From: support Date: Wed, 29 Jun 2022 15:27:40 +0000 (+0000) Subject: Built motion from commit 2aa87fa6.|2.6.11 X-Git-Url: http://repos.xcallymotion.com/base/%22https:/user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png//%22%27?a=commitdiff_plain;h=12557b829241bd4791a1efd2b1487c1c0f21865a;p=motion2.git Built motion from commit 2aa87fa6.|2.6.11 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index c183f5a..e0810d4 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-28T17:41:41.712Z", + "time": "2022-06-29T15:17:52.204Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 1850a6a..6a4fc39 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-28T17:41:41.712Z", + "time": "2022-06-29T15:17:52.204Z", "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 d5d40ea..f8ac274 100644 --- a/legacy-libs/gaxios/build/src/gaxios.js +++ b/legacy-libs/gaxios/build/src/gaxios.js @@ -1,5 +1,4 @@ "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 e853f1b..224f778 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": "6.4.2", - "from": "acorn@6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz" + "version": "5.7.1", + "from": "acorn@5.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz" }, "acorn-globals": { "version": "4.3.4", @@ -354,14 +354,7 @@ "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", - "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" - } - } + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz" }, "babel-types": { "version": "6.26.0", @@ -922,9 +915,9 @@ "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz" }, "core-js": { - "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" + "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" }, "core-util-is": { "version": "1.0.2", @@ -2459,11 +2452,6 @@ "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 40ed927..2465c10 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": "^6.4.2", + "acorn": "5.7.1", "activedirectory2": "2.1.0", "apiai-promise": "git+https://github.com/gcareri/apiai-promise.git", "archiver": "2.1.1", @@ -63,7 +63,6 @@ "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", @@ -156,6 +155,7 @@ "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 67c1168..e770602 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 _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 +var _0x886e=['urlForward[body]','sequelize','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0xc74312,_0x3d8ef0){var _0x3a9838=function(_0x49cfac){while(--_0x49cfac){_0xc74312['push'](_0xc74312['shift']());}};_0x3a9838(++_0x3d8ef0);}(_0x886e,0x157));var _0xe886=function(_0xdb7f25,_0x170636){_0xdb7f25=_0xdb7f25-0x0;var _0xce7457=_0x886e[_0xdb7f25];return _0xce7457;};'use strict';var Sequelize=require(_0xe886('0x0'));module['exports']={'name':{'type':Sequelize[_0xe886('0x1')],'get':function(_0x55e572){return this[_0xe886('0x2')](_0xe886('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xe886('0x4'),_0xe886('0x5'),_0xe886('0x6'),_0xe886('0x7'),_0xe886('0x8'),_0xe886('0x9'),_0xe886('0xa'),_0xe886('0xb')]],'msg':_0xe886('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xe886('0xd')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xe886('0xe')},'data3':{'type':Sequelize[_0xe886('0xd')](0x1000),'comment':_0xe886('0xf')},'data4':{'type':Sequelize[_0xe886('0xd')](0x1000),'comments':_0xe886('0x10')},'data5':{'type':Sequelize[_0xe886('0xd')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xe886('0xd')],'comments':_0xe886('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':_0xe886('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index fc943bc..eee7359 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 _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 +var _0x9d0e=['fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','then','destroy','error','stack','name','body','find','params','catch','zip-dir'];(function(_0x53d4dd,_0xabedc2){var _0x5d4700=function(_0x11e98c){while(--_0x11e98c){_0x53d4dd['push'](_0x53d4dd['shift']());}};_0x5d4700(++_0xabedc2);}(_0x9d0e,0x1cd));var _0xe9d0=function(_0x512bfc,_0x26f639){_0x512bfc=_0x512bfc-0x0;var _0x386bcc=_0x9d0e[_0x512bfc];return _0x386bcc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe9d0('0x0'));var jsonpatch=require(_0xe9d0('0x1'));var rp=require(_0xe9d0('0x2'));var moment=require('moment');var BPromise=require(_0xe9d0('0x3'));var Mustache=require(_0xe9d0('0x4'));var util=require('util');var path=require(_0xe9d0('0x5'));var sox=require(_0xe9d0('0x6'));var csv=require(_0xe9d0('0x7'));var ejs=require(_0xe9d0('0x8'));var fs=require('fs');var fs_extra=require(_0xe9d0('0x9'));var _=require(_0xe9d0('0xa'));var squel=require(_0xe9d0('0xb'));var crypto=require(_0xe9d0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9d0('0xd'));var toCsv=require(_0xe9d0('0x7'));var querystring=require(_0xe9d0('0xe'));var Papa=require(_0xe9d0('0xf'));var Redis=require(_0xe9d0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe9d0('0x11'));var as=require(_0xe9d0('0x12'));var hardwareService=require(_0xe9d0('0x13'));var logger=require('../../config/logger')(_0xe9d0('0x14'));var utils=require(_0xe9d0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe9d0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28de9e,_0xcb1d63){_0xcb1d63=_0xcb1d63||0xcc;return function(_0x45071b){if(_0x45071b){return _0x28de9e['sendStatus'](_0xcb1d63);}return _0x28de9e[_0xe9d0('0x17')](_0xcb1d63)[_0xe9d0('0x18')]();};}function respondWithResult(_0x10b9bd,_0x3266ab){_0x3266ab=_0x3266ab||0xc8;return function(_0x58f81b){if(_0x58f81b){return _0x10b9bd[_0xe9d0('0x17')](_0x3266ab)['json'](_0x58f81b);}};}function respondWithFilteredResult(_0x6d64f,_0x12f3c7){return function(_0x5bd829){if(_0x5bd829){var _0x584508=typeof _0x12f3c7[_0xe9d0('0x19')]===_0xe9d0('0x1a')&&typeof _0x12f3c7[_0xe9d0('0x1b')]===_0xe9d0('0x1a');var _0x2de380=_0x5bd829[_0xe9d0('0x1c')];var _0x25e433=_0x584508?0x0:_0x12f3c7[_0xe9d0('0x19')];var _0x5c6b65=_0x584508?_0x5bd829[_0xe9d0('0x1c')]:_0x12f3c7[_0xe9d0('0x19')]+_0x12f3c7[_0xe9d0('0x1b')];var _0x4ae0bd;if(_0x5c6b65>=_0x2de380){_0x5c6b65=_0x2de380;_0x4ae0bd=0xc8;}else{_0x4ae0bd=0xce;}_0x6d64f[_0xe9d0('0x17')](_0x4ae0bd);return _0x6d64f[_0xe9d0('0x1d')](_0xe9d0('0x1e'),_0x25e433+'-'+_0x5c6b65+'/'+_0x2de380)[_0xe9d0('0x1f')](_0x5bd829);}return null;};}function patchUpdates(_0x288b21){return function(_0x58bb1f){try{jsonpatch[_0xe9d0('0x20')](_0x58bb1f,_0x288b21,!![]);}catch(_0x4da68c){return BPromise['reject'](_0x4da68c);}return _0x58bb1f['save']();};}function saveUpdates(_0xcedbb7,_0x2d04fc){return function(_0x407e72){if(_0x407e72){return _0x407e72['update'](_0xcedbb7)[_0xe9d0('0x21')](function(_0x18c004){return _0x18c004;});}return null;};}function removeEntity(_0x1d8577,_0x547cc7){return function(_0x8f25c8){if(_0x8f25c8){return _0x8f25c8[_0xe9d0('0x22')]()[_0xe9d0('0x21')](function(){_0x1d8577[_0xe9d0('0x17')](0xcc)[_0xe9d0('0x18')]();});}};}function handleEntityNotFound(_0x24dc4e,_0x22cc74){return function(_0x57d855){if(!_0x57d855){_0x24dc4e['sendStatus'](0x194);}return _0x57d855;};}function handleError(_0x5681c8,_0x50e883){_0x50e883=_0x50e883||0x1f4;return function(_0x3ebf8f){logger[_0xe9d0('0x23')](_0x3ebf8f[_0xe9d0('0x24')]);if(_0x3ebf8f[_0xe9d0('0x25')]){delete _0x3ebf8f[_0xe9d0('0x25')];}_0x5681c8[_0xe9d0('0x17')](_0x50e883)['send'](_0x3ebf8f);};}exports['update']=function(_0x32c41c,_0xe07350){if(_0x32c41c[_0xe9d0('0x26')]['id']){delete _0x32c41c['body']['id'];}return db['Action'][_0xe9d0('0x27')]({'where':{'id':_0x32c41c[_0xe9d0('0x28')]['id']}})[_0xe9d0('0x21')](handleEntityNotFound(_0xe07350,null))[_0xe9d0('0x21')](saveUpdates(_0x32c41c[_0xe9d0('0x26')],null))[_0xe9d0('0x21')](respondWithResult(_0xe07350,null))[_0xe9d0('0x29')](handleError(_0xe07350,null));};exports['destroy']=function(_0x33353a,_0x293b20){return db['Action'][_0xe9d0('0x27')]({'where':{'id':_0x33353a[_0xe9d0('0x28')]['id']}})[_0xe9d0('0x21')](handleEntityNotFound(_0x293b20,null))[_0xe9d0('0x21')](removeEntity(_0x293b20,null))['catch'](handleError(_0x293b20,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 1a3fc70..1d242a4 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 _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 +var _0x2be2=['bluebird','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','api'];(function(_0x3219f9,_0x31182b){var _0x194d4c=function(_0x27ca41){while(--_0x27ca41){_0x3219f9['push'](_0x3219f9['shift']());}};_0x194d4c(++_0x31182b);}(_0x2be2,0x129));var _0x22be=function(_0xde4150,_0x5ca59d){_0xde4150=_0xde4150-0x0;var _0x31f571=_0x2be2[_0xde4150];return _0x31f571;};'use strict';var _=require(_0x22be('0x0'));var util=require(_0x22be('0x1'));var logger=require('../../config/logger')(_0x22be('0x2'));var moment=require('moment');var BPromise=require(_0x22be('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x22be('0x4'));var rimraf=require(_0x22be('0x5'));var config=require(_0x22be('0x6'));var attributes=require(_0x22be('0x7'));module[_0x22be('0x8')]=function(_0x4fb41e,_0x19ea2f){return _0x4fb41e[_0x22be('0x9')](_0x22be('0xa'),attributes,{'tableName':_0x22be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 0ee0cd1..0fb427f 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 _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 +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x51c726,_0x332b95){var _0x23fe86=function(_0x3145c8){while(--_0x3145c8){_0x51c726['push'](_0x51c726['shift']());}};_0x23fe86(++_0x332b95);}(_0x5fab,0x177));var _0xb5fa=function(_0x192cbe,_0x3b4b43){_0x192cbe=_0x192cbe-0x0;var _0x4ce395=_0x5fab[_0x192cbe];return _0x4ce395;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index ba91f81..78405b9 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 _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 +var _0x0a7e=['exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy'];(function(_0x4303e1,_0x492c81){var _0x548ec9=function(_0x26e6c3){while(--_0x26e6c3){_0x4303e1['push'](_0x4303e1['shift']());}};_0x548ec9(++_0x492c81);}(_0x0a7e,0x1f0));var _0xe0a7=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x0a7e[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xe0a7('0x0'));var util=require(_0xe0a7('0x1'));var path=require(_0xe0a7('0x2'));var timeout=require('connect-timeout');var express=require(_0xe0a7('0x3'));var router=express['Router']();var fs_extra=require(_0xe0a7('0x4'));var auth=require(_0xe0a7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe0a7('0x6'));var controller=require(_0xe0a7('0x7'));router[_0xe0a7('0x8')](_0xe0a7('0x9'),auth[_0xe0a7('0xa')](),controller[_0xe0a7('0xb')]);router[_0xe0a7('0xc')](_0xe0a7('0x9'),auth[_0xe0a7('0xa')](),controller[_0xe0a7('0xd')]);module[_0xe0a7('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 1485949..00f9e59 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 _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 +var _0x7217=['sequelize','STRING','TEXT'];(function(_0x315b20,_0x38ff12){var _0x3503c8=function(_0x3e9f9c){while(--_0x3e9f9c){_0x315b20['push'](_0x315b20['shift']());}};_0x3503c8(++_0x38ff12);}(_0x7217,0x19e));var _0x7721=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x7217[_0x481bf7];return _0x461787;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index cde35bf..f4313af 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 _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 +var _0xb477=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','set','json','apply','reject','save','update','then','destroy','get','CustomReports','error','stack','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','offset','order','sort','filter','merge','where','AnalyticCustomReport','count','includeAll','include','findAll','rows','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','MAX(%s)','AVG(%s)','keyBy','metric','clone','web','%s-%s.%s','generate','output','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','COUNT(*)','run','runReport','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20NULL','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3ed01b,_0x388890){var _0x59170b=function(_0x278185){while(--_0x278185){_0x3ed01b['push'](_0x3ed01b['shift']());}};_0x59170b(++_0x388890);}(_0xb477,0x8f));var _0x7b47=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xb477[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b47('0x0'));var zipdir=require(_0x7b47('0x1'));var jsonpatch=require(_0x7b47('0x2'));var rp=require('request-promise');var moment=require(_0x7b47('0x3'));var BPromise=require(_0x7b47('0x4'));var Mustache=require(_0x7b47('0x5'));var util=require('util');var path=require(_0x7b47('0x6'));var sox=require(_0x7b47('0x7'));var csv=require(_0x7b47('0x8'));var ejs=require(_0x7b47('0x9'));var fs=require('fs');var fs_extra=require(_0x7b47('0xa'));var _=require('lodash');var squel=require(_0x7b47('0xb'));var crypto=require(_0x7b47('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7b47('0xd'));var toCsv=require(_0x7b47('0x8'));var querystring=require(_0x7b47('0xe'));var Papa=require(_0x7b47('0xf'));var Redis=require(_0x7b47('0x10'));var authService=require(_0x7b47('0x11'));var qs=require(_0x7b47('0x12'));var as=require(_0x7b47('0x13'));var hardwareService=require(_0x7b47('0x14'));var logger=require(_0x7b47('0x15'))(_0x7b47('0x16'));var utils=require(_0x7b47('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7b47('0x18'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x1e4e3d,_0x201a9e){_0x201a9e=_0x201a9e||0xcc;return function(_0x55f8e0){if(_0x55f8e0){return _0x1e4e3d[_0x7b47('0x19')](_0x201a9e);}return _0x1e4e3d[_0x7b47('0x1a')](_0x201a9e)[_0x7b47('0x1b')]();};}function respondWithResult(_0x5923fd,_0x3e3ef3){_0x3e3ef3=_0x3e3ef3||0xc8;return function(_0x227cca){if(_0x227cca){return _0x5923fd[_0x7b47('0x1a')](_0x3e3ef3)['json'](_0x227cca);}};}function respondWithFilteredResult(_0x11be4f,_0x124db3){return function(_0x379182){if(_0x379182){var _0x283cd2=typeof _0x124db3['offset']===_0x7b47('0x1c')&&typeof _0x124db3[_0x7b47('0x1d')]===_0x7b47('0x1c');var _0x1f5972=_0x379182['count'];var _0x2ba858=_0x283cd2?0x0:_0x124db3['offset'];var _0x13e959=_0x283cd2?_0x379182['count']:_0x124db3['offset']+_0x124db3['limit'];var _0x13c673;if(_0x13e959>=_0x1f5972){_0x13e959=_0x1f5972;_0x13c673=0xc8;}else{_0x13c673=0xce;}_0x11be4f['status'](_0x13c673);return _0x11be4f[_0x7b47('0x1e')]('Content-Range',_0x2ba858+'-'+_0x13e959+'/'+_0x1f5972)[_0x7b47('0x1f')](_0x379182);}return null;};}function patchUpdates(_0x443333){return function(_0x57a2a2){try{jsonpatch[_0x7b47('0x20')](_0x57a2a2,_0x443333,!![]);}catch(_0x13f121){return BPromise[_0x7b47('0x21')](_0x13f121);}return _0x57a2a2[_0x7b47('0x22')]();};}function saveUpdates(_0x2e6a15,_0x4555d0){return function(_0x2176b0){if(_0x2176b0){return _0x2176b0[_0x7b47('0x23')](_0x2e6a15)[_0x7b47('0x24')](function(_0x56886b){return _0x56886b;});}return null;};}function removeEntity(_0x9aedc8,_0x13b56f){return function(_0xcfc6c8){if(_0xcfc6c8){return _0xcfc6c8[_0x7b47('0x25')]()[_0x7b47('0x24')](function(){var _0x2f960d=_0xcfc6c8[_0x7b47('0x26')]({'plain':!![]});var _0x9db41f=_0x7b47('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x9db41f,'resourceId':_0x2f960d['id']}})['then'](function(){return _0xcfc6c8;});})['then'](function(){_0x9aedc8[_0x7b47('0x1a')](0xcc)[_0x7b47('0x1b')]();});}};}function handleEntityNotFound(_0x1ea575,_0x331229){return function(_0x5705e2){if(!_0x5705e2){_0x1ea575[_0x7b47('0x19')](0x194);}return _0x5705e2;};}function handleError(_0x285e12,_0x107953){_0x107953=_0x107953||0x1f4;return function(_0xc291c1){logger[_0x7b47('0x28')](_0xc291c1[_0x7b47('0x29')]);if(_0xc291c1[_0x7b47('0x2a')]){delete _0xc291c1[_0x7b47('0x2a')];}_0x285e12[_0x7b47('0x1a')](_0x107953)['send'](_0xc291c1);};}exports['index']=function(_0x592b98,_0x345016){var _0xd56a68={},_0x469970={},_0x102d32={'count':0x0,'rows':[]};var _0x3ceafc=_[_0x7b47('0x2b')](db['AnalyticCustomReport'][_0x7b47('0x2c')],function(_0x136811){return{'name':_0x136811[_0x7b47('0x2d')],'type':_0x136811[_0x7b47('0x2e')]['key']};});_0x469970[_0x7b47('0x2f')]=_[_0x7b47('0x2b')](_0x3ceafc,'name');_0x469970[_0x7b47('0x30')]=_[_0x7b47('0x31')](_0x592b98[_0x7b47('0x30')]);_0x469970[_0x7b47('0x32')]=_[_0x7b47('0x33')](_0x469970[_0x7b47('0x2f')],_0x469970[_0x7b47('0x30')]);_0xd56a68['attributes']=_['intersection'](_0x469970[_0x7b47('0x2f')],qs['fields'](_0x592b98[_0x7b47('0x30')][_0x7b47('0x34')]));_0xd56a68[_0x7b47('0x35')]=_0xd56a68[_0x7b47('0x35')][_0x7b47('0x36')]?_0xd56a68[_0x7b47('0x35')]:_0x469970[_0x7b47('0x2f')];if(!_0x592b98['query'][_0x7b47('0x37')]('nolimit')){_0xd56a68['limit']=qs[_0x7b47('0x1d')](_0x592b98[_0x7b47('0x30')]['limit']);_0xd56a68[_0x7b47('0x38')]=qs[_0x7b47('0x38')](_0x592b98[_0x7b47('0x30')][_0x7b47('0x38')]);}_0xd56a68[_0x7b47('0x39')]=qs[_0x7b47('0x3a')](_0x592b98[_0x7b47('0x30')][_0x7b47('0x3a')]);_0xd56a68['where']=qs[_0x7b47('0x32')](_['pick'](_0x592b98[_0x7b47('0x30')],_0x469970[_0x7b47('0x32')]),_0x3ceafc);if(_0x592b98[_0x7b47('0x30')][_0x7b47('0x3b')]){_0xd56a68['where']=_[_0x7b47('0x3c')](_0xd56a68[_0x7b47('0x3d')],{'$or':_[_0x7b47('0x2b')](_0x3ceafc,function(_0x4018d2){if(_0x4018d2[_0x7b47('0x2e')]!=='VIRTUAL'){var _0x4823fd={};_0x4823fd[_0x4018d2['name']]={'$like':'%'+_0x592b98['query'][_0x7b47('0x3b')]+'%'};return _0x4823fd;}})});}_0xd56a68=_[_0x7b47('0x3c')]({},_0xd56a68,_0x592b98['options']);var _0x918d84={'where':_0xd56a68[_0x7b47('0x3d')]};return db[_0x7b47('0x3e')][_0x7b47('0x3f')](_0x918d84)[_0x7b47('0x24')](function(_0x4f659b){_0x102d32[_0x7b47('0x3f')]=_0x4f659b;if(_0x592b98['query'][_0x7b47('0x40')]){_0xd56a68[_0x7b47('0x41')]=[{'all':!![]}];}return db[_0x7b47('0x3e')][_0x7b47('0x42')](_0xd56a68);})[_0x7b47('0x24')](function(_0x155c21){_0x102d32[_0x7b47('0x43')]=_0x155c21;return _0x102d32;})[_0x7b47('0x24')](respondWithFilteredResult(_0x345016,_0xd56a68))['catch'](handleError(_0x345016,null));};exports[_0x7b47('0x44')]=function(_0x98c66d,_0x125a1e){var _0x58ff30={'raw':![],'where':{'id':_0x98c66d[_0x7b47('0x45')]['id']}},_0xca5375={};_0xca5375[_0x7b47('0x2f')]=_[_0x7b47('0x31')](db['AnalyticCustomReport'][_0x7b47('0x2c')]);_0xca5375[_0x7b47('0x30')]=_[_0x7b47('0x31')](_0x98c66d['query']);_0xca5375[_0x7b47('0x32')]=_[_0x7b47('0x33')](_0xca5375[_0x7b47('0x2f')],_0xca5375['query']);_0x58ff30[_0x7b47('0x35')]=_[_0x7b47('0x33')](_0xca5375[_0x7b47('0x2f')],qs[_0x7b47('0x34')](_0x98c66d[_0x7b47('0x30')][_0x7b47('0x34')]));_0x58ff30[_0x7b47('0x35')]=_0x58ff30['attributes'][_0x7b47('0x36')]?_0x58ff30[_0x7b47('0x35')]:_0xca5375['model'];if(_0x98c66d[_0x7b47('0x30')][_0x7b47('0x40')]){_0x58ff30[_0x7b47('0x41')]=[{'all':!![]}];}_0x58ff30=_['merge']({},_0x58ff30,_0x98c66d[_0x7b47('0x46')]);return db[_0x7b47('0x3e')][_0x7b47('0x47')](_0x58ff30)['then'](handleEntityNotFound(_0x125a1e,null))[_0x7b47('0x24')](respondWithResult(_0x125a1e,null))['catch'](handleError(_0x125a1e,null));};exports[_0x7b47('0x48')]=function(_0x2662dc,_0x2dd796){return db[_0x7b47('0x3e')]['create'](_0x2662dc[_0x7b47('0x49')],{})['then'](function(_0x12d170){var _0x5079b0=_0x2662dc[_0x7b47('0x4a')][_0x7b47('0x26')]({'plain':!![]});if(!_0x5079b0)throw new Error(_0x7b47('0x4b'));if(_0x5079b0['role']===_0x7b47('0x4a')){var _0x1e2dc8=_0x12d170[_0x7b47('0x26')]({'plain':!![]});var _0x5b3352='Reports';return db['UserProfileSection'][_0x7b47('0x47')]({'where':{'name':_0x5b3352,'userProfileId':_0x5079b0['userProfileId']},'raw':!![]})[_0x7b47('0x24')](function(_0x3a8d37){if(_0x3a8d37&&_0x3a8d37[_0x7b47('0x4c')]===0x0){return db[_0x7b47('0x4d')]['create']({'name':_0x1e2dc8['name'],'resourceId':_0x1e2dc8['id'],'type':_0x7b47('0x27'),'sectionId':_0x3a8d37['id']},{})['then'](function(){return _0x12d170;});}else{return _0x12d170;}})[_0x7b47('0x4e')](function(_0x39d811){logger[_0x7b47('0x28')](_0x7b47('0x4f'),_0x39d811);throw _0x39d811;});}return _0x12d170;})[_0x7b47('0x24')](respondWithResult(_0x2dd796,0xc9))[_0x7b47('0x4e')](handleError(_0x2dd796,null));};exports[_0x7b47('0x23')]=function(_0x3d2953,_0x42bdef){if(_0x3d2953['body']['id']){delete _0x3d2953[_0x7b47('0x49')]['id'];}return db[_0x7b47('0x3e')][_0x7b47('0x47')]({'where':{'id':_0x3d2953[_0x7b47('0x45')]['id']}})[_0x7b47('0x24')](handleEntityNotFound(_0x42bdef,null))[_0x7b47('0x24')](saveUpdates(_0x3d2953['body'],null))[_0x7b47('0x24')](respondWithResult(_0x42bdef,null))[_0x7b47('0x4e')](handleError(_0x42bdef,null));};exports[_0x7b47('0x25')]=function(_0x462cf0,_0x2402eb){return db[_0x7b47('0x3e')][_0x7b47('0x47')]({'where':{'id':_0x462cf0[_0x7b47('0x45')]['id']}})['then'](handleEntityNotFound(_0x2402eb,null))[_0x7b47('0x24')](removeEntity(_0x2402eb,null))[_0x7b47('0x4e')](handleError(_0x2402eb,null));};exports['preview']=function(_0x483a13,_0x33449b){var _0x3d3421=0xa;var _0x354511=[_0x7b47('0x50'),_0x7b47('0x51'),_0x7b47('0x52'),'cross_join'];var _0x50e059={'SUM':_0x7b47('0x53'),'COUNT':_0x7b47('0x54'),'COUNT DISTINCT':_0x7b47('0x55'),'MAX':'MAX(%s)','MIN':_0x7b47('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7b47('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1bc631={'SEC_TO_TIME':_0x7b47('0x58'),'DATE':_0x7b47('0x59'),'HOUR':_0x7b47('0x5a'),'ROUND':_0x7b47('0x5b'),'UNIX_TIMESTAMP':_0x7b47('0x5c')};var _0x1379a6=function(_0x493a65){return!_[_0x7b47('0x5d')]([_0x7b47('0x5e'),'IS\x20NOT\x20NULL',_0x7b47('0x5f'),_0x7b47('0x60')],_0x493a65);};var _0x25bdc3=function(_0x5cdca6){if(!_0x5cdca6||!_0x5cdca6[_0x7b47('0x61')][_0x7b47('0x36')]){return'';}for(var _0x120066='(',_0x5d6458=0x0;_0x5d6458<_0x5cdca6['rules'][_0x7b47('0x36')];_0x5d6458+=0x1){_0x5d6458>0x0&&(_0x120066+='\x20'+_0x5cdca6[_0x7b47('0x62')]+'\x20');_0x120066+=_0x5cdca6['rules'][_0x5d6458][_0x7b47('0x63')]?_0x25bdc3(_0x5cdca6['rules'][_0x5d6458]['group']):_0x5cdca6[_0x7b47('0x61')][_0x5d6458]['field']+'\x20'+_0x5cdca6[_0x7b47('0x61')][_0x5d6458]['condition']+(_0x1379a6(_0x5cdca6[_0x7b47('0x61')][_0x5d6458][_0x7b47('0x64')])?'\x20'+_0x5cdca6[_0x7b47('0x61')][_0x5d6458][_0x7b47('0x65')]:'');}return _0x120066+')';};var _0x4fe891={'where':{'id':_0x483a13['params']['id']}},_0x5b7537,_0x9b8b5e,_0x15c30a,_0x3b40bc,_0x54dfe5;_0x4fe891=_[_0x7b47('0x3c')]({},_0x4fe891,_0x483a13[_0x7b47('0x46')]);return db[_0x7b47('0x3e')][_0x7b47('0x47')](_0x4fe891)[_0x7b47('0x24')](function(_0x54c437){if(_0x54c437){_0x5b7537=_0x54c437;return _0x54c437[_0x7b47('0x66')]();}return null;})['then'](function(_0x23f36b){if(_0x23f36b){if(!_0x23f36b[_0x7b47('0x36')]){throw new db[(_0x7b47('0x67'))][(_0x7b47('0x68'))](_0x7b47('0x69'),0x193);}_0x9b8b5e=_0x23f36b;return db[_0x7b47('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x7b47('0x24')](function(_0x459cb5){if(_0x459cb5){_0x15c30a=_['keyBy'](_0x459cb5,'id');var _0x41dc89;var _0x3d81b6=squel[_0x7b47('0x6b')]();_0x3d81b6[_0x7b47('0x6c')](_0x5b7537[_0x7b47('0x6d')]);for(var _0x5919eb=0x0;_0x5919eb<_0x9b8b5e[_0x7b47('0x36')];_0x5919eb+=0x1){_0x41dc89=_0x9b8b5e[_0x5919eb][_0x7b47('0x6e')]?_0x15c30a[_0x9b8b5e[_0x5919eb]['MetricId']]['metric']:_0x9b8b5e[_0x5919eb][_0x7b47('0x6f')];_0x41dc89=_0x9b8b5e[_0x5919eb][_0x7b47('0x70')]?_[_0x7b47('0x71')](_0x50e059[_0x9b8b5e[_0x5919eb][_0x7b47('0x70')]],'%s',_0x41dc89):_0x41dc89;_0x41dc89=_0x9b8b5e[_0x5919eb][_0x7b47('0x72')]?_[_0x7b47('0x71')](_0x1bc631[_0x9b8b5e[_0x5919eb][_0x7b47('0x72')]],'%s',_0x41dc89):_0x41dc89;if(_0x9b8b5e[_0x5919eb][_0x7b47('0x73')]){_0x3d81b6['group'](_0x41dc89);}_0x9b8b5e[_0x5919eb][_0x7b47('0x74')]&&_0x3d81b6[_0x7b47('0x39')](_0x41dc89,_0x9b8b5e[_0x5919eb][_0x7b47('0x74')]===_0x7b47('0x75')?![]:!![]);_0x3d81b6[_0x7b47('0x6f')](_0x41dc89,_0x9b8b5e[_0x5919eb][_0x7b47('0x76')]||_0x41dc89);}if(_0x5b7537['joins']){_0x5b7537[_0x7b47('0x77')]=JSON[_0x7b47('0x78')](_0x5b7537[_0x7b47('0x77')]);for(var _0x4e553b=0x0;_0x4e553b<_0x5b7537['joins'][_0x7b47('0x36')];_0x4e553b+=0x1){if(_0x5b7537[_0x7b47('0x77')][_0x4e553b][_0x7b47('0x2e')]&&_[_0x7b47('0x5d')](_0x354511,_0x5b7537[_0x7b47('0x77')][_0x4e553b][_0x7b47('0x2e')])&&_0x5b7537[_0x7b47('0x77')][_0x4e553b][_0x7b47('0x79')]&&_0x5b7537[_0x7b47('0x77')][_0x4e553b]['foreignTable']&&_0x5b7537[_0x7b47('0x77')][_0x4e553b][_0x7b47('0x7a')]){_0x3d81b6[_0x5b7537[_0x7b47('0x77')][_0x4e553b]['type']](_0x5b7537[_0x7b47('0x77')][_0x4e553b][_0x7b47('0x7b')],null,util[_0x7b47('0x72')](_0x7b47('0x7c'),_0x5b7537[_0x7b47('0x6d')],_0x5b7537[_0x7b47('0x77')][_0x4e553b]['parentKey'],_0x5b7537[_0x7b47('0x77')][_0x4e553b][_0x7b47('0x7b')],_0x5b7537['joins'][_0x4e553b][_0x7b47('0x7a')]));}}}if(_0x5b7537[_0x7b47('0x7d')]){_0x5b7537['conditions']=JSON['parse'](_0x5b7537[_0x7b47('0x7d')]);_0x3d81b6['where'](_0x25bdc3(_0x5b7537['conditions'][_0x7b47('0x63')]));}_0x54dfe5=_0x3d81b6['clone']();_0x3d81b6[_0x7b47('0x1d')](_0x3d3421);_0x3d81b6[_0x7b47('0x38')](0x0);logger[_0x7b47('0x7e')](_0x7b47('0x7f'),_0x3d81b6[_0x7b47('0x80')]());return dbH[_0x7b47('0x81')][_0x7b47('0x30')](_0x3d81b6['toString'](),{'type':dbH[_0x7b47('0x81')][_0x7b47('0x82')][_0x7b47('0x83')]});}})[_0x7b47('0x24')](respondWithResult(_0x33449b,null))[_0x7b47('0x4e')](handleError(_0x33449b,null));};function runReport(_0x13e4db,_0x593c7e,_0x18794a){var _0x15f5eb=_0x593c7e[_0x7b47('0x2a')];var _0x29a7a3=0xa;var _0x27de31=[_0x7b47('0x50'),_0x7b47('0x51'),'right_join',_0x7b47('0x84')];var _0x426ee2={'SUM':_0x7b47('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7b47('0x55'),'MAX':_0x7b47('0x85'),'MIN':_0x7b47('0x56'),'AVG':_0x7b47('0x86'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7b47('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x569e3c={'SEC_TO_TIME':_0x7b47('0x58'),'DATE':_0x7b47('0x59'),'HOUR':_0x7b47('0x5a'),'ROUND':_0x7b47('0x5b'),'UNIX_TIMESTAMP':_0x7b47('0x5c')};var _0x1cbf78=function(_0x1fee6f){return!_[_0x7b47('0x5d')]([_0x7b47('0x5e'),'IS\x20NOT\x20NULL',_0x7b47('0x5f'),_0x7b47('0x60')],_0x1fee6f);};var _0x3b5809=function(_0x5dca3a){if(!_0x5dca3a||!_0x5dca3a[_0x7b47('0x61')][_0x7b47('0x36')]){return'';}for(var _0x36d138='(',_0x5a630f=0x0;_0x5a630f<_0x5dca3a[_0x7b47('0x61')][_0x7b47('0x36')];_0x5a630f+=0x1){_0x5a630f>0x0&&(_0x36d138+='\x20'+_0x5dca3a[_0x7b47('0x62')]+'\x20');_0x36d138+=_0x5dca3a[_0x7b47('0x61')][_0x5a630f]['group']?_0x3b5809(_0x5dca3a['rules'][_0x5a630f][_0x7b47('0x63')]):_0x5dca3a['rules'][_0x5a630f]['field']+'\x20'+_0x5dca3a[_0x7b47('0x61')][_0x5a630f][_0x7b47('0x64')]+(_0x1cbf78(_0x5dca3a['rules'][_0x5a630f][_0x7b47('0x64')])?'\x20'+_0x5dca3a[_0x7b47('0x61')][_0x5a630f][_0x7b47('0x65')]:'');}return _0x36d138+')';};var _0x55810e={'where':{'id':_0x13e4db['id']}},_0xf3cbea,_0x58e458,_0x166ce2,_0x5bf97e,_0x5b6a92;_0x55810e=_[_0x7b47('0x3c')]({},_0x55810e,_0x18794a);return db['AnalyticCustomReport'][_0x7b47('0x47')](_0x55810e)[_0x7b47('0x24')](function(_0x3a4128){if(_0x3a4128){_0xf3cbea=_0x3a4128;return _0x3a4128[_0x7b47('0x66')]();}return null;})[_0x7b47('0x24')](function(_0x5bda28){if(_0x5bda28){if(!_0x5bda28[_0x7b47('0x36')]){throw new db[(_0x7b47('0x67'))][(_0x7b47('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x58e458=_0x5bda28;return db[_0x7b47('0x6a')][_0x7b47('0x42')]({'raw':!![]});}return null;})[_0x7b47('0x24')](function(_0x44aa9f){if(_0x44aa9f){_0x166ce2=_[_0x7b47('0x87')](_0x44aa9f,'id');var _0x43dcd1;var _0x3c6584=squel['select']();_0x3c6584[_0x7b47('0x6c')](_0xf3cbea[_0x7b47('0x6d')]);for(var _0x1c169e=0x0;_0x1c169e<_0x58e458[_0x7b47('0x36')];_0x1c169e+=0x1){_0x43dcd1=_0x58e458[_0x1c169e][_0x7b47('0x6e')]?_0x166ce2[_0x58e458[_0x1c169e][_0x7b47('0x6e')]][_0x7b47('0x88')]:_0x58e458[_0x1c169e][_0x7b47('0x6f')];_0x43dcd1=_0x58e458[_0x1c169e][_0x7b47('0x70')]?_['replace'](_0x426ee2[_0x58e458[_0x1c169e][_0x7b47('0x70')]],'%s',_0x43dcd1):_0x43dcd1;_0x43dcd1=_0x58e458[_0x1c169e]['format']?_['replace'](_0x569e3c[_0x58e458[_0x1c169e][_0x7b47('0x72')]],'%s',_0x43dcd1):_0x43dcd1;if(_0x58e458[_0x1c169e][_0x7b47('0x73')]){_0x3c6584['group'](_0x43dcd1);}_0x58e458[_0x1c169e][_0x7b47('0x74')]&&_0x3c6584[_0x7b47('0x39')](_0x43dcd1,_0x58e458[_0x1c169e][_0x7b47('0x74')]===_0x7b47('0x75')?![]:!![]);_0x3c6584[_0x7b47('0x6f')](_0x43dcd1,_0x58e458[_0x1c169e]['alias']||_0x43dcd1);}if(_0xf3cbea[_0x7b47('0x77')]){_0xf3cbea['joins']=JSON['parse'](_0xf3cbea[_0x7b47('0x77')]);for(var _0x53dce4=0x0;_0x53dce4<_0xf3cbea[_0x7b47('0x77')][_0x7b47('0x36')];_0x53dce4+=0x1){if(_0xf3cbea['joins'][_0x53dce4][_0x7b47('0x2e')]&&_['includes'](_0x27de31,_0xf3cbea[_0x7b47('0x77')][_0x53dce4][_0x7b47('0x2e')])&&_0xf3cbea['joins'][_0x53dce4][_0x7b47('0x79')]&&_0xf3cbea[_0x7b47('0x77')][_0x53dce4][_0x7b47('0x7b')]&&_0xf3cbea[_0x7b47('0x77')][_0x53dce4]['foreignKey']){_0x3c6584[_0xf3cbea[_0x7b47('0x77')][_0x53dce4][_0x7b47('0x2e')]](_0xf3cbea[_0x7b47('0x77')][_0x53dce4][_0x7b47('0x7b')],null,util['format'](_0x7b47('0x7c'),_0xf3cbea[_0x7b47('0x6d')],_0xf3cbea[_0x7b47('0x77')][_0x53dce4]['parentKey'],_0xf3cbea[_0x7b47('0x77')][_0x53dce4][_0x7b47('0x7b')],_0xf3cbea[_0x7b47('0x77')][_0x53dce4]['foreignKey']));}}}if(_0xf3cbea['conditions']){_0xf3cbea[_0x7b47('0x7d')]=JSON[_0x7b47('0x78')](_0xf3cbea['conditions']);_0x3c6584[_0x7b47('0x3d')](_0x3b5809(_0xf3cbea[_0x7b47('0x7d')][_0x7b47('0x63')]));}_0x5b6a92=_0x3c6584[_0x7b47('0x89')]();_0x3c6584[_0x7b47('0x1d')](_0x29a7a3);_0x3c6584[_0x7b47('0x38')](0x0);return;}})['then'](function(){if(_0x593c7e['output']===_0x7b47('0x8a')){return null;}var _0x470e16=_['merge'](_0x593c7e,{'name':_0x593c7e['fullPath']||_0x593c7e[_0x7b47('0x2a')]||_0xf3cbea[_0x7b47('0x2a')],'basename':_0x15f5eb,'savename':util[_0x7b47('0x72')](_0x7b47('0x8b'),_0x593c7e[_0x7b47('0x2a')]||_0xf3cbea[_0x7b47('0x2a')],require('randomstring')[_0x7b47('0x8c')](0x4),_0x593c7e[_0x7b47('0x8d')]||_0x7b47('0x8e')),'reportId':_0xf3cbea['id'],'reportType':_0x7b47('0x8f')});return db[_0x7b47('0x90')]['create'](_0x470e16,{'raw':!![]});})['then'](function(_0x1e7bfc){if(_0xf3cbea[_0x7b47('0x6d')]===_0x7b47('0x91')){_0x5b6a92['where'](_0xf3cbea[_0x7b47('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x593c7e[_0x7b47('0x92')],_0x593c7e['endDate']);}else{_0x5b6a92[_0x7b47('0x3d')](_0xf3cbea[_0x7b47('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x593c7e[_0x7b47('0x92')],_0x593c7e[_0x7b47('0x93')]);}if(_0x1e7bfc){logger[_0x7b47('0x94')](_0x7b47('0x95'),_0x5b6a92['toString']());require(_0x7b47('0x96'))[_0x7b47('0x97')](path[_0x7b47('0x50')](__dirname,_0x7b47('0x98'),_0x1e7bfc[_0x7b47('0x8d')]),[_0x1e7bfc['id'],_0x5b6a92[_0x7b47('0x80')](),path[_0x7b47('0x50')](__dirname,_0x7b47('0x99'),_0x1e7bfc[_0x7b47('0x9a')]),_0x15f5eb]);return _0x1e7bfc;}else{var _0x57dd50=squel[_0x7b47('0x6b')]();_0x57dd50[_0x7b47('0x6c')]('('+_0x5b6a92[_0x7b47('0x80')]()+')','countTable');_0x57dd50[_0x7b47('0x6f')](_0x7b47('0x9b'),_0x7b47('0x3f'));_0x5b6a92['limit'](_0x593c7e['limit']||_0x29a7a3);_0x5b6a92[_0x7b47('0x38')](_0x593c7e[_0x7b47('0x38')]||0x0);return dbH[_0x7b47('0x81')][_0x7b47('0x30')](_0x57dd50[_0x7b47('0x80')](),{'type':dbH['sequelize'][_0x7b47('0x82')]['SELECT']})['then'](function(_0x38f07a){if(!_0x38f07a[_0x7b47('0x36')]){_0x5bf97e=0x0;}else{_0x5bf97e=_0x38f07a[0x0][_0x7b47('0x3f')]||0x0;}return dbH['sequelize']['query'](_0x5b6a92[_0x7b47('0x80')](),{'type':dbH[_0x7b47('0x81')][_0x7b47('0x82')]['SELECT']});})[_0x7b47('0x24')](function(_0x3bf3a0){return{'rows':_0x3bf3a0||[],'count':_0x5bf97e};});}});}exports[_0x7b47('0x9c')]=function(_0x25053f,_0x5194cb){return runReport(_0x25053f[_0x7b47('0x45')],_0x25053f[_0x7b47('0x30')],_0x25053f[_0x7b47('0x46')])[_0x7b47('0x24')](respondWithResult(_0x5194cb,null))[_0x7b47('0x4e')](handleError(_0x5194cb,null));};exports[_0x7b47('0x9d')]=runReport;exports[_0x7b47('0x30')]=function(_0x451b0b,_0xfe194e){var _0x1e0d76=0xa;var _0x28913c=[_0x7b47('0x50'),_0x7b47('0x51'),'right_join','cross_join'];var _0x5ce728={'SUM':_0x7b47('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7b47('0x55'),'MAX':_0x7b47('0x85'),'MIN':'MIN(%s)','AVG':_0x7b47('0x86'),'GROUP_CONCAT':_0x7b47('0x9e'),'GROUP_CONCAT ASC':_0x7b47('0x57'),'GROUP_CONCAT DESC':_0x7b47('0x9f')};var _0x38ea40={'SEC_TO_TIME':_0x7b47('0x58'),'DATE':_0x7b47('0x59'),'HOUR':'HOUR(%s)','ROUND':_0x7b47('0x5b'),'UNIX_TIMESTAMP':_0x7b47('0x5c')};var _0x5567c6=function(_0xe5c35b){return!_[_0x7b47('0x5d')]([_0x7b47('0x5e'),_0x7b47('0xa0'),_0x7b47('0x5f'),_0x7b47('0x60')],_0xe5c35b);};var _0x51e2d8=function(_0x4df3f6){if(!_0x4df3f6||!_0x4df3f6['rules'][_0x7b47('0x36')]){return'';}for(var _0x2a0025='(',_0x92d807=0x0;_0x92d807<_0x4df3f6[_0x7b47('0x61')][_0x7b47('0x36')];_0x92d807+=0x1){_0x92d807>0x0&&(_0x2a0025+='\x20'+_0x4df3f6['operator']+'\x20');_0x2a0025+=_0x4df3f6[_0x7b47('0x61')][_0x92d807][_0x7b47('0x63')]?_0x51e2d8(_0x4df3f6[_0x7b47('0x61')][_0x92d807][_0x7b47('0x63')]):_0x4df3f6[_0x7b47('0x61')][_0x92d807][_0x7b47('0x6f')]+'\x20'+_0x4df3f6[_0x7b47('0x61')][_0x92d807][_0x7b47('0x64')]+(_0x5567c6(_0x4df3f6[_0x7b47('0x61')][_0x92d807][_0x7b47('0x64')])?'\x20'+_0x4df3f6[_0x7b47('0x61')][_0x92d807][_0x7b47('0x65')]:'');}return _0x2a0025+')';};var _0x45f31f={'where':{'id':_0x451b0b[_0x7b47('0x45')]['id']}},_0x222933,_0x5d8e86,_0xa673f,_0x5088ce,_0x19319e;_0x45f31f=_[_0x7b47('0x3c')]({},_0x45f31f,_0x451b0b['options']);return db[_0x7b47('0x3e')][_0x7b47('0x47')](_0x45f31f)['then'](function(_0x4004c5){if(_0x4004c5){_0x222933=_0x4004c5;return _0x4004c5['getFields']();}return null;})[_0x7b47('0x24')](function(_0x45f8b3){if(_0x45f8b3){if(!_0x45f8b3[_0x7b47('0x36')]){throw new db[(_0x7b47('0x67'))][(_0x7b47('0x68'))](_0x7b47('0x69'),0x193);}_0x5d8e86=_0x45f8b3;return db['AnalyticMetric'][_0x7b47('0x42')]({'raw':!![]});}return null;})[_0x7b47('0x24')](function(_0x221d6f){if(_0x221d6f){_0xa673f=_[_0x7b47('0x87')](_0x221d6f,'id');var _0x101fdc;var _0x46a963=squel[_0x7b47('0x6b')]();_0x46a963[_0x7b47('0x6c')](_0x222933['table']);for(var _0x5c1e97=0x0;_0x5c1e97<_0x5d8e86[_0x7b47('0x36')];_0x5c1e97+=0x1){_0x101fdc=_0x5d8e86[_0x5c1e97][_0x7b47('0x6e')]?_0xa673f[_0x5d8e86[_0x5c1e97][_0x7b47('0x6e')]][_0x7b47('0x88')]:_0x5d8e86[_0x5c1e97][_0x7b47('0x6f')];_0x101fdc=_0x5d8e86[_0x5c1e97][_0x7b47('0x70')]?_[_0x7b47('0x71')](_0x5ce728[_0x5d8e86[_0x5c1e97][_0x7b47('0x70')]],'%s',_0x101fdc):_0x101fdc;_0x101fdc=_0x5d8e86[_0x5c1e97][_0x7b47('0x72')]?_[_0x7b47('0x71')](_0x38ea40[_0x5d8e86[_0x5c1e97][_0x7b47('0x72')]],'%s',_0x101fdc):_0x101fdc;if(_0x5d8e86[_0x5c1e97]['groupBy']){_0x46a963['group'](_0x101fdc);}_0x5d8e86[_0x5c1e97][_0x7b47('0x74')]&&_0x46a963[_0x7b47('0x39')](_0x101fdc,_0x5d8e86[_0x5c1e97][_0x7b47('0x74')]===_0x7b47('0x75')?![]:!![]);_0x46a963[_0x7b47('0x6f')](_0x101fdc,_0x5d8e86[_0x5c1e97][_0x7b47('0x76')]||_0x101fdc);}if(_0x222933[_0x7b47('0x77')]){_0x222933[_0x7b47('0x77')]=JSON['parse'](_0x222933['joins']);for(var _0x236291=0x0;_0x236291<_0x222933[_0x7b47('0x77')][_0x7b47('0x36')];_0x236291+=0x1){if(_0x222933[_0x7b47('0x77')][_0x236291][_0x7b47('0x2e')]&&_[_0x7b47('0x5d')](_0x28913c,_0x222933['joins'][_0x236291][_0x7b47('0x2e')])&&_0x222933[_0x7b47('0x77')][_0x236291][_0x7b47('0x79')]&&_0x222933['joins'][_0x236291][_0x7b47('0x7b')]&&_0x222933[_0x7b47('0x77')][_0x236291][_0x7b47('0x7a')]){_0x46a963[_0x222933[_0x7b47('0x77')][_0x236291][_0x7b47('0x2e')]](_0x222933[_0x7b47('0x77')][_0x236291][_0x7b47('0x7b')],null,util['format'](_0x7b47('0x7c'),_0x222933[_0x7b47('0x6d')],_0x222933[_0x7b47('0x77')][_0x236291]['parentKey'],_0x222933[_0x7b47('0x77')][_0x236291][_0x7b47('0x7b')],_0x222933[_0x7b47('0x77')][_0x236291]['foreignKey']));}}}if(_0x222933[_0x7b47('0x7d')]){_0x222933[_0x7b47('0x7d')]=JSON['parse'](_0x222933[_0x7b47('0x7d')]);_0x46a963[_0x7b47('0x3d')](_0x51e2d8(_0x222933['conditions'][_0x7b47('0x63')]));}_0x19319e=_0x46a963['clone']();_0x46a963[_0x7b47('0x1d')](_0x1e0d76);_0x46a963[_0x7b47('0x38')](0x0);logger[_0x7b47('0x7e')](_0x7b47('0x7f'),_0x46a963[_0x7b47('0x80')]());return dbH[_0x7b47('0x81')]['query'](_0x46a963[_0x7b47('0x80')](),{'type':dbH[_0x7b47('0x81')]['QueryTypes'][_0x7b47('0x83')]});}})['then'](function(){return{'sql':_0x19319e['toString']()};})[_0x7b47('0x24')](respondWithResult(_0xfe194e,null))[_0x7b47('0x4e')](handleError(_0xfe194e,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 6ab4cdd..8a2c8a1 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 _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 +var _0xa583=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','moment','bluebird'];(function(_0x3ff5de,_0x1c0844){var _0x323b7a=function(_0x14fd47){while(--_0x14fd47){_0x3ff5de['push'](_0x3ff5de['shift']());}};_0x323b7a(++_0x1c0844);}(_0xa583,0x14d));var _0x3a58=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa583[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3a58('0x0'));var logger=require(_0x3a58('0x1'))(_0x3a58('0x2'));var moment=require(_0x3a58('0x3'));var BPromise=require(_0x3a58('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a58('0x5'));var rimraf=require(_0x3a58('0x6'));var config=require(_0x3a58('0x7'));var attributes=require(_0x3a58('0x8'));module[_0x3a58('0x9')]=function(_0x1d26e4,_0x15e42e){return _0x1d26e4[_0x3a58('0xa')](_0x3a58('0xb'),attributes,{'tableName':_0x3a58('0xc'),'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 e283d24..460bba0 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 _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 +var _0x1e01=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','lodash','util','moment','randomstring','ioredis'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x1e01,0xd7));var _0x11e0=function(_0x3f2355,_0x2ce267){_0x3f2355=_0x3f2355-0x0;var _0x3f622c=_0x1e01[_0x3f2355];return _0x3f622c;};'use strict';var _=require(_0x11e0('0x0'));var util=require(_0x11e0('0x1'));var moment=require(_0x11e0('0x2'));var BPromise=require('bluebird');var rs=require(_0x11e0('0x3'));var fs=require('fs');var Redis=require(_0x11e0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x11e0('0x5'));var logger=require(_0x11e0('0x6'))(_0x11e0('0x7'));var config=require(_0x11e0('0x8'));var jayson=require(_0x11e0('0x9'));var client=jayson[_0x11e0('0xa')][_0x11e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1cf6b4,_0x27b6c7,_0x379780){return new BPromise(function(_0x3ea9ab,_0x58c419){return client[_0x11e0('0xc')](_0x1cf6b4,_0x379780)[_0x11e0('0xd')](function(_0x35369e){logger['info'](_0x11e0('0xe'),_0x27b6c7,_0x11e0('0xf'));logger[_0x11e0('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x27b6c7,_0x11e0('0xf'),JSON[_0x11e0('0x11')](_0x35369e));if(_0x35369e[_0x11e0('0x12')]){if(_0x35369e[_0x11e0('0x12')]['code']===0x1f4){logger[_0x11e0('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x27b6c7,_0x35369e['error'][_0x11e0('0x13')]);return _0x58c419(_0x35369e[_0x11e0('0x12')][_0x11e0('0x13')]);}logger[_0x11e0('0x12')](_0x11e0('0xe'),_0x27b6c7,_0x35369e[_0x11e0('0x12')]['message']);return _0x3ea9ab(_0x35369e[_0x11e0('0x12')][_0x11e0('0x13')]);}else{logger[_0x11e0('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0x27b6c7,_0x11e0('0xf'));_0x3ea9ab(_0x35369e[_0x11e0('0x15')][_0x11e0('0x13')]);}})['catch'](function(_0x4d36d7){logger[_0x11e0('0x12')](_0x11e0('0xe'),_0x27b6c7,_0x4d36d7);_0x58c419(_0x4d36d7);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index ac4abf8..f0833d0 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 _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 +var _0x4e6d=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','put','update','delete','destroy','exports','multer'];(function(_0x5bd677,_0x4341b0){var _0x2dbd6a=function(_0x3d7a8a){while(--_0x3d7a8a){_0x5bd677['push'](_0x5bd677['shift']());}};_0x2dbd6a(++_0x4341b0);}(_0x4e6d,0xf2));var _0xd4e6=function(_0x3e4285,_0x83a4f0){_0x3e4285=_0x3e4285-0x0;var _0xce09e7=_0x4e6d[_0x3e4285];return _0xce09e7;};'use strict';var multer=require(_0xd4e6('0x0'));var util=require(_0xd4e6('0x1'));var path=require(_0xd4e6('0x2'));var timeout=require(_0xd4e6('0x3'));var express=require(_0xd4e6('0x4'));var router=express[_0xd4e6('0x5')]();var fs_extra=require(_0xd4e6('0x6'));var auth=require(_0xd4e6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd4e6('0x8'));var controller=require(_0xd4e6('0x9'));router['get']('/',auth[_0xd4e6('0xa')](),controller[_0xd4e6('0xb')]);router[_0xd4e6('0xc')](_0xd4e6('0xd'),auth['isAuthenticated'](),controller[_0xd4e6('0xe')]);router[_0xd4e6('0xc')](_0xd4e6('0xf'),auth['isAuthenticated'](),controller[_0xd4e6('0x10')]);router[_0xd4e6('0xc')](_0xd4e6('0x11'),auth[_0xd4e6('0xa')](),controller[_0xd4e6('0x12')]);router[_0xd4e6('0xc')](_0xd4e6('0x13'),auth[_0xd4e6('0xa')](),controller['query']);router[_0xd4e6('0x14')]('/',auth['isAuthenticated'](),controller[_0xd4e6('0x15')]);router[_0xd4e6('0x16')](_0xd4e6('0xd'),auth[_0xd4e6('0xa')](),controller[_0xd4e6('0x17')]);router[_0xd4e6('0x18')](_0xd4e6('0xd'),auth['isAuthenticated'](),controller[_0xd4e6('0x19')]);module[_0xd4e6('0x1a')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 473a59c..7c69e35 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 _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 +var _0x7217=['sequelize','STRING','TEXT'];(function(_0x36979f,_0x2b8951){var _0x462c6d=function(_0x3e8027){while(--_0x3e8027){_0x36979f['push'](_0x36979f['shift']());}};_0x462c6d(++_0x2b8951);}(_0x7217,0x19e));var _0x7721=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x7217[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 95711cf..094b1b2 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 _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 +var _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x2ef3,0xba));var _0x32ef=function(_0x5eccb6,_0x3c4f00){_0x5eccb6=_0x5eccb6-0x0;var _0x5ab220=_0x2ef3[_0x5eccb6];return _0x5ab220;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index ecc39b3..8c16589 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 _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 +var _0x3abf=['request-promise','path','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util','api','moment','bluebird'];(function(_0x2be9a5,_0x1363e5){var _0x3b07a4=function(_0x58b56b){while(--_0x58b56b){_0x2be9a5['push'](_0x2be9a5['shift']());}};_0x3b07a4(++_0x1363e5);}(_0x3abf,0x15c));var _0xf3ab=function(_0x217838,_0x43466a){_0x217838=_0x217838-0x0;var _0x4ae0fd=_0x3abf[_0x217838];return _0x4ae0fd;};'use strict';var _=require('lodash');var util=require(_0xf3ab('0x0'));var logger=require('../../config/logger')(_0xf3ab('0x1'));var moment=require(_0xf3ab('0x2'));var BPromise=require(_0xf3ab('0x3'));var rp=require(_0xf3ab('0x4'));var fs=require('fs');var path=require(_0xf3ab('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf3ab('0x6'));module[_0xf3ab('0x7')]=function(_0x110652,_0x21eb54){return _0x110652[_0xf3ab('0x8')](_0xf3ab('0x9'),attributes,{'tableName':_0xf3ab('0xa'),'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 77cc565..cd87234 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 _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 +var _0xb210=['../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1f641b,_0x2f15a1){var _0x2fb99b=function(_0x2f1ab2){while(--_0x2f1ab2){_0x1f641b['push'](_0x1f641b['shift']());}};_0x2fb99b(++_0x2f15a1);}(_0xb210,0x19d));var _0x0b21=function(_0x2a8d9d,_0x11e582){_0x2a8d9d=_0x2a8d9d-0x0;var _0x451659=_0xb210[_0x2a8d9d];return _0x451659;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0b21('0x0'));var rs=require(_0x0b21('0x1'));var fs=require('fs');var Redis=require(_0x0b21('0x2'));var db=require(_0x0b21('0x3'))['db'];var utils=require(_0x0b21('0x4'));var logger=require(_0x0b21('0x5'))('rpc');var config=require(_0x0b21('0x6'));var jayson=require(_0x0b21('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x29a25f,_0xdab92b,_0x295d47){return new BPromise(function(_0x4864ed,_0x5f4565){return client[_0x0b21('0x8')](_0x29a25f,_0x295d47)[_0x0b21('0x9')](function(_0x15f639){logger[_0x0b21('0xa')](_0x0b21('0xb'),_0xdab92b,_0x0b21('0xc'));logger[_0x0b21('0xd')](_0x0b21('0xe'),_0xdab92b,'request\x20sent',JSON['stringify'](_0x15f639));if(_0x15f639[_0x0b21('0xf')]){if(_0x15f639['error'][_0x0b21('0x10')]===0x1f4){logger[_0x0b21('0xf')](_0x0b21('0xb'),_0xdab92b,_0x15f639['error'][_0x0b21('0x11')]);return _0x5f4565(_0x15f639['error'][_0x0b21('0x11')]);}logger[_0x0b21('0xf')](_0x0b21('0xb'),_0xdab92b,_0x15f639[_0x0b21('0xf')][_0x0b21('0x11')]);return _0x4864ed(_0x15f639['error']['message']);}else{logger['info'](_0x0b21('0xb'),_0xdab92b,_0x0b21('0xc'));_0x4864ed(_0x15f639[_0x0b21('0x12')][_0x0b21('0x11')]);}})['catch'](function(_0x5cc436){logger[_0x0b21('0xf')](_0x0b21('0xb'),_0xdab92b,_0x5cc436);_0x5f4565(_0x5cc436);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 48d3b6c..657f98f 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 _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 +var _0xaa65=['get','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated','index'];(function(_0x141993,_0x5cd8c2){var _0x55203a=function(_0x1797cd){while(--_0x1797cd){_0x141993['push'](_0x141993['shift']());}};_0x55203a(++_0x5cd8c2);}(_0xaa65,0x108));var _0x5aa6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa65[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x5aa6('0x0'));var util=require(_0x5aa6('0x1'));var path=require(_0x5aa6('0x2'));var timeout=require(_0x5aa6('0x3'));var express=require('express');var router=express[_0x5aa6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5aa6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5aa6('0x6'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x5aa6('0x7')](),controller[_0x5aa6('0x8')]);router[_0x5aa6('0x9')](_0x5aa6('0xa'),auth[_0x5aa6('0x7')](),controller[_0x5aa6('0xb')]);router[_0x5aa6('0x9')](_0x5aa6('0xc'),auth[_0x5aa6('0x7')](),controller[_0x5aa6('0xd')]);router[_0x5aa6('0x9')](_0x5aa6('0xe'),auth[_0x5aa6('0x7')](),controller['run']);router['get'](_0x5aa6('0xf'),auth[_0x5aa6('0x7')](),controller[_0x5aa6('0x10')]);router[_0x5aa6('0x11')]('/',auth[_0x5aa6('0x7')](),controller[_0x5aa6('0x12')]);router['put'](_0x5aa6('0xa'),auth[_0x5aa6('0x7')](),controller[_0x5aa6('0x13')]);router['delete'](_0x5aa6('0xa'),auth[_0x5aa6('0x7')](),controller['destroy']);module[_0x5aa6('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 0cad278..3a0e9b4 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 _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 +var _0xcb6b=['csv','DATE','scheduled','manual','UNSIGNED','sequelize','moment','exports','STRING','pdf'];(function(_0x243d54,_0x116cc8){var _0x18bb09=function(_0x3cde25){while(--_0x3cde25){_0x243d54['push'](_0x243d54['shift']());}};_0x18bb09(++_0x116cc8);}(_0xcb6b,0x11d));var _0xbcb6=function(_0x2e20f4,_0x410781){_0x2e20f4=_0x2e20f4-0x0;var _0x2d98f1=_0xcb6b[_0x2e20f4];return _0x2d98f1;};'use strict';var Sequelize=require(_0xbcb6('0x0'));var moment=require(_0xbcb6('0x1'));module[_0xbcb6('0x2')]={'name':{'type':Sequelize[_0xbcb6('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xbcb6('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0xbcb6('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0xbcb6('0x5')},'savename':{'type':Sequelize[_0xbcb6('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xbcb6('0x6')]},'endDate':{'type':Sequelize[_0xbcb6('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual',_0xbcb6('0x7')),'allowNull':![],'defaultValue':_0xbcb6('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xbcb6('0x9')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 0d1931b..2496332 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 _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 +var _0x72da=['end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','get','ExtractedReports','error','stack','name','send','index','map','rawAttributes','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','AnalyticExtractedReport','includeAll','findAll','rows','catch','show','params','keys','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status'];(function(_0x3e9c60,_0x4582ae){var _0x569f61=function(_0x43db1a){while(--_0x43db1a){_0x3e9c60['push'](_0x3e9c60['shift']());}};_0x569f61(++_0x4582ae);}(_0x72da,0x15d));var _0xa72d=function(_0x4d8764,_0xd13d7b){_0x4d8764=_0x4d8764-0x0;var _0x4e0b49=_0x72da[_0x4d8764];return _0x4e0b49;};'use strict';var emlformat=require(_0xa72d('0x0'));var rimraf=require(_0xa72d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa72d('0x2'));var rp=require(_0xa72d('0x3'));var moment=require(_0xa72d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa72d('0x5'));var util=require(_0xa72d('0x6'));var path=require(_0xa72d('0x7'));var sox=require(_0xa72d('0x8'));var csv=require(_0xa72d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa72d('0xa'));var _=require(_0xa72d('0xb'));var squel=require(_0xa72d('0xc'));var crypto=require(_0xa72d('0xd'));var jsforce=require(_0xa72d('0xe'));var deskjs=require(_0xa72d('0xf'));var toCsv=require(_0xa72d('0x9'));var querystring=require('querystring');var Papa=require(_0xa72d('0x10'));var Redis=require(_0xa72d('0x11'));var authService=require(_0xa72d('0x12'));var qs=require(_0xa72d('0x13'));var as=require(_0xa72d('0x14'));var hardwareService=require(_0xa72d('0x15'));var logger=require(_0xa72d('0x16'))(_0xa72d('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa72d('0x18'))['db'];function respondWithStatusCode(_0x1f7ef7,_0x2b4d73){_0x2b4d73=_0x2b4d73||0xcc;return function(_0xf6cff2){if(_0xf6cff2){return _0x1f7ef7[_0xa72d('0x19')](_0x2b4d73);}return _0x1f7ef7[_0xa72d('0x1a')](_0x2b4d73)[_0xa72d('0x1b')]();};}function respondWithResult(_0x33b831,_0x58c626){_0x58c626=_0x58c626||0xc8;return function(_0x346bcf){if(_0x346bcf){return _0x33b831[_0xa72d('0x1a')](_0x58c626)[_0xa72d('0x1c')](_0x346bcf);}};}function respondWithFilteredResult(_0x5d7ada,_0x51e847){return function(_0x260210){if(_0x260210){var _0x3b2647=typeof _0x51e847[_0xa72d('0x1d')]===_0xa72d('0x1e')&&typeof _0x51e847[_0xa72d('0x1f')]===_0xa72d('0x1e');var _0x49dfbb=_0x260210[_0xa72d('0x20')];var _0x5a496c=_0x3b2647?0x0:_0x51e847['offset'];var _0x3714ba=_0x3b2647?_0x260210['count']:_0x51e847[_0xa72d('0x1d')]+_0x51e847['limit'];var _0x5b20cd;if(_0x3714ba>=_0x49dfbb){_0x3714ba=_0x49dfbb;_0x5b20cd=0xc8;}else{_0x5b20cd=0xce;}_0x5d7ada[_0xa72d('0x1a')](_0x5b20cd);return _0x5d7ada[_0xa72d('0x21')](_0xa72d('0x22'),_0x5a496c+'-'+_0x3714ba+'/'+_0x49dfbb)[_0xa72d('0x1c')](_0x260210);}return null;};}function patchUpdates(_0x5d074e){return function(_0x3c9913){try{jsonpatch['apply'](_0x3c9913,_0x5d074e,!![]);}catch(_0x5296b0){return BPromise['reject'](_0x5296b0);}return _0x3c9913['save']();};}function saveUpdates(_0x5058c6,_0x504b8d){return function(_0x2d9557){if(_0x2d9557){return _0x2d9557['update'](_0x5058c6)[_0xa72d('0x23')](function(_0xb01880){return _0xb01880;});}return null;};}function removeEntity(_0x4a67f2,_0x364b9c){return function(_0x5b2daa){if(_0x5b2daa){return _0x5b2daa[_0xa72d('0x24')]()[_0xa72d('0x23')](function(){var _0x231d8=_0x5b2daa[_0xa72d('0x25')]({'plain':!![]});var _0x4e945b=_0xa72d('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x4e945b,'resourceId':_0x231d8['id']}})['then'](function(){return _0x5b2daa;});})[_0xa72d('0x23')](function(){_0x4a67f2[_0xa72d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cb1a4,_0x49d49b){return function(_0x1d2407){if(!_0x1d2407){_0x4cb1a4[_0xa72d('0x19')](0x194);}return _0x1d2407;};}function handleError(_0x593f4c,_0x39664b){_0x39664b=_0x39664b||0x1f4;return function(_0x1114d6){logger[_0xa72d('0x27')](_0x1114d6[_0xa72d('0x28')]);if(_0x1114d6[_0xa72d('0x29')]){delete _0x1114d6[_0xa72d('0x29')];}_0x593f4c[_0xa72d('0x1a')](_0x39664b)[_0xa72d('0x2a')](_0x1114d6);};}exports[_0xa72d('0x2b')]=function(_0x33b12e,_0x1e21ab){var _0x40e262={},_0x4900f6={},_0x63e634={'count':0x0,'rows':[]};var _0x52220a=_[_0xa72d('0x2c')](db['AnalyticExtractedReport'][_0xa72d('0x2d')],function(_0x354d31){return{'name':_0x354d31['fieldName'],'type':_0x354d31['type'][_0xa72d('0x2e')]};});_0x4900f6[_0xa72d('0x2f')]=_[_0xa72d('0x2c')](_0x52220a,_0xa72d('0x29'));_0x4900f6['query']=_['keys'](_0x33b12e[_0xa72d('0x30')]);_0x4900f6['filters']=_[_0xa72d('0x31')](_0x4900f6[_0xa72d('0x2f')],_0x4900f6[_0xa72d('0x30')]);_0x40e262[_0xa72d('0x32')]=_['intersection'](_0x4900f6[_0xa72d('0x2f')],qs[_0xa72d('0x33')](_0x33b12e[_0xa72d('0x30')]['fields']));_0x40e262['attributes']=_0x40e262[_0xa72d('0x32')][_0xa72d('0x34')]?_0x40e262[_0xa72d('0x32')]:_0x4900f6[_0xa72d('0x2f')];if(!_0x33b12e[_0xa72d('0x30')][_0xa72d('0x35')]('nolimit')){_0x40e262[_0xa72d('0x1f')]=qs[_0xa72d('0x1f')](_0x33b12e[_0xa72d('0x30')][_0xa72d('0x1f')]);_0x40e262['offset']=qs['offset'](_0x33b12e[_0xa72d('0x30')]['offset']);}_0x40e262[_0xa72d('0x36')]=qs[_0xa72d('0x37')](_0x33b12e[_0xa72d('0x30')]['sort']);_0x40e262[_0xa72d('0x38')]=qs[_0xa72d('0x39')](_[_0xa72d('0x3a')](_0x33b12e[_0xa72d('0x30')],_0x4900f6[_0xa72d('0x39')]),_0x52220a);if(_0x33b12e['query'][_0xa72d('0x3b')]){_0x40e262[_0xa72d('0x38')]=_['merge'](_0x40e262[_0xa72d('0x38')],{'$or':_[_0xa72d('0x2c')](_0x52220a,function(_0x2ffe16){if(_0x2ffe16[_0xa72d('0x3c')]!==_0xa72d('0x3d')){var _0x2b4a7b={};_0x2b4a7b[_0x2ffe16[_0xa72d('0x29')]]={'$like':'%'+_0x33b12e[_0xa72d('0x30')][_0xa72d('0x3b')]+'%'};return _0x2b4a7b;}})});}_0x40e262=_[_0xa72d('0x3e')]({},_0x40e262,_0x33b12e[_0xa72d('0x3f')]);var _0x3eebe0={'where':_0x40e262[_0xa72d('0x38')]};return db[_0xa72d('0x40')][_0xa72d('0x20')](_0x3eebe0)[_0xa72d('0x23')](function(_0x4b65e0){_0x63e634[_0xa72d('0x20')]=_0x4b65e0;if(_0x33b12e['query'][_0xa72d('0x41')]){_0x40e262['include']=[{'all':!![]}];}return db[_0xa72d('0x40')][_0xa72d('0x42')](_0x40e262);})[_0xa72d('0x23')](function(_0x4f814d){_0x63e634[_0xa72d('0x43')]=_0x4f814d;return _0x63e634;})[_0xa72d('0x23')](respondWithFilteredResult(_0x1e21ab,_0x40e262))[_0xa72d('0x44')](handleError(_0x1e21ab,null));};exports[_0xa72d('0x45')]=function(_0x588cc9,_0x3aa15c){var _0x45d1ba={'raw':!![],'where':{'id':_0x588cc9[_0xa72d('0x46')]['id']}},_0x4ac6ab={};_0x4ac6ab[_0xa72d('0x2f')]=_[_0xa72d('0x47')](db[_0xa72d('0x40')][_0xa72d('0x2d')]);_0x4ac6ab[_0xa72d('0x30')]=_[_0xa72d('0x47')](_0x588cc9['query']);_0x4ac6ab['filters']=_[_0xa72d('0x31')](_0x4ac6ab[_0xa72d('0x2f')],_0x4ac6ab['query']);_0x45d1ba[_0xa72d('0x32')]=_[_0xa72d('0x31')](_0x4ac6ab['model'],qs[_0xa72d('0x33')](_0x588cc9['query']['fields']));_0x45d1ba[_0xa72d('0x32')]=_0x45d1ba[_0xa72d('0x32')]['length']?_0x45d1ba[_0xa72d('0x32')]:_0x4ac6ab[_0xa72d('0x2f')];if(_0x588cc9['query'][_0xa72d('0x41')]){_0x45d1ba[_0xa72d('0x48')]=[{'all':!![]}];}_0x45d1ba=_[_0xa72d('0x3e')]({},_0x45d1ba,_0x588cc9[_0xa72d('0x3f')]);return db[_0xa72d('0x40')]['find'](_0x45d1ba)[_0xa72d('0x23')](handleEntityNotFound(_0x3aa15c,null))['then'](respondWithResult(_0x3aa15c,null))[_0xa72d('0x44')](handleError(_0x3aa15c,null));};exports[_0xa72d('0x49')]=function(_0x1b8506,_0x25b082){return db[_0xa72d('0x40')][_0xa72d('0x49')](_0x1b8506[_0xa72d('0x4a')],{})['then'](function(_0x5044d4){var _0x2a9b21=_0x1b8506['user']['get']({'plain':!![]});if(!_0x2a9b21)throw new Error(_0xa72d('0x4b'));if(_0x2a9b21[_0xa72d('0x4c')]==='user'){var _0x4c711e=_0x5044d4[_0xa72d('0x25')]({'plain':!![]});var _0x30269e=_0xa72d('0x26');return db[_0xa72d('0x4d')][_0xa72d('0x4e')]({'where':{'name':_0x30269e,'userProfileId':_0x2a9b21[_0xa72d('0x4f')]},'raw':!![]})[_0xa72d('0x23')](function(_0x593f1e){if(_0x593f1e&&_0x593f1e['autoAssociation']===0x0){return db['UserProfileResource'][_0xa72d('0x49')]({'name':_0x4c711e[_0xa72d('0x29')],'resourceId':_0x4c711e['id'],'type':_0x593f1e['name'],'sectionId':_0x593f1e['id']},{})[_0xa72d('0x23')](function(){return _0x5044d4;});}else{return _0x5044d4;}})[_0xa72d('0x44')](function(_0x528ac7){logger[_0xa72d('0x27')](_0xa72d('0x50'),_0x528ac7);throw _0x528ac7;});}return _0x5044d4;})[_0xa72d('0x23')](respondWithResult(_0x25b082,0xc9))['catch'](handleError(_0x25b082,null));};exports['update']=function(_0x20633c,_0x24f6a1){if(_0x20633c[_0xa72d('0x4a')]['id']){delete _0x20633c[_0xa72d('0x4a')]['id'];}return db[_0xa72d('0x40')][_0xa72d('0x4e')]({'where':{'id':_0x20633c['params']['id']}})[_0xa72d('0x23')](handleEntityNotFound(_0x24f6a1,null))[_0xa72d('0x23')](saveUpdates(_0x20633c[_0xa72d('0x4a')],null))[_0xa72d('0x23')](respondWithResult(_0x24f6a1,null))['catch'](handleError(_0x24f6a1,null));};exports[_0xa72d('0x24')]=function(_0x1b5ca4,_0x3aadfe){return db[_0xa72d('0x40')][_0xa72d('0x4e')]({'where':{'id':_0x1b5ca4[_0xa72d('0x46')]['id']}})[_0xa72d('0x23')](handleEntityNotFound(_0x3aadfe,null))['then'](removeEntity(_0x3aadfe,null))[_0xa72d('0x44')](handleError(_0x3aadfe,null));};exports[_0xa72d('0x51')]=function(_0x11ec12,_0x452e71,_0x36fc6b){return db[_0xa72d('0x40')][_0xa72d('0x4e')]({'where':{'id':_0x11ec12[_0xa72d('0x46')]['id']},'attributes':[_0xa72d('0x29'),_0xa72d('0x52'),_0xa72d('0x53'),_0xa72d('0x54')],'raw':!![]})[_0xa72d('0x23')](handleEntityNotFound(_0x452e71,null))[_0xa72d('0x23')](function(_0x56f11e){if(_0x56f11e){if(!fs[_0xa72d('0x55')](path[_0xa72d('0x56')](config[_0xa72d('0x57')],_0xa72d('0x58'),_0x56f11e[_0xa72d('0x53')]))){throw new db[(_0xa72d('0x59'))][(_0xa72d('0x5a'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x11ec12[_0xa72d('0x30')][_0xa72d('0x5b')]){return _0x452e71['sendStatus'](0xc8);}return _0x452e71['download'](path[_0xa72d('0x56')](config[_0xa72d('0x57')],_0xa72d('0x58'),_0x56f11e['savename']),util['format'](_0xa72d('0x5c'),_0x56f11e[_0xa72d('0x52')]||_0x56f11e[_0xa72d('0x29')],_0x56f11e[_0xa72d('0x54')][_0xa72d('0x5d')]()));}})[_0xa72d('0x44')](handleError(_0x452e71,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 54a5f64..8a9c34c 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 _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 +var _0xc487=['api','bluebird','request-promise','path','./analyticExtractedReport.attributes','exports','define'];(function(_0x12d6d1,_0x468f27){var _0x3c85de=function(_0x532c43){while(--_0x532c43){_0x12d6d1['push'](_0x12d6d1['shift']());}};_0x3c85de(++_0x468f27);}(_0xc487,0x181));var _0x7c48=function(_0x58b647,_0xe24336){_0x58b647=_0x58b647-0x0;var _0x233b67=_0xc487[_0x58b647];return _0x233b67;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7c48('0x0'));var moment=require('moment');var BPromise=require(_0x7c48('0x1'));var rp=require(_0x7c48('0x2'));var fs=require('fs');var path=require(_0x7c48('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7c48('0x4'));module[_0x7c48('0x5')]=function(_0x28a5c1,_0x106709){return _0x28a5c1[_0x7c48('0x6')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','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 434cd56..efdcea0 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 _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 +var _0x05ca=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x258d11,_0xc62302){var _0x230fd2=function(_0x3239e1){while(--_0x3239e1){_0x258d11['push'](_0x258d11['shift']());}};_0x230fd2(++_0xc62302);}(_0x05ca,0xbf));var _0xa05c=function(_0x1fdda9,_0x5c74bd){_0x1fdda9=_0x1fdda9-0x0;var _0x25e192=_0x05ca[_0x1fdda9];return _0x25e192;};'use strict';var _=require(_0xa05c('0x0'));var util=require('util');var moment=require(_0xa05c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa05c('0x2'));var fs=require('fs');var Redis=require(_0xa05c('0x3'));var db=require(_0xa05c('0x4'))['db'];var utils=require(_0xa05c('0x5'));var logger=require('../../config/logger')(_0xa05c('0x6'));var config=require(_0xa05c('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x424e34,_0xb06377,_0x256dc0){return new BPromise(function(_0x1cc047,_0x430a98){return client['request'](_0x424e34,_0x256dc0)[_0xa05c('0x8')](function(_0x508187){logger[_0xa05c('0x9')](_0xa05c('0xa'),_0xb06377,'request\x20sent');logger[_0xa05c('0xb')](_0xa05c('0xc'),_0xb06377,_0xa05c('0xd'),JSON['stringify'](_0x508187));if(_0x508187[_0xa05c('0xe')]){if(_0x508187[_0xa05c('0xe')][_0xa05c('0xf')]===0x1f4){logger[_0xa05c('0xe')](_0xa05c('0xa'),_0xb06377,_0x508187['error'][_0xa05c('0x10')]);return _0x430a98(_0x508187['error']['message']);}logger[_0xa05c('0xe')](_0xa05c('0xa'),_0xb06377,_0x508187[_0xa05c('0xe')][_0xa05c('0x10')]);return _0x1cc047(_0x508187['error'][_0xa05c('0x10')]);}else{logger['info'](_0xa05c('0xa'),_0xb06377,_0xa05c('0xd'));_0x1cc047(_0x508187[_0xa05c('0x11')][_0xa05c('0x10')]);}})[_0xa05c('0x12')](function(_0x40fcdf){logger[_0xa05c('0xe')](_0xa05c('0xa'),_0xb06377,_0x40fcdf);_0x430a98(_0x40fcdf);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 85329b2..709c697 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 _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 +var _0x22d8=['exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','delete','destroy'];(function(_0x30dbe6,_0x22e984){var _0x56bb53=function(_0x1ec502){while(--_0x1ec502){_0x30dbe6['push'](_0x30dbe6['shift']());}};_0x56bb53(++_0x22e984);}(_0x22d8,0xfd));var _0x822d=function(_0x547c55,_0x9ad851){_0x547c55=_0x547c55-0x0;var _0x266042=_0x22d8[_0x547c55];return _0x266042;};'use strict';var multer=require('multer');var util=require(_0x822d('0x0'));var path=require(_0x822d('0x1'));var timeout=require('connect-timeout');var express=require(_0x822d('0x2'));var router=express['Router']();var fs_extra=require(_0x822d('0x3'));var auth=require(_0x822d('0x4'));var interaction=require(_0x822d('0x5'));var config=require(_0x822d('0x6'));var controller=require(_0x822d('0x7'));router[_0x822d('0x8')]('/',auth[_0x822d('0x9')](),controller[_0x822d('0xa')]);router[_0x822d('0x8')](_0x822d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x822d('0x8')](_0x822d('0xc'),auth[_0x822d('0x9')](),controller[_0x822d('0xd')]);router[_0x822d('0xe')]('/',auth['isAuthenticated'](),controller[_0x822d('0xf')]);router[_0x822d('0x10')](_0x822d('0xb'),auth[_0x822d('0x9')](),controller[_0x822d('0x11')]);router[_0x822d('0x12')]('/:id',auth[_0x822d('0x9')](),controller[_0x822d('0x13')]);module[_0x822d('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 64a132c..edf4d60 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 _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 +var _0x2945=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x2c9b79,_0x7cf58b){var _0x265032=function(_0x188a92){while(--_0x188a92){_0x2c9b79['push'](_0x2c9b79['shift']());}};_0x265032(++_0x7cf58b);}(_0x2945,0xf3));var _0x5294=function(_0x1c9fc4,_0x240343){_0x1c9fc4=_0x1c9fc4-0x0;var _0x2efcba=_0x2945[_0x1c9fc4];return _0x2efcba;};'use strict';var Sequelize=require(_0x5294('0x0'));module[_0x5294('0x1')]={'field':{'type':Sequelize[_0x5294('0x2')]},'alias':{'type':Sequelize[_0x5294('0x3')]},'function':{'type':Sequelize[_0x5294('0x3')]},'format':{'type':Sequelize[_0x5294('0x3')]},'groupBy':{'type':Sequelize[_0x5294('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 937e86c..fb1e937 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 _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 +var _0xb057=['fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','then','includeAll','include','catch','show','params','find','bulkCreate','body','addFields','AnalyticCustomReport','findOne','sequelize','rimraf','moment','bluebird','mustache','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','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','error','name','index','map','AnalyticFieldReport','rawAttributes'];(function(_0x229776,_0x13732d){var _0x4f32b5=function(_0x48958d){while(--_0x48958d){_0x229776['push'](_0x229776['shift']());}};_0x4f32b5(++_0x13732d);}(_0xb057,0x1f0));var _0x7b05=function(_0x226a19,_0x4a2fde){_0x226a19=_0x226a19-0x0;var _0x1dd55d=_0xb057[_0x226a19];return _0x1dd55d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b05('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b05('0x1'));var BPromise=require(_0x7b05('0x2'));var Mustache=require(_0x7b05('0x3'));var util=require(_0x7b05('0x4'));var path=require(_0x7b05('0x5'));var sox=require(_0x7b05('0x6'));var csv=require(_0x7b05('0x7'));var ejs=require(_0x7b05('0x8'));var fs=require('fs');var fs_extra=require(_0x7b05('0x9'));var _=require(_0x7b05('0xa'));var squel=require(_0x7b05('0xb'));var crypto=require(_0x7b05('0xc'));var jsforce=require(_0x7b05('0xd'));var deskjs=require(_0x7b05('0xe'));var toCsv=require(_0x7b05('0x7'));var querystring=require(_0x7b05('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7b05('0x10'));var as=require(_0x7b05('0x11'));var hardwareService=require(_0x7b05('0x12'));var logger=require(_0x7b05('0x13'))(_0x7b05('0x14'));var utils=require('../../config/utils');var config=require(_0x7b05('0x15'));var licenseUtil=require(_0x7b05('0x16'));var db=require(_0x7b05('0x17'))['db'];function respondWithStatusCode(_0x125f37,_0x3772be){_0x3772be=_0x3772be||0xcc;return function(_0x3f338c){if(_0x3f338c){return _0x125f37[_0x7b05('0x18')](_0x3772be);}return _0x125f37['status'](_0x3772be)[_0x7b05('0x19')]();};}function respondWithResult(_0x4b76b4,_0x245122){_0x245122=_0x245122||0xc8;return function(_0xf65800){if(_0xf65800){return _0x4b76b4[_0x7b05('0x1a')](_0x245122)[_0x7b05('0x1b')](_0xf65800);}};}function respondWithFilteredResult(_0x3869ee,_0x1eb53c){return function(_0x223de7){if(_0x223de7){var _0x145685=typeof _0x1eb53c[_0x7b05('0x1c')]===_0x7b05('0x1d')&&typeof _0x1eb53c[_0x7b05('0x1e')]===_0x7b05('0x1d');var _0x3dd197=_0x223de7[_0x7b05('0x1f')];var _0x4517a5=_0x145685?0x0:_0x1eb53c[_0x7b05('0x1c')];var _0x1f1fa9=_0x145685?_0x223de7[_0x7b05('0x1f')]:_0x1eb53c[_0x7b05('0x1c')]+_0x1eb53c[_0x7b05('0x1e')];var _0x322762;if(_0x1f1fa9>=_0x3dd197){_0x1f1fa9=_0x3dd197;_0x322762=0xc8;}else{_0x322762=0xce;}_0x3869ee[_0x7b05('0x1a')](_0x322762);return _0x3869ee[_0x7b05('0x20')](_0x7b05('0x21'),_0x4517a5+'-'+_0x1f1fa9+'/'+_0x3dd197)[_0x7b05('0x1b')](_0x223de7);}return null;};}function patchUpdates(_0x5c990a){return function(_0x3bc51d){try{jsonpatch[_0x7b05('0x22')](_0x3bc51d,_0x5c990a,!![]);}catch(_0x10b127){return BPromise['reject'](_0x10b127);}return _0x3bc51d['save']();};}function saveUpdates(_0x7c6f3b,_0x1fe941){return function(_0x52dc10){if(_0x52dc10){return _0x52dc10[_0x7b05('0x23')](_0x7c6f3b)['then'](function(_0x264ae8){return _0x264ae8;});}return null;};}function removeEntity(_0x166757,_0x3ef78a){return function(_0x10a869){if(_0x10a869){return _0x10a869[_0x7b05('0x24')]()['then'](function(){_0x166757['status'](0xcc)[_0x7b05('0x19')]();});}};}function handleEntityNotFound(_0x8a4ab3,_0x2537f5){return function(_0x5d709b){if(!_0x5d709b){_0x8a4ab3[_0x7b05('0x18')](0x194);}return _0x5d709b;};}function handleError(_0x5529a5,_0x580b96){_0x580b96=_0x580b96||0x1f4;return function(_0x232e28){logger[_0x7b05('0x25')](_0x232e28['stack']);if(_0x232e28[_0x7b05('0x26')]){delete _0x232e28[_0x7b05('0x26')];}_0x5529a5['status'](_0x580b96)['send'](_0x232e28);};}exports[_0x7b05('0x27')]=function(_0x19fe71,_0x364b8e){var _0x4e058e={},_0x1e6510={},_0x3a72ac={'count':0x0,'rows':[]};var _0x2674d8=_[_0x7b05('0x28')](db[_0x7b05('0x29')][_0x7b05('0x2a')],function(_0x39ea16){return{'name':_0x39ea16[_0x7b05('0x2b')],'type':_0x39ea16['type'][_0x7b05('0x2c')]};});_0x1e6510[_0x7b05('0x2d')]=_['map'](_0x2674d8,_0x7b05('0x26'));_0x1e6510[_0x7b05('0x2e')]=_[_0x7b05('0x2f')](_0x19fe71[_0x7b05('0x2e')]);_0x1e6510[_0x7b05('0x30')]=_[_0x7b05('0x31')](_0x1e6510[_0x7b05('0x2d')],_0x1e6510[_0x7b05('0x2e')]);_0x4e058e['attributes']=_['intersection'](_0x1e6510[_0x7b05('0x2d')],qs[_0x7b05('0x32')](_0x19fe71[_0x7b05('0x2e')][_0x7b05('0x32')]));_0x4e058e['attributes']=_0x4e058e[_0x7b05('0x33')][_0x7b05('0x34')]?_0x4e058e[_0x7b05('0x33')]:_0x1e6510['model'];if(!_0x19fe71[_0x7b05('0x2e')][_0x7b05('0x35')](_0x7b05('0x36'))){_0x4e058e[_0x7b05('0x1e')]=qs[_0x7b05('0x1e')](_0x19fe71[_0x7b05('0x2e')][_0x7b05('0x1e')]);_0x4e058e[_0x7b05('0x1c')]=qs['offset'](_0x19fe71[_0x7b05('0x2e')][_0x7b05('0x1c')]);}_0x4e058e[_0x7b05('0x37')]=qs['sort'](_0x19fe71[_0x7b05('0x2e')][_0x7b05('0x38')]);_0x4e058e[_0x7b05('0x39')]=qs['filters'](_[_0x7b05('0x3a')](_0x19fe71[_0x7b05('0x2e')],_0x1e6510['filters']),_0x2674d8);if(_0x19fe71[_0x7b05('0x2e')][_0x7b05('0x3b')]){_0x4e058e[_0x7b05('0x39')]=_['merge'](_0x4e058e[_0x7b05('0x39')],{'$or':_[_0x7b05('0x28')](_0x2674d8,function(_0x18954e){if(_0x18954e[_0x7b05('0x3c')]!==_0x7b05('0x3d')){var _0x1d961c={};_0x1d961c[_0x18954e[_0x7b05('0x26')]]={'$like':'%'+_0x19fe71[_0x7b05('0x2e')]['filter']+'%'};return _0x1d961c;}})});}_0x4e058e=_[_0x7b05('0x3e')]({},_0x4e058e,_0x19fe71[_0x7b05('0x3f')]);var _0x1af6f3={'where':_0x4e058e['where']};return db[_0x7b05('0x29')][_0x7b05('0x1f')](_0x1af6f3)[_0x7b05('0x40')](function(_0x3434b6){_0x3a72ac[_0x7b05('0x1f')]=_0x3434b6;if(_0x19fe71[_0x7b05('0x2e')][_0x7b05('0x41')]){_0x4e058e[_0x7b05('0x42')]=[{'all':!![]}];}return db[_0x7b05('0x29')]['findAll'](_0x4e058e);})[_0x7b05('0x40')](function(_0x32183d){_0x3a72ac['rows']=_0x32183d;return _0x3a72ac;})['then'](respondWithFilteredResult(_0x364b8e,_0x4e058e))[_0x7b05('0x43')](handleError(_0x364b8e,null));};exports[_0x7b05('0x44')]=function(_0x1d516d,_0x220477){var _0x1d0c00={'raw':![],'where':{'id':_0x1d516d[_0x7b05('0x45')]['id']}},_0x350e1d={};_0x350e1d[_0x7b05('0x2d')]=_['keys'](db[_0x7b05('0x29')][_0x7b05('0x2a')]);_0x350e1d[_0x7b05('0x2e')]=_[_0x7b05('0x2f')](_0x1d516d['query']);_0x350e1d[_0x7b05('0x30')]=_['intersection'](_0x350e1d[_0x7b05('0x2d')],_0x350e1d['query']);_0x1d0c00[_0x7b05('0x33')]=_['intersection'](_0x350e1d['model'],qs[_0x7b05('0x32')](_0x1d516d[_0x7b05('0x2e')][_0x7b05('0x32')]));_0x1d0c00[_0x7b05('0x33')]=_0x1d0c00[_0x7b05('0x33')]['length']?_0x1d0c00['attributes']:_0x350e1d[_0x7b05('0x2d')];if(_0x1d516d[_0x7b05('0x2e')][_0x7b05('0x41')]){_0x1d0c00['include']=[{'all':!![]}];}_0x1d0c00=_['merge']({},_0x1d0c00,_0x1d516d['options']);return db[_0x7b05('0x29')][_0x7b05('0x46')](_0x1d0c00)['then'](handleEntityNotFound(_0x220477,null))[_0x7b05('0x40')](respondWithResult(_0x220477,null))[_0x7b05('0x43')](handleError(_0x220477,null));};exports['create']=function(_0x2ae07a,_0x14d2c1){return db[_0x7b05('0x29')]['create'](_0x2ae07a['body'],{})[_0x7b05('0x40')](respondWithResult(_0x14d2c1,0xc9))[_0x7b05('0x43')](handleError(_0x14d2c1,null));};exports[_0x7b05('0x47')]=function(_0x7a5928,_0x4258db){return db[_0x7b05('0x29')][_0x7b05('0x47')](_0x7a5928[_0x7b05('0x48')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4258db,0xc9))[_0x7b05('0x43')](handleError(_0x4258db,null));};exports[_0x7b05('0x23')]=function(_0x779944,_0x4b2646){if(_0x779944[_0x7b05('0x48')]['id']){delete _0x779944[_0x7b05('0x48')]['id'];}return db[_0x7b05('0x29')][_0x7b05('0x46')]({'where':{'id':_0x779944[_0x7b05('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b2646,null))[_0x7b05('0x40')](saveUpdates(_0x779944[_0x7b05('0x48')],null))[_0x7b05('0x40')](respondWithResult(_0x4b2646,null))[_0x7b05('0x43')](handleError(_0x4b2646,null));};exports[_0x7b05('0x24')]=function(_0x2380da,_0x5f494d){return db[_0x7b05('0x29')]['find']({'where':{'id':_0x2380da[_0x7b05('0x45')]['id']}})[_0x7b05('0x40')](handleEntityNotFound(_0x5f494d,null))[_0x7b05('0x40')](removeEntity(_0x5f494d,null))[_0x7b05('0x43')](handleError(_0x5f494d,null));};exports['bulkDestroy']=function(_0x51b28a,_0x1bef95){return db[_0x7b05('0x29')]['destroy']({'where':{'id':_0x51b28a[_0x7b05('0x2e')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1bef95,0xcc))[_0x7b05('0x43')](handleError(_0x1bef95,null));};exports[_0x7b05('0x49')]=function(_0x48e860,_0x3988b1,_0x59d71e){return db[_0x7b05('0x4a')][_0x7b05('0x4b')]({'where':{'id':_0x48e860['params']['id']}})[_0x7b05('0x40')](handleEntityNotFound(_0x3988b1,null))['then'](function(_0x27b656){if(_0x27b656){return db[_0x7b05('0x4c')]['transaction'](function(_0x2e958e){return db['AnalyticFieldReport'][_0x7b05('0x24')]({'where':{'CustomReportId':_0x48e860['params']['id']},'transaction':_0x2e958e})['then'](function(_0x6a821a){var _0x394d6e=_['map'](_0x48e860['body'],function(_0x3ba940){delete _0x3ba940['id'];_0x3ba940['CustomReportId']=_0x48e860[_0x7b05('0x45')]['id'];return _0x3ba940;});return db[_0x7b05('0x29')][_0x7b05('0x47')](_0x394d6e,{'transaction':_0x2e958e});});})[_0x7b05('0x40')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x48e860[_0x7b05('0x45')]['id']}});});}})[_0x7b05('0x40')](respondWithResult(_0x3988b1,null))[_0x7b05('0x43')](handleError(_0x3988b1,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index ac597d1..b3f756c 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 _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 +var _0x19f8=['define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','path','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x21c6b8,_0x16d6f6){var _0x39d474=function(_0x27dbf5){while(--_0x27dbf5){_0x21c6b8['push'](_0x21c6b8['shift']());}};_0x39d474(++_0x16d6f6);}(_0x19f8,0xad));var _0x819f=function(_0x3acb67,_0xbe0faa){_0x3acb67=_0x3acb67-0x0;var _0x534936=_0x19f8[_0x3acb67];return _0x534936;};'use strict';var _=require(_0x819f('0x0'));var util=require(_0x819f('0x1'));var logger=require(_0x819f('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x819f('0x3'));var rimraf=require('rimraf');var config=require(_0x819f('0x4'));var attributes=require(_0x819f('0x5'));module[_0x819f('0x6')]=function(_0x398af0,_0x29f4c3){return _0x398af0[_0x819f('0x7')](_0x819f('0x8'),attributes,{'tableName':_0x819f('0x9'),'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 68669f0..6a23bfe 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 _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 +var _0xb517=['error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x21eb73,_0x2816ef){var _0x15817a=function(_0x109cc7){while(--_0x109cc7){_0x21eb73['push'](_0x21eb73['shift']());}};_0x15817a(++_0x2816ef);}(_0xb517,0x1d0));var _0x7b51=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0xb517[_0x291f8b];return _0x275171;};'use strict';var _=require('lodash');var util=require(_0x7b51('0x0'));var moment=require(_0x7b51('0x1'));var BPromise=require(_0x7b51('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b51('0x3'));var db=require(_0x7b51('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b51('0x5'))(_0x7b51('0x6'));var config=require('../../config/environment');var jayson=require(_0x7b51('0x7'));var client=jayson[_0x7b51('0x8')][_0x7b51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1da9f5,_0x113422,_0x52d9ea){return new BPromise(function(_0x164a25,_0x4dcda8){return client[_0x7b51('0xa')](_0x1da9f5,_0x52d9ea)[_0x7b51('0xb')](function(_0x2da363){logger[_0x7b51('0xc')](_0x7b51('0xd'),_0x113422,_0x7b51('0xe'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x113422,_0x7b51('0xe'),JSON[_0x7b51('0xf')](_0x2da363));if(_0x2da363[_0x7b51('0x10')]){if(_0x2da363[_0x7b51('0x10')]['code']===0x1f4){logger[_0x7b51('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x113422,_0x2da363[_0x7b51('0x10')]['message']);return _0x4dcda8(_0x2da363[_0x7b51('0x10')]['message']);}logger[_0x7b51('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x113422,_0x2da363['error'][_0x7b51('0x11')]);return _0x164a25(_0x2da363[_0x7b51('0x10')][_0x7b51('0x11')]);}else{logger['info'](_0x7b51('0xd'),_0x113422,_0x7b51('0xe'));_0x164a25(_0x2da363[_0x7b51('0x12')][_0x7b51('0x11')]);}})[_0x7b51('0x13')](function(_0x244cb9){logger[_0x7b51('0x10')](_0x7b51('0xd'),_0x113422,_0x244cb9);_0x4dcda8(_0x244cb9);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 35380d6..8e0f766 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(_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 +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(_0x31b812,_0x212b99){var _0x15a5c9=function(_0x5a6088){while(--_0x5a6088){_0x31b812['push'](_0x31b812['shift']());}};_0x15a5c9(++_0x212b99);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 91ca69b..2772bcd 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 _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 +var _0x639a=['exports','STRING','name','TEXT'];(function(_0x243e90,_0xf6cb71){var _0x3f2699=function(_0x38f76a){while(--_0x38f76a){_0x243e90['push'](_0x243e90['shift']());}};_0x3f2699(++_0xf6cb71);}(_0x639a,0xec));var _0xa639=function(_0x2c339b,_0x153b16){_0x2c339b=_0x2c339b-0x0;var _0x558a46=_0x639a[_0x2c339b];return _0x558a46;};'use strict';var Sequelize=require('sequelize');module[_0xa639('0x0')]={'name':{'type':Sequelize[_0xa639('0x1')],'allowNull':![],'unique':_0xa639('0x2')},'table':{'type':Sequelize[_0xa639('0x1')]},'metric':{'type':Sequelize[_0xa639('0x3')]},'description':{'type':Sequelize[_0xa639('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 1326752..ccccfb9 100644 --- a/server/api/analyticMetric/analyticMetric.controller.js +++ b/server/api/analyticMetric/analyticMetric.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_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 +var _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x20bf8b,_0xd36fdc){var _0x1a9de7=function(_0x1d0dff){while(--_0x1d0dff){_0x20bf8b['push'](_0x20bf8b['shift']());}};_0x1a9de7(++_0xd36fdc);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x34c2d4,_0x418ed2){_0x34c2d4=_0x34c2d4-0x0;var _0x38796a=_0x7fbe[_0x34c2d4];return _0x38796a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 3f13d3e..729a830 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 _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 +var _0x3f1c=['AnalyticMetric','analytics_metrics','lodash','api','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','define'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x3f1c,0xd4));var _0xc3f1=function(_0x2ea0a2,_0xeadd1a){_0x2ea0a2=_0x2ea0a2-0x0;var _0x3d8b3c=_0x3f1c[_0x2ea0a2];return _0x3d8b3c;};'use strict';var _=require(_0xc3f1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc3f1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc3f1('0x2'));var fs=require('fs');var path=require(_0xc3f1('0x3'));var rimraf=require(_0xc3f1('0x4'));var config=require(_0xc3f1('0x5'));var attributes=require(_0xc3f1('0x6'));module['exports']=function(_0x12e78a,_0x4ebd4c){return _0x12e78a[_0xc3f1('0x7')](_0xc3f1('0x8'),attributes,{'tableName':_0xc3f1('0x9'),'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 725a10d..78b5178 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 _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 +var _0x6b30=['error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x35e083,_0x3ba806){var _0x555a8a=function(_0x5a32a0){while(--_0x5a32a0){_0x35e083['push'](_0x35e083['shift']());}};_0x555a8a(++_0x3ba806);}(_0x6b30,0x14b));var _0x06b3=function(_0x30bd01,_0x557a2c){_0x30bd01=_0x30bd01-0x0;var _0x44cdc3=_0x6b30[_0x30bd01];return _0x44cdc3;};'use strict';var _=require(_0x06b3('0x0'));var util=require(_0x06b3('0x1'));var moment=require(_0x06b3('0x2'));var BPromise=require(_0x06b3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x06b3('0x5'));var logger=require(_0x06b3('0x6'))(_0x06b3('0x7'));var config=require(_0x06b3('0x8'));var jayson=require(_0x06b3('0x9'));var client=jayson[_0x06b3('0xa')][_0x06b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b228c,_0x5ca309,_0x4406d1){return new BPromise(function(_0x11f583,_0x259fe7){return client[_0x06b3('0xc')](_0x1b228c,_0x4406d1)[_0x06b3('0xd')](function(_0xf92b2e){logger[_0x06b3('0xe')](_0x06b3('0xf'),_0x5ca309,'request\x20sent');logger[_0x06b3('0x10')](_0x06b3('0x11'),_0x5ca309,'request\x20sent',JSON[_0x06b3('0x12')](_0xf92b2e));if(_0xf92b2e[_0x06b3('0x13')]){if(_0xf92b2e[_0x06b3('0x13')][_0x06b3('0x14')]===0x1f4){logger['error'](_0x06b3('0xf'),_0x5ca309,_0xf92b2e['error'][_0x06b3('0x15')]);return _0x259fe7(_0xf92b2e[_0x06b3('0x13')][_0x06b3('0x15')]);}logger[_0x06b3('0x13')](_0x06b3('0xf'),_0x5ca309,_0xf92b2e[_0x06b3('0x13')]['message']);return _0x11f583(_0xf92b2e[_0x06b3('0x13')]['message']);}else{logger[_0x06b3('0xe')](_0x06b3('0xf'),_0x5ca309,_0x06b3('0x16'));_0x11f583(_0xf92b2e[_0x06b3('0x17')][_0x06b3('0x15')]);}})[_0x06b3('0x18')](function(_0x1eb777){logger['error'](_0x06b3('0xf'),_0x5ca309,_0x1eb777);_0x259fe7(_0x1eb777);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 08c5366..e92edff 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 _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 +var _0x3eea=['get','isAuthenticated','/:id','show','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x54a25e,_0x10311c){var _0x4f4d2b=function(_0x4f587a){while(--_0x4f587a){_0x54a25e['push'](_0x54a25e['shift']());}};_0x4f4d2b(++_0x10311c);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x19df14,_0x15cd6e){_0x19df14=_0x19df14-0x0;var _0x143c54=_0x3eea[_0x19df14];return _0x143c54;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')]('/',auth[_0xa3ee('0xb')](),controller['index']);router['get'](_0xa3ee('0xc'),auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['post']('/',auth[_0xa3ee('0xb')](),controller['create']);router[_0xa3ee('0xe')]('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0xf')]);router[_0xa3ee('0x10')]('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 2499027..1285a37 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 _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 +var _0xbf9a=['exports','TEXT'];(function(_0x4c4c86,_0x28a958){var _0x282ef8=function(_0x2f50f7){while(--_0x2f50f7){_0x4c4c86['push'](_0x4c4c86['shift']());}};_0x282ef8(++_0x28a958);}(_0xbf9a,0x18c));var _0xabf9=function(_0x2998db,_0x3424f1){_0x2998db=_0x2998db-0x0;var _0x115fea=_0xbf9a[_0x2998db];return _0x115fea;};'use strict';var Sequelize=require('sequelize');module[_0xabf9('0x0')]={'tree':{'type':Sequelize[_0xabf9('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 c0573e8..1663d95 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 _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 +var _0x9057=['destroy','then','error','stack','name','send','map','fieldName','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','params','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','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/environment','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','update'];(function(_0x29f2e7,_0x31287f){var _0x382f7b=function(_0x5bf241){while(--_0x5bf241){_0x29f2e7['push'](_0x29f2e7['shift']());}};_0x382f7b(++_0x31287f);}(_0x9057,0x154));var _0x7905=function(_0x101134,_0x1ed1d3){_0x101134=_0x101134-0x0;var _0xc47acc=_0x9057[_0x101134];return _0xc47acc;};'use strict';var emlformat=require(_0x7905('0x0'));var rimraf=require(_0x7905('0x1'));var zipdir=require(_0x7905('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7905('0x3'));var moment=require(_0x7905('0x4'));var BPromise=require(_0x7905('0x5'));var Mustache=require(_0x7905('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7905('0x7'));var csv=require(_0x7905('0x8'));var ejs=require(_0x7905('0x9'));var fs=require('fs');var fs_extra=require(_0x7905('0xa'));var _=require(_0x7905('0xb'));var squel=require('squel');var crypto=require(_0x7905('0xc'));var jsforce=require(_0x7905('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7905('0x8'));var querystring=require('querystring');var Papa=require(_0x7905('0xe'));var Redis=require(_0x7905('0xf'));var authService=require(_0x7905('0x10'));var qs=require(_0x7905('0x11'));var as=require(_0x7905('0x12'));var hardwareService=require(_0x7905('0x13'));var logger=require(_0x7905('0x14'))(_0x7905('0x15'));var utils=require(_0x7905('0x16'));var config=require(_0x7905('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bd483,_0x180c13){_0x180c13=_0x180c13||0xcc;return function(_0x2fb1dd){if(_0x2fb1dd){return _0x3bd483[_0x7905('0x18')](_0x180c13);}return _0x3bd483[_0x7905('0x19')](_0x180c13)[_0x7905('0x1a')]();};}function respondWithResult(_0x37f885,_0x49916c){_0x49916c=_0x49916c||0xc8;return function(_0x31725f){if(_0x31725f){return _0x37f885[_0x7905('0x19')](_0x49916c)[_0x7905('0x1b')](_0x31725f);}};}function respondWithFilteredResult(_0x425ae6,_0x40db76){return function(_0x1daf8a){if(_0x1daf8a){var _0x3e5b0c=typeof _0x40db76[_0x7905('0x1c')]==='undefined'&&typeof _0x40db76[_0x7905('0x1d')]===_0x7905('0x1e');var _0x5670a6=_0x1daf8a[_0x7905('0x1f')];var _0x57cd80=_0x3e5b0c?0x0:_0x40db76[_0x7905('0x1c')];var _0x6eb6f4=_0x3e5b0c?_0x1daf8a[_0x7905('0x1f')]:_0x40db76[_0x7905('0x1c')]+_0x40db76[_0x7905('0x1d')];var _0x157c22;if(_0x6eb6f4>=_0x5670a6){_0x6eb6f4=_0x5670a6;_0x157c22=0xc8;}else{_0x157c22=0xce;}_0x425ae6[_0x7905('0x19')](_0x157c22);return _0x425ae6['set'](_0x7905('0x20'),_0x57cd80+'-'+_0x6eb6f4+'/'+_0x5670a6)[_0x7905('0x1b')](_0x1daf8a);}return null;};}function patchUpdates(_0x2f72a5){return function(_0x555d37){try{jsonpatch['apply'](_0x555d37,_0x2f72a5,!![]);}catch(_0x53e719){return BPromise[_0x7905('0x21')](_0x53e719);}return _0x555d37['save']();};}function saveUpdates(_0x2e08c9,_0x136a2a){return function(_0x152f55){if(_0x152f55){return _0x152f55[_0x7905('0x22')](_0x2e08c9)['then'](function(_0x3dfdb3){return _0x3dfdb3;});}return null;};}function removeEntity(_0x2c1f85,_0x5daa8e){return function(_0x103a1b){if(_0x103a1b){return _0x103a1b[_0x7905('0x23')]()[_0x7905('0x24')](function(){_0x2c1f85[_0x7905('0x19')](0xcc)[_0x7905('0x1a')]();});}};}function handleEntityNotFound(_0x5daac2,_0x5a884e){return function(_0x2d0bc0){if(!_0x2d0bc0){_0x5daac2['sendStatus'](0x194);}return _0x2d0bc0;};}function handleError(_0x2a7619,_0x3c5b22){_0x3c5b22=_0x3c5b22||0x1f4;return function(_0x301785){logger[_0x7905('0x25')](_0x301785[_0x7905('0x26')]);if(_0x301785['name']){delete _0x301785[_0x7905('0x27')];}_0x2a7619['status'](_0x3c5b22)[_0x7905('0x28')](_0x301785);};}exports['index']=function(_0x5975ff,_0x3ddaf7){var _0x25ecce={},_0x54ac26={},_0x2401fb={'count':0x0,'rows':[]};var _0x2c81c0=_[_0x7905('0x29')](db['AnalyticTreeReport']['rawAttributes'],function(_0x5a03a8){return{'name':_0x5a03a8[_0x7905('0x2a')],'type':_0x5a03a8['type'][_0x7905('0x2b')]};});_0x54ac26['model']=_['map'](_0x2c81c0,_0x7905('0x27'));_0x54ac26[_0x7905('0x2c')]=_[_0x7905('0x2d')](_0x5975ff[_0x7905('0x2c')]);_0x54ac26[_0x7905('0x2e')]=_[_0x7905('0x2f')](_0x54ac26['model'],_0x54ac26[_0x7905('0x2c')]);_0x25ecce[_0x7905('0x30')]=_[_0x7905('0x2f')](_0x54ac26['model'],qs[_0x7905('0x31')](_0x5975ff[_0x7905('0x2c')][_0x7905('0x31')]));_0x25ecce[_0x7905('0x30')]=_0x25ecce['attributes'][_0x7905('0x32')]?_0x25ecce['attributes']:_0x54ac26[_0x7905('0x33')];if(!_0x5975ff[_0x7905('0x2c')][_0x7905('0x34')](_0x7905('0x35'))){_0x25ecce['limit']=qs['limit'](_0x5975ff[_0x7905('0x2c')][_0x7905('0x1d')]);_0x25ecce[_0x7905('0x1c')]=qs[_0x7905('0x1c')](_0x5975ff[_0x7905('0x2c')][_0x7905('0x1c')]);}_0x25ecce[_0x7905('0x36')]=qs[_0x7905('0x37')](_0x5975ff['query'][_0x7905('0x37')]);_0x25ecce[_0x7905('0x38')]=qs[_0x7905('0x2e')](_[_0x7905('0x39')](_0x5975ff[_0x7905('0x2c')],_0x54ac26[_0x7905('0x2e')]),_0x2c81c0);if(_0x5975ff['query'][_0x7905('0x3a')]){_0x25ecce['where']=_[_0x7905('0x3b')](_0x25ecce[_0x7905('0x38')],{'$or':_[_0x7905('0x29')](_0x2c81c0,function(_0x539424){if(_0x539424[_0x7905('0x3c')]!==_0x7905('0x3d')){var _0x2280c4={};_0x2280c4[_0x539424[_0x7905('0x27')]]={'$like':'%'+_0x5975ff[_0x7905('0x2c')]['filter']+'%'};return _0x2280c4;}})});}_0x25ecce=_[_0x7905('0x3b')]({},_0x25ecce,_0x5975ff[_0x7905('0x3e')]);var _0x4b5704={'where':_0x25ecce[_0x7905('0x38')]};return db[_0x7905('0x3f')][_0x7905('0x1f')](_0x4b5704)[_0x7905('0x24')](function(_0x1e62ec){_0x2401fb[_0x7905('0x1f')]=_0x1e62ec;if(_0x5975ff[_0x7905('0x2c')][_0x7905('0x40')]){_0x25ecce[_0x7905('0x41')]=[{'all':!![]}];}return db[_0x7905('0x3f')][_0x7905('0x42')](_0x25ecce);})['then'](function(_0xf05f56){_0x2401fb[_0x7905('0x43')]=_0xf05f56;return _0x2401fb;})[_0x7905('0x24')](respondWithFilteredResult(_0x3ddaf7,_0x25ecce))[_0x7905('0x44')](handleError(_0x3ddaf7,null));};exports[_0x7905('0x45')]=function(_0xd3d0f,_0x2c137a){var _0x362f68={'raw':!![],'where':{'id':_0xd3d0f['params']['id']}},_0x5369be={};_0x5369be[_0x7905('0x33')]=_[_0x7905('0x2d')](db['AnalyticTreeReport'][_0x7905('0x46')]);_0x5369be[_0x7905('0x2c')]=_['keys'](_0xd3d0f[_0x7905('0x2c')]);_0x5369be[_0x7905('0x2e')]=_[_0x7905('0x2f')](_0x5369be['model'],_0x5369be[_0x7905('0x2c')]);_0x362f68[_0x7905('0x30')]=_[_0x7905('0x2f')](_0x5369be[_0x7905('0x33')],qs['fields'](_0xd3d0f['query']['fields']));_0x362f68[_0x7905('0x30')]=_0x362f68[_0x7905('0x30')][_0x7905('0x32')]?_0x362f68[_0x7905('0x30')]:_0x5369be[_0x7905('0x33')];if(_0xd3d0f['query'][_0x7905('0x40')]){_0x362f68[_0x7905('0x41')]=[{'all':!![]}];}_0x362f68=_[_0x7905('0x3b')]({},_0x362f68,_0xd3d0f['options']);return db[_0x7905('0x3f')]['find'](_0x362f68)[_0x7905('0x24')](handleEntityNotFound(_0x2c137a,null))['then'](respondWithResult(_0x2c137a,null))[_0x7905('0x44')](handleError(_0x2c137a,null));};exports['create']=function(_0x382ea6,_0x1ecf31){return db['AnalyticTreeReport'][_0x7905('0x47')](_0x382ea6[_0x7905('0x48')],{})[_0x7905('0x24')](respondWithResult(_0x1ecf31,0xc9))[_0x7905('0x44')](handleError(_0x1ecf31,null));};exports[_0x7905('0x22')]=function(_0x118e2b,_0x577724){if(_0x118e2b[_0x7905('0x48')]['id']){delete _0x118e2b['body']['id'];}return db[_0x7905('0x3f')]['find']({'where':{'id':_0x118e2b[_0x7905('0x49')]['id']}})[_0x7905('0x24')](handleEntityNotFound(_0x577724,null))['then'](saveUpdates(_0x118e2b[_0x7905('0x48')],null))[_0x7905('0x24')](respondWithResult(_0x577724,null))[_0x7905('0x44')](handleError(_0x577724,null));};exports[_0x7905('0x23')]=function(_0x5c0988,_0x247325){return db[_0x7905('0x3f')][_0x7905('0x4a')]({'where':{'id':_0x5c0988[_0x7905('0x49')]['id']}})['then'](handleEntityNotFound(_0x247325,null))['then'](removeEntity(_0x247325,null))[_0x7905('0x44')](handleError(_0x247325,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 1f29a3c..6c2ff7d 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 _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 +var _0x3aec=['AnalyticTreeReport','analytics_report_trees','../../config/logger','api','moment','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x14f445,_0x2b24f9){var _0x3d4951=function(_0x2a5573){while(--_0x2a5573){_0x14f445['push'](_0x14f445['shift']());}};_0x3d4951(++_0x2b24f9);}(_0x3aec,0xfe));var _0xc3ae=function(_0x22f85a,_0x195ed5){_0x22f85a=_0x22f85a-0x0;var _0xaa717=_0x3aec[_0x22f85a];return _0xaa717;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc3ae('0x0'))(_0xc3ae('0x1'));var moment=require(_0xc3ae('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc3ae('0x3'));var attributes=require(_0xc3ae('0x4'));module[_0xc3ae('0x5')]=function(_0x5d58a1,_0x7240de){return _0x5d58a1[_0xc3ae('0x6')](_0xc3ae('0x7'),attributes,{'tableName':_0xc3ae('0x8'),'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 b54d678..094494b 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 _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 +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x1ed791,_0x3c86aa){var _0xea6482=function(_0x168cc9){while(--_0x168cc9){_0x1ed791['push'](_0x1ed791['shift']());}};_0xea6482(++_0x3c86aa);}(_0x2ef3,0xba));var _0x32ef=function(_0x22afde,_0x4ae892){_0x22afde=_0x22afde-0x0;var _0x19651b=_0x2ef3[_0x22afde];return _0x19651b;};'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')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index afdad96..510bc05 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 _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 +var _0x3dc2=['create','put','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','post'];(function(_0x1121db,_0x54f0a1){var _0x54dae0=function(_0x46e738){while(--_0x46e738){_0x1121db['push'](_0x1121db['shift']());}};_0x54dae0(++_0x54f0a1);}(_0x3dc2,0x1f2));var _0x23dc=function(_0x5dc3b2,_0x4a4d7f){_0x5dc3b2=_0x5dc3b2-0x0;var _0x4e3382=_0x3dc2[_0x5dc3b2];return _0x4e3382;};'use strict';var multer=require(_0x23dc('0x0'));var util=require(_0x23dc('0x1'));var path=require('path');var timeout=require(_0x23dc('0x2'));var express=require('express');var router=express[_0x23dc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x23dc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x23dc('0x5'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0x23dc('0x6')](),controller[_0x23dc('0x7')]);router[_0x23dc('0x8')](_0x23dc('0x9'),auth['isAuthenticated'](),controller[_0x23dc('0xa')]);router[_0x23dc('0xb')]('/',auth[_0x23dc('0x6')](),controller[_0x23dc('0xc')]);router[_0x23dc('0xd')](_0x23dc('0x9'),auth[_0x23dc('0x6')](),controller['update']);router[_0x23dc('0xe')](_0x23dc('0x9'),auth[_0x23dc('0x6')](),controller[_0x23dc('0xf')]);module[_0x23dc('0x10')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index fe81616..f5ed718 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 _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 +var _0x46fc=['STRING','sequelize','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x46fc,0x103));var _0xc46f=function(_0x4ca26c,_0x44d6f1){_0x4ca26c=_0x4ca26c-0x0;var _0x25b914=_0x46fc[_0x4ca26c];return _0x25b914;};'use strict';var Sequelize=require(_0xc46f('0x0'));module[_0xc46f('0x1')]={'name':{'type':Sequelize[_0xc46f('0x2')]},'basename':{'type':Sequelize[_0xc46f('0x2')]},'type':{'type':Sequelize[_0xc46f('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 0c86f8d..aa57b50 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 _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 +var _0xc2e9=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','apply','reject','update','then','destroy','error','stack','name','index','map','Attachment','rawAttributes','fieldName','key','keys','query','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','includeAll','include','catch','show','params','intersection','options','find','clone','get','omit','updatedAt','body','createdAt','create','file','originalname','filename','mimetype','download','findOne','server/files/attachments/','join','offline-chat/','basename','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xc2e9,0x1f4));var _0x9c2e=function(_0x47db8d,_0x268411){_0x47db8d=_0x47db8d-0x0;var _0x3283ef=_0xc2e9[_0x47db8d];return _0x3283ef;};'use strict';var emlformat=require(_0x9c2e('0x0'));var rimraf=require(_0x9c2e('0x1'));var zipdir=require(_0x9c2e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9c2e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9c2e('0x4'));var util=require(_0x9c2e('0x5'));var path=require(_0x9c2e('0x6'));var sox=require(_0x9c2e('0x7'));var csv=require(_0x9c2e('0x8'));var ejs=require(_0x9c2e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9c2e('0xa'));var squel=require(_0x9c2e('0xb'));var crypto=require('crypto');var jsforce=require(_0x9c2e('0xc'));var deskjs=require(_0x9c2e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9c2e('0xe'));var Papa=require(_0x9c2e('0xf'));var Redis=require(_0x9c2e('0x10'));var authService=require(_0x9c2e('0x11'));var qs=require(_0x9c2e('0x12'));var as=require(_0x9c2e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9c2e('0x14'));var licenseUtil=require(_0x9c2e('0x15'));var db=require(_0x9c2e('0x16'))['db'];function respondWithStatusCode(_0x31a719,_0xe1a4d){_0xe1a4d=_0xe1a4d||0xcc;return function(_0x5571b1){if(_0x5571b1){return _0x31a719[_0x9c2e('0x17')](_0xe1a4d);}return _0x31a719['status'](_0xe1a4d)[_0x9c2e('0x18')]();};}function respondWithResult(_0x4aa843,_0x39e132){_0x39e132=_0x39e132||0xc8;return function(_0x19d144){if(_0x19d144){return _0x4aa843['status'](_0x39e132)[_0x9c2e('0x19')](_0x19d144);}};}function respondWithFilteredResult(_0x3a5e8d,_0x91b655){return function(_0xb8a614){if(_0xb8a614){var _0xa2a9b=typeof _0x91b655[_0x9c2e('0x1a')]===_0x9c2e('0x1b')&&typeof _0x91b655[_0x9c2e('0x1c')]==='undefined';var _0x56c9d9=_0xb8a614[_0x9c2e('0x1d')];var _0x55d7b6=_0xa2a9b?0x0:_0x91b655[_0x9c2e('0x1a')];var _0x1961b7=_0xa2a9b?_0xb8a614['count']:_0x91b655[_0x9c2e('0x1a')]+_0x91b655[_0x9c2e('0x1c')];var _0x58c911;if(_0x1961b7>=_0x56c9d9){_0x1961b7=_0x56c9d9;_0x58c911=0xc8;}else{_0x58c911=0xce;}_0x3a5e8d[_0x9c2e('0x1e')](_0x58c911);return _0x3a5e8d['set']('Content-Range',_0x55d7b6+'-'+_0x1961b7+'/'+_0x56c9d9)['json'](_0xb8a614);}return null;};}function patchUpdates(_0x1fff81){return function(_0x462130){try{jsonpatch[_0x9c2e('0x1f')](_0x462130,_0x1fff81,!![]);}catch(_0x2edf21){return BPromise[_0x9c2e('0x20')](_0x2edf21);}return _0x462130['save']();};}function saveUpdates(_0x4910ef,_0x389102){return function(_0xfd9df6){if(_0xfd9df6){return _0xfd9df6[_0x9c2e('0x21')](_0x4910ef)[_0x9c2e('0x22')](function(_0x318395){return _0x318395;});}return null;};}function removeEntity(_0x48ba09,_0x2dd314){return function(_0x29fb74){if(_0x29fb74){return _0x29fb74[_0x9c2e('0x23')]()['then'](function(){_0x48ba09[_0x9c2e('0x1e')](0xcc)[_0x9c2e('0x18')]();});}};}function handleEntityNotFound(_0x3f03dc,_0x157630){return function(_0xda0f54){if(!_0xda0f54){_0x3f03dc[_0x9c2e('0x17')](0x194);}return _0xda0f54;};}function handleError(_0x6cfc13,_0x5cc656){_0x5cc656=_0x5cc656||0x1f4;return function(_0x4ecf1c){logger[_0x9c2e('0x24')](_0x4ecf1c[_0x9c2e('0x25')]);if(_0x4ecf1c[_0x9c2e('0x26')]){delete _0x4ecf1c[_0x9c2e('0x26')];}_0x6cfc13['status'](_0x5cc656)['send'](_0x4ecf1c);};}exports[_0x9c2e('0x27')]=function(_0x44f003,_0x411254){var _0x1e5b38={},_0x519601={},_0x2b5949={'count':0x0,'rows':[]};var _0x4b4cfa=_[_0x9c2e('0x28')](db[_0x9c2e('0x29')][_0x9c2e('0x2a')],function(_0x23bd4c){return{'name':_0x23bd4c[_0x9c2e('0x2b')],'type':_0x23bd4c['type'][_0x9c2e('0x2c')]};});_0x519601['model']=_[_0x9c2e('0x28')](_0x4b4cfa,_0x9c2e('0x26'));_0x519601['query']=_[_0x9c2e('0x2d')](_0x44f003[_0x9c2e('0x2e')]);_0x519601[_0x9c2e('0x2f')]=_['intersection'](_0x519601[_0x9c2e('0x30')],_0x519601[_0x9c2e('0x2e')]);_0x1e5b38[_0x9c2e('0x31')]=_['intersection'](_0x519601[_0x9c2e('0x30')],qs['fields'](_0x44f003[_0x9c2e('0x2e')][_0x9c2e('0x32')]));_0x1e5b38[_0x9c2e('0x31')]=_0x1e5b38[_0x9c2e('0x31')][_0x9c2e('0x33')]?_0x1e5b38['attributes']:_0x519601[_0x9c2e('0x30')];if(!_0x44f003[_0x9c2e('0x2e')][_0x9c2e('0x34')]('nolimit')){_0x1e5b38[_0x9c2e('0x1c')]=qs[_0x9c2e('0x1c')](_0x44f003[_0x9c2e('0x2e')][_0x9c2e('0x1c')]);_0x1e5b38[_0x9c2e('0x1a')]=qs[_0x9c2e('0x1a')](_0x44f003[_0x9c2e('0x2e')][_0x9c2e('0x1a')]);}_0x1e5b38[_0x9c2e('0x35')]=qs[_0x9c2e('0x36')](_0x44f003['query'][_0x9c2e('0x36')]);_0x1e5b38[_0x9c2e('0x37')]=qs[_0x9c2e('0x2f')](_[_0x9c2e('0x38')](_0x44f003[_0x9c2e('0x2e')],_0x519601[_0x9c2e('0x2f')]),_0x4b4cfa);if(_0x44f003[_0x9c2e('0x2e')][_0x9c2e('0x39')]){_0x1e5b38[_0x9c2e('0x37')]=_[_0x9c2e('0x3a')](_0x1e5b38[_0x9c2e('0x37')],{'$or':_[_0x9c2e('0x28')](_0x4b4cfa,function(_0x493e84){if(_0x493e84[_0x9c2e('0x3b')]!=='VIRTUAL'){var _0xd9a530={};_0xd9a530[_0x493e84[_0x9c2e('0x26')]]={'$like':'%'+_0x44f003[_0x9c2e('0x2e')][_0x9c2e('0x39')]+'%'};return _0xd9a530;}})});}_0x1e5b38=_[_0x9c2e('0x3a')]({},_0x1e5b38,_0x44f003['options']);var _0x31eb42={'where':_0x1e5b38[_0x9c2e('0x37')]};return db[_0x9c2e('0x29')][_0x9c2e('0x1d')](_0x31eb42)[_0x9c2e('0x22')](function(_0x3eade4){_0x2b5949[_0x9c2e('0x1d')]=_0x3eade4;if(_0x44f003[_0x9c2e('0x2e')][_0x9c2e('0x3c')]){_0x1e5b38[_0x9c2e('0x3d')]=[{'all':!![]}];}return db[_0x9c2e('0x29')]['findAll'](_0x1e5b38);})[_0x9c2e('0x22')](function(_0x3d3ac0){_0x2b5949['rows']=_0x3d3ac0;return _0x2b5949;})[_0x9c2e('0x22')](respondWithFilteredResult(_0x411254,_0x1e5b38))[_0x9c2e('0x3e')](handleError(_0x411254,null));};exports[_0x9c2e('0x3f')]=function(_0x31ce09,_0x542de2){var _0x519fd1={'raw':!![],'where':{'id':_0x31ce09[_0x9c2e('0x40')]['id']}},_0x3dc042={};_0x3dc042['model']=_[_0x9c2e('0x2d')](db[_0x9c2e('0x29')][_0x9c2e('0x2a')]);_0x3dc042['query']=_[_0x9c2e('0x2d')](_0x31ce09[_0x9c2e('0x2e')]);_0x3dc042[_0x9c2e('0x2f')]=_['intersection'](_0x3dc042[_0x9c2e('0x30')],_0x3dc042[_0x9c2e('0x2e')]);_0x519fd1[_0x9c2e('0x31')]=_[_0x9c2e('0x41')](_0x3dc042[_0x9c2e('0x30')],qs[_0x9c2e('0x32')](_0x31ce09[_0x9c2e('0x2e')][_0x9c2e('0x32')]));_0x519fd1['attributes']=_0x519fd1[_0x9c2e('0x31')]['length']?_0x519fd1[_0x9c2e('0x31')]:_0x3dc042[_0x9c2e('0x30')];if(_0x31ce09[_0x9c2e('0x2e')]['includeAll']){_0x519fd1[_0x9c2e('0x3d')]=[{'all':!![]}];}_0x519fd1=_[_0x9c2e('0x3a')]({},_0x519fd1,_0x31ce09[_0x9c2e('0x42')]);return db['Attachment'][_0x9c2e('0x43')](_0x519fd1)['then'](handleEntityNotFound(_0x542de2,null))[_0x9c2e('0x22')](respondWithResult(_0x542de2,null))[_0x9c2e('0x3e')](handleError(_0x542de2,null));};exports[_0x9c2e('0x44')]=function(_0x3cfa39,_0x1b36c6){var _0x45ac9e={'where':{'id':_0x3cfa39[_0x9c2e('0x40')]['id']}},_0x10a379={};_0x10a379[_0x9c2e('0x30')]=_[_0x9c2e('0x2d')](db[_0x9c2e('0x29')]['rawAttributes']);_0x45ac9e['attributes']=_['intersection'](_0x10a379['model'],qs['fields'](_0x3cfa39['query'][_0x9c2e('0x32')]));_0x45ac9e['attributes']=_0x45ac9e[_0x9c2e('0x31')][_0x9c2e('0x33')]?_0x45ac9e[_0x9c2e('0x31')]:_0x10a379[_0x9c2e('0x30')];if(_0x3cfa39[_0x9c2e('0x2e')][_0x9c2e('0x3c')]){_0x45ac9e[_0x9c2e('0x3d')]=[{'all':!![]}];}_0x45ac9e=_[_0x9c2e('0x3a')]({},_0x45ac9e,_0x3cfa39['options']);return db['Attachment']['find'](_0x45ac9e)[_0x9c2e('0x22')](handleEntityNotFound(_0x1b36c6,null))[_0x9c2e('0x22')](function(_0x164462){if(_0x164462){var _0x7cc16d=_0x164462[_0x9c2e('0x45')]({'plain':!![]});_0x7cc16d=qs[_0x9c2e('0x46')](_0x7cc16d,['id','createdAt',_0x9c2e('0x47')]);_0x3cfa39['body']=_[_0x9c2e('0x46')](_0x3cfa39[_0x9c2e('0x48')],['id',_0x9c2e('0x49'),_0x9c2e('0x47')]);return db[_0x9c2e('0x29')]['create'](_[_0x9c2e('0x3a')](_0x7cc16d,_0x3cfa39[_0x9c2e('0x48')]),{'include':_0x3cfa39[_0x9c2e('0x2e')][_0x9c2e('0x3c')]?[{'all':!![]}]:undefined});}})[_0x9c2e('0x22')](respondWithResult(_0x1b36c6,0xc9))[_0x9c2e('0x3e')](handleError(_0x1b36c6,null));};exports[_0x9c2e('0x21')]=function(_0xed4b5d,_0x55c0c5){if(_0xed4b5d['body']['id']){delete _0xed4b5d[_0x9c2e('0x48')]['id'];}return db['Attachment'][_0x9c2e('0x43')]({'where':{'id':_0xed4b5d['params']['id']}})[_0x9c2e('0x22')](handleEntityNotFound(_0x55c0c5,null))[_0x9c2e('0x22')](saveUpdates(_0xed4b5d[_0x9c2e('0x48')],null))['then'](respondWithResult(_0x55c0c5,null))[_0x9c2e('0x3e')](handleError(_0x55c0c5,null));};exports[_0x9c2e('0x23')]=function(_0x2df3c5,_0x2a6914){return db['Attachment'][_0x9c2e('0x43')]({'where':{'id':_0x2df3c5[_0x9c2e('0x40')]['id']}})[_0x9c2e('0x22')](handleEntityNotFound(_0x2a6914,null))[_0x9c2e('0x22')](removeEntity(_0x2a6914,null))[_0x9c2e('0x3e')](handleError(_0x2a6914,null));};exports[_0x9c2e('0x4a')]=function(_0xa5a0a7,_0x454ad1,_0x535b6a){_0xa5a0a7['body'][_0x9c2e('0x26')]=_0xa5a0a7[_0x9c2e('0x4b')][_0x9c2e('0x4c')];_0xa5a0a7[_0x9c2e('0x48')]['basename']=_0xa5a0a7[_0x9c2e('0x4b')][_0x9c2e('0x4d')];_0xa5a0a7['body']['type']=_0xa5a0a7[_0x9c2e('0x4b')][_0x9c2e('0x4e')];return db[_0x9c2e('0x29')][_0x9c2e('0x4a')](_0xa5a0a7[_0x9c2e('0x48')])[_0x9c2e('0x22')](respondWithResult(_0x454ad1,0xc9))[_0x9c2e('0x3e')](handleError(_0x454ad1,null));};exports[_0x9c2e('0x4f')]=function(_0x3cace5,_0x473680,_0x1b87f9){return db['Attachment'][_0x9c2e('0x50')]({'where':{'id':_0x3cace5[_0x9c2e('0x40')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x473680,null))[_0x9c2e('0x22')](function(_0x1e14d9){if(_0x1e14d9){var _0x45073a=_0x1e14d9['ChatOfflineMessageId']!==null;var _0x10db42=path['join'](config['root'],_0x9c2e('0x51'));if(_0x45073a){_0x10db42=path[_0x9c2e('0x52')](_0x10db42,_0x9c2e('0x53'));}var _0x286fba=path[_0x9c2e('0x52')](_0x10db42,_0x1e14d9[_0x9c2e('0x54')]);return _0x473680[_0x9c2e('0x4f')](_0x286fba);}})[_0x9c2e('0x3e')](handleError(_0x473680,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 7de6972..704f186 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 _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 +var _0xf957=['rimraf','../../config/environment','./attachment.attributes','Attachment','attachments','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x5004ed,_0x2b1ab6){var _0x467590=function(_0x495ada){while(--_0x495ada){_0x5004ed['push'](_0x5004ed['shift']());}};_0x467590(++_0x2b1ab6);}(_0xf957,0xaa));var _0x7f95=function(_0x421612,_0x1ed085){_0x421612=_0x421612-0x0;var _0x5a4787=_0xf957[_0x421612];return _0x5a4787;};'use strict';var _=require(_0x7f95('0x0'));var util=require('util');var logger=require(_0x7f95('0x1'))(_0x7f95('0x2'));var moment=require('moment');var BPromise=require(_0x7f95('0x3'));var rp=require(_0x7f95('0x4'));var fs=require('fs');var path=require(_0x7f95('0x5'));var rimraf=require(_0x7f95('0x6'));var config=require(_0x7f95('0x7'));var attributes=require(_0x7f95('0x8'));module['exports']=function(_0x512ae0,_0x523ffd){return _0x512ae0['define'](_0x7f95('0x9'),attributes,{'tableName':_0x7f95('0xa'),'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 d60eddd..7ed8503 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 _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 +var _0x4c6d=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','then'];(function(_0xe2e672,_0x1263c9){var _0x4d8e80=function(_0x2811e9){while(--_0x2811e9){_0xe2e672['push'](_0xe2e672['shift']());}};_0x4d8e80(++_0x1263c9);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0xfea29f,_0x1d2f22){_0xfea29f=_0xfea29f-0x0;var _0x2935ba=_0x4c6d[_0xfea29f];return _0x2935ba;};'use strict';var _=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var moment=require(_0xd4c6('0x2'));var BPromise=require(_0xd4c6('0x3'));var rs=require(_0xd4c6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4c6('0x5'))['db'];var utils=require(_0xd4c6('0x6'));var logger=require(_0xd4c6('0x7'))('rpc');var config=require(_0xd4c6('0x8'));var jayson=require(_0xd4c6('0x9'));var client=jayson['client'][_0xd4c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x316314,_0x4329e3,_0x5d4fce){return new BPromise(function(_0x440ee3,_0x19ce1c){return client[_0xd4c6('0xb')](_0x316314,_0x5d4fce)['then'](function(_0xe2f90b){logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,'request\x20sent');logger[_0xd4c6('0xe')](_0xd4c6('0xf'),_0x4329e3,_0xd4c6('0x10'),JSON[_0xd4c6('0x11')](_0xe2f90b));if(_0xe2f90b[_0xd4c6('0x12')]){if(_0xe2f90b[_0xd4c6('0x12')]['code']===0x1f4){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b['error'][_0xd4c6('0x13')]);return _0x19ce1c(_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);}logger[_0xd4c6('0x12')](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);return _0x440ee3(_0xe2f90b['error']['message']);}else{logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,_0xd4c6('0x10'));_0x440ee3(_0xe2f90b[_0xd4c6('0x14')][_0xd4c6('0x13')]);}})[_0xd4c6('0x15')](function(_0xe52075){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe52075);_0x19ce1c(_0xe52075);});});}exports[_0xd4c6('0x16')]=function(_0x23a16f){var _0x2c97b=this;return new Promise(function(_0x31f328,_0x54e0a5){return db[_0xd4c6('0x17')][_0xd4c6('0x18')](_0x23a16f[_0xd4c6('0x19')],{'raw':_0x23a16f['options']?_0x23a16f[_0xd4c6('0x1a')][_0xd4c6('0x1b')]===undefined?!![]:![]:!![]})[_0xd4c6('0x1c')](function(_0x3b1658){logger['info'](_0xd4c6('0x16'),_0x23a16f);logger['debug'](_0xd4c6('0x16'),_0x23a16f,JSON[_0xd4c6('0x11')](_0x3b1658));_0x31f328(_0x3b1658);})[_0xd4c6('0x15')](function(_0x222813){logger[_0xd4c6('0x12')](_0xd4c6('0x16'),_0x222813[_0xd4c6('0x13')],_0x23a16f);_0x54e0a5(_0x2c97b[_0xd4c6('0x12')](0x1f4,_0x222813[_0xd4c6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 86be9e3..a947f6d 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 _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 +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x823b63,_0x57f919){_0x823b63=_0x823b63-0x0;var _0x359766=_0xdb28[_0x823b63];return _0x359766;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index b16c16e..5addbd7 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 _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 +var _0x5fba=['use','User','passport','passport-local','Strategy','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','undefined','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','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','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt','disabled','blocked','blockedAt','online','user','agent','then','add','minutes','clearBlockUser','getLicense','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken'];(function(_0x15a3e4,_0x1287d7){var _0x1b8205=function(_0x406982){while(--_0x406982){_0x15a3e4['push'](_0x15a3e4['shift']());}};_0x1b8205(++_0x1287d7);}(_0x5fba,0x128));var _0xa5fb=function(_0x331c5d,_0x3a6652){_0x331c5d=_0x331c5d-0x0;var _0x808c40=_0x5fba[_0x331c5d];return _0x808c40;};'use strict';var passport=require(_0xa5fb('0x0'));var LocalStrategy=require(_0xa5fb('0x1'))[_0xa5fb('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xa5fb('0x3'));var util=require(_0xa5fb('0x4'));var db=require(_0xa5fb('0x5'))['db'];var authService=require(_0xa5fb('0x6'));var utils=require(_0xa5fb('0x7'));var config=require('../../config/environment');var logger=require(_0xa5fb('0x8'))(_0xa5fb('0x9'));function isActiveDirectoryConfigured(_0x34d189){var _0x287d0b=![];if(typeof _0x34d189[_0xa5fb('0xa')]!==_0xa5fb('0xb')){_0x287d0b=_0x34d189[_0xa5fb('0xa')]['baseDN']&&_0x34d189[_0xa5fb('0xa')][_0xa5fb('0xc')]&&_0x34d189[_0xa5fb('0xa')][_0xa5fb('0xd')];}return _0x287d0b;}function adAuthenticate(_0x20e590,_0x30fb7a,_0x18e80c){return new BPromise(function(_0x3e5393,_0x59e5c9){try{var _0x27258e=new ActiveDirectory(_0x20e590);_0x27258e[_0xa5fb('0xe')](_0x30fb7a,_0x18e80c,function(_0xb6b38f,_0x16c6c0){if(_0xb6b38f){logger[_0xa5fb('0xf')](_0xa5fb('0x10'),_0x30fb7a,util[_0xa5fb('0x11')](_0xb6b38f,{'showHidden':![],'depth':null}));_0x59e5c9(_0xa5fb('0x12'));}else if(!_0x16c6c0){logger[_0xa5fb('0xf')](_0xa5fb('0x13'),_0x30fb7a);_0x59e5c9(_0xa5fb('0x12'));}else{_0x3e5393(_0x16c6c0);}});}catch(_0x7fce84){_0x59e5c9(_0x7fce84);}});}function ActiveDirectoryAuthenticate(_0x20818d,_0x262c07,_0x1553ad,_0x7b18d9){var _0x493099,_0x2712d2;if(!isActiveDirectoryConfigured(config)){logger[_0xa5fb('0xf')](_0xa5fb('0x14'),_0x262c07);return _0x7b18d9(null,![],{'message':_0xa5fb('0x12')});}return db[_0xa5fb('0x15')]['findOne']({'where':{'id':0x1},'attributes':[_0xa5fb('0x16'),_0xa5fb('0x17')],'raw':!![]})['then'](function(_0x3b4d4f){_0x493099=_0x3b4d4f;if(!_0x493099['adSsoEnabled']){logger[_0xa5fb('0xf')](_0xa5fb('0x18'),_0x262c07);throw new Error(_0xa5fb('0x12'));}return _0x20818d[_0xa5fb('0x19')]({'attributes':['id',_0xa5fb('0x1a'),_0xa5fb('0x1b'),_0xa5fb('0x1c'),'role',_0xa5fb('0x1d'),_0xa5fb('0x1e'),_0xa5fb('0x1f'),_0xa5fb('0x20')],'where':{'name':_0x262c07,'role':{'$or':['admin',_0xa5fb('0x21'),_0xa5fb('0x22')]},'adSsoEnabled':!![]}});})[_0xa5fb('0x23')](function(_0x5b01b0){if(!_0x5b01b0||_0x5b01b0&&_0x5b01b0[_0xa5fb('0x1a')]!==_0x262c07){throw new Error(_0xa5fb('0x12'));}_0x2712d2=_0x5b01b0;var _0x33d50b=_0x2712d2[_0xa5fb('0x1a')]+'@'+config['activedirectory'][_0xa5fb('0xd')];return adAuthenticate(config['activedirectory'],_0x33d50b,_0x1553ad);})[_0xa5fb('0x23')](function(_0x169a4e){if(_0x2712d2['disabled']){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x493099[_0xa5fb('0x17')]>0x0){if(_0x2712d2[_0xa5fb('0x1e')]){if(moment(_0x2712d2['blockedAt'])[_0xa5fb('0x24')](_0x493099[_0xa5fb('0x17')],_0xa5fb('0x25'))>moment()){throw new Error(_0xa5fb('0x12'));}return utils[_0xa5fb('0x26')](_0x2712d2,0x0,![],null)[_0xa5fb('0x23')](function(){return utils[_0xa5fb('0x27')](_0x2712d2);})['then'](function(){return _0x7b18d9(null,_0x2712d2);});}else{return utils[_0xa5fb('0x27')](_0x2712d2)[_0xa5fb('0x23')](function(){return _0x7b18d9(null,_0x2712d2);});}}else{return utils[_0xa5fb('0x27')](_0x2712d2)[_0xa5fb('0x23')](function(){return _0x7b18d9(null,_0x2712d2);});}})['catch'](function(_0x1036e7){return _0x7b18d9(null,![],_0x1036e7);});}function handleError(_0x27ebe3,_0x318b4c,_0x2a2e60){return _0x27ebe3[_0xa5fb('0x28')](_0x318b4c||0x1f4)['send']({'message':_0x2a2e60?_0x2a2e60[_0xa5fb('0x29')]||_0x2a2e60:''});}exports[_0xa5fb('0x2a')]=function(_0x719a70,_0x27a19c,_0x20f5be){passport[_0xa5fb('0xe')](_0xa5fb('0x2b'),function(_0x5bcd59,_0x1a9eaa,_0x184066){var _0x2649f8=_0x5bcd59||_0x184066;if(_0x2649f8){return handleError(_0x27a19c,0x191,_0x2649f8);}if(!_0x1a9eaa){return handleError(_0x27a19c,0x194,{'message':_0xa5fb('0x2c')});}else{var _0x4cad41={'payload':{'id':_0x1a9eaa['id'],'role':_0x1a9eaa[_0xa5fb('0x2d')]},'options':{'expiresIn':0x15180}};return authService[_0xa5fb('0x2e')](_0x4cad41)[_0xa5fb('0x23')](function(_0x380e68){_0x27a19c['json']({'id':_0x1a9eaa['id'],'token':_0x380e68,'statusCall':'','isAlreadyLogged':_0x1a9eaa['online']});});}})(_0x719a70,_0x27a19c,_0x20f5be);};passport[_0xa5fb('0x2f')]('ad-login',new LocalStrategy({'usernameField':_0xa5fb('0x1a'),'passwordField':_0xa5fb('0x1b')},function(_0x1210ea,_0x1ca235,_0x4ab884){return ActiveDirectoryAuthenticate(db[_0xa5fb('0x30')],_0x1210ea,_0x1ca235,_0x4ab884);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index cb1f823..849e8b0 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 _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 +var _0x501c=['login','express','Router','./authActiveDirectory.controller','post'];(function(_0x554e66,_0x4c7936){var _0x487a08=function(_0x3e43ba){while(--_0x3e43ba){_0x554e66['push'](_0x554e66['shift']());}};_0x487a08(++_0x4c7936);}(_0x501c,0xbf));var _0xc501=function(_0x4ad5d9,_0x18b357){_0x4ad5d9=_0x4ad5d9-0x0;var _0x1730c7=_0x501c[_0x4ad5d9];return _0x1730c7;};'use strict';var express=require(_0xc501('0x0'));var router=express[_0xc501('0x1')]();var controller=require(_0xc501('0x2'));router[_0xc501('0x3')]('/',controller[_0xc501('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 6100b48..963b5b9 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 _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 +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(_0x576425,_0x966e28){var _0x1c3685=function(_0x4930d2){while(--_0x4930d2){_0x576425['push'](_0x576425['shift']());}};_0x1c3685(++_0x966e28);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 214288c..0571d07 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 _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 +var _0x93da=['login','setTokenCookie','exports','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','/callback','callback','isMiddleware'];(function(_0x41ca35,_0x93d92a){var _0x36ef98=function(_0x302c7f){while(--_0x302c7f){_0x41ca35['push'](_0x41ca35['shift']());}};_0x36ef98(++_0x93d92a);}(_0x93da,0x92));var _0xa93d=function(_0x4886d7,_0x5a6dbc){_0x4886d7=_0x4886d7-0x0;var _0x161122=_0x93da[_0x4886d7];return _0x161122;};'use strict';var express=require(_0xa93d('0x0'));var passport=require('passport');var router=express[_0xa93d('0x1')]();var controller=require(_0xa93d('0x2'));var userController=require(_0xa93d('0x3'));var authService=require(_0xa93d('0x4'));router['get']('/',controller['login']);router['get'](_0xa93d('0x5'),controller[_0xa93d('0x6')],authService[_0xa93d('0x7')],userController[_0xa93d('0x8')],authService[_0xa93d('0x9')]);module[_0xa93d('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 27a4f70..69d2f20 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 _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 +var _0x8869=['getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','message','status','send','login','local-login','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','Setting','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','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','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','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.','securePassword','passwordHistoryLimit','previousPasswords','resetPasswordToken','resetPasswordExpires','save','Password\x20reset!','use','User','util','passport-local','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','findOne','allowedLoginAttempts','then','name','password','role','disabled','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','blockDuration','minutes','clearBlockUser','blocked','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!'];(function(_0xd58267,_0x3a7366){var _0x8b24ca=function(_0x200808){while(--_0x200808){_0xd58267['push'](_0xd58267['shift']());}};_0x8b24ca(++_0x3a7366);}(_0x8869,0x1c2));var _0x9886=function(_0x324e6d,_0x1dfa19){_0x324e6d=_0x324e6d-0x0;var _0x8fba28=_0x8869[_0x324e6d];return _0x8fba28;};'use strict';var util=require(_0x9886('0x0'));var passport=require('passport');var LocalStrategy=require(_0x9886('0x1'))['Strategy'];var jayson=require(_0x9886('0x2'));var _=require(_0x9886('0x3'));var rs=require(_0x9886('0x4'));var moment=require(_0x9886('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x9886('0x6'));var utils=require(_0x9886('0x7'));var client=jayson[_0x9886('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x90dfb1,_0x2139fd,_0x1fdda7,_0x392fb6){var _0x328a42,_0x4f7fab;return db['Setting'][_0x9886('0x9')]({'where':{'id':0x1},'attributes':[_0x9886('0xa'),'blockDuration'],'raw':!![]})[_0x9886('0xb')](function(_0x249ead){_0x328a42=_0x249ead;return _0x90dfb1['findOne']({'attributes':['id',_0x9886('0xc'),_0x9886('0xd'),'salt',_0x9886('0xe'),_0x9886('0xf'),'blocked',_0x9886('0x10'),_0x9886('0x11')],'where':{'name':_0x2139fd,'role':{'$or':[_0x9886('0x12'),_0x9886('0x13'),_0x9886('0x14')]}}});})[_0x9886('0xb')](function(_0x428ed4){if(!_0x428ed4||_0x428ed4&&_0x428ed4['name']!==_0x2139fd){throw new Error(_0x9886('0x15'));}else{_0x4f7fab=_0x428ed4;return _0x4f7fab;}})['then'](function(){_0x4f7fab[_0x9886('0x16')](_0x1fdda7,function(_0x56c427,_0x3348a9){var _0x240012=_0x4f7fab['loginAttempts']+0x1;if(_0x56c427){return _0x392fb6(_0x56c427);}else if(!_0x3348a9){if(_0x4f7fab[_0x9886('0xf')]){return _0x392fb6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x328a42[_0x9886('0xa')]>0x0){if(_0x4f7fab['blocked']){if(_0x328a42['blockDuration']>0x0){if(moment(_0x4f7fab[_0x9886('0x10')])[_0x9886('0x17')](_0x328a42[_0x9886('0x18')],_0x9886('0x19'))>moment()){return _0x392fb6(null,![],{'message':_0x9886('0x15')});}else{return utils[_0x9886('0x1a')](_0x4f7fab,_0x240012,![],null)['then'](function(){return _0x392fb6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x392fb6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x240012>=_0x328a42[_0x9886('0xa')]){return utils[_0x9886('0x1a')](_0x4f7fab,0x0,!![],moment())[_0x9886('0xb')](function(){return _0x392fb6(null,![],{'message':_0x9886('0x15')});});}else{return utils[_0x9886('0x1a')](_0x4f7fab,_0x240012,![],null)[_0x9886('0xb')](function(){return _0x392fb6(null,![],{'message':_0x9886('0x15')});});}}}else{return _0x392fb6(null,![],{'message':_0x9886('0x15')});}}else{if(_0x4f7fab[_0x9886('0xf')]){return _0x392fb6(null,![],{'message':_0x9886('0x15')});}else if(_0x328a42['allowedLoginAttempts']>0x0){if(_0x4f7fab['blocked']){if(_0x328a42[_0x9886('0x18')]>0x0){if(moment(_0x4f7fab[_0x9886('0x10')])['add'](_0x328a42[_0x9886('0x18')],_0x9886('0x19'))>moment()){return _0x392fb6(null,![],{'message':_0x9886('0x15')});}else{return utils[_0x9886('0x1a')](_0x4f7fab,0x0,![],null)['then'](function(){return utils['getLicense'](_0x4f7fab);})[_0x9886('0xb')](function(){return _0x392fb6(null,_0x4f7fab);});}}else{return _0x392fb6(null,![],{'message':_0x9886('0x15')});}}else{return utils[_0x9886('0x1a')](_0x4f7fab,0x0,![],null)[_0x9886('0xb')](function(){return utils['getLicense'](_0x4f7fab);})[_0x9886('0xb')](function(){return _0x392fb6(null,_0x4f7fab);})['catch'](function(_0x47b2cf){return _0x392fb6(null,![],_0x47b2cf);});}}else{if(_0x4f7fab[_0x9886('0x1b')]){return _0x392fb6(null,![],{'message':_0x9886('0x15')});}else{return utils[_0x9886('0x1c')](_0x4f7fab)[_0x9886('0xb')](function(){return _0x392fb6(null,_0x4f7fab);});}}}});})[_0x9886('0x1d')](function(_0x3512f8){return _0x392fb6(null,![],_0x3512f8);});}function sendServiceMail(_0x405d9a){return db[_0x9886('0x1e')][_0x9886('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x9886('0xc'),'email'],'include':[{'model':db[_0x9886('0x20')],'as':_0x9886('0x21'),'include':[{'model':db[_0x9886('0x22')],'as':_0x9886('0x22')}]}]})[_0x9886('0xb')](function(_0x3d6d82){if(!_0x3d6d82){throw new Error(_0x9886('0x23'));}var _0x19ab8d=_0x3d6d82[_0x9886('0x24')]();var _0x5f334d={'account':_0x19ab8d,'message':_[_0x9886('0x25')]({'from':util[_0x9886('0x26')](_0x9886('0x27'),_0x3d6d82[_0x9886('0xc')],_0x3d6d82[_0x9886('0x28')]||_0x3d6d82['Smtp'][_0x9886('0x13')])},_0x405d9a)};return client[_0x9886('0x29')](_0x9886('0x2a'),_0x5f334d);})['then'](function(_0x47a8db){if(_0x47a8db[_0x9886('0x2b')]){throw new Error(util[_0x9886('0x26')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x47a8db[_0x9886('0x2b')][_0x9886('0x2c')]||JSON['stringify'](_0x47a8db[_0x9886('0x2b')])));}return!![];});}function handleError(_0x47338c,_0x4e79a9,_0x13cf08){return _0x47338c[_0x9886('0x2d')](_0x4e79a9||0x1f4)[_0x9886('0x2e')]({'message':_0x13cf08?_0x13cf08[_0x9886('0x2c')]||_0x13cf08:''});}exports[_0x9886('0x2f')]=function(_0x923878,_0x3b0e37,_0x4f96c3){passport[_0x9886('0x16')](_0x9886('0x30'),function(_0x229f06,_0x413250,_0x5801cb){var _0x531ea4=_0x229f06||_0x5801cb;if(_0x531ea4){return handleError(_0x3b0e37,0x191,_0x531ea4);}if(!_0x413250){return handleError(_0x3b0e37,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x282302={'payload':{'id':_0x413250['id'],'role':_0x413250[_0x9886('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x9886('0x31')](_0x282302)[_0x9886('0xb')](function(_0x12d7de){_0x3b0e37[_0x9886('0x32')]({'id':_0x413250['id'],'token':_0x12d7de,'statusCall':'','isAlreadyLogged':_0x413250['online']});});}})(_0x923878,_0x3b0e37,_0x4f96c3);};exports[_0x9886('0x33')]=function(_0x1ef82e,_0x20b616){if(!_0x1ef82e[_0x9886('0x34')][_0x9886('0x28')]){return handleError(_0x20b616,0x1f4,{'message':_0x9886('0x35')});}var _0x1ae1dc=rs[_0x9886('0x36')]();_0x1ef82e[_0x9886('0x34')]['email']=_0x1ef82e[_0x9886('0x34')][_0x9886('0x28')]['trim']()[_0x9886('0x37')]();var _0x2f4cf5;return db[_0x9886('0x38')][_0x9886('0x9')]({'where':{'id':0x1},'attributes':[_0x9886('0xa'),_0x9886('0x18')],'raw':!![]})[_0x9886('0xb')](function(_0x1ad3d2){_0x2f4cf5=_0x1ad3d2;return db['User'][_0x9886('0x1f')]({'where':{'email':_0x1ef82e[_0x9886('0x34')][_0x9886('0x28')]}});})[_0x9886('0xb')](function(_0x5a396b){if(!_0x5a396b){throw new Error(_0x9886('0x39'));}if(_0x5a396b['disabled']){throw new Error(_0x9886('0x3a'));}if(_0x5a396b[_0x9886('0x1b')]){if(moment(_0x5a396b[_0x9886('0x10')])[_0x9886('0x17')](_0x2f4cf5[_0x9886('0x18')],'minutes')>moment()){throw new Error(_0x9886('0x3b'));}else{_0x5a396b[_0x9886('0x1b')]=![];_0x5a396b[_0x9886('0x10')]=null;}}_0x5a396b['resetPasswordToken']=_0x1ae1dc;_0x5a396b['resetPasswordExpires']=Date[_0x9886('0x3c')]()+0x36ee80;return _0x5a396b['save']();})[_0x9886('0xb')](function(){return sendServiceMail({'to':_0x1ef82e[_0x9886('0x34')][_0x9886('0x28')],'subject':_0x9886('0x3d'),'text':_0x9886('0x3e')+_0x9886('0x3f')+_0x9886('0x40')+_0x1ef82e[_0x9886('0x41')][_0x9886('0x42')]+'/reset/'+_0x1ae1dc+'\x0a\x0a'+_0x9886('0x43')});})[_0x9886('0xb')](function(){_0x20b616['status'](0xc8)[_0x9886('0x2e')]({'message':_0x9886('0x44')});})[_0x9886('0x1d')](function(_0x5d34eb){return handleError(_0x20b616,0x1f4,_0x5d34eb);});};exports[_0x9886('0x45')]=function(_0x1b71e8,_0xdbefe){return db['User']['find']({'where':{'resetPasswordToken':_0x1b71e8[_0x9886('0x46')]['token'],'resetPasswordExpires':{'$gt':Date[_0x9886('0x3c')]()}}})[_0x9886('0xb')](function(_0x53ab05){if(!_0x53ab05){throw new Error(_0x9886('0x47'));}return db[_0x9886('0x38')][_0x9886('0x9')]({'attributes':['id',_0x9886('0x48'),'enforcePasswordHistory',_0x9886('0x49')]})[_0x9886('0xb')](function(_0x1e413d){if(_0x1e413d[_0x9886('0x48')])authService['validatePasswordPattern'](_0x1b71e8[_0x9886('0x34')][_0x9886('0xd')]);if(!_0x1e413d['enforcePasswordHistory']||!_0x53ab05[_0x9886('0x4a')])return _0x53ab05;authService['validatePasswordHistory'](_0x1b71e8[_0x9886('0x34')][_0x9886('0xd')],_0x53ab05[_0x9886('0x4a')],_0x1e413d[_0x9886('0x49')]);return _0x53ab05;})[_0x9886('0xb')](function(){_0x53ab05['password']=_0x1b71e8[_0x9886('0x34')][_0x9886('0xd')];_0x53ab05[_0x9886('0x4b')]=null;_0x53ab05[_0x9886('0x4c')]=null;return _0x53ab05[_0x9886('0x4d')]();});})[_0x9886('0xb')](function(){_0xdbefe['status'](0xc8)[_0x9886('0x2e')]({'message':_0x9886('0x4e')});})[_0x9886('0x1d')](function(_0x515b3a){return handleError(_0xdbefe,0x1f4,_0x515b3a);});};passport[_0x9886('0x4f')](_0x9886('0x30'),new LocalStrategy({'usernameField':'name','passwordField':_0x9886('0xd')},function(_0x4d9d74,_0x2ace2e,_0x37c058){return localAuthenticate(db[_0x9886('0x50')],_0x4d9d74,_0x2ace2e,_0x37c058);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 08bf813..a521eaf 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 _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 +var _0xc253=['forgot','exports','express','Router','./authLocal.controller','post','/forgot'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xc253,0x167));var _0x3c25=function(_0x466f51,_0x1393ed){_0x466f51=_0x466f51-0x0;var _0x2db305=_0xc253[_0x466f51];return _0x2db305;};'use strict';var express=require(_0x3c25('0x0'));var router=express[_0x3c25('0x1')]();var controller=require(_0x3c25('0x2'));router[_0x3c25('0x3')]('/',controller['login']);router[_0x3c25('0x3')](_0x3c25('0x4'),controller[_0x3c25('0x5')]);router[_0x3c25('0x3')]('/reset/:token',controller['reset']);module[_0x3c25('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 1c609cd..c0b4836 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 _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 +var _0xd896=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0xd896,0x9a));var _0x6d89=function(_0x270a2a,_0x572ead){_0x270a2a=_0x270a2a-0x0;var _0x1eeeb3=_0xd896[_0x270a2a];return _0x1eeeb3;};'use strict';var Sequelize=require(_0x6d89('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6d89('0x1')]},'status':{'type':Sequelize[_0x6d89('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x6d89('0x3')],'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 9e29174..037b108 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 _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 +var _0x2315=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','Automation','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','findAll','show','params','keys','options','find','create','body','catch','addConditions','Condition','ids','omit','getConditions','findOne','pick','addActions','Action','getActions','hasOwnProperty'];(function(_0x19aee6,_0xcb2918){var _0x511975=function(_0x4fbb42){while(--_0x4fbb42){_0x19aee6['push'](_0x19aee6['shift']());}};_0x511975(++_0xcb2918);}(_0x2315,0xaa));var _0x5231=function(_0x4b089b,_0x4cdc48){_0x4b089b=_0x4b089b-0x0;var _0xcf02fc=_0x2315[_0x4b089b];return _0xcf02fc;};'use strict';var emlformat=require(_0x5231('0x0'));var rimraf=require(_0x5231('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5231('0x2'));var rp=require(_0x5231('0x3'));var moment=require(_0x5231('0x4'));var BPromise=require(_0x5231('0x5'));var Mustache=require('mustache');var util=require(_0x5231('0x6'));var path=require(_0x5231('0x7'));var sox=require(_0x5231('0x8'));var csv=require(_0x5231('0x9'));var ejs=require(_0x5231('0xa'));var fs=require('fs');var fs_extra=require(_0x5231('0xb'));var _=require(_0x5231('0xc'));var squel=require(_0x5231('0xd'));var crypto=require(_0x5231('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5231('0xf'));var toCsv=require(_0x5231('0x9'));var querystring=require('querystring');var Papa=require(_0x5231('0x10'));var Redis=require(_0x5231('0x11'));var authService=require(_0x5231('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5231('0x13'));var logger=require(_0x5231('0x14'))(_0x5231('0x15'));var utils=require(_0x5231('0x16'));var config=require(_0x5231('0x17'));var licenseUtil=require(_0x5231('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d3a84,_0x347c83){_0x347c83=_0x347c83||0xcc;return function(_0x3bd735){if(_0x3bd735){return _0x5d3a84[_0x5231('0x19')](_0x347c83);}return _0x5d3a84[_0x5231('0x1a')](_0x347c83)[_0x5231('0x1b')]();};}function respondWithResult(_0x2bf88b,_0x4ea529){_0x4ea529=_0x4ea529||0xc8;return function(_0x30f763){if(_0x30f763){return _0x2bf88b['status'](_0x4ea529)['json'](_0x30f763);}};}function respondWithFilteredResult(_0x57a1b5,_0xb9ae4b){return function(_0x59f7d8){if(_0x59f7d8){var _0x2596ed=typeof _0xb9ae4b[_0x5231('0x1c')]===_0x5231('0x1d')&&typeof _0xb9ae4b[_0x5231('0x1e')]===_0x5231('0x1d');var _0x3bc1a1=_0x59f7d8['count'];var _0x2f808e=_0x2596ed?0x0:_0xb9ae4b[_0x5231('0x1c')];var _0x1d61ff=_0x2596ed?_0x59f7d8[_0x5231('0x1f')]:_0xb9ae4b[_0x5231('0x1c')]+_0xb9ae4b[_0x5231('0x1e')];var _0x433dc2;if(_0x1d61ff>=_0x3bc1a1){_0x1d61ff=_0x3bc1a1;_0x433dc2=0xc8;}else{_0x433dc2=0xce;}_0x57a1b5['status'](_0x433dc2);return _0x57a1b5[_0x5231('0x20')](_0x5231('0x21'),_0x2f808e+'-'+_0x1d61ff+'/'+_0x3bc1a1)[_0x5231('0x22')](_0x59f7d8);}return null;};}function patchUpdates(_0x205723){return function(_0x336ffe){try{jsonpatch[_0x5231('0x23')](_0x336ffe,_0x205723,!![]);}catch(_0x52f545){return BPromise[_0x5231('0x24')](_0x52f545);}return _0x336ffe[_0x5231('0x25')]();};}function saveUpdates(_0x54167d,_0x4165b8){return function(_0x25f3af){if(_0x25f3af){return _0x25f3af[_0x5231('0x26')](_0x54167d)[_0x5231('0x27')](function(_0x271031){return _0x271031;});}return null;};}function removeEntity(_0x346031,_0x54bff7){return function(_0xd946a0){if(_0xd946a0){return _0xd946a0[_0x5231('0x28')]()[_0x5231('0x27')](function(){_0x346031[_0x5231('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x110e9f,_0x3151b0){return function(_0x150144){if(!_0x150144){_0x110e9f[_0x5231('0x19')](0x194);}return _0x150144;};}function handleError(_0x1dbba5,_0x5d739d){_0x5d739d=_0x5d739d||0x1f4;return function(_0x5199a6){logger['error'](_0x5199a6[_0x5231('0x29')]);if(_0x5199a6[_0x5231('0x2a')]){delete _0x5199a6['name'];}_0x1dbba5[_0x5231('0x1a')](_0x5d739d)[_0x5231('0x2b')](_0x5199a6);};}exports[_0x5231('0x2c')]=function(_0x5a6b00,_0x645513){var _0x1e0107={},_0x96cd44={},_0x137604={'count':0x0,'rows':[]};var _0x245b23=_[_0x5231('0x2d')](db[_0x5231('0x2e')][_0x5231('0x2f')],function(_0x3fef33){return{'name':_0x3fef33[_0x5231('0x30')],'type':_0x3fef33['type']['key']};});_0x96cd44[_0x5231('0x31')]=_[_0x5231('0x2d')](_0x245b23,_0x5231('0x2a'));_0x96cd44['query']=_['keys'](_0x5a6b00[_0x5231('0x32')]);_0x96cd44[_0x5231('0x33')]=_[_0x5231('0x34')](_0x96cd44[_0x5231('0x31')],_0x96cd44[_0x5231('0x32')]);_0x1e0107[_0x5231('0x35')]=_[_0x5231('0x34')](_0x96cd44[_0x5231('0x31')],qs[_0x5231('0x36')](_0x5a6b00[_0x5231('0x32')][_0x5231('0x36')]));_0x1e0107[_0x5231('0x35')]=_0x1e0107[_0x5231('0x35')][_0x5231('0x37')]?_0x1e0107[_0x5231('0x35')]:_0x96cd44['model'];if(!_0x5a6b00['query']['hasOwnProperty'](_0x5231('0x38'))){_0x1e0107[_0x5231('0x1e')]=qs[_0x5231('0x1e')](_0x5a6b00[_0x5231('0x32')][_0x5231('0x1e')]);_0x1e0107[_0x5231('0x1c')]=qs[_0x5231('0x1c')](_0x5a6b00['query'][_0x5231('0x1c')]);}_0x1e0107[_0x5231('0x39')]=qs[_0x5231('0x3a')](_0x5a6b00[_0x5231('0x32')]['sort']);_0x1e0107[_0x5231('0x3b')]=qs[_0x5231('0x33')](_['pick'](_0x5a6b00[_0x5231('0x32')],_0x96cd44[_0x5231('0x33')]),_0x245b23);if(_0x5a6b00[_0x5231('0x32')][_0x5231('0x3c')]){_0x1e0107['where']=_[_0x5231('0x3d')](_0x1e0107[_0x5231('0x3b')],{'$or':_[_0x5231('0x2d')](_0x245b23,function(_0x227d78){if(_0x227d78[_0x5231('0x3e')]!==_0x5231('0x3f')){var _0x5cb845={};_0x5cb845[_0x227d78[_0x5231('0x2a')]]={'$like':'%'+_0x5a6b00[_0x5231('0x32')]['filter']+'%'};return _0x5cb845;}})});}_0x1e0107=_[_0x5231('0x3d')]({},_0x1e0107,_0x5a6b00['options']);var _0x9c001b={'where':_0x1e0107[_0x5231('0x3b')]};return db[_0x5231('0x2e')][_0x5231('0x1f')](_0x9c001b)['then'](function(_0x2245aa){_0x137604['count']=_0x2245aa;if(_0x5a6b00['query'][_0x5231('0x40')]){_0x1e0107['include']=[{'all':!![]}];}return db['Automation'][_0x5231('0x41')](_0x1e0107);})['then'](function(_0x4da311){_0x137604['rows']=_0x4da311;return _0x137604;})[_0x5231('0x27')](respondWithFilteredResult(_0x645513,_0x1e0107))['catch'](handleError(_0x645513,null));};exports[_0x5231('0x42')]=function(_0x1c9309,_0x39a275){var _0x1190f6={'raw':![],'where':{'id':_0x1c9309[_0x5231('0x43')]['id']}},_0x390660={};_0x390660['model']=_[_0x5231('0x44')](db[_0x5231('0x2e')][_0x5231('0x2f')]);_0x390660[_0x5231('0x32')]=_[_0x5231('0x44')](_0x1c9309['query']);_0x390660['filters']=_[_0x5231('0x34')](_0x390660[_0x5231('0x31')],_0x390660[_0x5231('0x32')]);_0x1190f6[_0x5231('0x35')]=_['intersection'](_0x390660[_0x5231('0x31')],qs[_0x5231('0x36')](_0x1c9309[_0x5231('0x32')][_0x5231('0x36')]));_0x1190f6['attributes']=_0x1190f6[_0x5231('0x35')][_0x5231('0x37')]?_0x1190f6[_0x5231('0x35')]:_0x390660[_0x5231('0x31')];if(_0x1c9309[_0x5231('0x32')]['includeAll']){_0x1190f6['include']=[{'all':!![]}];}_0x1190f6=_[_0x5231('0x3d')]({},_0x1190f6,_0x1c9309[_0x5231('0x45')]);return db['Automation'][_0x5231('0x46')](_0x1190f6)[_0x5231('0x27')](handleEntityNotFound(_0x39a275,null))[_0x5231('0x27')](respondWithResult(_0x39a275,null))['catch'](handleError(_0x39a275,null));};exports[_0x5231('0x47')]=function(_0x1c45b7,_0x4e1a3b){return db[_0x5231('0x2e')][_0x5231('0x47')](_0x1c45b7[_0x5231('0x48')],{})[_0x5231('0x27')](respondWithResult(_0x4e1a3b,0xc9))[_0x5231('0x49')](handleError(_0x4e1a3b,null));};exports['update']=function(_0x148335,_0xbff6f1){if(_0x148335[_0x5231('0x48')]['id']){delete _0x148335[_0x5231('0x48')]['id'];}return db[_0x5231('0x2e')][_0x5231('0x46')]({'where':{'id':_0x148335[_0x5231('0x43')]['id']}})[_0x5231('0x27')](handleEntityNotFound(_0xbff6f1,null))[_0x5231('0x27')](saveUpdates(_0x148335[_0x5231('0x48')],null))['then'](respondWithResult(_0xbff6f1,null))[_0x5231('0x49')](handleError(_0xbff6f1,null));};exports[_0x5231('0x28')]=function(_0x3d0979,_0x12922a){return db['Automation'][_0x5231('0x46')]({'where':{'id':_0x3d0979['params']['id']}})[_0x5231('0x27')](handleEntityNotFound(_0x12922a,null))['then'](removeEntity(_0x12922a,null))['catch'](handleError(_0x12922a,null));};exports[_0x5231('0x4a')]=function(_0x2e54e7,_0x1a8be2,_0x38b5fa){return db[_0x5231('0x4b')]['find']({'where':{'id':_0x2e54e7[_0x5231('0x43')]['id']}})['then'](handleEntityNotFound(_0x1a8be2,null))['then'](function(_0x237758){if(_0x237758){return _0x237758[_0x5231('0x4a')](_0x2e54e7[_0x5231('0x48')][_0x5231('0x4c')],_[_0x5231('0x4d')](_0x2e54e7[_0x5231('0x48')],[_0x5231('0x4c'),'id'])||{});}})[_0x5231('0x27')](respondWithResult(_0x1a8be2,null))['catch'](handleError(_0x1a8be2,null));};exports[_0x5231('0x4e')]=function(_0x16f820,_0xeef87a,_0x4f1fe1){var _0x3badbf={};var _0x407d20={};var _0x429d8c;var _0x90ffc7;return db['Automation'][_0x5231('0x4f')]({'where':{'id':_0x16f820[_0x5231('0x43')]['id']}})[_0x5231('0x27')](handleEntityNotFound(_0xeef87a,null))[_0x5231('0x27')](function(_0x138311){if(_0x138311){_0x429d8c=_0x138311;_0x407d20[_0x5231('0x31')]=_['keys'](db[_0x5231('0x4b')][_0x5231('0x2f')]);_0x407d20[_0x5231('0x32')]=_[_0x5231('0x44')](_0x16f820['query']);_0x407d20[_0x5231('0x33')]=_[_0x5231('0x34')](_0x407d20[_0x5231('0x31')],_0x407d20[_0x5231('0x32')]);_0x3badbf[_0x5231('0x35')]=_[_0x5231('0x34')](_0x407d20[_0x5231('0x31')],qs[_0x5231('0x36')](_0x16f820['query']['fields']));_0x3badbf[_0x5231('0x35')]=_0x3badbf['attributes'][_0x5231('0x37')]?_0x3badbf[_0x5231('0x35')]:_0x407d20[_0x5231('0x31')];_0x3badbf[_0x5231('0x39')]=qs[_0x5231('0x3a')](_0x16f820[_0x5231('0x32')]['sort']);_0x3badbf['where']=qs[_0x5231('0x33')](_[_0x5231('0x50')](_0x16f820[_0x5231('0x32')],_0x407d20[_0x5231('0x33')]));if(_0x16f820[_0x5231('0x32')][_0x5231('0x3c')]){_0x3badbf[_0x5231('0x3b')]=_[_0x5231('0x3d')](_0x3badbf[_0x5231('0x3b')],{'$or':_[_0x5231('0x2d')](_0x3badbf['attributes'],function(_0x5493d6){var _0x1f97e0={};_0x1f97e0[_0x5493d6]={'$like':'%'+_0x16f820['query'][_0x5231('0x3c')]+'%'};return _0x1f97e0;})});}_0x3badbf=_[_0x5231('0x3d')]({},_0x3badbf,_0x16f820[_0x5231('0x45')]);return _0x429d8c[_0x5231('0x4e')](_0x3badbf);}})[_0x5231('0x27')](function(_0x3e4aac){if(_0x3e4aac){_0x90ffc7=_0x3e4aac[_0x5231('0x37')];if(!_0x16f820[_0x5231('0x32')]['hasOwnProperty'](_0x5231('0x38'))){_0x3badbf['limit']=qs['limit'](_0x16f820[_0x5231('0x32')][_0x5231('0x1e')]);_0x3badbf['offset']=qs[_0x5231('0x1c')](_0x16f820[_0x5231('0x32')][_0x5231('0x1c')]);}return _0x429d8c['getConditions'](_0x3badbf);}})[_0x5231('0x27')](function(_0xfed704){if(_0xfed704){return _0xfed704?{'count':_0x90ffc7,'rows':_0xfed704}:null;}})[_0x5231('0x27')](respondWithResult(_0xeef87a,null))['catch'](handleError(_0xeef87a,null));};exports[_0x5231('0x51')]=function(_0x2e3712,_0x74aebb,_0x26275c){return db[_0x5231('0x52')][_0x5231('0x46')]({'where':{'id':_0x2e3712[_0x5231('0x43')]['id']}})[_0x5231('0x27')](handleEntityNotFound(_0x74aebb,null))[_0x5231('0x27')](function(_0x4c6a25){if(_0x4c6a25){return _0x4c6a25[_0x5231('0x51')](_0x2e3712[_0x5231('0x48')][_0x5231('0x4c')],_[_0x5231('0x4d')](_0x2e3712[_0x5231('0x48')],[_0x5231('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x74aebb,null))['catch'](handleError(_0x74aebb,null));};exports[_0x5231('0x53')]=function(_0x5cfebc,_0x2c37cd,_0x2b7a61){var _0x4f6e80={};var _0x212150={};var _0x5642d2;var _0x2ab520;return db[_0x5231('0x2e')]['findOne']({'where':{'id':_0x5cfebc[_0x5231('0x43')]['id']}})['then'](handleEntityNotFound(_0x2c37cd,null))[_0x5231('0x27')](function(_0x12397d){if(_0x12397d){_0x5642d2=_0x12397d;_0x212150[_0x5231('0x31')]=_[_0x5231('0x44')](db[_0x5231('0x52')]['rawAttributes']);_0x212150[_0x5231('0x32')]=_[_0x5231('0x44')](_0x5cfebc[_0x5231('0x32')]);_0x212150[_0x5231('0x33')]=_[_0x5231('0x34')](_0x212150[_0x5231('0x31')],_0x212150[_0x5231('0x32')]);_0x4f6e80[_0x5231('0x35')]=_[_0x5231('0x34')](_0x212150[_0x5231('0x31')],qs[_0x5231('0x36')](_0x5cfebc[_0x5231('0x32')]['fields']));_0x4f6e80[_0x5231('0x35')]=_0x4f6e80[_0x5231('0x35')][_0x5231('0x37')]?_0x4f6e80['attributes']:_0x212150[_0x5231('0x31')];_0x4f6e80[_0x5231('0x39')]=qs[_0x5231('0x3a')](_0x5cfebc[_0x5231('0x32')][_0x5231('0x3a')]);_0x4f6e80[_0x5231('0x3b')]=qs[_0x5231('0x33')](_[_0x5231('0x50')](_0x5cfebc[_0x5231('0x32')],_0x212150[_0x5231('0x33')]));if(_0x5cfebc['query'][_0x5231('0x3c')]){_0x4f6e80[_0x5231('0x3b')]=_['merge'](_0x4f6e80['where'],{'$or':_[_0x5231('0x2d')](_0x4f6e80[_0x5231('0x35')],function(_0x1a2473){var _0x56e39b={};_0x56e39b[_0x1a2473]={'$like':'%'+_0x5cfebc['query'][_0x5231('0x3c')]+'%'};return _0x56e39b;})});}_0x4f6e80=_[_0x5231('0x3d')]({},_0x4f6e80,_0x5cfebc['options']);return _0x5642d2['getActions'](_0x4f6e80);}})[_0x5231('0x27')](function(_0x2b7cac){if(_0x2b7cac){_0x2ab520=_0x2b7cac[_0x5231('0x37')];if(!_0x5cfebc['query'][_0x5231('0x54')]('nolimit')){_0x4f6e80[_0x5231('0x1e')]=qs[_0x5231('0x1e')](_0x5cfebc['query'][_0x5231('0x1e')]);_0x4f6e80['offset']=qs[_0x5231('0x1c')](_0x5cfebc['query'][_0x5231('0x1c')]);}return _0x5642d2[_0x5231('0x53')](_0x4f6e80);}})['then'](function(_0x537d57){if(_0x537d57){return _0x537d57?{'count':_0x2ab520,'rows':_0x537d57}:null;}})[_0x5231('0x27')](respondWithResult(_0x2c37cd,null))[_0x5231('0x49')](handleError(_0x2c37cd,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 92af92d..4a00df1 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 _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 +var _0xbfae=['path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x1073ad,_0x44bf0b){var _0x528474=function(_0x3450f7){while(--_0x3450f7){_0x1073ad['push'](_0x1073ad['shift']());}};_0x528474(++_0x44bf0b);}(_0xbfae,0x1b4));var _0xebfa=function(_0xdf4182,_0xd869ff){_0xdf4182=_0xdf4182-0x0;var _0x1d10c7=_0xbfae[_0xdf4182];return _0x1d10c7;};'use strict';var _=require(_0xebfa('0x0'));var util=require(_0xebfa('0x1'));var logger=require(_0xebfa('0x2'))(_0xebfa('0x3'));var moment=require(_0xebfa('0x4'));var BPromise=require('bluebird');var rp=require(_0xebfa('0x5'));var fs=require('fs');var path=require(_0xebfa('0x6'));var rimraf=require(_0xebfa('0x7'));var config=require('../../config/environment');var attributes=require(_0xebfa('0x8'));module[_0xebfa('0x9')]=function(_0x5f15c0,_0x2577d4){return _0x5f15c0[_0xebfa('0xa')](_0xebfa('0xb'),attributes,{'tableName':_0xebfa('0xc'),'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 a598aff..9f9d123 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 _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 +var _0xb2af=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb2af,0xd2));var _0xfb2a=function(_0x26b69c,_0x94157c){_0x26b69c=_0x26b69c-0x0;var _0x27bbda=_0xb2af[_0x26b69c];return _0x27bbda;};'use strict';var _=require(_0xfb2a('0x0'));var util=require(_0xfb2a('0x1'));var moment=require(_0xfb2a('0x2'));var BPromise=require(_0xfb2a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb2a('0x4'));var db=require(_0xfb2a('0x5'))['db'];var utils=require(_0xfb2a('0x6'));var logger=require(_0xfb2a('0x7'))(_0xfb2a('0x8'));var config=require('../../config/environment');var jayson=require(_0xfb2a('0x9'));var client=jayson[_0xfb2a('0xa')][_0xfb2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55cf25,_0x715404,_0x3e20de){return new BPromise(function(_0x1f3315,_0x55bb4e){return client[_0xfb2a('0xc')](_0x55cf25,_0x3e20de)[_0xfb2a('0xd')](function(_0x3d3333){logger[_0xfb2a('0xe')](_0xfb2a('0xf'),_0x715404,_0xfb2a('0x10'));logger[_0xfb2a('0x11')](_0xfb2a('0x12'),_0x715404,_0xfb2a('0x10'),JSON[_0xfb2a('0x13')](_0x3d3333));if(_0x3d3333[_0xfb2a('0x14')]){if(_0x3d3333[_0xfb2a('0x14')]['code']===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x715404,_0x3d3333[_0xfb2a('0x14')][_0xfb2a('0x15')]);return _0x55bb4e(_0x3d3333[_0xfb2a('0x14')][_0xfb2a('0x15')]);}logger['error'](_0xfb2a('0xf'),_0x715404,_0x3d3333['error']['message']);return _0x1f3315(_0x3d3333[_0xfb2a('0x14')]['message']);}else{logger['info'](_0xfb2a('0xf'),_0x715404,_0xfb2a('0x10'));_0x1f3315(_0x3d3333[_0xfb2a('0x16')][_0xfb2a('0x15')]);}})[_0xfb2a('0x17')](function(_0xc85abf){logger[_0xfb2a('0x14')](_0xfb2a('0xf'),_0x715404,_0xc85abf);_0x55bb4e(_0xc85abf);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index cd333a2..946713f 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 _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 +var _0x9860=['show','/:id/conditions','getConditions','getActions','post','create','/:id/actions','addActions','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x579c34,_0x743122){var _0x28a925=function(_0x537efe){while(--_0x537efe){_0x579c34['push'](_0x579c34['shift']());}};_0x28a925(++_0x743122);}(_0x9860,0x15f));var _0x0986=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9860[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x0986('0x0'));var path=require(_0x0986('0x1'));var timeout=require(_0x0986('0x2'));var express=require(_0x0986('0x3'));var router=express[_0x0986('0x4')]();var fs_extra=require(_0x0986('0x5'));var auth=require(_0x0986('0x6'));var interaction=require(_0x0986('0x7'));var config=require(_0x0986('0x8'));var controller=require('./automation.controller');router[_0x0986('0x9')]('/',auth[_0x0986('0xa')](),controller[_0x0986('0xb')]);router['get'](_0x0986('0xc'),auth[_0x0986('0xa')](),controller[_0x0986('0xd')]);router[_0x0986('0x9')](_0x0986('0xe'),auth['isAuthenticated'](),controller[_0x0986('0xf')]);router[_0x0986('0x9')]('/:id/actions',auth[_0x0986('0xa')](),controller[_0x0986('0x10')]);router[_0x0986('0x11')]('/',auth[_0x0986('0xa')](),controller[_0x0986('0x12')]);router['post'](_0x0986('0xe'),auth[_0x0986('0xa')](),controller['addConditions']);router['post'](_0x0986('0x13'),auth[_0x0986('0xa')](),controller[_0x0986('0x14')]);router[_0x0986('0x15')](_0x0986('0xc'),auth['isAuthenticated'](),controller[_0x0986('0x16')]);router[_0x0986('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x0986('0x18')]);module[_0x0986('0x19')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 8c3fb05..a388e33 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 _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 +var _0x1ecf=['NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','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','name','ivr','BOOLEAN','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'];(function(_0x2d03d0,_0x529ee7){var _0x43b480=function(_0x10a2bc){while(--_0x10a2bc){_0x2d03d0['push'](_0x2d03d0['shift']());}};_0x43b480(++_0x529ee7);}(_0x1ecf,0x15d));var _0xf1ec=function(_0x118139,_0x7ce965){_0x118139=_0x118139-0x0;var _0x2fece9=_0x1ecf[_0x118139];return _0x2fece9;};'use strict';var Sequelize=require('sequelize');module[_0xf1ec('0x0')]={'name':{'type':Sequelize[_0xf1ec('0x1')],'unique':_0xf1ec('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xf1ec('0x3')),'allowNull':![],'defaultValue':_0xf1ec('0x3')},'description':{'type':Sequelize[_0xf1ec('0x1')]},'active':{'type':Sequelize[_0xf1ec('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xf1ec('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf1ec('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf1ec('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf1ec('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xf1ec('0x7')](0x3)[_0xf1ec('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf1ec('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf1ec('0x7')](0x3)[_0xf1ec('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf1ec('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf1ec('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf1ec('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xf1ec('0x7')](0x3)[_0xf1ec('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf1ec('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf1ec('0x7')](0x5)[_0xf1ec('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf1ec('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf1ec('0x7')](0x3)[_0xf1ec('0x5')],'defaultValue':0x3,'comment':_0xf1ec('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf1ec('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf1ec('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf1ec('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf1ec('0xf')},'dialTimezone':{'type':Sequelize[_0xf1ec('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf1ec('0x1')],'defaultValue':_0xf1ec('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xf1ec('0x11')](_0xf1ec('0x12'),'never',_0xf1ec('0x13')),'defaultValue':_0xf1ec('0x12')},'dialAMDActive':{'type':Sequelize[_0xf1ec('0x4')],'defaultValue':0x0,'comment':_0xf1ec('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xf1ec('0x7')](0x9)[_0xf1ec('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xf1ec('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf1ec('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf1ec('0x7')](0x9)[_0xf1ec('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf1ec('0x7')](0x9)[_0xf1ec('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf1ec('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xf1ec('0x7')](0x9)[_0xf1ec('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf1ec('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf1ec('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf1ec('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf1ec('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf1ec('0x7')](0x5)[_0xf1ec('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf1ec('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf1ec('0x7')](0x9)[_0xf1ec('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf1ec('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf1ec('0x11')](_0xf1ec('0x1b'),'ASC'),'defaultValue':_0xf1ec('0x1b')},'dialPrefix':{'type':Sequelize[_0xf1ec('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf1ec('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf1ec('0x1c')},'dialCutDigit':{'type':Sequelize[_0xf1ec('0x7')](0x3)[_0xf1ec('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf1ec('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf1ec('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf1ec('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf1ec('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xf1ec('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf1ec('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf1ec('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf1ec('0x7')](0x3)[_0xf1ec('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf1ec('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf1ec('0x7')](0x5)[_0xf1ec('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf1ec('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xf1ec('0x7')](0x3)[_0xf1ec('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xf1ec('0x7')](0x5)[_0xf1ec('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf1ec('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf1ec('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf1ec('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf1ec('0x7')](0x5)[_0xf1ec('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf1ec('0x25')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 1d9af14..1dd2d7d 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 _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 +var _0xe5b5=['apply','reject','then','error','name','send','index','map','Campaign','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','order','sort','filters','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','params','find','create','body','user','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','clone','get','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileResource','update','destroy','getHoppers','CmHopper','nolimit','pick','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','hasOwnProperty','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_hopper','insert','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range'];(function(_0x1a9bce,_0x4d25b2){var _0x23724d=function(_0x2502d6){while(--_0x2502d6){_0x1a9bce['push'](_0x1a9bce['shift']());}};_0x23724d(++_0x4d25b2);}(_0xe5b5,0x73));var _0x5e5b=function(_0x4b4b0e,_0x6c674){_0x4b4b0e=_0x4b4b0e-0x0;var _0x4c2d91=_0xe5b5[_0x4b4b0e];return _0x4c2d91;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e5b('0x0'));var zipdir=require(_0x5e5b('0x1'));var jsonpatch=require(_0x5e5b('0x2'));var rp=require(_0x5e5b('0x3'));var moment=require(_0x5e5b('0x4'));var BPromise=require(_0x5e5b('0x5'));var Mustache=require(_0x5e5b('0x6'));var util=require(_0x5e5b('0x7'));var path=require(_0x5e5b('0x8'));var sox=require(_0x5e5b('0x9'));var csv=require(_0x5e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5e5b('0xb'));var _=require(_0x5e5b('0xc'));var squel=require(_0x5e5b('0xd'));var crypto=require(_0x5e5b('0xe'));var jsforce=require(_0x5e5b('0xf'));var deskjs=require(_0x5e5b('0x10'));var toCsv=require(_0x5e5b('0xa'));var querystring=require(_0x5e5b('0x11'));var Papa=require('papaparse');var Redis=require(_0x5e5b('0x12'));var authService=require(_0x5e5b('0x13'));var qs=require(_0x5e5b('0x14'));var as=require(_0x5e5b('0x15'));var hardwareService=require(_0x5e5b('0x16'));var logger=require(_0x5e5b('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x5e5b('0x18'));var licenseUtil=require(_0x5e5b('0x19'));var db=require(_0x5e5b('0x1a'))['db'];function respondWithStatusCode(_0x28668a,_0x42e548){_0x42e548=_0x42e548||0xcc;return function(_0x3e0cbe){if(_0x3e0cbe){return _0x28668a['sendStatus'](_0x42e548);}return _0x28668a[_0x5e5b('0x1b')](_0x42e548)[_0x5e5b('0x1c')]();};}function respondWithResult(_0x38dabd,_0x492ef7){_0x492ef7=_0x492ef7||0xc8;return function(_0x18bd59){if(_0x18bd59){return _0x38dabd[_0x5e5b('0x1b')](_0x492ef7)[_0x5e5b('0x1d')](_0x18bd59);}};}function respondWithFilteredResult(_0x4512c4,_0x2639d6){return function(_0x3d8b7f){if(_0x3d8b7f){var _0xa17e55=typeof _0x2639d6[_0x5e5b('0x1e')]==='undefined'&&typeof _0x2639d6[_0x5e5b('0x1f')]===_0x5e5b('0x20');var _0x3ed951=_0x3d8b7f[_0x5e5b('0x21')];var _0x498d68=_0xa17e55?0x0:_0x2639d6[_0x5e5b('0x1e')];var _0xe24365=_0xa17e55?_0x3d8b7f[_0x5e5b('0x21')]:_0x2639d6[_0x5e5b('0x1e')]+_0x2639d6['limit'];var _0x55ffae;if(_0xe24365>=_0x3ed951){_0xe24365=_0x3ed951;_0x55ffae=0xc8;}else{_0x55ffae=0xce;}_0x4512c4[_0x5e5b('0x1b')](_0x55ffae);return _0x4512c4[_0x5e5b('0x22')](_0x5e5b('0x23'),_0x498d68+'-'+_0xe24365+'/'+_0x3ed951)[_0x5e5b('0x1d')](_0x3d8b7f);}return null;};}function patchUpdates(_0x479ae5){return function(_0x2f85e5){try{jsonpatch[_0x5e5b('0x24')](_0x2f85e5,_0x479ae5,!![]);}catch(_0x4f1524){return BPromise[_0x5e5b('0x25')](_0x4f1524);}return _0x2f85e5['save']();};}function saveUpdates(_0x216e80,_0x36cce7){return function(_0x3680a3){if(_0x3680a3){return _0x3680a3['update'](_0x216e80)[_0x5e5b('0x26')](function(_0x53b56b){return _0x53b56b;});}return null;};}function removeEntity(_0x1a06e1,_0x18deec){return function(_0x49b15b){if(_0x49b15b){return _0x49b15b['destroy']()['then'](function(){var _0x5558b3=_0x49b15b['get']({'plain':!![]});var _0x32d94c='IvrCampaigns';return db['UserProfileResource']['destroy']({'where':{'type':_0x32d94c,'resourceId':_0x5558b3['id']}})['then'](function(){return _0x49b15b;});})[_0x5e5b('0x26')](function(){_0x1a06e1[_0x5e5b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x308009,_0x1f76db){return function(_0x5b8b6f){if(!_0x5b8b6f){_0x308009['sendStatus'](0x194);}return _0x5b8b6f;};}function handleError(_0x28290c,_0x2c5e1a){_0x2c5e1a=_0x2c5e1a||0x1f4;return function(_0x545062){logger[_0x5e5b('0x27')](_0x545062['stack']);if(_0x545062[_0x5e5b('0x28')]){delete _0x545062[_0x5e5b('0x28')];}_0x28290c[_0x5e5b('0x1b')](_0x2c5e1a)[_0x5e5b('0x29')](_0x545062);};}exports[_0x5e5b('0x2a')]=function(_0x7c84a4,_0x1a40ba){var _0x1b6cdf={},_0x38bc88={},_0x545a86={'count':0x0,'rows':[]};var _0x543622=_[_0x5e5b('0x2b')](db[_0x5e5b('0x2c')][_0x5e5b('0x2d')],function(_0xd5928){return{'name':_0xd5928['fieldName'],'type':_0xd5928[_0x5e5b('0x2e')]['key']};});_0x38bc88[_0x5e5b('0x2f')]=_[_0x5e5b('0x2b')](_0x543622,'name');_0x38bc88[_0x5e5b('0x30')]=_[_0x5e5b('0x31')](_0x7c84a4[_0x5e5b('0x30')]);_0x38bc88['filters']=_[_0x5e5b('0x32')](_0x38bc88['model'],_0x38bc88[_0x5e5b('0x30')]);_0x1b6cdf[_0x5e5b('0x33')]=_[_0x5e5b('0x32')](_0x38bc88[_0x5e5b('0x2f')],qs[_0x5e5b('0x34')](_0x7c84a4[_0x5e5b('0x30')][_0x5e5b('0x34')]));_0x1b6cdf[_0x5e5b('0x33')]=_0x1b6cdf[_0x5e5b('0x33')][_0x5e5b('0x35')]?_0x1b6cdf[_0x5e5b('0x33')]:_0x38bc88[_0x5e5b('0x2f')];if(!_0x7c84a4[_0x5e5b('0x30')]['hasOwnProperty']('nolimit')){_0x1b6cdf['limit']=qs[_0x5e5b('0x1f')](_0x7c84a4['query'][_0x5e5b('0x1f')]);_0x1b6cdf['offset']=qs[_0x5e5b('0x1e')](_0x7c84a4[_0x5e5b('0x30')][_0x5e5b('0x1e')]);}_0x1b6cdf[_0x5e5b('0x36')]=qs[_0x5e5b('0x37')](_0x7c84a4[_0x5e5b('0x30')][_0x5e5b('0x37')]);_0x1b6cdf['where']=qs[_0x5e5b('0x38')](_['pick'](_0x7c84a4[_0x5e5b('0x30')],_0x38bc88[_0x5e5b('0x38')]),_0x543622);if(_0x7c84a4[_0x5e5b('0x30')][_0x5e5b('0x39')]){_0x1b6cdf['where']=_[_0x5e5b('0x3a')](_0x1b6cdf['where'],{'$or':_[_0x5e5b('0x2b')](_0x543622,function(_0x28d50e){if(_0x28d50e[_0x5e5b('0x2e')]!==_0x5e5b('0x3b')){var _0x423fe6={};_0x423fe6[_0x28d50e['name']]={'$like':'%'+_0x7c84a4['query'][_0x5e5b('0x39')]+'%'};return _0x423fe6;}})});}_0x1b6cdf=_[_0x5e5b('0x3a')]({},_0x1b6cdf,_0x7c84a4[_0x5e5b('0x3c')]);var _0x410ca9={'where':_0x1b6cdf[_0x5e5b('0x3d')]};return db[_0x5e5b('0x2c')]['count'](_0x410ca9)[_0x5e5b('0x26')](function(_0x560a6e){_0x545a86[_0x5e5b('0x21')]=_0x560a6e;if(_0x7c84a4[_0x5e5b('0x30')][_0x5e5b('0x3e')]){_0x1b6cdf[_0x5e5b('0x3f')]=[{'all':!![]}];}return db[_0x5e5b('0x2c')][_0x5e5b('0x40')](_0x1b6cdf);})['then'](function(_0x7ebcbd){_0x545a86[_0x5e5b('0x41')]=_0x7ebcbd;return _0x545a86;})[_0x5e5b('0x26')](respondWithFilteredResult(_0x1a40ba,_0x1b6cdf))[_0x5e5b('0x42')](handleError(_0x1a40ba,null));};exports['show']=function(_0x11d0ce,_0x5eb00b){var _0x45612b={'raw':![],'where':{'id':_0x11d0ce[_0x5e5b('0x43')]['id']}},_0x4a1c79={};_0x4a1c79[_0x5e5b('0x2f')]=_[_0x5e5b('0x31')](db[_0x5e5b('0x2c')]['rawAttributes']);_0x4a1c79['query']=_['keys'](_0x11d0ce[_0x5e5b('0x30')]);_0x4a1c79['filters']=_[_0x5e5b('0x32')](_0x4a1c79[_0x5e5b('0x2f')],_0x4a1c79['query']);_0x45612b[_0x5e5b('0x33')]=_['intersection'](_0x4a1c79['model'],qs[_0x5e5b('0x34')](_0x11d0ce[_0x5e5b('0x30')]['fields']));_0x45612b['attributes']=_0x45612b[_0x5e5b('0x33')][_0x5e5b('0x35')]?_0x45612b['attributes']:_0x4a1c79[_0x5e5b('0x2f')];if(_0x11d0ce[_0x5e5b('0x30')][_0x5e5b('0x3e')]){_0x45612b[_0x5e5b('0x3f')]=[{'all':!![]}];}_0x45612b=_['merge']({},_0x45612b,_0x11d0ce['options']);return db[_0x5e5b('0x2c')][_0x5e5b('0x44')](_0x45612b)[_0x5e5b('0x26')](handleEntityNotFound(_0x5eb00b,null))[_0x5e5b('0x26')](respondWithResult(_0x5eb00b,null))[_0x5e5b('0x42')](handleError(_0x5eb00b,null));};exports[_0x5e5b('0x45')]=function(_0x560132,_0xbcdaad){return db[_0x5e5b('0x2c')][_0x5e5b('0x45')](_0x560132[_0x5e5b('0x46')],{})[_0x5e5b('0x26')](function(_0x3ed7ee){var _0x30fb7c=_0x560132[_0x5e5b('0x47')]['get']({'plain':!![]});if(!_0x30fb7c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30fb7c['role']==='user'){var _0x22cc1f=_0x3ed7ee['get']({'plain':!![]});var _0x59c28b=_0x5e5b('0x48');return db[_0x5e5b('0x49')]['find']({'where':{'name':_0x59c28b,'userProfileId':_0x30fb7c[_0x5e5b('0x4a')]},'raw':!![]})[_0x5e5b('0x26')](function(_0x4060f6){if(_0x4060f6&&_0x4060f6[_0x5e5b('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x22cc1f[_0x5e5b('0x28')],'resourceId':_0x22cc1f['id'],'type':_0x4060f6[_0x5e5b('0x28')],'sectionId':_0x4060f6['id']},{})[_0x5e5b('0x26')](function(){return _0x3ed7ee;});}else{return _0x3ed7ee;}})[_0x5e5b('0x42')](function(_0x1281b2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1281b2);throw _0x1281b2;});}return _0x3ed7ee;})['then'](respondWithResult(_0xbcdaad,0xc9))['catch'](handleError(_0xbcdaad,null));};exports[_0x5e5b('0x4c')]=function(_0x3c19a5,_0x5b3fe0){var _0x2b924d={'where':{'id':_0x3c19a5[_0x5e5b('0x43')]['id']}},_0x1ce1a6={};_0x1ce1a6[_0x5e5b('0x2f')]=_[_0x5e5b('0x31')](db['Campaign'][_0x5e5b('0x2d')]);_0x2b924d[_0x5e5b('0x33')]=_[_0x5e5b('0x32')](_0x1ce1a6[_0x5e5b('0x2f')],qs[_0x5e5b('0x34')](_0x3c19a5[_0x5e5b('0x30')]['fields']));_0x2b924d['attributes']=_0x2b924d[_0x5e5b('0x33')][_0x5e5b('0x35')]?_0x2b924d['attributes']:_0x1ce1a6[_0x5e5b('0x2f')];if(_0x3c19a5[_0x5e5b('0x30')][_0x5e5b('0x3e')]){_0x2b924d['include']=[{'all':!![]}];}_0x2b924d=_[_0x5e5b('0x3a')]({},_0x2b924d,_0x3c19a5[_0x5e5b('0x3c')]);return db['Campaign']['find'](_0x2b924d)[_0x5e5b('0x26')](handleEntityNotFound(_0x5b3fe0,null))['then'](function(_0x158082){if(_0x158082){var _0x5d6488=_0x158082[_0x5e5b('0x4d')]({'plain':!![]});_0x5d6488=qs[_0x5e5b('0x4e')](_0x5d6488,['id','createdAt',_0x5e5b('0x4f')]);_0x3c19a5[_0x5e5b('0x46')]=_['omit'](_0x3c19a5[_0x5e5b('0x46')],['id',_0x5e5b('0x50'),'updatedAt']);return db[_0x5e5b('0x2c')][_0x5e5b('0x45')](_[_0x5e5b('0x3a')](_0x5d6488,_0x3c19a5[_0x5e5b('0x46')]),{'include':_0x3c19a5['query'][_0x5e5b('0x3e')]?[{'all':!![]}]:undefined})[_0x5e5b('0x26')](function(_0x37495d){var _0x582fdc=_0x3c19a5[_0x5e5b('0x47')][_0x5e5b('0x4d')]({'plain':!![]});if(!_0x582fdc)throw new Error(_0x5e5b('0x51'));if(_0x582fdc[_0x5e5b('0x52')]===_0x5e5b('0x47')){var _0x28c8f1=_0x37495d[_0x5e5b('0x4d')]({'plain':!![]});var _0x458342=_0x5e5b('0x48');return db['UserProfileSection'][_0x5e5b('0x44')]({'where':{'name':_0x458342,'userProfileId':_0x582fdc[_0x5e5b('0x4a')]},'raw':!![]})[_0x5e5b('0x26')](function(_0x4e1744){if(_0x4e1744&&_0x4e1744['autoAssociation']===0x0){return db[_0x5e5b('0x53')][_0x5e5b('0x45')]({'name':_0x28c8f1[_0x5e5b('0x28')],'resourceId':_0x28c8f1['id'],'type':_0x4e1744['name'],'sectionId':_0x4e1744['id']},{})[_0x5e5b('0x26')](function(){return _0x37495d;});}else{return _0x37495d;}})[_0x5e5b('0x42')](function(_0x2ca87c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ca87c);throw _0x2ca87c;});}return _0x37495d;});}})[_0x5e5b('0x26')](respondWithResult(_0x5b3fe0,0xc9))[_0x5e5b('0x42')](handleError(_0x5b3fe0,null));};exports[_0x5e5b('0x54')]=function(_0x23257c,_0x1f9233){if(_0x23257c[_0x5e5b('0x46')]['id']){delete _0x23257c[_0x5e5b('0x46')]['id'];}return db[_0x5e5b('0x2c')][_0x5e5b('0x44')]({'where':{'id':_0x23257c[_0x5e5b('0x43')]['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x1f9233,null))['then'](saveUpdates(_0x23257c[_0x5e5b('0x46')],null))[_0x5e5b('0x26')](respondWithResult(_0x1f9233,null))[_0x5e5b('0x42')](handleError(_0x1f9233,null));};exports[_0x5e5b('0x55')]=function(_0x129141,_0x3588cf){return db['Campaign']['find']({'where':{'id':_0x129141['params']['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x3588cf,null))['then'](removeEntity(_0x3588cf,null))[_0x5e5b('0x42')](handleError(_0x3588cf,null));};exports[_0x5e5b('0x56')]=function(_0xcce46d,_0x543f38,_0xbceca6){var _0x53f1cc={'raw':!![],'where':{}};var _0x3a8923={};var _0x2ad7f8={'count':0x0,'rows':[]};return db[_0x5e5b('0x2c')]['findOne']({'where':{'id':_0xcce46d[_0x5e5b('0x43')]['id']}})['then'](handleEntityNotFound(_0x543f38,null))['then'](function(_0x430c1a){if(_0x430c1a){_0x3a8923[_0x5e5b('0x2f')]=_[_0x5e5b('0x31')](db[_0x5e5b('0x57')][_0x5e5b('0x2d')]);_0x3a8923[_0x5e5b('0x30')]=_['keys'](_0xcce46d[_0x5e5b('0x30')]);_0x3a8923['filters']=_[_0x5e5b('0x32')](_0x3a8923['model'],_0x3a8923['query']);_0x53f1cc[_0x5e5b('0x33')]=_[_0x5e5b('0x32')](_0x3a8923[_0x5e5b('0x2f')],qs[_0x5e5b('0x34')](_0xcce46d[_0x5e5b('0x30')][_0x5e5b('0x34')]));_0x53f1cc[_0x5e5b('0x33')]=_0x53f1cc['attributes'][_0x5e5b('0x35')]?_0x53f1cc[_0x5e5b('0x33')]:_0x3a8923[_0x5e5b('0x2f')];if(!_0xcce46d[_0x5e5b('0x30')]['hasOwnProperty'](_0x5e5b('0x58'))){_0x53f1cc['limit']=qs[_0x5e5b('0x1f')](_0xcce46d[_0x5e5b('0x30')][_0x5e5b('0x1f')]);_0x53f1cc[_0x5e5b('0x1e')]=qs[_0x5e5b('0x1e')](_0xcce46d[_0x5e5b('0x30')][_0x5e5b('0x1e')]);}_0x53f1cc[_0x5e5b('0x36')]=qs[_0x5e5b('0x37')](_0xcce46d['query'][_0x5e5b('0x37')]);_0x53f1cc[_0x5e5b('0x3d')]=qs[_0x5e5b('0x38')](_[_0x5e5b('0x59')](_0xcce46d[_0x5e5b('0x30')],_0x3a8923[_0x5e5b('0x38')]));_0x53f1cc['where'][_0x5e5b('0x5a')]=_0x430c1a['id'];if(_0xcce46d[_0x5e5b('0x30')][_0x5e5b('0x39')]){_0x53f1cc[_0x5e5b('0x3d')]=_[_0x5e5b('0x3a')](_0x53f1cc[_0x5e5b('0x3d')],{'$or':_[_0x5e5b('0x2b')](_0x53f1cc['attributes'],function(_0x1cab47){var _0x4f69ff={};_0x4f69ff[_0x1cab47]={'$like':'%'+_0xcce46d[_0x5e5b('0x30')][_0x5e5b('0x39')]+'%'};return _0x4f69ff;})});}_0x53f1cc=_[_0x5e5b('0x3a')]({},_0x53f1cc,_0xcce46d[_0x5e5b('0x3c')]);return db[_0x5e5b('0x57')][_0x5e5b('0x21')]({'where':_0x53f1cc[_0x5e5b('0x3d')]})['then'](function(_0x15214c){_0x2ad7f8[_0x5e5b('0x21')]=_0x15214c;if(_0xcce46d[_0x5e5b('0x30')][_0x5e5b('0x3e')]){_0x53f1cc[_0x5e5b('0x3f')]=[{'all':!![]}];}return db[_0x5e5b('0x57')][_0x5e5b('0x40')](_0x53f1cc);})[_0x5e5b('0x26')](function(_0x1d1367){_0x2ad7f8[_0x5e5b('0x41')]=_0x1d1367;return _0x2ad7f8;});}})[_0x5e5b('0x26')](respondWithFilteredResult(_0x543f38,_0x53f1cc))[_0x5e5b('0x42')](handleError(_0x543f38,null));};exports[_0x5e5b('0x5b')]=function(_0x4c1068,_0x127872,_0x218935){var _0x3d8c79={'raw':!![],'where':{}};var _0x386a9f={};var _0x565477={'count':0x0,'rows':[]};return db[_0x5e5b('0x2c')][_0x5e5b('0x5c')]({'where':{'id':_0x4c1068[_0x5e5b('0x43')]['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x127872,null))[_0x5e5b('0x26')](function(_0x220103){if(_0x220103){_0x386a9f[_0x5e5b('0x2f')]=_[_0x5e5b('0x31')](db[_0x5e5b('0x5d')]['rawAttributes']);_0x386a9f[_0x5e5b('0x30')]=_[_0x5e5b('0x31')](_0x4c1068[_0x5e5b('0x30')]);_0x386a9f[_0x5e5b('0x38')]=_['intersection'](_0x386a9f[_0x5e5b('0x2f')],_0x386a9f['query']);_0x3d8c79[_0x5e5b('0x33')]=_[_0x5e5b('0x32')](_0x386a9f[_0x5e5b('0x2f')],qs[_0x5e5b('0x34')](_0x4c1068[_0x5e5b('0x30')]['fields']));_0x3d8c79[_0x5e5b('0x33')]=_0x3d8c79[_0x5e5b('0x33')]['length']?_0x3d8c79[_0x5e5b('0x33')]:_0x386a9f[_0x5e5b('0x2f')];if(!_0x4c1068['query']['hasOwnProperty'](_0x5e5b('0x58'))){_0x3d8c79[_0x5e5b('0x1f')]=qs[_0x5e5b('0x1f')](_0x4c1068[_0x5e5b('0x30')][_0x5e5b('0x1f')]);_0x3d8c79[_0x5e5b('0x1e')]=qs[_0x5e5b('0x1e')](_0x4c1068[_0x5e5b('0x30')][_0x5e5b('0x1e')]);}_0x3d8c79[_0x5e5b('0x36')]=qs[_0x5e5b('0x37')](_0x4c1068[_0x5e5b('0x30')][_0x5e5b('0x37')]);_0x3d8c79[_0x5e5b('0x3d')]=qs[_0x5e5b('0x38')](_[_0x5e5b('0x59')](_0x4c1068[_0x5e5b('0x30')],_0x386a9f[_0x5e5b('0x38')]));_0x3d8c79['where']['CampaignId']=_0x220103['id'];if(_0x4c1068[_0x5e5b('0x30')][_0x5e5b('0x39')]){_0x3d8c79[_0x5e5b('0x3d')]=_['merge'](_0x3d8c79['where'],{'$or':_[_0x5e5b('0x2b')](_0x3d8c79[_0x5e5b('0x33')],function(_0x35cbc4){var _0x34e34a={};_0x34e34a[_0x35cbc4]={'$like':'%'+_0x4c1068[_0x5e5b('0x30')][_0x5e5b('0x39')]+'%'};return _0x34e34a;})});}_0x3d8c79=_['merge']({},_0x3d8c79,_0x4c1068[_0x5e5b('0x3c')]);return db[_0x5e5b('0x5d')][_0x5e5b('0x21')]({'where':_0x3d8c79[_0x5e5b('0x3d')]})[_0x5e5b('0x26')](function(_0x384e0c){_0x565477[_0x5e5b('0x21')]=_0x384e0c;if(_0x4c1068[_0x5e5b('0x30')]['includeAll']){_0x3d8c79[_0x5e5b('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x5e5b('0x40')](_0x3d8c79);})[_0x5e5b('0x26')](function(_0x12ecfe){_0x565477[_0x5e5b('0x41')]=_0x12ecfe;return _0x565477;});}})['then'](respondWithFilteredResult(_0x127872,_0x3d8c79))[_0x5e5b('0x42')](handleError(_0x127872,null));};exports[_0x5e5b('0x5e')]=function(_0x91b57e,_0x556a4b,_0x2590d1){var _0x59e36e={'raw':!![],'where':{}};var _0x308c1b={};var _0x4298e5={'count':0x0,'rows':[]};return db[_0x5e5b('0x2c')][_0x5e5b('0x5c')]({'where':{'id':_0x91b57e[_0x5e5b('0x43')]['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x556a4b,null))[_0x5e5b('0x26')](function(_0x43dd42){if(_0x43dd42){_0x308c1b[_0x5e5b('0x2f')]=_[_0x5e5b('0x31')](db[_0x5e5b('0x5f')]['rawAttributes']);_0x308c1b[_0x5e5b('0x30')]=_[_0x5e5b('0x31')](_0x91b57e[_0x5e5b('0x30')]);_0x308c1b[_0x5e5b('0x38')]=_[_0x5e5b('0x32')](_0x308c1b[_0x5e5b('0x2f')],_0x308c1b[_0x5e5b('0x30')]);_0x59e36e[_0x5e5b('0x33')]=_[_0x5e5b('0x32')](_0x308c1b[_0x5e5b('0x2f')],qs[_0x5e5b('0x34')](_0x91b57e['query'][_0x5e5b('0x34')]));_0x59e36e['attributes']=_0x59e36e[_0x5e5b('0x33')][_0x5e5b('0x35')]?_0x59e36e['attributes']:_0x308c1b[_0x5e5b('0x2f')];if(!_0x91b57e[_0x5e5b('0x30')]['hasOwnProperty']('nolimit')){_0x59e36e['limit']=qs[_0x5e5b('0x1f')](_0x91b57e[_0x5e5b('0x30')][_0x5e5b('0x1f')]);_0x59e36e[_0x5e5b('0x1e')]=qs[_0x5e5b('0x1e')](_0x91b57e[_0x5e5b('0x30')]['offset']);}_0x59e36e[_0x5e5b('0x36')]=qs[_0x5e5b('0x37')](_0x91b57e[_0x5e5b('0x30')][_0x5e5b('0x37')]);_0x59e36e[_0x5e5b('0x3d')]=qs[_0x5e5b('0x38')](_['pick'](_0x91b57e[_0x5e5b('0x30')],_0x308c1b[_0x5e5b('0x38')]));_0x59e36e[_0x5e5b('0x3d')][_0x5e5b('0x5a')]=_0x43dd42['id'];if(_0x91b57e['query'][_0x5e5b('0x39')]){_0x59e36e[_0x5e5b('0x3d')]=_['merge'](_0x59e36e[_0x5e5b('0x3d')],{'$or':_[_0x5e5b('0x2b')](_0x59e36e[_0x5e5b('0x33')],function(_0x546510){var _0x49ea11={};_0x49ea11[_0x546510]={'$like':'%'+_0x91b57e[_0x5e5b('0x30')][_0x5e5b('0x39')]+'%'};return _0x49ea11;})});}_0x59e36e=_[_0x5e5b('0x3a')]({},_0x59e36e,_0x91b57e[_0x5e5b('0x3c')]);return db[_0x5e5b('0x5f')]['count']({'where':_0x59e36e[_0x5e5b('0x3d')]})['then'](function(_0xd9a6ee){_0x4298e5['count']=_0xd9a6ee;if(_0x91b57e[_0x5e5b('0x30')][_0x5e5b('0x3e')]){_0x59e36e['include']=[{'all':!![]}];}return db[_0x5e5b('0x5f')][_0x5e5b('0x40')](_0x59e36e);})[_0x5e5b('0x26')](function(_0x430291){_0x4298e5['rows']=_0x430291;return _0x4298e5;});}})[_0x5e5b('0x26')](respondWithFilteredResult(_0x556a4b,_0x59e36e))[_0x5e5b('0x42')](handleError(_0x556a4b,null));};exports[_0x5e5b('0x60')]=function(_0x2401f9,_0x46c8b4,_0xb8f0fd){var _0x2cfff0={'raw':!![],'where':{}};var _0x4d9562={};var _0xc8adfb={'count':0x0,'rows':[]};return db[_0x5e5b('0x2c')][_0x5e5b('0x5c')]({'where':{'id':_0x2401f9[_0x5e5b('0x43')]['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x46c8b4,null))['then'](function(_0x499d4b){if(_0x499d4b){_0x4d9562[_0x5e5b('0x2f')]=_['keys'](db[_0x5e5b('0x61')][_0x5e5b('0x2d')]);_0x4d9562[_0x5e5b('0x30')]=_[_0x5e5b('0x31')](_0x2401f9['query']);_0x4d9562[_0x5e5b('0x38')]=_['intersection'](_0x4d9562[_0x5e5b('0x2f')],_0x4d9562[_0x5e5b('0x30')]);_0x2cfff0[_0x5e5b('0x33')]=_[_0x5e5b('0x32')](_0x4d9562[_0x5e5b('0x2f')],qs[_0x5e5b('0x34')](_0x2401f9[_0x5e5b('0x30')][_0x5e5b('0x34')]));_0x2cfff0[_0x5e5b('0x33')]=_0x2cfff0[_0x5e5b('0x33')]['length']?_0x2cfff0[_0x5e5b('0x33')]:_0x4d9562[_0x5e5b('0x2f')];if(!_0x2401f9[_0x5e5b('0x30')]['hasOwnProperty'](_0x5e5b('0x58'))){_0x2cfff0[_0x5e5b('0x1f')]=qs[_0x5e5b('0x1f')](_0x2401f9[_0x5e5b('0x30')][_0x5e5b('0x1f')]);_0x2cfff0[_0x5e5b('0x1e')]=qs[_0x5e5b('0x1e')](_0x2401f9[_0x5e5b('0x30')][_0x5e5b('0x1e')]);}_0x2cfff0[_0x5e5b('0x36')]=qs[_0x5e5b('0x37')](_0x2401f9[_0x5e5b('0x30')]['sort']);_0x2cfff0[_0x5e5b('0x3d')]=qs[_0x5e5b('0x38')](_[_0x5e5b('0x59')](_0x2401f9['query'],_0x4d9562['filters']));_0x2cfff0[_0x5e5b('0x3d')][_0x5e5b('0x5a')]=_0x499d4b['id'];if(_0x2401f9['query'][_0x5e5b('0x39')]){_0x2cfff0['where']=_[_0x5e5b('0x3a')](_0x2cfff0[_0x5e5b('0x3d')],{'$or':_[_0x5e5b('0x2b')](_0x2cfff0[_0x5e5b('0x33')],function(_0x429084){var _0x4c07f0={};_0x4c07f0[_0x429084]={'$like':'%'+_0x2401f9[_0x5e5b('0x30')][_0x5e5b('0x39')]+'%'};return _0x4c07f0;})});}_0x2cfff0=_['merge']({},_0x2cfff0,_0x2401f9[_0x5e5b('0x3c')]);return db[_0x5e5b('0x61')]['count']({'where':_0x2cfff0[_0x5e5b('0x3d')]})[_0x5e5b('0x26')](function(_0x416941){_0xc8adfb['count']=_0x416941;if(_0x2401f9['query'][_0x5e5b('0x3e')]){_0x2cfff0[_0x5e5b('0x3f')]=[{'all':!![]}];}return db[_0x5e5b('0x61')][_0x5e5b('0x40')](_0x2cfff0);})[_0x5e5b('0x26')](function(_0x47c605){_0xc8adfb['rows']=_0x47c605;return _0xc8adfb;});}})[_0x5e5b('0x26')](respondWithFilteredResult(_0x46c8b4,_0x2cfff0))[_0x5e5b('0x42')](handleError(_0x46c8b4,null));};exports['getLists']=function(_0x1da4af,_0x2a691f,_0x440b4c){var _0x2e047b={};var _0xc9ea89={};var _0x381744;var _0x1026e0;return db['Campaign']['findOne']({'where':{'id':_0x1da4af[_0x5e5b('0x43')]['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x2a691f,null))[_0x5e5b('0x26')](function(_0x4113a4){if(_0x4113a4){_0x381744=_0x4113a4;_0xc9ea89[_0x5e5b('0x2f')]=_[_0x5e5b('0x31')](db[_0x5e5b('0x62')]['rawAttributes']);_0xc9ea89['query']=_[_0x5e5b('0x31')](_0x1da4af[_0x5e5b('0x30')]);_0xc9ea89['filters']=_[_0x5e5b('0x32')](_0xc9ea89[_0x5e5b('0x2f')],_0xc9ea89['query']);_0x2e047b[_0x5e5b('0x33')]=_[_0x5e5b('0x32')](_0xc9ea89[_0x5e5b('0x2f')],qs[_0x5e5b('0x34')](_0x1da4af['query'][_0x5e5b('0x34')]));_0x2e047b[_0x5e5b('0x33')]=_0x2e047b[_0x5e5b('0x33')][_0x5e5b('0x35')]?_0x2e047b['attributes']:_0xc9ea89['model'];_0x2e047b['order']=qs[_0x5e5b('0x37')](_0x1da4af[_0x5e5b('0x30')][_0x5e5b('0x37')]);_0x2e047b[_0x5e5b('0x3d')]=qs[_0x5e5b('0x38')](_[_0x5e5b('0x59')](_0x1da4af['query'],_0xc9ea89['filters']));if(_0x1da4af[_0x5e5b('0x30')][_0x5e5b('0x39')]){_0x2e047b['where']=_[_0x5e5b('0x3a')](_0x2e047b[_0x5e5b('0x3d')],{'$or':_[_0x5e5b('0x2b')](_0x2e047b[_0x5e5b('0x33')],function(_0x5b3157){var _0x115a42={};_0x115a42[_0x5b3157]={'$like':'%'+_0x1da4af[_0x5e5b('0x30')][_0x5e5b('0x39')]+'%'};return _0x115a42;})});}_0x2e047b=_[_0x5e5b('0x3a')]({},_0x2e047b,_0x1da4af[_0x5e5b('0x3c')]);return _0x381744[_0x5e5b('0x63')](_0x2e047b);}})[_0x5e5b('0x26')](function(_0x36bcc7){if(_0x36bcc7){_0x1026e0=_0x36bcc7[_0x5e5b('0x35')];if(!_0x1da4af[_0x5e5b('0x30')][_0x5e5b('0x64')](_0x5e5b('0x58'))){_0x2e047b[_0x5e5b('0x1f')]=qs['limit'](_0x1da4af['query'][_0x5e5b('0x1f')]);_0x2e047b[_0x5e5b('0x1e')]=qs['offset'](_0x1da4af[_0x5e5b('0x30')][_0x5e5b('0x1e')]);}return _0x381744[_0x5e5b('0x63')](_0x2e047b);}})[_0x5e5b('0x26')](function(_0x423e75){if(_0x423e75){return _0x423e75?{'count':_0x1026e0,'rows':_0x423e75}:null;}})[_0x5e5b('0x26')](respondWithResult(_0x2a691f,null))['catch'](handleError(_0x2a691f,null));};exports[_0x5e5b('0x65')]=function(_0x3453d2,_0x45931e,_0x2c5a23){var _0x10b74d,_0x3b03e9;var _0x3e0b30=[];var _0xa31f34=moment()[_0x5e5b('0x66')](_0x5e5b('0x67'));return db[_0x5e5b('0x2c')][_0x5e5b('0x44')]({'where':{'id':_0x3453d2[_0x5e5b('0x43')]['id']}})['then'](handleEntityNotFound(_0x45931e,null))[_0x5e5b('0x26')](function(_0x59187b){if(_0x59187b){_0x3b03e9=_0x59187b;return _0x59187b['addLists'](_0x3453d2[_0x5e5b('0x46')][_0x5e5b('0x68')],_[_0x5e5b('0x4e')](_0x3453d2[_0x5e5b('0x46')],[_0x5e5b('0x68'),'id'])||{});}return null;})[_0x5e5b('0x69')](function(_0x538256){var _0x248069;var _0x806763;_0x10b74d=_0x538256||[];var _0x1632c4=[];if(_0x538256){for(var _0x19dfb2=0x0;_0x19dfb2<_0x538256[_0x5e5b('0x35')];_0x19dfb2+=0x1){var _0xd5a993=_0x538256[_0x19dfb2][_0x5e5b('0x4d')]({'plain':!![]});_0x3b03e9[_0x5e5b('0x6a')]=_0x3453d2[_0x5e5b('0x46')][_0x5e5b('0x6a')]?_0x3453d2[_0x5e5b('0x46')]['dialCheckDuplicateType']:_0x3b03e9[_0x5e5b('0x6a')];switch(_0x3b03e9[_0x5e5b('0x6a')]){case _0x5e5b('0x6b'):_0x248069=squel['insert']()[_0x5e5b('0x6c')]('cm_hopper')[_0x5e5b('0x6d')]([_0x5e5b('0x6e'),_0x5e5b('0x6f'),_0x5e5b('0x70'),_0x5e5b('0x71'),_0x5e5b('0x5a'),_0x5e5b('0x50'),_0x5e5b('0x4f')],squel[_0x5e5b('0x72')]()[_0x5e5b('0x73')]('phone',_0x5e5b('0x6e'))[_0x5e5b('0x73')](_0x5e5b('0x74'),_0x5e5b('0x6f'))[_0x5e5b('0x73')]('id',_0x5e5b('0x70'))[_0x5e5b('0x73')](_0xd5a993[_0x5e5b('0x75')][_0x5e5b('0x76')](),_0x5e5b('0x71'))['field'](_0x3453d2[_0x5e5b('0x43')]['id']['toString'](),_0x5e5b('0x5a'))[_0x5e5b('0x73')]('\x27'+_0xa31f34+'\x27',_0x5e5b('0x50'))[_0x5e5b('0x73')]('\x27'+_0xa31f34+'\x27','updatedAt')[_0x5e5b('0x77')](_0x5e5b('0x78'))[_0x5e5b('0x3d')](_0x5e5b('0x79'))[_0x5e5b('0x3d')](_0x5e5b('0x7a'),_0xd5a993[_0x5e5b('0x75')]['toString']())[_0x5e5b('0x3d')](_0x5e5b('0x7b'))['where'](_0x5e5b('0x7c'),squel[_0x5e5b('0x72')]()['field'](_0x5e5b('0x7d'))[_0x5e5b('0x77')](_0x5e5b('0x7e'))[_0x5e5b('0x3d')](_0x5e5b('0x7f'),_0x3453d2['params']['id'][_0x5e5b('0x76')]()))[_0x5e5b('0x3d')](_0x5e5b('0x7c'),squel[_0x5e5b('0x72')]()[_0x5e5b('0x73')](_0x5e5b('0x80'))[_0x5e5b('0x77')]('cm_hopper')[_0x5e5b('0x3d')](_0x5e5b('0x7f'),_0x3453d2[_0x5e5b('0x43')]['id'][_0x5e5b('0x76')]())))[_0x5e5b('0x76')]();break;case _0x5e5b('0x81'):_0x248069=squel['insert']()[_0x5e5b('0x6c')](_0x5e5b('0x82'))[_0x5e5b('0x6d')](['phone',_0x5e5b('0x6f'),'ContactId',_0x5e5b('0x71'),_0x5e5b('0x5a'),_0x5e5b('0x50'),_0x5e5b('0x4f')],squel['select']()[_0x5e5b('0x73')]('phone','phone')[_0x5e5b('0x73')](_0x5e5b('0x74'),_0x5e5b('0x6f'))[_0x5e5b('0x73')]('id',_0x5e5b('0x70'))[_0x5e5b('0x73')](_0xd5a993['CmListId'][_0x5e5b('0x76')](),'ListId')[_0x5e5b('0x73')](_0x3453d2[_0x5e5b('0x43')]['id'][_0x5e5b('0x76')](),_0x5e5b('0x5a'))[_0x5e5b('0x73')]('\x27'+_0xa31f34+'\x27',_0x5e5b('0x50'))['field']('\x27'+_0xa31f34+'\x27',_0x5e5b('0x4f'))['from'](_0x5e5b('0x78'))[_0x5e5b('0x3d')](_0x5e5b('0x79'))['where']('ListId\x20=\x20?',_0xd5a993['CmListId'][_0x5e5b('0x76')]())[_0x5e5b('0x3d')](_0x5e5b('0x7b'))[_0x5e5b('0x3d')](_0x5e5b('0x7c'),squel[_0x5e5b('0x72')]()['field'](_0x5e5b('0x80'))[_0x5e5b('0x77')](_0x5e5b('0x82'))[_0x5e5b('0x3d')](_0x5e5b('0x7f'),_0x3453d2[_0x5e5b('0x43')]['id'][_0x5e5b('0x76')]())))[_0x5e5b('0x76')]();break;default:_0x248069=squel['insert']()[_0x5e5b('0x6c')](_0x5e5b('0x82'))[_0x5e5b('0x6d')]([_0x5e5b('0x6e'),'scheduledAt',_0x5e5b('0x70'),'ListId',_0x5e5b('0x5a'),_0x5e5b('0x50'),_0x5e5b('0x4f')],squel[_0x5e5b('0x72')]()['field'](_0x5e5b('0x6e'),_0x5e5b('0x6e'))[_0x5e5b('0x73')]('NOW()',_0x5e5b('0x6f'))[_0x5e5b('0x73')]('id',_0x5e5b('0x70'))['field'](_0xd5a993[_0x5e5b('0x75')][_0x5e5b('0x76')](),_0x5e5b('0x71'))[_0x5e5b('0x73')](_0x3453d2[_0x5e5b('0x43')]['id'][_0x5e5b('0x76')](),_0x5e5b('0x5a'))['field']('\x27'+_0xa31f34+'\x27',_0x5e5b('0x50'))[_0x5e5b('0x73')]('\x27'+_0xa31f34+'\x27','updatedAt')['from'](_0x5e5b('0x78'))[_0x5e5b('0x3d')]('deletedAt\x20IS\x20NULL')[_0x5e5b('0x3d')](_0x5e5b('0x7a'),_0xd5a993['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x5e5b('0x76')]();}_0x806763=squel[_0x5e5b('0x83')]()['into'](_0x5e5b('0x84'))[_0x5e5b('0x6d')]([_0x5e5b('0x85'),_0x5e5b('0x6f'),_0x5e5b('0x6e'),_0x5e5b('0x86'),_0x5e5b('0x50'),_0x5e5b('0x4f')],squel[_0x5e5b('0x72')]()['field'](_0x5e5b('0x87'),'id')[_0x5e5b('0x73')]('NOW()',_0x5e5b('0x6f'))['field'](_0x5e5b('0x88'),_0x5e5b('0x6e'))[_0x5e5b('0x73')](_0x5e5b('0x89'),_0x5e5b('0x86'))[_0x5e5b('0x73')]('\x27'+_0xa31f34+'\x27','createdAt')[_0x5e5b('0x73')]('\x27'+_0xa31f34+'\x27',_0x5e5b('0x4f'))[_0x5e5b('0x77')](_0x5e5b('0x8a'),'ci')[_0x5e5b('0x8b')](_0x5e5b('0x82'),'h',_0x5e5b('0x8c'))[_0x5e5b('0x3d')](_0x5e5b('0x8d'),_0xd5a993[_0x5e5b('0x75')][_0x5e5b('0x76')]())[_0x5e5b('0x3d')](_0x5e5b('0x8e'),_0x3453d2[_0x5e5b('0x43')]['id'][_0x5e5b('0x76')]())['where']('h.createdAt\x20=\x20?',_0xa31f34))[_0x5e5b('0x76')]();_0x1632c4[_0x5e5b('0x8f')](db[_0x5e5b('0x90')][_0x5e5b('0x30')](_0x248069));_0x3e0b30['push'](db[_0x5e5b('0x90')][_0x5e5b('0x30')](_0x806763));}return BPromise[_0x5e5b('0x91')](_0x1632c4);}})[_0x5e5b('0x26')](function(){return BPromise[_0x5e5b('0x91')](_0x3e0b30);})['then'](function(){return _0x10b74d;})[_0x5e5b('0x26')](respondWithResult(_0x45931e,null))[_0x5e5b('0x42')](handleError(_0x45931e,null));};exports[_0x5e5b('0x92')]=function(_0xb5293a,_0x1eb268,_0xb7925b){return db['Campaign'][_0x5e5b('0x44')]({'where':{'id':_0xb5293a[_0x5e5b('0x43')]['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x1eb268,null))[_0x5e5b('0x26')](function(_0x3b561f){if(_0x3b561f){return _0x3b561f[_0x5e5b('0x92')](_0xb5293a[_0x5e5b('0x30')][_0x5e5b('0x68')]);}})[_0x5e5b('0x26')](function(_0x20479e){if(_0x20479e){return db['CmHopper']['destroy']({'where':{'ListId':_0xb5293a[_0x5e5b('0x30')]['ids'],'CampaignId':_0xb5293a[_0x5e5b('0x43')]['id']}})['then'](function(){return _0x20479e;});}})['then'](respondWithStatusCode(_0x1eb268,null))[_0x5e5b('0x42')](handleError(_0x1eb268,null));};exports[_0x5e5b('0x93')]=function(_0x93f950,_0x4804c6,_0x2e66fa){var _0x2fb482={};var _0x20956f={};var _0x2f4279;var _0x1e4dd0;return db[_0x5e5b('0x2c')][_0x5e5b('0x5c')]({'where':{'id':_0x93f950[_0x5e5b('0x43')]['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x4804c6,null))['then'](function(_0x1186b3){if(_0x1186b3){_0x2f4279=_0x1186b3;_0x20956f[_0x5e5b('0x2f')]=_[_0x5e5b('0x31')](db['CmList']['rawAttributes']);_0x20956f[_0x5e5b('0x30')]=_[_0x5e5b('0x31')](_0x93f950[_0x5e5b('0x30')]);_0x20956f[_0x5e5b('0x38')]=_[_0x5e5b('0x32')](_0x20956f[_0x5e5b('0x2f')],_0x20956f[_0x5e5b('0x30')]);_0x2fb482[_0x5e5b('0x33')]=_[_0x5e5b('0x32')](_0x20956f[_0x5e5b('0x2f')],qs[_0x5e5b('0x34')](_0x93f950[_0x5e5b('0x30')][_0x5e5b('0x34')]));_0x2fb482[_0x5e5b('0x33')]=_0x2fb482[_0x5e5b('0x33')][_0x5e5b('0x35')]?_0x2fb482['attributes']:_0x20956f['model'];_0x2fb482['order']=qs[_0x5e5b('0x37')](_0x93f950['query'][_0x5e5b('0x37')]);_0x2fb482['where']=qs[_0x5e5b('0x38')](_[_0x5e5b('0x59')](_0x93f950[_0x5e5b('0x30')],_0x20956f[_0x5e5b('0x38')]));if(_0x93f950['query']['filter']){_0x2fb482[_0x5e5b('0x3d')]=_[_0x5e5b('0x3a')](_0x2fb482[_0x5e5b('0x3d')],{'$or':_[_0x5e5b('0x2b')](_0x2fb482[_0x5e5b('0x33')],function(_0x38025e){var _0x37f714={};_0x37f714[_0x38025e]={'$like':'%'+_0x93f950[_0x5e5b('0x30')]['filter']+'%'};return _0x37f714;})});}_0x2fb482=_[_0x5e5b('0x3a')]({},_0x2fb482,_0x93f950['options']);return _0x2f4279[_0x5e5b('0x93')](_0x2fb482);}})['then'](function(_0x5bfd97){if(_0x5bfd97){_0x1e4dd0=_0x5bfd97[_0x5e5b('0x35')];if(!_0x93f950[_0x5e5b('0x30')]['hasOwnProperty']('nolimit')){_0x2fb482['limit']=qs[_0x5e5b('0x1f')](_0x93f950[_0x5e5b('0x30')][_0x5e5b('0x1f')]);_0x2fb482[_0x5e5b('0x1e')]=qs[_0x5e5b('0x1e')](_0x93f950[_0x5e5b('0x30')][_0x5e5b('0x1e')]);}return _0x2f4279[_0x5e5b('0x93')](_0x2fb482);}})[_0x5e5b('0x26')](function(_0x2301da){if(_0x2301da){return _0x2301da?{'count':_0x1e4dd0,'rows':_0x2301da}:null;}})[_0x5e5b('0x26')](respondWithResult(_0x4804c6,null))['catch'](handleError(_0x4804c6,null));};exports['addBlackLists']=function(_0x1da201,_0x3bee32,_0x185c84){var _0x4b170b,_0x4c1025;var _0x2dddeb=[];var _0x25a887=moment()[_0x5e5b('0x66')](_0x5e5b('0x67'));return db[_0x5e5b('0x2c')][_0x5e5b('0x44')]({'where':{'id':_0x1da201[_0x5e5b('0x43')]['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x3bee32,null))[_0x5e5b('0x26')](function(_0x15fb75){if(_0x15fb75){_0x4c1025=_0x15fb75;return _0x15fb75[_0x5e5b('0x94')](_0x1da201['body'][_0x5e5b('0x68')],_[_0x5e5b('0x4e')](_0x1da201[_0x5e5b('0x46')],[_0x5e5b('0x68'),'id'])||{});}return null;})[_0x5e5b('0x69')](function(_0x28e0ad){var _0x25495f;var _0xb45473;_0x4b170b=_0x28e0ad||[];var _0x4e7801=[];if(_0x28e0ad){for(var _0x11d758=0x0;_0x11d758<_0x28e0ad[_0x5e5b('0x35')];_0x11d758+=0x1){var _0x5401cc=_0x28e0ad[_0x11d758][_0x5e5b('0x4d')]({'plain':!![]});_0x25495f=squel[_0x5e5b('0x83')]()[_0x5e5b('0x6c')](_0x5e5b('0x95'))[_0x5e5b('0x6d')]([_0x5e5b('0x6e'),_0x5e5b('0x70'),_0x5e5b('0x71'),_0x5e5b('0x5a'),_0x5e5b('0x50'),_0x5e5b('0x4f')],squel[_0x5e5b('0x72')]()['field'](_0x5e5b('0x6e'),_0x5e5b('0x6e'))[_0x5e5b('0x73')]('id',_0x5e5b('0x70'))[_0x5e5b('0x73')](_0x5401cc[_0x5e5b('0x75')]['toString'](),_0x5e5b('0x71'))[_0x5e5b('0x73')](_0x1da201['params']['id'][_0x5e5b('0x76')](),_0x5e5b('0x5a'))[_0x5e5b('0x73')]('NOW()','createdAt')[_0x5e5b('0x73')](_0x5e5b('0x74'),_0x5e5b('0x4f'))['from'](_0x5e5b('0x78'))[_0x5e5b('0x3d')]('deletedAt\x20IS\x20NULL')['where'](_0x5e5b('0x7a'),_0x5401cc[_0x5e5b('0x75')][_0x5e5b('0x76')]())['where'](_0x5e5b('0x7b')))[_0x5e5b('0x76')]();_0x4e7801[_0x5e5b('0x8f')](db['sequelize'][_0x5e5b('0x30')](_0x25495f));}return BPromise[_0x5e5b('0x91')](_0x4e7801);}})['then'](function(){return _0x4b170b;})[_0x5e5b('0x26')](respondWithResult(_0x3bee32,null))['catch'](handleError(_0x3bee32,null));};exports['removeBlackLists']=function(_0x32a261,_0x5ef810,_0x407a96){return db['Campaign']['find']({'where':{'id':_0x32a261['params']['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x5ef810,null))[_0x5e5b('0x26')](function(_0x6b0cae){if(_0x6b0cae){return _0x6b0cae[_0x5e5b('0x96')](_0x32a261['query']['ids']);}})[_0x5e5b('0x26')](function(_0x49d076){if(_0x49d076){return db[_0x5e5b('0x61')][_0x5e5b('0x55')]({'where':{'ListId':_0x32a261['query'][_0x5e5b('0x68')],'CampaignId':_0x32a261[_0x5e5b('0x43')]['id']}})[_0x5e5b('0x26')](function(){return _0x49d076;});}})[_0x5e5b('0x26')](respondWithStatusCode(_0x5ef810,null))[_0x5e5b('0x42')](handleError(_0x5ef810,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 822fd9a..f04a187 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_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 +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 dc1ce27..b1fe5c5 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 _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 +var _0x19ea=['where','attributes','limit','include','map','model','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCampaign','findAll','raw','options'];(function(_0x1e2327,_0x52e463){var _0x33ef71=function(_0x34f7f1){while(--_0x34f7f1){_0x1e2327['push'](_0x1e2327['shift']());}};_0x33ef71(++_0x52e463);}(_0x19ea,0xfe));var _0xa19e=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x19ea[_0xe66cf2];return _0x2d84e7;};'use strict';var _=require(_0xa19e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa19e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa19e('0x2'));var db=require(_0xa19e('0x3'))['db'];var utils=require(_0xa19e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa19e('0x5'));var jayson=require(_0xa19e('0x6'));var client=jayson[_0xa19e('0x7')][_0xa19e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1087e7,_0x30fd4a,_0x336e23){return new BPromise(function(_0x1867cb,_0x44e468){return client[_0xa19e('0x9')](_0x1087e7,_0x336e23)[_0xa19e('0xa')](function(_0x59b907){logger[_0xa19e('0xb')](_0xa19e('0xc'),_0x30fd4a,_0xa19e('0xd'));logger[_0xa19e('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x30fd4a,_0xa19e('0xd'),JSON[_0xa19e('0xf')](_0x59b907));if(_0x59b907[_0xa19e('0x10')]){if(_0x59b907['error'][_0xa19e('0x11')]===0x1f4){logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);return _0x44e468(_0x59b907['error'][_0xa19e('0x12')]);}logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);return _0x1867cb(_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);}else{logger[_0xa19e('0xb')](_0xa19e('0xc'),_0x30fd4a,_0xa19e('0xd'));_0x1867cb(_0x59b907[_0xa19e('0x13')]['message']);}})[_0xa19e('0x14')](function(_0x34066a){logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x34066a);_0x44e468(_0x34066a);});});}exports[_0xa19e('0x15')]=function(_0x38e398){var _0x1f37c4=this;return new Promise(function(_0x530a75,_0xd3e0ff){return db['Campaign'][_0xa19e('0x16')]({'raw':_0x38e398['options']?_0x38e398['options'][_0xa19e('0x17')]===undefined?!![]:![]:!![],'where':_0x38e398[_0xa19e('0x18')]?_0x38e398['options'][_0xa19e('0x19')]||null:null,'attributes':_0x38e398[_0xa19e('0x18')]?_0x38e398[_0xa19e('0x18')][_0xa19e('0x1a')]||null:null,'limit':_0x38e398['options']?_0x38e398[_0xa19e('0x18')][_0xa19e('0x1b')]||null:null,'include':_0x38e398[_0xa19e('0x18')]?_0x38e398[_0xa19e('0x18')][_0xa19e('0x1c')]?_[_0xa19e('0x1d')](_0x38e398[_0xa19e('0x18')][_0xa19e('0x1c')],function(_0xc16a44){return{'model':db[_0xc16a44['model']],'as':_0xc16a44['as'],'attributes':_0xc16a44[_0xa19e('0x1a')],'include':_0xc16a44[_0xa19e('0x1c')]?_['map'](_0xc16a44[_0xa19e('0x1c')],function(_0x1d3ce6){return{'model':db[_0x1d3ce6['model']],'as':_0x1d3ce6['as'],'attributes':_0x1d3ce6[_0xa19e('0x1a')],'include':_0x1d3ce6[_0xa19e('0x1c')]?_['map'](_0x1d3ce6[_0xa19e('0x1c')],function(_0x10682d){return{'model':db[_0x10682d[_0xa19e('0x1e')]],'as':_0x10682d['as'],'attributes':_0x10682d[_0xa19e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa19e('0xa')](function(_0x180407){logger[_0xa19e('0xb')](_0xa19e('0x15'),_0x38e398);logger[_0xa19e('0xe')](_0xa19e('0x15'),_0x38e398,JSON[_0xa19e('0xf')](_0x180407));_0x530a75(_0x180407);})[_0xa19e('0x14')](function(_0x1ce643){logger[_0xa19e('0x10')](_0xa19e('0x15'),_0x1ce643[_0xa19e('0x12')],_0x38e398);_0xd3e0ff(_0x1f37c4[_0xa19e('0x10')](0x1f4,_0x1ce643[_0xa19e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index e947da8..88fed46 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 _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 +var _0x0d4e=['/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','/:id','update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists'];(function(_0x413ab5,_0x25fe01){var _0x482c24=function(_0x11c1e1){while(--_0x11c1e1){_0x413ab5['push'](_0x413ab5['shift']());}};_0x482c24(++_0x25fe01);}(_0x0d4e,0x1ca));var _0xe0d4=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x0d4e[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0xe0d4('0x0'));var util=require(_0xe0d4('0x1'));var path=require(_0xe0d4('0x2'));var timeout=require(_0xe0d4('0x3'));var express=require(_0xe0d4('0x4'));var router=express[_0xe0d4('0x5')]();var fs_extra=require(_0xe0d4('0x6'));var auth=require(_0xe0d4('0x7'));var interaction=require(_0xe0d4('0x8'));var config=require('../../config/environment');var controller=require(_0xe0d4('0x9'));router[_0xe0d4('0xa')]('/',auth[_0xe0d4('0xb')](),controller[_0xe0d4('0xc')]);router['get']('/:id',auth[_0xe0d4('0xb')](),controller[_0xe0d4('0xd')]);router[_0xe0d4('0xa')](_0xe0d4('0xe'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0xf')]);router[_0xe0d4('0xa')](_0xe0d4('0x10'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x11')]);router[_0xe0d4('0xa')](_0xe0d4('0x12'),auth[_0xe0d4('0xb')](),controller['getHopperFinals']);router[_0xe0d4('0xa')](_0xe0d4('0x13'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x14')]);router[_0xe0d4('0xa')](_0xe0d4('0x15'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x16')]);router[_0xe0d4('0xa')](_0xe0d4('0x17'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x18')]);router[_0xe0d4('0x19')]('/',auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x1a')]);router['post'](_0xe0d4('0x1b'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x1c')]);router['post']('/:id/lists',auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x1d')]);router[_0xe0d4('0x19')](_0xe0d4('0x17'),auth[_0xe0d4('0xb')](),controller['addBlackLists']);router[_0xe0d4('0x1e')](_0xe0d4('0x1f'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x20')]);router[_0xe0d4('0x21')]('/:id',auth[_0xe0d4('0xb')](),controller['destroy']);router['delete'](_0xe0d4('0x15'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x22')]);router['delete'](_0xe0d4('0x17'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x23')]);module[_0xe0d4('0x24')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 470b260..f0a826b 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 _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 +var _0x65eb=['TEXT','getDataValue','key','sequelize','exports','STRING'];(function(_0x4bc035,_0x46da0a){var _0x588288=function(_0x5d2a40){while(--_0x5d2a40){_0x4bc035['push'](_0x4bc035['shift']());}};_0x588288(++_0x46da0a);}(_0x65eb,0x17d));var _0xb65e=function(_0x105d03,_0x488b95){_0x105d03=_0x105d03-0x0;var _0x2dd889=_0x65eb[_0x105d03];return _0x2dd889;};'use strict';var Sequelize=require(_0xb65e('0x0'));module[_0xb65e('0x1')]={'key':{'type':Sequelize[_0xb65e('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xb65e('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xb65e('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xb65e('0x4')](_0xb65e('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 3f2f561..2eef8c9 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 _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 +var _0x7d25=['params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','limit','count','set','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','length','options','find','body'];(function(_0x80b36e,_0x4d4528){var _0x1eacc5=function(_0x3b032f){while(--_0x3b032f){_0x80b36e['push'](_0x80b36e['shift']());}};_0x1eacc5(++_0x4d4528);}(_0x7d25,0x177));var _0x57d2=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x7d25[_0x40a825];return _0x273a54;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x57d2('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x57d2('0x1'));var moment=require(_0x57d2('0x2'));var BPromise=require(_0x57d2('0x3'));var Mustache=require(_0x57d2('0x4'));var util=require(_0x57d2('0x5'));var path=require(_0x57d2('0x6'));var sox=require(_0x57d2('0x7'));var csv=require(_0x57d2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x57d2('0x9'));var _=require(_0x57d2('0xa'));var squel=require(_0x57d2('0xb'));var crypto=require(_0x57d2('0xc'));var jsforce=require(_0x57d2('0xd'));var deskjs=require(_0x57d2('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x57d2('0xf'));var Redis=require(_0x57d2('0x10'));var authService=require(_0x57d2('0x11'));var qs=require(_0x57d2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x57d2('0x13'));var logger=require('../../config/logger')(_0x57d2('0x14'));var utils=require(_0x57d2('0x15'));var config=require(_0x57d2('0x16'));var licenseUtil=require(_0x57d2('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ac070,_0x4a535d){_0x4a535d=_0x4a535d||0xcc;return function(_0x3f74f2){if(_0x3f74f2){return _0x1ac070[_0x57d2('0x18')](_0x4a535d);}return _0x1ac070['status'](_0x4a535d)[_0x57d2('0x19')]();};}function respondWithResult(_0x60e547,_0x343c40){_0x343c40=_0x343c40||0xc8;return function(_0x2c9bda){if(_0x2c9bda){return _0x60e547[_0x57d2('0x1a')](_0x343c40)['json'](_0x2c9bda);}};}function respondWithFilteredResult(_0xad5a39,_0x27b719){return function(_0xb75974){if(_0xb75974){var _0x5325c=typeof _0x27b719[_0x57d2('0x1b')]==='undefined'&&typeof _0x27b719[_0x57d2('0x1c')]==='undefined';var _0xfb2f45=_0xb75974[_0x57d2('0x1d')];var _0x39c099=_0x5325c?0x0:_0x27b719[_0x57d2('0x1b')];var _0xe8b091=_0x5325c?_0xb75974[_0x57d2('0x1d')]:_0x27b719[_0x57d2('0x1b')]+_0x27b719[_0x57d2('0x1c')];var _0x31a657;if(_0xe8b091>=_0xfb2f45){_0xe8b091=_0xfb2f45;_0x31a657=0xc8;}else{_0x31a657=0xce;}_0xad5a39[_0x57d2('0x1a')](_0x31a657);return _0xad5a39[_0x57d2('0x1e')]('Content-Range',_0x39c099+'-'+_0xe8b091+'/'+_0xfb2f45)['json'](_0xb75974);}return null;};}function patchUpdates(_0x21322d){return function(_0x25d0b3){try{jsonpatch[_0x57d2('0x1f')](_0x25d0b3,_0x21322d,!![]);}catch(_0x12710e){return BPromise['reject'](_0x12710e);}return _0x25d0b3[_0x57d2('0x20')]();};}function saveUpdates(_0x3ee7d1,_0x3ba13b){return function(_0x1dc2c3){if(_0x1dc2c3){return _0x1dc2c3[_0x57d2('0x21')](_0x3ee7d1)[_0x57d2('0x22')](function(_0x49d363){return _0x49d363;});}return null;};}function removeEntity(_0x33a88b,_0x5ea78a){return function(_0x30674f){if(_0x30674f){return _0x30674f[_0x57d2('0x23')]()[_0x57d2('0x22')](function(){var _0x2d7ebf=_0x30674f[_0x57d2('0x24')]({'plain':!![]});var _0x2766c1=_0x57d2('0x25');return db[_0x57d2('0x26')][_0x57d2('0x23')]({'where':{'type':_0x2766c1,'resourceId':_0x2d7ebf['id']}})['then'](function(){return _0x30674f;});})[_0x57d2('0x22')](function(){_0x33a88b[_0x57d2('0x1a')](0xcc)[_0x57d2('0x19')]();});}};}function handleEntityNotFound(_0x3fb40b,_0x5e22ca){return function(_0x533868){if(!_0x533868){_0x3fb40b['sendStatus'](0x194);}return _0x533868;};}function handleError(_0x30fb95,_0x3c9f61){_0x3c9f61=_0x3c9f61||0x1f4;return function(_0x454a10){logger[_0x57d2('0x27')](_0x454a10[_0x57d2('0x28')]);if(_0x454a10[_0x57d2('0x29')]){delete _0x454a10[_0x57d2('0x29')];}_0x30fb95[_0x57d2('0x1a')](_0x3c9f61)[_0x57d2('0x2a')](_0x454a10);};}exports[_0x57d2('0x2b')]=function(_0x5c69fe,_0x48f987){var _0xdd1e3f={},_0x12d23f={},_0x28c3ee={'count':0x0,'rows':[]};var _0x1e56fa=_[_0x57d2('0x2c')](db[_0x57d2('0x2d')][_0x57d2('0x2e')],function(_0x21cdca){return{'name':_0x21cdca[_0x57d2('0x2f')],'type':_0x21cdca[_0x57d2('0x30')][_0x57d2('0x31')]};});_0x12d23f[_0x57d2('0x32')]=_[_0x57d2('0x2c')](_0x1e56fa,'name');_0x12d23f[_0x57d2('0x33')]=_[_0x57d2('0x34')](_0x5c69fe[_0x57d2('0x33')]);_0x12d23f[_0x57d2('0x35')]=_[_0x57d2('0x36')](_0x12d23f[_0x57d2('0x32')],_0x12d23f[_0x57d2('0x33')]);_0xdd1e3f[_0x57d2('0x37')]=_[_0x57d2('0x36')](_0x12d23f[_0x57d2('0x32')],qs['fields'](_0x5c69fe['query'][_0x57d2('0x38')]));_0xdd1e3f['attributes']=_0xdd1e3f[_0x57d2('0x37')]['length']?_0xdd1e3f[_0x57d2('0x37')]:_0x12d23f['model'];if(!_0x5c69fe[_0x57d2('0x33')][_0x57d2('0x39')](_0x57d2('0x3a'))){_0xdd1e3f[_0x57d2('0x1c')]=qs[_0x57d2('0x1c')](_0x5c69fe['query'][_0x57d2('0x1c')]);_0xdd1e3f[_0x57d2('0x1b')]=qs[_0x57d2('0x1b')](_0x5c69fe[_0x57d2('0x33')]['offset']);}_0xdd1e3f[_0x57d2('0x3b')]=qs['sort'](_0x5c69fe[_0x57d2('0x33')][_0x57d2('0x3c')]);_0xdd1e3f[_0x57d2('0x3d')]=qs[_0x57d2('0x35')](_[_0x57d2('0x3e')](_0x5c69fe[_0x57d2('0x33')],_0x12d23f[_0x57d2('0x35')]),_0x1e56fa);if(_0x5c69fe[_0x57d2('0x33')][_0x57d2('0x3f')]){_0xdd1e3f[_0x57d2('0x3d')]=_[_0x57d2('0x40')](_0xdd1e3f[_0x57d2('0x3d')],{'$or':[{'key':{'$like':'%'+_0x5c69fe[_0x57d2('0x33')]['filter']+'%'}},{'value':{'$like':'%'+_0x5c69fe[_0x57d2('0x33')][_0x57d2('0x3f')]+'%'}}]});}_0xdd1e3f=_[_0x57d2('0x40')]({},_0xdd1e3f,_0x5c69fe['options']);var _0x52a35f={'where':_0xdd1e3f['where']};return db[_0x57d2('0x2d')][_0x57d2('0x1d')](_0x52a35f)['then'](function(_0x383e0a){_0x28c3ee[_0x57d2('0x1d')]=_0x383e0a;if(_0x5c69fe['query'][_0x57d2('0x41')]){_0xdd1e3f[_0x57d2('0x42')]=[{'all':!![]}];}return db[_0x57d2('0x2d')][_0x57d2('0x43')](_0xdd1e3f);})[_0x57d2('0x22')](function(_0xdeb288){_0x28c3ee[_0x57d2('0x44')]=_0xdeb288;return _0x28c3ee;})[_0x57d2('0x22')](respondWithFilteredResult(_0x48f987,_0xdd1e3f))[_0x57d2('0x45')](handleError(_0x48f987,null));};exports[_0x57d2('0x46')]=function(_0x4f7ff0,_0x38c46e){var _0x42d618={'raw':!![],'where':{'id':_0x4f7ff0['params']['id']}},_0x50d687={};_0x50d687['model']=_['keys'](db[_0x57d2('0x2d')][_0x57d2('0x2e')]);_0x50d687[_0x57d2('0x33')]=_[_0x57d2('0x34')](_0x4f7ff0[_0x57d2('0x33')]);_0x50d687['filters']=_[_0x57d2('0x36')](_0x50d687[_0x57d2('0x32')],_0x50d687[_0x57d2('0x33')]);_0x42d618[_0x57d2('0x37')]=_['intersection'](_0x50d687['model'],qs[_0x57d2('0x38')](_0x4f7ff0[_0x57d2('0x33')]['fields']));_0x42d618[_0x57d2('0x37')]=_0x42d618[_0x57d2('0x37')][_0x57d2('0x47')]?_0x42d618[_0x57d2('0x37')]:_0x50d687['model'];if(_0x4f7ff0[_0x57d2('0x33')][_0x57d2('0x41')]){_0x42d618[_0x57d2('0x42')]=[{'all':!![]}];}_0x42d618=_[_0x57d2('0x40')]({},_0x42d618,_0x4f7ff0[_0x57d2('0x48')]);return db['CannedAnswer'][_0x57d2('0x49')](_0x42d618)[_0x57d2('0x22')](handleEntityNotFound(_0x38c46e,null))[_0x57d2('0x22')](respondWithResult(_0x38c46e,null))['catch'](handleError(_0x38c46e,null));};exports[_0x57d2('0x21')]=function(_0x1d82f2,_0x166275){if(_0x1d82f2[_0x57d2('0x4a')]['id']){delete _0x1d82f2['body']['id'];}return db[_0x57d2('0x2d')][_0x57d2('0x49')]({'where':{'id':_0x1d82f2[_0x57d2('0x4b')]['id']}})[_0x57d2('0x22')](handleEntityNotFound(_0x166275,null))[_0x57d2('0x22')](saveUpdates(_0x1d82f2['body'],null))[_0x57d2('0x22')](respondWithResult(_0x166275,null))[_0x57d2('0x45')](handleError(_0x166275,null));};exports[_0x57d2('0x23')]=function(_0x493f59,_0x597c11){return db[_0x57d2('0x2d')]['find']({'where':{'id':_0x493f59[_0x57d2('0x4b')]['id']}})[_0x57d2('0x22')](handleEntityNotFound(_0x597c11,null))['then'](removeEntity(_0x597c11,null))[_0x57d2('0x45')](handleError(_0x597c11,null));};exports[_0x57d2('0x4c')]=function(_0x32e6b9,_0xf0f816){var _0x163e37={'key':_0x32e6b9[_0x57d2('0x4a')][_0x57d2('0x31')]};if(_0x32e6b9[_0x57d2('0x4a')]['MailAccountId']){_0x163e37[_0x57d2('0x4d')]=_0x32e6b9[_0x57d2('0x4a')][_0x57d2('0x4d')];}else if(_0x32e6b9[_0x57d2('0x4a')][_0x57d2('0x4e')]){_0x163e37[_0x57d2('0x4e')]=_0x32e6b9['body'][_0x57d2('0x4e')];}else if(_0x32e6b9['body'][_0x57d2('0x4f')]){_0x163e37[_0x57d2('0x4f')]=_0x32e6b9['body'][_0x57d2('0x4f')];}else if(_0x32e6b9[_0x57d2('0x4a')][_0x57d2('0x50')]){_0x163e37[_0x57d2('0x50')]=_0x32e6b9[_0x57d2('0x4a')][_0x57d2('0x50')];}return db[_0x57d2('0x2d')][_0x57d2('0x49')]({'where':_0x163e37})[_0x57d2('0x22')](function(_0x5a9766){if(_0x5a9766){throw new db[(_0x57d2('0x51'))][(_0x57d2('0x52'))](_0x57d2('0x53'));}return db[_0x57d2('0x2d')][_0x57d2('0x4c')](_0x32e6b9[_0x57d2('0x4a')]);})[_0x57d2('0x22')](function(_0x59564f){var _0x5ca95e=_0x32e6b9[_0x57d2('0x54')][_0x57d2('0x24')]({'plain':!![]});if(!_0x5ca95e)throw new Error(_0x57d2('0x55'));if(_0x5ca95e[_0x57d2('0x56')]===_0x57d2('0x54')){var _0x5e9b6a=_0x59564f[_0x57d2('0x24')]({'plain':!![]});return db[_0x57d2('0x57')][_0x57d2('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x5ca95e[_0x57d2('0x58')]},'raw':!![]})['then'](function(_0x4eb3f0){if(_0x4eb3f0&&_0x4eb3f0[_0x57d2('0x59')]===0x0){return db[_0x57d2('0x26')][_0x57d2('0x4c')]({'name':_0x5e9b6a[_0x57d2('0x29')],'resourceId':_0x5e9b6a['id'],'type':_0x4eb3f0[_0x57d2('0x29')],'sectionId':_0x4eb3f0['id']},{})['then'](function(){return _0x59564f;});}else{return _0x59564f;}})[_0x57d2('0x45')](function(_0x17dd8f){logger[_0x57d2('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17dd8f);throw _0x17dd8f;});}return _0x59564f;})[_0x57d2('0x22')](respondWithResult(_0xf0f816,0xc9))[_0x57d2('0x45')](handleError(_0xf0f816,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index ee86197..6831e28 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 _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 +var _0xfa70=['define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xfa70,0x156));var _0x0fa7=function(_0x330f00,_0x2208d8){_0x330f00=_0x330f00-0x0;var _0x3c79d8=_0xfa70[_0x330f00];return _0x3c79d8;};'use strict';var _=require(_0x0fa7('0x0'));var util=require(_0x0fa7('0x1'));var logger=require(_0x0fa7('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0fa7('0x3'));var fs=require('fs');var path=require(_0x0fa7('0x4'));var rimraf=require(_0x0fa7('0x5'));var config=require(_0x0fa7('0x6'));var attributes=require(_0x0fa7('0x7'));module[_0x0fa7('0x8')]=function(_0x24ee39,_0x46ef20){return _0x24ee39[_0x0fa7('0x9')](_0x0fa7('0xa'),attributes,{'tableName':_0x0fa7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0fa7('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index da1ddcd..1a6527e 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(_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 +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(_0x5f472e,_0x563808){var _0x4adebc=function(_0x54edad){while(--_0x54edad){_0x5f472e['push'](_0x5f472e['shift']());}};_0x4adebc(++_0x563808);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 f7a25f1..335aa52 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 _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 +var _0xbfd6=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x2047eb,_0x563c6b){var _0x4a2123=function(_0x11142d){while(--_0x11142d){_0x2047eb['push'](_0x2047eb['shift']());}};_0x4a2123(++_0x563c6b);}(_0xbfd6,0x16b));var _0x6bfd=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xbfd6[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x6bfd('0x0'));var util=require(_0x6bfd('0x1'));var path=require(_0x6bfd('0x2'));var timeout=require(_0x6bfd('0x3'));var express=require(_0x6bfd('0x4'));var router=express[_0x6bfd('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6bfd('0x6'));var config=require('../../config/environment');var controller=require(_0x6bfd('0x7'));router['get']('/',auth[_0x6bfd('0x8')](),controller[_0x6bfd('0x9')]);router['get'](_0x6bfd('0xa'),auth[_0x6bfd('0x8')](),controller[_0x6bfd('0xb')]);router[_0x6bfd('0xc')]('/',auth[_0x6bfd('0x8')](),controller['create']);router[_0x6bfd('0xd')](_0x6bfd('0xa'),auth[_0x6bfd('0x8')](),controller[_0x6bfd('0xe')]);router[_0x6bfd('0xf')](_0x6bfd('0xa'),auth[_0x6bfd('0x8')](),controller[_0x6bfd('0x10')]);module[_0x6bfd('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 391441c..e037559 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 _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 +var _0x3d15=['DATE','STRING','INTEGER','exports'];(function(_0x502d72,_0x22d8f5){var _0x4cbe7c=function(_0x5ecad5){while(--_0x5ecad5){_0x502d72['push'](_0x502d72['shift']());}};_0x4cbe7c(++_0x22d8f5);}(_0x3d15,0x127));var _0x53d1=function(_0x5b2809,_0x48b226){_0x5b2809=_0x5b2809-0x0;var _0x572dee=_0x3d15[_0x5b2809];return _0x572dee;};'use strict';var Sequelize=require('sequelize');module[_0x53d1('0x0')]={'calldate':{'type':Sequelize[_0x53d1('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x53d1('0x2')]},'src':{'type':Sequelize[_0x53d1('0x2')]},'dst':{'type':Sequelize[_0x53d1('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x53d1('0x2')]},'dstchannel':{'type':Sequelize[_0x53d1('0x2')]},'lastapp':{'type':Sequelize[_0x53d1('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x53d1('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x53d1('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x53d1('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x53d1('0x2')]},'userfield':{'type':Sequelize[_0x53d1('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x53d1('0x2')]},'sequence':{'type':Sequelize[_0x53d1('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x53d1('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 9d0b84b..56151ed 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 _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 +var _0xe14b=['rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','error','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','describe','eml-format'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xe14b,0x93));var _0xbe14=function(_0x522710,_0x35be54){_0x522710=_0x522710-0x0;var _0x4845b4=_0xe14b[_0x522710];return _0x4845b4;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){_0x3d3608['status'](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x5fa043,_0x1ee9c1){return function(_0x39cc81){if(!_0x39cc81){_0x5fa043[_0xbe14('0x16')](0x194);}return _0x39cc81;};}function handleError(_0x2703f5,_0x55d001){_0x55d001=_0x55d001||0x1f4;return function(_0x1822e0){logger[_0xbe14('0x23')](_0x1822e0[_0xbe14('0x24')]);if(_0x1822e0[_0xbe14('0x25')]){delete _0x1822e0['name'];}_0x2703f5[_0xbe14('0x17')](_0x55d001)[_0xbe14('0x26')](_0x1822e0);};}exports['index']=function(_0x3c3613,_0x3b3e84){var _0x1c7cc7={},_0x19252f={},_0x34d648={'count':0x0,'rows':[]};var _0x36d4b2=_[_0xbe14('0x27')](db[_0xbe14('0x28')][_0xbe14('0x29')],function(_0x16a159){return{'name':_0x16a159[_0xbe14('0x2a')],'type':_0x16a159[_0xbe14('0x2b')][_0xbe14('0x2c')]};});_0x19252f[_0xbe14('0x2d')]=_[_0xbe14('0x27')](_0x36d4b2,_0xbe14('0x25'));_0x19252f[_0xbe14('0x2e')]=_[_0xbe14('0x2f')](_0x3c3613[_0xbe14('0x2e')]);_0x19252f[_0xbe14('0x30')]=_['intersection'](_0x19252f[_0xbe14('0x2d')],_0x19252f['query']);_0x1c7cc7['attributes']=_[_0xbe14('0x31')](_0x19252f['model'],qs[_0xbe14('0x32')](_0x3c3613[_0xbe14('0x2e')]['fields']));_0x1c7cc7['attributes']=_0x1c7cc7['attributes'][_0xbe14('0x33')]?_0x1c7cc7[_0xbe14('0x34')]:_0x19252f['model'];if(!_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x35')](_0xbe14('0x36'))){_0x1c7cc7[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x3c3613['query']['limit']);_0x1c7cc7[_0xbe14('0x1c')]=qs['offset'](_0x3c3613['query']['offset']);}_0x1c7cc7[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x38')]);_0x1c7cc7[_0xbe14('0x39')]=qs[_0xbe14('0x30')](_[_0xbe14('0x3a')](_0x3c3613[_0xbe14('0x2e')],_0x19252f[_0xbe14('0x30')]),_0x36d4b2);if(_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x3b')]){_0x1c7cc7[_0xbe14('0x39')]=_['merge'](_0x1c7cc7['where'],{'$or':_[_0xbe14('0x27')](_0x36d4b2,function(_0x2951e1){if(_0x2951e1[_0xbe14('0x2b')]!=='VIRTUAL'){var _0x326329={};_0x326329[_0x2951e1[_0xbe14('0x25')]]={'$like':'%'+_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x3b')]+'%'};return _0x326329;}})});}_0x1c7cc7=_[_0xbe14('0x3c')]({},_0x1c7cc7,_0x3c3613[_0xbe14('0x3d')]);var _0x19fa30={'where':_0x1c7cc7[_0xbe14('0x39')]};return db[_0xbe14('0x28')]['count'](_0x19fa30)[_0xbe14('0x22')](function(_0x841b71){_0x34d648[_0xbe14('0x1b')]=_0x841b71;if(_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x3e')]){_0x1c7cc7[_0xbe14('0x3f')]=[{'all':!![]}];}return db['Cdr'][_0xbe14('0x40')](_0x1c7cc7);})[_0xbe14('0x22')](function(_0x1220c9){_0x34d648[_0xbe14('0x41')]=_0x1220c9;return _0x34d648;})['then'](respondWithFilteredResult(_0x3b3e84,_0x1c7cc7))['catch'](handleError(_0x3b3e84,null));};exports[_0xbe14('0x42')]=function(_0xe417b,_0x3272ae){var _0x51c859={'raw':!![],'where':{'id':_0xe417b[_0xbe14('0x43')]['id']}},_0x5d5318={};_0x5d5318['model']=_['keys'](db[_0xbe14('0x28')][_0xbe14('0x29')]);_0x5d5318[_0xbe14('0x2e')]=_['keys'](_0xe417b['query']);_0x5d5318['filters']=_[_0xbe14('0x31')](_0x5d5318[_0xbe14('0x2d')],_0x5d5318[_0xbe14('0x2e')]);_0x51c859['attributes']=_[_0xbe14('0x31')](_0x5d5318[_0xbe14('0x2d')],qs[_0xbe14('0x32')](_0xe417b[_0xbe14('0x2e')]['fields']));_0x51c859['attributes']=_0x51c859[_0xbe14('0x34')][_0xbe14('0x33')]?_0x51c859[_0xbe14('0x34')]:_0x5d5318[_0xbe14('0x2d')];if(_0xe417b[_0xbe14('0x2e')]['includeAll']){_0x51c859['include']=[{'all':!![]}];}_0x51c859=_[_0xbe14('0x3c')]({},_0x51c859,_0xe417b[_0xbe14('0x3d')]);return db[_0xbe14('0x28')][_0xbe14('0x44')](_0x51c859)['then'](handleEntityNotFound(_0x3272ae,null))[_0xbe14('0x22')](respondWithResult(_0x3272ae,null))[_0xbe14('0x45')](handleError(_0x3272ae,null));};exports['create']=function(_0x396e40,_0x2a35e5){return db[_0xbe14('0x28')][_0xbe14('0x46')](_0x396e40['body'],{})['then'](respondWithResult(_0x2a35e5,0xc9))[_0xbe14('0x45')](handleError(_0x2a35e5,null));};exports[_0xbe14('0x21')]=function(_0x4a1a37,_0x5acf90){if(_0x4a1a37[_0xbe14('0x47')]['id']){delete _0x4a1a37[_0xbe14('0x47')]['id'];}return db[_0xbe14('0x28')][_0xbe14('0x44')]({'where':{'id':_0x4a1a37[_0xbe14('0x43')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x5acf90,null))[_0xbe14('0x22')](saveUpdates(_0x4a1a37['body'],null))[_0xbe14('0x22')](respondWithResult(_0x5acf90,null))[_0xbe14('0x45')](handleError(_0x5acf90,null));};exports[_0xbe14('0x48')]=function(_0x22b1f8,_0x2fc073){return db['Cdr'][_0xbe14('0x44')]({'where':{'id':_0x22b1f8[_0xbe14('0x43')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x2fc073,null))[_0xbe14('0x22')](removeEntity(_0x2fc073,null))[_0xbe14('0x45')](handleError(_0x2fc073,null));};exports[_0xbe14('0x49')]=function(_0x505829,_0x5aeea9){return db[_0xbe14('0x28')][_0xbe14('0x49')]()[_0xbe14('0x22')](respondWithResult(_0x5aeea9,null))['catch'](handleError(_0x5aeea9,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index e78a63e..4249787 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_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 +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x5b987b,_0x127cbc){var _0xa973b9=function(_0x17a9f4){while(--_0x17a9f4){_0x5b987b['push'](_0x5b987b['shift']());}};_0xa973b9(++_0x127cbc);}(_0x7a54,0x106));var _0x47a5=function(_0x3e049e,_0x3a63b6){_0x3e049e=_0x3e049e-0x0;var _0x59e196=_0x7a54[_0x3e049e];return _0x59e196;};'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 afa6212..6534b6b 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 _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 +var _0x8155=['then','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x48aaca,_0x140945){var _0xac5ed9=function(_0x180b19){while(--_0x180b19){_0x48aaca['push'](_0x48aaca['shift']());}};_0xac5ed9(++_0x140945);}(_0x8155,0x196));var _0x5815=function(_0xd4d59a,_0x524fc0){_0xd4d59a=_0xd4d59a-0x0;var _0x52eacc=_0x8155[_0xd4d59a];return _0x52eacc;};'use strict';var _=require(_0x5815('0x0'));var util=require(_0x5815('0x1'));var moment=require(_0x5815('0x2'));var BPromise=require('bluebird');var rs=require(_0x5815('0x3'));var fs=require('fs');var Redis=require(_0x5815('0x4'));var db=require(_0x5815('0x5'))['db'];var utils=require(_0x5815('0x6'));var logger=require(_0x5815('0x7'))(_0x5815('0x8'));var config=require(_0x5815('0x9'));var jayson=require(_0x5815('0xa'));var client=jayson[_0x5815('0xb')][_0x5815('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x298927,_0x478e67,_0xd3a605){return new BPromise(function(_0x5ece98,_0x417ae5){return client[_0x5815('0xd')](_0x298927,_0xd3a605)[_0x5815('0xe')](function(_0x6ee732){logger['info'](_0x5815('0xf'),_0x478e67,_0x5815('0x10'));logger['debug'](_0x5815('0x11'),_0x478e67,_0x5815('0x10'),JSON['stringify'](_0x6ee732));if(_0x6ee732[_0x5815('0x12')]){if(_0x6ee732['error']['code']===0x1f4){logger[_0x5815('0x12')](_0x5815('0xf'),_0x478e67,_0x6ee732['error'][_0x5815('0x13')]);return _0x417ae5(_0x6ee732[_0x5815('0x12')][_0x5815('0x13')]);}logger[_0x5815('0x12')](_0x5815('0xf'),_0x478e67,_0x6ee732['error'][_0x5815('0x13')]);return _0x5ece98(_0x6ee732['error'][_0x5815('0x13')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x478e67,_0x5815('0x10'));_0x5ece98(_0x6ee732['result']['message']);}})[_0x5815('0x14')](function(_0x3ecb7e){logger[_0x5815('0x12')]('Cdr,\x20%s,\x20%s',_0x478e67,_0x3ecb7e);_0x417ae5(_0x3ecb7e);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 860eccf..952dcc2 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(_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 +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x1e9424,_0x191cba){var _0x1bd96c=function(_0x5e952d){while(--_0x5e952d){_0x1e9424['push'](_0x1e9424['shift']());}};_0x1bd96c(++_0x191cba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index bd752af..0996ad2 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 _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 +var _0xa87a=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x33aeff,_0x5ca889){var _0xa1f400=function(_0x25cf9a){while(--_0x25cf9a){_0x33aeff['push'](_0x33aeff['shift']());}};_0xa1f400(++_0x5ca889);}(_0xa87a,0xfe));var _0xaa87=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0xa87a[_0x18abd2];return _0x1dcad6;};'use strict';var Sequelize=require(_0xaa87('0x0'));module[_0xaa87('0x1')]={'priority':{'type':Sequelize[_0xaa87('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xaa87('0x3')},'appdata':{'type':Sequelize[_0xaa87('0x4')]()},'description':{'type':Sequelize[_0xaa87('0x5')]},'interval':{'type':Sequelize[_0xaa87('0x5')],'defaultValue':_0xaa87('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 2b67e15..f06fea8 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 _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 +var _0x4e5c=['merge','options','then','catch','body','eml-format','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','save','update','destroy','error','stack','name','send','params','keys','ChatApplication','query','intersection','model','fields','attributes','length','includeAll','include'];(function(_0x3cbd16,_0x452307){var _0x41f5eb=function(_0x3bfe89){while(--_0x3bfe89){_0x3cbd16['push'](_0x3cbd16['shift']());}};_0x41f5eb(++_0x452307);}(_0x4e5c,0x149));var _0xc4e5=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x4e5c[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0xc4e5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc4e5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc4e5('0x2'));var moment=require(_0xc4e5('0x3'));var BPromise=require(_0xc4e5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc4e5('0x5'));var csv=require(_0xc4e5('0x6'));var ejs=require(_0xc4e5('0x7'));var fs=require('fs');var fs_extra=require(_0xc4e5('0x8'));var _=require(_0xc4e5('0x9'));var squel=require(_0xc4e5('0xa'));var crypto=require(_0xc4e5('0xb'));var jsforce=require(_0xc4e5('0xc'));var deskjs=require(_0xc4e5('0xd'));var toCsv=require(_0xc4e5('0x6'));var querystring=require(_0xc4e5('0xe'));var Papa=require(_0xc4e5('0xf'));var Redis=require('ioredis');var authService=require(_0xc4e5('0x10'));var qs=require(_0xc4e5('0x11'));var as=require(_0xc4e5('0x12'));var hardwareService=require(_0xc4e5('0x13'));var logger=require('../../config/logger')(_0xc4e5('0x14'));var utils=require(_0xc4e5('0x15'));var config=require(_0xc4e5('0x16'));var licenseUtil=require(_0xc4e5('0x17'));var db=require(_0xc4e5('0x18'))['db'];function respondWithStatusCode(_0x418b8b,_0x3fa318){_0x3fa318=_0x3fa318||0xcc;return function(_0x54c5a7){if(_0x54c5a7){return _0x418b8b['sendStatus'](_0x3fa318);}return _0x418b8b[_0xc4e5('0x19')](_0x3fa318)['end']();};}function respondWithResult(_0x3f8150,_0x7cd002){_0x7cd002=_0x7cd002||0xc8;return function(_0x303037){if(_0x303037){return _0x3f8150[_0xc4e5('0x19')](_0x7cd002)['json'](_0x303037);}};}function respondWithFilteredResult(_0x1b7d62,_0x528de4){return function(_0x338c37){if(_0x338c37){var _0x3beb59=typeof _0x528de4[_0xc4e5('0x1a')]===_0xc4e5('0x1b')&&typeof _0x528de4[_0xc4e5('0x1c')]===_0xc4e5('0x1b');var _0x228232=_0x338c37[_0xc4e5('0x1d')];var _0x170c0c=_0x3beb59?0x0:_0x528de4['offset'];var _0x252b5a=_0x3beb59?_0x338c37[_0xc4e5('0x1d')]:_0x528de4['offset']+_0x528de4[_0xc4e5('0x1c')];var _0x33eef8;if(_0x252b5a>=_0x228232){_0x252b5a=_0x228232;_0x33eef8=0xc8;}else{_0x33eef8=0xce;}_0x1b7d62['status'](_0x33eef8);return _0x1b7d62[_0xc4e5('0x1e')]('Content-Range',_0x170c0c+'-'+_0x252b5a+'/'+_0x228232)['json'](_0x338c37);}return null;};}function patchUpdates(_0x2f2970){return function(_0x7dbe6d){try{jsonpatch['apply'](_0x7dbe6d,_0x2f2970,!![]);}catch(_0x34f4e8){return BPromise['reject'](_0x34f4e8);}return _0x7dbe6d[_0xc4e5('0x1f')]();};}function saveUpdates(_0x37e869,_0x505078){return function(_0x546949){if(_0x546949){return _0x546949[_0xc4e5('0x20')](_0x37e869)['then'](function(_0x69cb24){return _0x69cb24;});}return null;};}function removeEntity(_0x41467f,_0x4bb973){return function(_0x4ed1ff){if(_0x4ed1ff){return _0x4ed1ff[_0xc4e5('0x21')]()['then'](function(){_0x41467f[_0xc4e5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x460fd8,_0x234b31){return function(_0x53f7cd){if(!_0x53f7cd){_0x460fd8['sendStatus'](0x194);}return _0x53f7cd;};}function handleError(_0x4b379b,_0x23889c){_0x23889c=_0x23889c||0x1f4;return function(_0x183ec7){logger[_0xc4e5('0x22')](_0x183ec7[_0xc4e5('0x23')]);if(_0x183ec7[_0xc4e5('0x24')]){delete _0x183ec7[_0xc4e5('0x24')];}_0x4b379b[_0xc4e5('0x19')](_0x23889c)[_0xc4e5('0x25')](_0x183ec7);};}exports['show']=function(_0x1cd4d9,_0x2ad4be){var _0x261b88={'raw':!![],'where':{'id':_0x1cd4d9[_0xc4e5('0x26')]['id']}},_0x23383b={};_0x23383b['model']=_[_0xc4e5('0x27')](db[_0xc4e5('0x28')]['rawAttributes']);_0x23383b[_0xc4e5('0x29')]=_['keys'](_0x1cd4d9[_0xc4e5('0x29')]);_0x23383b['filters']=_[_0xc4e5('0x2a')](_0x23383b['model'],_0x23383b[_0xc4e5('0x29')]);_0x261b88['attributes']=_['intersection'](_0x23383b[_0xc4e5('0x2b')],qs[_0xc4e5('0x2c')](_0x1cd4d9[_0xc4e5('0x29')][_0xc4e5('0x2c')]));_0x261b88['attributes']=_0x261b88[_0xc4e5('0x2d')][_0xc4e5('0x2e')]?_0x261b88[_0xc4e5('0x2d')]:_0x23383b[_0xc4e5('0x2b')];if(_0x1cd4d9['query'][_0xc4e5('0x2f')]){_0x261b88[_0xc4e5('0x30')]=[{'all':!![]}];}_0x261b88=_[_0xc4e5('0x31')]({},_0x261b88,_0x1cd4d9[_0xc4e5('0x32')]);return db[_0xc4e5('0x28')]['find'](_0x261b88)[_0xc4e5('0x33')](handleEntityNotFound(_0x2ad4be,null))[_0xc4e5('0x33')](respondWithResult(_0x2ad4be,null))[_0xc4e5('0x34')](handleError(_0x2ad4be,null));};exports['update']=function(_0x44551b,_0x1c78ec){if(_0x44551b[_0xc4e5('0x35')]['id']){delete _0x44551b[_0xc4e5('0x35')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x44551b[_0xc4e5('0x26')]['id']}})[_0xc4e5('0x33')](handleEntityNotFound(_0x1c78ec,null))[_0xc4e5('0x33')](saveUpdates(_0x44551b[_0xc4e5('0x35')],null))[_0xc4e5('0x33')](respondWithResult(_0x1c78ec,null))[_0xc4e5('0x34')](handleError(_0x1c78ec,null));};exports[_0xc4e5('0x21')]=function(_0x2439ee,_0x20bbce){return db['ChatApplication']['find']({'where':{'id':_0x2439ee[_0xc4e5('0x26')]['id']}})[_0xc4e5('0x33')](handleEntityNotFound(_0x20bbce,null))[_0xc4e5('0x33')](removeEntity(_0x20bbce,null))[_0xc4e5('0x34')](handleError(_0x20bbce,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index d2f16f1..4d281ec 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 _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 +var _0xf0cc=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','lodash','api','request-promise','path'];(function(_0x4b91a7,_0x3a9a0b){var _0x598700=function(_0x2465aa){while(--_0x2465aa){_0x4b91a7['push'](_0x4b91a7['shift']());}};_0x598700(++_0x3a9a0b);}(_0xf0cc,0xa7));var _0xcf0c=function(_0x477b32,_0x5135ca){_0x477b32=_0x477b32-0x0;var _0x1d99be=_0xf0cc[_0x477b32];return _0x1d99be;};'use strict';var _=require(_0xcf0c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcf0c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcf0c('0x2'));var fs=require('fs');var path=require(_0xcf0c('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcf0c('0x4'));module[_0xcf0c('0x5')]=function(_0x1a6003,_0x497363){return _0x1a6003[_0xcf0c('0x6')](_0xcf0c('0x7'),attributes,{'tableName':_0xcf0c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 2f7f30e..6d34a8a 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 _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 +var _0x06a9=['../../config/environment','jayson/promise','client','http','request','then','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','request\x20sent','result','util','moment','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0x06a9,0x144));var _0x906a=function(_0x4e8224,_0x3d9649){_0x4e8224=_0x4e8224-0x0;var _0x78c86e=_0x06a9[_0x4e8224];return _0x78c86e;};'use strict';var _=require('lodash');var util=require(_0x906a('0x0'));var moment=require(_0x906a('0x1'));var BPromise=require('bluebird');var rs=require(_0x906a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x906a('0x3'));var logger=require(_0x906a('0x4'))(_0x906a('0x5'));var config=require(_0x906a('0x6'));var jayson=require(_0x906a('0x7'));var client=jayson[_0x906a('0x8')][_0x906a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a1a6d,_0x184d27,_0x19de5b){return new BPromise(function(_0x417f21,_0x3c9341){return client[_0x906a('0xa')](_0x4a1a6d,_0x19de5b)[_0x906a('0xb')](function(_0x56e6a7){logger[_0x906a('0xc')]('ChatApplication,\x20%s,\x20%s',_0x184d27,'request\x20sent');logger[_0x906a('0xd')](_0x906a('0xe'),_0x184d27,'request\x20sent',JSON[_0x906a('0xf')](_0x56e6a7));if(_0x56e6a7[_0x906a('0x10')]){if(_0x56e6a7['error'][_0x906a('0x11')]===0x1f4){logger[_0x906a('0x10')](_0x906a('0x12'),_0x184d27,_0x56e6a7[_0x906a('0x10')]['message']);return _0x3c9341(_0x56e6a7[_0x906a('0x10')][_0x906a('0x13')]);}logger[_0x906a('0x10')](_0x906a('0x12'),_0x184d27,_0x56e6a7[_0x906a('0x10')]['message']);return _0x417f21(_0x56e6a7['error'][_0x906a('0x13')]);}else{logger[_0x906a('0xc')](_0x906a('0x12'),_0x184d27,_0x906a('0x14'));_0x417f21(_0x56e6a7[_0x906a('0x15')][_0x906a('0x13')]);}})['catch'](function(_0x3a9c80){logger[_0x906a('0x10')](_0x906a('0x12'),_0x184d27,_0x3a9c80);_0x3c9341(_0x3a9c80);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 3d1f3b2..1d94d94 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 _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 +var _0xf5c9=['multer','path','express','Router','fs-extra','../../components/interaction/service','./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','destroy','exports'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xf5c9,0x69));var _0x9f5c=function(_0x2200c6,_0x45b748){_0x2200c6=_0x2200c6-0x0;var _0x156997=_0xf5c9[_0x2200c6];return _0x156997;};'use strict';var multer=require(_0x9f5c('0x0'));var util=require('util');var path=require(_0x9f5c('0x1'));var timeout=require('connect-timeout');var express=require(_0x9f5c('0x2'));var router=express[_0x9f5c('0x3')]();var fs_extra=require(_0x9f5c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9f5c('0x5'));var config=require('../../config/environment');var controller=require(_0x9f5c('0x6'));router['get'](_0x9f5c('0x7'),auth[_0x9f5c('0x8')](),controller[_0x9f5c('0x9')]);router[_0x9f5c('0xa')](_0x9f5c('0x7'),auth[_0x9f5c('0x8')](),controller[_0x9f5c('0xb')]);router[_0x9f5c('0xc')](_0x9f5c('0x7'),auth[_0x9f5c('0x8')](),controller[_0x9f5c('0xd')]);module[_0x9f5c('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 7a12140..c851f13 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 _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 +var _0xbd54=['exports','STRING','BOOLEAN','sequelize'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xbd54,0x67));var _0x4bd5=function(_0x5d990e,_0x4ba9f5){_0x5d990e=_0x5d990e-0x0;var _0x36c763=_0xbd54[_0x5d990e];return _0x36c763;};'use strict';var Sequelize=require(_0x4bd5('0x0'));module[_0x4bd5('0x1')]={'name':{'type':Sequelize[_0x4bd5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4bd5('0x2')]},'write':{'type':Sequelize[_0x4bd5('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 b189e76..05258d6 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 _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 +var _0xcb85=['ids','addMessage','ChatGroupId','$gte','format','getMessages','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','ChatGroup','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','catch','keys','find','create','body','params','describe','getUnread','ChatInternalMessage','toInteger','addMembers','omit','getMembers','findOne','User','removeMembers'];(function(_0x59a436,_0x196b36){var _0x36554d=function(_0x3676dd){while(--_0x3676dd){_0x59a436['push'](_0x59a436['shift']());}};_0x36554d(++_0x196b36);}(_0xcb85,0x18a));var _0x5cb8=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xcb85[_0x2b10c6];return _0x3789d2;};'use strict';var emlformat=require(_0x5cb8('0x0'));var rimraf=require(_0x5cb8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5cb8('0x2'));var rp=require(_0x5cb8('0x3'));var moment=require(_0x5cb8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5cb8('0x5'));var util=require(_0x5cb8('0x6'));var path=require(_0x5cb8('0x7'));var sox=require('sox');var csv=require(_0x5cb8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5cb8('0x9'));var _=require(_0x5cb8('0xa'));var squel=require('squel');var crypto=require(_0x5cb8('0xb'));var jsforce=require(_0x5cb8('0xc'));var deskjs=require(_0x5cb8('0xd'));var toCsv=require(_0x5cb8('0x8'));var querystring=require('querystring');var Papa=require(_0x5cb8('0xe'));var Redis=require(_0x5cb8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5cb8('0x10'));var as=require(_0x5cb8('0x11'));var hardwareService=require(_0x5cb8('0x12'));var logger=require(_0x5cb8('0x13'))(_0x5cb8('0x14'));var utils=require('../../config/utils');var config=require(_0x5cb8('0x15'));var licenseUtil=require(_0x5cb8('0x16'));var db=require(_0x5cb8('0x17'))['db'];config[_0x5cb8('0x18')]=_[_0x5cb8('0x19')](config['redis'],{'host':_0x5cb8('0x1a'),'port':0x18eb});var socket=require(_0x5cb8('0x1b'))(new Redis(config[_0x5cb8('0x18')]));require(_0x5cb8('0x1c'))[_0x5cb8('0x1d')](socket);function respondWithStatusCode(_0x13625a,_0x5735da){_0x5735da=_0x5735da||0xcc;return function(_0xc890ab){if(_0xc890ab){return _0x13625a[_0x5cb8('0x1e')](_0x5735da);}return _0x13625a[_0x5cb8('0x1f')](_0x5735da)[_0x5cb8('0x20')]();};}function respondWithResult(_0x17bfae,_0xddf22c){_0xddf22c=_0xddf22c||0xc8;return function(_0x2d3328){if(_0x2d3328){return _0x17bfae[_0x5cb8('0x1f')](_0xddf22c)['json'](_0x2d3328);}};}function respondWithFilteredResult(_0x11c70c,_0x1f94d5){return function(_0x3a7f9a){if(_0x3a7f9a){var _0x5919ad=typeof _0x1f94d5[_0x5cb8('0x21')]===_0x5cb8('0x22')&&typeof _0x1f94d5['limit']===_0x5cb8('0x22');var _0x425693=_0x3a7f9a[_0x5cb8('0x23')];var _0x479f29=_0x5919ad?0x0:_0x1f94d5[_0x5cb8('0x21')];var _0x1f6bae=_0x5919ad?_0x3a7f9a[_0x5cb8('0x23')]:_0x1f94d5[_0x5cb8('0x21')]+_0x1f94d5[_0x5cb8('0x24')];var _0x5287c0;if(_0x1f6bae>=_0x425693){_0x1f6bae=_0x425693;_0x5287c0=0xc8;}else{_0x5287c0=0xce;}_0x11c70c[_0x5cb8('0x1f')](_0x5287c0);return _0x11c70c[_0x5cb8('0x25')](_0x5cb8('0x26'),_0x479f29+'-'+_0x1f6bae+'/'+_0x425693)[_0x5cb8('0x27')](_0x3a7f9a);}return null;};}function patchUpdates(_0x48af23){return function(_0x54f124){try{jsonpatch[_0x5cb8('0x28')](_0x54f124,_0x48af23,!![]);}catch(_0x2e707d){return BPromise[_0x5cb8('0x29')](_0x2e707d);}return _0x54f124[_0x5cb8('0x2a')]();};}function saveUpdates(_0x571215,_0x431482){return function(_0x3b29e4){if(_0x3b29e4){return _0x3b29e4[_0x5cb8('0x2b')](_0x571215)[_0x5cb8('0x2c')](function(_0x4a0c7e){return _0x4a0c7e;});}return null;};}function removeEntity(_0x3926ce,_0x2bd69f){return function(_0x4287b4){if(_0x4287b4){return _0x4287b4[_0x5cb8('0x2d')]()[_0x5cb8('0x2c')](function(){_0x3926ce[_0x5cb8('0x1f')](0xcc)[_0x5cb8('0x20')]();});}};}function handleEntityNotFound(_0x2945d9,_0x150f9e){return function(_0x4b3c73){if(!_0x4b3c73){_0x2945d9[_0x5cb8('0x1e')](0x194);}return _0x4b3c73;};}function handleError(_0x1a5125,_0x14dfaf){_0x14dfaf=_0x14dfaf||0x1f4;return function(_0xf5b7b9){logger[_0x5cb8('0x2e')](_0xf5b7b9['stack']);if(_0xf5b7b9[_0x5cb8('0x2f')]){delete _0xf5b7b9[_0x5cb8('0x2f')];}_0x1a5125['status'](_0x14dfaf)[_0x5cb8('0x30')](_0xf5b7b9);};}exports[_0x5cb8('0x31')]=function(_0x3be227,_0x150a36){var _0x50ef98={},_0x33fa36={},_0x40ee08={'count':0x0,'rows':[]};var _0x5206ec=_['map'](db[_0x5cb8('0x32')][_0x5cb8('0x33')],function(_0xf50cb3){return{'name':_0xf50cb3[_0x5cb8('0x34')],'type':_0xf50cb3['type'][_0x5cb8('0x35')]};});_0x33fa36[_0x5cb8('0x36')]=_[_0x5cb8('0x37')](_0x5206ec,_0x5cb8('0x2f'));_0x33fa36[_0x5cb8('0x38')]=_['keys'](_0x3be227['query']);_0x33fa36['filters']=_[_0x5cb8('0x39')](_0x33fa36[_0x5cb8('0x36')],_0x33fa36['query']);_0x50ef98[_0x5cb8('0x3a')]=_[_0x5cb8('0x39')](_0x33fa36[_0x5cb8('0x36')],qs[_0x5cb8('0x3b')](_0x3be227[_0x5cb8('0x38')]['fields']));_0x50ef98[_0x5cb8('0x3a')]=_0x50ef98[_0x5cb8('0x3a')][_0x5cb8('0x3c')]?_0x50ef98['attributes']:_0x33fa36[_0x5cb8('0x36')];if(!_0x3be227['query'][_0x5cb8('0x3d')](_0x5cb8('0x3e'))){_0x50ef98[_0x5cb8('0x24')]=qs[_0x5cb8('0x24')](_0x3be227[_0x5cb8('0x38')]['limit']);_0x50ef98[_0x5cb8('0x21')]=qs[_0x5cb8('0x21')](_0x3be227['query'][_0x5cb8('0x21')]);}_0x50ef98[_0x5cb8('0x3f')]=qs[_0x5cb8('0x40')](_0x3be227['query'][_0x5cb8('0x40')]);_0x50ef98['where']=qs[_0x5cb8('0x41')](_[_0x5cb8('0x42')](_0x3be227[_0x5cb8('0x38')],_0x33fa36[_0x5cb8('0x41')]),_0x5206ec);if(_0x3be227[_0x5cb8('0x38')][_0x5cb8('0x43')]){_0x50ef98[_0x5cb8('0x44')]=_[_0x5cb8('0x45')](_0x50ef98['where'],{'$or':_[_0x5cb8('0x37')](_0x5206ec,function(_0x2985db){if(_0x2985db[_0x5cb8('0x46')]!==_0x5cb8('0x47')){var _0x22ec17={};_0x22ec17[_0x2985db[_0x5cb8('0x2f')]]={'$like':'%'+_0x3be227[_0x5cb8('0x38')][_0x5cb8('0x43')]+'%'};return _0x22ec17;}})});}_0x50ef98=_[_0x5cb8('0x45')]({},_0x50ef98,_0x3be227[_0x5cb8('0x48')]);var _0x3caf50={'where':_0x50ef98['where']};return db[_0x5cb8('0x32')][_0x5cb8('0x23')](_0x3caf50)[_0x5cb8('0x2c')](function(_0x28890c){_0x40ee08[_0x5cb8('0x23')]=_0x28890c;if(_0x3be227['query'][_0x5cb8('0x49')]){_0x50ef98['include']=[{'all':!![]}];}return db[_0x5cb8('0x32')][_0x5cb8('0x4a')](_0x50ef98);})[_0x5cb8('0x2c')](function(_0x3d285b){_0x40ee08['rows']=_0x3d285b;return _0x40ee08;})[_0x5cb8('0x2c')](respondWithFilteredResult(_0x150a36,_0x50ef98))[_0x5cb8('0x4b')](handleError(_0x150a36,null));};exports['show']=function(_0x2897d4,_0x39fc58){var _0x787cc9={'raw':!![],'where':{'id':_0x2897d4['params']['id']}},_0x4cd878={};_0x4cd878[_0x5cb8('0x36')]=_[_0x5cb8('0x4c')](db[_0x5cb8('0x32')]['rawAttributes']);_0x4cd878[_0x5cb8('0x38')]=_[_0x5cb8('0x4c')](_0x2897d4[_0x5cb8('0x38')]);_0x4cd878[_0x5cb8('0x41')]=_[_0x5cb8('0x39')](_0x4cd878['model'],_0x4cd878['query']);_0x787cc9[_0x5cb8('0x3a')]=_[_0x5cb8('0x39')](_0x4cd878['model'],qs[_0x5cb8('0x3b')](_0x2897d4[_0x5cb8('0x38')]['fields']));_0x787cc9[_0x5cb8('0x3a')]=_0x787cc9[_0x5cb8('0x3a')]['length']?_0x787cc9[_0x5cb8('0x3a')]:_0x4cd878[_0x5cb8('0x36')];if(_0x2897d4[_0x5cb8('0x38')][_0x5cb8('0x49')]){_0x787cc9['include']=[{'all':!![]}];}_0x787cc9=_[_0x5cb8('0x45')]({},_0x787cc9,_0x2897d4[_0x5cb8('0x48')]);return db[_0x5cb8('0x32')][_0x5cb8('0x4d')](_0x787cc9)[_0x5cb8('0x2c')](handleEntityNotFound(_0x39fc58,null))[_0x5cb8('0x2c')](respondWithResult(_0x39fc58,null))[_0x5cb8('0x4b')](handleError(_0x39fc58,null));};exports[_0x5cb8('0x4e')]=function(_0x1394f0,_0x8efd67){return db[_0x5cb8('0x32')][_0x5cb8('0x4e')](_0x1394f0[_0x5cb8('0x4f')],{})[_0x5cb8('0x2c')](respondWithResult(_0x8efd67,0xc9))[_0x5cb8('0x4b')](handleError(_0x8efd67,null));};exports['update']=function(_0x4b48b4,_0x103b06){if(_0x4b48b4[_0x5cb8('0x4f')]['id']){delete _0x4b48b4[_0x5cb8('0x4f')]['id'];}return db[_0x5cb8('0x32')]['find']({'where':{'id':_0x4b48b4[_0x5cb8('0x50')]['id']}})[_0x5cb8('0x2c')](handleEntityNotFound(_0x103b06,null))['then'](saveUpdates(_0x4b48b4[_0x5cb8('0x4f')],null))[_0x5cb8('0x2c')](respondWithResult(_0x103b06,null))[_0x5cb8('0x4b')](handleError(_0x103b06,null));};exports[_0x5cb8('0x2d')]=function(_0x5a327a,_0x43cb0b){return db[_0x5cb8('0x32')][_0x5cb8('0x4d')]({'where':{'id':_0x5a327a[_0x5cb8('0x50')]['id']}})[_0x5cb8('0x2c')](handleEntityNotFound(_0x43cb0b,null))['then'](removeEntity(_0x43cb0b,null))['catch'](handleError(_0x43cb0b,null));};exports[_0x5cb8('0x51')]=function(_0x4535ba,_0x37db9c){return db[_0x5cb8('0x32')][_0x5cb8('0x51')]()[_0x5cb8('0x2c')](respondWithResult(_0x37db9c,null))[_0x5cb8('0x4b')](handleError(_0x37db9c,null));};exports[_0x5cb8('0x52')]=function(_0x4d9f9c,_0x4f0bf2,_0x4dafc9){return db[_0x5cb8('0x53')][_0x5cb8('0x23')]({'where':{'ChatGroupId':_0x4d9f9c[_0x5cb8('0x50')]['id'],'ToId':_0x4d9f9c['user']['id'],'read':![]}})[_0x5cb8('0x2c')](function(_0x1e4466){return{'id':_[_0x5cb8('0x54')](_0x4d9f9c['params']['id']),'count':_0x1e4466};})[_0x5cb8('0x2c')](respondWithResult(_0x4f0bf2,null))[_0x5cb8('0x4b')](handleError(_0x4f0bf2,null));};exports[_0x5cb8('0x55')]=function(_0x3a0ce6,_0x52b48f,_0x4dd5c6){return db['ChatGroup']['find']({'where':{'id':_0x3a0ce6[_0x5cb8('0x50')]['id']}})[_0x5cb8('0x2c')](handleEntityNotFound(_0x52b48f,null))['then'](function(_0x437742){if(_0x437742){return _0x437742[_0x5cb8('0x55')](_0x3a0ce6[_0x5cb8('0x4f')]['ids'],_[_0x5cb8('0x56')](_0x3a0ce6[_0x5cb8('0x4f')],['ids','id'])||{});}})[_0x5cb8('0x2c')](respondWithResult(_0x52b48f,null))['catch'](handleError(_0x52b48f,null));};exports[_0x5cb8('0x57')]=function(_0x2b25fd,_0x22a642,_0x3d920b){var _0x12b014={};var _0x39f8a={};var _0x12e3f9;var _0x44370b;return db[_0x5cb8('0x32')][_0x5cb8('0x58')]({'where':{'id':_0x2b25fd[_0x5cb8('0x50')]['id']}})[_0x5cb8('0x2c')](handleEntityNotFound(_0x22a642,null))[_0x5cb8('0x2c')](function(_0x146d6c){if(_0x146d6c){_0x12e3f9=_0x146d6c;_0x39f8a[_0x5cb8('0x36')]=_[_0x5cb8('0x4c')](db[_0x5cb8('0x59')][_0x5cb8('0x33')]);_0x39f8a[_0x5cb8('0x38')]=_[_0x5cb8('0x4c')](_0x2b25fd[_0x5cb8('0x38')]);_0x39f8a[_0x5cb8('0x41')]=_[_0x5cb8('0x39')](_0x39f8a['model'],_0x39f8a[_0x5cb8('0x38')]);_0x12b014['attributes']=_[_0x5cb8('0x39')](_0x39f8a[_0x5cb8('0x36')],qs[_0x5cb8('0x3b')](_0x2b25fd[_0x5cb8('0x38')][_0x5cb8('0x3b')]));_0x12b014['attributes']=_0x12b014[_0x5cb8('0x3a')]['length']?_0x12b014[_0x5cb8('0x3a')]:_0x39f8a[_0x5cb8('0x36')];_0x12b014[_0x5cb8('0x3f')]=qs[_0x5cb8('0x40')](_0x2b25fd[_0x5cb8('0x38')][_0x5cb8('0x40')]);_0x12b014[_0x5cb8('0x44')]=qs['filters'](_['pick'](_0x2b25fd['query'],_0x39f8a['filters']));if(_0x2b25fd[_0x5cb8('0x38')][_0x5cb8('0x43')]){_0x12b014[_0x5cb8('0x44')]=_[_0x5cb8('0x45')](_0x12b014[_0x5cb8('0x44')],{'$or':_[_0x5cb8('0x37')](_0x12b014[_0x5cb8('0x3a')],function(_0x265733){var _0x279875={};_0x279875[_0x265733]={'$like':'%'+_0x2b25fd[_0x5cb8('0x38')][_0x5cb8('0x43')]+'%'};return _0x279875;})});}_0x12b014=_['merge']({},_0x12b014,_0x2b25fd[_0x5cb8('0x48')]);return _0x12e3f9['getMembers'](_0x12b014);}})[_0x5cb8('0x2c')](function(_0x59425){if(_0x59425){_0x44370b=_0x59425[_0x5cb8('0x3c')];if(!_0x2b25fd[_0x5cb8('0x38')][_0x5cb8('0x3d')](_0x5cb8('0x3e'))){_0x12b014[_0x5cb8('0x24')]=qs[_0x5cb8('0x24')](_0x2b25fd[_0x5cb8('0x38')][_0x5cb8('0x24')]);_0x12b014['offset']=qs['offset'](_0x2b25fd[_0x5cb8('0x38')][_0x5cb8('0x21')]);}return _0x12e3f9[_0x5cb8('0x57')](_0x12b014);}})[_0x5cb8('0x2c')](function(_0x488f25){if(_0x488f25){return _0x488f25?{'count':_0x44370b,'rows':_0x488f25}:null;}})['then'](respondWithResult(_0x22a642,null))[_0x5cb8('0x4b')](handleError(_0x22a642,null));};exports[_0x5cb8('0x5a')]=function(_0xa0ba4,_0x193682,_0x2a2c43){return db['ChatGroup'][_0x5cb8('0x4d')]({'where':{'id':_0xa0ba4[_0x5cb8('0x50')]['id']}})[_0x5cb8('0x2c')](handleEntityNotFound(_0x193682,null))[_0x5cb8('0x2c')](function(_0x81bbf2){if(_0x81bbf2){return _0x81bbf2[_0x5cb8('0x5a')](_0xa0ba4['query'][_0x5cb8('0x5b')]);}})['then'](respondWithStatusCode(_0x193682,null))[_0x5cb8('0x4b')](handleError(_0x193682,null));};exports[_0x5cb8('0x5c')]=function(_0x3c6997,_0x21b4d1,_0x3369fc){if(_0x3c6997[_0x5cb8('0x4f')]['id']){delete _0x3c6997[_0x5cb8('0x4f')]['id'];}return db[_0x5cb8('0x32')]['find']({'where':{'id':_0x3c6997[_0x5cb8('0x50')]['id']}})[_0x5cb8('0x2c')](handleEntityNotFound(_0x21b4d1,null))[_0x5cb8('0x2c')](function(_0x1459b3){if(_0x1459b3){_0x3c6997[_0x5cb8('0x4f')][_0x5cb8('0x5d')]=_0x1459b3['id'];return db['ChatInternalMessage'][_0x5cb8('0x4e')](_0x3c6997[_0x5cb8('0x4f')]);}})[_0x5cb8('0x2c')](respondWithResult(_0x21b4d1,null))[_0x5cb8('0x4b')](handleError(_0x21b4d1,null));};exports['getMessages']=function(_0x5b6763,_0x36446b,_0x1f2513){var _0x4644de={};var _0x211f6a={};var _0x514fc8;var _0x17c3a8;return db[_0x5cb8('0x32')]['findOne']({'where':{'id':_0x5b6763[_0x5cb8('0x50')]['id']}})[_0x5cb8('0x2c')](handleEntityNotFound(_0x36446b,null))[_0x5cb8('0x2c')](function(_0x2ea703){if(_0x2ea703){_0x514fc8=_0x2ea703;_0x211f6a[_0x5cb8('0x36')]=_[_0x5cb8('0x4c')](db['ChatInternalMessage'][_0x5cb8('0x33')]);_0x211f6a[_0x5cb8('0x38')]=_['keys'](_0x5b6763[_0x5cb8('0x38')]);_0x211f6a['filters']=_['intersection'](_0x211f6a[_0x5cb8('0x36')],_0x211f6a[_0x5cb8('0x38')]);_0x4644de[_0x5cb8('0x3a')]=_[_0x5cb8('0x39')](_0x211f6a['model'],qs[_0x5cb8('0x3b')](_0x5b6763[_0x5cb8('0x38')][_0x5cb8('0x3b')]));_0x4644de[_0x5cb8('0x3a')]=_0x4644de['attributes']['length']?_0x4644de['attributes']:_0x211f6a['model'];_0x4644de['order']=qs[_0x5cb8('0x40')](_0x5b6763['query'][_0x5cb8('0x40')]);_0x4644de[_0x5cb8('0x44')]=qs['filters'](_[_0x5cb8('0x42')](_0x5b6763[_0x5cb8('0x38')],_0x211f6a[_0x5cb8('0x41')]));if(_0x5b6763['query'][_0x5cb8('0x43')]){_0x4644de[_0x5cb8('0x44')]=_[_0x5cb8('0x45')](_0x4644de['where'],{'$or':_[_0x5cb8('0x37')](_0x4644de['attributes'],function(_0x6fb61b){var _0x3020e5={};_0x3020e5[_0x6fb61b]={'$like':'%'+_0x5b6763['query'][_0x5cb8('0x43')]+'%'};return _0x3020e5;})});}if(_0x5b6763[_0x5cb8('0x38')][_0x5cb8('0x5e')]){var _0x2947b5=_0x5b6763[_0x5cb8('0x38')][_0x5cb8('0x5e')]['split'](',');var _0x3d8c59={};_0x3d8c59[_0x2947b5[0x0]]={'$gte':moment(_0x2947b5[0x1])[_0x5cb8('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4644de[_0x5cb8('0x44')]=_[_0x5cb8('0x45')](_0x4644de[_0x5cb8('0x44')],_0x3d8c59);}_0x4644de=_['merge']({},_0x4644de,_0x5b6763['options']);return _0x514fc8['getMessages'](_0x4644de);}})[_0x5cb8('0x2c')](function(_0x3852d){if(_0x3852d){_0x17c3a8=_0x3852d[_0x5cb8('0x3c')];if(!_0x5b6763[_0x5cb8('0x38')][_0x5cb8('0x3d')](_0x5cb8('0x3e'))){_0x4644de[_0x5cb8('0x24')]=qs[_0x5cb8('0x24')](_0x5b6763[_0x5cb8('0x38')]['limit']);_0x4644de[_0x5cb8('0x21')]=qs[_0x5cb8('0x21')](_0x5b6763[_0x5cb8('0x38')]['offset']);}return _0x514fc8[_0x5cb8('0x60')](_0x4644de);}})[_0x5cb8('0x2c')](function(_0x2acf93){if(_0x2acf93){return _0x2acf93?{'count':_0x17c3a8,'rows':_0x2acf93}:null;}})[_0x5cb8('0x2c')](respondWithResult(_0x36446b,null))[_0x5cb8('0x4b')](handleError(_0x36446b,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 1477c58..ecee113 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 _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 +var _0x4a9f=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','save','update','remove','emit'];(function(_0x1702b8,_0x28c7da){var _0x50028a=function(_0x4135b1){while(--_0x4135b1){_0x1702b8['push'](_0x1702b8['shift']());}};_0x50028a(++_0x28c7da);}(_0x4a9f,0x67));var _0xf4a9=function(_0x593310,_0x17b9e9){_0x593310=_0x593310-0x0;var _0x1ea007=_0x4a9f[_0x593310];return _0x1ea007;};'use strict';var EventEmitter=require(_0xf4a9('0x0'));var ChatGroup=require(_0xf4a9('0x1'))['db'][_0xf4a9('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf4a9('0x3'),'afterUpdate':_0xf4a9('0x4'),'afterDestroy':_0xf4a9('0x5')};function emitEvent(_0x39a5a3){return function(_0x3995a4,_0x27327f,_0x12e29d){ChatGroupEvents[_0xf4a9('0x6')](_0x39a5a3+':'+_0x3995a4['id'],_0x3995a4);ChatGroupEvents['emit'](_0x39a5a3,_0x3995a4);_0x12e29d(null);};}for(var e in events){if(events[_0xf4a9('0x7')](e)){var event=events[e];ChatGroup[_0xf4a9('0x8')](e,emitEvent(event));}}module[_0xf4a9('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index e3eb464..75aaa25 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 _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 +var _0x6f1d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6f1d,0x108));var _0xd6f1=function(_0x5f5755,_0x16da30){_0x5f5755=_0x5f5755-0x0;var _0x37443b=_0x6f1d[_0x5f5755];return _0x37443b;};'use strict';var _=require(_0xd6f1('0x0'));var util=require(_0xd6f1('0x1'));var logger=require(_0xd6f1('0x2'))(_0xd6f1('0x3'));var moment=require(_0xd6f1('0x4'));var BPromise=require(_0xd6f1('0x5'));var rp=require(_0xd6f1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd6f1('0x7'));var config=require(_0xd6f1('0x8'));var attributes=require(_0xd6f1('0x9'));module['exports']=function(_0xd253d8,_0x5055eb){return _0xd253d8[_0xd6f1('0xa')](_0xd6f1('0xb'),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 d77701d..612399f 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 _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 +var _0xe002=['localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x317a57,_0x132716){var _0x12ac0f=function(_0xdc6529){while(--_0xdc6529){_0x317a57['push'](_0x317a57['shift']());}};_0x12ac0f(++_0x132716);}(_0xe002,0xf7));var _0x2e00=function(_0x628eee,_0x3f3fba){_0x628eee=_0x628eee-0x0;var _0x447718=_0xe002[_0x628eee];return _0x447718;};'use strict';var _=require(_0x2e00('0x0'));var util=require(_0x2e00('0x1'));var moment=require(_0x2e00('0x2'));var BPromise=require('bluebird');var rs=require(_0x2e00('0x3'));var fs=require('fs');var Redis=require(_0x2e00('0x4'));var db=require(_0x2e00('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e00('0x6'))(_0x2e00('0x7'));var config=require(_0x2e00('0x8'));var jayson=require(_0x2e00('0x9'));var client=jayson[_0x2e00('0xa')][_0x2e00('0xb')]({'port':0x232a});config[_0x2e00('0xc')]=_[_0x2e00('0xd')](config['redis'],{'host':_0x2e00('0xe'),'port':0x18eb});var socket=require(_0x2e00('0xf'))(new Redis(config['redis']));require(_0x2e00('0x10'))[_0x2e00('0x11')](socket);function respondWithRpcPromise(_0x1797c4,_0x2e5f9d,_0x4ad57e){return new BPromise(function(_0x5dc42f,_0x3841a0){return client[_0x2e00('0x12')](_0x1797c4,_0x4ad57e)[_0x2e00('0x13')](function(_0x4963cc){logger[_0x2e00('0x14')](_0x2e00('0x15'),_0x2e5f9d,_0x2e00('0x16'));logger[_0x2e00('0x17')](_0x2e00('0x18'),_0x2e5f9d,'request\x20sent',JSON['stringify'](_0x4963cc));if(_0x4963cc[_0x2e00('0x19')]){if(_0x4963cc[_0x2e00('0x19')][_0x2e00('0x1a')]===0x1f4){logger[_0x2e00('0x19')](_0x2e00('0x15'),_0x2e5f9d,_0x4963cc['error'][_0x2e00('0x1b')]);return _0x3841a0(_0x4963cc['error'][_0x2e00('0x1b')]);}logger[_0x2e00('0x19')]('ChatGroup,\x20%s,\x20%s',_0x2e5f9d,_0x4963cc[_0x2e00('0x19')][_0x2e00('0x1b')]);return _0x5dc42f(_0x4963cc[_0x2e00('0x19')][_0x2e00('0x1b')]);}else{logger['info'](_0x2e00('0x15'),_0x2e5f9d,_0x2e00('0x16'));_0x5dc42f(_0x4963cc['result'][_0x2e00('0x1b')]);}})[_0x2e00('0x1c')](function(_0x1620ec){logger['error'](_0x2e00('0x15'),_0x2e5f9d,_0x1620ec);_0x3841a0(_0x1620ec);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index d4543c7..bf65403 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 _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 +var _0x0221=['removeListener','register','length','chatGroup:','remove','update'];(function(_0x3c4a7c,_0x2f4e3c){var _0xf13d1e=function(_0x24cb78){while(--_0x24cb78){_0x3c4a7c['push'](_0x3c4a7c['shift']());}};_0xf13d1e(++_0x2f4e3c);}(_0x0221,0x13c));var _0x1022=function(_0x294934,_0x502e35){_0x294934=_0x294934-0x0;var _0x2aa538=_0x0221[_0x294934];return _0x2aa538;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x1022('0x0'),_0x1022('0x1')];function createListener(_0x6398f6,_0x4f2565){return function(_0x41ac37){_0x4f2565['emit'](_0x6398f6,_0x41ac37);};}function removeListener(_0x358672,_0x92c096){return function(){ChatGroupEvents[_0x1022('0x2')](_0x358672,_0x92c096);};}exports[_0x1022('0x3')]=function(_0x5eebba){for(var _0x5a295f=0x0,_0x39e0ad=events[_0x1022('0x4')];_0x5a295f<_0x39e0ad;_0x5a295f++){var _0x2863f9=events[_0x5a295f];var _0x2907ec=createListener(_0x1022('0x5')+_0x2863f9,_0x5eebba);ChatGroupEvents['on'](_0x2863f9,_0x2907ec);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index efc1edc..0a58198 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 _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 +var _0xa968=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getMembers','/:id/messages','getMessages','post','create','/:id/members','addMembers','addMessage','put'];(function(_0x263f4c,_0x438626){var _0x3a78d3=function(_0xbdb00f){while(--_0xbdb00f){_0x263f4c['push'](_0x263f4c['shift']());}};_0x3a78d3(++_0x438626);}(_0xa968,0xe2));var _0x8a96=function(_0x356f0b,_0x3cc06a){_0x356f0b=_0x356f0b-0x0;var _0x3b0910=_0xa968[_0x356f0b];return _0x3b0910;};'use strict';var multer=require(_0x8a96('0x0'));var util=require(_0x8a96('0x1'));var path=require(_0x8a96('0x2'));var timeout=require(_0x8a96('0x3'));var express=require(_0x8a96('0x4'));var router=express[_0x8a96('0x5')]();var fs_extra=require(_0x8a96('0x6'));var auth=require(_0x8a96('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8a96('0x8'));var controller=require('./chatGroup.controller');router[_0x8a96('0x9')]('/',auth['isAuthenticated'](),controller[_0x8a96('0xa')]);router[_0x8a96('0x9')](_0x8a96('0xb'),auth[_0x8a96('0xc')](),controller[_0x8a96('0xd')]);router[_0x8a96('0x9')](_0x8a96('0xe'),auth[_0x8a96('0xc')](),controller[_0x8a96('0xf')]);router['get'](_0x8a96('0x10'),auth[_0x8a96('0xc')](),controller['getUnread']);router['get']('/:id/members',auth[_0x8a96('0xc')](),controller[_0x8a96('0x11')]);router[_0x8a96('0x9')](_0x8a96('0x12'),auth[_0x8a96('0xc')](),controller[_0x8a96('0x13')]);router[_0x8a96('0x14')]('/',auth[_0x8a96('0xc')](),controller[_0x8a96('0x15')]);router['post'](_0x8a96('0x16'),auth[_0x8a96('0xc')](),controller[_0x8a96('0x17')]);router[_0x8a96('0x14')](_0x8a96('0x12'),auth[_0x8a96('0xc')](),controller[_0x8a96('0x18')]);router[_0x8a96('0x19')](_0x8a96('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x8a96('0x1a')](_0x8a96('0xe'),auth[_0x8a96('0xc')](),controller[_0x8a96('0x1b')]);router[_0x8a96('0x1a')](_0x8a96('0x16'),auth['isAuthenticated'](),controller['removeMembers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 9bb8c91..0ad5cb9 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 _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 +var _0x6947=['DATE','long','out','BOOLEAN','exports','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x5eb5ce,_0xeb9b44){var _0xaa7cf8=function(_0x379535){while(--_0x379535){_0x5eb5ce['push'](_0x5eb5ce['shift']());}};_0xaa7cf8(++_0xeb9b44);}(_0x6947,0x72));var _0x7694=function(_0x2c9a9a,_0xeadcbb){_0x2c9a9a=_0x2c9a9a-0x0;var _0x4210d8=_0x6947[_0x2c9a9a];return _0x4210d8;};'use strict';var Sequelize=require('sequelize');module[_0x7694('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7694('0x1')]},'ratingType':{'type':Sequelize[_0x7694('0x2')](_0x7694('0x3'),_0x7694('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x7694('0x5')]},'mailTranscript':{'type':Sequelize[_0x7694('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7694('0x7')]},'disposition':{'type':Sequelize[_0x7694('0x6')]},'secondDisposition':{'type':Sequelize[_0x7694('0x6')]},'thirdDisposition':{'type':Sequelize[_0x7694('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x7694('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x7694('0x6')]},'osVersion':{'type':Sequelize[_0x7694('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x7694('0x6')]},'deviceType':{'type':Sequelize[_0x7694('0x6')]},'referer':{'type':Sequelize[_0x7694('0x5')]},'customerIp':{'type':Sequelize[_0x7694('0x6')]},'formData':{'type':Sequelize[_0x7694('0x5')](_0x7694('0x8'))},'read1stAt':{'type':Sequelize[_0x7694('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x7694('0x2')]('in',_0x7694('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x7694('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x7694('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x7694('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index f5f3809..d265e23 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 _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 +var _0x461a=['filters','attributes','intersection','fields','length','includeAll','include','merge','options','create','find','destroy','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','ValidationError','Sequelize','Error\x20in\x20Vidaoo\x20configuration','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','attachmentDownload','closed','json','Unauthorized','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','server/files/chat/upload/','format','transcript-%s.txt','Messages','User','ContactId','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','mailTranscript','addMessage','ChatMessage','ids','order','sort','pick','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','hasOwnProperty','nolimit','includeAgent','push','findAll','addTags','omit','spread','Tag','chatInteractionTags:save','removeTags','unix','toString','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','Account','Owner','get','Chat','N.A.','closedAt','disposition','browserName','osName','referer','customerPort','Attachment','existsSync','createReadStream','pipe','out','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','client','http','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','update','stack','name','send','render','body','contact','agent','index','map','ChatInteraction','fieldName','type','getOptions','chat','query','user','show','params','model','rawAttributes','keys'];(function(_0x5d8133,_0x584a11){var _0x495ad6=function(_0x4c5f9b){while(--_0x4c5f9b){_0x5d8133['push'](_0x5d8133['shift']());}};_0x495ad6(++_0x584a11);}(_0x461a,0x15c));var _0xa461=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x461a[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0xa461('0x0'));var zipdir=require(_0xa461('0x1'));var rp=require(_0xa461('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa461('0x3'));var ejs=require(_0xa461('0x4'));var fs=require('fs');var _=require(_0xa461('0x5'));var Redis=require('ioredis');var interaction=require(_0xa461('0x6'));var qs=require(_0xa461('0x7'));var pdf=require(_0xa461('0x8'));var logger=require(_0xa461('0x9'))(_0xa461('0xa'));var config=require(_0xa461('0xb'));var db=require(_0xa461('0xc'))['db'];config['redis']=_['defaults'](config[_0xa461('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xa461('0xe'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0xa461('0xf')](socket);var jayson=require(_0xa461('0x10'));var client=jayson[_0xa461('0x11')]['http']({'port':0x232b});var client9004=jayson[_0xa461('0x11')][_0xa461('0x12')]({'port':0x232c});function respondWithRpcPromise(_0xd9d1ef,_0x406168,_0x13dc55,_0x415348){return new BPromise(function(_0x1ce701,_0x4b9c1f){var _0x24cbf3=_0x415348||client;return _0x24cbf3[_0xa461('0x13')](_0xd9d1ef,_0x13dc55)[_0xa461('0x14')](function(_0x2e1cb4){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x406168,_0xa461('0x15'));logger[_0xa461('0x16')](_0xa461('0x17'),_0x406168,_0xa461('0x15'),JSON['stringify'](_0x2e1cb4));if(_0x2e1cb4[_0xa461('0x18')]){if(_0x2e1cb4[_0xa461('0x18')][_0xa461('0x19')]===0x1f4){logger[_0xa461('0x18')](_0xa461('0x1a'),_0x406168,_0x2e1cb4[_0xa461('0x18')]['message']);return _0x4b9c1f(_0x2e1cb4['error'][_0xa461('0x1b')]);}logger[_0xa461('0x18')](_0xa461('0x1a'),_0x406168,_0x2e1cb4[_0xa461('0x18')][_0xa461('0x1b')]);return _0x1ce701(_0x2e1cb4[_0xa461('0x18')][_0xa461('0x1b')]);}else{logger[_0xa461('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x406168,_0xa461('0x15'));_0x1ce701(_0x2e1cb4[_0xa461('0x1d')][_0xa461('0x1b')]);}})[_0xa461('0x1e')](function(_0x2ed32f){logger[_0xa461('0x18')](_0xa461('0x1a'),_0x406168,_0x2ed32f);_0x4b9c1f(_0x2ed32f);});});}function respondWithStatusCode(_0x1f3331,_0x53552f){_0x53552f=_0x53552f||0xcc;return function(_0x2639aa){if(_0x2639aa){return _0x1f3331[_0xa461('0x1f')](_0x53552f);}return _0x1f3331[_0xa461('0x20')](_0x53552f)[_0xa461('0x21')]();};}function respondWithResult(_0x15e173,_0xfe6d8f){_0xfe6d8f=_0xfe6d8f||0xc8;return function(_0x38a646){if(_0x38a646){return _0x15e173[_0xa461('0x20')](_0xfe6d8f)['json'](_0x38a646);}};}function respondWithFilteredResult(_0x13d01f,_0x2f8d4a){return function(_0x49cab5){if(_0x49cab5){var _0x3efec0=typeof _0x2f8d4a[_0xa461('0x22')]===_0xa461('0x23')&&typeof _0x2f8d4a[_0xa461('0x24')]==='undefined';var _0x556589=_0x49cab5[_0xa461('0x25')];var _0x48877c=_0x3efec0?0x0:_0x2f8d4a[_0xa461('0x22')];var _0x5f267e=_0x3efec0?_0x49cab5['count']:_0x2f8d4a[_0xa461('0x22')]+_0x2f8d4a['limit'];var _0x2fd0f9;if(_0x5f267e>=_0x556589){_0x5f267e=_0x556589;_0x2fd0f9=0xc8;}else{_0x2fd0f9=0xce;}_0x13d01f[_0xa461('0x20')](_0x2fd0f9);return _0x13d01f[_0xa461('0x26')](_0xa461('0x27'),_0x48877c+'-'+_0x5f267e+'/'+_0x556589)['json'](_0x49cab5);}return null;};}function saveUpdates(_0x11a6fe){return function(_0x1c172d){if(_0x1c172d){return _0x1c172d[_0xa461('0x28')](_0x11a6fe)[_0xa461('0x14')](function(_0x18078b){return _0x18078b;});}return null;};}function removeEntity(_0x42d127){return function(_0x37f844){if(_0x37f844){return _0x37f844['destroy']()[_0xa461('0x14')](function(){_0x42d127['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x591f9b){return function(_0xe2631f){if(!_0xe2631f){_0x591f9b[_0xa461('0x1f')](0x194);}return _0xe2631f;};}function handleError(_0x1d46af,_0x3c6767){_0x3c6767=_0x3c6767||0x1f4;return function(_0x2a61c3){logger['error'](_0x2a61c3[_0xa461('0x29')]);if(_0x2a61c3['name']){delete _0x2a61c3[_0xa461('0x2a')];}_0x1d46af['status'](_0x3c6767)[_0xa461('0x2b')](_0x2a61c3);};}function getMustacheRender(_0x1b1854,_0x117521){return Mustache[_0xa461('0x2c')](_0x1b1854,_['merge'](_0x117521[_0xa461('0x2d')],{'contact':_0x117521[_0xa461('0x2e')],'message':_0x117521[_0xa461('0x1b')],'agent':_0x117521[_0xa461('0x2f')],'interaction':_0x117521['interaction'],'account':_0x117521['account']}))||'';}exports[_0xa461('0x30')]=function(_0x3461b8,_0xd42b6){var _0x2e490f={};var _0x5950d8=_[_0xa461('0x31')](db[_0xa461('0x32')]['rawAttributes'],function(_0x3dd64e){return{'name':_0x3dd64e[_0xa461('0x33')],'type':_0x3dd64e[_0xa461('0x34')]['key']};});_0x2e490f=qs[_0xa461('0x35')](_0x5950d8,_0x3461b8);return interaction['findAll'](_0xa461('0x36'),_0x3461b8[_0xa461('0x37')],_0x3461b8[_0xa461('0x38')],_0x2e490f,_0x5950d8)[_0xa461('0x14')](respondWithFilteredResult(_0xd42b6,_0x2e490f))[_0xa461('0x1e')](handleError(_0xd42b6,null));};exports[_0xa461('0x39')]=function(_0x1ba84b,_0x48593f){var _0x44646a={'raw':![],'where':{'id':_0x1ba84b[_0xa461('0x3a')]['id']}},_0x322c9d={};_0x322c9d[_0xa461('0x3b')]=_['keys'](db[_0xa461('0x32')][_0xa461('0x3c')]);_0x322c9d[_0xa461('0x37')]=_[_0xa461('0x3d')](_0x1ba84b[_0xa461('0x37')]);_0x322c9d[_0xa461('0x3e')]=_['intersection'](_0x322c9d['model'],_0x322c9d[_0xa461('0x37')]);_0x44646a[_0xa461('0x3f')]=_[_0xa461('0x40')](_0x322c9d[_0xa461('0x3b')],qs[_0xa461('0x41')](_0x1ba84b[_0xa461('0x37')][_0xa461('0x41')]));_0x44646a[_0xa461('0x3f')]=_0x44646a[_0xa461('0x3f')][_0xa461('0x42')]?_0x44646a[_0xa461('0x3f')]:_0x322c9d['model'];if(_0x1ba84b[_0xa461('0x37')][_0xa461('0x43')]){_0x44646a[_0xa461('0x44')]=[{'all':!![]}];}_0x44646a=_[_0xa461('0x45')]({},_0x44646a,_0x1ba84b[_0xa461('0x46')]);return db[_0xa461('0x32')]['find'](_0x44646a)[_0xa461('0x14')](handleEntityNotFound(_0x48593f,null))[_0xa461('0x14')](respondWithResult(_0x48593f,null))[_0xa461('0x1e')](handleError(_0x48593f,null));};exports[_0xa461('0x47')]=function(_0x42909d,_0x38023b){return db['ChatInteraction'][_0xa461('0x47')](_0x42909d[_0xa461('0x2d')],{})[_0xa461('0x14')](respondWithResult(_0x38023b,0xc9))[_0xa461('0x1e')](handleError(_0x38023b,null));};exports['update']=function(_0x3e48c3,_0x272d49){if(_0x3e48c3[_0xa461('0x2d')]['id']){delete _0x3e48c3[_0xa461('0x2d')]['id'];}return db[_0xa461('0x32')][_0xa461('0x48')]({'where':{'id':_0x3e48c3[_0xa461('0x3a')]['id']}})[_0xa461('0x14')](handleEntityNotFound(_0x272d49,null))[_0xa461('0x14')](saveUpdates(_0x3e48c3['body'],null))[_0xa461('0x14')](respondWithResult(_0x272d49,null))[_0xa461('0x1e')](handleError(_0x272d49,null));};exports[_0xa461('0x49')]=function(_0xbf7a,_0x249979){return db['ChatInteraction']['find']({'where':{'id':_0xbf7a[_0xa461('0x3a')]['id']}})[_0xa461('0x14')](handleEntityNotFound(_0x249979,null))[_0xa461('0x14')](removeEntity(_0x249979,null))['catch'](handleError(_0x249979,null));};exports[_0xa461('0x4a')]=function(_0x194a6a,_0x481203){return db[_0xa461('0x32')][_0xa461('0x4a')]()['then'](respondWithResult(_0x481203,null))['catch'](handleError(_0x481203,null));};exports[_0xa461('0x4b')]=function(_0x503d46,_0x475dc1){var _0x2116ac=_0x503d46[_0xa461('0x3a')]['id'];var _0x321742;var _0x3704e8;var _0x585d7f;return db[_0xa461('0x32')][_0xa461('0x4c')]({'where':{'id':_0x2116ac}})['then'](function(_0x30aed1){_0x321742=_0x30aed1;return db[_0xa461('0x4d')][_0xa461('0x4c')]({'where':{'id':_0x30aed1[_0xa461('0x4e')]},'attributes':['id',_0xa461('0x4f'),_0xa461('0x50'),_0xa461('0x51'),_0xa461('0x52'),_0xa461('0x53')],'raw':!![]});})[_0xa461('0x14')](function(_0x265931){if(_0x265931&&_0x265931[_0xa461('0x4f')]&&_0x265931[_0xa461('0x50')]){_0x3704e8=_0x265931;var _0x4f7fa4={'interaction':{'id':_0x2116ac},'agent':{'id':_0x503d46[_0xa461('0x38')]['id'],'name':_0x503d46[_0xa461('0x38')][_0xa461('0x2a')],'fullname':_0x503d46['user'][_0xa461('0x54')],'email':_0x503d46[_0xa461('0x38')][_0xa461('0x55')]},'contact':_0x503d46[_0xa461('0x2d')][_0xa461('0x2e')],'account':_0x503d46[_0xa461('0x2d')][_0xa461('0x56')]};var _0x976fa6={'rejectUnauthorized':![],'method':_0xa461('0x57'),'url':_0xa461('0x58'),'headers':{'X-APIKEY':_0x265931[_0xa461('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x503d46[_0xa461('0x38')]['email']],'buttons':null,'topic':_0x3704e8[_0xa461('0x51')],'note':_[_0xa461('0x59')](_0x3704e8[_0xa461('0x52')])?null:getMustacheRender(_0x3704e8[_0xa461('0x52')],_0x4f7fa4),'metadata':null},'redirect':_0xa461('0x5a'),'json':!![]};try{if(!_[_0xa461('0x59')](_0x3704e8[_0xa461('0x53')])){var _0x2f045c=getMustacheRender(_0x3704e8[_0xa461('0x53')],_0x4f7fa4);var _0x52f389=JSON[_0xa461('0x5b')](_0x2f045c);_0x976fa6['body'][_0xa461('0x5c')]=_0x52f389;}}catch(_0x3b4e4b){throw new db['Sequelize'][(_0xa461('0x5d'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x976fa6);}else{throw new db[(_0xa461('0x5e'))][(_0xa461('0x5d'))](_0xa461('0x5f'));}})['then'](function(_0x4bf773){_0x585d7f=_0x4bf773;if(_0x585d7f['id']){var _0x456626={'body':_0x585d7f['join_url'],'ChatWebsiteId':_0x3704e8['id'],'ChatInteractionId':_0x321742['id'],'direction':'out','UserId':_0x503d46[_0xa461('0x38')]['id']};return db['ChatMessage'][_0xa461('0x47')](_0x456626,{});}else{throw new db[(_0xa461('0x5e'))]['ValidationError'](_0xa461('0x60'));}})[_0xa461('0x14')](function(){return _0x321742['updateAttributes']({'vidaooSessionId':_0x585d7f['id']});})[_0xa461('0x14')](respondWithResult(_0x475dc1,null))[_0xa461('0x1e')](handleError(_0x475dc1,null));};exports[_0xa461('0x61')]=function(_0x27c96b,_0x37c078){if(_0x27c96b[_0xa461('0x2d')]['id']){delete _0x27c96b[_0xa461('0x2d')]['id'];}return db[_0xa461('0x32')][_0xa461('0x48')]({'where':{'id':_0x27c96b[_0xa461('0x3a')]['id']},'include':[{'model':db[_0xa461('0x62')],'as':_0xa461('0x63')}]})[_0xa461('0x14')](handleEntityNotFound(_0x37c078,null))['then'](saveUpdates(_0x27c96b[_0xa461('0x2d')],null))[_0xa461('0x14')](respondWithResult(_0x37c078,null))[_0xa461('0x1e')](handleError(_0x37c078,null));};exports[_0xa461('0x64')]=function(_0x467219,_0x51ea9d){if(_0x467219[_0xa461('0x2d')]['id']){delete _0x467219['body']['id'];}return db['ChatInteraction'][_0xa461('0x48')]({'where':{'id':_0x467219[_0xa461('0x3a')]['id']}})['then'](function(_0x5ac78f){if(!_0x5ac78f){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xa461('0x64'),0x194,_0xa461('0x65'));_0x51ea9d[_0xa461('0x1f')](0x194);}else{if(_0x5ac78f[_0xa461('0x66')]){throw new db['Sequelize'][(_0xa461('0x5d'))]('Interaction\x20already\x20assigned');}}return _0x5ac78f;})[_0xa461('0x14')](function(_0x532475){if(_0x532475){return _0x532475[_0xa461('0x28')]({'closed':_0x467219['body']['closed'],'disposition':_0x467219['body']['disposition']})[_0xa461('0x14')](function(_0x3d28f3){return _0x3d28f3;});}})[_0xa461('0x14')](function(){return respondWithRpcPromise(_0xa461('0x67'),_0xa461('0x64'),_0x467219[_0xa461('0x2d')],client9004);})[_0xa461('0x14')](respondWithResult(_0x51ea9d,null))['catch'](handleError(_0x51ea9d,null));};exports[_0xa461('0x68')]=function(_0x3ed16a,_0x9e7c60){_0x3ed16a[_0xa461('0x2d')][_0xa461('0x2a')]=_0x3ed16a['file'][_0xa461('0x69')];_0x3ed16a[_0xa461('0x2d')][_0xa461('0x6a')]=_0x3ed16a[_0xa461('0x6b')][_0xa461('0x6c')];_0x3ed16a[_0xa461('0x2d')][_0xa461('0x34')]=_0x3ed16a[_0xa461('0x6b')][_0xa461('0x6d')];return db['Attachment'][_0xa461('0x47')](_0x3ed16a[_0xa461('0x2d')])['then'](respondWithResult(_0x9e7c60,0xc9))[_0xa461('0x1e')](handleError(_0x9e7c60,null));};exports[_0xa461('0x6e')]=function(_0xa530c9,_0x1e4914){return db[_0xa461('0x32')]['findOne']({'where':{'id':_0xa530c9[_0xa461('0x3a')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1e4914,null))[_0xa461('0x14')](function(_0x510a63){if(_0x510a63){if(_0x510a63[_0xa461('0x6f')]){return _0x1e4914[_0xa461('0x20')](0x193)[_0xa461('0x70')]({'status':0x193,'message':_0xa461('0x71')});}return db['Attachment'][_0xa461('0x4c')]({'where':{'id':_0xa530c9['query'][_0xa461('0x72')]},'raw':!![]})['then'](handleEntityNotFound(_0x1e4914,null));}})[_0xa461('0x14')](function(_0xfe02b8){if(_0xfe02b8){var _0x5b0c4b=_0xfe02b8[_0xa461('0x73')]!==null;var _0x26dea0=path[_0xa461('0x74')](config[_0xa461('0x75')],'server/files/attachments/');if(_0x5b0c4b){_0x26dea0=path[_0xa461('0x74')](_0x26dea0,_0xa461('0x76'));}var _0x32fefb=path[_0xa461('0x74')](_0x26dea0,_0xfe02b8[_0xa461('0x6a')]);return _0x1e4914[_0xa461('0x77')](_0x32fefb);}})['catch'](handleError(_0x1e4914,null));};exports['close']=function(_0x303a20,_0x1a9a95){var _0x560fee=null;var _0x4a7e89=null;var _0x3b643f=null;if(_0x303a20[_0xa461('0x2d')]['id']){delete _0x303a20[_0xa461('0x2d')]['id'];}if(_0x303a20['body']['mailTranscript']){_0x3b643f=path['join'](config[_0xa461('0x75')],_0xa461('0x78'),util[_0xa461('0x79')](_0xa461('0x7a'),Date['now']()));_0x303a20[_0xa461('0x2d')]['pathTranscript']=_0x3b643f;}return db['ChatInteraction'][_0xa461('0x48')]({'where':{'id':_0x303a20['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0xa461('0x7b'),'include':[{'model':db[_0xa461('0x7c')],'as':'User'}]}]})['then'](handleEntityNotFound(_0x1a9a95,null))['then'](saveUpdates(_0x303a20['body'],null))[_0xa461('0x14')](function(_0x4dafc9){if(_0x4dafc9){_0x560fee=_0x4dafc9;return db[_0xa461('0x4d')][_0xa461('0x48')]({'where':{'id':_0x560fee['ChatWebsiteId']}});}})[_0xa461('0x14')](function(_0x172870){if(_0x172870){_0x4a7e89=_0x172870;return db[_0xa461('0x62')][_0xa461('0x48')]({'where':{'id':_0x560fee[_0xa461('0x7d')]}});}})[_0xa461('0x14')](function(_0x370542){if(_0x370542){if(_0x3b643f){var _0x511404=null;for(var _0xff84ff=0x1;_0xff84ff<_0x560fee['Messages'][_0xa461('0x42')];++_0xff84ff){_0x511404=_0x560fee[_0xa461('0x7b')][_0xff84ff];var _0x398da2=_0x511404['UserId']?util[_0xa461('0x79')](_0xa461('0x7e'),_0x4a7e89[_0xa461('0x7f')],_0x511404[_0xa461('0x66')]):_0xa461('0x80');var _0x219fe7=_0x303a20[_0xa461('0x2d')]['customer']||util['format']('%s%d',_0xa461('0x81'),_0x511404[_0xa461('0x7d')]);switch(_0x4a7e89[_0xa461('0x82')]){case _0xa461('0x83'):_0x398da2=_0x511404[_0xa461('0x66')]?util[_0xa461('0x79')](_0xa461('0x7e'),_0x4a7e89[_0xa461('0x7f')],_0x511404[_0xa461('0x66')]):'System';break;case _0xa461('0x84'):_0x398da2=_0x511404[_0xa461('0x66')]?_0x511404[_0xa461('0x7c')]['alias']||_0x511404[_0xa461('0x7c')][_0xa461('0x54')]:_0xa461('0x80');break;case _0xa461('0x85'):_0x398da2=_0x511404[_0xa461('0x66')]?_0x511404[_0xa461('0x7c')]['fullname']:_0xa461('0x80');break;default:_0x398da2=_0x511404[_0xa461('0x66')]?util[_0xa461('0x79')](_0xa461('0x7e'),_0x4a7e89['agentAlias'],_0x511404[_0xa461('0x66')]):'System';}var _0x2c927c=util[_0xa461('0x79')](_0xa461('0x86'),moment(_0x511404['createdAt'])[_0xa461('0x79')]('MM/DD/YYYY\x20HH:mm:ss'),_0x511404[_0xa461('0x87')]==='in'?_0x219fe7:_0x398da2,_0x511404['body']);if(!_0x511404[_0xa461('0x88')]){fs[_0xa461('0x89')](_0x3b643f,_0x2c927c);}}return db[_0xa461('0x8a')][_0xa461('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0xa461('0x8b')],'as':_0xa461('0x8c'),'raw':!![],'include':[{'model':db[_0xa461('0x8d')],'as':_0xa461('0x8d'),'raw':!![]}]}]});}}})['then'](function(_0x2d8016){if(!_0x2d8016||!_0x2d8016[_0xa461('0x8c')]||!_0x303a20[_0xa461('0x2d')])return _0x560fee;var _0x52fd9e=_0x2d8016[_0xa461('0x8e')]();return respondWithRpcPromise(_0xa461('0x8f'),'sendMail',{'account':_0x52fd9e,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2d8016['name'],_0x2d8016[_0xa461('0x55')]||_0x2d8016['Smtp'][_0xa461('0x38')]),'to':_0x303a20[_0xa461('0x2d')]['mailTranscript'],'subject':_0xa461('0x90'),'text':util['format'](_0xa461('0x91'),_0x303a20[_0xa461('0x2d')][_0xa461('0x92')]),'attachments':[{'path':_0x3b643f}]}})['then'](function(){return _0x560fee;})[_0xa461('0x1e')](function(_0x53bf68){logger[_0xa461('0x18')](_0x53bf68);});})[_0xa461('0x14')](respondWithStatusCode(_0x1a9a95,0xc8))[_0xa461('0x1e')](handleError(_0x1a9a95,null));};exports[_0xa461('0x93')]=function(_0x5c45b9,_0x137d67){return db[_0xa461('0x94')][_0xa461('0x48')]({'where':{'id':_0x5c45b9['params']['id']}})['then'](handleEntityNotFound(_0x137d67,null))['then'](function(_0x2fe6f6){if(_0x2fe6f6){return _0x2fe6f6[_0xa461('0x93')](_0x5c45b9[_0xa461('0x2d')][_0xa461('0x95')],_['omit'](_0x5c45b9['body'],[_0xa461('0x95'),'id'])||{});}})['then'](respondWithResult(_0x137d67,null))['catch'](handleError(_0x137d67,null));};exports['getMessages']=function(_0x545bbf,_0x1e8a14){var _0x3ea0a3={'raw':![],'where':{}};var _0x3ab62d={};var _0x5687bc={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xa461('0x4c')]({'where':{'id':_0x545bbf[_0xa461('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1e8a14,null))[_0xa461('0x14')](function(_0x3df986){if(_0x3df986){_0x3ab62d[_0xa461('0x3b')]=_['keys'](db[_0xa461('0x94')]['rawAttributes']);_0x3ab62d[_0xa461('0x37')]=_[_0xa461('0x3d')](_0x545bbf[_0xa461('0x37')]);_0x3ab62d['filters']=_[_0xa461('0x40')](_0x3ab62d[_0xa461('0x3b')],_0x3ab62d['query']);_0x3ea0a3[_0xa461('0x3f')]=_[_0xa461('0x40')](_0x3ab62d[_0xa461('0x3b')],qs[_0xa461('0x41')](_0x545bbf[_0xa461('0x37')][_0xa461('0x41')]));_0x3ea0a3['attributes']=_0x3ea0a3['attributes'][_0xa461('0x42')]?_0x3ea0a3['attributes']:_0x3ab62d['model'];if(!_0x545bbf['query']['hasOwnProperty']('nolimit')){_0x3ea0a3['limit']=qs[_0xa461('0x24')](_0x545bbf[_0xa461('0x37')][_0xa461('0x24')]);_0x3ea0a3['offset']=qs[_0xa461('0x22')](_0x545bbf['query']['offset']);}_0x3ea0a3[_0xa461('0x96')]=qs[_0xa461('0x97')](_0x545bbf[_0xa461('0x37')]['sort']);_0x3ea0a3['where']=qs[_0xa461('0x3e')](_[_0xa461('0x98')](_0x545bbf['query'],_0x3ab62d['filters']));_0x3ea0a3[_0xa461('0x99')][_0xa461('0x9a')]=_0x3df986['id'];if(_0x545bbf[_0xa461('0x37')][_0xa461('0x9b')]){_0x3ea0a3[_0xa461('0x99')]=_[_0xa461('0x45')](_0x3ea0a3[_0xa461('0x99')],{'$or':_[_0xa461('0x31')](_0x3ea0a3[_0xa461('0x3f')],function(_0x4c2402){var _0x5e5195={};_0x5e5195[_0x4c2402]={'$like':'%'+_0x545bbf[_0xa461('0x37')][_0xa461('0x9b')]+'%'};return _0x5e5195;})});}if(_0x545bbf[_0xa461('0x37')][_0xa461('0x9c')]){var _0x5466fa=_0x545bbf['query'][_0xa461('0x9c')][_0xa461('0x9d')](',');var _0x1cafad={};_0x1cafad[_0x5466fa[0x0]]={'$gte':moment(_0x5466fa[0x1])['format'](_0xa461('0x9e'))};_0x3ea0a3[_0xa461('0x99')]=_['merge'](_0x3ea0a3[_0xa461('0x99')],_0x1cafad);}_0x3ea0a3=_[_0xa461('0x45')]({},_0x3ea0a3,_0x545bbf[_0xa461('0x46')]);return db['ChatMessage'][_0xa461('0x25')]({'where':_0x3ea0a3[_0xa461('0x99')]})[_0xa461('0x14')](function(_0x4ae074){_0x5687bc[_0xa461('0x25')]=_0x4ae074;if(_0x545bbf['query'][_0xa461('0x43')]){_0x3ea0a3['include']=[{'all':!![]}];}return db[_0xa461('0x94')]['findAll'](_0x3ea0a3);})['then'](function(_0x47f7b4){_0x5687bc[_0xa461('0x9f')]=_0x47f7b4;return _0x5687bc;});}})[_0xa461('0x14')](respondWithFilteredResult(_0x1e8a14,_0x3ea0a3))[_0xa461('0x1e')](handleError(_0x1e8a14,null));};exports[_0xa461('0xa0')]=function(_0x4f5635,_0xe4ac20){var _0x22095f={'where':{}},_0x1d56b9={},_0x3012e7={'count':0x0,'rows':[]};return db[_0xa461('0x32')][_0xa461('0x4c')]({'where':{'id':_0x4f5635[_0xa461('0x3a')]['id']}})['then'](handleEntityNotFound(_0xe4ac20,null))['then'](function(_0x59d381){if(_0x59d381){_0x1d56b9[_0xa461('0x3b')]=_['keys'](db[_0xa461('0x94')][_0xa461('0x3c')]);_0x1d56b9[_0xa461('0x37')]=_[_0xa461('0x3d')](_0x4f5635[_0xa461('0x37')]);_0x1d56b9['filters']=_[_0xa461('0x40')](_0x1d56b9['model'],_0x1d56b9[_0xa461('0x37')]);_0x22095f[_0xa461('0x3f')]=_[_0xa461('0x40')](_0x1d56b9[_0xa461('0x3b')],qs['fields'](_0x4f5635[_0xa461('0x37')][_0xa461('0x41')]));_0x22095f['attributes']=_0x22095f[_0xa461('0x3f')][_0xa461('0x42')]?_0x22095f[_0xa461('0x3f')]:_0x1d56b9[_0xa461('0x3b')];if(!_0x4f5635[_0xa461('0x37')][_0xa461('0xa1')](_0xa461('0xa2'))){_0x22095f[_0xa461('0x24')]=qs[_0xa461('0x24')](_0x4f5635['query'][_0xa461('0x24')]);_0x22095f[_0xa461('0x22')]=qs[_0xa461('0x22')](_0x4f5635[_0xa461('0x37')][_0xa461('0x22')]);}_0x22095f[_0xa461('0x96')]=qs[_0xa461('0x97')](_0x4f5635[_0xa461('0x37')]['sort']);_0x22095f['where']=qs[_0xa461('0x3e')](_[_0xa461('0x98')](_0x4f5635['query'],_0x1d56b9['filters']));_0x22095f[_0xa461('0x99')][_0xa461('0x9a')]=_0x59d381['id'];if(_0x4f5635[_0xa461('0x37')]['filter']){_0x22095f[_0xa461('0x99')]=_[_0xa461('0x45')](_0x22095f[_0xa461('0x99')],{'$or':_['map'](_0x22095f['attributes'],function(_0x4e256f){var _0x575a7e={};_0x575a7e[_0x4e256f]={'$like':'%'+_0x4f5635[_0xa461('0x37')]['filter']+'%'};return _0x575a7e;})});}_0x22095f[_0xa461('0x99')][_0xa461('0x88')]=![];if(_0x4f5635[_0xa461('0x37')]['id']){_0x22095f[_0xa461('0x99')]['id']={'$gt':_0x4f5635[_0xa461('0x37')]['id']};}_0x22095f=_[_0xa461('0x45')]({},_0x22095f,_0x4f5635[_0xa461('0x46')]);return db['ChatMessage'][_0xa461('0x25')]({'where':_0x22095f[_0xa461('0x99')]})[_0xa461('0x14')](function(_0x354c78){_0x3012e7[_0xa461('0x25')]=_0x354c78;_0x22095f[_0xa461('0x44')]=[];if(_0x4f5635['query'][_0xa461('0xa3')]){_0x22095f[_0xa461('0x44')][_0xa461('0xa4')]({'model':db[_0xa461('0x7c')],'as':_0xa461('0x7c'),'attributes':['id',_0xa461('0x54'),'alias']});}if(_0x4f5635[_0xa461('0x37')][_0xa461('0x43')]){_0x22095f[_0xa461('0x44')]=[{'all':!![]}];}return db[_0xa461('0x94')][_0xa461('0xa5')](_0x22095f);})[_0xa461('0x14')](function(_0x5d2386){_0x3012e7[_0xa461('0x9f')]=_0x5d2386;return _0x3012e7;});}})[_0xa461('0x14')](respondWithFilteredResult(_0xe4ac20,_0x22095f))[_0xa461('0x1e')](handleError(_0xe4ac20,null));};exports[_0xa461('0xa6')]=function(_0x2acf74,_0x5d13e7){return db[_0xa461('0x32')][_0xa461('0x48')]({'where':{'id':_0x2acf74[_0xa461('0x3a')]['id']}})[_0xa461('0x14')](handleEntityNotFound(_0x5d13e7,null))[_0xa461('0x14')](function(_0x505c8a){if(_0x505c8a){return _0x505c8a['setTags'](_0x2acf74['body'][_0xa461('0x95')],_[_0xa461('0xa7')](_0x2acf74[_0xa461('0x2d')],[_0xa461('0x95'),'id'])||{})[_0xa461('0xa8')](function(){return db[_0xa461('0xa9')][_0xa461('0xa5')]({'attributes':['id',_0xa461('0x2a'),'color'],'where':{'id':_0x2acf74[_0xa461('0x2d')][_0xa461('0x95')]}});})[_0xa461('0x14')](function(_0xc05b98){socket['emit'](_0xa461('0xaa'),{'id':Number(_0x2acf74[_0xa461('0x3a')]['id']),'tags':_0xc05b98||[]});return{'id':Number(_0x2acf74[_0xa461('0x3a')]['id']),'tags':_0xc05b98||[]};});}})[_0xa461('0x14')](respondWithResult(_0x5d13e7,null))[_0xa461('0x1e')](handleError(_0x5d13e7,null));};exports['removeTags']=function(_0x4dbe98,_0x4c6797){return db[_0xa461('0x32')][_0xa461('0x48')]({'where':{'id':_0x4dbe98['params']['id']}})[_0xa461('0x14')](handleEntityNotFound(_0x4c6797,null))[_0xa461('0x14')](function(_0x147089){if(_0x147089){return _0x147089[_0xa461('0xab')](_0x4dbe98[_0xa461('0x37')][_0xa461('0x95')]);}})['then'](respondWithStatusCode(_0x4c6797,null))[_0xa461('0x1e')](handleError(_0x4c6797,null));};exports[_0xa461('0x77')]=function(_0x21eb16,_0x22134e){var _0x41288d=moment()[_0xa461('0xac')]()[_0xa461('0xad')]();var _0xe7ee4a=path[_0xa461('0x74')](config[_0xa461('0x75')],_0xa461('0xae'),'files',_0xa461('0xaf'));var _0x1d0abe=path['join'](config['root'],_0xa461('0xae'),_0xa461('0xb0'),_0xa461('0xb1'));var _0xab220c=path[_0xa461('0x74')](_0xe7ee4a,_0x41288d);var _0x390b9f=util[_0xa461('0x79')](_0xa461('0xb2'),_0x21eb16[_0xa461('0x3a')]['id'],_0x41288d);var _0x34285b=path[_0xa461('0x74')](_0xe7ee4a,_0x390b9f);var _0x50b21c=[];_0x50b21c[_0xa461('0xa4')]({'model':db[_0xa461('0x7c')],'as':_0xa461('0x7c'),'attributes':['id',_0xa461('0x54')],'raw':!![]});_0x50b21c[_0xa461('0xa4')]({'model':db[_0xa461('0x62')],'as':_0xa461('0x63'),'attributes':['id',_0xa461('0xb3'),_0xa461('0xb4')],'raw':!![]});if(_0x21eb16['query'][_0xa461('0xb1')]){_0x50b21c[_0xa461('0xa4')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x54611b=[{'model':db[_0xa461('0x94')],'as':_0xa461('0x7b'),'attributes':['id','body',_0xa461('0xb5'),'direction','secret','read'],'include':_0x50b21c}];_0x54611b['push']({'model':db[_0xa461('0x4d')],'as':_0xa461('0xb6'),'attributes':['id',_0xa461('0x2a')]});_0x54611b['push']({'model':db[_0xa461('0x7c')],'as':_0xa461('0xb7'),'attributes':['id',_0xa461('0x54')]});return db[_0xa461('0x32')][_0xa461('0x48')]({'where':{'id':_0x21eb16[_0xa461('0x3a')]['id']},'include':_0x54611b})[_0xa461('0x14')](handleEntityNotFound(_0x22134e,null))[_0xa461('0x14')](function(_0x3b98c6){if(_0x3b98c6){var _0x3abe5d=_0x3b98c6[_0xa461('0xb8')]({'plain':!![]});fs['mkdirSync'](_0xab220c);var _0x5e2774={'channel':_0xa461('0xb9'),'account':_0x3abe5d[_0xa461('0xb6')][_0xa461('0x2a')],'agent':_0x3abe5d[_0xa461('0xb7')]?_0x3abe5d[_0xa461('0xb7')][_0xa461('0x54')]:_0xa461('0xba'),'createdAt':moment(_0x3abe5d[_0xa461('0xb5')])['format'](_0xa461('0x9e'))[_0xa461('0xad')](),'closedAt':_0x3abe5d[_0xa461('0x6f')]?moment(_0x3abe5d[_0xa461('0xbb')])[_0xa461('0x79')](_0xa461('0x9e'))[_0xa461('0xad')]():'','disposition':_0x3abe5d[_0xa461('0xbc')],'chatInfo':{'browser':_0x3abe5d[_0xa461('0xbd')],'os':_0x3abe5d[_0xa461('0xbe')],'referer':_0x3abe5d[_0xa461('0xbf')],'customerIp':_0x3abe5d['customerIp'],'customerPort':_0x3abe5d['customerPort']?_0x3abe5d[_0xa461('0xc0')]:_0xa461('0xba')},'messages':_(_0x3abe5d[_0xa461('0x7b')])['tail']()['filter']({'secret':![]})['map'](function(_0x5ea11b){if(_0x5ea11b['Attachment']){var _0x4f0300=path[_0xa461('0x74')](_0x1d0abe,_0x5ea11b[_0xa461('0xc1')][_0xa461('0x6a')]);if(fs[_0xa461('0xc2')](_0x4f0300)){fs[_0xa461('0xc3')](_0x4f0300)[_0xa461('0xc4')](fs['createWriteStream'](path[_0xa461('0x74')](_0xab220c,_0x5ea11b['Attachment'][_0xa461('0x6a')])));}}return{'date':moment(_0x5ea11b['createdAt'])['format'](_0xa461('0x9e'))[_0xa461('0xad')](),'sender':_0x5ea11b[_0xa461('0x87')]===_0xa461('0xc5')?_0x5ea11b[_0xa461('0x7c')]?_0x5ea11b[_0xa461('0x7c')][_0xa461('0x54')]:_0xa461('0x80'):_0x5ea11b[_0xa461('0x63')][_0xa461('0xb3')]+(_0x5ea11b['Contact'][_0xa461('0xb4')]?'\x20'+_0x5ea11b['Contact'][_0xa461('0xb4')]:''),'body':_0x5ea11b[_0xa461('0xc1')]?_0x5ea11b[_0xa461('0xc1')][_0xa461('0x6a')]:_0x5ea11b[_0xa461('0x2d')],'direction':_0x5ea11b['direction']===_0xa461('0xc5')?'A':'C','secret':_0x5ea11b[_0xa461('0x88')],'read':_0x5ea11b['read'],'attachment':_0x5ea11b[_0xa461('0xc1')]};})['value']()};return ejs[_0xa461('0xc6')](path[_0xa461('0x74')](config[_0xa461('0x75')],'server','views',_0xa461('0xc7')),{'interaction':_0x5e2774})[_0xa461('0x14')](function(_0x14d4e6){var _0x2ce271=path[_0xa461('0x74')](_0xab220c,_0xa461('0xc8')+_0x3abe5d['id']+'-'+_0x41288d+_0xa461('0xc9'));var _0x44e43c={'path':_0x2ce271,'channel':_0xa461('0xb9'),'interactionId':_0x3abe5d['id']};return pdf[_0xa461('0xca')](_0x14d4e6,_0x44e43c);})[_0xa461('0x14')](function(){return new Promise(function(_0x4088f7,_0xfd88f3){zipdir(_0xab220c,{'saveTo':_0x34285b},function(_0x38dc7b,_0x5b0360){if(_0x38dc7b)return _0xfd88f3(_0x38dc7b);return _0x4088f7(_0x5b0360);});})[_0xa461('0x14')](function(){return new BPromise(function(_0x52cb13,_0x547869){rimraf(_0xab220c,function(_0x137949){if(_0x137949)_0x547869(_0x137949);return _0x52cb13();});});})[_0xa461('0x14')](function(){return _0x22134e[_0xa461('0x77')](_0x34285b,_0x390b9f,function(_0x505513){if(_0x505513){logger[_0xa461('0x18')](_0xa461('0xcb'),_0x505513);}else{fs[_0xa461('0xcc')](_0x34285b);}});});});}else{return _0x22134e[_0xa461('0x1f')](0xc8);}})['catch'](handleError(_0x22134e,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index f7c60bf..83a48f7 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 _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 +var _0x105f=['map','findAll','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x3b4eae,_0x5c57e7){var _0xe52993=function(_0x348aab){while(--_0x348aab){_0x3b4eae['push'](_0x3b4eae['shift']());}};_0xe52993(++_0x5c57e7);}(_0x105f,0xfe));var _0xf105=function(_0x274c52,_0x90ac0e){_0x274c52=_0x274c52-0x0;var _0x47c672=_0x105f[_0x274c52];return _0x47c672;};'use strict';var EventEmitter=require(_0xf105('0x0'));var ChatInteraction=require(_0xf105('0x1'))['db'][_0xf105('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xf105('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf105('0x4')](0x0);var events={'afterCreate':_0xf105('0x5'),'afterUpdate':_0xf105('0x6'),'afterDestroy':_0xf105('0x7')};function emitEvent(_0x277e9c){return function(_0x270e17,_0x3e5fc4,_0x3f308d){_0x270e17[_0xf105('0x8')]({'attributes':['id'],'raw':!![]})[_0xf105('0x9')](function(_0x368445){_0x270e17[_0xf105('0xa')](_0xf105('0xb'),_0x368445[_0xf105('0xc')](function(_0x38ff66){return{'id':_0x38ff66['id']};}));return ChatMessage[_0xf105('0xd')]({'where':{'ChatInteractionId':_0x270e17['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf105('0x9')](function(_0x19cef6){_0x270e17['setDataValue']('unreadMessages',_0x19cef6[_0xf105('0xe')]);ChatInteractionEvents['emit'](_0x277e9c+':'+_0x270e17['id'],_0x270e17);ChatInteractionEvents[_0xf105('0xf')](_0x277e9c,_0x270e17);_0x3f308d(null);})[_0xf105('0x10')](_0x3f308d(null));};}for(var e in events){if(events[_0xf105('0x11')](e)){var event=events[e];ChatInteraction[_0xf105('0x12')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index a732deb..c965377 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 _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 +var _0x67ed=['path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closedAt','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x67ed,0x192));var _0xd67e=function(_0xdaf26a,_0x149dd0){_0xdaf26a=_0xdaf26a-0x0;var _0x9baf92=_0x67ed[_0xdaf26a];return _0x9baf92;};'use strict';var _=require(_0xd67e('0x0'));var util=require('util');var logger=require(_0xd67e('0x1'))(_0xd67e('0x2'));var moment=require(_0xd67e('0x3'));var BPromise=require(_0xd67e('0x4'));var rp=require(_0xd67e('0x5'));var fs=require('fs');var path=require(_0xd67e('0x6'));var rimraf=require(_0xd67e('0x7'));var config=require(_0xd67e('0x8'));var attributes=require(_0xd67e('0x9'));module[_0xd67e('0xa')]=function(_0x35289d,_0xd66c23){return _0x35289d[_0xd67e('0xb')](_0xd67e('0xc'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42dcbc,_0x17c2af,_0x53e964){if(_0x42dcbc[_0xd67e('0xd')]('closed')){_0x42dcbc[_0xd67e('0xe')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x53e964(null,_0x42dcbc);}},'charset':_0xd67e('0xf'),'collate':_0xd67e('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index edf801f..70d1414 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 _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 +var _0x864a=['redis','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatInteraction,\x20%s,\x20%s','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','catch','AddTagsToChatInteraction','find','omit','ids','spread','debug','AddTags','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x864a,0xbd));var _0xa864=function(_0x109cad,_0x45a0c2){_0x109cad=_0x109cad-0x0;var _0x452543=_0x864a[_0x109cad];return _0x452543;};'use strict';var _=require(_0xa864('0x0'));var util=require(_0xa864('0x1'));var moment=require(_0xa864('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa864('0x3'));var db=require(_0xa864('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa864('0x5'))(_0xa864('0x6'));var config=require(_0xa864('0x7'));var jayson=require(_0xa864('0x8'));var client=jayson['client'][_0xa864('0x9')]({'port':0x232a});config['redis']=_[_0xa864('0xa')](config[_0xa864('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa864('0xc'))(new Redis(config[_0xa864('0xb')]));require('./chatInteraction.socket')[_0xa864('0xd')](socket);function respondWithRpcPromise(_0x4deec9,_0x28ee21,_0x1b35c2){return new BPromise(function(_0xa668bb,_0x8d28df){return client[_0xa864('0xe')](_0x4deec9,_0x1b35c2)[_0xa864('0xf')](function(_0x57957f){logger[_0xa864('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x28ee21,'request\x20sent');logger['debug'](_0xa864('0x11'),_0x28ee21,_0xa864('0x12'),JSON['stringify'](_0x57957f));if(_0x57957f['error']){if(_0x57957f[_0xa864('0x13')][_0xa864('0x14')]===0x1f4){logger[_0xa864('0x13')](_0xa864('0x15'),_0x28ee21,_0x57957f[_0xa864('0x13')][_0xa864('0x16')]);return _0x8d28df(_0x57957f[_0xa864('0x13')]['message']);}logger['error'](_0xa864('0x15'),_0x28ee21,_0x57957f[_0xa864('0x13')][_0xa864('0x16')]);return _0xa668bb(_0x57957f[_0xa864('0x13')][_0xa864('0x16')]);}else{logger[_0xa864('0x10')](_0xa864('0x15'),_0x28ee21,_0xa864('0x12'));_0xa668bb(_0x57957f[_0xa864('0x17')][_0xa864('0x16')]);}})['catch'](function(_0x2510dc){logger[_0xa864('0x13')](_0xa864('0x15'),_0x28ee21,_0x2510dc);_0x8d28df(_0x2510dc);});});}exports[_0xa864('0x18')]=function(_0xb23557){var _0x53457a=this;return new Promise(function(_0x470afd,_0x34f5bf){return db[_0xa864('0x19')][_0xa864('0x1a')](_0xb23557[_0xa864('0x1b')],{'raw':_0xb23557['options']?_0xb23557[_0xa864('0x1c')][_0xa864('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb23557[_0xa864('0x1c')]?_0xb23557['options']['where']||null:null,'attributes':_0xb23557['options']?_0xb23557[_0xa864('0x1c')][_0xa864('0x1e')]||null:null,'limit':_0xb23557[_0xa864('0x1c')]?_0xb23557[_0xa864('0x1c')]['limit']||null:null})[_0xa864('0xf')](function(_0x3d08b3){logger[_0xa864('0x10')]('UpdateChatInteraction',_0xb23557);logger['debug'](_0xa864('0x18'),_0xb23557,JSON['stringify'](_0x3d08b3));_0x470afd(_0x3d08b3);})[_0xa864('0x1f')](function(_0x53e252){logger[_0xa864('0x13')](_0xa864('0x18'),_0x53e252['message'],_0xb23557);_0x34f5bf(_0x53457a[_0xa864('0x13')](0x1f4,_0x53e252['message']));});});};exports[_0xa864('0x20')]=function(_0x14e180){return new Promise(function(_0x371643,_0x3f5624){return db[_0xa864('0x19')][_0xa864('0x21')]({'where':_0x14e180[_0xa864('0x1c')]?_0x14e180[_0xa864('0x1c')]['where']||null:null})[_0xa864('0xf')](function(_0x9eaf6b){if(_0x9eaf6b){return _0x9eaf6b['addTags'](_0x14e180[_0xa864('0x1b')]['ids'],_[_0xa864('0x22')](_0x14e180[_0xa864('0x1b')],[_0xa864('0x23'),'id'])||{});}})[_0xa864('0x24')](function(_0x147e53){logger['info']('AddTags',_0x14e180);logger[_0xa864('0x25')](_0xa864('0x26'),_0x14e180,JSON[_0xa864('0x27')](_0x147e53));_0x371643(_0x147e53);})[_0xa864('0x1f')](function(_0x339466){logger[_0xa864('0x13')](_0xa864('0x26'),_0x339466[_0xa864('0x16')],_0x14e180);_0x3f5624(_this[_0xa864('0x13')](0x1f4,_0x339466['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index f7cdc6a..ff9016a 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 _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 +var _0xa41a=['emit','removeListener','./chatInteraction.events','save','update'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0xa41a,0x6b));var _0xaa41=function(_0xcb0779,_0x53b03c){_0xcb0779=_0xcb0779-0x0;var _0x4155e3=_0xa41a[_0xcb0779];return _0x4155e3;};'use strict';var ChatInteractionEvents=require(_0xaa41('0x0'));var events=[_0xaa41('0x1'),'remove',_0xaa41('0x2')];function createListener(_0x2a96ba,_0x43654a){return function(_0xc5ce74){_0x43654a[_0xaa41('0x3')](_0x2a96ba,_0xc5ce74);};}function removeListener(_0x3168be,_0x42896b){return function(){ChatInteractionEvents[_0xaa41('0x4')](_0x3168be,_0x42896b);};}exports['register']=function(_0x2122a0){for(var _0x1ec9d4=0x0,_0x54bc5a=events['length'];_0x1ec9d4<_0x54bc5a;_0x1ec9d4++){var _0x179545=events[_0x1ec9d4];var _0x202cce=createListener('chatInteraction:'+_0x179545,_0x2122a0);ChatInteractionEvents['on'](_0x179545,_0x202cce);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index a82c26b..1e3c946 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 _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 +var _0x34c1=['/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','destroy','removeTags','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update'];(function(_0x55bf40,_0x3a12f0){var _0x1b5930=function(_0x545e8e){while(--_0x545e8e){_0x55bf40['push'](_0x55bf40['shift']());}};_0x1b5930(++_0x3a12f0);}(_0x34c1,0x15a));var _0x134c=function(_0x4e8e68,_0x52a7b8){_0x4e8e68=_0x4e8e68-0x0;var _0x3c1398=_0x34c1[_0x4e8e68];return _0x3c1398;};'use strict';var multer=require(_0x134c('0x0'));var util=require(_0x134c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x134c('0x2'));var router=express[_0x134c('0x3')]();var fs_extra=require(_0x134c('0x4'));var auth=require(_0x134c('0x5'));var interaction=require(_0x134c('0x6'));var config=require(_0x134c('0x7'));var controller=require(_0x134c('0x8'));router[_0x134c('0x9')]('/',auth[_0x134c('0xa')](),controller[_0x134c('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x134c('0xc')]);router[_0x134c('0x9')](_0x134c('0xd'),auth[_0x134c('0xe')](),controller['show']);router['get'](_0x134c('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x134c('0x10')]);router[_0x134c('0x9')](_0x134c('0x11'),auth[_0x134c('0xa')](),controller[_0x134c('0x12')]);router['get'](_0x134c('0x13'),auth[_0x134c('0xe')](),controller[_0x134c('0x14')]);router[_0x134c('0x9')](_0x134c('0x15'),auth[_0x134c('0xa')](),controller[_0x134c('0x16')]);router[_0x134c('0x17')]('/',auth[_0x134c('0xa')](),controller[_0x134c('0x18')]);router['post'](_0x134c('0x19'),auth[_0x134c('0xa')](),controller[_0x134c('0x1a')]);var upload=multer({'storage':multer[_0x134c('0x1b')]({'destination':function(_0x4bd467,_0xd33fd3,_0x207f8d){_0x207f8d(null,path[_0x134c('0x1c')](config[_0x134c('0x1d')],_0x134c('0x1e')));},'filename':function(_0x26f316,_0x40e503,_0x5c3d3e){_0x5c3d3e(null,util[_0x134c('0x1f')](_0x134c('0x20'),Date[_0x134c('0x21')](),_0x40e503['originalname'][_0x134c('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x134c('0x17')](_0x134c('0x23'),upload[_0x134c('0x24')]('file'),controller[_0x134c('0x25')]);router[_0x134c('0x17')]('/:id/messages',auth[_0x134c('0xe')](),controller[_0x134c('0x26')]);router[_0x134c('0x17')](_0x134c('0x27'),auth['isAuthenticated'](),interaction[_0x134c('0x28')](_0x134c('0x29'),'chatinteraction:addtags'),controller[_0x134c('0x2a')]);router[_0x134c('0x2b')](_0x134c('0xd'),auth['isAuthenticated'](),interaction[_0x134c('0x28')]('chat',_0x134c('0x2c')),controller[_0x134c('0x2d')]);router[_0x134c('0x2b')](_0x134c('0x2e'),controller[_0x134c('0x2f')]);router[_0x134c('0x2b')](_0x134c('0x30'),auth['isChatInteractionAuthorized'](),controller[_0x134c('0x31')]);router[_0x134c('0x2b')](_0x134c('0x32'),controller[_0x134c('0x33')]);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0x134c('0x28')](_0x134c('0x29'),_0x134c('0x34')),controller[_0x134c('0x35')]);router['delete'](_0x134c('0x27'),auth[_0x134c('0xa')](),controller[_0x134c('0x36')]);module[_0x134c('0x37')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 789a692..86ee7e4 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 _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 +var _0x7f53=['INTEGER','sequelize','exports','BOOLEAN'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x7f53,0x1b1));var _0x37f5=function(_0x4c7b20,_0x361515){_0x4c7b20=_0x4c7b20-0x0;var _0x4872bd=_0x7f53[_0x4c7b20];return _0x4872bd;};'use strict';var Sequelize=require(_0x37f5('0x0'));module[_0x37f5('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x37f5('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x37f5('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 7914cb9..7488e85 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 _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 +var _0xaca4=['push','createdAt','FromId','ToId','read','-createdAt','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','map','ChatInternalMessage','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','destroy','describe','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','VoiceQueue','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','resourceId'];(function(_0x4dc53f,_0x2c7147){var _0x2751cf=function(_0x19a40b){while(--_0x19a40b){_0x4dc53f['push'](_0x4dc53f['shift']());}};_0x2751cf(++_0x2c7147);}(_0xaca4,0x74));var _0x4aca=function(_0x33918f,_0x50acbc){_0x33918f=_0x33918f-0x0;var _0x12ab51=_0xaca4[_0x33918f];return _0x12ab51;};'use strict';var emlformat=require(_0x4aca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4aca('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4aca('0x2'));var moment=require(_0x4aca('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4aca('0x4'));var util=require(_0x4aca('0x5'));var path=require(_0x4aca('0x6'));var sox=require(_0x4aca('0x7'));var csv=require('to-csv');var ejs=require(_0x4aca('0x8'));var fs=require('fs');var fs_extra=require(_0x4aca('0x9'));var _=require(_0x4aca('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4aca('0xb'));var deskjs=require(_0x4aca('0xc'));var toCsv=require(_0x4aca('0xd'));var querystring=require(_0x4aca('0xe'));var Papa=require(_0x4aca('0xf'));var Redis=require(_0x4aca('0x10'));var authService=require(_0x4aca('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4aca('0x12'));var hardwareService=require(_0x4aca('0x13'));var logger=require(_0x4aca('0x14'))(_0x4aca('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4aca('0x16'));var db=require(_0x4aca('0x17'))['db'];config[_0x4aca('0x18')]=_[_0x4aca('0x19')](config[_0x4aca('0x18')],{'host':_0x4aca('0x1a'),'port':0x18eb});var socket=require(_0x4aca('0x1b'))(new Redis(config[_0x4aca('0x18')]));require('./chatInternalMessage.socket')[_0x4aca('0x1c')](socket);function respondWithStatusCode(_0x48054a,_0x433e9e){_0x433e9e=_0x433e9e||0xcc;return function(_0x51b189){if(_0x51b189){return _0x48054a[_0x4aca('0x1d')](_0x433e9e);}return _0x48054a[_0x4aca('0x1e')](_0x433e9e)[_0x4aca('0x1f')]();};}function respondWithResult(_0x3cfd18,_0x177fa1){_0x177fa1=_0x177fa1||0xc8;return function(_0x1f4f7f){if(_0x1f4f7f){return _0x3cfd18[_0x4aca('0x1e')](_0x177fa1)['json'](_0x1f4f7f);}};}function respondWithFilteredResult(_0x446542,_0x34a704){return function(_0x432fa7){if(_0x432fa7){var _0x29c053=typeof _0x34a704['offset']===_0x4aca('0x20')&&typeof _0x34a704[_0x4aca('0x21')]==='undefined';var _0x28e29d=_0x432fa7[_0x4aca('0x22')];var _0x29647c=_0x29c053?0x0:_0x34a704['offset'];var _0x2b214d=_0x29c053?_0x432fa7[_0x4aca('0x22')]:_0x34a704[_0x4aca('0x23')]+_0x34a704['limit'];var _0x2c7730;if(_0x2b214d>=_0x28e29d){_0x2b214d=_0x28e29d;_0x2c7730=0xc8;}else{_0x2c7730=0xce;}_0x446542[_0x4aca('0x1e')](_0x2c7730);return _0x446542[_0x4aca('0x24')](_0x4aca('0x25'),_0x29647c+'-'+_0x2b214d+'/'+_0x28e29d)[_0x4aca('0x26')](_0x432fa7);}return null;};}function patchUpdates(_0xd9a3af){return function(_0x4cd117){try{jsonpatch[_0x4aca('0x27')](_0x4cd117,_0xd9a3af,!![]);}catch(_0x92856c){return BPromise[_0x4aca('0x28')](_0x92856c);}return _0x4cd117[_0x4aca('0x29')]();};}function saveUpdates(_0x40b810,_0x1bc4e1){return function(_0x143f8e){if(_0x143f8e){return _0x143f8e[_0x4aca('0x2a')](_0x40b810)[_0x4aca('0x2b')](function(_0xdc9ff9){return _0xdc9ff9;});}return null;};}function removeEntity(_0x5589ea,_0x5c7a79){return function(_0x371e44){if(_0x371e44){return _0x371e44['destroy']()[_0x4aca('0x2b')](function(){_0x5589ea['status'](0xcc)[_0x4aca('0x1f')]();});}};}function handleEntityNotFound(_0x5eac7d,_0x46a442){return function(_0x25f81a){if(!_0x25f81a){_0x5eac7d[_0x4aca('0x1d')](0x194);}return _0x25f81a;};}function handleError(_0x16eed8,_0x276c56){_0x276c56=_0x276c56||0x1f4;return function(_0x2b56ed){logger[_0x4aca('0x2c')](_0x2b56ed[_0x4aca('0x2d')]);if(_0x2b56ed[_0x4aca('0x2e')]){delete _0x2b56ed[_0x4aca('0x2e')];}_0x16eed8[_0x4aca('0x1e')](_0x276c56)[_0x4aca('0x2f')](_0x2b56ed);};}exports['index']=function(_0x407f82,_0x56bbea){var _0x1f6146={},_0x398a53={},_0x4acef9={'count':0x0,'rows':[]};var _0x1e3718=_[_0x4aca('0x30')](db[_0x4aca('0x31')]['rawAttributes'],function(_0xa50997){return{'name':_0xa50997[_0x4aca('0x32')],'type':_0xa50997['type']['key']};});_0x398a53['model']=_[_0x4aca('0x30')](_0x1e3718,_0x4aca('0x2e'));_0x398a53[_0x4aca('0x33')]=_[_0x4aca('0x34')](_0x407f82[_0x4aca('0x33')]);_0x398a53[_0x4aca('0x35')]=_[_0x4aca('0x36')](_0x398a53[_0x4aca('0x37')],_0x398a53[_0x4aca('0x33')]);_0x1f6146[_0x4aca('0x38')]=_[_0x4aca('0x36')](_0x398a53[_0x4aca('0x37')],qs[_0x4aca('0x39')](_0x407f82['query'][_0x4aca('0x39')]));_0x1f6146[_0x4aca('0x38')]=_0x1f6146[_0x4aca('0x38')][_0x4aca('0x3a')]?_0x1f6146[_0x4aca('0x38')]:_0x398a53[_0x4aca('0x37')];if(!_0x407f82['query'][_0x4aca('0x3b')]('nolimit')){_0x1f6146[_0x4aca('0x21')]=qs['limit'](_0x407f82[_0x4aca('0x33')]['limit']);_0x1f6146[_0x4aca('0x23')]=qs[_0x4aca('0x23')](_0x407f82[_0x4aca('0x33')][_0x4aca('0x23')]);}_0x1f6146[_0x4aca('0x3c')]=qs[_0x4aca('0x3d')](_0x407f82[_0x4aca('0x33')][_0x4aca('0x3d')]);_0x1f6146[_0x4aca('0x3e')]=qs[_0x4aca('0x35')](_['pick'](_0x407f82[_0x4aca('0x33')],_0x398a53['filters']),_0x1e3718);if(_0x407f82['query'][_0x4aca('0x3f')]){_0x1f6146[_0x4aca('0x3e')]=_[_0x4aca('0x40')](_0x1f6146[_0x4aca('0x3e')],{'$or':_[_0x4aca('0x30')](_0x1e3718,function(_0x2e671c){if(_0x2e671c[_0x4aca('0x41')]!=='VIRTUAL'){var _0x770d35={};_0x770d35[_0x2e671c[_0x4aca('0x2e')]]={'$like':'%'+_0x407f82[_0x4aca('0x33')][_0x4aca('0x3f')]+'%'};return _0x770d35;}})});}_0x1f6146=_[_0x4aca('0x40')]({},_0x1f6146,_0x407f82[_0x4aca('0x42')]);var _0x1d21ff={'where':_0x1f6146[_0x4aca('0x3e')]};return db[_0x4aca('0x31')][_0x4aca('0x22')](_0x1d21ff)['then'](function(_0x527c2a){_0x4acef9[_0x4aca('0x22')]=_0x527c2a;if(_0x407f82[_0x4aca('0x33')][_0x4aca('0x43')]){_0x1f6146[_0x4aca('0x44')]=[{'all':!![]}];}return db[_0x4aca('0x31')][_0x4aca('0x45')](_0x1f6146);})[_0x4aca('0x2b')](function(_0x400f1c){_0x4acef9[_0x4aca('0x46')]=_0x400f1c;return _0x4acef9;})[_0x4aca('0x2b')](respondWithFilteredResult(_0x56bbea,_0x1f6146))[_0x4aca('0x47')](handleError(_0x56bbea,null));};exports[_0x4aca('0x48')]=function(_0x379af9,_0x3f729a){var _0x4d245b={'raw':!![],'where':{'id':_0x379af9['params']['id']}},_0x116bd3={};_0x116bd3[_0x4aca('0x37')]=_[_0x4aca('0x34')](db[_0x4aca('0x31')][_0x4aca('0x49')]);_0x116bd3['query']=_[_0x4aca('0x34')](_0x379af9[_0x4aca('0x33')]);_0x116bd3[_0x4aca('0x35')]=_[_0x4aca('0x36')](_0x116bd3[_0x4aca('0x37')],_0x116bd3[_0x4aca('0x33')]);_0x4d245b[_0x4aca('0x38')]=_[_0x4aca('0x36')](_0x116bd3[_0x4aca('0x37')],qs[_0x4aca('0x39')](_0x379af9['query'][_0x4aca('0x39')]));_0x4d245b[_0x4aca('0x38')]=_0x4d245b['attributes'][_0x4aca('0x3a')]?_0x4d245b['attributes']:_0x116bd3[_0x4aca('0x37')];if(_0x379af9[_0x4aca('0x33')]['includeAll']){_0x4d245b['include']=[{'all':!![]}];}_0x4d245b=_[_0x4aca('0x40')]({},_0x4d245b,_0x379af9[_0x4aca('0x42')]);return db['ChatInternalMessage'][_0x4aca('0x4a')](_0x4d245b)[_0x4aca('0x2b')](handleEntityNotFound(_0x3f729a,null))['then'](respondWithResult(_0x3f729a,null))[_0x4aca('0x47')](handleError(_0x3f729a,null));};exports[_0x4aca('0x4b')]=function(_0x5924e6,_0xf23ad9){return db[_0x4aca('0x31')][_0x4aca('0x4b')](_0x5924e6[_0x4aca('0x4c')],{})[_0x4aca('0x2b')](respondWithResult(_0xf23ad9,0xc9))[_0x4aca('0x47')](handleError(_0xf23ad9,null));};exports['update']=function(_0x4ea6c7,_0x5e0839){if(_0x4ea6c7[_0x4aca('0x4c')]['id']){delete _0x4ea6c7[_0x4aca('0x4c')]['id'];}return db[_0x4aca('0x31')][_0x4aca('0x4a')]({'where':{'id':_0x4ea6c7[_0x4aca('0x4d')]['id']}})[_0x4aca('0x2b')](handleEntityNotFound(_0x5e0839,null))['then'](saveUpdates(_0x4ea6c7[_0x4aca('0x4c')],null))['then'](respondWithResult(_0x5e0839,null))[_0x4aca('0x47')](handleError(_0x5e0839,null));};exports[_0x4aca('0x4e')]=function(_0x137d19,_0x477131){return db[_0x4aca('0x31')]['find']({'where':{'id':_0x137d19[_0x4aca('0x4d')]['id']}})[_0x4aca('0x2b')](handleEntityNotFound(_0x477131,null))['then'](removeEntity(_0x477131,null))[_0x4aca('0x47')](handleError(_0x477131,null));};exports[_0x4aca('0x4f')]=function(_0x3df672,_0x45659e){return db[_0x4aca('0x31')][_0x4aca('0x4f')]()['then'](respondWithResult(_0x45659e,null))[_0x4aca('0x47')](handleError(_0x45659e,null));};function wrapUser(_0x39108c){return function(_0xbdd59f){var _0x4d7b4b=_0x39108c['get']({'plain':!![]});_0x4d7b4b[_0x4aca('0x50')]=[];if(_0xbdd59f){_0x4d7b4b[_0x4aca('0x51')]=_0xbdd59f['createdAt'];_0x4d7b4b[_0x4aca('0x52')]=_0xbdd59f;}else{_0x4d7b4b[_0x4aca('0x51')]=moment(0x0)[_0x4aca('0x53')](_0x4aca('0x54'));_0x4d7b4b[_0x4aca('0x52')]={};}return _0x4d7b4b;};}exports[_0x4aca('0x55')]=function(_0x466ea2,_0x4d0258,_0x13680e){var _0x1271c7=[];return db[_0x4aca('0x56')][_0x4aca('0x45')]({'where':{'role':[_0x4aca('0x57'),_0x4aca('0x58'),_0x4aca('0x59')]},'attributes':['id',_0x4aca('0x5a'),'name',_0x4aca('0x5b'),_0x4aca('0x5c'),_0x4aca('0x5d'),_0x4aca('0x5e'),_0x4aca('0x5f'),'allowmessenger',_0x4aca('0x60')],'order':qs[_0x4aca('0x3d')]('-online'),'include':[{'model':db[_0x4aca('0x61')],'as':'VoiceQueues','attributes':['id',_0x4aca('0x2e'),_0x4aca('0x41')],'through':{'attributes':[]}}]})['then'](function(_0x542ac){if(_0x542ac){var _0x3b463a=_0x466ea2[_0x4aca('0x59')][_0x4aca('0x62')]({'plain':!![]});if(!_0x3b463a)throw new Error(_0x4aca('0x63'));if(_0x3b463a[_0x4aca('0x5b')]==='user'){return db[_0x4aca('0x64')][_0x4aca('0x4a')]({'where':{'name':_0x4aca('0x65'),'userProfileId':_0x3b463a['userProfileId']},'raw':!![]})[_0x4aca('0x2b')](function(_0x1c1675){if(_0x1c1675){if(_0x1c1675[_0x4aca('0x66')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x1c1675['id']},'raw':!![]})[_0x4aca('0x2b')](function(_0x166a59){var _0x64fc6b=[];if(_['isEmpty'](_0x166a59)){_0x64fc6b=_[_0x4aca('0x3f')](_0x542ac,function(_0x2841d9){if(_0x2841d9[_0x4aca('0x5b')]!==_0x4aca('0x57')){return _0x2841d9;}});return _0x64fc6b;}else{for(var _0x5bc9a2=0x0;_0x5bc9a2<_0x542ac['length'];_0x5bc9a2++){var _0x5cb600=_0x542ac[_0x5bc9a2];if(_0x5cb600[_0x4aca('0x5b')]===_0x4aca('0x57')){var _0x357eaa=_[_0x4aca('0x4a')](_0x166a59,function(_0x1aedb4){return _0x1aedb4[_0x4aca('0x67')]===_0x5cb600['id'];});if(_0x357eaa)_0x64fc6b[_0x4aca('0x68')](_0x5cb600);}else{_0x64fc6b[_0x4aca('0x68')](_0x5cb600);}}return _0x64fc6b;}});}else{return _0x542ac;}}else{var _0x54a0ca=_[_0x4aca('0x3f')](_0x542ac,function(_0xbe5e3c){if(_0xbe5e3c[_0x4aca('0x5b')]!=='agent'){return _0xbe5e3c;}});return _0x54a0ca;}});}else{return _0x542ac;}}})['then'](function(_0x3a9f4a){var _0x3ea84f=[];if(_0x3a9f4a){_0x1271c7=_0x3a9f4a;for(var _0x44b2ad=0x0;_0x44b2ad<_0x3a9f4a[_0x4aca('0x3a')];_0x44b2ad+=0x1){_0x1271c7[_0x44b2ad]['messages']=[];_0x3ea84f[_0x4aca('0x68')](db[_0x4aca('0x31')]['find']({'where':{'FromId':[_0x466ea2[_0x4aca('0x59')]['id'],_0x3a9f4a[_0x44b2ad]['id']],'ToId':[_0x466ea2['user']['id'],_0x3a9f4a[_0x44b2ad]['id']],'ChatGroupId':null},'attributes':['id',_0x4aca('0x69'),_0x4aca('0x6a'),_0x4aca('0x6b'),_0x4aca('0x6c'),_0x4aca('0x4c')],'order':qs[_0x4aca('0x3d')](_0x4aca('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x4aca('0x2b')](wrapUser(_0x3a9f4a[_0x44b2ad])));}return BPromise['all'](_0x3ea84f);}return[];})[_0x4aca('0x2b')](function(_0x10a14b){return{'rows':_0x10a14b,'count':_0x10a14b[_0x4aca('0x3a')]};})[_0x4aca('0x2b')](respondWithResult(_0x4d0258,null))[_0x4aca('0x47')](handleError(_0x4d0258,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index ba3d9f1..ab9e707 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 _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 +var _0x78ca=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x4b9b14,_0x4e226b){var _0x26ccdc=function(_0x14f5f6){while(--_0x14f5f6){_0x4b9b14['push'](_0x4b9b14['shift']());}};_0x26ccdc(++_0x4e226b);}(_0x78ca,0xee));var _0xa78c=function(_0x492832,_0x311a6d){_0x492832=_0x492832-0x0;var _0x5c41c8=_0x78ca[_0x492832];return _0x5c41c8;};'use strict';var EventEmitter=require(_0xa78c('0x0'));var ChatInternalMessage=require(_0xa78c('0x1'))['db'][_0xa78c('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xa78c('0x3')](0x0);var events={'afterCreate':_0xa78c('0x4'),'afterUpdate':_0xa78c('0x5'),'afterDestroy':_0xa78c('0x6')};function emitEvent(_0x228a95){return function(_0x4e51b6,_0x438ade,_0x572ae7){ChatInternalMessageEvents[_0xa78c('0x7')](_0x228a95+':'+_0x4e51b6['id'],_0x4e51b6);ChatInternalMessageEvents[_0xa78c('0x7')](_0x228a95,_0x4e51b6);_0x572ae7(null);};}for(var e in events){if(events[_0xa78c('0x8')](e)){var event=events[e];ChatInternalMessage[_0xa78c('0x9')](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 78ad587..f5a91d1 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 _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 +var _0x7c58=['../../config/environment','./chatInternalMessage.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x4a919f,_0x553927){var _0x2cd4ab=function(_0x568811){while(--_0x568811){_0x4a919f['push'](_0x4a919f['shift']());}};_0x2cd4ab(++_0x553927);}(_0x7c58,0xea));var _0x87c5=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x7c58[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x87c5('0x0'));var util=require(_0x87c5('0x1'));var logger=require(_0x87c5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x87c5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x87c5('0x4'));var rimraf=require(_0x87c5('0x5'));var config=require(_0x87c5('0x6'));var attributes=require(_0x87c5('0x7'));module[_0x87c5('0x8')]=function(_0x35b89a,_0x2cac93){return _0x35b89a[_0x87c5('0x9')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x87c5('0xa'),'collate':_0x87c5('0xb')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index edbb425..ba91830 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 _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 +var _0x59f1=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x59f1,0x199));var _0x159f=function(_0x2cd48f,_0x5c8878){_0x2cd48f=_0x2cd48f-0x0;var _0x194fa6=_0x59f1[_0x2cd48f];return _0x194fa6;};'use strict';var _=require('lodash');var util=require(_0x159f('0x0'));var moment=require('moment');var BPromise=require(_0x159f('0x1'));var rs=require(_0x159f('0x2'));var fs=require('fs');var Redis=require(_0x159f('0x3'));var db=require(_0x159f('0x4'))['db'];var utils=require(_0x159f('0x5'));var logger=require(_0x159f('0x6'))(_0x159f('0x7'));var config=require(_0x159f('0x8'));var jayson=require(_0x159f('0x9'));var client=jayson[_0x159f('0xa')][_0x159f('0xb')]({'port':0x232a});config['redis']=_[_0x159f('0xc')](config[_0x159f('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x159f('0xd')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0xa44380,_0x4a48a3,_0x2d2493){return new BPromise(function(_0x5b9471,_0xb62b49){return client[_0x159f('0xe')](_0xa44380,_0x2d2493)[_0x159f('0xf')](function(_0x1b1c4b){logger[_0x159f('0x10')](_0x159f('0x11'),_0x4a48a3,_0x159f('0x12'));logger[_0x159f('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x4a48a3,_0x159f('0x12'),JSON['stringify'](_0x1b1c4b));if(_0x1b1c4b[_0x159f('0x14')]){if(_0x1b1c4b[_0x159f('0x14')][_0x159f('0x15')]===0x1f4){logger[_0x159f('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x4a48a3,_0x1b1c4b['error']['message']);return _0xb62b49(_0x1b1c4b['error'][_0x159f('0x16')]);}logger[_0x159f('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x4a48a3,_0x1b1c4b[_0x159f('0x14')]['message']);return _0x5b9471(_0x1b1c4b[_0x159f('0x14')][_0x159f('0x16')]);}else{logger['info'](_0x159f('0x11'),_0x4a48a3,_0x159f('0x12'));_0x5b9471(_0x1b1c4b['result'][_0x159f('0x16')]);}})['catch'](function(_0xbd59fe){logger[_0x159f('0x14')](_0x159f('0x11'),_0x4a48a3,_0xbd59fe);_0xb62b49(_0xbd59fe);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 7a3d5fd..f848768 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 _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 +var _0x4ce4=['register','chatInternalMessage:','./chatInternalMessage.events','remove','update','emit','removeListener'];(function(_0xdab12a,_0x4012b9){var _0x4fb77d=function(_0x48ab41){while(--_0x48ab41){_0xdab12a['push'](_0xdab12a['shift']());}};_0x4fb77d(++_0x4012b9);}(_0x4ce4,0xa3));var _0x44ce=function(_0x24c14e,_0x55fc09){_0x24c14e=_0x24c14e-0x0;var _0x589035=_0x4ce4[_0x24c14e];return _0x589035;};'use strict';var ChatInternalMessageEvents=require(_0x44ce('0x0'));var events=['save',_0x44ce('0x1'),_0x44ce('0x2')];function createListener(_0x69cb87,_0x53fcb3){return function(_0x2b7008){_0x53fcb3[_0x44ce('0x3')](_0x69cb87,_0x2b7008);};}function removeListener(_0x5e6fa3,_0x1e141a){return function(){ChatInternalMessageEvents[_0x44ce('0x4')](_0x5e6fa3,_0x1e141a);};}exports[_0x44ce('0x5')]=function(_0x3cb381){for(var _0x2bebb0=0x0,_0xba961a=events['length'];_0x2bebb0<_0xba961a;_0x2bebb0++){var _0x8ea18d=events[_0x2bebb0];var _0x40da3f=createListener(_0x44ce('0x6')+_0x8ea18d,_0x3cb381);ChatInternalMessageEvents['on'](_0x8ea18d,_0x40da3f);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index bdb90bb..529296f 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 _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 +var _0x27f0=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','/:id','put','update','delete','exports','multer','util'];(function(_0x3cd2ee,_0x363ab7){var _0x4a7208=function(_0x26e9b9){while(--_0x26e9b9){_0x3cd2ee['push'](_0x3cd2ee['shift']());}};_0x4a7208(++_0x363ab7);}(_0x27f0,0x8a));var _0x027f=function(_0x54df31,_0x56de20){_0x54df31=_0x54df31-0x0;var _0x3636ed=_0x27f0[_0x54df31];return _0x3636ed;};'use strict';var multer=require(_0x027f('0x0'));var util=require(_0x027f('0x1'));var path=require(_0x027f('0x2'));var timeout=require('connect-timeout');var express=require(_0x027f('0x3'));var router=express[_0x027f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x027f('0x5'));var interaction=require(_0x027f('0x6'));var config=require(_0x027f('0x7'));var controller=require(_0x027f('0x8'));router[_0x027f('0x9')]('/',auth[_0x027f('0xa')](),controller[_0x027f('0xb')]);router['get'](_0x027f('0xc'),auth['isAuthenticated'](),controller[_0x027f('0xd')]);router[_0x027f('0x9')](_0x027f('0xe'),auth[_0x027f('0xa')](),controller['getUsers']);router['get'](_0x027f('0xf'),auth[_0x027f('0xa')](),controller['show']);router['post']('/',auth[_0x027f('0xa')](),controller['create']);router[_0x027f('0x10')](_0x027f('0xf'),controller[_0x027f('0x11')]);router[_0x027f('0x12')](_0x027f('0xf'),auth[_0x027f('0xa')](),controller['destroy']);module[_0x027f('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 bf7bca9..b0ef19c 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 _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 +var _0x578c=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x332740,_0x267c85){var _0x2681ed=function(_0x31c35c){while(--_0x31c35c){_0x332740['push'](_0x332740['shift']());}};_0x2681ed(++_0x267c85);}(_0x578c,0x158));var _0xc578=function(_0x21cf68,_0x264c24){_0x21cf68=_0x21cf68-0x0;var _0x250910=_0x578c[_0x21cf68];return _0x250910;};'use strict';var Sequelize=require(_0xc578('0x0'));module[_0xc578('0x1')]={'body':{'type':Sequelize[_0xc578('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc578('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc578('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc578('0x4')]('in','out'),'defaultValue':_0xc578('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc578('0x6')]},'providerName':{'type':Sequelize[_0xc578('0x7')]},'providerResponse':{'type':Sequelize[_0xc578('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 545bb43..bee64e9 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 _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 +var _0x433d=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','stack','name','index','ChatMessage','rawAttributes','type','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','find','create','body','describe','../../config/logger','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','params','get','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','EventManager','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','contact','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1ad0c1,_0x35a3f1){var _0x5e6656=function(_0x866c27){while(--_0x866c27){_0x1ad0c1['push'](_0x1ad0c1['shift']());}};_0x5e6656(++_0x35a3f1);}(_0x433d,0xe9));var _0xd433=function(_0x5e9d35,_0x382c91){_0x5e9d35=_0x5e9d35-0x0;var _0x3beb2e=_0x433d[_0x5e9d35];return _0x3beb2e;};'use strict';var emlformat=require(_0xd433('0x0'));var rimraf=require(_0xd433('0x1'));var zipdir=require(_0xd433('0x2'));var jsonpatch=require(_0xd433('0x3'));var rp=require('request-promise');var moment=require(_0xd433('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd433('0x5'));var util=require(_0xd433('0x6'));var path=require(_0xd433('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd433('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd433('0x9'));var squel=require(_0xd433('0xa'));var crypto=require(_0xd433('0xb'));var jsforce=require(_0xd433('0xc'));var deskjs=require(_0xd433('0xd'));var toCsv=require(_0xd433('0xe'));var querystring=require(_0xd433('0xf'));var Papa=require(_0xd433('0x10'));var Redis=require(_0xd433('0x11'));var authService=require(_0xd433('0x12'));var qs=require(_0xd433('0x13'));var as=require(_0xd433('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd433('0x15'))['db'];config[_0xd433('0x16')]=_[_0xd433('0x17')](config[_0xd433('0x16')],{'host':_0xd433('0x18'),'port':0x18eb});var socket=require(_0xd433('0x19'))(new Redis(config[_0xd433('0x16')]));require('./chatMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xd433('0x1a')][_0xd433('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0xd433('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x320f5f,_0x1fa0c9,_0x133b35,_0x38931a){return new BPromise(function(_0x56eb37,_0x570ed1){var _0x41a44c=_0x38931a||client;return _0x41a44c['request'](_0x320f5f,_0x133b35)[_0xd433('0x1c')](function(_0x1cafd0){logger[_0xd433('0x1d')](_0xd433('0x1e'),_0x1fa0c9,_0xd433('0x1f'));logger['debug'](_0xd433('0x20'),_0x1fa0c9,_0xd433('0x1f'),JSON[_0xd433('0x21')](_0x1cafd0));if(_0x1cafd0[_0xd433('0x22')]){if(_0x1cafd0['error'][_0xd433('0x23')]===0x1f4){logger[_0xd433('0x22')](_0xd433('0x1e'),_0x1fa0c9,_0x1cafd0['error']['message']);return _0x570ed1(_0x1cafd0[_0xd433('0x22')][_0xd433('0x24')]);}logger['error'](_0xd433('0x1e'),_0x1fa0c9,_0x1cafd0[_0xd433('0x22')][_0xd433('0x24')]);return _0x56eb37(_0x1cafd0[_0xd433('0x22')][_0xd433('0x24')]);}else{logger[_0xd433('0x1d')](_0xd433('0x1e'),_0x1fa0c9,'request\x20sent');_0x56eb37(_0x1cafd0['result'][_0xd433('0x24')]);}})[_0xd433('0x25')](function(_0x2aaf1a){logger['error'](_0xd433('0x1e'),_0x1fa0c9,_0x2aaf1a);_0x570ed1(_0x2aaf1a);});});}function respondWithStatusCode(_0x5df057,_0x4dde8c){_0x4dde8c=_0x4dde8c||0xcc;return function(_0x43d589){if(_0x43d589){return _0x5df057['sendStatus'](_0x4dde8c);}return _0x5df057[_0xd433('0x26')](_0x4dde8c)[_0xd433('0x27')]();};}function respondWithResult(_0x32091d,_0x52d047){_0x52d047=_0x52d047||0xc8;return function(_0x24717e){if(_0x24717e){return _0x32091d[_0xd433('0x26')](_0x52d047)[_0xd433('0x28')](_0x24717e);}};}function respondWithFilteredResult(_0x22cc1c,_0x389167){return function(_0x724d36){if(_0x724d36){var _0x44d51a=typeof _0x389167[_0xd433('0x29')]===_0xd433('0x2a')&&typeof _0x389167['limit']===_0xd433('0x2a');var _0x4bebcf=_0x724d36['count'];var _0x4d42b4=_0x44d51a?0x0:_0x389167['offset'];var _0x2bca1f=_0x44d51a?_0x724d36[_0xd433('0x2b')]:_0x389167[_0xd433('0x29')]+_0x389167[_0xd433('0x2c')];var _0x5ae7c2;if(_0x2bca1f>=_0x4bebcf){_0x2bca1f=_0x4bebcf;_0x5ae7c2=0xc8;}else{_0x5ae7c2=0xce;}_0x22cc1c[_0xd433('0x26')](_0x5ae7c2);return _0x22cc1c[_0xd433('0x2d')]('Content-Range',_0x4d42b4+'-'+_0x2bca1f+'/'+_0x4bebcf)[_0xd433('0x28')](_0x724d36);}return null;};}function patchUpdates(_0x383eb1){return function(_0x300bb5){try{jsonpatch[_0xd433('0x2e')](_0x300bb5,_0x383eb1,!![]);}catch(_0xb1d4ca){return BPromise[_0xd433('0x2f')](_0xb1d4ca);}return _0x300bb5[_0xd433('0x30')]();};}function saveUpdates(_0x197b2b,_0xb3e4aa){return function(_0x2979fb){if(_0x2979fb){return _0x2979fb[_0xd433('0x31')](_0x197b2b)[_0xd433('0x1c')](function(_0x132b05){return _0x132b05;});}return null;};}function removeEntity(_0x28b5f7,_0x480a6d){return function(_0x360ae2){if(_0x360ae2){return _0x360ae2[_0xd433('0x32')]()[_0xd433('0x1c')](function(){_0x28b5f7[_0xd433('0x26')](0xcc)[_0xd433('0x27')]();});}};}function handleEntityNotFound(_0x4b9515,_0x1a8f50){return function(_0x1ef634){if(!_0x1ef634){_0x4b9515['sendStatus'](0x194);}return _0x1ef634;};}function handleError(_0x35f27c,_0x44bba1){_0x44bba1=_0x44bba1||0x1f4;return function(_0x3874a2){logger['error'](_0x3874a2[_0xd433('0x33')]);if(_0x3874a2[_0xd433('0x34')]){delete _0x3874a2[_0xd433('0x34')];}_0x35f27c['status'](_0x44bba1)['send'](_0x3874a2);};}exports[_0xd433('0x35')]=function(_0x1d5e07,_0x1ca309){var _0x5d9e0d={},_0x53cbf2={},_0x2098f9={'count':0x0,'rows':[]};var _0x45a51f=_['map'](db[_0xd433('0x36')][_0xd433('0x37')],function(_0x9cad93){return{'name':_0x9cad93['fieldName'],'type':_0x9cad93[_0xd433('0x38')]['key']};});_0x53cbf2[_0xd433('0x39')]=_[_0xd433('0x3a')](_0x45a51f,'name');_0x53cbf2[_0xd433('0x3b')]=_[_0xd433('0x3c')](_0x1d5e07['query']);_0x53cbf2[_0xd433('0x3d')]=_['intersection'](_0x53cbf2['model'],_0x53cbf2['query']);_0x5d9e0d[_0xd433('0x3e')]=_[_0xd433('0x3f')](_0x53cbf2[_0xd433('0x39')],qs[_0xd433('0x40')](_0x1d5e07[_0xd433('0x3b')][_0xd433('0x40')]));_0x5d9e0d[_0xd433('0x3e')]=_0x5d9e0d[_0xd433('0x3e')][_0xd433('0x41')]?_0x5d9e0d['attributes']:_0x53cbf2[_0xd433('0x39')];if(!_0x1d5e07['query']['hasOwnProperty'](_0xd433('0x42'))){_0x5d9e0d[_0xd433('0x2c')]=qs[_0xd433('0x2c')](_0x1d5e07['query'][_0xd433('0x2c')]);_0x5d9e0d['offset']=qs[_0xd433('0x29')](_0x1d5e07[_0xd433('0x3b')][_0xd433('0x29')]);}_0x5d9e0d[_0xd433('0x43')]=qs[_0xd433('0x44')](_0x1d5e07[_0xd433('0x3b')][_0xd433('0x44')]);_0x5d9e0d[_0xd433('0x45')]=qs[_0xd433('0x3d')](_[_0xd433('0x46')](_0x1d5e07['query'],_0x53cbf2['filters']),_0x45a51f);if(_0x1d5e07[_0xd433('0x3b')][_0xd433('0x47')]){_0x5d9e0d['where']=_[_0xd433('0x48')](_0x5d9e0d[_0xd433('0x45')],{'$or':_[_0xd433('0x3a')](_0x45a51f,function(_0x4766df){if(_0x4766df['type']!==_0xd433('0x49')){var _0x1419a3={};_0x1419a3[_0x4766df[_0xd433('0x34')]]={'$like':'%'+_0x1d5e07[_0xd433('0x3b')][_0xd433('0x47')]+'%'};return _0x1419a3;}})});}_0x5d9e0d=_[_0xd433('0x48')]({},_0x5d9e0d,_0x1d5e07[_0xd433('0x4a')]);var _0x2b9544={'where':_0x5d9e0d[_0xd433('0x45')]};return db[_0xd433('0x36')][_0xd433('0x2b')](_0x2b9544)['then'](function(_0xdd3358){_0x2098f9[_0xd433('0x2b')]=_0xdd3358;if(_0x1d5e07['query'][_0xd433('0x4b')]){_0x5d9e0d['include']=[{'all':!![]}];}return db[_0xd433('0x36')][_0xd433('0x4c')](_0x5d9e0d);})['then'](function(_0x7d28e3){_0x2098f9[_0xd433('0x4d')]=_0x7d28e3;return _0x2098f9;})[_0xd433('0x1c')](respondWithFilteredResult(_0x1ca309,_0x5d9e0d))[_0xd433('0x25')](handleError(_0x1ca309,null));};exports[_0xd433('0x4e')]=function(_0x3c27ad,_0x192d0d){var _0x10934c={'raw':!![],'where':{'id':_0x3c27ad['params']['id']}},_0x2b5d19={};_0x2b5d19[_0xd433('0x39')]=_[_0xd433('0x3c')](db[_0xd433('0x36')][_0xd433('0x37')]);_0x2b5d19['query']=_[_0xd433('0x3c')](_0x3c27ad['query']);_0x2b5d19[_0xd433('0x3d')]=_[_0xd433('0x3f')](_0x2b5d19['model'],_0x2b5d19[_0xd433('0x3b')]);_0x10934c[_0xd433('0x3e')]=_[_0xd433('0x3f')](_0x2b5d19['model'],qs[_0xd433('0x40')](_0x3c27ad[_0xd433('0x3b')][_0xd433('0x40')]));_0x10934c[_0xd433('0x3e')]=_0x10934c[_0xd433('0x3e')][_0xd433('0x41')]?_0x10934c[_0xd433('0x3e')]:_0x2b5d19[_0xd433('0x39')];if(_0x3c27ad[_0xd433('0x3b')][_0xd433('0x4b')]){_0x10934c[_0xd433('0x4f')]=[{'all':!![]}];}_0x10934c=_[_0xd433('0x48')]({},_0x10934c,_0x3c27ad[_0xd433('0x4a')]);return db[_0xd433('0x36')][_0xd433('0x50')](_0x10934c)['then'](handleEntityNotFound(_0x192d0d,null))[_0xd433('0x1c')](respondWithResult(_0x192d0d,null))['catch'](handleError(_0x192d0d,null));};exports['create']=function(_0x318d22,_0xf6a2c9){return db['ChatMessage'][_0xd433('0x51')](_0x318d22[_0xd433('0x52')],{})[_0xd433('0x1c')](respondWithResult(_0xf6a2c9,0xc9))[_0xd433('0x25')](handleError(_0xf6a2c9,null));};exports[_0xd433('0x31')]=function(_0x5d7eed,_0x2c7bce){if(_0x5d7eed[_0xd433('0x52')]['id']){delete _0x5d7eed[_0xd433('0x52')]['id'];}return db[_0xd433('0x36')][_0xd433('0x50')]({'where':{'id':_0x5d7eed['params']['id']}})[_0xd433('0x1c')](handleEntityNotFound(_0x2c7bce,null))['then'](saveUpdates(_0x5d7eed[_0xd433('0x52')],null))['then'](respondWithResult(_0x2c7bce,null))[_0xd433('0x25')](handleError(_0x2c7bce,null));};exports[_0xd433('0x32')]=function(_0x4982df,_0x351196){return db[_0xd433('0x36')]['find']({'where':{'id':_0x4982df['params']['id']}})[_0xd433('0x1c')](handleEntityNotFound(_0x351196,null))[_0xd433('0x1c')](removeEntity(_0x351196,null))[_0xd433('0x25')](handleError(_0x351196,null));};exports[_0xd433('0x53')]=function(_0x44228d,_0x38fd52){return db[_0xd433('0x36')][_0xd433('0x53')]()[_0xd433('0x1c')](respondWithResult(_0x38fd52,null))[_0xd433('0x25')](handleError(_0x38fd52,null));};var interaction_log=require(_0xd433('0x54'))(_0xd433('0x55'));exports[_0xd433('0x56')]=function(_0x3c3f02,_0x28888c,_0x575d62){var _0x20897f={'agent':{},'channel':_0xd433('0x57')};if(_0x3c3f02[_0xd433('0x52')]['id']){delete _0x3c3f02[_0xd433('0x52')]['id'];}_0x3c3f02[_0xd433('0x52')][_0xd433('0x58')]=!![];_0x3c3f02[_0xd433('0x52')]['readAt']=moment()[_0xd433('0x59')](_0xd433('0x5a'));_0x3c3f02['body'][_0xd433('0x5b')]=_0x3c3f02['body'][_0xd433('0x5b')]||_0x3c3f02[_0xd433('0x5c')]['id'];_0x20897f[_0xd433('0x5d')]['id']=_0x3c3f02['body']['UserId'];return db[_0xd433('0x36')]['find']({'where':{'id':_0x3c3f02[_0xd433('0x5e')]['id'],'UserId':null}})[_0xd433('0x1c')](handleEntityNotFound(_0x28888c,null))[_0xd433('0x1c')](saveUpdates(_0x3c3f02[_0xd433('0x52')],null))[_0xd433('0x1c')](function(_0x585db5){if(_0x585db5){_0x20897f[_0xd433('0x24')]=_0x585db5[_0xd433('0x5f')]({'plain':!![]});return db[_0xd433('0x60')][_0xd433('0x50')]({'where':{'id':_0x585db5[_0xd433('0x61')]}});}return null;})[_0xd433('0x1c')](handleEntityNotFound(_0x28888c,null))[_0xd433('0x1c')](function(_0x37f38c){if(_0x37f38c){return _0x37f38c[_0xd433('0x31')]({'UserId':_0x3c3f02[_0xd433('0x52')][_0xd433('0x5b')],'read1stAt':_[_0xd433('0x62')](_0x37f38c['read1stAt'])?moment()[_0xd433('0x59')](_0xd433('0x5a')):undefined});}return null;})['then'](function(_0x498cec){if(_0x498cec){_0x20897f[_0xd433('0x63')]=_0x498cec['get']({'plain':!![]});interaction_log[_0xd433('0x1d')](_0xd433('0x64'),_0x3c3f02['user']['id'],_0x3c3f02[_0xd433('0x5c')][_0xd433('0x34')],_0x3c3f02[_0xd433('0x5c')][_0xd433('0x65')],_0x20897f[_0xd433('0x63')]['id'],_0x3c3f02[_0xd433('0x52')]?JSON[_0xd433('0x21')](_0x3c3f02[_0xd433('0x52')]):_0xd433('0x66'));return respondWithRpcPromise(_0xd433('0x67'),_0xd433('0x68'),_0x20897f);}return null;})['then'](function(_0x2c7bcb){var _0x9fc579=_0xd433('0x69')+_0x2c7bcb[_0xd433('0x24')]['ContactId'];return db[_0xd433('0x6a')][_0xd433('0x3b')](_0x9fc579,{'type':db[_0xd433('0x6b')][_0xd433('0x6c')][_0xd433('0x6d')],'raw':!![]})['then'](function(_0x38c1fc){return _0x38c1fc;});})[_0xd433('0x1c')](function(_0x14b991){if(_0x14b991){_0x20897f['message']['contact']=_0x14b991[0x0];if(!_0x3c3f02[_0xd433('0x52')][_0xd433('0x5b')])return;return db[_0xd433('0x6e')][_0xd433('0x50')]({'where':{'id':_0x3c3f02[_0xd433('0x52')][_0xd433('0x5b')],'role':_0xd433('0x5d')},'attributes':['id',_0xd433('0x34'),'fullname',_0xd433('0x6f'),_0xd433('0x70')],'raw':!![]});}return null;})[_0xd433('0x1c')](function(_0x56fa6f){if(!_0x56fa6f)return null;_0x20897f['message']['agent']=_0x56fa6f;return _0x20897f;})[_0xd433('0x1c')](function(_0x4b09ed){if(_0x4b09ed){if(_0x3c3f02[_0xd433('0x52')][_0xd433('0x71')]){_0x20897f[_0xd433('0x24')][_0xd433('0x72')]=util[_0xd433('0x59')](_0xd433('0x73'),_0x3c3f02[_0xd433('0x5c')][_0xd433('0x34')]);_0x20897f[_0xd433('0x24')]['channel']=_0x20897f['channel'];_0x20897f['message'][_0xd433('0x74')]=_0x20897f[_0xd433('0x75')];_0x20897f['message'][_0xd433('0x76')]='accept';return respondWithRpcPromise(_0xd433('0x77'),_0xd433('0x77'),{'event':'acceptmessage','message':_[_0xd433('0x48')](_0x20897f[_0xd433('0x24')],JSON['parse'](_0x20897f[_0xd433('0x63')][_0xd433('0x78')]))},client9002)[_0xd433('0x1c')](function(){return _0x20897f;});}return _0x20897f;}return null;})[_0xd433('0x1c')](respondWithResult(_0x28888c,null))[_0xd433('0x25')](handleError(_0x28888c,null));};var interaction_log=require(_0xd433('0x54'))(_0xd433('0x55'));exports[_0xd433('0x2f')]=function(_0x3655b5,_0x29c2a1,_0x4170f7){var _0x4bac72={'agent':{},'channel':_0xd433('0x57')};if(_0x3655b5[_0xd433('0x52')]['id']){delete _0x3655b5['body']['id'];}_0x3655b5['body'][_0xd433('0x5b')]=_0x3655b5[_0xd433('0x52')]['UserId']||_0x3655b5[_0xd433('0x5c')]['id'];_0x4bac72[_0xd433('0x5d')]['id']=_0x3655b5[_0xd433('0x52')][_0xd433('0x5b')];return db['ChatMessage']['find']({'where':{'id':_0x3655b5[_0xd433('0x5e')]['id'],'UserId':null}})[_0xd433('0x1c')](handleEntityNotFound(_0x29c2a1,null))[_0xd433('0x1c')](function(_0x42d058){if(_0x42d058){_0x4bac72[_0xd433('0x24')]=_0x42d058[_0xd433('0x5f')]({'plain':!![]});return db[_0xd433('0x60')][_0xd433('0x50')]({'where':{'id':_0x42d058['ChatInteractionId']}});}return null;})[_0xd433('0x1c')](handleEntityNotFound(_0x29c2a1,null))['then'](function(_0xf7df28){if(_0xf7df28){_0x4bac72['interaction']=_0xf7df28[_0xd433('0x5f')]({'plain':!![]});interaction_log[_0xd433('0x1d')](_0xd433('0x79'),_0x3655b5[_0xd433('0x5c')]['id'],_0x3655b5[_0xd433('0x5c')][_0xd433('0x34')],_0x3655b5[_0xd433('0x5c')][_0xd433('0x65')],_0x4bac72[_0xd433('0x63')]['id'],_0x3655b5[_0xd433('0x52')]?JSON[_0xd433('0x21')](_0x3655b5[_0xd433('0x52')]):_0xd433('0x66'));return respondWithRpcPromise(_0xd433('0x7a'),_0xd433('0x7b'),_0x4bac72);}return null;})[_0xd433('0x1c')](function(_0x437c92){var _0x36dabf=_0xd433('0x69')+_0x437c92[_0xd433('0x24')][_0xd433('0x7c')];return db[_0xd433('0x6a')][_0xd433('0x3b')](_0x36dabf,{'type':db[_0xd433('0x6b')][_0xd433('0x6c')]['SELECT'],'raw':!![]})[_0xd433('0x1c')](function(_0x5a7d33){return _0x5a7d33;});})[_0xd433('0x1c')](function(_0x345ea7){if(_0x345ea7){_0x4bac72[_0xd433('0x24')][_0xd433('0x7d')]=_0x345ea7[0x0];if(!_0x3655b5[_0xd433('0x52')][_0xd433('0x5b')])return;return db['User']['find']({'where':{'id':_0x3655b5['body'][_0xd433('0x5b')],'role':_0xd433('0x5d')},'attributes':['id','name','fullname',_0xd433('0x6f'),_0xd433('0x70')],'raw':!![]});}return null;})[_0xd433('0x1c')](function(_0x5512c0){if(!_0x5512c0)return null;_0x4bac72[_0xd433('0x24')][_0xd433('0x5d')]=_0x5512c0;return _0x4bac72;})['then'](function(_0x2b5752){if(_0x2b5752){_0x2b5752[_0xd433('0x24')][_0xd433('0x72')]=util[_0xd433('0x59')](_0xd433('0x73'),_0x3655b5['user']['name']);_0x2b5752[_0xd433('0x24')][_0xd433('0x75')]=_0x4bac72[_0xd433('0x75')];_0x2b5752[_0xd433('0x24')]['motionChannel']=_0x4bac72[_0xd433('0x75')];_0x2b5752[_0xd433('0x24')][_0xd433('0x76')]='reject';respondWithRpcPromise('EventManager',_0xd433('0x77'),{'event':_0xd433('0x7e'),'message':_[_0xd433('0x48')](_0x4bac72[_0xd433('0x24')],JSON['parse'](_0x4bac72[_0xd433('0x63')][_0xd433('0x78')]))},client9002);return _0x4bac72;}return null;})[_0xd433('0x1c')](respondWithResult(_0x29c2a1,null))[_0xd433('0x25')](handleError(_0x29c2a1,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index ff0a1f8..323dc34 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 _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 +var _0x7c8a=['ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x3a9ee1,_0x1c9619){var _0x3d9dcc=function(_0x47fa08){while(--_0x47fa08){_0x3a9ee1['push'](_0x3a9ee1['shift']());}};_0x3d9dcc(++_0x1c9619);}(_0x7c8a,0x8e));var _0xa7c8=function(_0x32989d,_0x2d8a0c){_0x32989d=_0x32989d-0x0;var _0x1c18a5=_0x7c8a[_0x32989d];return _0x1c18a5;};'use strict';var EventEmitter=require(_0xa7c8('0x0'));var ChatMessage=require(_0xa7c8('0x1'))['db'][_0xa7c8('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa7c8('0x3')](0x0);var events={'afterCreate':_0xa7c8('0x4'),'afterUpdate':_0xa7c8('0x5'),'afterDestroy':_0xa7c8('0x6')};function emitEvent(_0x4e0ede){return function(_0x3317b1,_0x12c28e,_0x266eb1){ChatMessageEvents['emit'](_0x4e0ede+':'+_0x3317b1['id'],_0x3317b1);ChatMessageEvents[_0xa7c8('0x7')](_0x4e0ede,_0x3317b1);_0x266eb1(null);};}for(var e in events){if(events[_0xa7c8('0x8')](e)){var event=events[e];ChatMessage['hook'](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 8b7145c..eee9e35 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 _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 +var _0xceae=['fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','bluebird','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages'];(function(_0x149300,_0x11fa0d){var _0x1e27ac=function(_0x388e6a){while(--_0x388e6a){_0x149300['push'](_0x149300['shift']());}};_0x1e27ac(++_0x11fa0d);}(_0xceae,0x122));var _0xecea=function(_0x5eb4bb,_0xbd4598){_0x5eb4bb=_0x5eb4bb-0x0;var _0x12d25b=_0xceae[_0x5eb4bb];return _0x12d25b;};'use strict';var _=require(_0xecea('0x0'));var util=require(_0xecea('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xecea('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xecea('0x3'));var config=require(_0xecea('0x4'));var attributes=require(_0xecea('0x5'));module[_0xecea('0x6')]=function(_0x1588bf,_0x1b1b68){return _0x1588bf[_0xecea('0x7')](_0xecea('0x8'),attributes,{'tableName':_0xecea('0x9'),'paranoid':![],'indexes':[{'name':_0xecea('0xa'),'fields':['body'],'type':_0xecea('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ecb8e,_0x379b2c,_0x2142af){var _0x38d7af=_0x1588bf[_0xecea('0xc')];var _0xd2fce0=_0x4ecb8e[_0xecea('0xd')]({'plain':!![]});if(_0xd2fce0[_0xecea('0xe')][_0xecea('0xf')]()==='in'||_0xd2fce0[_0xecea('0xe')][_0xecea('0xf')]()===_0xecea('0x10')&&!_0xd2fce0['secret']&&!_['isNil'](_0xd2fce0['UserId'])){_0x38d7af[_0xecea('0x11')]['findOne']({'where':{'id':_0xd2fce0[_0xecea('0x12')]}})[_0xecea('0x13')](function(_0x23d248){if(_0x23d248){_0x23d248[_0xecea('0x14')]({'lastMsgAt':_0xd2fce0[_0xecea('0x15')],'lastMsgDirection':_0xd2fce0[_0xecea('0xe')]['toLowerCase']()});}})[_0xecea('0x16')](function(_0x3245c2){console[_0xecea('0x17')](_0x3245c2);});}_0x2142af();}},'charset':'utf8mb4','collate':_0xecea('0x18')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 3cdac32..1f3682a 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 _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 +var _0xe1cc=['request\x20sent','stringify','error','code','message','result','CreateChatMessage','ChatMessage','options','raw','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x28c402,_0x4515bb){var _0x5e5a79=function(_0x4f15b3){while(--_0x4f15b3){_0x28c402['push'](_0x28c402['shift']());}};_0x5e5a79(++_0x4515bb);}(_0xe1cc,0xf2));var _0xce1c=function(_0x23524a,_0x118ff4){_0x23524a=_0x23524a-0x0;var _0x2a7744=_0xe1cc[_0x23524a];return _0x2a7744;};'use strict';var _=require(_0xce1c('0x0'));var util=require('util');var moment=require(_0xce1c('0x1'));var BPromise=require('bluebird');var rs=require(_0xce1c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce1c('0x3'))['db'];var utils=require(_0xce1c('0x4'));var logger=require(_0xce1c('0x5'))(_0xce1c('0x6'));var config=require(_0xce1c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xce1c('0x8')]['http']({'port':0x232a});config[_0xce1c('0x9')]=_[_0xce1c('0xa')](config['redis'],{'host':_0xce1c('0xb'),'port':0x18eb});var socket=require(_0xce1c('0xc'))(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x1cbe6a,_0x144ed2,_0x39d045){return new BPromise(function(_0x3b1b28,_0x4beb9d){return client[_0xce1c('0xd')](_0x1cbe6a,_0x39d045)[_0xce1c('0xe')](function(_0x222ef7){logger[_0xce1c('0xf')](_0xce1c('0x10'),_0x144ed2,'request\x20sent');logger[_0xce1c('0x11')](_0xce1c('0x12'),_0x144ed2,_0xce1c('0x13'),JSON[_0xce1c('0x14')](_0x222ef7));if(_0x222ef7[_0xce1c('0x15')]){if(_0x222ef7[_0xce1c('0x15')][_0xce1c('0x16')]===0x1f4){logger[_0xce1c('0x15')](_0xce1c('0x10'),_0x144ed2,_0x222ef7[_0xce1c('0x15')]['message']);return _0x4beb9d(_0x222ef7['error'][_0xce1c('0x17')]);}logger[_0xce1c('0x15')]('ChatMessage,\x20%s,\x20%s',_0x144ed2,_0x222ef7[_0xce1c('0x15')]['message']);return _0x3b1b28(_0x222ef7[_0xce1c('0x15')][_0xce1c('0x17')]);}else{logger['info'](_0xce1c('0x10'),_0x144ed2,_0xce1c('0x13'));_0x3b1b28(_0x222ef7[_0xce1c('0x18')][_0xce1c('0x17')]);}})['catch'](function(_0x9d2955){logger[_0xce1c('0x15')](_0xce1c('0x10'),_0x144ed2,_0x9d2955);_0x4beb9d(_0x9d2955);});});}exports[_0xce1c('0x19')]=function(_0x3e1b0d){var _0x1b0054=this;return new Promise(function(_0x2d063f,_0x206074){return db[_0xce1c('0x1a')]['create'](_0x3e1b0d['body'],{'raw':_0x3e1b0d['options']?_0x3e1b0d[_0xce1c('0x1b')][_0xce1c('0x1c')]===undefined?!![]:![]:!![]})[_0xce1c('0xe')](function(_0x449019){logger[_0xce1c('0xf')](_0xce1c('0x19'),_0x3e1b0d);logger[_0xce1c('0x11')]('CreateChatMessage',_0x3e1b0d,JSON[_0xce1c('0x14')](_0x449019));_0x2d063f(_0x449019);})['catch'](function(_0x4e8e99){logger[_0xce1c('0x15')](_0xce1c('0x19'),_0x4e8e99[_0xce1c('0x17')],_0x3e1b0d);_0x206074(_0x1b0054[_0xce1c('0x15')](0x1f4,_0x4e8e99['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index c6519d3..16d633f 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 _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 +var _0x7a2d=['length','chatMessage:','./chatMessage.events','save','remove','update','removeListener','register'];(function(_0xc79556,_0x27b148){var _0x19f18a=function(_0x434e45){while(--_0x434e45){_0xc79556['push'](_0xc79556['shift']());}};_0x19f18a(++_0x27b148);}(_0x7a2d,0x142));var _0xd7a2=function(_0x36e1d2,_0x5697a){_0x36e1d2=_0x36e1d2-0x0;var _0x3a7037=_0x7a2d[_0x36e1d2];return _0x3a7037;};'use strict';var ChatMessageEvents=require(_0xd7a2('0x0'));var events=[_0xd7a2('0x1'),_0xd7a2('0x2'),_0xd7a2('0x3')];function createListener(_0x81f2c5,_0x1edb4e){return function(_0x31dd61){_0x1edb4e['emit'](_0x81f2c5,_0x31dd61);};}function removeListener(_0x500472,_0x7370d9){return function(){ChatMessageEvents[_0xd7a2('0x4')](_0x500472,_0x7370d9);};}exports[_0xd7a2('0x5')]=function(_0x13b19d){for(var _0x4f0c6b=0x0,_0x210a06=events[_0xd7a2('0x6')];_0x4f0c6b<_0x210a06;_0x4f0c6b++){var _0x1e3fc8=events[_0x4f0c6b];var _0x69f732=createListener(_0xd7a2('0x7')+_0x1e3fc8,_0x13b19d);ChatMessageEvents['on'](_0x1e3fc8,_0x69f732);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 110c9a1..ca063fe 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 _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 +var _0x50d7=['chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','index','get','/describe','isAuthenticated','/:id','post','tracked'];(function(_0x2f16e5,_0x2e75e0){var _0x5d082a=function(_0x13873b){while(--_0x13873b){_0x2f16e5['push'](_0x2f16e5['shift']());}};_0x5d082a(++_0x2e75e0);}(_0x50d7,0xba));var _0x750d=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x50d7[_0x138adb];return _0x1b27f2;};'use strict';var multer=require(_0x750d('0x0'));var util=require(_0x750d('0x1'));var path=require(_0x750d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x750d('0x3'));var auth=require(_0x750d('0x4'));var interaction=require(_0x750d('0x5'));var config=require('../../config/environment');var controller=require(_0x750d('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x750d('0x7')]);router[_0x750d('0x8')](_0x750d('0x9'),auth[_0x750d('0xa')](),controller['describe']);router[_0x750d('0x8')](_0x750d('0xb'),auth[_0x750d('0xa')](),controller['show']);router[_0x750d('0xc')]('/',auth['isAuthenticated'](),interaction[_0x750d('0xd')](_0x750d('0xe'),_0x750d('0xf')),controller[_0x750d('0x10')]);router[_0x750d('0x11')](_0x750d('0xb'),controller[_0x750d('0x12')]);router[_0x750d('0x11')](_0x750d('0x13'),auth[_0x750d('0xa')](),controller[_0x750d('0x14')]);router[_0x750d('0x11')](_0x750d('0x15'),auth[_0x750d('0xa')](),controller[_0x750d('0x16')]);router[_0x750d('0x17')]('/:id',auth[_0x750d('0xa')](),controller[_0x750d('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index b7c3b6c..8e2cfb0 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 _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 +var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x315b61,_0x4bb11e){_0x315b61=_0x315b61-0x0;var _0x3521e8=_0x0b0e[_0x315b61];return _0x3521e8;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index a7235ab..e7dab60 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(_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 +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(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x7a54,0x106));var _0x47a5=function(_0x2753f0,_0x29488e){_0x2753f0=_0x2753f0-0x0;var _0x4143ee=_0x7a54[_0x2753f0];return _0x4143ee;};'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 e84504b..2b41983 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 _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 +var _0x01d9=['ChatOfflineMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3eb926,_0x27e966){var _0x29460d=function(_0x143ba7){while(--_0x143ba7){_0x3eb926['push'](_0x3eb926['shift']());}};_0x29460d(++_0x27e966);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x901d('0x0'));var ChatOfflineMessage=require(_0x901d('0x1'))['db'][_0x901d('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x901d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x901d('0x4'),'afterDestroy':_0x901d('0x5')};function emitEvent(_0x247cfc){return function(_0x8f7b4,_0x214f38,_0x456f31){ChatOfflineMessageEvents[_0x901d('0x6')](_0x247cfc+':'+_0x8f7b4['id'],_0x8f7b4);ChatOfflineMessageEvents['emit'](_0x247cfc,_0x8f7b4);_0x456f31(null);};}for(var e in events){if(events[_0x901d('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x901d('0x8')](e,emitEvent(event));}}module[_0x901d('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 2e3d2d6..8cc4e99 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 _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 +var _0x7a28=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x571339,_0x5bcafb){var _0x5af8a6=function(_0x389251){while(--_0x389251){_0x571339['push'](_0x571339['shift']());}};_0x5af8a6(++_0x5bcafb);}(_0x7a28,0x172));var _0x87a2=function(_0x1f4f68,_0x5c9022){_0x1f4f68=_0x1f4f68-0x0;var _0x3e2d3d=_0x7a28[_0x1f4f68];return _0x3e2d3d;};'use strict';var attributes=require(_0x87a2('0x0'));module[_0x87a2('0x1')]=function(_0x43eedd){return _0x43eedd[_0x87a2('0x2')](_0x87a2('0x3'),attributes,{'tableName':_0x87a2('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x87a2('0x5'),'collate':_0x87a2('0x6')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index b38e0ba..525cd44 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 _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 +var _0xdae3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','request\x20sent','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','info','result'];(function(_0x3861f7,_0x995b22){var _0x50879f=function(_0x3003f1){while(--_0x3003f1){_0x3861f7['push'](_0x3861f7['shift']());}};_0x50879f(++_0x995b22);}(_0xdae3,0x10e));var _0x3dae=function(_0x6d2cf2,_0x1386ca){_0x6d2cf2=_0x6d2cf2-0x0;var _0x2e646e=_0xdae3[_0x6d2cf2];return _0x2e646e;};'use strict';var _=require(_0x3dae('0x0'));var util=require(_0x3dae('0x1'));var moment=require(_0x3dae('0x2'));var BPromise=require(_0x3dae('0x3'));var rs=require(_0x3dae('0x4'));var fs=require('fs');var Redis=require(_0x3dae('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3dae('0x6'))(_0x3dae('0x7'));var config=require(_0x3dae('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3dae('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x353d24,_0x3f6ddd,_0x990c70){return new BPromise(function(_0x353eef,_0xbfc082){return client['request'](_0x353d24,_0x990c70)[_0x3dae('0xa')](function(_0x319278){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x3f6ddd,'request\x20sent');logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x3f6ddd,_0x3dae('0xb'),JSON[_0x3dae('0xc')](_0x319278));if(_0x319278['error']){if(_0x319278[_0x3dae('0xd')]['code']===0x1f4){logger['error'](_0x3dae('0xe'),_0x3f6ddd,_0x319278[_0x3dae('0xd')][_0x3dae('0xf')]);return _0xbfc082(_0x319278['error']['message']);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3f6ddd,_0x319278['error'][_0x3dae('0xf')]);return _0x353eef(_0x319278[_0x3dae('0xd')][_0x3dae('0xf')]);}else{logger[_0x3dae('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3f6ddd,_0x3dae('0xb'));_0x353eef(_0x319278[_0x3dae('0x11')][_0x3dae('0xf')]);}})['catch'](function(_0x46c437){logger[_0x3dae('0xd')](_0x3dae('0xe'),_0x3f6ddd,_0x46c437);_0xbfc082(_0x46c437);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 8fc4af4..e2a0d60 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 _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 +var _0x9e3c=['put','update','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x153dba,_0x2fc9d9){var _0x4d3654=function(_0x4a0c50){while(--_0x4a0c50){_0x153dba['push'](_0x153dba['shift']());}};_0x4d3654(++_0x2fc9d9);}(_0x9e3c,0x17f));var _0xc9e3=function(_0x527a53,_0x3265d6){_0x527a53=_0x527a53-0x0;var _0x2332f5=_0x9e3c[_0x527a53];return _0x2332f5;};'use strict';var multer=require('multer');var util=require(_0xc9e3('0x0'));var path=require(_0xc9e3('0x1'));var timeout=require('connect-timeout');var express=require(_0xc9e3('0x2'));var router=express[_0xc9e3('0x3')]();var fs_extra=require(_0xc9e3('0x4'));var auth=require(_0xc9e3('0x5'));var interaction=require(_0xc9e3('0x6'));var config=require(_0xc9e3('0x7'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0xc9e3('0x8')](),controller[_0xc9e3('0x9')]);router[_0xc9e3('0xa')](_0xc9e3('0xb'),auth[_0xc9e3('0x8')](),controller[_0xc9e3('0xc')]);router['get'](_0xc9e3('0xd'),auth[_0xc9e3('0x8')](),controller[_0xc9e3('0xe')]);router[_0xc9e3('0xf')]('/',auth[_0xc9e3('0x8')](),controller['create']);router[_0xc9e3('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xc9e3('0x11')]);router['delete'](_0xc9e3('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xc9e3('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 512298b..770302a 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 _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 +var _0x1e12=['exports','STRING','mouseOver','timeout','INTEGER','sequelize'];(function(_0x2df84d,_0x56d874){var _0x2634ce=function(_0x8e8e31){while(--_0x8e8e31){_0x2df84d['push'](_0x2df84d['shift']());}};_0x2634ce(++_0x56d874);}(_0x1e12,0xef));var _0x21e1=function(_0x335f37,_0x23569c){_0x335f37=_0x335f37-0x0;var _0x5ebe83=_0x1e12[_0x335f37];return _0x5ebe83;};'use strict';var Sequelize=require(_0x21e1('0x0'));module[_0x21e1('0x1')]={'name':{'type':Sequelize[_0x21e1('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x21e1('0x3'),_0x21e1('0x4')),'defaultValue':_0x21e1('0x3')},'selector':{'type':Sequelize[_0x21e1('0x2')]},'timeout':{'type':Sequelize[_0x21e1('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index ad3e1f6..743fc62 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 _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 +var _0x96f1=['Content-Range','apply','reject','then','end','error','stack','name','send','show','model','ChatProactiveAction','query','keys','filters','attributes','intersection','fields','length','includeAll','merge','options','find','catch','update','params','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count'];(function(_0x5d9f6d,_0x38ff06){var _0x3c9b25=function(_0x5f1913){while(--_0x5f1913){_0x5d9f6d['push'](_0x5d9f6d['shift']());}};_0x3c9b25(++_0x38ff06);}(_0x96f1,0x19c));var _0x196f=function(_0x1dacca,_0x5d87cf){_0x1dacca=_0x1dacca-0x0;var _0x155f58=_0x96f1[_0x1dacca];return _0x155f58;};'use strict';var emlformat=require(_0x196f('0x0'));var rimraf=require(_0x196f('0x1'));var zipdir=require(_0x196f('0x2'));var jsonpatch=require(_0x196f('0x3'));var rp=require(_0x196f('0x4'));var moment=require(_0x196f('0x5'));var BPromise=require(_0x196f('0x6'));var Mustache=require(_0x196f('0x7'));var util=require('util');var path=require('path');var sox=require(_0x196f('0x8'));var csv=require(_0x196f('0x9'));var ejs=require(_0x196f('0xa'));var fs=require('fs');var fs_extra=require(_0x196f('0xb'));var _=require(_0x196f('0xc'));var squel=require('squel');var crypto=require(_0x196f('0xd'));var jsforce=require(_0x196f('0xe'));var deskjs=require(_0x196f('0xf'));var toCsv=require(_0x196f('0x9'));var querystring=require('querystring');var Papa=require(_0x196f('0x10'));var Redis=require('ioredis');var authService=require(_0x196f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x196f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x196f('0x13'));var licenseUtil=require(_0x196f('0x14'));var db=require(_0x196f('0x15'))['db'];function respondWithStatusCode(_0x36e631,_0x28a202){_0x28a202=_0x28a202||0xcc;return function(_0x219c21){if(_0x219c21){return _0x36e631['sendStatus'](_0x28a202);}return _0x36e631[_0x196f('0x16')](_0x28a202)['end']();};}function respondWithResult(_0x40828b,_0x568ef0){_0x568ef0=_0x568ef0||0xc8;return function(_0x16bd9d){if(_0x16bd9d){return _0x40828b['status'](_0x568ef0)[_0x196f('0x17')](_0x16bd9d);}};}function respondWithFilteredResult(_0x106562,_0x192367){return function(_0x330646){if(_0x330646){var _0xeeae5d=typeof _0x192367[_0x196f('0x18')]==='undefined'&&typeof _0x192367[_0x196f('0x19')]===_0x196f('0x1a');var _0x1e73f1=_0x330646[_0x196f('0x1b')];var _0x55b82f=_0xeeae5d?0x0:_0x192367[_0x196f('0x18')];var _0x2b2f56=_0xeeae5d?_0x330646[_0x196f('0x1b')]:_0x192367['offset']+_0x192367[_0x196f('0x19')];var _0x84571f;if(_0x2b2f56>=_0x1e73f1){_0x2b2f56=_0x1e73f1;_0x84571f=0xc8;}else{_0x84571f=0xce;}_0x106562['status'](_0x84571f);return _0x106562['set'](_0x196f('0x1c'),_0x55b82f+'-'+_0x2b2f56+'/'+_0x1e73f1)[_0x196f('0x17')](_0x330646);}return null;};}function patchUpdates(_0x464321){return function(_0x16bec1){try{jsonpatch[_0x196f('0x1d')](_0x16bec1,_0x464321,!![]);}catch(_0x17fbd2){return BPromise[_0x196f('0x1e')](_0x17fbd2);}return _0x16bec1['save']();};}function saveUpdates(_0x3e17f,_0x3d6e33){return function(_0x31bf42){if(_0x31bf42){return _0x31bf42['update'](_0x3e17f)['then'](function(_0x2f5d60){return _0x2f5d60;});}return null;};}function removeEntity(_0x28a6d3,_0x1c5786){return function(_0x18b220){if(_0x18b220){return _0x18b220['destroy']()[_0x196f('0x1f')](function(){_0x28a6d3[_0x196f('0x16')](0xcc)[_0x196f('0x20')]();});}};}function handleEntityNotFound(_0x330e36,_0x427ac6){return function(_0x406ab5){if(!_0x406ab5){_0x330e36['sendStatus'](0x194);}return _0x406ab5;};}function handleError(_0x4f6155,_0x37105f){_0x37105f=_0x37105f||0x1f4;return function(_0x3c4834){logger[_0x196f('0x21')](_0x3c4834[_0x196f('0x22')]);if(_0x3c4834[_0x196f('0x23')]){delete _0x3c4834[_0x196f('0x23')];}_0x4f6155[_0x196f('0x16')](_0x37105f)[_0x196f('0x24')](_0x3c4834);};}exports[_0x196f('0x25')]=function(_0x22e769,_0x5a285b){var _0x2ef0ea={'raw':!![],'where':{'id':_0x22e769['params']['id']}},_0x30b0c7={};_0x30b0c7[_0x196f('0x26')]=_['keys'](db[_0x196f('0x27')]['rawAttributes']);_0x30b0c7[_0x196f('0x28')]=_[_0x196f('0x29')](_0x22e769[_0x196f('0x28')]);_0x30b0c7[_0x196f('0x2a')]=_['intersection'](_0x30b0c7[_0x196f('0x26')],_0x30b0c7[_0x196f('0x28')]);_0x2ef0ea[_0x196f('0x2b')]=_[_0x196f('0x2c')](_0x30b0c7[_0x196f('0x26')],qs[_0x196f('0x2d')](_0x22e769['query'][_0x196f('0x2d')]));_0x2ef0ea['attributes']=_0x2ef0ea['attributes'][_0x196f('0x2e')]?_0x2ef0ea[_0x196f('0x2b')]:_0x30b0c7[_0x196f('0x26')];if(_0x22e769[_0x196f('0x28')][_0x196f('0x2f')]){_0x2ef0ea['include']=[{'all':!![]}];}_0x2ef0ea=_[_0x196f('0x30')]({},_0x2ef0ea,_0x22e769[_0x196f('0x31')]);return db[_0x196f('0x27')][_0x196f('0x32')](_0x2ef0ea)[_0x196f('0x1f')](handleEntityNotFound(_0x5a285b,null))[_0x196f('0x1f')](respondWithResult(_0x5a285b,null))[_0x196f('0x33')](handleError(_0x5a285b,null));};exports['create']=function(_0x2d9cc4,_0x56c95c){return db[_0x196f('0x27')]['create'](_0x2d9cc4['body'],{})[_0x196f('0x1f')](respondWithResult(_0x56c95c,0xc9))[_0x196f('0x33')](handleError(_0x56c95c,null));};exports[_0x196f('0x34')]=function(_0x2e9533,_0x1805d1){if(_0x2e9533['body']['id']){delete _0x2e9533['body']['id'];}return db[_0x196f('0x27')][_0x196f('0x32')]({'where':{'id':_0x2e9533[_0x196f('0x35')]['id']}})[_0x196f('0x1f')](handleEntityNotFound(_0x1805d1,null))['then'](saveUpdates(_0x2e9533[_0x196f('0x36')],null))[_0x196f('0x1f')](respondWithResult(_0x1805d1,null))[_0x196f('0x33')](handleError(_0x1805d1,null));};exports['destroy']=function(_0x4fe155,_0x46e662){return db[_0x196f('0x27')]['find']({'where':{'id':_0x4fe155[_0x196f('0x35')]['id']}})[_0x196f('0x1f')](handleEntityNotFound(_0x46e662,null))[_0x196f('0x1f')](removeEntity(_0x46e662,null))[_0x196f('0x33')](handleError(_0x46e662,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index fa0534b..b5cbbb9 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 _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 +var _0x46a2=['chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction'];(function(_0x140438,_0x17c9e2){var _0x3ff495=function(_0x3d2b18){while(--_0x3d2b18){_0x140438['push'](_0x140438['shift']());}};_0x3ff495(++_0x17c9e2);}(_0x46a2,0x12c));var _0x246a=function(_0x5a7f64,_0x347d57){_0x5a7f64=_0x5a7f64-0x0;var _0x3d30f1=_0x46a2[_0x5a7f64];return _0x3d30f1;};'use strict';var _=require(_0x246a('0x0'));var util=require(_0x246a('0x1'));var logger=require(_0x246a('0x2'))(_0x246a('0x3'));var moment=require(_0x246a('0x4'));var BPromise=require(_0x246a('0x5'));var rp=require(_0x246a('0x6'));var fs=require('fs');var path=require(_0x246a('0x7'));var rimraf=require(_0x246a('0x8'));var config=require('../../config/environment');var attributes=require(_0x246a('0x9'));module['exports']=function(_0x2eecff,_0x5cdef3){return _0x2eecff[_0x246a('0xa')](_0x246a('0xb'),attributes,{'tableName':_0x246a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 06e4b89..ceb416e 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 _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 +var _0x1e63=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring'];(function(_0x58c184,_0x128f43){var _0x25a09f=function(_0x5ef878){while(--_0x5ef878){_0x58c184['push'](_0x58c184['shift']());}};_0x25a09f(++_0x128f43);}(_0x1e63,0x11d));var _0x31e6=function(_0x48f0cb,_0x4e1f50){_0x48f0cb=_0x48f0cb-0x0;var _0x232533=_0x1e63[_0x48f0cb];return _0x232533;};'use strict';var _=require(_0x31e6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x31e6('0x1'));var rs=require(_0x31e6('0x2'));var fs=require('fs');var Redis=require(_0x31e6('0x3'));var db=require(_0x31e6('0x4'))['db'];var utils=require(_0x31e6('0x5'));var logger=require(_0x31e6('0x6'))('rpc');var config=require(_0x31e6('0x7'));var jayson=require(_0x31e6('0x8'));var client=jayson[_0x31e6('0x9')][_0x31e6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x510124,_0x577ad5,_0x43b1d1){return new BPromise(function(_0x2dd77c,_0x333ae6){return client[_0x31e6('0xb')](_0x510124,_0x43b1d1)[_0x31e6('0xc')](function(_0x4e280d){logger[_0x31e6('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x577ad5,'request\x20sent');logger[_0x31e6('0xe')](_0x31e6('0xf'),_0x577ad5,_0x31e6('0x10'),JSON[_0x31e6('0x11')](_0x4e280d));if(_0x4e280d['error']){if(_0x4e280d[_0x31e6('0x12')][_0x31e6('0x13')]===0x1f4){logger[_0x31e6('0x12')](_0x31e6('0x14'),_0x577ad5,_0x4e280d[_0x31e6('0x12')][_0x31e6('0x15')]);return _0x333ae6(_0x4e280d[_0x31e6('0x12')][_0x31e6('0x15')]);}logger[_0x31e6('0x12')](_0x31e6('0x14'),_0x577ad5,_0x4e280d[_0x31e6('0x12')][_0x31e6('0x15')]);return _0x2dd77c(_0x4e280d[_0x31e6('0x12')][_0x31e6('0x15')]);}else{logger[_0x31e6('0xd')](_0x31e6('0x14'),_0x577ad5,_0x31e6('0x10'));_0x2dd77c(_0x4e280d[_0x31e6('0x16')]['message']);}})[_0x31e6('0x17')](function(_0x11268e){logger[_0x31e6('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x577ad5,_0x11268e);_0x333ae6(_0x11268e);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 658da2d..2e80e92 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 _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 +var _0x5d17=['create','put','/:id','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','isAuthenticated','show','post'];(function(_0x29b7d0,_0x180edf){var _0xbeb0b=function(_0x375188){while(--_0x375188){_0x29b7d0['push'](_0x29b7d0['shift']());}};_0xbeb0b(++_0x180edf);}(_0x5d17,0x114));var _0x75d1=function(_0x8686c9,_0x305a8f){_0x8686c9=_0x8686c9-0x0;var _0x1dc90c=_0x5d17[_0x8686c9];return _0x1dc90c;};'use strict';var multer=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75d1('0x2'));var router=express[_0x75d1('0x3')]();var fs_extra=require(_0x75d1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var controller=require(_0x75d1('0x7'));router[_0x75d1('0x8')]('/:id',auth[_0x75d1('0x9')](),controller[_0x75d1('0xa')]);router[_0x75d1('0xb')]('/',auth[_0x75d1('0x9')](),controller[_0x75d1('0xc')]);router[_0x75d1('0xd')](_0x75d1('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x75d1('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x75d1('0x10')]);module[_0x75d1('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index c4734af..b99d918 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 _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 +var _0xe5ac=['sequelize','exports','name','STRING','ENUM','beepall'];(function(_0x57c750,_0x3ca2c1){var _0x56dcba=function(_0x104134){while(--_0x104134){_0x57c750['push'](_0x57c750['shift']());}};_0x56dcba(++_0x3ca2c1);}(_0xe5ac,0x9c));var _0xce5a=function(_0x4b5740,_0x1689d2){_0x4b5740=_0x4b5740-0x0;var _0x49aa07=_0xe5ac[_0x4b5740];return _0x49aa07;};'use strict';var Sequelize=require(_0xce5a('0x0'));module[_0xce5a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xce5a('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xce5a('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xce5a('0x4')]('rrmemory',_0xce5a('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 903e85b..678f582 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 _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 +var _0x3d48=['message','ChatQueue,\x20%s,\x20%s','info','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','update','destroy','get','ChatQueues','stack','name','index','map','ChatQueue','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','include','findAll','rows','params','rawAttributes','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','describe','getMembers','UserChatQueue','ChatQueueId','UserId','agent','updatedAt','format','%s/%s','SIP','chatPause','createdAt','getTeams','findOne','Team','ids','User','online','voicePause','Agents','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','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','removeAgents','userChatQueue:remove','addAgents','omit','userChatQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','request','then','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5d5378,_0x3d083e){var _0x46fa19=function(_0x726a3d){while(--_0x726a3d){_0x5d5378['push'](_0x5d5378['shift']());}};_0x46fa19(++_0x3d083e);}(_0x3d48,0x1a0));var _0x83d4=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x3d48[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x83d4('0x0'));var zipdir=require(_0x83d4('0x1'));var jsonpatch=require(_0x83d4('0x2'));var rp=require('request-promise');var moment=require(_0x83d4('0x3'));var BPromise=require(_0x83d4('0x4'));var Mustache=require(_0x83d4('0x5'));var util=require(_0x83d4('0x6'));var path=require(_0x83d4('0x7'));var sox=require(_0x83d4('0x8'));var csv=require(_0x83d4('0x9'));var ejs=require(_0x83d4('0xa'));var fs=require('fs');var fs_extra=require(_0x83d4('0xb'));var _=require(_0x83d4('0xc'));var squel=require(_0x83d4('0xd'));var crypto=require('crypto');var jsforce=require(_0x83d4('0xe'));var deskjs=require(_0x83d4('0xf'));var toCsv=require(_0x83d4('0x9'));var querystring=require(_0x83d4('0x10'));var Papa=require(_0x83d4('0x11'));var Redis=require(_0x83d4('0x12'));var authService=require(_0x83d4('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x83d4('0x14'));var hardwareService=require(_0x83d4('0x15'));var logger=require(_0x83d4('0x16'))(_0x83d4('0x17'));var utils=require(_0x83d4('0x18'));var config=require(_0x83d4('0x19'));var licenseUtil=require(_0x83d4('0x1a'));var db=require(_0x83d4('0x1b'))['db'];config[_0x83d4('0x1c')]=_[_0x83d4('0x1d')](config['redis'],{'host':_0x83d4('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x83d4('0x1f'))[_0x83d4('0x20')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x575ce7,_0x48471a,_0x5b1955,_0x9adfbc){return new BPromise(function(_0x190de6,_0x10ba2e){var _0x345cc8=_0x9adfbc||client;return _0x345cc8[_0x83d4('0x21')](_0x575ce7,_0x5b1955)[_0x83d4('0x22')](function(_0x5afeec){logger['info']('ChatQueue,\x20%s,\x20%s',_0x48471a,_0x83d4('0x23'));logger[_0x83d4('0x24')](_0x83d4('0x25'),_0x48471a,'request\x20sent',JSON[_0x83d4('0x26')](_0x5afeec));if(_0x5afeec[_0x83d4('0x27')]){if(_0x5afeec['error']['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x48471a,_0x5afeec['error'][_0x83d4('0x28')]);return _0x10ba2e(_0x5afeec[_0x83d4('0x27')][_0x83d4('0x28')]);}logger['error'](_0x83d4('0x29'),_0x48471a,_0x5afeec[_0x83d4('0x27')][_0x83d4('0x28')]);return _0x190de6(_0x5afeec[_0x83d4('0x27')][_0x83d4('0x28')]);}else{logger[_0x83d4('0x2a')](_0x83d4('0x29'),_0x48471a,_0x83d4('0x23'));_0x190de6(_0x5afeec['result'][_0x83d4('0x28')]);}})[_0x83d4('0x2b')](function(_0x1a6a39){logger[_0x83d4('0x27')](_0x83d4('0x29'),_0x48471a,_0x1a6a39);_0x10ba2e(_0x1a6a39);});});}function respondWithStatusCode(_0x4ddc4c,_0x9a0e77){_0x9a0e77=_0x9a0e77||0xcc;return function(_0x58d045){if(_0x58d045){return _0x4ddc4c[_0x83d4('0x2c')](_0x9a0e77);}return _0x4ddc4c[_0x83d4('0x2d')](_0x9a0e77)[_0x83d4('0x2e')]();};}function respondWithResult(_0x2ea4b3,_0x45f14e){_0x45f14e=_0x45f14e||0xc8;return function(_0x14e0c9){if(_0x14e0c9){return _0x2ea4b3[_0x83d4('0x2d')](_0x45f14e)['json'](_0x14e0c9);}};}function respondWithFilteredResult(_0x72451c,_0x140d31){return function(_0x126be9){if(_0x126be9){var _0x78e0c4=typeof _0x140d31[_0x83d4('0x2f')]===_0x83d4('0x30')&&typeof _0x140d31[_0x83d4('0x31')]===_0x83d4('0x30');var _0x3e447b=_0x126be9[_0x83d4('0x32')];var _0x3b9c72=_0x78e0c4?0x0:_0x140d31['offset'];var _0x32869a=_0x78e0c4?_0x126be9[_0x83d4('0x32')]:_0x140d31[_0x83d4('0x2f')]+_0x140d31['limit'];var _0x107241;if(_0x32869a>=_0x3e447b){_0x32869a=_0x3e447b;_0x107241=0xc8;}else{_0x107241=0xce;}_0x72451c[_0x83d4('0x2d')](_0x107241);return _0x72451c['set'](_0x83d4('0x33'),_0x3b9c72+'-'+_0x32869a+'/'+_0x3e447b)['json'](_0x126be9);}return null;};}function patchUpdates(_0x31f4b5){return function(_0x2d446a){try{jsonpatch['apply'](_0x2d446a,_0x31f4b5,!![]);}catch(_0x2e1f73){return BPromise[_0x83d4('0x34')](_0x2e1f73);}return _0x2d446a['save']();};}function saveUpdates(_0xebb1bd,_0x252919){return function(_0x72580a){if(_0x72580a){return _0x72580a[_0x83d4('0x35')](_0xebb1bd)[_0x83d4('0x22')](function(_0x10ca5b){return _0x10ca5b;});}return null;};}function removeEntity(_0x530687,_0x4898dc){return function(_0x2f3140){if(_0x2f3140){return _0x2f3140[_0x83d4('0x36')]()[_0x83d4('0x22')](function(){var _0x40b6b5=_0x2f3140[_0x83d4('0x37')]({'plain':!![]});var _0x3d4685=_0x83d4('0x38');return db['UserProfileResource'][_0x83d4('0x36')]({'where':{'type':_0x3d4685,'resourceId':_0x40b6b5['id']}})[_0x83d4('0x22')](function(){return _0x2f3140;});})[_0x83d4('0x22')](function(){_0x530687[_0x83d4('0x2d')](0xcc)[_0x83d4('0x2e')]();});}};}function handleEntityNotFound(_0x129375,_0x27d5fb){return function(_0x25dd7b){if(!_0x25dd7b){_0x129375[_0x83d4('0x2c')](0x194);}return _0x25dd7b;};}function handleError(_0x185647,_0x1854b5){_0x1854b5=_0x1854b5||0x1f4;return function(_0x358733){logger[_0x83d4('0x27')](_0x358733[_0x83d4('0x39')]);if(_0x358733[_0x83d4('0x3a')]){delete _0x358733['name'];}_0x185647['status'](_0x1854b5)['send'](_0x358733);};}exports[_0x83d4('0x3b')]=function(_0x50adb5,_0xe8899e){var _0xa4c237={},_0x18851b={},_0x1a6f67={'count':0x0,'rows':[]};var _0x4bd9ea=_[_0x83d4('0x3c')](db[_0x83d4('0x3d')]['rawAttributes'],function(_0x3a6e06){return{'name':_0x3a6e06['fieldName'],'type':_0x3a6e06['type'][_0x83d4('0x3e')]};});_0x18851b[_0x83d4('0x3f')]=_['map'](_0x4bd9ea,_0x83d4('0x3a'));_0x18851b[_0x83d4('0x40')]=_[_0x83d4('0x41')](_0x50adb5[_0x83d4('0x40')]);_0x18851b[_0x83d4('0x42')]=_[_0x83d4('0x43')](_0x18851b[_0x83d4('0x3f')],_0x18851b['query']);_0xa4c237[_0x83d4('0x44')]=_[_0x83d4('0x43')](_0x18851b['model'],qs[_0x83d4('0x45')](_0x50adb5['query']['fields']));_0xa4c237[_0x83d4('0x44')]=_0xa4c237[_0x83d4('0x44')][_0x83d4('0x46')]?_0xa4c237[_0x83d4('0x44')]:_0x18851b[_0x83d4('0x3f')];if(!_0x50adb5['query'][_0x83d4('0x47')](_0x83d4('0x48'))){_0xa4c237[_0x83d4('0x31')]=qs[_0x83d4('0x31')](_0x50adb5[_0x83d4('0x40')][_0x83d4('0x31')]);_0xa4c237['offset']=qs[_0x83d4('0x2f')](_0x50adb5[_0x83d4('0x40')][_0x83d4('0x2f')]);}_0xa4c237[_0x83d4('0x49')]=qs['sort'](_0x50adb5[_0x83d4('0x40')][_0x83d4('0x4a')]);_0xa4c237[_0x83d4('0x4b')]=qs[_0x83d4('0x42')](_[_0x83d4('0x4c')](_0x50adb5[_0x83d4('0x40')],_0x18851b['filters']),_0x4bd9ea);if(_0x50adb5[_0x83d4('0x40')]['filter']){_0xa4c237[_0x83d4('0x4b')]=_['merge'](_0xa4c237['where'],{'$or':_[_0x83d4('0x3c')](_0x4bd9ea,function(_0x2247bc){if(_0x2247bc[_0x83d4('0x4d')]!==_0x83d4('0x4e')){var _0x175ac1={};_0x175ac1[_0x2247bc[_0x83d4('0x3a')]]={'$like':'%'+_0x50adb5[_0x83d4('0x40')][_0x83d4('0x4f')]+'%'};return _0x175ac1;}})});}_0xa4c237=_[_0x83d4('0x50')]({},_0xa4c237,_0x50adb5['options']);var _0x34f450={'where':_0xa4c237[_0x83d4('0x4b')]};return db[_0x83d4('0x3d')][_0x83d4('0x32')](_0x34f450)['then'](function(_0x1cc9d2){_0x1a6f67[_0x83d4('0x32')]=_0x1cc9d2;if(_0x50adb5[_0x83d4('0x40')]['includeAll']){_0xa4c237[_0x83d4('0x51')]=[{'all':!![]}];}return db[_0x83d4('0x3d')][_0x83d4('0x52')](_0xa4c237);})[_0x83d4('0x22')](function(_0x1ec382){_0x1a6f67[_0x83d4('0x53')]=_0x1ec382;return _0x1a6f67;})[_0x83d4('0x22')](respondWithFilteredResult(_0xe8899e,_0xa4c237))[_0x83d4('0x2b')](handleError(_0xe8899e,null));};exports['show']=function(_0x2b6551,_0x500353){var _0x262984={'raw':!![],'where':{'id':_0x2b6551[_0x83d4('0x54')]['id']}},_0x49eaea={};_0x49eaea[_0x83d4('0x3f')]=_[_0x83d4('0x41')](db[_0x83d4('0x3d')][_0x83d4('0x55')]);_0x49eaea['query']=_[_0x83d4('0x41')](_0x2b6551[_0x83d4('0x40')]);_0x49eaea[_0x83d4('0x42')]=_[_0x83d4('0x43')](_0x49eaea[_0x83d4('0x3f')],_0x49eaea[_0x83d4('0x40')]);_0x262984['attributes']=_['intersection'](_0x49eaea[_0x83d4('0x3f')],qs['fields'](_0x2b6551[_0x83d4('0x40')][_0x83d4('0x45')]));_0x262984[_0x83d4('0x44')]=_0x262984[_0x83d4('0x44')]['length']?_0x262984[_0x83d4('0x44')]:_0x49eaea[_0x83d4('0x3f')];if(_0x2b6551['query'][_0x83d4('0x56')]){_0x262984[_0x83d4('0x51')]=[{'all':!![]}];}_0x262984=_[_0x83d4('0x50')]({},_0x262984,_0x2b6551[_0x83d4('0x57')]);return db[_0x83d4('0x3d')]['find'](_0x262984)[_0x83d4('0x22')](handleEntityNotFound(_0x500353,null))[_0x83d4('0x22')](respondWithResult(_0x500353,null))[_0x83d4('0x2b')](handleError(_0x500353,null));};exports['create']=function(_0x2fd9a6,_0xfc12c){return db[_0x83d4('0x3d')][_0x83d4('0x58')](_0x2fd9a6[_0x83d4('0x59')],{})[_0x83d4('0x22')](function(_0x402e2e){var _0x123fa2=_0x2fd9a6[_0x83d4('0x5a')][_0x83d4('0x37')]({'plain':!![]});if(!_0x123fa2)throw new Error(_0x83d4('0x5b'));if(_0x123fa2[_0x83d4('0x5c')]===_0x83d4('0x5a')){var _0x2871da=_0x402e2e[_0x83d4('0x37')]({'plain':!![]});var _0x253e28=_0x83d4('0x38');return db[_0x83d4('0x5d')][_0x83d4('0x5e')]({'where':{'name':_0x253e28,'userProfileId':_0x123fa2[_0x83d4('0x5f')]},'raw':!![]})[_0x83d4('0x22')](function(_0x5d991a){if(_0x5d991a&&_0x5d991a['autoAssociation']===0x0){return db[_0x83d4('0x60')][_0x83d4('0x58')]({'name':_0x2871da[_0x83d4('0x3a')],'resourceId':_0x2871da['id'],'type':_0x5d991a['name'],'sectionId':_0x5d991a['id']},{})[_0x83d4('0x22')](function(){return _0x402e2e;});}else{return _0x402e2e;}})[_0x83d4('0x2b')](function(_0x209129){logger[_0x83d4('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x209129);throw _0x209129;});}return _0x402e2e;})[_0x83d4('0x22')](respondWithResult(_0xfc12c,0xc9))[_0x83d4('0x2b')](handleError(_0xfc12c,null));};exports[_0x83d4('0x35')]=function(_0x2fa6d6,_0x2beea7){if(_0x2fa6d6[_0x83d4('0x59')]['id']){delete _0x2fa6d6['body']['id'];}return db['ChatQueue']['find']({'where':{'id':_0x2fa6d6[_0x83d4('0x54')]['id']}})[_0x83d4('0x22')](handleEntityNotFound(_0x2beea7,null))[_0x83d4('0x22')](saveUpdates(_0x2fa6d6[_0x83d4('0x59')],null))[_0x83d4('0x22')](respondWithResult(_0x2beea7,null))[_0x83d4('0x2b')](handleError(_0x2beea7,null));};exports[_0x83d4('0x36')]=function(_0x336546,_0x35c5e4){return db['ChatQueue'][_0x83d4('0x5e')]({'where':{'id':_0x336546[_0x83d4('0x54')]['id']}})[_0x83d4('0x22')](handleEntityNotFound(_0x35c5e4,null))[_0x83d4('0x22')](removeEntity(_0x35c5e4,null))[_0x83d4('0x2b')](handleError(_0x35c5e4,null));};exports[_0x83d4('0x61')]=function(_0xab3029,_0x2e9e89){return db[_0x83d4('0x3d')]['describe']()[_0x83d4('0x22')](respondWithResult(_0x2e9e89,null))[_0x83d4('0x2b')](handleError(_0x2e9e89,null));};exports[_0x83d4('0x62')]=function(_0x474fe,_0x3cd833,_0x220978){var _0x3b60c8={'raw':!![],'where':{}},_0x12e584={},_0x1ab963;return db['ChatQueue']['findOne']({'where':{'id':_0x474fe['params']['id']}})[_0x83d4('0x22')](handleEntityNotFound(_0x3cd833,null))[_0x83d4('0x22')](function(_0x3354a4){if(_0x3354a4){_0x1ab963=_0x3354a4[_0x83d4('0x37')]({'plain':!![]});_0x12e584[_0x83d4('0x3f')]=_[_0x83d4('0x41')](db[_0x83d4('0x63')][_0x83d4('0x55')]);_0x12e584['query']=_[_0x83d4('0x41')](_0x474fe[_0x83d4('0x40')]);_0x12e584[_0x83d4('0x42')]=_[_0x83d4('0x43')](_0x12e584[_0x83d4('0x3f')],_0x12e584[_0x83d4('0x40')]);_0x3b60c8['attributes']=_[_0x83d4('0x43')](_0x12e584[_0x83d4('0x3f')],qs[_0x83d4('0x45')](_0x474fe[_0x83d4('0x40')][_0x83d4('0x45')]));_0x3b60c8[_0x83d4('0x44')]=_0x3b60c8[_0x83d4('0x44')][_0x83d4('0x46')]?_0x3b60c8[_0x83d4('0x44')]:_0x12e584['model'];if(!_0x474fe[_0x83d4('0x40')]['hasOwnProperty'](_0x83d4('0x48'))){_0x3b60c8[_0x83d4('0x31')]=qs[_0x83d4('0x31')](_0x474fe[_0x83d4('0x40')]['limit']);_0x3b60c8[_0x83d4('0x2f')]=qs[_0x83d4('0x2f')](_0x474fe['query'][_0x83d4('0x2f')]);}_0x3b60c8[_0x83d4('0x49')]=qs[_0x83d4('0x4a')](_0x474fe[_0x83d4('0x40')][_0x83d4('0x4a')]);_0x3b60c8[_0x83d4('0x4b')]=qs[_0x83d4('0x42')](_[_0x83d4('0x4c')](_0x474fe[_0x83d4('0x40')],_0x12e584[_0x83d4('0x42')]));_0x3b60c8['where'][_0x83d4('0x64')]=_0x3354a4['id'];if(_0x474fe['query'][_0x83d4('0x4f')]){_0x3b60c8['where']=_['merge'](_0x3b60c8[_0x83d4('0x4b')],{'$or':_[_0x83d4('0x3c')](_0x3b60c8[_0x83d4('0x44')],function(_0x294acb){var _0x29e2ed={};_0x29e2ed[_0x294acb]={'$like':'%'+_0x474fe[_0x83d4('0x40')]['filter']+'%'};return _0x29e2ed;})});}_0x3b60c8=_[_0x83d4('0x50')]({},_0x3b60c8,_0x474fe['options']);return db['UserChatQueue'][_0x83d4('0x52')](_0x3b60c8);}})[_0x83d4('0x22')](function(_0x20c163){if(_0x20c163){return db['User']['findAndCountAll']({'where':{'id':_[_0x83d4('0x3c')](_0x20c163,_0x83d4('0x65')),'role':_0x83d4('0x66')},'attributes':['id',_0x83d4('0x3a'),'chatPause',_0x83d4('0x67'),'createdAt']});}})['then'](function(_0x4985b4){if(_0x4985b4){return{'count':_0x4985b4['count'],'rows':_['map'](_0x4985b4[_0x83d4('0x53')],function(_0x5700cc){return{'membername':_0x5700cc['name'],'UserId':_0x5700cc['id'],'queue_name':_0x1ab963[_0x83d4('0x3a')],'ChatQueueId':_0x1ab963['id'],'interface':util[_0x83d4('0x68')](_0x83d4('0x69'),_0x83d4('0x6a'),_0x5700cc[_0x83d4('0x3a')]),'penalty':0x0,'paused':_0x5700cc[_0x83d4('0x6b')],'createdAt':_0x5700cc[_0x83d4('0x6c')],'updatedAt':_0x5700cc[_0x83d4('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3cd833,_0x3b60c8))[_0x83d4('0x2b')](handleError(_0x3cd833,null));};exports[_0x83d4('0x6d')]=function(_0x1b54f4,_0xa828c7,_0xd32c7e){var _0x1e12c8={};var _0x5adb65={};var _0x165998;var _0x50f685;return db[_0x83d4('0x3d')][_0x83d4('0x6e')]({'where':{'id':_0x1b54f4[_0x83d4('0x54')]['id']}})['then'](handleEntityNotFound(_0xa828c7,null))[_0x83d4('0x22')](function(_0x2f56b2){if(_0x2f56b2){_0x165998=_0x2f56b2;_0x5adb65[_0x83d4('0x3f')]=_[_0x83d4('0x41')](db[_0x83d4('0x6f')][_0x83d4('0x55')]);_0x5adb65['query']=_[_0x83d4('0x41')](_0x1b54f4[_0x83d4('0x40')]);_0x5adb65['filters']=_[_0x83d4('0x43')](_0x5adb65[_0x83d4('0x3f')],_0x5adb65[_0x83d4('0x40')]);_0x1e12c8[_0x83d4('0x44')]=_[_0x83d4('0x43')](_0x5adb65[_0x83d4('0x3f')],qs[_0x83d4('0x45')](_0x1b54f4[_0x83d4('0x40')][_0x83d4('0x45')]));_0x1e12c8[_0x83d4('0x44')]=_0x1e12c8['attributes'][_0x83d4('0x46')]?_0x1e12c8[_0x83d4('0x44')]:_0x5adb65[_0x83d4('0x3f')];_0x1e12c8[_0x83d4('0x49')]=qs[_0x83d4('0x4a')](_0x1b54f4[_0x83d4('0x40')]['sort']);_0x1e12c8[_0x83d4('0x4b')]=qs['filters'](_['pick'](_0x1b54f4[_0x83d4('0x40')],_0x5adb65[_0x83d4('0x42')]));if(_0x1b54f4[_0x83d4('0x40')][_0x83d4('0x4f')]){_0x1e12c8['where']=_[_0x83d4('0x50')](_0x1e12c8['where'],{'$or':_[_0x83d4('0x3c')](_0x1e12c8[_0x83d4('0x44')],function(_0x43625d){var _0xb7d84={};_0xb7d84[_0x43625d]={'$like':'%'+_0x1b54f4[_0x83d4('0x40')][_0x83d4('0x4f')]+'%'};return _0xb7d84;})});}_0x1e12c8=_[_0x83d4('0x50')]({},_0x1e12c8,_0x1b54f4[_0x83d4('0x57')]);return _0x165998[_0x83d4('0x6d')](_0x1e12c8);}})[_0x83d4('0x22')](function(_0x588a66){if(_0x588a66){_0x50f685=_0x588a66['length'];if(!_0x1b54f4[_0x83d4('0x40')][_0x83d4('0x47')](_0x83d4('0x48'))){_0x1e12c8[_0x83d4('0x31')]=qs['limit'](_0x1b54f4[_0x83d4('0x40')]['limit']);_0x1e12c8[_0x83d4('0x2f')]=qs[_0x83d4('0x2f')](_0x1b54f4['query'][_0x83d4('0x2f')]);}return _0x165998['getTeams'](_0x1e12c8);}})[_0x83d4('0x22')](function(_0x41eca4){if(_0x41eca4){return _0x41eca4?{'count':_0x50f685,'rows':_0x41eca4}:null;}})[_0x83d4('0x22')](respondWithResult(_0xa828c7,null))[_0x83d4('0x2b')](handleError(_0xa828c7,null));};exports['addTeams']=function(_0x33000e,_0x32068a,_0x20a529){var _0x2355ab=_0x33000e[_0x83d4('0x59')][_0x83d4('0x70')];return db['Team'][_0x83d4('0x52')]({'where':{'id':_0x2355ab},'attributes':['id'],'include':[{'model':db[_0x83d4('0x71')],'as':'Agents','attributes':['id','name',_0x83d4('0x72'),_0x83d4('0x73'),'interface'],'raw':!![]}]})[_0x83d4('0x22')](function(_0x598b70){if(_0x598b70){var _0x4aa8ed=_['flatMap'](_0x598b70,function(_0x736606){var _0x309a9b=_0x736606[_0x83d4('0x37')]({'plain':!![]});return _0x309a9b[_0x83d4('0x74')];});return db[_0x83d4('0x3d')]['find']({'where':{'id':_0x33000e[_0x83d4('0x54')]['id']}})['then'](function(_0x15b88c){return db[_0x83d4('0x75')][_0x83d4('0x76')](function(_0x3e65ea){return _0x15b88c[_0x83d4('0x77')](_0x2355ab,{'transaction':_0x3e65ea})[_0x83d4('0x22')](function(){return BPromise[_0x83d4('0x78')](_0x4aa8ed,function(_0x5937f5){return db[_0x83d4('0x63')][_0x83d4('0x79')]({'where':{'UserId':_0x5937f5['id'],'ChatQueueId':_0x33000e[_0x83d4('0x54')]['id']},'transaction':_0x3e65ea});});})[_0x83d4('0x22')](function(){_0x4aa8ed[_0x83d4('0x7a')](function(_0x11eeb3){socket[_0x83d4('0x7b')]('userChatQueue:save',{'UserId':_0x11eeb3['id'],'ChatQueueId':_0x15b88c['id']});});});});});}})[_0x83d4('0x22')](respondWithStatusCode(_0x32068a,null))[_0x83d4('0x2b')](handleError(_0x32068a,null));};exports[_0x83d4('0x7c')]=function(_0x11a99c,_0x15ba00,_0xc09882){return db[_0x83d4('0x6f')][_0x83d4('0x52')]({'where':{'id':_0x11a99c['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x83d4('0x71')],'as':_0x83d4('0x74'),'attributes':['id'],'raw':!![]}]})[_0x83d4('0x22')](handleEntityNotFound(_0x15ba00,null))[_0x83d4('0x22')](function(_0x589e71){var _0x160dbe=_['map'](_0x589e71,'id');var _0x1cff7f=[];var _0x4a69ba=[];var _0xb78332=squel[_0x83d4('0x7d')]();_0xb78332[_0x83d4('0x7e')](_0x83d4('0x7f'))[_0x83d4('0x80')](_0x83d4('0x81'),'tq')[_0x83d4('0x82')](_0x83d4('0x83'),'ut',_0x83d4('0x84'))[_0x83d4('0x4b')](_0x83d4('0x85'),_0x11a99c[_0x83d4('0x54')]['id']);for(var _0x15726f=0x0;_0x15726f<_0x589e71[_0x83d4('0x46')];_0x15726f+=0x1){let _0x15f0d5=_0x589e71[_0x15726f];for(var _0x5c78de=0x0;_0x5c78de<_0x15f0d5['Agents'][_0x83d4('0x46')];_0x5c78de+=0x1){let _0x59d1f2=_0x15f0d5[_0x83d4('0x74')][_0x5c78de];var _0x4b8211=_0xb78332[_0x83d4('0x86')]();_0x4b8211[_0x83d4('0x4b')](_0x83d4('0x87'),_0x59d1f2['id']);_0x4a69ba[_0x83d4('0x88')](db[_0x83d4('0x75')][_0x83d4('0x40')](_0x4b8211[_0x83d4('0x89')](),{'type':db[_0x83d4('0x75')]['QueryTypes'][_0x83d4('0x8a')]})[_0x83d4('0x22')](function(_0x449cb4){if(_0x449cb4[_0x83d4('0x46')]===0x1){return _0x59d1f2['id'];}else{var _0x1a1145=_[_0x83d4('0x8b')](_[_0x83d4('0x3c')](_0x449cb4,_0x83d4('0x8c')),function(_0x38ae42){return _[_0x83d4('0x8d')](_0x160dbe,_0x38ae42);});if(_0x1a1145){return _0x59d1f2['id'];}}}));}}return BPromise[_0x83d4('0x8e')](_0x4a69ba)[_0x83d4('0x22')](function(_0x52ff9e){_0x1cff7f=_(_0x1cff7f)[_0x83d4('0x8f')](_0x52ff9e)[_0x83d4('0x90')]()['value']();return db[_0x83d4('0x3d')]['find']({'where':{'id':_0x11a99c['params']['id']}})[_0x83d4('0x22')](function(_0x182ba6){return db[_0x83d4('0x75')][_0x83d4('0x76')](function(_0x2d9a12){return _0x182ba6[_0x83d4('0x7c')](_0x11a99c[_0x83d4('0x40')]['ids'],{'transaction':_0x2d9a12})[_0x83d4('0x22')](function(){if(!_['isEmpty'](_0x1cff7f)){return _0x182ba6[_0x83d4('0x91')](_0x1cff7f,{'transaction':_0x2d9a12});}})['then'](function(){_0x1cff7f[_0x83d4('0x7a')](function(_0x5d1ca7){socket[_0x83d4('0x7b')](_0x83d4('0x92'),{'UserId':_0x5d1ca7,'ChatQueueId':_0x182ba6['id']});});});});});});})[_0x83d4('0x22')](respondWithStatusCode(_0x15ba00,null))[_0x83d4('0x2b')](handleError(_0x15ba00,null));};exports[_0x83d4('0x93')]=function(_0x31ae43,_0xeb6b2,_0x10d439){return db[_0x83d4('0x3d')][_0x83d4('0x5e')]({'where':{'id':_0x31ae43[_0x83d4('0x54')]['id']}})[_0x83d4('0x22')](handleEntityNotFound(_0xeb6b2,null))['then'](function(_0x550a34){if(_0x550a34){return _0x550a34[_0x83d4('0x93')](_0x31ae43[_0x83d4('0x59')][_0x83d4('0x70')],_[_0x83d4('0x94')](_0x31ae43[_0x83d4('0x59')],[_0x83d4('0x70'),'id'])||{})['spread'](function(_0x305d7c){for(var _0x22c625=0x0;_0x22c625<_0x31ae43[_0x83d4('0x59')][_0x83d4('0x70')]['length'];_0x22c625+=0x1){socket[_0x83d4('0x7b')](_0x83d4('0x95'),{'UserId':Number(_0x31ae43[_0x83d4('0x59')][_0x83d4('0x70')][_0x22c625]),'ChatQueueId':Number(_0x31ae43[_0x83d4('0x54')]['id'])});}return _0x305d7c;});}})[_0x83d4('0x22')](respondWithResult(_0xeb6b2,null))[_0x83d4('0x2b')](handleError(_0xeb6b2,null));};exports[_0x83d4('0x91')]=function(_0x3f8637,_0x2cb5f7,_0x420f4b){return db[_0x83d4('0x3d')][_0x83d4('0x5e')]({'where':{'id':_0x3f8637[_0x83d4('0x54')]['id']}})[_0x83d4('0x22')](handleEntityNotFound(_0x2cb5f7,null))[_0x83d4('0x22')](function(_0x58bf84){if(_0x58bf84){return _0x58bf84[_0x83d4('0x91')](_0x3f8637[_0x83d4('0x40')][_0x83d4('0x70')])[_0x83d4('0x22')](function(){if(_[_0x83d4('0x96')](_0x3f8637[_0x83d4('0x40')][_0x83d4('0x70')])){for(var _0x5a6a06=0x0;_0x5a6a06<_0x3f8637['query']['ids'][_0x83d4('0x46')];_0x5a6a06+=0x1){socket[_0x83d4('0x7b')](_0x83d4('0x92'),{'UserId':Number(_0x3f8637[_0x83d4('0x40')][_0x83d4('0x70')][_0x5a6a06]),'ChatQueueId':Number(_0x3f8637[_0x83d4('0x54')]['id'])});}}else{socket['emit'](_0x83d4('0x92'),{'UserId':Number(_0x3f8637[_0x83d4('0x40')][_0x83d4('0x70')]),'ChatQueueId':Number(_0x3f8637[_0x83d4('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x2cb5f7,null))['catch'](handleError(_0x2cb5f7,null));};exports['getAgents']=function(_0x29e982,_0x31fc87,_0x576937){var _0x2dcbd3={};var _0x597e93={};var _0x3c1fef;var _0x9e9e70;return db[_0x83d4('0x3d')][_0x83d4('0x6e')]({'where':{'id':_0x29e982[_0x83d4('0x54')]['id']}})[_0x83d4('0x22')](handleEntityNotFound(_0x31fc87,null))[_0x83d4('0x22')](function(_0x5cf27a){if(_0x5cf27a){_0x3c1fef=_0x5cf27a;_0x597e93[_0x83d4('0x3f')]=_[_0x83d4('0x41')](db['User']['rawAttributes']);_0x597e93[_0x83d4('0x40')]=_[_0x83d4('0x41')](_0x29e982[_0x83d4('0x40')]);_0x597e93[_0x83d4('0x42')]=_[_0x83d4('0x43')](_0x597e93['model'],_0x597e93['query']);_0x2dcbd3[_0x83d4('0x44')]=_[_0x83d4('0x43')](_0x597e93[_0x83d4('0x3f')],qs[_0x83d4('0x45')](_0x29e982['query'][_0x83d4('0x45')]));_0x2dcbd3[_0x83d4('0x44')]=_0x2dcbd3['attributes']['length']?_0x2dcbd3[_0x83d4('0x44')]:_0x597e93[_0x83d4('0x3f')];_0x2dcbd3[_0x83d4('0x49')]=qs[_0x83d4('0x4a')](_0x29e982[_0x83d4('0x40')][_0x83d4('0x4a')]);_0x2dcbd3[_0x83d4('0x4b')]=qs[_0x83d4('0x42')](_[_0x83d4('0x4c')](_0x29e982[_0x83d4('0x40')],_0x597e93[_0x83d4('0x42')]));if(_0x29e982[_0x83d4('0x40')][_0x83d4('0x4f')]){_0x2dcbd3[_0x83d4('0x4b')]=_[_0x83d4('0x50')](_0x2dcbd3[_0x83d4('0x4b')],{'$or':_[_0x83d4('0x3c')](_0x2dcbd3[_0x83d4('0x44')],function(_0x20b07f){var _0x361e49={};_0x361e49[_0x20b07f]={'$like':'%'+_0x29e982[_0x83d4('0x40')][_0x83d4('0x4f')]+'%'};return _0x361e49;})});}_0x2dcbd3=_['merge']({},_0x2dcbd3,_0x29e982[_0x83d4('0x57')]);return _0x3c1fef[_0x83d4('0x97')](_0x2dcbd3);}})[_0x83d4('0x22')](function(_0x521eee){if(_0x521eee){_0x9e9e70=_0x521eee['length'];if(!_0x29e982[_0x83d4('0x40')][_0x83d4('0x47')](_0x83d4('0x48'))){_0x2dcbd3[_0x83d4('0x31')]=qs[_0x83d4('0x31')](_0x29e982[_0x83d4('0x40')][_0x83d4('0x31')]);_0x2dcbd3[_0x83d4('0x2f')]=qs[_0x83d4('0x2f')](_0x29e982[_0x83d4('0x40')][_0x83d4('0x2f')]);}return _0x3c1fef[_0x83d4('0x97')](_0x2dcbd3);}})[_0x83d4('0x22')](function(_0x3156c0){if(_0x3156c0){return _0x3156c0?{'count':_0x9e9e70,'rows':_0x3156c0}:null;}})[_0x83d4('0x22')](respondWithResult(_0x31fc87,null))[_0x83d4('0x2b')](handleError(_0x31fc87,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index e6214ea..81ce422 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 _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 +var _0x474f=['exports','events','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0x474f,0xac));var _0xf474=function(_0x5725a0,_0x180d50){_0x5725a0=_0x5725a0-0x0;var _0x2eade4=_0x474f[_0x5725a0];return _0x2eade4;};'use strict';var EventEmitter=require(_0xf474('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xf474('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf474('0x2')](0x0);var events={'afterCreate':_0xf474('0x3'),'afterUpdate':_0xf474('0x4'),'afterDestroy':'remove'};function emitEvent(_0x509648){return function(_0x80bdac,_0x27fd05,_0x21e07f){ChatQueueEvents[_0xf474('0x5')](_0x509648+':'+_0x80bdac['id'],_0x80bdac);ChatQueueEvents[_0xf474('0x5')](_0x509648,_0x80bdac);_0x21e07f(null);};}for(var e in events){if(events[_0xf474('0x6')](e)){var event=events[e];ChatQueue[_0xf474('0x7')](e,emitEvent(event));}}module[_0xf474('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index df9f421..e978a0a 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 _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 +var _0x15f5=['chat_queues','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','ChatQueue'];(function(_0x4d1875,_0x5041fb){var _0x4f8f5c=function(_0x2ec54c){while(--_0x2ec54c){_0x4d1875['push'](_0x4d1875['shift']());}};_0x4f8f5c(++_0x5041fb);}(_0x15f5,0xbc));var _0x515f=function(_0x5b78e3,_0x3c5de6){_0x5b78e3=_0x5b78e3-0x0;var _0x55ff10=_0x15f5[_0x5b78e3];return _0x55ff10;};'use strict';var _=require(_0x515f('0x0'));var util=require(_0x515f('0x1'));var logger=require('../../config/logger')(_0x515f('0x2'));var moment=require('moment');var BPromise=require(_0x515f('0x3'));var rp=require(_0x515f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x515f('0x5'));var config=require(_0x515f('0x6'));var attributes=require(_0x515f('0x7'));module[_0x515f('0x8')]=function(_0x240f83,_0x27f22d){return _0x240f83['define'](_0x515f('0x9'),attributes,{'tableName':_0x515f('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 dd1f232..dbc3675 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 _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 +var _0xc8ac=['./chatQueue.socket','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults'];(function(_0xb2c134,_0x3eca93){var _0x120bac=function(_0x261e15){while(--_0x261e15){_0xb2c134['push'](_0xb2c134['shift']());}};_0x120bac(++_0x3eca93);}(_0xc8ac,0xe9));var _0xcc8a=function(_0x184759,_0x1cc38a){_0x184759=_0x184759-0x0;var _0xf26d5f=_0xc8ac[_0x184759];return _0xf26d5f;};'use strict';var _=require(_0xcc8a('0x0'));var util=require(_0xcc8a('0x1'));var moment=require(_0xcc8a('0x2'));var BPromise=require(_0xcc8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcc8a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc8a('0x5'));var logger=require(_0xcc8a('0x6'))(_0xcc8a('0x7'));var config=require(_0xcc8a('0x8'));var jayson=require(_0xcc8a('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xcc8a('0xa')]=_[_0xcc8a('0xb')](config[_0xcc8a('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcc8a('0xa')]));require(_0xcc8a('0xc'))['register'](socket);function respondWithRpcPromise(_0x3fa245,_0x34f02f,_0x510c1d){return new BPromise(function(_0x2c5025,_0x4e175e){return client['request'](_0x3fa245,_0x510c1d)[_0xcc8a('0xd')](function(_0x186896){logger[_0xcc8a('0xe')](_0xcc8a('0xf'),_0x34f02f,_0xcc8a('0x10'));logger[_0xcc8a('0x11')](_0xcc8a('0x12'),_0x34f02f,_0xcc8a('0x10'),JSON[_0xcc8a('0x13')](_0x186896));if(_0x186896[_0xcc8a('0x14')]){if(_0x186896[_0xcc8a('0x14')]['code']===0x1f4){logger[_0xcc8a('0x14')](_0xcc8a('0xf'),_0x34f02f,_0x186896[_0xcc8a('0x14')][_0xcc8a('0x15')]);return _0x4e175e(_0x186896[_0xcc8a('0x14')][_0xcc8a('0x15')]);}logger['error'](_0xcc8a('0xf'),_0x34f02f,_0x186896[_0xcc8a('0x14')][_0xcc8a('0x15')]);return _0x2c5025(_0x186896[_0xcc8a('0x14')][_0xcc8a('0x15')]);}else{logger[_0xcc8a('0xe')](_0xcc8a('0xf'),_0x34f02f,'request\x20sent');_0x2c5025(_0x186896['result'][_0xcc8a('0x15')]);}})[_0xcc8a('0x16')](function(_0x20c29f){logger[_0xcc8a('0x14')]('ChatQueue,\x20%s,\x20%s',_0x34f02f,_0x20c29f);_0x4e175e(_0x20c29f);});});}exports[_0xcc8a('0x17')]=function(_0x4dad7b){var _0x471f1d=this;return new Promise(function(_0x3a2e3d,_0xa76ad9){return db['ChatQueue'][_0xcc8a('0x18')]({'raw':_0x4dad7b[_0xcc8a('0x19')]?_0x4dad7b['options'][_0xcc8a('0x1a')]===undefined?!![]:![]:!![],'where':_0x4dad7b[_0xcc8a('0x19')]?_0x4dad7b[_0xcc8a('0x19')][_0xcc8a('0x1b')]||null:null,'attributes':_0x4dad7b[_0xcc8a('0x19')]?_0x4dad7b['options'][_0xcc8a('0x1c')]||null:null,'limit':_0x4dad7b[_0xcc8a('0x19')]?_0x4dad7b['options'][_0xcc8a('0x1d')]||null:null,'include':_0x4dad7b[_0xcc8a('0x19')]?_0x4dad7b['options'][_0xcc8a('0x1e')]?_[_0xcc8a('0x1f')](_0x4dad7b[_0xcc8a('0x19')][_0xcc8a('0x1e')],function(_0x221841){return{'model':db[_0x221841[_0xcc8a('0x20')]],'as':_0x221841['as'],'attributes':_0x221841[_0xcc8a('0x1c')],'include':_0x221841[_0xcc8a('0x1e')]?_[_0xcc8a('0x1f')](_0x221841[_0xcc8a('0x1e')],function(_0x338351){return{'model':db[_0x338351[_0xcc8a('0x20')]],'as':_0x338351['as'],'attributes':_0x338351['attributes'],'include':_0x338351[_0xcc8a('0x1e')]?_[_0xcc8a('0x1f')](_0x338351['include'],function(_0x41271f){return{'model':db[_0x41271f[_0xcc8a('0x20')]],'as':_0x41271f['as'],'attributes':_0x41271f[_0xcc8a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcc8a('0xd')](function(_0x581ae8){logger[_0xcc8a('0xe')](_0xcc8a('0x17'),_0x4dad7b);logger[_0xcc8a('0x11')](_0xcc8a('0x17'),_0x4dad7b,JSON[_0xcc8a('0x13')](_0x581ae8));_0x3a2e3d(_0x581ae8);})[_0xcc8a('0x16')](function(_0x2a877f){logger[_0xcc8a('0x14')]('GetChatQueue',_0x2a877f['message'],_0x4dad7b);_0xa76ad9(_0x471f1d[_0xcc8a('0x14')](0x1f4,_0x2a877f['message']));});});};exports[_0xcc8a('0x21')]=function(_0x3629c1){var _0x59ff46=this;return new Promise(function(_0x14dbee,_0x5c19b0){return db['ChatQueue'][_0xcc8a('0x22')]({'raw':_0x3629c1[_0xcc8a('0x19')]?_0x3629c1[_0xcc8a('0x19')][_0xcc8a('0x1a')]===undefined?!![]:![]:!![],'where':_0x3629c1['options']?_0x3629c1['options'][_0xcc8a('0x1b')]||null:null,'attributes':_0x3629c1[_0xcc8a('0x19')]?_0x3629c1[_0xcc8a('0x19')][_0xcc8a('0x1c')]||null:null,'include':_0x3629c1[_0xcc8a('0x19')]?_0x3629c1[_0xcc8a('0x19')][_0xcc8a('0x1e')]?_[_0xcc8a('0x1f')](_0x3629c1[_0xcc8a('0x19')][_0xcc8a('0x1e')],function(_0x36125f){return{'model':db[_0x36125f[_0xcc8a('0x20')]],'as':_0x36125f['as'],'attributes':_0x36125f['attributes'],'include':_0x36125f[_0xcc8a('0x1e')]?_[_0xcc8a('0x1f')](_0x36125f[_0xcc8a('0x1e')],function(_0x5df806){return{'model':db[_0x5df806[_0xcc8a('0x20')]],'as':_0x5df806['as'],'attributes':_0x5df806['attributes'],'include':_0x5df806['include']?_[_0xcc8a('0x1f')](_0x5df806['include'],function(_0x46a22d){return{'model':db[_0x46a22d[_0xcc8a('0x20')]],'as':_0x46a22d['as'],'attributes':_0x46a22d[_0xcc8a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcc8a('0xd')](function(_0x20390c){logger['info'](_0xcc8a('0x21'),_0x3629c1);logger[_0xcc8a('0x11')](_0xcc8a('0x21'),_0x3629c1,JSON[_0xcc8a('0x13')](_0x20390c));_0x14dbee(_0x20390c);})['catch'](function(_0x5e1174){logger[_0xcc8a('0x14')]('ShowChatQueue',_0x5e1174['message'],_0x3629c1);_0x5c19b0(_0x59ff46['error'](0x1f4,_0x5e1174['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index a8fcb29..c78c1e2 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 _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 +var _0x1cc7=['remove','emit','length','chatQueue:','./chatQueue.events','save'];(function(_0x44f773,_0xcb2147){var _0x517341=function(_0x3dbb3f){while(--_0x3dbb3f){_0x44f773['push'](_0x44f773['shift']());}};_0x517341(++_0xcb2147);}(_0x1cc7,0x15a));var _0x71cc=function(_0x25b189,_0x566220){_0x25b189=_0x25b189-0x0;var _0x4f0763=_0x1cc7[_0x25b189];return _0x4f0763;};'use strict';var ChatQueueEvents=require(_0x71cc('0x0'));var events=[_0x71cc('0x1'),_0x71cc('0x2'),'update'];function createListener(_0x4db9cd,_0x547fe6){return function(_0xe5d54e){_0x547fe6[_0x71cc('0x3')](_0x4db9cd,_0xe5d54e);};}function removeListener(_0x402191,_0x5431e1){return function(){ChatQueueEvents['removeListener'](_0x402191,_0x5431e1);};}exports['register']=function(_0x27a175){for(var _0x4ecf81=0x0,_0xc0444e=events[_0x71cc('0x4')];_0x4ecf81<_0xc0444e;_0x4ecf81++){var _0x4039ce=events[_0x4ecf81];var _0x2e70f0=createListener(_0x71cc('0x5')+_0x4039ce,_0x27a175);ChatQueueEvents['on'](_0x4039ce,_0x2e70f0);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index b020359..8741f69 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 _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 +var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x321d22,_0x350ec3){var _0x3d360c=function(_0x1b0b1b){while(--_0x1b0b1b){_0x321d22['push'](_0x321d22['shift']());}};_0x3d360c(++_0x350ec3);}(_0xe14b,0x93));var _0xbe14=function(_0x2a5ac2,_0x36db10){_0x2a5ac2=_0x2a5ac2-0x0;var _0x25c649=_0xe14b[_0x2a5ac2];return _0x25c649;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 00d51f9..84f44e5 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 _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 +var _0xfcd2=['DATE','exports','STRING'];(function(_0x4cf23f,_0x99878d){var _0x1ee7cd=function(_0x44c804){while(--_0x44c804){_0x4cf23f['push'](_0x4cf23f['shift']());}};_0x1ee7cd(++_0x99878d);}(_0xfcd2,0x1d8));var _0x2fcd=function(_0x33db4b,_0x1d8a35){_0x33db4b=_0x33db4b-0x0;var _0x1ad559=_0xfcd2[_0x33db4b];return _0x1ad559;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x2fcd('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x2fcd('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2fcd('0x2')]},'exitAt':{'type':Sequelize[_0x2fcd('0x2')]},'reason':{'type':Sequelize[_0x2fcd('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 86cbf11..4ce16d5 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 _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 +var _0xbd0e=['VIRTUAL','options','ChatQueueReport','findAll','rows','catch','show','keys','rawAttributes','fields','include','find','create','body','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','end','stack','name','send','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0xbd0e,0x187));var _0xebd0=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0xbd0e[_0x149ca0];return _0x56b6b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xebd0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebd0('0x1'));var rp=require(_0xebd0('0x2'));var moment=require(_0xebd0('0x3'));var BPromise=require(_0xebd0('0x4'));var Mustache=require(_0xebd0('0x5'));var util=require(_0xebd0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xebd0('0x7'));var ejs=require(_0xebd0('0x8'));var fs=require('fs');var fs_extra=require(_0xebd0('0x9'));var _=require(_0xebd0('0xa'));var squel=require(_0xebd0('0xb'));var crypto=require(_0xebd0('0xc'));var jsforce=require(_0xebd0('0xd'));var deskjs=require(_0xebd0('0xe'));var toCsv=require(_0xebd0('0x7'));var querystring=require('querystring');var Papa=require(_0xebd0('0xf'));var Redis=require(_0xebd0('0x10'));var authService=require(_0xebd0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xebd0('0x12'));var hardwareService=require(_0xebd0('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xebd0('0x14'));var config=require(_0xebd0('0x15'));var licenseUtil=require(_0xebd0('0x16'));var db=require(_0xebd0('0x17'))['db'];function respondWithStatusCode(_0xfbd0b7,_0x562df3){_0x562df3=_0x562df3||0xcc;return function(_0x464387){if(_0x464387){return _0xfbd0b7[_0xebd0('0x18')](_0x562df3);}return _0xfbd0b7[_0xebd0('0x19')](_0x562df3)['end']();};}function respondWithResult(_0x298300,_0x22c014){_0x22c014=_0x22c014||0xc8;return function(_0x3ad9ac){if(_0x3ad9ac){return _0x298300[_0xebd0('0x19')](_0x22c014)[_0xebd0('0x1a')](_0x3ad9ac);}};}function respondWithFilteredResult(_0x406cff,_0x2bf066){return function(_0x44822c){if(_0x44822c){var _0x25097c=typeof _0x2bf066[_0xebd0('0x1b')]===_0xebd0('0x1c')&&typeof _0x2bf066[_0xebd0('0x1d')]===_0xebd0('0x1c');var _0x20244d=_0x44822c[_0xebd0('0x1e')];var _0x4791b2=_0x25097c?0x0:_0x2bf066[_0xebd0('0x1b')];var _0x40b14d=_0x25097c?_0x44822c[_0xebd0('0x1e')]:_0x2bf066[_0xebd0('0x1b')]+_0x2bf066['limit'];var _0x37eff9;if(_0x40b14d>=_0x20244d){_0x40b14d=_0x20244d;_0x37eff9=0xc8;}else{_0x37eff9=0xce;}_0x406cff[_0xebd0('0x19')](_0x37eff9);return _0x406cff['set'](_0xebd0('0x1f'),_0x4791b2+'-'+_0x40b14d+'/'+_0x20244d)['json'](_0x44822c);}return null;};}function patchUpdates(_0x4720d5){return function(_0x197b2f){try{jsonpatch[_0xebd0('0x20')](_0x197b2f,_0x4720d5,!![]);}catch(_0x1827ae){return BPromise['reject'](_0x1827ae);}return _0x197b2f[_0xebd0('0x21')]();};}function saveUpdates(_0x4ad73a,_0x2970e7){return function(_0x2d2639){if(_0x2d2639){return _0x2d2639[_0xebd0('0x22')](_0x4ad73a)['then'](function(_0x234548){return _0x234548;});}return null;};}function removeEntity(_0x47fe4,_0x254979){return function(_0x507343){if(_0x507343){return _0x507343[_0xebd0('0x23')]()[_0xebd0('0x24')](function(){_0x47fe4[_0xebd0('0x19')](0xcc)[_0xebd0('0x25')]();});}};}function handleEntityNotFound(_0x4a0deb,_0x4ee6dd){return function(_0x144f13){if(!_0x144f13){_0x4a0deb[_0xebd0('0x18')](0x194);}return _0x144f13;};}function handleError(_0x4210fb,_0x73fd66){_0x73fd66=_0x73fd66||0x1f4;return function(_0x30d96b){logger['error'](_0x30d96b[_0xebd0('0x26')]);if(_0x30d96b[_0xebd0('0x27')]){delete _0x30d96b[_0xebd0('0x27')];}_0x4210fb[_0xebd0('0x19')](_0x73fd66)[_0xebd0('0x28')](_0x30d96b);};}exports['index']=function(_0x53169b,_0x4edc71){var _0x540a70={},_0x206716={},_0x3b9033={'count':0x0,'rows':[]};var _0x16c821=_['map'](db['ChatQueueReport']['rawAttributes'],function(_0x140967){return{'name':_0x140967[_0xebd0('0x29')],'type':_0x140967[_0xebd0('0x2a')][_0xebd0('0x2b')]};});_0x206716[_0xebd0('0x2c')]=_[_0xebd0('0x2d')](_0x16c821,_0xebd0('0x27'));_0x206716[_0xebd0('0x2e')]=_['keys'](_0x53169b[_0xebd0('0x2e')]);_0x206716[_0xebd0('0x2f')]=_[_0xebd0('0x30')](_0x206716[_0xebd0('0x2c')],_0x206716[_0xebd0('0x2e')]);_0x540a70[_0xebd0('0x31')]=_['intersection'](_0x206716[_0xebd0('0x2c')],qs['fields'](_0x53169b['query']['fields']));_0x540a70[_0xebd0('0x31')]=_0x540a70[_0xebd0('0x31')][_0xebd0('0x32')]?_0x540a70[_0xebd0('0x31')]:_0x206716[_0xebd0('0x2c')];if(!_0x53169b['query'][_0xebd0('0x33')](_0xebd0('0x34'))){_0x540a70[_0xebd0('0x1d')]=qs[_0xebd0('0x1d')](_0x53169b[_0xebd0('0x2e')][_0xebd0('0x1d')]);_0x540a70[_0xebd0('0x1b')]=qs[_0xebd0('0x1b')](_0x53169b[_0xebd0('0x2e')]['offset']);}_0x540a70[_0xebd0('0x35')]=qs['sort'](_0x53169b[_0xebd0('0x2e')][_0xebd0('0x36')]);_0x540a70[_0xebd0('0x37')]=qs['filters'](_[_0xebd0('0x38')](_0x53169b['query'],_0x206716[_0xebd0('0x2f')]),_0x16c821);if(_0x53169b[_0xebd0('0x2e')][_0xebd0('0x39')]){_0x540a70['where']=_[_0xebd0('0x3a')](_0x540a70[_0xebd0('0x37')],{'$or':_['map'](_0x16c821,function(_0x58db9e){if(_0x58db9e[_0xebd0('0x2a')]!==_0xebd0('0x3b')){var _0x292c1e={};_0x292c1e[_0x58db9e['name']]={'$like':'%'+_0x53169b[_0xebd0('0x2e')][_0xebd0('0x39')]+'%'};return _0x292c1e;}})});}_0x540a70=_[_0xebd0('0x3a')]({},_0x540a70,_0x53169b[_0xebd0('0x3c')]);var _0x46c7b7={'where':_0x540a70[_0xebd0('0x37')]};return db[_0xebd0('0x3d')][_0xebd0('0x1e')](_0x46c7b7)['then'](function(_0x5d030d){_0x3b9033[_0xebd0('0x1e')]=_0x5d030d;if(_0x53169b['query']['includeAll']){_0x540a70['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0xebd0('0x3e')](_0x540a70);})[_0xebd0('0x24')](function(_0x14d0bc){_0x3b9033[_0xebd0('0x3f')]=_0x14d0bc;return _0x3b9033;})[_0xebd0('0x24')](respondWithFilteredResult(_0x4edc71,_0x540a70))[_0xebd0('0x40')](handleError(_0x4edc71,null));};exports[_0xebd0('0x41')]=function(_0x50840c,_0x1dad44){var _0xd994f={'raw':!![],'where':{'id':_0x50840c['params']['id']}},_0x2c3bc3={};_0x2c3bc3['model']=_[_0xebd0('0x42')](db['ChatQueueReport'][_0xebd0('0x43')]);_0x2c3bc3[_0xebd0('0x2e')]=_[_0xebd0('0x42')](_0x50840c[_0xebd0('0x2e')]);_0x2c3bc3[_0xebd0('0x2f')]=_[_0xebd0('0x30')](_0x2c3bc3[_0xebd0('0x2c')],_0x2c3bc3['query']);_0xd994f[_0xebd0('0x31')]=_[_0xebd0('0x30')](_0x2c3bc3[_0xebd0('0x2c')],qs[_0xebd0('0x44')](_0x50840c[_0xebd0('0x2e')][_0xebd0('0x44')]));_0xd994f['attributes']=_0xd994f[_0xebd0('0x31')]['length']?_0xd994f['attributes']:_0x2c3bc3[_0xebd0('0x2c')];if(_0x50840c['query']['includeAll']){_0xd994f[_0xebd0('0x45')]=[{'all':!![]}];}_0xd994f=_[_0xebd0('0x3a')]({},_0xd994f,_0x50840c[_0xebd0('0x3c')]);return db[_0xebd0('0x3d')][_0xebd0('0x46')](_0xd994f)['then'](handleEntityNotFound(_0x1dad44,null))[_0xebd0('0x24')](respondWithResult(_0x1dad44,null))['catch'](handleError(_0x1dad44,null));};exports['create']=function(_0x2e44f1,_0x45ad49){return db['ChatQueueReport'][_0xebd0('0x47')](_0x2e44f1[_0xebd0('0x48')],{})[_0xebd0('0x24')](respondWithResult(_0x45ad49,0xc9))[_0xebd0('0x40')](handleError(_0x45ad49,null));};exports[_0xebd0('0x22')]=function(_0x18675a,_0x778fa1){if(_0x18675a[_0xebd0('0x48')]['id']){delete _0x18675a[_0xebd0('0x48')]['id'];}return db['ChatQueueReport'][_0xebd0('0x46')]({'where':{'id':_0x18675a[_0xebd0('0x49')]['id']}})[_0xebd0('0x24')](handleEntityNotFound(_0x778fa1,null))[_0xebd0('0x24')](saveUpdates(_0x18675a[_0xebd0('0x48')],null))[_0xebd0('0x24')](respondWithResult(_0x778fa1,null))['catch'](handleError(_0x778fa1,null));};exports[_0xebd0('0x23')]=function(_0x14ed2e,_0x526a93){return db[_0xebd0('0x3d')][_0xebd0('0x46')]({'where':{'id':_0x14ed2e['params']['id']}})[_0xebd0('0x24')](handleEntityNotFound(_0x526a93,null))[_0xebd0('0x24')](removeEntity(_0x526a93,null))[_0xebd0('0x40')](handleError(_0x526a93,null));};exports[_0xebd0('0x4a')]=function(_0x28a11b,_0x4ce8a5){return db['ChatQueueReport'][_0xebd0('0x4a')]()[_0xebd0('0x24')](respondWithResult(_0x4ce8a5,null))[_0xebd0('0x40')](handleError(_0x4ce8a5,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index fdfbac9..74bb23f 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 _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 +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x3878bd,_0x51e3e5){var _0x359e60=function(_0xe70276){while(--_0xe70276){_0x3878bd['push'](_0x3878bd['shift']());}};_0x359e60(++_0x51e3e5);}(_0xe706,0xa3));var _0x6e70=function(_0x788c48,_0x5c0e5e){_0x788c48=_0x788c48-0x0;var _0x299c14=_0xe706[_0x788c48];return _0x299c14;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index eddf743..7674475 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 _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 +var _0x6cb4=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','request\x20sent','debug','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','result','catch','ChatQueueReport','create','body','options','raw','then','CreateChatQueueReport','UpdateChatQueueReport','update','attributes','limit','lodash'];(function(_0x37e4ad,_0x170ca0){var _0x128d7c=function(_0x137db8){while(--_0x137db8){_0x37e4ad['push'](_0x37e4ad['shift']());}};_0x128d7c(++_0x170ca0);}(_0x6cb4,0xff));var _0x46cb=function(_0x5cf074,_0x34f595){_0x5cf074=_0x5cf074-0x0;var _0x593789=_0x6cb4[_0x5cf074];return _0x593789;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var moment=require(_0x46cb('0x2'));var BPromise=require(_0x46cb('0x3'));var rs=require(_0x46cb('0x4'));var fs=require('fs');var Redis=require(_0x46cb('0x5'));var db=require(_0x46cb('0x6'))['db'];var utils=require(_0x46cb('0x7'));var logger=require(_0x46cb('0x8'))('rpc');var config=require(_0x46cb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x46cb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11262d,_0x148d0f,_0x31b35b){return new BPromise(function(_0x2d6c29,_0x24b4f5){return client[_0x46cb('0xb')](_0x11262d,_0x31b35b)['then'](function(_0x3d7663){logger[_0x46cb('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x148d0f,_0x46cb('0xd'));logger[_0x46cb('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x148d0f,_0x46cb('0xd'),JSON[_0x46cb('0xf')](_0x3d7663));if(_0x3d7663['error']){if(_0x3d7663['error']['code']===0x1f4){logger[_0x46cb('0x10')](_0x46cb('0x11'),_0x148d0f,_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);return _0x24b4f5(_0x3d7663['error'][_0x46cb('0x12')]);}logger[_0x46cb('0x10')](_0x46cb('0x11'),_0x148d0f,_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);return _0x2d6c29(_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);}else{logger[_0x46cb('0xc')](_0x46cb('0x11'),_0x148d0f,_0x46cb('0xd'));_0x2d6c29(_0x3d7663[_0x46cb('0x13')]['message']);}})[_0x46cb('0x14')](function(_0x5796d2){logger[_0x46cb('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x148d0f,_0x5796d2);_0x24b4f5(_0x5796d2);});});}exports['CreateChatQueueReport']=function(_0x4e3454){var _0x1b6646=this;return new Promise(function(_0x1f2891,_0x4df1f0){return db[_0x46cb('0x15')][_0x46cb('0x16')](_0x4e3454[_0x46cb('0x17')],{'raw':_0x4e3454[_0x46cb('0x18')]?_0x4e3454[_0x46cb('0x18')][_0x46cb('0x19')]===undefined?!![]:![]:!![]})[_0x46cb('0x1a')](function(_0x149483){logger[_0x46cb('0xc')](_0x46cb('0x1b'),_0x4e3454);logger[_0x46cb('0xe')](_0x46cb('0x1b'),_0x4e3454,JSON[_0x46cb('0xf')](_0x149483));_0x1f2891(_0x149483);})[_0x46cb('0x14')](function(_0x1fb467){logger[_0x46cb('0x10')](_0x46cb('0x1b'),_0x1fb467[_0x46cb('0x12')],_0x4e3454);_0x4df1f0(_0x1b6646[_0x46cb('0x10')](0x1f4,_0x1fb467[_0x46cb('0x12')]));});});};exports[_0x46cb('0x1c')]=function(_0x40e0e5){var _0x5a1338=this;return new Promise(function(_0x4d663e,_0x6588f3){return db[_0x46cb('0x15')][_0x46cb('0x1d')](_0x40e0e5[_0x46cb('0x17')],{'raw':_0x40e0e5[_0x46cb('0x18')]?_0x40e0e5['options'][_0x46cb('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40e0e5['options']?_0x40e0e5['options']['where']||null:null,'attributes':_0x40e0e5[_0x46cb('0x18')]?_0x40e0e5[_0x46cb('0x18')][_0x46cb('0x1e')]||null:null,'limit':_0x40e0e5[_0x46cb('0x18')]?_0x40e0e5[_0x46cb('0x18')][_0x46cb('0x1f')]||null:null})[_0x46cb('0x1a')](function(_0x8c65b2){logger[_0x46cb('0xc')](_0x46cb('0x1c'),_0x40e0e5);logger[_0x46cb('0xe')]('UpdateChatQueueReport',_0x40e0e5,JSON[_0x46cb('0xf')](_0x8c65b2));_0x4d663e(_0x8c65b2);})[_0x46cb('0x14')](function(_0x4c73bd){logger['error'](_0x46cb('0x1c'),_0x4c73bd['message'],_0x40e0e5);_0x6588f3(_0x5a1338[_0x46cb('0x10')](0x1f4,_0x4c73bd[_0x46cb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index af18529..8b373e5 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 _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 +var _0xe501=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','exports','util','path','connect-timeout','express'];(function(_0x214057,_0x598967){var _0x565bc9=function(_0x95b3f3){while(--_0x95b3f3){_0x214057['push'](_0x214057['shift']());}};_0x565bc9(++_0x598967);}(_0xe501,0x1f0));var _0x1e50=function(_0x458829,_0x5dae88){_0x458829=_0x458829-0x0;var _0xc0a3c=_0xe501[_0x458829];return _0xc0a3c;};'use strict';var multer=require('multer');var util=require(_0x1e50('0x0'));var path=require(_0x1e50('0x1'));var timeout=require(_0x1e50('0x2'));var express=require(_0x1e50('0x3'));var router=express[_0x1e50('0x4')]();var fs_extra=require(_0x1e50('0x5'));var auth=require(_0x1e50('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1e50('0x7'));var controller=require(_0x1e50('0x8'));router[_0x1e50('0x9')]('/',auth[_0x1e50('0xa')](),controller[_0x1e50('0xb')]);router[_0x1e50('0x9')](_0x1e50('0xc'),auth[_0x1e50('0xa')](),controller[_0x1e50('0xd')]);router['get'](_0x1e50('0xe'),auth[_0x1e50('0xa')](),controller[_0x1e50('0xf')]);router['post']('/',auth[_0x1e50('0xa')](),controller[_0x1e50('0x10')]);router[_0x1e50('0x11')](_0x1e50('0xe'),auth['isAuthenticated'](),controller[_0x1e50('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1e50('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 3e09449..4c764c2 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 _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 +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x22d352,_0x4a576f){var _0x11228c=function(_0x4d8414){while(--_0x4d8414){_0x22d352['push'](_0x22d352['shift']());}};_0x11228c(++_0x4a576f);}(_0xaa88,0x137));var _0x8aa8=function(_0x2074db,_0x10b81b){_0x2074db=_0x2074db-0x0;var _0x27324c=_0xaa88[_0x2074db];return _0x27324c;};'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 diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 099d552..c93cd72 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 _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 +var _0x90c9=['body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','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','api','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','Content-Range','save','then','error','stack','name','send','index','map','ChatTransferReport','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','create'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0x90c9,0x12b));var _0x990c=function(_0x4befae,_0x55b079){_0x4befae=_0x4befae-0x0;var _0x76c573=_0x90c9[_0x4befae];return _0x76c573;};'use strict';var emlformat=require(_0x990c('0x0'));var rimraf=require(_0x990c('0x1'));var zipdir=require(_0x990c('0x2'));var jsonpatch=require(_0x990c('0x3'));var rp=require(_0x990c('0x4'));var moment=require(_0x990c('0x5'));var BPromise=require(_0x990c('0x6'));var Mustache=require('mustache');var util=require(_0x990c('0x7'));var path=require('path');var sox=require(_0x990c('0x8'));var csv=require(_0x990c('0x9'));var ejs=require(_0x990c('0xa'));var fs=require('fs');var fs_extra=require(_0x990c('0xb'));var _=require(_0x990c('0xc'));var squel=require(_0x990c('0xd'));var crypto=require(_0x990c('0xe'));var jsforce=require(_0x990c('0xf'));var deskjs=require(_0x990c('0x10'));var toCsv=require(_0x990c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x990c('0x11'));var authService=require(_0x990c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x990c('0x13'));var hardwareService=require(_0x990c('0x14'));var logger=require('../../config/logger')(_0x990c('0x15'));var utils=require('../../config/utils');var config=require(_0x990c('0x16'));var licenseUtil=require(_0x990c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x218659,_0xe9fa7b){_0xe9fa7b=_0xe9fa7b||0xcc;return function(_0x3f89c6){if(_0x3f89c6){return _0x218659['sendStatus'](_0xe9fa7b);}return _0x218659['status'](_0xe9fa7b)['end']();};}function respondWithResult(_0x29d69a,_0x2a8822){_0x2a8822=_0x2a8822||0xc8;return function(_0xa1b7b0){if(_0xa1b7b0){return _0x29d69a[_0x990c('0x18')](_0x2a8822)[_0x990c('0x19')](_0xa1b7b0);}};}function respondWithFilteredResult(_0x461213,_0x4744ec){return function(_0x4cce3a){if(_0x4cce3a){var _0x8bb2f2=typeof _0x4744ec[_0x990c('0x1a')]==='undefined'&&typeof _0x4744ec[_0x990c('0x1b')]===_0x990c('0x1c');var _0x12c407=_0x4cce3a[_0x990c('0x1d')];var _0x5679a7=_0x8bb2f2?0x0:_0x4744ec[_0x990c('0x1a')];var _0x4326e2=_0x8bb2f2?_0x4cce3a['count']:_0x4744ec['offset']+_0x4744ec['limit'];var _0x32b8e9;if(_0x4326e2>=_0x12c407){_0x4326e2=_0x12c407;_0x32b8e9=0xc8;}else{_0x32b8e9=0xce;}_0x461213['status'](_0x32b8e9);return _0x461213[_0x990c('0x1e')](_0x990c('0x1f'),_0x5679a7+'-'+_0x4326e2+'/'+_0x12c407)['json'](_0x4cce3a);}return null;};}function patchUpdates(_0x54633a){return function(_0x3d3690){try{jsonpatch['apply'](_0x3d3690,_0x54633a,!![]);}catch(_0x6a3551){return BPromise['reject'](_0x6a3551);}return _0x3d3690[_0x990c('0x20')]();};}function saveUpdates(_0x996ced,_0x5099d3){return function(_0x96202b){if(_0x96202b){return _0x96202b['update'](_0x996ced)[_0x990c('0x21')](function(_0x33fdc0){return _0x33fdc0;});}return null;};}function removeEntity(_0x18d9be,_0x1b1e0a){return function(_0x3f3093){if(_0x3f3093){return _0x3f3093['destroy']()[_0x990c('0x21')](function(){_0x18d9be[_0x990c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34537b,_0x48134e){return function(_0x36f602){if(!_0x36f602){_0x34537b['sendStatus'](0x194);}return _0x36f602;};}function handleError(_0x1faec8,_0x1c842b){_0x1c842b=_0x1c842b||0x1f4;return function(_0x3704c4){logger[_0x990c('0x22')](_0x3704c4[_0x990c('0x23')]);if(_0x3704c4[_0x990c('0x24')]){delete _0x3704c4[_0x990c('0x24')];}_0x1faec8[_0x990c('0x18')](_0x1c842b)[_0x990c('0x25')](_0x3704c4);};}exports[_0x990c('0x26')]=function(_0x28909c,_0x5b952f){var _0x50c555={},_0x356a4a={},_0x53d9ae={'count':0x0,'rows':[]};var _0x43ca4e=_[_0x990c('0x27')](db[_0x990c('0x28')]['rawAttributes'],function(_0x56979b){return{'name':_0x56979b[_0x990c('0x29')],'type':_0x56979b[_0x990c('0x2a')][_0x990c('0x2b')]};});_0x356a4a[_0x990c('0x2c')]=_[_0x990c('0x27')](_0x43ca4e,_0x990c('0x24'));_0x356a4a[_0x990c('0x2d')]=_['keys'](_0x28909c[_0x990c('0x2d')]);_0x356a4a[_0x990c('0x2e')]=_['intersection'](_0x356a4a[_0x990c('0x2c')],_0x356a4a[_0x990c('0x2d')]);_0x50c555[_0x990c('0x2f')]=_[_0x990c('0x30')](_0x356a4a[_0x990c('0x2c')],qs[_0x990c('0x31')](_0x28909c[_0x990c('0x2d')]['fields']));_0x50c555[_0x990c('0x2f')]=_0x50c555[_0x990c('0x2f')][_0x990c('0x32')]?_0x50c555[_0x990c('0x2f')]:_0x356a4a[_0x990c('0x2c')];if(!_0x28909c[_0x990c('0x2d')][_0x990c('0x33')](_0x990c('0x34'))){_0x50c555[_0x990c('0x1b')]=qs['limit'](_0x28909c[_0x990c('0x2d')][_0x990c('0x1b')]);_0x50c555[_0x990c('0x1a')]=qs[_0x990c('0x1a')](_0x28909c['query']['offset']);}_0x50c555[_0x990c('0x35')]=qs[_0x990c('0x36')](_0x28909c['query']['sort']);_0x50c555[_0x990c('0x37')]=qs['filters'](_[_0x990c('0x38')](_0x28909c['query'],_0x356a4a[_0x990c('0x2e')]),_0x43ca4e);if(_0x28909c[_0x990c('0x2d')][_0x990c('0x39')]){_0x50c555[_0x990c('0x37')]=_[_0x990c('0x3a')](_0x50c555[_0x990c('0x37')],{'$or':_[_0x990c('0x27')](_0x43ca4e,function(_0x4979cf){if(_0x4979cf[_0x990c('0x2a')]!==_0x990c('0x3b')){var _0x148f62={};_0x148f62[_0x4979cf['name']]={'$like':'%'+_0x28909c['query'][_0x990c('0x39')]+'%'};return _0x148f62;}})});}_0x50c555=_['merge']({},_0x50c555,_0x28909c[_0x990c('0x3c')]);var _0x298406={'where':_0x50c555['where']};return db[_0x990c('0x28')]['count'](_0x298406)[_0x990c('0x21')](function(_0x37c0db){_0x53d9ae[_0x990c('0x1d')]=_0x37c0db;if(_0x28909c[_0x990c('0x2d')]['includeAll']){_0x50c555['include']=[{'all':!![]}];}return db[_0x990c('0x28')][_0x990c('0x3d')](_0x50c555);})['then'](function(_0x5a1fbf){_0x53d9ae[_0x990c('0x3e')]=_0x5a1fbf;return _0x53d9ae;})[_0x990c('0x21')](respondWithFilteredResult(_0x5b952f,_0x50c555))[_0x990c('0x3f')](handleError(_0x5b952f,null));};exports[_0x990c('0x40')]=function(_0x351668,_0x13b62c){var _0x3182b9={'raw':!![],'where':{'id':_0x351668[_0x990c('0x41')]['id']}},_0x56adf4={};_0x56adf4[_0x990c('0x2c')]=_[_0x990c('0x42')](db[_0x990c('0x28')][_0x990c('0x43')]);_0x56adf4['query']=_[_0x990c('0x42')](_0x351668[_0x990c('0x2d')]);_0x56adf4[_0x990c('0x2e')]=_[_0x990c('0x30')](_0x56adf4[_0x990c('0x2c')],_0x56adf4[_0x990c('0x2d')]);_0x3182b9[_0x990c('0x2f')]=_[_0x990c('0x30')](_0x56adf4[_0x990c('0x2c')],qs[_0x990c('0x31')](_0x351668[_0x990c('0x2d')][_0x990c('0x31')]));_0x3182b9['attributes']=_0x3182b9['attributes'][_0x990c('0x32')]?_0x3182b9[_0x990c('0x2f')]:_0x56adf4[_0x990c('0x2c')];if(_0x351668[_0x990c('0x2d')][_0x990c('0x44')]){_0x3182b9['include']=[{'all':!![]}];}_0x3182b9=_['merge']({},_0x3182b9,_0x351668[_0x990c('0x3c')]);return db[_0x990c('0x28')][_0x990c('0x45')](_0x3182b9)['then'](handleEntityNotFound(_0x13b62c,null))[_0x990c('0x21')](respondWithResult(_0x13b62c,null))[_0x990c('0x3f')](handleError(_0x13b62c,null));};exports[_0x990c('0x46')]=function(_0x1fce14,_0x361055){return db[_0x990c('0x28')][_0x990c('0x46')](_0x1fce14[_0x990c('0x47')],{})[_0x990c('0x21')](respondWithResult(_0x361055,0xc9))[_0x990c('0x3f')](handleError(_0x361055,null));};exports['update']=function(_0x24963c,_0x826832){if(_0x24963c[_0x990c('0x47')]['id']){delete _0x24963c['body']['id'];}return db[_0x990c('0x28')]['find']({'where':{'id':_0x24963c[_0x990c('0x41')]['id']}})['then'](handleEntityNotFound(_0x826832,null))[_0x990c('0x21')](saveUpdates(_0x24963c[_0x990c('0x47')],null))[_0x990c('0x21')](respondWithResult(_0x826832,null))[_0x990c('0x3f')](handleError(_0x826832,null));};exports[_0x990c('0x48')]=function(_0x3c125f,_0x53ba89){return db['ChatTransferReport'][_0x990c('0x45')]({'where':{'id':_0x3c125f[_0x990c('0x41')]['id']}})[_0x990c('0x21')](handleEntityNotFound(_0x53ba89,null))[_0x990c('0x21')](removeEntity(_0x53ba89,null))[_0x990c('0x3f')](handleError(_0x53ba89,null));};exports['describe']=function(_0x54f610,_0xfbd3ea){return db[_0x990c('0x28')][_0x990c('0x49')]()[_0x990c('0x21')](respondWithResult(_0xfbd3ea,null))[_0x990c('0x3f')](handleError(_0xfbd3ea,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 0bfb0e9..6a165a1 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 _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 +var _0xc4a2=['define','report_chat_transfer','lodash','util','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x404991,_0x5a9865){var _0x429b45=function(_0x3ad6e5){while(--_0x3ad6e5){_0x404991['push'](_0x404991['shift']());}};_0x429b45(++_0x5a9865);}(_0xc4a2,0xfc));var _0x2c4a=function(_0x38a7ee,_0x69abc5){_0x38a7ee=_0x38a7ee-0x0;var _0xcc983=_0xc4a2[_0x38a7ee];return _0xcc983;};'use strict';var _=require(_0x2c4a('0x0'));var util=require(_0x2c4a('0x1'));var logger=require('../../config/logger')(_0x2c4a('0x2'));var moment=require(_0x2c4a('0x3'));var BPromise=require(_0x2c4a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c4a('0x5'));var rimraf=require('rimraf');var config=require(_0x2c4a('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0x2c4a('0x7')]=function(_0x553a4b,_0x115e11){return _0x553a4b[_0x2c4a('0x8')]('ChatTransferReport',attributes,{'tableName':_0x2c4a('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index f48c040..29119ce 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 _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 +var _0x66a1=['then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request'];(function(_0x13551e,_0x3a8c79){var _0x55d46f=function(_0x312f35){while(--_0x312f35){_0x13551e['push'](_0x13551e['shift']());}};_0x55d46f(++_0x3a8c79);}(_0x66a1,0xe7));var _0x166a=function(_0x2d0ce6,_0x43a84f){_0x2d0ce6=_0x2d0ce6-0x0;var _0x2b0323=_0x66a1[_0x2d0ce6];return _0x2b0323;};'use strict';var _=require('lodash');var util=require(_0x166a('0x0'));var moment=require(_0x166a('0x1'));var BPromise=require(_0x166a('0x2'));var rs=require(_0x166a('0x3'));var fs=require('fs');var Redis=require(_0x166a('0x4'));var db=require(_0x166a('0x5'))['db'];var utils=require(_0x166a('0x6'));var logger=require('../../config/logger')(_0x166a('0x7'));var config=require('../../config/environment');var jayson=require(_0x166a('0x8'));var client=jayson['client'][_0x166a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35ea3a,_0x242f55,_0x21f6c9){return new BPromise(function(_0x35d1a1,_0x51fcf0){return client[_0x166a('0xa')](_0x35ea3a,_0x21f6c9)[_0x166a('0xb')](function(_0xe0b6ba){logger[_0x166a('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x242f55,_0x166a('0xd'));logger[_0x166a('0xe')](_0x166a('0xf'),_0x242f55,_0x166a('0xd'),JSON[_0x166a('0x10')](_0xe0b6ba));if(_0xe0b6ba[_0x166a('0x11')]){if(_0xe0b6ba['error'][_0x166a('0x12')]===0x1f4){logger['error'](_0x166a('0x13'),_0x242f55,_0xe0b6ba[_0x166a('0x11')]['message']);return _0x51fcf0(_0xe0b6ba['error'][_0x166a('0x14')]);}logger[_0x166a('0x11')](_0x166a('0x13'),_0x242f55,_0xe0b6ba[_0x166a('0x11')][_0x166a('0x14')]);return _0x35d1a1(_0xe0b6ba[_0x166a('0x11')][_0x166a('0x14')]);}else{logger[_0x166a('0xc')](_0x166a('0x13'),_0x242f55,_0x166a('0xd'));_0x35d1a1(_0xe0b6ba['result']['message']);}})[_0x166a('0x15')](function(_0x5a9abc){logger[_0x166a('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x242f55,_0x5a9abc);_0x51fcf0(_0x5a9abc);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 6bed48f..b73282e 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 _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 +var _0x542c=['delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put'];(function(_0x3ebeb8,_0x1890da){var _0x1cfc32=function(_0x340e58){while(--_0x340e58){_0x3ebeb8['push'](_0x3ebeb8['shift']());}};_0x1cfc32(++_0x1890da);}(_0x542c,0x8f));var _0xc542=function(_0x9ce333,_0x162dac){_0x9ce333=_0x9ce333-0x0;var _0xde9dcc=_0x542c[_0x9ce333];return _0xde9dcc;};'use strict';var multer=require(_0xc542('0x0'));var util=require('util');var path=require(_0xc542('0x1'));var timeout=require(_0xc542('0x2'));var express=require('express');var router=express[_0xc542('0x3')]();var fs_extra=require(_0xc542('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc542('0x5'));var config=require(_0xc542('0x6'));var controller=require(_0xc542('0x7'));router[_0xc542('0x8')]('/',auth[_0xc542('0x9')](),controller[_0xc542('0xa')]);router[_0xc542('0x8')](_0xc542('0xb'),auth[_0xc542('0x9')](),controller[_0xc542('0xc')]);router[_0xc542('0x8')](_0xc542('0xd'),auth[_0xc542('0x9')](),controller[_0xc542('0xe')]);router[_0xc542('0xf')]('/',auth[_0xc542('0x9')](),controller['create']);router[_0xc542('0x10')]('/:id',auth[_0xc542('0x9')](),controller['update']);router[_0xc542('0x11')](_0xc542('0xd'),auth[_0xc542('0x9')](),controller[_0xc542('0x12')]);module[_0xc542('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 87c7d1b..986c55e 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 _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 +var _0x55e0=['CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','name','text','input','getDataValue','onlineForm','parse','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right'];(function(_0x241d8b,_0xbc727d){var _0xa8e555=function(_0x46d325){while(--_0x46d325){_0x241d8b['push'](_0x241d8b['shift']());}};_0xa8e555(++_0xbc727d);}(_0x55e0,0xdc));var _0x055e=function(_0x3d63f6,_0x8cd7e4){_0x3d63f6=_0x3d63f6-0x0;var _0x2ac67b=_0x55e0[_0x3d63f6];return _0x2ac67b;};'use strict';var Sequelize=require(_0x055e('0x0'));var rs=require(_0x055e('0x1'));module[_0x055e('0x2')]={'name':{'type':Sequelize[_0x055e('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x055e('0x3')]},'mapKey':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x4')},'mapKeyOffline':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x4')},'key':{'type':Sequelize[_0x055e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x055e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x055e('0x3')]},'animation':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x055e('0x9')]('rounded','squared'),'defaultValue':_0x055e('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0xb')},'start_chat_button':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xc')},'offline_chat_button':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'header_offline':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x055e('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x13')},'noteTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x14')},'placeholderMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x16')},'closingMessageButton':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'skipMessageButton':{'type':Sequelize[_0x055e('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x17')},'ratingType':{'type':Sequelize[_0x055e('0x9')](_0x055e('0x18'),_0x055e('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return JSON[_0x055e('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x055e('0x1b'),'type':_0x055e('0x1c'),'required':!![]},'props':{'title':_0x055e('0x1b'),'helpText':''}},{'type':_0x055e('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x055e('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x055e('0x1e')](_0x055e('0x1f'))?JSON[_0x055e('0x20')](this[_0x055e('0x1e')](_0x055e('0x1f'))):{};},'set':function(_0x4c653c){return this['setDataValue'](_0x055e('0x1f'),JSON[_0x055e('0x1a')](_0x4c653c));}},'offlineForm':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x055e('0x1d'),'props':{'title':_0x055e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x055e('0x4'),'type':_0x055e('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x055e('0x21')},'props':{'title':'Comments','helpText':_0x055e('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x055e('0x1e')](_0x055e('0x23'))?JSON[_0x055e('0x20')](this[_0x055e('0x1e')]('offlineForm')):{};},'set':function(_0x99a372){return this[_0x055e('0x24')](_0x055e('0x23'),JSON[_0x055e('0x1a')](_0x99a372));}},'token':{'type':Sequelize[_0x055e('0x3')],'defaultValue':function(){return rs[_0x055e('0x25')]();}},'autoclose':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x055e('0x3')]},'forwardOffline':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x26')},'waitingMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x29')},'sendUnmanaged':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x055e('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x055e('0x3')]},'notificationTemplate':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return _0x055e('0x2a');}},'notificationSound':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x055e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x2c')},'verticalAlignment':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x2d')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x2e')},'defaultTitle':{'type':Sequelize[_0x055e('0x3')]},'customerAvatar':{'type':Sequelize[_0x055e('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x055e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x30')},'systemAvatar':{'type':Sequelize[_0x055e('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x055e('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1012a4){if(!_0x1012a4)this[_0x055e('0x24')](_0x055e('0x32'),null);this['setDataValue'](_0x055e('0x33'),_0x1012a4);}},'vidaooEscalation':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x34')},'vidaooNote':{'type':Sequelize[_0x055e('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x055e('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x055e('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 294ef4d..6e7a58f 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 _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 +var _0x79c5=['server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','difference','createdAt','updatedAt','CompanyId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','ChatApplication','Applications','account','applications','list','priority','asc','Contacts','ListId','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','x-real-port','referer','version','%s\x20%s','browser','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','contact','messageId','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','fromString','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','email','offlineMessageSubject','subjectOffline','toPairsIn','Chat','MailAccountId','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','ids','getInteractions','Contact','User','Owner','fullname','internal','Tag','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','ONLINE','OFFLINE','timezone','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','custom','License','all','some','server/files/chat/iframe.ejs','utf8','URL','address','origin','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','hideWhenOffline','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','omit','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','path','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','api','../../config/environment','url','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','get','ChatWebsites','UserProfileResource','destroy','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','removeDispositions','CannedAnswer','findOne','removeAnswers','addLogo','file','filename','agentAvatar','addCustomerAvatar','addSystemAvatar','join','root','sitepic','../../config/license/util','getLicense','isNil','existsSync'];(function(_0x4c5205,_0x14084a){var _0x114f3d=function(_0x2408f3){while(--_0x2408f3){_0x4c5205['push'](_0x4c5205['shift']());}};_0x114f3d(++_0x14084a);}(_0x79c5,0xb8));var _0x579c=function(_0x2f77d6,_0x815a1d){_0x2f77d6=_0x2f77d6-0x0;var _0x5bf9eb=_0x79c5[_0x2f77d6];return _0x5bf9eb;};'use strict';var BPromise=require(_0x579c('0x0'));var Mustache=require('mustache');var util=require(_0x579c('0x1'));var path=require(_0x579c('0x2'));var ejs=require(_0x579c('0x3'));var fs=require('fs');var fs_extra=require(_0x579c('0x4'));var _=require(_0x579c('0x5'));var querystring=require(_0x579c('0x6'));var Redis=require('ioredis');var qs=require(_0x579c('0x7'));var logger=require('../../config/logger')(_0x579c('0x8'));var config=require(_0x579c('0x9'));var url=require(_0x579c('0xa'));var db=require(_0x579c('0xb'))['db'];config[_0x579c('0xc')]=_[_0x579c('0xd')](config['redis'],{'host':_0x579c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x579c('0xc')]));require(_0x579c('0xf'))[_0x579c('0x10')](socket);var htmlToText=require(_0x579c('0x11'));var jayson=require(_0x579c('0x12'));var client=jayson[_0x579c('0x13')][_0x579c('0x14')]({'port':0x232c});var client9002=jayson[_0x579c('0x13')][_0x579c('0x14')]({'port':0x232a});var client9003=jayson[_0x579c('0x13')][_0x579c('0x14')]({'port':0x232b});var client9001=jayson[_0x579c('0x13')][_0x579c('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x57e32c,_0x3ed642,_0x71298,_0xea3ff4){return new BPromise(function(_0x293380,_0x5a47ea){var _0xcf9c1b=_0xea3ff4||client;return _0xcf9c1b['request'](_0x57e32c,_0x71298)[_0x579c('0x15')](function(_0x257ea5){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x3ed642,_0x579c('0x16'));logger['debug'](_0x579c('0x17'),_0x3ed642,'request\x20sent',JSON[_0x579c('0x18')](_0x257ea5));if(_0x257ea5['error']){if(_0x257ea5[_0x579c('0x19')][_0x579c('0x1a')]===0x1f4){logger[_0x579c('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x3ed642,_0x257ea5[_0x579c('0x19')][_0x579c('0x1b')]);return _0x5a47ea(_0x257ea5[_0x579c('0x19')][_0x579c('0x1b')]);}logger['error'](_0x579c('0x1c'),_0x3ed642,_0x257ea5[_0x579c('0x19')][_0x579c('0x1b')]);return _0x293380(_0x257ea5[_0x579c('0x19')][_0x579c('0x1b')]);}else{logger[_0x579c('0x1d')](_0x579c('0x1c'),_0x3ed642,_0x579c('0x16'));_0x293380(_0x257ea5[_0x579c('0x1e')][_0x579c('0x1b')]);}})[_0x579c('0x1f')](function(_0x50a4e6){logger[_0x579c('0x19')](_0x579c('0x1c'),_0x3ed642,_0x50a4e6);_0x5a47ea(_0x50a4e6);});});}function respondWithStatusCode(_0x5a68d9,_0x5a2b0a){_0x5a2b0a=_0x5a2b0a||0xcc;return function(_0x422bc0){if(_0x422bc0){return _0x5a68d9[_0x579c('0x20')](_0x5a2b0a);}return _0x5a68d9[_0x579c('0x21')](_0x5a2b0a)['end']();};}function respondWithResult(_0x4662a9,_0x425a6e){_0x425a6e=_0x425a6e||0xc8;return function(_0x32e2a9){if(_0x32e2a9){return _0x4662a9[_0x579c('0x21')](_0x425a6e)[_0x579c('0x22')](_0x32e2a9);}};}function respondWithFilteredResult(_0x5e7c02,_0x45dde4){return function(_0x2c7991){if(_0x2c7991){var _0x2bdca1=typeof _0x45dde4[_0x579c('0x23')]===_0x579c('0x24')&&typeof _0x45dde4[_0x579c('0x25')]===_0x579c('0x24');var _0x1419c2=_0x2c7991[_0x579c('0x26')];var _0x24441f=_0x2bdca1?0x0:_0x45dde4[_0x579c('0x23')];var _0x459147=_0x2bdca1?_0x2c7991[_0x579c('0x26')]:_0x45dde4[_0x579c('0x23')]+_0x45dde4['limit'];var _0x227518;if(_0x459147>=_0x1419c2){_0x459147=_0x1419c2;_0x227518=0xc8;}else{_0x227518=0xce;}_0x5e7c02[_0x579c('0x21')](_0x227518);return _0x5e7c02[_0x579c('0x27')](_0x579c('0x28'),_0x24441f+'-'+_0x459147+'/'+_0x1419c2)[_0x579c('0x22')](_0x2c7991);}return null;};}function saveUpdates(_0x2d52fd){return function(_0x1dc749){if(_0x1dc749){return _0x1dc749[_0x579c('0x29')](_0x2d52fd)[_0x579c('0x15')](function(_0x1636f5){return _0x1636f5;});}return null;};}function removeEntity(_0x5e7398){return function(_0x38bad8){if(_0x38bad8){return _0x38bad8['destroy']()['then'](function(){var _0x3808d2=_0x38bad8[_0x579c('0x2a')]({'plain':!![]});var _0xd2082a=_0x579c('0x2b');return db[_0x579c('0x2c')][_0x579c('0x2d')]({'where':{'type':_0xd2082a,'resourceId':_0x3808d2['id']}})[_0x579c('0x15')](function(){return _0x38bad8;});})[_0x579c('0x15')](function(){_0x5e7398[_0x579c('0x21')](0xcc)[_0x579c('0x2e')]();});}};}function handleEntityNotFound(_0x37f906){return function(_0x4da111){if(!_0x4da111){_0x37f906[_0x579c('0x20')](0x194);}return _0x4da111;};}function handleError(_0x22ebb8,_0x3e2d2a){_0x3e2d2a=_0x3e2d2a||0x1f4;return function(_0x37d435){logger['error'](_0x37d435[_0x579c('0x2f')]);if(_0x37d435[_0x579c('0x30')]){delete _0x37d435['name'];}_0x22ebb8[_0x579c('0x21')](_0x3e2d2a)[_0x579c('0x31')](_0x37d435);};}exports[_0x579c('0x32')]=function(_0x694e00,_0x4526e3){var _0x11fd07={'include':[{'model':db[_0x579c('0x33')],'as':_0x579c('0x34')}]},_0x5de068={},_0x3658c4={'count':0x0,'rows':[]};var _0xf2b444=_[_0x579c('0x35')](db[_0x579c('0x36')][_0x579c('0x37')],function(_0x5407e1){return{'name':_0x5407e1['fieldName'],'type':_0x5407e1[_0x579c('0x38')][_0x579c('0x39')]};});_0x5de068['model']=_[_0x579c('0x35')](_0xf2b444,'name');_0x5de068['query']=_[_0x579c('0x3a')](_0x694e00['query']);_0x5de068[_0x579c('0x3b')]=_[_0x579c('0x3c')](_0x5de068[_0x579c('0x3d')],_0x5de068[_0x579c('0x3e')]);_0x11fd07[_0x579c('0x3f')]=_[_0x579c('0x3c')](_0x5de068[_0x579c('0x3d')],qs[_0x579c('0x40')](_0x694e00[_0x579c('0x3e')][_0x579c('0x40')]));_0x11fd07[_0x579c('0x3f')]=_0x11fd07['attributes'][_0x579c('0x41')]?_0x11fd07[_0x579c('0x3f')]:_0x5de068['model'];if(!_0x694e00[_0x579c('0x3e')][_0x579c('0x42')](_0x579c('0x43'))){_0x11fd07[_0x579c('0x25')]=qs[_0x579c('0x25')](_0x694e00[_0x579c('0x3e')][_0x579c('0x25')]);_0x11fd07[_0x579c('0x23')]=qs[_0x579c('0x23')](_0x694e00['query'][_0x579c('0x23')]);}_0x11fd07[_0x579c('0x44')]=qs[_0x579c('0x45')](_0x694e00[_0x579c('0x3e')][_0x579c('0x45')]);_0x11fd07[_0x579c('0x46')]=qs['filters'](_[_0x579c('0x47')](_0x694e00[_0x579c('0x3e')],_0x5de068['filters']),_0xf2b444);if(_0x694e00[_0x579c('0x3e')][_0x579c('0x48')]){_0x11fd07[_0x579c('0x46')]=_[_0x579c('0x49')](_0x11fd07[_0x579c('0x46')],{'$or':_[_0x579c('0x35')](_0xf2b444,function(_0x3e0856){if(_0x3e0856[_0x579c('0x38')]!==_0x579c('0x4a')){var _0x3583bb={};_0x3583bb[_0x3e0856['name']]={'$like':'%'+_0x694e00[_0x579c('0x3e')]['filter']+'%'};return _0x3583bb;}})});}_0x11fd07=_[_0x579c('0x49')]({},_0x11fd07,_0x694e00['options']);var _0x112d42={'where':_0x11fd07[_0x579c('0x46')]};return db[_0x579c('0x36')][_0x579c('0x26')](_0x112d42)[_0x579c('0x15')](function(_0xe8baf3){_0x3658c4[_0x579c('0x26')]=_0xe8baf3;if(_0x694e00[_0x579c('0x3e')][_0x579c('0x4b')]){_0x11fd07[_0x579c('0x4c')]=[{'all':!![]}];}return db['ChatWebsite'][_0x579c('0x4d')](_0x11fd07);})['then'](function(_0x3a7e19){_0x3658c4[_0x579c('0x4e')]=_0x3a7e19;return _0x3658c4;})[_0x579c('0x15')](respondWithFilteredResult(_0x4526e3,_0x11fd07))['catch'](handleError(_0x4526e3,null));};exports[_0x579c('0x4f')]=function(_0x4b424f,_0x4a8ed1){var _0x28497b={'raw':![],'where':{'id':_0x4b424f[_0x579c('0x50')]['id']},'include':[{'model':db[_0x579c('0x33')],'as':_0x579c('0x34')}]},_0x4064df={};_0x4064df['model']=_[_0x579c('0x3a')](db[_0x579c('0x36')][_0x579c('0x37')]);_0x4064df[_0x579c('0x3e')]=_[_0x579c('0x3a')](_0x4b424f[_0x579c('0x3e')]);_0x4064df[_0x579c('0x3b')]=_[_0x579c('0x3c')](_0x4064df[_0x579c('0x3d')],_0x4064df['query']);_0x28497b[_0x579c('0x3f')]=_['intersection'](_0x4064df[_0x579c('0x3d')],qs[_0x579c('0x40')](_0x4b424f[_0x579c('0x3e')][_0x579c('0x40')]));_0x28497b['attributes']=_0x28497b[_0x579c('0x3f')][_0x579c('0x41')]?_0x28497b[_0x579c('0x3f')]:_0x4064df[_0x579c('0x3d')];if(_0x4b424f['query'][_0x579c('0x4b')]){_0x28497b['include']=[{'all':!![]}];}_0x28497b=_[_0x579c('0x49')]({},_0x28497b,_0x4b424f[_0x579c('0x51')]);return db[_0x579c('0x36')][_0x579c('0x52')](_0x28497b)[_0x579c('0x15')](handleEntityNotFound(_0x4a8ed1,null))[_0x579c('0x15')](respondWithResult(_0x4a8ed1,null))['catch'](handleError(_0x4a8ed1,null));};exports[_0x579c('0x53')]=function(_0x2ea34a,_0x3e8200){return db['ChatWebsite'][_0x579c('0x53')](_0x2ea34a[_0x579c('0x54')],{})[_0x579c('0x15')](function(_0x333d45){var _0x301880=_0x2ea34a[_0x579c('0x55')][_0x579c('0x2a')]({'plain':!![]});if(!_0x301880)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x301880[_0x579c('0x56')]===_0x579c('0x55')){var _0x5eeef7=_0x333d45[_0x579c('0x2a')]({'plain':!![]});var _0x39ff7d=_0x579c('0x2b');return db[_0x579c('0x57')][_0x579c('0x52')]({'where':{'name':_0x39ff7d,'userProfileId':_0x301880[_0x579c('0x58')]},'raw':!![]})['then'](function(_0x288e4f){if(_0x288e4f&&_0x288e4f[_0x579c('0x59')]===0x0){return db[_0x579c('0x2c')][_0x579c('0x53')]({'name':_0x5eeef7[_0x579c('0x30')],'resourceId':_0x5eeef7['id'],'type':_0x288e4f[_0x579c('0x30')],'sectionId':_0x288e4f['id']},{})['then'](function(){return _0x333d45;});}else{return _0x333d45;}})[_0x579c('0x1f')](function(_0x332724){logger[_0x579c('0x19')](_0x579c('0x5a'),_0x332724);throw _0x332724;});}return _0x333d45;})['then'](respondWithResult(_0x3e8200,0xc9))[_0x579c('0x1f')](handleError(_0x3e8200,null));};exports['update']=function(_0x1afed4,_0x103964){if(_0x1afed4['body']['id']){delete _0x1afed4[_0x579c('0x54')]['id'];}return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x1afed4['params']['id']},'include':[{'model':db['Pause'],'as':_0x579c('0x34')}]})[_0x579c('0x15')](handleEntityNotFound(_0x103964,null))['then'](saveUpdates(_0x1afed4[_0x579c('0x54')],null))[_0x579c('0x15')](respondWithResult(_0x103964,null))['catch'](handleError(_0x103964,null));};exports[_0x579c('0x2d')]=function(_0x3da66e,_0x2359ad){return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x3da66e['params']['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x2359ad,null))[_0x579c('0x15')](removeEntity(_0x2359ad,null))[_0x579c('0x1f')](handleError(_0x2359ad,null));};exports[_0x579c('0x5b')]=function(_0x55ee02,_0x3b010d){return db[_0x579c('0x36')][_0x579c('0x5b')]()[_0x579c('0x15')](respondWithResult(_0x3b010d,null))[_0x579c('0x1f')](handleError(_0x3b010d,null));};exports[_0x579c('0x5c')]=function(_0x417f90,_0x50878f){if(_0x417f90['body']['id']){delete _0x417f90[_0x579c('0x54')]['id'];}return db['ChatWebsite'][_0x579c('0x52')]({'where':{'id':_0x417f90[_0x579c('0x50')]['id']}})['then'](handleEntityNotFound(_0x50878f,null))[_0x579c('0x15')](function(_0x3b37cd){if(_0x3b37cd){_0x417f90[_0x579c('0x54')][_0x579c('0x5d')]=_0x3b37cd['id'];return db[_0x579c('0x5e')]['create'](_0x417f90['body']);}})[_0x579c('0x15')](respondWithResult(_0x50878f,null))[_0x579c('0x1f')](handleError(_0x50878f,null));};exports[_0x579c('0x5f')]=function(_0x15c8db,_0x533ca5){var _0x446f4d={'raw':![],'where':{}};var _0xef0072={};var _0xa96ec4={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x15c8db[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x533ca5,null))[_0x579c('0x15')](function(_0x33edfc){if(_0x33edfc){_0xef0072['model']=_[_0x579c('0x3a')](db[_0x579c('0x5e')][_0x579c('0x37')]);_0xef0072['query']=_[_0x579c('0x3a')](_0x15c8db[_0x579c('0x3e')]);_0xef0072[_0x579c('0x3b')]=_[_0x579c('0x3c')](_0xef0072['model'],_0xef0072[_0x579c('0x3e')]);_0x446f4d[_0x579c('0x3f')]=_[_0x579c('0x3c')](_0xef0072['model'],qs['fields'](_0x15c8db[_0x579c('0x3e')][_0x579c('0x40')]));_0x446f4d[_0x579c('0x3f')]=_0x446f4d[_0x579c('0x3f')][_0x579c('0x41')]?_0x446f4d[_0x579c('0x3f')]:_0xef0072[_0x579c('0x3d')];if(!_0x15c8db[_0x579c('0x3e')][_0x579c('0x42')]('nolimit')){_0x446f4d[_0x579c('0x25')]=qs[_0x579c('0x25')](_0x15c8db[_0x579c('0x3e')][_0x579c('0x25')]);_0x446f4d[_0x579c('0x23')]=qs[_0x579c('0x23')](_0x15c8db[_0x579c('0x3e')][_0x579c('0x23')]);}_0x446f4d[_0x579c('0x44')]=qs['sort'](_0x15c8db[_0x579c('0x3e')]['sort']);_0x446f4d[_0x579c('0x46')]=qs[_0x579c('0x3b')](_[_0x579c('0x47')](_0x15c8db['query'],_0xef0072[_0x579c('0x3b')]));_0x446f4d[_0x579c('0x46')][_0x579c('0x5d')]=_0x33edfc['id'];if(_0x15c8db[_0x579c('0x3e')]['filter']){_0x446f4d[_0x579c('0x46')]=_[_0x579c('0x49')](_0x446f4d[_0x579c('0x46')],{'$or':_['map'](_0x446f4d[_0x579c('0x3f')],function(_0x3fb859){var _0x1a63b5={};_0x1a63b5[_0x3fb859]={'$like':'%'+_0x15c8db[_0x579c('0x3e')][_0x579c('0x48')]+'%'};return _0x1a63b5;})});}_0x446f4d=_['merge']({},_0x446f4d,_0x15c8db[_0x579c('0x51')]);return db['Disposition'][_0x579c('0x26')]({'where':_0x446f4d['where']})[_0x579c('0x15')](function(_0x10cd13){_0xa96ec4[_0x579c('0x26')]=_0x10cd13;if(_0x15c8db[_0x579c('0x3e')][_0x579c('0x4b')]){_0x446f4d['include']=[{'all':!![]}];}return db[_0x579c('0x5e')][_0x579c('0x4d')](_0x446f4d);})[_0x579c('0x15')](function(_0xc8becf){_0xa96ec4[_0x579c('0x4e')]=_0xc8becf;return _0xa96ec4;});}})['then'](respondWithFilteredResult(_0x533ca5,_0x446f4d))['catch'](handleError(_0x533ca5,null));};exports[_0x579c('0x60')]=function(_0x17aa5d,_0x10aa11){return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x17aa5d['params']['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x10aa11,null))['then'](function(_0x50dad3){if(_0x50dad3){return _0x50dad3[_0x579c('0x60')](_0x17aa5d[_0x579c('0x3e')]['ids']);}})['then'](respondWithStatusCode(_0x10aa11,null))[_0x579c('0x1f')](handleError(_0x10aa11,null));};exports['addAnswer']=function(_0x3d733f,_0x4d745c){if(_0x3d733f['body']['id']){delete _0x3d733f[_0x579c('0x54')]['id'];}return db['ChatWebsite'][_0x579c('0x52')]({'where':{'id':_0x3d733f[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x4d745c,null))[_0x579c('0x15')](function(_0x3377b8){if(_0x3377b8){_0x3d733f[_0x579c('0x54')][_0x579c('0x5d')]=_0x3377b8['id'];return db[_0x579c('0x61')][_0x579c('0x53')](_0x3d733f[_0x579c('0x54')]);}})[_0x579c('0x15')](respondWithResult(_0x4d745c,null))[_0x579c('0x1f')](handleError(_0x4d745c,null));};exports['getAnswers']=function(_0x2d2b26,_0x3d55e4){var _0x5ba109={'raw':![],'where':{}};var _0x354c7d={};var _0x36e10d={'count':0x0,'rows':[]};return db[_0x579c('0x36')][_0x579c('0x62')]({'where':{'id':_0x2d2b26[_0x579c('0x50')]['id']}})['then'](handleEntityNotFound(_0x3d55e4,null))[_0x579c('0x15')](function(_0xcf5a3d){if(_0xcf5a3d){_0x354c7d[_0x579c('0x3d')]=_[_0x579c('0x3a')](db[_0x579c('0x61')][_0x579c('0x37')]);_0x354c7d['query']=_['keys'](_0x2d2b26[_0x579c('0x3e')]);_0x354c7d[_0x579c('0x3b')]=_[_0x579c('0x3c')](_0x354c7d[_0x579c('0x3d')],_0x354c7d[_0x579c('0x3e')]);_0x5ba109[_0x579c('0x3f')]=_[_0x579c('0x3c')](_0x354c7d[_0x579c('0x3d')],qs['fields'](_0x2d2b26[_0x579c('0x3e')][_0x579c('0x40')]));_0x5ba109['attributes']=_0x5ba109[_0x579c('0x3f')][_0x579c('0x41')]?_0x5ba109[_0x579c('0x3f')]:_0x354c7d[_0x579c('0x3d')];if(!_0x2d2b26[_0x579c('0x3e')][_0x579c('0x42')](_0x579c('0x43'))){_0x5ba109[_0x579c('0x25')]=qs[_0x579c('0x25')](_0x2d2b26[_0x579c('0x3e')][_0x579c('0x25')]);_0x5ba109[_0x579c('0x23')]=qs[_0x579c('0x23')](_0x2d2b26[_0x579c('0x3e')][_0x579c('0x23')]);}_0x5ba109[_0x579c('0x44')]=qs[_0x579c('0x45')](_0x2d2b26[_0x579c('0x3e')][_0x579c('0x45')]);_0x5ba109['where']=qs[_0x579c('0x3b')](_[_0x579c('0x47')](_0x2d2b26[_0x579c('0x3e')],_0x354c7d[_0x579c('0x3b')]));_0x5ba109[_0x579c('0x46')][_0x579c('0x5d')]=_0xcf5a3d['id'];if(_0x2d2b26['query']['filter']){_0x5ba109[_0x579c('0x46')]=_['merge'](_0x5ba109[_0x579c('0x46')],{'$or':_[_0x579c('0x35')](_0x5ba109['attributes'],function(_0x19cbea){var _0x41aa5b={};_0x41aa5b[_0x19cbea]={'$like':'%'+_0x2d2b26[_0x579c('0x3e')][_0x579c('0x48')]+'%'};return _0x41aa5b;})});}_0x5ba109=_[_0x579c('0x49')]({},_0x5ba109,_0x2d2b26[_0x579c('0x51')]);return db[_0x579c('0x61')][_0x579c('0x26')]({'where':_0x5ba109[_0x579c('0x46')]})[_0x579c('0x15')](function(_0x39efcc){_0x36e10d[_0x579c('0x26')]=_0x39efcc;if(_0x2d2b26[_0x579c('0x3e')][_0x579c('0x4b')]){_0x5ba109['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x579c('0x4d')](_0x5ba109);})['then'](function(_0x1e4ad0){_0x36e10d[_0x579c('0x4e')]=_0x1e4ad0;return _0x36e10d;});}})[_0x579c('0x15')](respondWithFilteredResult(_0x3d55e4,_0x5ba109))[_0x579c('0x1f')](handleError(_0x3d55e4,null));};exports['removeAnswers']=function(_0x403298,_0x36060e){return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x403298[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x36060e,null))[_0x579c('0x15')](function(_0x3d291a){if(_0x3d291a){return _0x3d291a[_0x579c('0x63')](_0x403298['query']['ids']);}})[_0x579c('0x15')](respondWithStatusCode(_0x36060e,null))[_0x579c('0x1f')](handleError(_0x36060e,null));};exports[_0x579c('0x64')]=function(_0x30a43b,_0x54555f){_0x30a43b[_0x579c('0x54')]['sitepic']=_0x30a43b[_0x579c('0x65')][_0x579c('0x66')];return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x30a43b[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x54555f,null))[_0x579c('0x15')](saveUpdates(_0x30a43b['body'],null))[_0x579c('0x15')](respondWithResult(_0x54555f,null))[_0x579c('0x1f')](handleError(_0x54555f,null));};exports['addAvatar']=function(_0x7cb127,_0xfccc4a){_0x7cb127[_0x579c('0x54')][_0x579c('0x67')]=_0x7cb127[_0x579c('0x65')][_0x579c('0x66')];return db['ChatWebsite'][_0x579c('0x52')]({'where':{'id':_0x7cb127[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0xfccc4a,null))[_0x579c('0x15')](saveUpdates(_0x7cb127[_0x579c('0x54')],null))[_0x579c('0x15')](respondWithResult(_0xfccc4a,null))[_0x579c('0x1f')](handleError(_0xfccc4a,null));};exports[_0x579c('0x68')]=function(_0x147a06,_0x5c2ba5){_0x147a06['body']['customerAvatar']=_0x147a06[_0x579c('0x65')]['filename'];return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x147a06['params']['id']}})['then'](handleEntityNotFound(_0x5c2ba5,null))[_0x579c('0x15')](saveUpdates(_0x147a06[_0x579c('0x54')],null))[_0x579c('0x15')](respondWithResult(_0x5c2ba5,null))[_0x579c('0x1f')](handleError(_0x5c2ba5,null));};exports[_0x579c('0x69')]=function(_0xa37af0,_0x8c97cb){_0xa37af0[_0x579c('0x54')]['systemAvatar']=_0xa37af0[_0x579c('0x65')][_0x579c('0x66')];return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0xa37af0[_0x579c('0x50')]['id']}})['then'](handleEntityNotFound(_0x8c97cb,null))[_0x579c('0x15')](saveUpdates(_0xa37af0['body'],null))[_0x579c('0x15')](respondWithResult(_0x8c97cb,null))['catch'](handleError(_0x8c97cb,null));};exports['getLogo']=function(_0x3c81a2,_0xd789d9){var _0x1da1cc=path[_0x579c('0x6a')](config[_0x579c('0x6b')],'server/files/images/logos/default_logo.svg');var _0x4719b2={'where':{'id':_0x3c81a2[_0x579c('0x50')]['id']},'attributes':['id',_0x579c('0x6c')],'raw':!![]};var _0x48da20=![];return require(_0x579c('0x6d'))[_0x579c('0x6e')]()[_0x579c('0x15')](function(_0x353ba8){if(_0x353ba8){_0x48da20=_0x353ba8['custom'];}})[_0x579c('0x15')](function(){return db[_0x579c('0x36')][_0x579c('0x52')](_0x4719b2);})['then'](handleEntityNotFound(_0xd789d9,null))[_0x579c('0x15')](function(_0x4a5097){if(_0x4a5097){if(!_[_0x579c('0x6f')](_0x4a5097[_0x579c('0x6c')])){if(fs[_0x579c('0x70')](path[_0x579c('0x6a')](config[_0x579c('0x6b')],_0x579c('0x71'),_0x4a5097[_0x579c('0x6c')]))&&_0x48da20){_0x1da1cc=path['join'](config[_0x579c('0x6b')],_0x579c('0x71'),_0x4a5097[_0x579c('0x6c')]);}}return _0xd789d9[_0x579c('0x72')](_0x1da1cc);}})['catch'](handleError(_0xd789d9,null));};exports[_0x579c('0x73')]=function(_0x40da02,_0x5be62f){var _0xe967ea=path[_0x579c('0x6a')](config['root'],_0x579c('0x74'));var _0x20ab1e={'where':{'id':_0x40da02[_0x579c('0x50')]['id']},'attributes':['id',_0x579c('0x67')],'raw':!![]};return db[_0x579c('0x36')][_0x579c('0x52')](_0x20ab1e)[_0x579c('0x15')](handleEntityNotFound(_0x5be62f,null))[_0x579c('0x15')](function(_0x1fc9c0){if(_0x1fc9c0){if(!_['isNil'](_0x1fc9c0[_0x579c('0x67')])){if(fs[_0x579c('0x70')](path[_0x579c('0x6a')](config[_0x579c('0x6b')],_0x579c('0x75'),_0x1fc9c0[_0x579c('0x67')]))){_0xe967ea=path[_0x579c('0x6a')](config[_0x579c('0x6b')],_0x579c('0x75'),_0x1fc9c0[_0x579c('0x67')]);}}return _0x5be62f[_0x579c('0x72')](_0xe967ea);}})[_0x579c('0x1f')](handleError(_0x5be62f,null));};exports[_0x579c('0x76')]=function(_0x470673,_0x303eda){var _0x57bb06=path[_0x579c('0x6a')](config['root'],_0x579c('0x77'));var _0x3574dd={'where':{'id':_0x470673[_0x579c('0x50')]['id']},'attributes':['id',_0x579c('0x78'),'showCustomerAvatar'],'raw':!![]};return db[_0x579c('0x36')]['find'](_0x3574dd)['then'](handleEntityNotFound(_0x303eda,null))[_0x579c('0x15')](function(_0x229a0a){if(_0x229a0a){if(!_[_0x579c('0x6f')](_0x229a0a[_0x579c('0x78')])){if(fs[_0x579c('0x70')](path[_0x579c('0x6a')](config['root'],_0x579c('0x75'),_0x229a0a['customerAvatar']))&&_0x229a0a[_0x579c('0x79')]){_0x57bb06=path['join'](config[_0x579c('0x6b')],'server/files/images/avatars/',_0x229a0a[_0x579c('0x78')]);}}return _0x303eda[_0x579c('0x72')](_0x57bb06);}})[_0x579c('0x1f')](handleError(_0x303eda,null));};exports[_0x579c('0x7a')]=function(_0x26e40c,_0x1b0fbb){var _0x226159=path[_0x579c('0x6a')](config[_0x579c('0x6b')],_0x579c('0x7b'));var _0x38c878={'where':{'id':_0x26e40c[_0x579c('0x50')]['id']},'attributes':['id',_0x579c('0x7c')],'raw':!![]};return db[_0x579c('0x36')][_0x579c('0x52')](_0x38c878)[_0x579c('0x15')](handleEntityNotFound(_0x1b0fbb,null))[_0x579c('0x15')](function(_0x1c8d57){if(_0x1c8d57){if(!_[_0x579c('0x6f')](_0x1c8d57['systemAvatar'])){if(fs[_0x579c('0x70')](path[_0x579c('0x6a')](config[_0x579c('0x6b')],_0x579c('0x75'),_0x1c8d57['systemAvatar']))){_0x226159=path[_0x579c('0x6a')](config['root'],_0x579c('0x75'),_0x1c8d57[_0x579c('0x7c')]);}}return _0x1b0fbb[_0x579c('0x72')](_0x226159);}})[_0x579c('0x1f')](handleError(_0x1b0fbb,null));};exports['notify']=function(_0x36136a,_0x5817f2){var _0x2fbc0c=require(_0x579c('0x7d'));var _0x342eda=new _0x2fbc0c();var _0x87264c=_0x342eda[_0x579c('0x7e')](_0x36136a[_0x579c('0x7f')][_0x579c('0x80')])['getResult']();var _0x1f34fe={'body':_0x36136a[_0x579c('0x54')],'channel':_0x579c('0x81')};var _0x3f016d=[];var _0x4da428=[];var _0x5cc70c={};var _0x2888c1=![];return db[_0x579c('0x82')][_0x579c('0x5b')]()[_0x579c('0x15')](function(_0x38e9a2){if(!_0x38e9a2){throw new db[(_0x579c('0x83'))]['ValidationError']('no\x20available\x20attributes');}_0x3f016d=_[_0x579c('0x84')](_[_0x579c('0x3a')](_0x38e9a2),[_0x579c('0x85'),'updatedAt']);_0x4da428=_['difference'](_['keys'](_0x38e9a2),[_0x579c('0x85'),_0x579c('0x86'),_0x579c('0x87'),'ListId']);if(_0x36136a['body']['id']){delete _0x36136a['body']['id'];}if(_[_0x579c('0x6f')](_0x36136a[_0x579c('0x54')][_0x579c('0x88')])){throw new db[(_0x579c('0x83'))][(_0x579c('0x89'))](_0x579c('0x8a'));}if(_[_0x579c('0x6f')](_0x36136a['body'][_0x579c('0x54')])||_0x36136a['body'][_0x579c('0x54')]===''){throw new db[(_0x579c('0x83'))][(_0x579c('0x89'))](_0x579c('0x8b'));}if(_['isNil'](_0x36136a[_0x579c('0x54')]['mapKey'])){throw new db['Sequelize'][(_0x579c('0x89'))](_0x579c('0x8c')+_0x4da428);}if(!_[_0x579c('0x8d')](_0x4da428,_0x36136a['body'][_0x579c('0x8e')])){throw new db[(_0x579c('0x83'))][(_0x579c('0x89'))](_0x579c('0x8f')+_0x4da428);}_0x5cc70c[_0x36136a['body'][_0x579c('0x8e')]]=_0x36136a[_0x579c('0x54')][_0x579c('0x88')];})['then'](function(){return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x36136a[_0x579c('0x50')]['id']},'include':[{'model':db[_0x579c('0x90')],'as':_0x579c('0x91'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x5cc70c,'limit':0x1,'order':[[_0x579c('0x86'),'DESC']]}]},{'model':db[_0x579c('0x92')],'as':_0x579c('0x93')}]});})['then'](handleEntityNotFound(_0x5817f2,null))['then'](function(_0x13aa92){if(_0x13aa92&&_0x13aa92[_0x579c('0x91')]){_0x1f34fe[_0x579c('0x94')]=_0x13aa92;_0x1f34fe[_0x579c('0x95')]=_0x13aa92['Applications'];_0x1f34fe[_0x579c('0x96')]=_0x13aa92[_0x579c('0x91')];_0x1f34fe[_0x579c('0x95')]=_['orderBy'](_0x1f34fe[_0x579c('0x95')],[_0x579c('0x97')],[_0x579c('0x98')]);if(_0x1f34fe[_0x579c('0x94')][_0x579c('0x93')]){delete _0x1f34fe['account'][_0x579c('0x93')];}if(_0x1f34fe['account'][_0x579c('0x91')]&&_0x1f34fe['account'][_0x579c('0x91')]['Contacts'][_0x579c('0x41')]){return _0x1f34fe[_0x579c('0x94')][_0x579c('0x91')][_0x579c('0x99')][0x0];}var _0x23aa12=_[_0x579c('0xd')](_0x36136a[_0x579c('0x54')],{'firstName':_0x36136a[_0x579c('0x54')][_0x579c('0x88')],'ListId':_0x13aa92[_0x579c('0x9a')]});_0x23aa12[_0x36136a[_0x579c('0x54')][_0x579c('0x8e')]]=_0x36136a[_0x579c('0x54')][_0x579c('0x88')];return db['CmContact'][_0x579c('0x53')](_0x23aa12,{'fields':_0x3f016d,'raw':!![]});}})['then'](handleEntityNotFound(_0x5817f2,null))[_0x579c('0x15')](function(_0xe18e9e){_0x1f34fe['contact']=_0xe18e9e;var _0x126557=_0x36136a[_0x579c('0x54')][_0x579c('0x9b')];if(_0x36136a['headers'][_0x579c('0x9c')]){_0x126557=_0x36136a[_0x579c('0x7f')][_0x579c('0x9c')];}else if(_0x36136a[_0x579c('0x7f')]['x-forwarded-for']){_0x126557=_[_0x579c('0x9d')](_0x36136a['headers'][_0x579c('0x9e')][_0x579c('0x9f')](','));}if(_0xe18e9e){var _0x45dbfa={'ContactId':_0xe18e9e['id'],'ChatWebsiteId':_0x36136a[_0x579c('0x50')]['id'],'from':(_0xe18e9e[_0x579c('0xa0')]||'')+'\x20'+(_0xe18e9e['lastName']||''),'customerIp':_0x126557,'customerPort':_0x36136a[_0x579c('0x7f')][_0x579c('0xa1')]?_0x36136a[_0x579c('0x7f')][_0x579c('0xa1')]:null,'referer':_0x36136a[_0x579c('0x54')][_0x579c('0xa2')],'browserName':_0x87264c['browser']['name']&&_0x87264c['browser'][_0x579c('0xa3')]?util['format'](_0x579c('0xa4'),_0x87264c[_0x579c('0xa5')]['name'],_0x87264c[_0x579c('0xa5')][_0x579c('0xa3')]):_0x579c('0xa6'),'browserVersion':_0x87264c[_0x579c('0xa5')][_0x579c('0xa3')]||'unknown','osName':util[_0x579c('0xa7')](_0x579c('0xa4'),_0x87264c['os'][_0x579c('0x30')],_0x87264c['os']['version']),'osVersion':_0x87264c['os'][_0x579c('0xa3')],'deviceModel':_0x87264c['device'][_0x579c('0x3d')]&&_0x87264c[_0x579c('0xa8')][_0x579c('0xa9')]?util[_0x579c('0xa7')](_0x579c('0xaa'),_0x87264c['device'][_0x579c('0x3d')],_0x87264c[_0x579c('0xa8')][_0x579c('0xa9')],_0x87264c[_0x579c('0xa8')][_0x579c('0x38')]):null,'deviceVendor':_0x87264c['device'][_0x579c('0xa9')],'deviceType':_0x87264c[_0x579c('0xa8')][_0x579c('0x38')],'formData':JSON[_0x579c('0x18')](_0x36136a['body'])};var _0x7c0c7a={'ChatWebsiteId':_0x36136a[_0x579c('0x50')]['id'],'closed':![]};if(_0x36136a['body'][_0x579c('0xab')]){_0x7c0c7a[_0x579c('0xab')]=_0x36136a['body'][_0x579c('0xab')];return db['ChatInteraction'][_0x579c('0x52')]({'where':_0x7c0c7a})[_0x579c('0x15')](function(_0xe3b3c4){if(_0xe3b3c4){return[_0xe3b3c4,![]];}_0x45dbfa['threadId']=_0x36136a['body'][_0x579c('0xab')];_0x45dbfa[_0x579c('0xac')]=_0x36136a['body']['externalUrl'];return db[_0x579c('0xad')][_0x579c('0x53')](_0x45dbfa)['then'](function(_0x97d789){return[_0x97d789,!![]];});});}_0x7c0c7a[_0x579c('0xae')]=_0xe18e9e['id'];if(_0x36136a[_0x579c('0x54')][_0x579c('0xaf')]&&_0x36136a[_0x579c('0x54')]['interaction']['id']){_0x7c0c7a['id']=_0x36136a['body'][_0x579c('0xaf')]['id'];return db[_0x579c('0xad')][_0x579c('0x52')]({'where':_0x7c0c7a})[_0x579c('0x15')](function(_0x3ee520){if(_0x3ee520){return[_0x3ee520,![]];}return db[_0x579c('0xad')][_0x579c('0x53')](_0x45dbfa)[_0x579c('0x15')](function(_0x407d6b){return[_0x407d6b,!![]];});});}return db[_0x579c('0xad')][_0x579c('0x53')](_0x45dbfa)[_0x579c('0x15')](function(_0x2d76ce){return[_0x2d76ce,!![]];});}})[_0x579c('0xb0')](function(_0xd80713,_0x1f2111){if(_0xd80713){_0x2888c1=_0x1f2111;if(!_0x1f2111){var _0x522be3={'from':(_0x1f34fe[_0x579c('0xb1')][_0x579c('0xa0')]||'')+'\x20'+(_0x1f34fe[_0x579c('0xb1')]['lastName']||'')};if(_0x36136a[_0x579c('0x54')][_0x579c('0xab')]&&_0x36136a[_0x579c('0x54')][_0x579c('0xb2')]&&_0x36136a['body']['threadId']!=_0x36136a[_0x579c('0x54')][_0x579c('0xb2')]){_0x522be3[_0x579c('0xab')]=_0x36136a[_0x579c('0x54')][_0x579c('0xb2')];}return _0xd80713[_0x579c('0x29')](_0x522be3);}else{return _0xd80713;}}})[_0x579c('0x15')](function(_0x3b1909){_0x1f34fe[_0x579c('0xaf')]=_0x3b1909['get']({'plain':!![]});_0x1f34fe[_0x579c('0xaf')]['created']=_0x2888c1;if(_0x1f34fe[_0x579c('0xaf')]['created']){if(_0x1f34fe['account'][_0x579c('0xb3')]){_0x1f34fe['applications'][_0x579c('0xb4')]({'id':0x0,'priority':_0x1f34fe[_0x579c('0x95')][_0x579c('0x41')]+0x1,'app':_0x579c('0xb5'),'appdata':_0x579c('0xb6'),'interval':_0x579c('0xb7')});}}return db['ChatMessage'][_0x579c('0x53')]({'body':_0x36136a[_0x579c('0x54')]['body'],'ChatWebsiteId':_0x36136a[_0x579c('0x50')]['id'],'ChatInteractionId':_0x3b1909['id'],'direction':'in','ContactId':_0x1f34fe['contact']['id'],'AttachmentId':_0x36136a[_0x579c('0x54')][_0x579c('0xb8')]});})[_0x579c('0x15')](function(_0x26d4c0){_0x1f34fe['message']=_0x26d4c0;if(_0x1f34fe['interaction'][_0x579c('0xb9')]){return db['User'][_0x579c('0x52')]({'attributes':['id',_0x579c('0x30')],'where':{'id':_0x1f34fe[_0x579c('0xaf')]['UserId']}})[_0x579c('0x15')](function(_0x4408be){if(_0x4408be){_0x1f34fe[_0x579c('0x95')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4408be[_0x579c('0x30')]+','+(_0x1f34fe[_0x579c('0x94')][_0x579c('0xba')]||0xa),'interval':_0x579c('0xb7')});_0x1f34fe[_0x579c('0xbb')]=!![];}return respondWithRpcPromise('Start',_0x579c('0xbc'),_0x1f34fe);});}return respondWithRpcPromise(_0x579c('0xbd'),_0x579c('0xbc'),_0x1f34fe);})[_0x579c('0x15')](function(_0x24a080){respondWithRpcPromise(_0x579c('0xbe'),_0x579c('0xbe'),{'event':'notify','message':_0x24a080},client9002);return _0x24a080;})[_0x579c('0x15')](respondWithResult(_0x5817f2,null))[_0x579c('0x1f')](handleError(_0x5817f2,null));};exports[_0x579c('0xbf')]=function(_0x22f930,_0xb6e3d9){var _0xc5d770,_0xf64aac,_0x4e44d9;var _0x26ce63=[];var _0x52288a={};var _0x5abf65=_0x22f930[_0x579c('0xc0')]||[];var _0x29bb9d=[];var _0x125fb7;return db[_0x579c('0x82')][_0x579c('0x5b')]()[_0x579c('0x15')](function(_0x246c91){if(!_0x246c91){throw new db[(_0x579c('0x83'))]['ValidationError']('no\x20available\x20attributes');}_0x26ce63=_[_0x579c('0x84')](_['keys'](_0x246c91),[_0x579c('0x85'),_0x579c('0x86'),_0x579c('0x87'),_0x579c('0x9a')]);if(_0x22f930[_0x579c('0x54')]['id']){delete _0x22f930[_0x579c('0x54')]['id'];}if(_[_0x579c('0x6f')](_0x22f930[_0x579c('0x54')][_0x579c('0x88')])){throw _0xb6e3d9[_0x579c('0x21')](0x1f4)['send'](new db[(_0x579c('0x83'))][(_0x579c('0x89'))](_0x579c('0x8a')));}if(_[_0x579c('0x6f')](_0x22f930[_0x579c('0x54')]['body'])||_0x22f930[_0x579c('0x54')][_0x579c('0x54')]===''){throw _0xb6e3d9[_0x579c('0x21')](0x1f4)[_0x579c('0x31')](new db[(_0x579c('0x83'))]['ValidationError'](_0x579c('0x8b')));}if(_['isNil'](_0x22f930[_0x579c('0x54')][_0x579c('0xc1')])){throw _0xb6e3d9[_0x579c('0x21')](0x1f4)['send'](new db['Sequelize'][(_0x579c('0x89'))](_0x579c('0xc2')+_0x26ce63));}if(!_['includes'](_0x26ce63,_0x22f930[_0x579c('0x54')][_0x579c('0xc1')])){throw _0xb6e3d9[_0x579c('0x21')](0x1f4)['send'](new db['Sequelize'][(_0x579c('0x89'))](_0x579c('0xc3')+_0x26ce63));}_0x52288a[_0x22f930[_0x579c('0x54')]['mapKeyOffline']]=_0x22f930[_0x579c('0x54')]['from'];})['then'](function(){return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x22f930[_0x579c('0x50')]['id']},'include':[{'model':db[_0x579c('0x90')],'as':_0x579c('0x91')},{'model':db['MailAccount'],'as':_0x579c('0xc4')}]});})['then'](handleEntityNotFound(_0xb6e3d9,null))['then'](function(_0x3ed301){if(_0x3ed301&&_0x3ed301[_0x579c('0x91')]){_0xf64aac=_0x3ed301;var _0x6e3600=_[_0x579c('0xd')](_0x22f930[_0x579c('0x54')],{'firstName':_0x22f930[_0x579c('0x54')][_0x579c('0x88')],'phone':_0x22f930[_0x579c('0x54')]['from'],'ListId':_0x3ed301[_0x579c('0x9a')]});_0x6e3600[_0x22f930[_0x579c('0x54')][_0x579c('0xc1')]]=_0x22f930[_0x579c('0x54')][_0x579c('0x88')];return db[_0x579c('0x82')][_0x579c('0xc5')]({'where':_0x52288a,'defaults':_0x6e3600});}})[_0x579c('0xb0')](function(_0x4f1e27){if(_0x4f1e27){_0x4e44d9=_0x4f1e27;var _0x8adb3d=fs[_0x579c('0xc6')](path[_0x579c('0x6a')](config[_0x579c('0x6b')],_0x579c('0xc7')),'utf8');var _0x10c3d2=ejs[_0x579c('0xc8')](_0x8adb3d,{'body':_[_0x579c('0xc9')](_0x22f930[_0x579c('0x54')][_0x579c('0x54')]),'bodyTitle':_0xf64aac[_0x579c('0xca')]});return db['ChatOfflineMessage'][_0x579c('0x53')]({'body':_0x10c3d2,'plainBody':htmlToText[_0x579c('0xcb')](_0x10c3d2),'ContactId':_0x4f1e27['id'],'ChatWebsiteId':_0xf64aac['id']});}})[_0x579c('0x15')](function(_0x7982a){_0x125fb7=_0x7982a;if(_0x5abf65[_0x579c('0x41')]){var _0x34fe88=_0x5abf65['map'](function(_0x1c4f25){return{'name':_0x1c4f25[_0x579c('0xcc')],'basename':_0x1c4f25[_0x579c('0x66')],'type':_0x1c4f25[_0x579c('0xcd')],'ChatOfflineMessageId':_0x7982a['id']};});_0x29bb9d=_0x34fe88['map'](_0x390002=>{var _0x45ce1b={'filename':_0x390002[_0x579c('0x30')],'path':path['join'](config['root'],_0x579c('0xce'),_0x579c('0xc0'),_0x579c('0xcf'),_0x579c('0xd0'),_0x390002['basename'])};return _0x45ce1b;});if(!_0xf64aac[_0x579c('0xd1')]){return db[_0x579c('0xd2')][_0x579c('0xd3')](function(_0x363be0){return db[_0x579c('0xd4')]['bulkCreate'](_0x34fe88,{'transaction':_0x363be0});});}}})[_0x579c('0x15')](function(){if(_0x125fb7){_0xc5d770=_0x125fb7;return db[_0x579c('0xc4')][_0x579c('0x62')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x579c('0xd5'),'raw':!![]}]}]});}})['then'](function(_0x478f50){if(_0x478f50&&_0x478f50[_0x579c('0xd6')]&&_0xf64aac[_0x579c('0xd7')]&&_0xf64aac[_0x579c('0xd8')]){var _0x568446=_0x478f50[_0x579c('0xd9')]();return respondWithRpcPromise(_0x579c('0xda'),_0x579c('0xdb'),{'account':_0x568446,'message':{'from':util[_0x579c('0xa7')]('\x22%s\x22\x20<%s>',_0x478f50[_0x579c('0x30')],_0x478f50[_0x579c('0xdc')]||_0x478f50[_0x579c('0xd6')][_0x579c('0x55')]),'to':_0xf64aac['forwardOfflineAddress'],'subject':_0xf64aac[_0x579c('0xdd')],'html':_0xc5d770[_0x579c('0x54')],'attachments':_0x29bb9d}},client9003)['then'](function(){return _0xc5d770;})['catch'](function(_0x440e27){logger[_0x579c('0x19')](_0x440e27);});}})[_0x579c('0x15')](function(){if(_0xf64aac&&_0xf64aac[_0x579c('0xd1')]&&_0xf64aac['MailAccountId']){var _0x551f6a=[];if(_0x5abf65[_0x579c('0x41')]){_0x551f6a=_0x5abf65['map'](function(_0x5d7d8f){return{'name':_0x5d7d8f[_0x579c('0xcc')],'basename':_0x5d7d8f[_0x579c('0x66')],'type':_0x5d7d8f[_0x579c('0xcd')],'ChatOfflineMessageId':_0x125fb7['id']};});}var _0x543c9a;if(!_[_0x579c('0x6f')](_0xf64aac[_0x579c('0xde')])){var _0x4b8c5a=_[_0x579c('0x35')](_0x22f930[_0x579c('0x54')],function(_0x2b0927){return _0x2b0927;});var _0x3ad619=_[_0x579c('0xdf')](_0x4b8c5a)[0x0];var _0x407317=_['mapValues'](_0x3ad619,function(_0x3fc490){return _0x3fc490;});_0x543c9a=_0x407317[0x1][_0xf64aac['subjectOffline']];}var _0x17d1c9={'from':_0x4e44d9['email'],'firstName':_0x4e44d9['firstName'],'lastName':_0x4e44d9['lastName'],'mapKey':_0x579c('0xdc'),'message':{'from':_0x4e44d9[_0x579c('0xdc')],'to':_0xf64aac[_0x579c('0xc4')][_0x579c('0xdc')],'cc':'','subject':_['isNil'](_0x543c9a)?_0xf64aac[_0x579c('0xdd')]:_0x543c9a,'messageId':'','sentAt':new Date(),'attach':_0x551f6a[_0x579c('0x41')],'attachments':_0x551f6a,'originChannel':_0x579c('0xe0'),'ChatWebsiteId':_0xf64aac['id'],'ChatOfflineMessageId':_0xc5d770['id'],'originTo':_0xf64aac['MailAccount'][_0x579c('0xdc')]},'body':_0xc5d770[_0x579c('0x54')]};var _0x68d5e1={'account':{'id':_0xf64aac[_0x579c('0xe1')]},'body':_0x17d1c9,'log':_0x579c('0xe2')};return respondWithRpcPromise(_0x579c('0xe2'),_0x579c('0xe3'),_0x68d5e1,client9001)['then'](function(){return _0xc5d770;})[_0x579c('0x1f')](function(_0x4b5e75){logger[_0x579c('0x19')](_0x4b5e75);});}return;})[_0x579c('0x15')](function(){if(_0xc5d770){return _0xc5d770;}})['then'](respondWithResult(_0xb6e3d9,null))['catch'](function(_0x340282){logger['error'](_0x579c('0x1f'),_0x340282);for(var _0xaefa4e of _0x5abf65){var _0x52bc5f=path['join'](config[_0x579c('0x6b')],'server',_0x579c('0xc0'),_0x579c('0xcf'),'offline-chat',_0xaefa4e[_0x579c('0x66')]);fs_extra[_0x579c('0xe4')](_0x52bc5f)[_0x579c('0x1f')](function(_0xfa690f){logger[_0x579c('0x19')](_0x579c('0xe5'),_0x52bc5f,_0xfa690f);});}});};exports['addInteraction']=function(_0x3bd55d,_0x488f20){return db[_0x579c('0xad')][_0x579c('0x52')]({'where':{'id':_0x3bd55d[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x488f20,null))[_0x579c('0x15')](function(_0x46c62f){if(_0x46c62f){return _0x46c62f['addInteraction'](_0x3bd55d[_0x579c('0x54')][_0x579c('0xe6')],_['omit'](_0x3bd55d[_0x579c('0x54')],['ids','id'])||{});}})[_0x579c('0x15')](respondWithResult(_0x488f20,null))[_0x579c('0x1f')](handleError(_0x488f20,null));};exports[_0x579c('0xe7')]=function(_0x6e198c,_0x4635b6){var _0x1cfd5a={'raw':![],'where':{}};var _0xb58089={};var _0x22795b={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x579c('0x62')]({'where':{'id':_0x6e198c[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x4635b6,null))[_0x579c('0x15')](function(_0x4b972f){if(_0x4b972f){_0xb58089[_0x579c('0x3d')]=_[_0x579c('0x3a')](db['ChatInteraction'][_0x579c('0x37')]);_0xb58089['query']=_[_0x579c('0x3a')](_0x6e198c[_0x579c('0x3e')]);_0xb58089[_0x579c('0x3b')]=_[_0x579c('0x3c')](_0xb58089[_0x579c('0x3d')],_0xb58089['query']);_0x1cfd5a[_0x579c('0x3f')]=_[_0x579c('0x3c')](_0xb58089[_0x579c('0x3d')],qs[_0x579c('0x40')](_0x6e198c[_0x579c('0x3e')][_0x579c('0x40')]));_0x1cfd5a['attributes']=_0x1cfd5a['attributes'][_0x579c('0x41')]?_0x1cfd5a['attributes']:_0xb58089[_0x579c('0x3d')];if(!_0x6e198c[_0x579c('0x3e')][_0x579c('0x42')](_0x579c('0x43'))){_0x1cfd5a[_0x579c('0x25')]=qs['limit'](_0x6e198c['query'][_0x579c('0x25')]);_0x1cfd5a['offset']=qs[_0x579c('0x23')](_0x6e198c[_0x579c('0x3e')][_0x579c('0x23')]);}_0x1cfd5a[_0x579c('0x44')]=qs[_0x579c('0x45')](_0x6e198c[_0x579c('0x3e')][_0x579c('0x45')]);_0x1cfd5a[_0x579c('0x46')]=qs[_0x579c('0x3b')](_['pick'](_0x6e198c[_0x579c('0x3e')],_0xb58089[_0x579c('0x3b')]));_0x1cfd5a[_0x579c('0x46')][_0x579c('0x5d')]=_0x4b972f['id'];if(_0x6e198c['query']['filter']){_0x1cfd5a[_0x579c('0x46')]=_['merge'](_0x1cfd5a[_0x579c('0x46')],{'$or':_[_0x579c('0x35')](_0x1cfd5a['attributes'],function(_0x4ca45e){var _0xc9f655={};_0xc9f655[_0x4ca45e]={'$like':'%'+_0x6e198c[_0x579c('0x3e')][_0x579c('0x48')]+'%'};return _0xc9f655;})});}_0x1cfd5a=_[_0x579c('0x49')]({},_0x1cfd5a,_0x6e198c[_0x579c('0x51')]);return db[_0x579c('0xad')][_0x579c('0x26')]({'where':_0x1cfd5a['where']})[_0x579c('0x15')](function(_0x3ba470){_0x22795b[_0x579c('0x26')]=_0x3ba470;if(_0x6e198c[_0x579c('0x3e')][_0x579c('0x4b')]){_0x1cfd5a[_0x579c('0x4c')]=[{'model':db[_0x579c('0x82')],'as':_0x579c('0xe8'),'required':![]},{'model':db[_0x579c('0xe9')],'as':_0x579c('0xea'),'attributes':[_0x579c('0x30'),_0x579c('0xeb'),_0x579c('0xec')],'required':![]},{'model':db[_0x579c('0xed')],'as':'Tags','attributes':['id',_0x579c('0x30'),_0x579c('0xee')],'where':_0x6e198c['query'][_0x579c('0xef')]?{'id':_0x6e198c[_0x579c('0x3e')][_0x579c('0xef')]}:undefined,'required':_0x6e198c[_0x579c('0x3e')][_0x579c('0xef')]?!![]:![]}];}return db[_0x579c('0xad')][_0x579c('0x4d')](_0x1cfd5a);})['then'](function(_0x45f94a){_0x22795b[_0x579c('0x4e')]=_0x45f94a;return _0x22795b;});}})[_0x579c('0x15')](respondWithFilteredResult(_0x4635b6,_0x1cfd5a))[_0x579c('0x1f')](handleError(_0x4635b6,null));};function iftimePromise(_0x282da9,_0x29efea){return respondWithRpcPromise(_0x579c('0xf0'),_0x579c('0xf1'),{'command':_0x29efea['timezone']?util[_0x579c('0xa7')](_0x579c('0xf2'),_0x282da9[_0x579c('0xf3')],_0x29efea['timezone']):util['format'](_0x579c('0xf4'),_0x282da9[_0x579c('0xf3')])},client9002)[_0x579c('0x15')](function(_0x3146fd){var _0x415778=_0x3146fd&&_0x3146fd[_0x579c('0xf5')](_0x579c('0xf6'))>=0x0?!![]:![];logger[_0x579c('0x1d')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x29efea['id'],_0x282da9['id'],_0x282da9[_0x579c('0xf3')],_0x415778?_0x579c('0xf7'):_0x579c('0xf8'),_0x29efea[_0x579c('0xf9')]?_0x29efea[_0x579c('0xf9')]:_0x579c('0xfa'));return _0x415778;})[_0x579c('0x1f')](function(_0x34f5fe){logger[_0x579c('0x19')](_0x579c('0xfb'),_0x29efea['id'],_0x282da9['id'],_0x282da9[_0x579c('0xf3')],util[_0x579c('0xfc')](_0x34f5fe,{'showHidden':![],'depth':null}),_0x29efea[_0x579c('0xf9')]?_0x29efea[_0x579c('0xf9')]:_0x579c('0xfa'));return![];});}exports[_0x579c('0xf1')]=function(_0x289669,_0x2332a4){var _0x568406=0x0;var _0x5e3e3b=0x0;var _0x29a239=![];var _0x124c2b;var _0x145580;return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x289669[_0x579c('0x50')]['id']},'include':[{'model':db[_0x579c('0xfd')],'as':'Interval','include':[{'model':db[_0x579c('0xfd')],'as':_0x579c('0xfe'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x579c('0x15')](handleEntityNotFound(_0x2332a4,null))[_0x579c('0x15')](function(_0x47e63e){if(_0x47e63e){_0x124c2b=_0x47e63e;return _0x47e63e[_0x579c('0xff')]({'raw':!![]});}})[_0x579c('0x15')](function(_0x2d19dc){if(_0x124c2b){if(_0x2d19dc){_0x145580=_0x2d19dc;}}return require(_0x579c('0x6d'))['getLicense']();})[_0x579c('0x15')](function(_0x3ca798){if(_0x3ca798){_0x5e3e3b=_0x3ca798[_0x579c('0x100')];_0x29a239=_0x3ca798[_0x579c('0x101')];}})[_0x579c('0x15')](function(){return db[_0x579c('0xad')][_0x579c('0x26')]({'where':{'closed':![]}});})['then'](function(_0x692fb){_0x568406=_0x692fb;if(_0x5e3e3b&&_0x692fb>_0x5e3e3b){return db[_0x579c('0x102')][_0x579c('0x62')]({'where':{'id':0x1}})[_0x579c('0x15')](function(_0xdcb9a5){if(_0xdcb9a5){_0xdcb9a5['increment']('chatLicenseExceeded');}});}})[_0x579c('0x15')](function(){if(_0x124c2b[_0x579c('0xfd')]&&_0x124c2b['Interval'][_0x579c('0xfe')]){var _0x18b041=[];for(var _0x5bbcc5=0x0;_0x5bbcc5<_0x124c2b['Interval'][_0x579c('0xfe')][_0x579c('0x41')];_0x5bbcc5++){var _0x2e6638=_0x124c2b[_0x579c('0xfd')][_0x579c('0xfe')][_0x5bbcc5][_0x579c('0x2a')]({'plain':!![]});_0x18b041[_0x579c('0xb4')](iftimePromise(_0x2e6638,_0x124c2b));}return BPromise[_0x579c('0x103')](_0x18b041)[_0x579c('0x15')](function(_0x286ae6){return _[_0x579c('0x104')](_0x286ae6);});}else{return!![];}})[_0x579c('0x15')](function(_0x251b3b){var _0x873e25=fs[_0x579c('0xc6')](path['join'](config[_0x579c('0x6b')],_0x579c('0x105')),_0x579c('0x106'));var _0x30b1a0=new url[(_0x579c('0x107'))](_0x124c2b[_0x579c('0x108')])[_0x579c('0x109')];var _0x484608='3.1.0';var _0x534574=![];var _0x3a988e={'chatVersion':_0x484608,'chatWebsiteAddressOrigin':_0x30b1a0,'remote':_0x124c2b['remote'],'query':querystring['stringify'](_[_0x579c('0x49')](_0x124c2b['get']({'plain':!![]}),{'customerIp':_0x289669[_0x579c('0x7f')]['x-forwarded-for']||_0x289669['headers'][_0x579c('0x10a')]||_0x289669[_0x579c('0x10b')][_0x579c('0x10c')]||_0x289669['ip'],'referer':_0x289669['headers'][_0x579c('0xa2')],'openedInteractions':_0x568406,'maxInteractions':_0x5e3e3b,'virtual':_0x29a239[_0x579c('0x100')],'online':_0x251b3b,'custom':_0x29a239}))[_0x579c('0x10d')](/'/g,'\x5c\x27')};_0x2332a4[_0x579c('0x31')](ejs['render'](Mustache[_0x579c('0xc8')](_0x873e25,_0x3a988e),{'proactiveActions':_0x145580,'alignment':_0x124c2b[_0x579c('0x10e')],'verticalAlignment':_0x124c2b[_0x579c('0x10f')],'div_color':_0x124c2b[_0x579c('0xee')],'labelText':_0x124c2b['labelText'],'text_color':_0x124c2b[_0x579c('0x110')],'text_button_color':_0x124c2b['textButtonColor'],'button_color':_0x124c2b['color_button'],'background_color':_0x124c2b['backgroundColor'],'hideWhenOffline':_0x124c2b[_0x579c('0x111')],'intervalId':_0x124c2b['IntervalId'],'isDevelopment':_0x534574,'chatVersion':_0x484608}));})[_0x579c('0x1f')](handleError(_0x2332a4,null));};exports['addApplications']=function(_0xaba7ad,_0x33990f){var _0x5e7106=_0xaba7ad[_0x579c('0x50')]['id'];var _0xb80433=_0xaba7ad[_0x579c('0x54')];var _0x4fa8d4=0xc8;var _0x534616=null;return db[_0x579c('0xd2')]['transaction']({'isolationLevel':db[_0x579c('0xd2')][_0x579c('0x112')][_0x579c('0x113')][_0x579c('0x114')]},function(_0x1fd3e3){return db['ChatWebsite']['findOne']({'where':{'id':_0x5e7106},'transaction':_0x1fd3e3})[_0x579c('0x15')](function(_0x1f1c56){if(_0x1f1c56){return db[_0x579c('0x92')][_0x579c('0x2d')]({'where':{'ChatWebsiteId':_0x5e7106},'transaction':_0x1fd3e3})[_0x579c('0x15')](function(){var _0x4e77fc=_[_0x579c('0x35')](_0xb80433,function(_0x5b1fbe){_0x5b1fbe[_0x579c('0x5d')]=_0x5e7106;return _0x5b1fbe;});return db[_0x579c('0x92')][_0x579c('0x115')](_0x4e77fc,{'transaction':_0x1fd3e3});});}else{_0x4fa8d4=0x194;_0x534616=[];}});})['then'](function(){if(_0x4fa8d4!==0x194){return db[_0x579c('0x92')][_0x579c('0x116')]({'where':{'ChatWebsiteId':_0x5e7106},'order':_0x579c('0x97')})[_0x579c('0x15')](function(_0x3f7306){_0x534616=_0x3f7306;});}})['catch'](function(_0x3b48dc){_0x4fa8d4=0x1f4;logger[_0x579c('0x19')](_0x3b48dc[_0x579c('0x2f')]);if(_0x3b48dc[_0x579c('0x30')]){delete _0x3b48dc['name'];}_0x534616=_0x3b48dc;})[_0x579c('0x117')](function(){if(_0x534616===null){_0x33990f['sendStatus'](_0x4fa8d4);}else{if(_0x4fa8d4===0x1f4){_0x33990f[_0x579c('0x21')](_0x4fa8d4)['send'](_0x534616);}else{_0x33990f[_0x579c('0x21')](_0x4fa8d4)[_0x579c('0x22')](_0x534616);}}});};exports[_0x579c('0x118')]=function(_0x2cec7e,_0x28e833){var _0x33cb2b={};var _0x477bc4={};var _0xe06bb6;var _0x4170aa;return db[_0x579c('0x36')]['findOne']({'where':{'id':_0x2cec7e[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x28e833,null))['then'](function(_0x7305bf){if(_0x7305bf){_0xe06bb6=_0x7305bf;_0x477bc4['model']=_[_0x579c('0x3a')](db[_0x579c('0x92')][_0x579c('0x37')]);_0x477bc4[_0x579c('0x3e')]=_[_0x579c('0x3a')](_0x2cec7e[_0x579c('0x3e')]);_0x477bc4[_0x579c('0x3b')]=_[_0x579c('0x3c')](_0x477bc4[_0x579c('0x3d')],_0x477bc4[_0x579c('0x3e')]);_0x33cb2b['attributes']=_[_0x579c('0x3c')](_0x477bc4[_0x579c('0x3d')],qs[_0x579c('0x40')](_0x2cec7e[_0x579c('0x3e')][_0x579c('0x40')]));_0x33cb2b[_0x579c('0x3f')]=_0x33cb2b[_0x579c('0x3f')][_0x579c('0x41')]?_0x33cb2b[_0x579c('0x3f')]:_0x477bc4['model'];_0x33cb2b['order']=qs[_0x579c('0x45')](_0x2cec7e[_0x579c('0x3e')][_0x579c('0x45')]);_0x33cb2b[_0x579c('0x46')]=qs[_0x579c('0x3b')](_['pick'](_0x2cec7e[_0x579c('0x3e')],_0x477bc4[_0x579c('0x3b')]));if(_0x2cec7e[_0x579c('0x3e')][_0x579c('0x48')]){_0x33cb2b[_0x579c('0x46')]=_['merge'](_0x33cb2b[_0x579c('0x46')],{'$or':_[_0x579c('0x35')](_0x33cb2b[_0x579c('0x3f')],function(_0x345dcc){var _0x39451a={};_0x39451a[_0x345dcc]={'$like':'%'+_0x2cec7e[_0x579c('0x3e')]['filter']+'%'};return _0x39451a;})});}_0x33cb2b=_['merge']({},_0x33cb2b,_0x2cec7e[_0x579c('0x51')]);return _0xe06bb6[_0x579c('0x118')](_0x33cb2b);}})[_0x579c('0x15')](function(_0x34d256){if(_0x34d256){_0x4170aa=_0x34d256[_0x579c('0x41')];if(!_0x2cec7e[_0x579c('0x3e')][_0x579c('0x42')](_0x579c('0x43'))){_0x33cb2b[_0x579c('0x25')]=qs['limit'](_0x2cec7e['query']['limit']);_0x33cb2b[_0x579c('0x23')]=qs[_0x579c('0x23')](_0x2cec7e[_0x579c('0x3e')]['offset']);}return _0xe06bb6['getApplications'](_0x33cb2b);}})[_0x579c('0x15')](function(_0x51e0b3){if(_0x51e0b3){return _0x51e0b3?{'count':_0x4170aa,'rows':_0x51e0b3}:null;}})[_0x579c('0x15')](respondWithResult(_0x28e833,null))[_0x579c('0x1f')](handleError(_0x28e833,null));};exports['addProactiveActions']=function(_0x263db5,_0xf4e279){return db[_0x579c('0x119')]['find']({'where':{'id':_0x263db5[_0x579c('0x50')]['id']}})['then'](handleEntityNotFound(_0xf4e279,null))[_0x579c('0x15')](function(_0x17edd0){if(_0x17edd0){return _0x17edd0[_0x579c('0x11a')](_0x263db5[_0x579c('0x54')][_0x579c('0xe6')],_[_0x579c('0x11b')](_0x263db5['body'],['ids','id'])||{});}})[_0x579c('0x15')](respondWithResult(_0xf4e279,null))['catch'](handleError(_0xf4e279,null));};exports['getProactiveActions']=function(_0x18cedb,_0x5ef787){var _0x2bcb1e={};var _0x1745fa={};var _0x254358;var _0x376a24;return db['ChatWebsite']['findOne']({'where':{'id':_0x18cedb['params']['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x5ef787,null))[_0x579c('0x15')](function(_0x1f1593){if(_0x1f1593){_0x254358=_0x1f1593;_0x1745fa[_0x579c('0x3d')]=_['keys'](db['ChatProactiveAction'][_0x579c('0x37')]);_0x1745fa[_0x579c('0x3e')]=_[_0x579c('0x3a')](_0x18cedb[_0x579c('0x3e')]);_0x1745fa['filters']=_[_0x579c('0x3c')](_0x1745fa[_0x579c('0x3d')],_0x1745fa[_0x579c('0x3e')]);_0x2bcb1e['attributes']=_[_0x579c('0x3c')](_0x1745fa[_0x579c('0x3d')],qs[_0x579c('0x40')](_0x18cedb[_0x579c('0x3e')][_0x579c('0x40')]));_0x2bcb1e[_0x579c('0x3f')]=_0x2bcb1e['attributes']['length']?_0x2bcb1e['attributes']:_0x1745fa[_0x579c('0x3d')];_0x2bcb1e[_0x579c('0x44')]=qs['sort'](_0x18cedb[_0x579c('0x3e')]['sort']);_0x2bcb1e['where']=qs[_0x579c('0x3b')](_[_0x579c('0x47')](_0x18cedb[_0x579c('0x3e')],_0x1745fa[_0x579c('0x3b')]));if(_0x18cedb[_0x579c('0x3e')]['filter']){_0x2bcb1e['where']=_['merge'](_0x2bcb1e[_0x579c('0x46')],{'$or':_[_0x579c('0x35')](_0x2bcb1e[_0x579c('0x3f')],function(_0x214f2e){var _0x583cf2={};_0x583cf2[_0x214f2e]={'$like':'%'+_0x18cedb[_0x579c('0x3e')][_0x579c('0x48')]+'%'};return _0x583cf2;})});}_0x2bcb1e=_[_0x579c('0x49')]({},_0x2bcb1e,_0x18cedb[_0x579c('0x51')]);return _0x254358['getProactiveActions'](_0x2bcb1e);}})[_0x579c('0x15')](function(_0x20363d){if(_0x20363d){_0x376a24=_0x20363d[_0x579c('0x41')];if(!_0x18cedb[_0x579c('0x3e')][_0x579c('0x42')](_0x579c('0x43'))){_0x2bcb1e[_0x579c('0x25')]=qs[_0x579c('0x25')](_0x18cedb[_0x579c('0x3e')][_0x579c('0x25')]);_0x2bcb1e[_0x579c('0x23')]=qs[_0x579c('0x23')](_0x18cedb[_0x579c('0x3e')][_0x579c('0x23')]);}return _0x254358[_0x579c('0xff')](_0x2bcb1e);}})[_0x579c('0x15')](function(_0x4d50d8){if(_0x4d50d8){return _0x4d50d8?{'count':_0x376a24,'rows':_0x4d50d8}:null;}})[_0x579c('0x15')](respondWithResult(_0x5ef787,null))[_0x579c('0x1f')](handleError(_0x5ef787,null));};exports[_0x579c('0x11c')]=function(_0x44070e,_0x3b7ffa){var _0x4a7281=_0x44070e[_0x579c('0x3e')]['online']==='false'?_0x579c('0x11d'):_0x579c('0x11e');return db[_0x579c('0x36')][_0x579c('0x52')]({'attributes':['id',_0x4a7281],'where':{'id':_0x44070e['params']['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x3b7ffa,null))['then'](function(_0x460583){if(_0x460583){var _0x3d7a7e=_0x460583[_0x4a7281];var _0x16f299=_0x3d7a7e&&_0x3d7a7e[_0x579c('0x11f')]?_0x3d7a7e[_0x579c('0x11f')]:[];_0x3b7ffa[_0x579c('0x31')]({'fromKey':_['isNil'](_0x3d7a7e[_0x579c('0x120')])?undefined:_0x3d7a7e[_0x579c('0x120')],'count':_0x16f299[_0x579c('0x41')],'rows':_0x16f299});}})['catch'](handleError(_0x3b7ffa,null));};exports[_0x579c('0x121')]=function(_0x51af47,_0x4af1e1){var _0xe0f93c={'raw':![],'where':{}};var _0x393741={};var _0xf9f2a6={'count':0x0,'rows':[]};return db[_0x579c('0x36')][_0x579c('0x62')]({'where':{'id':_0x51af47[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x4af1e1,null))[_0x579c('0x15')](function(_0x50ee6b){if(_0x50ee6b){_0x393741[_0x579c('0x3d')]=_[_0x579c('0x3a')](db[_0x579c('0x122')][_0x579c('0x37')]);_0x393741[_0x579c('0x3e')]=_['keys'](_0x51af47[_0x579c('0x3e')]);_0x393741[_0x579c('0x3b')]=_[_0x579c('0x3c')](_0x393741[_0x579c('0x3d')],_0x393741[_0x579c('0x3e')]);_0xe0f93c[_0x579c('0x3f')]=_[_0x579c('0x3c')](_0x393741[_0x579c('0x3d')],qs[_0x579c('0x40')](_0x51af47[_0x579c('0x3e')][_0x579c('0x40')]));_0xe0f93c[_0x579c('0x3f')]=_0xe0f93c[_0x579c('0x3f')][_0x579c('0x41')]?_0xe0f93c['attributes']:_0x393741[_0x579c('0x3d')];if(!_0x51af47[_0x579c('0x3e')][_0x579c('0x42')](_0x579c('0x43'))){_0xe0f93c[_0x579c('0x25')]=qs[_0x579c('0x25')](_0x51af47[_0x579c('0x3e')]['limit']);_0xe0f93c[_0x579c('0x23')]=qs[_0x579c('0x23')](_0x51af47[_0x579c('0x3e')][_0x579c('0x23')]);}_0xe0f93c[_0x579c('0x44')]=qs[_0x579c('0x45')](_0x51af47[_0x579c('0x3e')][_0x579c('0x45')]);_0xe0f93c['where']=qs[_0x579c('0x3b')](_['pick'](_0x51af47[_0x579c('0x3e')],_0x393741[_0x579c('0x3b')]));_0xe0f93c[_0x579c('0x46')][_0x579c('0x5d')]=_0x50ee6b['id'];if(_0x51af47[_0x579c('0x3e')][_0x579c('0x48')]){_0xe0f93c['where']=_['merge'](_0xe0f93c[_0x579c('0x46')],{'$or':_[_0x579c('0x35')](_0xe0f93c[_0x579c('0x3f')],function(_0x30f78d){var _0x509984={};_0x509984[_0x30f78d]={'$like':'%'+_0x51af47[_0x579c('0x3e')][_0x579c('0x48')]+'%'};return _0x509984;})});}_0xe0f93c=_[_0x579c('0x49')]({},_0xe0f93c,_0x51af47[_0x579c('0x51')]);return db[_0x579c('0x122')]['count']({'where':_0xe0f93c[_0x579c('0x46')]})[_0x579c('0x15')](function(_0x473c4f){_0xf9f2a6[_0x579c('0x26')]=_0x473c4f;if(_0x51af47[_0x579c('0x3e')][_0x579c('0x4b')]){_0xe0f93c[_0x579c('0x4c')]=[{'all':!![]}];}else{_0xe0f93c[_0x579c('0x4c')]=[{'model':db['CmContact'],'as':_0x579c('0xe8'),'required':![]},{'model':db[_0x579c('0xd4')],'as':'Attachments','required':![]}];}return db[_0x579c('0x122')][_0x579c('0x4d')](_0xe0f93c);})[_0x579c('0x15')](function(_0xd7d6c1){_0xf9f2a6[_0x579c('0x4e')]=_0xd7d6c1;return _0xf9f2a6;});}})[_0x579c('0x15')](respondWithFilteredResult(_0x4af1e1,_0xe0f93c))[_0x579c('0x1f')](handleError(_0x4af1e1,null));};exports[_0x579c('0x123')]=function(_0x2968df,_0x119794){return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x2968df[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x119794,null))['then'](function(_0x2f520d){if(_0x2f520d){return _0x2f520d[_0x579c('0x123')](_0x2968df['body'][_0x579c('0xe6')],_[_0x579c('0x11b')](_0x2968df[_0x579c('0x54')],[_0x579c('0xe6'),'id'])||{})['spread'](function(_0x354b84){for(var _0x6d64e=0x0;_0x6d64e<_0x2968df['body']['ids']['length'];_0x6d64e+=0x1){socket[_0x579c('0x124')]('userChatWebsite:save',{'UserId':Number(_0x2968df['body'][_0x579c('0xe6')][_0x6d64e]),'ChatWebsiteId':Number(_0x2968df['params']['id'])});}return _0x354b84;});}})[_0x579c('0x15')](respondWithResult(_0x119794,null))['catch'](handleError(_0x119794,null));};exports[_0x579c('0x125')]=function(_0x18d144,_0x45e569){return db['ChatWebsite']['find']({'where':{'id':_0x18d144[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x45e569,null))[_0x579c('0x15')](function(_0xfc0fac){if(_0xfc0fac){return _0xfc0fac[_0x579c('0x125')](_0x18d144[_0x579c('0x3e')][_0x579c('0xe6')])['then'](function(){if(_[_0x579c('0x126')](_0x18d144[_0x579c('0x3e')][_0x579c('0xe6')])){for(var _0xdcd95c=0x0;_0xdcd95c<_0x18d144[_0x579c('0x3e')][_0x579c('0xe6')]['length'];_0xdcd95c+=0x1){socket[_0x579c('0x124')](_0x579c('0x127'),{'UserId':Number(_0x18d144[_0x579c('0x3e')][_0x579c('0xe6')][_0xdcd95c]),'ChatWebsiteId':Number(_0x18d144['params']['id'])});}}else{socket[_0x579c('0x124')](_0x579c('0x127'),{'UserId':Number(_0x18d144[_0x579c('0x3e')][_0x579c('0xe6')]),'ChatWebsiteId':Number(_0x18d144['params']['id'])});}});}})[_0x579c('0x15')](respondWithStatusCode(_0x45e569,null))[_0x579c('0x1f')](handleError(_0x45e569,null));};exports[_0x579c('0x128')]=function(_0x38d137,_0x1280dc){var _0x4ae796={};var _0x176441={};var _0x3bd037;var _0x52a1d4;return db['ChatWebsite']['findOne']({'where':{'id':_0x38d137[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x1280dc,null))[_0x579c('0x15')](function(_0x22a3cb){if(_0x22a3cb){_0x3bd037=_0x22a3cb;_0x176441['model']=_[_0x579c('0x3a')](db['User'][_0x579c('0x37')]);_0x176441['query']=_[_0x579c('0x3a')](_0x38d137[_0x579c('0x3e')]);_0x176441[_0x579c('0x3b')]=_[_0x579c('0x3c')](_0x176441[_0x579c('0x3d')],_0x176441[_0x579c('0x3e')]);_0x4ae796[_0x579c('0x3f')]=_[_0x579c('0x3c')](_0x176441[_0x579c('0x3d')],qs[_0x579c('0x40')](_0x38d137['query'][_0x579c('0x40')]));_0x4ae796[_0x579c('0x3f')]=_0x4ae796[_0x579c('0x3f')]['length']?_0x4ae796['attributes']:_0x176441[_0x579c('0x3d')];_0x4ae796['order']=qs['sort'](_0x38d137[_0x579c('0x3e')][_0x579c('0x45')]);_0x4ae796['where']=qs[_0x579c('0x3b')](_[_0x579c('0x47')](_0x38d137[_0x579c('0x3e')],_0x176441['filters']));if(_0x38d137['query']['filter']){_0x4ae796[_0x579c('0x46')]=_['merge'](_0x4ae796[_0x579c('0x46')],{'$or':_['map'](_0x4ae796['attributes'],function(_0x2e6b62){var _0x365695={};_0x365695[_0x2e6b62]={'$like':'%'+_0x38d137[_0x579c('0x3e')][_0x579c('0x48')]+'%'};return _0x365695;})});}_0x4ae796=_[_0x579c('0x49')]({},_0x4ae796,_0x38d137[_0x579c('0x51')]);return _0x3bd037['getAgents'](_0x4ae796);}})[_0x579c('0x15')](function(_0x4eadc7){if(_0x4eadc7){_0x52a1d4=_0x4eadc7[_0x579c('0x41')];if(!_0x38d137[_0x579c('0x3e')][_0x579c('0x42')](_0x579c('0x43'))){_0x4ae796[_0x579c('0x25')]=qs[_0x579c('0x25')](_0x38d137[_0x579c('0x3e')]['limit']);_0x4ae796['offset']=qs['offset'](_0x38d137[_0x579c('0x3e')][_0x579c('0x23')]);}return _0x3bd037[_0x579c('0x128')](_0x4ae796);}})[_0x579c('0x15')](function(_0x561fa7){if(_0x561fa7){return _0x561fa7?{'count':_0x52a1d4,'rows':_0x561fa7}:null;}})[_0x579c('0x15')](respondWithResult(_0x1280dc,null))[_0x579c('0x1f')](handleError(_0x1280dc,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 3fc5062..a5190d6 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 _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 +var _0x6b4e=['emit','hasOwnProperty','hook','exports','../../mysqldb','remove'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x6b4e,0x1a8));var _0xe6b4=function(_0x4cba09,_0x169035){_0x4cba09=_0x4cba09-0x0;var _0x1d626e=_0x6b4e[_0x4cba09];return _0x1d626e;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xe6b4('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe6b4('0x1')};function emitEvent(_0x3be9b1){return function(_0x1aedc5,_0x344db1,_0x436fc0){ChatWebsiteEvents[_0xe6b4('0x2')](_0x3be9b1+':'+_0x1aedc5['id'],_0x1aedc5);ChatWebsiteEvents['emit'](_0x3be9b1,_0x1aedc5);_0x436fc0(null);};}for(var e in events){if(events[_0xe6b4('0x3')](e)){var event=events[e];ChatWebsite[_0xe6b4('0x4')](e,emitEvent(event));}}module[_0xe6b4('0x5')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 134ea35..458002c 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 _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 +var _0xea56=['moment','request-promise','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api'];(function(_0x597db9,_0x5a8c52){var _0xc6120b=function(_0x33c6bc){while(--_0x33c6bc){_0x597db9['push'](_0x597db9['shift']());}};_0xc6120b(++_0x5a8c52);}(_0xea56,0x74));var _0x6ea5=function(_0x281353,_0x5d53a9){_0x281353=_0x281353-0x0;var _0x4f4e7b=_0xea56[_0x281353];return _0x4f4e7b;};'use strict';var _=require(_0x6ea5('0x0'));var util=require(_0x6ea5('0x1'));var logger=require(_0x6ea5('0x2'))(_0x6ea5('0x3'));var moment=require(_0x6ea5('0x4'));var BPromise=require('bluebird');var rp=require(_0x6ea5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ea5('0x6'));var config=require('../../config/environment');var attributes=require(_0x6ea5('0x7'));module[_0x6ea5('0x8')]=function(_0x4e2953,_0x218b92){return _0x4e2953[_0x6ea5('0x9')](_0x6ea5('0xa'),attributes,{'tableName':_0x6ea5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index f028acd..14abb62 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 _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 +var _0x16fb=['jayson/promise','client','http','redis','defaults','localhost','./chatWebsite.socket','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x211791,_0xb1b929){var _0x198234=function(_0x43ee1f){while(--_0x43ee1f){_0x211791['push'](_0x211791['shift']());}};_0x198234(++_0xb1b929);}(_0x16fb,0x189));var _0xb16f=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x16fb[_0x3305de];return _0x3b5a84;};'use strict';var _=require(_0xb16f('0x0'));var util=require(_0xb16f('0x1'));var moment=require('moment');var BPromise=require(_0xb16f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb16f('0x3'));var db=require(_0xb16f('0x4'))['db'];var utils=require(_0xb16f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb16f('0x6'));var jayson=require(_0xb16f('0x7'));var client=jayson[_0xb16f('0x8')][_0xb16f('0x9')]({'port':0x232a});config[_0xb16f('0xa')]=_[_0xb16f('0xb')](config[_0xb16f('0xa')],{'host':_0xb16f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb16f('0xa')]));require(_0xb16f('0xd'))['register'](socket);function respondWithRpcPromise(_0xeab76,_0x1d65d4,_0x2601fc){return new BPromise(function(_0x2ed95e,_0x31427c){return client[_0xb16f('0xe')](_0xeab76,_0x2601fc)['then'](function(_0x89c532){logger['info'](_0xb16f('0xf'),_0x1d65d4,_0xb16f('0x10'));logger[_0xb16f('0x11')](_0xb16f('0x12'),_0x1d65d4,'request\x20sent',JSON[_0xb16f('0x13')](_0x89c532));if(_0x89c532[_0xb16f('0x14')]){if(_0x89c532[_0xb16f('0x14')]['code']===0x1f4){logger['error'](_0xb16f('0xf'),_0x1d65d4,_0x89c532[_0xb16f('0x14')][_0xb16f('0x15')]);return _0x31427c(_0x89c532[_0xb16f('0x14')][_0xb16f('0x15')]);}logger['error'](_0xb16f('0xf'),_0x1d65d4,_0x89c532['error'][_0xb16f('0x15')]);return _0x2ed95e(_0x89c532[_0xb16f('0x14')][_0xb16f('0x15')]);}else{logger[_0xb16f('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x1d65d4,'request\x20sent');_0x2ed95e(_0x89c532[_0xb16f('0x17')][_0xb16f('0x15')]);}})[_0xb16f('0x18')](function(_0x40099b){logger[_0xb16f('0x14')](_0xb16f('0xf'),_0x1d65d4,_0x40099b);_0x31427c(_0x40099b);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 9b2ac41..31402cc 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 _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 +var _0x3e7f=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x3e7f,0x66));var _0xf3e7=function(_0x2c9db3,_0x47f183){_0x2c9db3=_0x2c9db3-0x0;var _0x2d7879=_0x3e7f[_0x2c9db3];return _0x2d7879;};'use strict';var ChatWebsiteEvents=require(_0xf3e7('0x0'));var events=[_0xf3e7('0x1'),_0xf3e7('0x2'),'update'];function createListener(_0x3db708,_0x4382e2){return function(_0xdde034){_0x4382e2[_0xf3e7('0x3')](_0x3db708,_0xdde034);};}function removeListener(_0x27e628,_0x208207){return function(){ChatWebsiteEvents[_0xf3e7('0x4')](_0x27e628,_0x208207);};}exports[_0xf3e7('0x5')]=function(_0x429845){for(var _0x23c1be=0x0,_0x1c98ce=events[_0xf3e7('0x6')];_0x23c1be<_0x1c98ce;_0x23c1be++){var _0x33e6d4=events[_0x23c1be];var _0x5133ed=createListener(_0xf3e7('0x7')+_0x33e6d4,_0x429845);ChatWebsiteEvents['on'](_0x33e6d4,_0x5133ed);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 2673a54..75626cd 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 _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 +var _0x60ba=['addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','single','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','/:id/users','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x60ba,0x75));var _0xa60b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x60ba[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0xa60b('0x0'));var util=require('util');var path=require(_0xa60b('0x1'));var timeout=require(_0xa60b('0x2'));var express=require(_0xa60b('0x3'));var router=express['Router']();var fs_extra=require(_0xa60b('0x4'));var auth=require(_0xa60b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa60b('0x6'));var controller=require('./chatWebsite.controller');router[_0xa60b('0x7')]('/',auth[_0xa60b('0x8')](),controller[_0xa60b('0x9')]);router['get'](_0xa60b('0xa'),auth[_0xa60b('0x8')](),controller[_0xa60b('0xb')]);router[_0xa60b('0x7')](_0xa60b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa60b('0x7')](_0xa60b('0xd'),auth[_0xa60b('0x8')](),controller[_0xa60b('0xe')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0xa60b('0x7')](_0xa60b('0xf'),controller[_0xa60b('0x10')]);router['get'](_0xa60b('0x11'),controller[_0xa60b('0x12')]);router[_0xa60b('0x7')](_0xa60b('0x13'),controller[_0xa60b('0x14')]);router[_0xa60b('0x7')](_0xa60b('0x15'),controller[_0xa60b('0x16')]);router[_0xa60b('0x7')](_0xa60b('0x17'),auth['isAuthenticated'](),controller[_0xa60b('0x18')]);router[_0xa60b('0x7')](_0xa60b('0x19'),controller[_0xa60b('0x1a')]);router['get'](_0xa60b('0x1b'),auth[_0xa60b('0x8')](),controller[_0xa60b('0x1c')]);router[_0xa60b('0x7')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['getProactiveActions']);router[_0xa60b('0x7')]('/:id/fields',controller[_0xa60b('0x1d')]);router[_0xa60b('0x7')](_0xa60b('0x1e'),auth[_0xa60b('0x8')](),controller[_0xa60b('0x1f')]);router[_0xa60b('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0xa60b('0x20')]);router[_0xa60b('0x21')]('/',auth['isAuthenticated'](),controller[_0xa60b('0x22')]);router[_0xa60b('0x21')](_0xa60b('0xd'),auth['isAuthenticated'](),controller[_0xa60b('0x23')]);router[_0xa60b('0x21')](_0xa60b('0x24'),auth[_0xa60b('0x8')](),controller[_0xa60b('0x25')]);var upload=multer({'storage':multer[_0xa60b('0x26')]({'destination':function(_0x689af6,_0x11b48d,_0xc01aee){_0xc01aee(null,path[_0xa60b('0x27')](config[_0xa60b('0x28')],_0xa60b('0x29')));},'filename':function(_0x13c32f,_0x72ea3c,_0x91b38e){_0x91b38e(null,util[_0xa60b('0x2a')](_0xa60b('0x2b'),Date[_0xa60b('0x2c')](),_0x72ea3c[_0xa60b('0x2d')]));}})});router[_0xa60b('0x21')](_0xa60b('0xf'),upload['single'](_0xa60b('0x2e')),controller[_0xa60b('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x506f42,_0x398809,_0x29b1ab){_0x29b1ab(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x149b6b,_0x542cb0,_0xb99965){_0xb99965(null,util[_0xa60b('0x2a')](_0xa60b('0x2b'),Date[_0xa60b('0x2c')](),_0x542cb0[_0xa60b('0x2d')]));}})});router[_0xa60b('0x21')](_0xa60b('0x11'),upload[_0xa60b('0x30')]('file'),controller[_0xa60b('0x31')]);var upload=multer({'storage':multer[_0xa60b('0x26')]({'destination':function(_0x547883,_0x104050,_0x40b6de){_0x40b6de(null,path[_0xa60b('0x27')](config[_0xa60b('0x28')],_0xa60b('0x32')));},'filename':function(_0x1cf202,_0x584656,_0x5935c2){_0x5935c2(null,util[_0xa60b('0x2a')]('%s-%s',Date['now'](),_0x584656[_0xa60b('0x2d')]));}})});router['post']('/:id/customer_avatar',upload[_0xa60b('0x30')]('file'),controller[_0xa60b('0x33')]);var upload=multer({'storage':multer[_0xa60b('0x26')]({'destination':function(_0x52a201,_0x4f4af1,_0x5be19c){_0x5be19c(null,path[_0xa60b('0x27')](config[_0xa60b('0x28')],'server/files/images/avatars/'));},'filename':function(_0x1e7419,_0x381ed7,_0x567624){_0x567624(null,util['format'](_0xa60b('0x2b'),Date[_0xa60b('0x2c')](),_0x381ed7['originalname']));}})});router[_0xa60b('0x21')](_0xa60b('0x15'),upload[_0xa60b('0x30')]('file'),controller[_0xa60b('0x34')]);router[_0xa60b('0x21')](_0xa60b('0x35'),controller[_0xa60b('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0xa60b('0x26')]({'destination':function(_0x89709c,_0x45ea85,_0x1e1b84){const _0x1d161b=path['join'](config['root'],_0xa60b('0x37'),_0xa60b('0x38'),_0xa60b('0x39'));fs_extra[_0xa60b('0x3a')](_0x1d161b,function(){_0x1e1b84(null,_0x1d161b);});},'filename':function(_0x146f5f,_0x105650,_0x3265c4){const _0x2cbd85=_0x105650[_0xa60b('0x2d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3d2e8e=path[_0xa60b('0x3b')](_0x2cbd85);const _0x5219f6=Date[_0xa60b('0x2c')]()+'-'+_0x2cbd85[_0xa60b('0x3c')](_0x3d2e8e,'')+_0x3d2e8e;_0x3265c4(null,_0x5219f6);}})});router['post'](_0xa60b('0x3d'),offlineUploadMulter[_0xa60b('0x3e')](),controller[_0xa60b('0x3f')]);router[_0xa60b('0x21')](_0xa60b('0x17'),auth[_0xa60b('0x8')](),controller[_0xa60b('0x40')]);router[_0xa60b('0x21')](_0xa60b('0x1b'),auth[_0xa60b('0x8')](),controller[_0xa60b('0x41')]);router[_0xa60b('0x21')](_0xa60b('0x42'),auth[_0xa60b('0x8')](),controller[_0xa60b('0x43')]);router[_0xa60b('0x21')](_0xa60b('0x44'),auth[_0xa60b('0x8')](),controller[_0xa60b('0x45')]);router[_0xa60b('0x46')](_0xa60b('0xc'),auth[_0xa60b('0x8')](),controller[_0xa60b('0x47')]);router[_0xa60b('0x48')]('/:id',auth[_0xa60b('0x8')](),controller[_0xa60b('0x49')]);router[_0xa60b('0x48')](_0xa60b('0xd'),auth[_0xa60b('0x8')](),controller['removeDispositions']);router[_0xa60b('0x48')]('/:id/canned_answers',auth[_0xa60b('0x8')](),controller[_0xa60b('0x4a')]);router[_0xa60b('0x48')](_0xa60b('0x44'),auth[_0xa60b('0x8')](),controller[_0xa60b('0x4b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 74b74b4..d0d23b5 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 _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 +var _0x7db1=['Router','production','app','get','client-side-logger','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment'];(function(_0x2ea174,_0xb3181){var _0x5987c7=function(_0x3f7c44){while(--_0x3f7c44){_0x2ea174['push'](_0x2ea174['shift']());}};_0x5987c7(++_0xb3181);}(_0x7db1,0x1ca));var _0x17db=function(_0x3a1972,_0x194511){_0x3a1972=_0x3a1972-0x0;var _0xc7e0b5=_0x7db1[_0x3a1972];return _0xc7e0b5;};var beaverLogger=require(_0x17db('0x0'));var express=require(_0x17db('0x1'));var auth=require(_0x17db('0x2'));var config=require(_0x17db('0x3'));var router=express[_0x17db('0x4')]();var isProduction=config['env']===_0x17db('0x5')||![];function clientSideLogs(_0x35e5ae,_0x47aa41,_0x3d8d6b){var _0x43e41d=_0x35e5ae[_0x17db('0x6')][_0x17db('0x7')](_0x17db('0x8'));if(!_0x43e41d){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x17db('0x9')]({'uri':_0x17db('0xa'),'logger':_0x43e41d,'enableCors':!isProduction})(_0x35e5ae,_0x47aa41,_0x3d8d6b);}router[_0x17db('0xb')](auth[_0x17db('0xc')](),clientSideLogs);module[_0x17db('0xd')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 6b13536..b583944 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 _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 +var _0x5c66=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x5f4585,_0x287c9f){var _0x32b347=function(_0x301639){while(--_0x301639){_0x5f4585['push'](_0x5f4585['shift']());}};_0x32b347(++_0x287c9f);}(_0x5c66,0xd7));var _0x65c6=function(_0xf46740,_0x2d49e0){_0xf46740=_0xf46740-0x0;var _0x46361a=_0x5c66[_0xf46740];return _0x46361a;};'use strict';var Sequelize=require(_0x65c6('0x0'));module[_0x65c6('0x1')]={'name':{'type':Sequelize[_0x65c6('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x65c6('0x3')](_0x65c6('0x4'),_0x65c6('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x65c6('0x6'),_0x65c6('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':_0x65c6('0x8')},'data2':{'type':Sequelize[_0x65c6('0x2')],'comment':_0x65c6('0x9')},'data3':{'type':Sequelize[_0x65c6('0x2')],'comment':_0x65c6('0xa')},'data4':{'type':Sequelize[_0x65c6('0x2')],'comment':_0x65c6('0xb')},'data5':{'type':Sequelize[_0x65c6('0xc')],'comment':_0x65c6('0xd')},'data6':{'type':Sequelize['TEXT'],'comment':_0x65c6('0xe')},'data7':{'type':Sequelize[_0x65c6('0xc')],'comment':_0x65c6('0xf')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index b176b8a..2d7c4cc 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 _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 +var _0x581c=['base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','end','error','stack','name','send','padEnd','slice','index','CloudProvider','fieldName','type','key','filters','intersection','model','query','attributes','fields','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','service','decryptString','data3','catch','show','params','keys','length','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','rawAttributes','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state'];(function(_0x31a201,_0x1fc5c7){var _0x5c8148=function(_0x49c045){while(--_0x49c045){_0x31a201['push'](_0x31a201['shift']());}};_0x5c8148(++_0x1fc5c7);}(_0x581c,0x78));var _0xc581=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x581c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc581('0x0'));var Redis=require('ioredis');var qs=require(_0xc581('0x1'));var encryptor=require(_0xc581('0x2'));var config=require('../../config/environment');var logger=require(_0xc581('0x3'))(_0xc581('0x4'));var db=require('../../mysqldb')['db'];var oauth=require(_0xc581('0x5'));config[_0xc581('0x6')]=_[_0xc581('0x7')](config['redis'],{'host':_0xc581('0x8'),'port':0x18eb});var socket=require(_0xc581('0x9'))(new Redis(config['redis']));var redis=new Redis(config[_0xc581('0x6')]);function respondWithStatusCode(_0x523113,_0x4daa8e){_0x4daa8e=_0x4daa8e||0xcc;return function(_0x503b7a){if(_0x503b7a){return _0x523113[_0xc581('0xa')](_0x4daa8e);}return _0x523113[_0xc581('0xb')](_0x4daa8e)['end']();};}function respondWithResult(_0x570a86,_0x47557e){_0x47557e=_0x47557e||0xc8;return function(_0x5018e){if(_0x5018e){return _0x570a86[_0xc581('0xb')](_0x47557e)['json'](_0x5018e);}};}function respondWithFilteredResult(_0x325e5c,_0x5b4a7a){return function(_0x1b7af9){if(_0x1b7af9){var _0x5cec5a=typeof _0x5b4a7a[_0xc581('0xc')]===_0xc581('0xd')&&typeof _0x5b4a7a[_0xc581('0xe')]==='undefined';var _0xd7f203=_0x1b7af9['count'];var _0x5dae41=_0x5cec5a?0x0:_0x5b4a7a[_0xc581('0xc')];var _0x553a80=_0x5cec5a?_0x1b7af9[_0xc581('0xf')]:_0x5b4a7a[_0xc581('0xc')]+_0x5b4a7a[_0xc581('0xe')];var _0x2301a0;if(_0x553a80>=_0xd7f203){_0x553a80=_0xd7f203;_0x2301a0=0xc8;}else{_0x2301a0=0xce;}_0x325e5c[_0xc581('0xb')](_0x2301a0);return _0x325e5c[_0xc581('0x10')](_0xc581('0x11'),_0x5dae41+'-'+_0x553a80+'/'+_0xd7f203)[_0xc581('0x12')](_0x1b7af9);}return null;};}function saveUpdates(_0x3e2400){return function(_0x3d9f26){if(_0x3d9f26){return _0x3d9f26[_0xc581('0x13')](_0x3e2400)[_0xc581('0x14')](function(_0x514dc4){return _0x514dc4;});}return null;};}function removeEntity(_0x131a98){return function(_0x3de59f){if(_0x3de59f){return _0x3de59f[_0xc581('0x15')]()[_0xc581('0x14')](function(){_0x131a98[_0xc581('0xb')](0xcc)[_0xc581('0x16')]();});}};}function handleEntityNotFound(_0x53bb19){return function(_0x1936b5){if(!_0x1936b5){_0x53bb19[_0xc581('0xa')](0x194);}return _0x1936b5;};}function handleError(_0x47a548,_0x1b1f79){_0x1b1f79=_0x1b1f79||0x1f4;return function(_0x46ccc4){logger[_0xc581('0x17')](_0x46ccc4[_0xc581('0x18')]);if(_0x46ccc4[_0xc581('0x19')]){delete _0x46ccc4['name'];}_0x47a548['status'](_0x1b1f79)[_0xc581('0x1a')](_0x46ccc4);};}function maskClientSecret(_0xf9ada2){return _[_0xc581('0x1b')](_0xf9ada2[_0xc581('0x1c')](0x0,0x3),0x14,'*');}exports[_0xc581('0x1d')]=function(_0x41e726,_0x54139c){var _0x1b3348={},_0x1f0cf6={},_0x21be13={'count':0x0,'rows':[]};var _0x13e487=_['map'](db[_0xc581('0x1e')]['rawAttributes'],function(_0x1df3d1){return{'name':_0x1df3d1[_0xc581('0x1f')],'type':_0x1df3d1[_0xc581('0x20')][_0xc581('0x21')]};});_0x1f0cf6['model']=_['map'](_0x13e487,_0xc581('0x19'));_0x1f0cf6['query']=_['keys'](_0x41e726['query']);_0x1f0cf6[_0xc581('0x22')]=_[_0xc581('0x23')](_0x1f0cf6[_0xc581('0x24')],_0x1f0cf6[_0xc581('0x25')]);_0x1b3348[_0xc581('0x26')]=_['intersection'](_0x1f0cf6[_0xc581('0x24')],qs[_0xc581('0x27')](_0x41e726[_0xc581('0x25')]['fields']));_0x1b3348[_0xc581('0x26')]=_0x1b3348[_0xc581('0x26')]['length']?_0x1b3348[_0xc581('0x26')]:_0x1f0cf6[_0xc581('0x24')];if(!_0x41e726[_0xc581('0x25')]['hasOwnProperty'](_0xc581('0x28'))){_0x1b3348[_0xc581('0xe')]=qs[_0xc581('0xe')](_0x41e726[_0xc581('0x25')][_0xc581('0xe')]);_0x1b3348['offset']=qs['offset'](_0x41e726[_0xc581('0x25')][_0xc581('0xc')]);}_0x1b3348[_0xc581('0x29')]=qs['sort'](_0x41e726[_0xc581('0x25')][_0xc581('0x2a')]);_0x1b3348[_0xc581('0x2b')]=qs[_0xc581('0x22')](_[_0xc581('0x2c')](_0x41e726[_0xc581('0x25')],_0x1f0cf6[_0xc581('0x22')]),_0x13e487);if(_0x41e726['query'][_0xc581('0x2d')]){_0x1b3348['where']=_[_0xc581('0x2e')](_0x1b3348['where'],{'$or':_[_0xc581('0x2f')](_0x13e487,function(_0x994fb8){if(_0x994fb8[_0xc581('0x20')]!==_0xc581('0x30')){var _0xf33e45={};_0xf33e45[_0x994fb8[_0xc581('0x19')]]={'$like':'%'+_0x41e726[_0xc581('0x25')][_0xc581('0x2d')]+'%'};return _0xf33e45;}})});}_0x1b3348=_[_0xc581('0x2e')]({},_0x1b3348,_0x41e726[_0xc581('0x31')]);var _0x3874c7={'where':_0x1b3348['where']};return db[_0xc581('0x1e')]['count'](_0x3874c7)[_0xc581('0x14')](function(_0x3863c7){_0x21be13[_0xc581('0xf')]=_0x3863c7;if(_0x41e726[_0xc581('0x25')][_0xc581('0x32')]){_0x1b3348[_0xc581('0x33')]=[{'all':!![]}];}return db[_0xc581('0x1e')][_0xc581('0x34')](_0x1b3348);})[_0xc581('0x14')](function(_0x2f7310){_0x21be13[_0xc581('0x35')]=_[_0xc581('0x2f')](_0x2f7310,function(_0x57d21b){if(_0x57d21b[_0xc581('0x36')]==='MicrosoftAzure'){var _0x593bcf=encryptor[_0xc581('0x37')](_0x57d21b['data3']);_0x57d21b[_0xc581('0x38')]=maskClientSecret(_0x593bcf);}return _0x57d21b;});return _0x21be13;})[_0xc581('0x14')](respondWithFilteredResult(_0x54139c,_0x1b3348))[_0xc581('0x39')](handleError(_0x54139c,null));};exports[_0xc581('0x3a')]=function(_0x564501,_0x1dd92d){var _0x491a63={'raw':!![],'where':{'id':_0x564501[_0xc581('0x3b')]['id']}},_0x1d2e44={};_0x1d2e44[_0xc581('0x24')]=_[_0xc581('0x3c')](db[_0xc581('0x1e')]['rawAttributes']);_0x1d2e44[_0xc581('0x25')]=_[_0xc581('0x3c')](_0x564501[_0xc581('0x25')]);_0x1d2e44[_0xc581('0x22')]=_[_0xc581('0x23')](_0x1d2e44['model'],_0x1d2e44[_0xc581('0x25')]);_0x491a63['attributes']=_[_0xc581('0x23')](_0x1d2e44[_0xc581('0x24')],qs[_0xc581('0x27')](_0x564501['query']['fields']));_0x491a63[_0xc581('0x26')]=_0x491a63[_0xc581('0x26')][_0xc581('0x3d')]?_0x491a63['attributes']:_0x1d2e44[_0xc581('0x24')];if(_0x564501[_0xc581('0x25')][_0xc581('0x32')]){_0x491a63[_0xc581('0x33')]=[{'all':!![]}];}_0x491a63=_['merge']({},_0x491a63,_0x564501[_0xc581('0x31')]);return db[_0xc581('0x1e')][_0xc581('0x3e')](_0x491a63)[_0xc581('0x14')](handleEntityNotFound(_0x1dd92d,null))[_0xc581('0x14')](function(_0x42a483){if(_0x42a483['service']===_0xc581('0x3f')){var _0xa1857f=encryptor['decryptString'](_0x42a483[_0xc581('0x38')]);_0x42a483[_0xc581('0x38')]=maskClientSecret(_0xa1857f);}return _0x42a483;})[_0xc581('0x14')](respondWithResult(_0x1dd92d,null))[_0xc581('0x39')](handleError(_0x1dd92d,null));};exports[_0xc581('0x40')]=function(_0x5b34cc,_0x37d70a){if(!_0x5b34cc[_0xc581('0x41')][_0xc581('0x19')])throw new Error(_0xc581('0x42'));if(!_0x5b34cc[_0xc581('0x41')][_0xc581('0x36')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x4e5f88=db[_0xc581('0x1e')][_0xc581('0x43')][_0xc581('0x36')][_0xc581('0x44')];if(!_0x4e5f88['includes'](_0x5b34cc['body'][_0xc581('0x36')]))throw new Error(_0xc581('0x45')+_0x4e5f88[_0xc581('0x46')](',\x20'));if(_0x5b34cc[_0xc581('0x41')]['service']===_0xc581('0x3f')&&_0x5b34cc[_0xc581('0x41')][_0xc581('0x38')]){_0x5b34cc[_0xc581('0x41')]['data3']=encryptor[_0xc581('0x47')](_0x5b34cc[_0xc581('0x41')][_0xc581('0x38')]);}return db[_0xc581('0x1e')][_0xc581('0x40')](_0x5b34cc[_0xc581('0x41')],{})[_0xc581('0x14')](respondWithResult(_0x37d70a,0xc9))[_0xc581('0x39')](handleError(_0x37d70a,null));};exports[_0xc581('0x13')]=function(_0x40c2e4,_0x4862c0){if(_0x40c2e4[_0xc581('0x41')]['id']){delete _0x40c2e4[_0xc581('0x41')]['id'];}return db[_0xc581('0x1e')]['find']({'where':{'id':_0x40c2e4[_0xc581('0x3b')]['id']}})[_0xc581('0x14')](handleEntityNotFound(_0x4862c0,null))[_0xc581('0x14')](function(_0x490a9f){if(_0x490a9f[_0xc581('0x36')]===_0xc581('0x3f')&&_0x40c2e4[_0xc581('0x41')][_0xc581('0x38')]){_0x40c2e4[_0xc581('0x41')][_0xc581('0x38')]=encryptor[_0xc581('0x47')](_0x40c2e4['body'][_0xc581('0x38')]);}return _0x490a9f;})['then'](saveUpdates(_0x40c2e4[_0xc581('0x41')],null))[_0xc581('0x14')](respondWithResult(_0x4862c0,null))[_0xc581('0x39')](handleError(_0x4862c0,null));};exports['destroy']=function(_0x85f63b,_0x17b3f7){return db['CloudProvider'][_0xc581('0x3e')]({'where':{'id':_0x85f63b[_0xc581('0x3b')]['id']}})[_0xc581('0x14')](handleEntityNotFound(_0x17b3f7,null))[_0xc581('0x14')](removeEntity(_0x17b3f7,null))[_0xc581('0x39')](handleError(_0x17b3f7,null));};exports[_0xc581('0x48')]=function(_0x4ce9d1,_0x29e6fe){return db[_0xc581('0x1e')]['findOne']({'where':{'id':_0x4ce9d1[_0xc581('0x3b')]['id']},'raw':!![]})['then'](function(_0x41752d){if(!_0x41752d)return _0x29e6fe[_0xc581('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x41752d,_0x4ce9d1[_0xc581('0x49')]['id'])};})[_0xc581('0x14')](respondWithResult(_0x29e6fe,null))['catch'](handleError(_0x29e6fe,null));};exports[_0xc581('0x4a')]=function(_0x5ac4bf,_0x51a873){var _0x43a3ae=_0x5ac4bf[_0xc581('0x41')];var _0x1cc3cf;var _0x47a928;if(_0x43a3ae[_0xc581('0x17')])throw _0x43a3ae;redis[_0xc581('0x4b')](_0x43a3ae['state'])[_0xc581('0x14')](function(_0x17e3ea){if(!_0x17e3ea)throw new Error(_0xc581('0x4c'));_0x1cc3cf=JSON[_0xc581('0x4d')](_0x17e3ea);var _0x562009=Buffer[_0xc581('0x4e')](_0x43a3ae[_0xc581('0x4f')],_0xc581('0x50'))[_0xc581('0x51')](_0xc581('0x52'));_0x47a928=JSON['parse'](_0x562009);if(!oauth[_0xc581('0x53')](_0x43a3ae['id_token'],_0x1cc3cf[_0xc581('0x54')]))throw new Error(_0xc581('0x55'));redis[_0xc581('0x56')](_0x43a3ae[_0xc581('0x4f')]);return oauth[_0xc581('0x57')](_0x43a3ae[_0xc581('0x58')],_0x1cc3cf);})[_0xc581('0x14')](function(_0x560c20){_0x1cc3cf[_0xc581('0x59')]=_0x560c20['access_token'];_0x1cc3cf[_0xc581('0x5a')]=_0x560c20[_0xc581('0x5b')];return db[_0xc581('0x1e')][_0xc581('0x13')]({'data5':_0x1cc3cf[_0xc581('0x59')],'data6':_0x1cc3cf[_0xc581('0x5a')]},{'where':{'id':_0x1cc3cf['id']}});})[_0xc581('0x14')](function(){oauth[_0xc581('0x5c')](_0x1cc3cf);socket[_0xc581('0x5d')](_0xc581('0x5e'),{'id':_0x47a928['id']});return;})[_0xc581('0x14')](respondWithStatusCode(_0x51a873,null))[_0xc581('0x39')](function(_0xa8578){if(_0x47a928){socket['emit'](_0xc581('0x5f'),{'id':_0x47a928['id']});}if(!_0x1cc3cf){logger[_0xc581('0x17')](_0xc581('0x60'),_0xa8578);return _0x51a873[_0xc581('0xb')](0x1f4)[_0xc581('0x1a')](_0xa8578[_0xc581('0x61')]);}logger[_0xc581('0x17')](_0xc581('0x62'),_0x1cc3cf['id'],JSON[_0xc581('0x63')](_0xa8578));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index b94ee99..1ba3bd8 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 _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 +var _0x2893=['rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','util','../../config/logger','path'];(function(_0x4d5cc7,_0x10f85d){var _0x289350=function(_0x5af4c3){while(--_0x5af4c3){_0x4d5cc7['push'](_0x4d5cc7['shift']());}};_0x289350(++_0x10f85d);}(_0x2893,0x12f));var _0x3289=function(_0x48bee1,_0x29f43d){_0x48bee1=_0x48bee1-0x0;var _0x582372=_0x2893[_0x48bee1];return _0x582372;};'use strict';var _=require('lodash');var util=require(_0x3289('0x0'));var logger=require(_0x3289('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3289('0x2'));var rimraf=require(_0x3289('0x3'));var config=require(_0x3289('0x4'));var attributes=require(_0x3289('0x5'));module[_0x3289('0x6')]=function(_0x2e2d7e,_0x54f77f){return _0x2e2d7e[_0x3289('0x7')](_0x3289('0x8'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index cada408..f44bb5b 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 _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 +var _0x3177=['update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','Dynamics365','push','data7','/.default','Outlook365','replace','{TENANT_ID}','data2','code','stringify','base64','toString','hex','client_id','response_type','join','redirect_uri','form_post','scope','nonce','prompt','login','map','value','oauth2Claims','payload','iss','issuer','aud','audience','unix','exp','resolve','data3','findOne','then','refresh_token','data6','data4','data1','decryptString','POST','data5','CloudProvider'];(function(_0x5adfa9,_0x4b835d){var _0x458f41=function(_0x504e46){while(--_0x504e46){_0x5adfa9['push'](_0x5adfa9['shift']());}};_0x458f41(++_0x4b835d);}(_0x3177,0x185));var _0x7317=function(_0xfc5df5,_0x5935dc){_0xfc5df5=_0xfc5df5-0x0;var _0x3a9b2c=_0x3177[_0xfc5df5];return _0x3a9b2c;};'use strict';var _=require(_0x7317('0x0'));var crypto=require(_0x7317('0x1'));var jwt=require(_0x7317('0x2'));var moment=require(_0x7317('0x3'));var Redis=require(_0x7317('0x4'));var rp=require(_0x7317('0x5'));var util=require(_0x7317('0x6'));var encryptor=require(_0x7317('0x7'));var config=require(_0x7317('0x8'));var logger=require('../../config/logger')(_0x7317('0x9'));var schedule=require(_0x7317('0xa'));var db=require(_0x7317('0xb'))['db'];config[_0x7317('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x7317('0xc')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x7317('0xd'),_0x7317('0xe'),_0x7317('0xf'),_0x7317('0x10'),_0x7317('0x11'),_0x7317('0x12'),_0x7317('0x13')],'Dynamics365':[_0x7317('0xd'),_0x7317('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x7317('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x7317('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1f8b72){var _0x2c63d8=_['map'](AZURE_AUTH_SCOPES[_0x1f8b72[_0x7317('0x16')]]);if(_0x1f8b72[_0x7317('0x16')]===_0x7317('0x17'))_0x2c63d8[_0x7317('0x18')](_0x1f8b72[_0x7317('0x19')]+_0x7317('0x1a'));return _0x2c63d8['join']('\x20');}function getAccessTokenScope(_0x3272f5){if(_0x3272f5[_0x7317('0x16')]===_0x7317('0x1b'))return _0x7317('0x11');if(_0x3272f5[_0x7317('0x16')]===_0x7317('0x17'))return _0x3272f5[_0x7317('0x19')]+_0x7317('0x1a');}function generateMicrosoftAuthorizationUrl(_0x32f011,_0x48aeb5){var _0x3306c1=MICROSOFT_AUTH_URL[_0x7317('0x1c')](_0x7317('0x1d'),_0x32f011[_0x7317('0x1e')]);var _0xb93fa5=[_0x7317('0x1f'),'id_token'];var _0x4960d1=Buffer['from'](JSON[_0x7317('0x20')]({'id':_0x48aeb5}))['toString'](_0x7317('0x21'));var _0x94a0c0=crypto['randomBytes'](0x10)[_0x7317('0x22')](_0x7317('0x23'));var _0x169910=getAuthorizationScopes(_0x32f011);var _0xa41d59=[{'key':_0x7317('0x24'),'value':_0x32f011['data1']},{'key':_0x7317('0x25'),'value':encodeURIComponent(_0xb93fa5[_0x7317('0x26')]('\x20'))},{'key':_0x7317('0x27'),'value':_0x32f011['data4']},{'key':'response_mode','value':_0x7317('0x28')},{'key':_0x7317('0x29'),'value':encodeURIComponent(_0x169910)},{'key':'state','value':_0x4960d1},{'key':_0x7317('0x2a'),'value':_0x94a0c0},{'key':_0x7317('0x2b'),'value':_0x7317('0x2c')}];var _0x41ee35=_0x3306c1+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x7317('0x2d')](_0xa41d59,function(_0x2b4f18){return _0x2b4f18['key']+'='+_0x2b4f18[_0x7317('0x2e')];})['join']('&');_0x32f011[_0x7317('0x2f')]={'issuer':_0x3306c1['replace']('oauth2/',''),'audience':_0x32f011['data1'],'state':_0x4960d1,'nonce':_0x94a0c0};redis['set'](_0x4960d1,JSON[_0x7317('0x20')](_0x32f011));return _0x41ee35;}function isValidIdToken(_0x17bb24,_0x503de4){try{var _0x1641b4=jwt['decode'](_0x17bb24,{'complete':!![]});var _0x325e71=_0x1641b4[_0x7317('0x30')];if(_0x325e71[_0x7317('0x31')]!==_0x503de4[_0x7317('0x32')])return![];if(_0x325e71[_0x7317('0x33')]!==_0x503de4[_0x7317('0x34')])return![];if(_0x325e71[_0x7317('0x2a')]!==_0x503de4[_0x7317('0x2a')])return![];if(moment()['isAfter'](moment[_0x7317('0x35')](_0x325e71[_0x7317('0x36')])))return![];return!![];}catch(_0x28e3b3){throw _0x28e3b3;}}function refreshOauth2MicrosoftAccessToken(_0x5870b4){return Promise[_0x7317('0x37')]()['then'](function(){if(_0x5870b4[_0x7317('0x38')])return _0x5870b4;return db['CloudProvider'][_0x7317('0x39')]({'where':{'id':_0x5870b4['id']},'raw':!![]});})[_0x7317('0x3a')](function(_0x55bf07){var _0x4019e8={'grant_type':_0x7317('0x3b'),'refresh_token':_0x55bf07[_0x7317('0x3c')],'scope':getAccessTokenScope(_0x55bf07),'redirect_uri':_0x55bf07[_0x7317('0x3d')],'client_id':_0x55bf07[_0x7317('0x3e')],'client_secret':encryptor[_0x7317('0x3f')](_0x55bf07[_0x7317('0x38')])};var _0x558091={'method':_0x7317('0x40'),'uri':MICROSOFT_AUTH_URL['replace'](_0x7317('0x1d'),_0x55bf07[_0x7317('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4019e8,'json':!![]};return rp(_0x558091);})[_0x7317('0x3a')](function(_0xe8fd0f){_0x5870b4[_0x7317('0x41')]=_0xe8fd0f['access_token'];_0x5870b4['data6']=_0xe8fd0f['refresh_token'];return db[_0x7317('0x42')][_0x7317('0x43')]({'data5':_0x5870b4[_0x7317('0x41')],'data6':_0x5870b4[_0x7317('0x3c')]},{'where':{'id':_0x5870b4['id']}});})['then'](function(){return _0x5870b4;})[_0x7317('0x44')](function(_0x2a5163){logger[_0x7317('0x45')](_0x7317('0x46'),_0x5870b4['id'],_0x2a5163);});}function getOauth2MicrosoftAccessToken(_0x2345dd,_0x28556d){var _0x54fa94={'grant_type':_0x7317('0x47'),'code':_0x2345dd,'scope':getAccessTokenScope(_0x28556d),'redirect_uri':_0x28556d[_0x7317('0x3d')],'client_id':_0x28556d[_0x7317('0x3e')],'client_secret':encryptor[_0x7317('0x3f')](_0x28556d['data3'])};var _0x4067d3={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x7317('0x1d'),_0x28556d[_0x7317('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x54fa94,'json':!![]};return rp(_0x4067d3);}function startRefreshInterval(_0x27c2cc){var _0x13a996=schedule['intervals'];if(_0x13a996[_0x27c2cc['id']])clearInterval(_0x13a996[_0x27c2cc['id']]);_0x13a996[_0x27c2cc['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x27c2cc['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x7317('0x48')]=_0x13a996;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x7317('0x3a')](function(_0x33eacf){var _0x1f2da5=_0x33eacf[_0x7317('0x2d')](function(_0x568067){return refreshOauth2MicrosoftAccessToken(_0x568067)[_0x7317('0x3a')](function(_0xf063b5){startRefreshInterval(_0xf063b5);});});return Promise['all'](_0x1f2da5);})[_0x7317('0x44')](function(_0x3c2474){var _0x824c56=_0x3c2474?util[_0x7317('0x49')](_0x3c2474,{'showHidden':![],'depth':null}):'';logger['error'](_0x7317('0x4a'),_0x824c56);});}module[_0x7317('0x4b')]={'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 569e61c..3812e44 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 _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 +var _0x8ff9=['../../config/environment','client','http','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x8ff9,0x1a6));var _0x98ff=function(_0xc1da56,_0x5e7d96){_0xc1da56=_0xc1da56-0x0;var _0x5b1e17=_0x8ff9[_0xc1da56];return _0x5b1e17;};'use strict';var _=require(_0x98ff('0x0'));var util=require(_0x98ff('0x1'));var moment=require(_0x98ff('0x2'));var BPromise=require(_0x98ff('0x3'));var rs=require(_0x98ff('0x4'));var fs=require('fs');var Redis=require(_0x98ff('0x5'));var db=require(_0x98ff('0x6'))['db'];var utils=require(_0x98ff('0x7'));var logger=require(_0x98ff('0x8'))(_0x98ff('0x9'));var config=require(_0x98ff('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x98ff('0xb')][_0x98ff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x13537e,_0x21d840,_0x12d3fe){return new BPromise(function(_0xbe13f3,_0x51fbd8){return client[_0x98ff('0xd')](_0x13537e,_0x12d3fe)['then'](function(_0x4bbf37){logger[_0x98ff('0xe')](_0x98ff('0xf'),_0x21d840,_0x98ff('0x10'));logger[_0x98ff('0x11')](_0x98ff('0x12'),_0x21d840,'request\x20sent',JSON[_0x98ff('0x13')](_0x4bbf37));if(_0x4bbf37['error']){if(_0x4bbf37[_0x98ff('0x14')]['code']===0x1f4){logger['error'](_0x98ff('0xf'),_0x21d840,_0x4bbf37[_0x98ff('0x14')][_0x98ff('0x15')]);return _0x51fbd8(_0x4bbf37['error'][_0x98ff('0x15')]);}logger['error'](_0x98ff('0xf'),_0x21d840,_0x4bbf37[_0x98ff('0x14')][_0x98ff('0x15')]);return _0xbe13f3(_0x4bbf37[_0x98ff('0x14')][_0x98ff('0x15')]);}else{logger[_0x98ff('0xe')]('CloudProvider,\x20%s,\x20%s',_0x21d840,_0x98ff('0x10'));_0xbe13f3(_0x4bbf37[_0x98ff('0x16')][_0x98ff('0x15')]);}})[_0x98ff('0x17')](function(_0x3751b9){logger[_0x98ff('0x14')](_0x98ff('0xf'),_0x21d840,_0x3751b9);_0x51fbd8(_0x3751b9);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index ae53579..f7928ca 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 _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 +var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0x1261,0x144));var _0x1126=function(_0x1193ea,_0xc04ef0){_0x1193ea=_0x1193ea-0x0;var _0x5e4000=_0x1261[_0x1193ea];return _0x5e4000;};'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 diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index b1dccb0..9b948b5 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 _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 +var _0x4606=['exports','STRING','name'];(function(_0x2f08db,_0x468da8){var _0xd8d3e6=function(_0x1d72e2){while(--_0x1d72e2){_0x2f08db['push'](_0x2f08db['shift']());}};_0xd8d3e6(++_0x468da8);}(_0x4606,0x1b0));var _0x6460=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4606[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x6460('0x0')]={'name':{'type':Sequelize[_0x6460('0x1')],'unique':_0x6460('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x6460('0x1')]},'companyId':{'type':Sequelize[_0x6460('0x1')]},'website':{'type':Sequelize[_0x6460('0x1')]},'phone':{'type':Sequelize[_0x6460('0x1')]},'fax':{'type':Sequelize[_0x6460('0x1')]},'type':{'type':Sequelize[_0x6460('0x1')]},'street':{'type':Sequelize[_0x6460('0x1')]},'postalCode':{'type':Sequelize[_0x6460('0x1')]},'city':{'type':Sequelize[_0x6460('0x1')]},'country':{'type':Sequelize[_0x6460('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x6460('0x1')]},'sStreet':{'type':Sequelize[_0x6460('0x1')]},'sPostalCode':{'type':Sequelize[_0x6460('0x1')]},'sCity':{'type':Sequelize[_0x6460('0x1')]},'sCountry':{'type':Sequelize[_0x6460('0x1')]},'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 65ad10c..c1530e1 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 _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 +var _0x2c86=['zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','get','Companies','UserProfileResource','then','end','sendStatus','error','stack','name','send','index','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','merge','map','filter','options','CmCompany','includeAll','findAll','rows','catch','show','params','rawAttributes','fields','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','omit','ids','getContacts','findOne','pick','eml-format','rimraf'];(function(_0x499792,_0x20bf22){var _0x1ba806=function(_0x2bc368){while(--_0x2bc368){_0x499792['push'](_0x499792['shift']());}};_0x1ba806(++_0x20bf22);}(_0x2c86,0x1c0));var _0x62c8=function(_0xa002c8,_0x485247){_0xa002c8=_0xa002c8-0x0;var _0x4da7a6=_0x2c86[_0xa002c8];return _0x4da7a6;};'use strict';var emlformat=require(_0x62c8('0x0'));var rimraf=require(_0x62c8('0x1'));var zipdir=require(_0x62c8('0x2'));var jsonpatch=require(_0x62c8('0x3'));var rp=require(_0x62c8('0x4'));var moment=require(_0x62c8('0x5'));var BPromise=require(_0x62c8('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x62c8('0x7'));var sox=require(_0x62c8('0x8'));var csv=require(_0x62c8('0x9'));var ejs=require(_0x62c8('0xa'));var fs=require('fs');var fs_extra=require(_0x62c8('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x62c8('0xc'));var deskjs=require(_0x62c8('0xd'));var toCsv=require(_0x62c8('0x9'));var querystring=require(_0x62c8('0xe'));var Papa=require(_0x62c8('0xf'));var Redis=require(_0x62c8('0x10'));var authService=require(_0x62c8('0x11'));var qs=require(_0x62c8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x62c8('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x62c8('0x14'));var config=require(_0x62c8('0x15'));var licenseUtil=require(_0x62c8('0x16'));var db=require(_0x62c8('0x17'))['db'];function respondWithStatusCode(_0x5ca63b,_0x702ad4){_0x702ad4=_0x702ad4||0xcc;return function(_0x462fd9){if(_0x462fd9){return _0x5ca63b['sendStatus'](_0x702ad4);}return _0x5ca63b[_0x62c8('0x18')](_0x702ad4)['end']();};}function respondWithResult(_0x142ff6,_0x389a5f){_0x389a5f=_0x389a5f||0xc8;return function(_0x30038e){if(_0x30038e){return _0x142ff6['status'](_0x389a5f)['json'](_0x30038e);}};}function respondWithFilteredResult(_0x14abaa,_0xfe9a1f){return function(_0x40b733){if(_0x40b733){var _0x31800d=typeof _0xfe9a1f[_0x62c8('0x19')]===_0x62c8('0x1a')&&typeof _0xfe9a1f[_0x62c8('0x1b')]==='undefined';var _0xea343e=_0x40b733['count'];var _0x5067c0=_0x31800d?0x0:_0xfe9a1f[_0x62c8('0x19')];var _0x3de0a1=_0x31800d?_0x40b733[_0x62c8('0x1c')]:_0xfe9a1f[_0x62c8('0x19')]+_0xfe9a1f[_0x62c8('0x1b')];var _0x2a7f91;if(_0x3de0a1>=_0xea343e){_0x3de0a1=_0xea343e;_0x2a7f91=0xc8;}else{_0x2a7f91=0xce;}_0x14abaa[_0x62c8('0x18')](_0x2a7f91);return _0x14abaa[_0x62c8('0x1d')](_0x62c8('0x1e'),_0x5067c0+'-'+_0x3de0a1+'/'+_0xea343e)[_0x62c8('0x1f')](_0x40b733);}return null;};}function patchUpdates(_0x1be691){return function(_0x1b3318){try{jsonpatch[_0x62c8('0x20')](_0x1b3318,_0x1be691,!![]);}catch(_0x2be4c9){return BPromise[_0x62c8('0x21')](_0x2be4c9);}return _0x1b3318[_0x62c8('0x22')]();};}function saveUpdates(_0x251053,_0x5a99ce){return function(_0x1fe31d){if(_0x1fe31d){return _0x1fe31d[_0x62c8('0x23')](_0x251053)['then'](function(_0x330841){return _0x330841;});}return null;};}function removeEntity(_0x56e759,_0x3d0bff){return function(_0x2b74ad){if(_0x2b74ad){return _0x2b74ad[_0x62c8('0x24')]()['then'](function(){var _0x207e8f=_0x2b74ad[_0x62c8('0x25')]({'plain':!![]});var _0x1be463=_0x62c8('0x26');return db[_0x62c8('0x27')][_0x62c8('0x24')]({'where':{'type':_0x1be463,'resourceId':_0x207e8f['id']}})[_0x62c8('0x28')](function(){return _0x2b74ad;});})[_0x62c8('0x28')](function(){_0x56e759['status'](0xcc)[_0x62c8('0x29')]();});}};}function handleEntityNotFound(_0x63f403,_0x159401){return function(_0x5b3738){if(!_0x5b3738){_0x63f403[_0x62c8('0x2a')](0x194);}return _0x5b3738;};}function handleError(_0x5a0530,_0x1f7e2e){_0x1f7e2e=_0x1f7e2e||0x1f4;return function(_0x384cc9){logger[_0x62c8('0x2b')](_0x384cc9[_0x62c8('0x2c')]);if(_0x384cc9[_0x62c8('0x2d')]){delete _0x384cc9[_0x62c8('0x2d')];}_0x5a0530[_0x62c8('0x18')](_0x1f7e2e)[_0x62c8('0x2e')](_0x384cc9);};}exports[_0x62c8('0x2f')]=function(_0x9d80c1,_0x424b00){var _0x1d236b={},_0x58b068={},_0x50734e={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0x62c8('0x28')](function(_0x34538a){_0x58b068[_0x62c8('0x30')]=_[_0x62c8('0x31')](_0x34538a);_0x58b068[_0x62c8('0x32')]=_['keys'](_0x9d80c1[_0x62c8('0x32')]);_0x58b068[_0x62c8('0x33')]=_[_0x62c8('0x34')](_0x58b068[_0x62c8('0x30')],_0x58b068[_0x62c8('0x32')]);_0x1d236b['attributes']=_[_0x62c8('0x34')](_0x58b068['model'],qs['fields'](_0x9d80c1[_0x62c8('0x32')]['fields']));_0x1d236b[_0x62c8('0x35')]=_0x1d236b[_0x62c8('0x35')]['length']?_0x1d236b[_0x62c8('0x35')]:_0x58b068[_0x62c8('0x30')];if(!_0x9d80c1['query'][_0x62c8('0x36')](_0x62c8('0x37'))){_0x1d236b[_0x62c8('0x1b')]=qs[_0x62c8('0x1b')](_0x9d80c1['query'][_0x62c8('0x1b')]);_0x1d236b[_0x62c8('0x19')]=qs[_0x62c8('0x19')](_0x9d80c1[_0x62c8('0x32')]['offset']);}_0x1d236b[_0x62c8('0x38')]=qs[_0x62c8('0x39')](_0x9d80c1[_0x62c8('0x32')][_0x62c8('0x39')]);_0x1d236b[_0x62c8('0x3a')]=qs['filters'](_['pick'](_0x9d80c1['query'],_0x58b068['filters']),_0x34538a);if(_0x9d80c1[_0x62c8('0x32')]['filter']){_0x1d236b['where']=_[_0x62c8('0x3b')](_0x1d236b[_0x62c8('0x3a')],{'$or':_[_0x62c8('0x3c')](_0x1d236b[_0x62c8('0x35')],function(_0x2af9f9){var _0x5ba444={};_0x5ba444[_0x2af9f9]={'$like':'%'+_0x9d80c1[_0x62c8('0x32')][_0x62c8('0x3d')]+'%'};return _0x5ba444;})});}_0x1d236b=_[_0x62c8('0x3b')]({},_0x1d236b,_0x9d80c1[_0x62c8('0x3e')]);var _0x45b629={'where':_0x1d236b[_0x62c8('0x3a')]};return db[_0x62c8('0x3f')][_0x62c8('0x1c')](_0x45b629)['then'](function(_0x1d6c9d){_0x50734e[_0x62c8('0x1c')]=_0x1d6c9d;if(_0x9d80c1[_0x62c8('0x32')][_0x62c8('0x40')]){_0x1d236b['include']=[{'all':!![]}];}return db[_0x62c8('0x3f')][_0x62c8('0x41')](_0x1d236b);})[_0x62c8('0x28')](function(_0x280128){_0x50734e[_0x62c8('0x42')]=_0x280128;return _0x50734e;})[_0x62c8('0x28')](respondWithFilteredResult(_0x424b00,_0x1d236b))[_0x62c8('0x43')](handleError(_0x424b00,null));})[_0x62c8('0x43')](handleError(_0x424b00,null));};exports[_0x62c8('0x44')]=function(_0x5b7905,_0x1b34d8){var _0x46c9a2={'raw':![],'where':{'id':_0x5b7905[_0x62c8('0x45')]['id']}},_0x559fe0={};_0x559fe0[_0x62c8('0x30')]=_[_0x62c8('0x31')](db[_0x62c8('0x3f')][_0x62c8('0x46')]);_0x559fe0[_0x62c8('0x32')]=_[_0x62c8('0x31')](_0x5b7905[_0x62c8('0x32')]);_0x559fe0[_0x62c8('0x33')]=_[_0x62c8('0x34')](_0x559fe0['model'],_0x559fe0['query']);_0x46c9a2[_0x62c8('0x35')]=_['intersection'](_0x559fe0[_0x62c8('0x30')],qs[_0x62c8('0x47')](_0x5b7905[_0x62c8('0x32')][_0x62c8('0x47')]));_0x46c9a2['attributes']=_0x46c9a2[_0x62c8('0x35')][_0x62c8('0x48')]?_0x46c9a2['attributes']:_0x559fe0['model'];if(_0x5b7905['query']['includeAll']){_0x46c9a2[_0x62c8('0x49')]=[{'all':!![]}];}_0x46c9a2=_['merge']({},_0x46c9a2,_0x5b7905[_0x62c8('0x3e')]);return db[_0x62c8('0x3f')][_0x62c8('0x4a')](_0x46c9a2)['then'](handleEntityNotFound(_0x1b34d8,null))[_0x62c8('0x28')](respondWithResult(_0x1b34d8,null))[_0x62c8('0x43')](handleError(_0x1b34d8,null));};exports[_0x62c8('0x4b')]=function(_0x459114,_0x244f5b){return db['CmCompany'][_0x62c8('0x4b')](_0x459114[_0x62c8('0x4c')],{})[_0x62c8('0x28')](function(_0x238003){var _0x2e20f1=_0x459114[_0x62c8('0x4d')][_0x62c8('0x25')]({'plain':!![]});if(!_0x2e20f1)throw new Error(_0x62c8('0x4e'));if(_0x2e20f1['role']===_0x62c8('0x4d')){var _0x4fe10a=_0x238003[_0x62c8('0x25')]({'plain':!![]});var _0x55bd2f='Companies';return db[_0x62c8('0x4f')][_0x62c8('0x4a')]({'where':{'name':_0x55bd2f,'userProfileId':_0x2e20f1[_0x62c8('0x50')]},'raw':!![]})[_0x62c8('0x28')](function(_0x22690b){if(_0x22690b&&_0x22690b['autoAssociation']===0x0){return db[_0x62c8('0x27')]['create']({'name':_0x4fe10a[_0x62c8('0x2d')],'resourceId':_0x4fe10a['id'],'type':_0x22690b[_0x62c8('0x2d')],'sectionId':_0x22690b['id']},{})['then'](function(){return _0x238003;});}else{return _0x238003;}})[_0x62c8('0x43')](function(_0x49429c){logger[_0x62c8('0x2b')](_0x62c8('0x51'),_0x49429c);throw _0x49429c;});}return _0x238003;})['then'](respondWithResult(_0x244f5b,0xc9))[_0x62c8('0x43')](handleError(_0x244f5b,null));};exports['update']=function(_0x5d2ed5,_0x274390){if(_0x5d2ed5[_0x62c8('0x4c')]['id']){delete _0x5d2ed5[_0x62c8('0x4c')]['id'];}return db[_0x62c8('0x3f')][_0x62c8('0x4a')]({'where':{'id':_0x5d2ed5[_0x62c8('0x45')]['id']}})[_0x62c8('0x28')](handleEntityNotFound(_0x274390,null))[_0x62c8('0x28')](saveUpdates(_0x5d2ed5[_0x62c8('0x4c')],null))[_0x62c8('0x28')](respondWithResult(_0x274390,null))[_0x62c8('0x43')](handleError(_0x274390,null));};exports[_0x62c8('0x24')]=function(_0x30f447,_0x677100){return db[_0x62c8('0x3f')]['find']({'where':{'id':_0x30f447[_0x62c8('0x45')]['id']}})['then'](handleEntityNotFound(_0x677100,null))[_0x62c8('0x28')](removeEntity(_0x677100,null))[_0x62c8('0x43')](handleError(_0x677100,null));};exports[_0x62c8('0x52')]=function(_0x11fbec,_0x1ee9c7){return db['CmCompany'][_0x62c8('0x52')]()[_0x62c8('0x28')](respondWithResult(_0x1ee9c7,null))[_0x62c8('0x43')](handleError(_0x1ee9c7,null));};exports[_0x62c8('0x53')]=function(_0x23ddb9,_0x682ddb,_0x180935){return db[_0x62c8('0x54')][_0x62c8('0x4a')]({'where':{'id':_0x23ddb9[_0x62c8('0x45')]['id']}})[_0x62c8('0x28')](handleEntityNotFound(_0x682ddb,null))['then'](function(_0x36e205){if(_0x36e205){return _0x36e205[_0x62c8('0x53')](_0x23ddb9[_0x62c8('0x4c')]['ids'],_[_0x62c8('0x55')](_0x23ddb9[_0x62c8('0x4c')],[_0x62c8('0x56'),'id'])||{});}})[_0x62c8('0x28')](respondWithResult(_0x682ddb,null))['catch'](handleError(_0x682ddb,null));};exports[_0x62c8('0x57')]=function(_0xa422be,_0x11a719,_0x55e2cc){var _0x29bd37={};var _0x469ebb={};var _0x36d92e;var _0x1ed089;return db[_0x62c8('0x3f')][_0x62c8('0x58')]({'where':{'id':_0xa422be['params']['id']}})[_0x62c8('0x28')](handleEntityNotFound(_0x11a719,null))[_0x62c8('0x28')](function(_0x176bd6){if(_0x176bd6){_0x36d92e=_0x176bd6;_0x469ebb[_0x62c8('0x30')]=_[_0x62c8('0x31')](db['CmContact']['rawAttributes']);_0x469ebb[_0x62c8('0x32')]=_[_0x62c8('0x31')](_0xa422be[_0x62c8('0x32')]);_0x469ebb[_0x62c8('0x33')]=_[_0x62c8('0x34')](_0x469ebb[_0x62c8('0x30')],_0x469ebb['query']);_0x29bd37['attributes']=_[_0x62c8('0x34')](_0x469ebb[_0x62c8('0x30')],qs['fields'](_0xa422be[_0x62c8('0x32')][_0x62c8('0x47')]));_0x29bd37[_0x62c8('0x35')]=_0x29bd37[_0x62c8('0x35')][_0x62c8('0x48')]?_0x29bd37[_0x62c8('0x35')]:_0x469ebb[_0x62c8('0x30')];_0x29bd37[_0x62c8('0x38')]=qs[_0x62c8('0x39')](_0xa422be[_0x62c8('0x32')][_0x62c8('0x39')]);_0x29bd37[_0x62c8('0x3a')]=qs[_0x62c8('0x33')](_[_0x62c8('0x59')](_0xa422be[_0x62c8('0x32')],_0x469ebb['filters']));if(_0xa422be[_0x62c8('0x32')][_0x62c8('0x3d')]){_0x29bd37['where']=_[_0x62c8('0x3b')](_0x29bd37['where'],{'$or':_[_0x62c8('0x3c')](_0x29bd37[_0x62c8('0x35')],function(_0x2964f7){var _0x3bcb3e={};_0x3bcb3e[_0x2964f7]={'$like':'%'+_0xa422be['query'][_0x62c8('0x3d')]+'%'};return _0x3bcb3e;})});}_0x29bd37=_[_0x62c8('0x3b')]({},_0x29bd37,_0xa422be[_0x62c8('0x3e')]);return _0x36d92e['getContacts'](_0x29bd37);}})[_0x62c8('0x28')](function(_0x51f3a7){if(_0x51f3a7){_0x1ed089=_0x51f3a7[_0x62c8('0x48')];if(!_0xa422be[_0x62c8('0x32')][_0x62c8('0x36')](_0x62c8('0x37'))){_0x29bd37[_0x62c8('0x1b')]=qs[_0x62c8('0x1b')](_0xa422be['query'][_0x62c8('0x1b')]);_0x29bd37['offset']=qs['offset'](_0xa422be[_0x62c8('0x32')][_0x62c8('0x19')]);}return _0x36d92e[_0x62c8('0x57')](_0x29bd37);}})[_0x62c8('0x28')](function(_0x1aaf92){if(_0x1aaf92){return _0x1aaf92?{'count':_0x1ed089,'rows':_0x1aaf92}:null;}})[_0x62c8('0x28')](respondWithResult(_0x11a719,null))['catch'](handleError(_0x11a719,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 02babea..7b16c4e 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 _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 +var _0xd55f=['cm_companies','lodash','../../config/logger','request-promise','path','../../config/environment','exports','define','CmCompany'];(function(_0x134c95,_0x49ed19){var _0x5ac841=function(_0x442161){while(--_0x442161){_0x134c95['push'](_0x134c95['shift']());}};_0x5ac841(++_0x49ed19);}(_0xd55f,0xac));var _0xfd55=function(_0x8ae658,_0x2e66d6){_0x8ae658=_0x8ae658-0x0;var _0x55a7d9=_0xd55f[_0x8ae658];return _0x55a7d9;};'use strict';var _=require(_0xfd55('0x0'));var util=require('util');var logger=require(_0xfd55('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfd55('0x2'));var fs=require('fs');var path=require(_0xfd55('0x3'));var rimraf=require('rimraf');var config=require(_0xfd55('0x4'));var attributes=require('./cmCompany.attributes');module[_0xfd55('0x5')]=function(_0x5832a9,_0xf4f36f){return _0x5832a9[_0xfd55('0x6')](_0xfd55('0x7'),attributes,{'tableName':_0xfd55('0x8'),'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 b18f9de..b85d7a1 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 _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 +var _0xd83b=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x17c487,_0x2b72f1){var _0x3feeb8=function(_0x49aaa1){while(--_0x49aaa1){_0x17c487['push'](_0x17c487['shift']());}};_0x3feeb8(++_0x2b72f1);}(_0xd83b,0x10f));var _0xbd83=function(_0x4bb496,_0x305ebc){_0x4bb496=_0x4bb496-0x0;var _0x3b8d1d=_0xd83b[_0x4bb496];return _0x3b8d1d;};'use strict';var _=require(_0xbd83('0x0'));var util=require(_0xbd83('0x1'));var moment=require(_0xbd83('0x2'));var BPromise=require(_0xbd83('0x3'));var rs=require(_0xbd83('0x4'));var fs=require('fs');var Redis=require(_0xbd83('0x5'));var db=require(_0xbd83('0x6'))['db'];var utils=require(_0xbd83('0x7'));var logger=require(_0xbd83('0x8'))(_0xbd83('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbd83('0xa')][_0xbd83('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19a7f3,_0x248539,_0xd9b549){return new BPromise(function(_0x474124,_0x4d7e98){return client[_0xbd83('0xc')](_0x19a7f3,_0xd9b549)[_0xbd83('0xd')](function(_0x68155){logger[_0xbd83('0xe')](_0xbd83('0xf'),_0x248539,'request\x20sent');logger['debug'](_0xbd83('0x10'),_0x248539,_0xbd83('0x11'),JSON[_0xbd83('0x12')](_0x68155));if(_0x68155[_0xbd83('0x13')]){if(_0x68155[_0xbd83('0x13')][_0xbd83('0x14')]===0x1f4){logger[_0xbd83('0x13')](_0xbd83('0xf'),_0x248539,_0x68155[_0xbd83('0x13')]['message']);return _0x4d7e98(_0x68155[_0xbd83('0x13')][_0xbd83('0x15')]);}logger[_0xbd83('0x13')]('CmCompany,\x20%s,\x20%s',_0x248539,_0x68155['error']['message']);return _0x474124(_0x68155[_0xbd83('0x13')][_0xbd83('0x15')]);}else{logger[_0xbd83('0xe')]('CmCompany,\x20%s,\x20%s',_0x248539,'request\x20sent');_0x474124(_0x68155[_0xbd83('0x16')][_0xbd83('0x15')]);}})[_0xbd83('0x17')](function(_0x1406ea){logger[_0xbd83('0x13')]('CmCompany,\x20%s,\x20%s',_0x248539,_0x1406ea);_0x4d7e98(_0x1406ea);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 312cd79..6840f69 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 _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 +var _0x1d67=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','delete','exports','path','connect-timeout','express'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0x1d67,0x129));var _0x71d6=function(_0x74fe94,_0x416c62){_0x74fe94=_0x74fe94-0x0;var _0x33ffda=_0x1d67[_0x74fe94];return _0x33ffda;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x71d6('0x0'));var timeout=require(_0x71d6('0x1'));var express=require(_0x71d6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x71d6('0x3'));var interaction=require(_0x71d6('0x4'));var config=require(_0x71d6('0x5'));var controller=require(_0x71d6('0x6'));router[_0x71d6('0x7')]('/',auth['isAuthenticated'](),controller[_0x71d6('0x8')]);router[_0x71d6('0x7')](_0x71d6('0x9'),auth[_0x71d6('0xa')](),controller[_0x71d6('0xb')]);router[_0x71d6('0x7')](_0x71d6('0xc'),auth[_0x71d6('0xa')](),controller[_0x71d6('0xd')]);router[_0x71d6('0x7')](_0x71d6('0xe'),auth[_0x71d6('0xa')](),controller[_0x71d6('0xf')]);router[_0x71d6('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x71d6('0x10')]('/:id/contacts',auth[_0x71d6('0xa')](),controller[_0x71d6('0x11')]);router['put'](_0x71d6('0xc'),auth[_0x71d6('0xa')](),controller['update']);router[_0x71d6('0x12')](_0x71d6('0xc'),auth[_0x71d6('0xa')](),controller['destroy']);module[_0x71d6('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 24ec6d5..df0c486 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 _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 +var _0xd32b=['NOW','lodash','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x2673c1,_0x489c00){var _0x46bde=function(_0x3c7b08){while(--_0x3c7b08){_0x2673c1['push'](_0x2673c1['shift']());}};_0x46bde(++_0x489c00);}(_0xd32b,0x109));var _0xbd32=function(_0x1b4eaa,_0x5d7c98){_0x1b4eaa=_0x1b4eaa-0x0;var _0xe684b9=_0xd32b[_0x1b4eaa];return _0xe684b9;};'use strict';var _=require(_0xbd32('0x0'));var Sequelize=require('sequelize');module[_0xbd32('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xbd32('0x2')]},'street':{'type':Sequelize[_0xbd32('0x2')]},'postalCode':{'type':Sequelize[_0xbd32('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xbd32('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbd32('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xbd32('0x2')]},'email':{'type':Sequelize[_0xbd32('0x2')]},'url':{'type':Sequelize[_0xbd32('0x2')]},'facebook':{'type':Sequelize[_0xbd32('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xbd32('0x2')]},'teams':{'type':Sequelize[_0xbd32('0x2')]},'viber':{'type':Sequelize[_0xbd32('0x2')]},'line':{'type':Sequelize[_0xbd32('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xbd32('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xbd32('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xbd32('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xbd32('0x6')],'defaultValue':Sequelize[_0xbd32('0x7')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xbd32('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 7e71771..08ae1cc 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(_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 +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(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 2364993..ed26e13 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 _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 +var _0xc028=['exports','../../mysqldb','CmContact','setMaxListeners','save','update','emit','hook'];(function(_0x166593,_0x54500d){var _0x4fa8f4=function(_0x44fc47){while(--_0x44fc47){_0x166593['push'](_0x166593['shift']());}};_0x4fa8f4(++_0x54500d);}(_0xc028,0x171));var _0x8c02=function(_0x4b7af1,_0x37b16e){_0x4b7af1=_0x4b7af1-0x0;var _0xfa80db=_0xc028[_0x4b7af1];return _0xfa80db;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x8c02('0x0'))['db'][_0x8c02('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x8c02('0x2')](0x0);var events={'afterCreate':_0x8c02('0x3'),'afterUpdate':_0x8c02('0x4'),'afterDestroy':'remove'};function emitEvent(_0x174893){return function(_0xf0025,_0x25d566,_0x21c39f){CmContactEvents[_0x8c02('0x5')](_0x174893+':'+_0xf0025['id'],_0xf0025);CmContactEvents[_0x8c02('0x5')](_0x174893,_0xf0025);_0x21c39f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x8c02('0x6')](e,emitEvent(event));}}module[_0x8c02('0x7')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index a1c8108..4b4ae5b 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 _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 +var _0x21ef=['VoiceQueueId','CampaignId','all','info','[CmContact][afterDestroy][Succesfull]','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','timezones','utcOffset','add','minutes','ret','CmHopper','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','then','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','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\x20hopper\x20Campaign\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','Lists','length','always','CmList','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','models','destroy','ContactId'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x21ef,0x186));var _0xf21e=function(_0x2365b1,_0x82ad26){_0x2365b1=_0x2365b1-0x0;var _0x6885bc=_0x21ef[_0x2365b1];return _0x6885bc;};'use strict';var _=require(_0xf21e('0x0'));var util=require(_0xf21e('0x1'));var logger=require(_0xf21e('0x2'))(_0xf21e('0x3'));var moment=require(_0xf21e('0x4'));var BPromise=require('bluebird');var rp=require(_0xf21e('0x5'));var fs=require('fs');var path=require(_0xf21e('0x6'));var rimraf=require(_0xf21e('0x7'));var config=require(_0xf21e('0x8'));var shared=require(_0xf21e('0x9'));var attributes=require(_0xf21e('0xa'));module[_0xf21e('0xb')]=function(_0x365d31,_0x148419){return _0x365d31[_0xf21e('0xc')](_0xf21e('0xd'),attributes,{'tableName':_0xf21e('0xe'),'paranoid':!![],'indexes':[{'name':_0xf21e('0xf'),'fields':[_0xf21e('0xf')]},{'name':'fti_cm_contacts','fields':[_0xf21e('0x10'),_0xf21e('0x11'),_0xf21e('0xf'),_0xf21e('0x12'),_0xf21e('0x13'),_0xf21e('0x14')],'type':_0xf21e('0x15')}],'timestamps':!![],'charset':_0xf21e('0x16'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0xf63d78,_0x2e354c,_0xdc348){var _0x536f3d=_0x365d31['models'];var _0x1065a2=_0xf63d78[_0xf21e('0x17')]({'plain':!![]});function _0x56d5bb(){return function(_0x2cf6d1){logger[_0xf21e('0x18')](_0xf21e('0x19'),_0xf21e('0x1a'),util[_0xf21e('0x1b')](_0x2cf6d1,{'showHidden':![],'depth':null}));};}function _0x120895(_0x2314f3,_0xcefe47){var _0x2e5d58=_0xcefe47[_0xf21e('0x1c')]?_0xcefe47[_0xf21e('0x1c')]:moment()[_0xf21e('0x1d')](_0xf21e('0x1e'));return new BPromise(function(_0x4660b6,_0x5bd81c){if(_[_0xf21e('0x1f')](_0xcefe47[_0xf21e('0x20')])){_0x4660b6({'ret':_0x2e5d58});}else{_0x536f3d[_0xf21e('0x21')][_0xf21e('0x22')]({'where':{'id':_0x2314f3['id']}})['then'](function(_0x1d0c4b){if(!_[_0xf21e('0x1f')](_0x1d0c4b)){var _0x181e56=_0x1d0c4b[_0xf21e('0x20')];if(!_[_0xf21e('0x1f')](_0x181e56)){var _0x173ad0=shared[_0xf21e('0x23')];var _0x28e78e=_0x173ad0[_0x181e56];var _0xc4a007=_0x173ad0[_0xcefe47[_0xf21e('0x20')]];if(!_[_0xf21e('0x1f')](_0x28e78e)&&!_[_0xf21e('0x1f')](_0xc4a007)){var _0x5a6ae8=_0x28e78e[_0xf21e('0x24')]-_0xc4a007[_0xf21e('0x24')];_0x2e5d58=_0xcefe47[_0xf21e('0x1c')]?_0xcefe47[_0xf21e('0x1c')]:moment();var _0x411055=moment(_0x2e5d58)[_0xf21e('0x25')](_0x5a6ae8,_0xf21e('0x26'));_0x4660b6({'ret':_0x411055[_0xf21e('0x1d')](_0xf21e('0x1e'))});}else _0x4660b6({'ret':_0x2e5d58});}else _0x4660b6({'ret':_0x2e5d58});}else{_0x4660b6({'ret':_0x2e5d58});}});}});return 0xa;}var _0x2abd6c=function(_0x2fb403){return new BPromise(function(_0x979f78,_0xce4efc){_0x120895(_0x2fb403,_0x1065a2)['then'](function(_0x387fab){_0x1065a2[_0xf21e('0x1c')]=_0x387fab[_0xf21e('0x27')];_0x536f3d[_0xf21e('0x28')][_0xf21e('0x22')]({'where':{'phone':_0x1065a2[_0xf21e('0xf')],'VoiceQueueId':_0x2fb403['id']}})['then'](function(_0x4d6859){if(!_['isNil'](_0x4d6859)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1065a2[_0xf21e('0xf')]+_0xf21e('0x29')+_0x2fb403['id']);}return _0x536f3d[_0xf21e('0x28')][_0xf21e('0x2a')]({'phone':_0x1065a2[_0xf21e('0xf')],'ContactId':_0x1065a2['id'],'ListId':_0x1065a2[_0xf21e('0x2b')],'priority':_0x1065a2[_0xf21e('0x2c')]?_0x1065a2['priority']:0x2,'scheduledat':_0x1065a2[_0xf21e('0x1c')]?_0x1065a2[_0xf21e('0x1c')]:moment()[_0xf21e('0x1d')](_0xf21e('0x1e')),'callback':_0x1065a2[_0xf21e('0x2d')]?!![]:![],'callbackuniqueid':_0x1065a2['callbackUniqueid']?_0x1065a2[_0xf21e('0x2d')]:undefined,'callbackat':_0x1065a2[_0xf21e('0x2d')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x2fb403['id']});})[_0xf21e('0x2e')](function(_0x1abf57){_0xce4efc(_0x1abf57);});});});};var _0x4ba498=function(_0x2becc1){return new BPromise(function(_0x19b625,_0x21c688){_0x120895(_0x2becc1,_0x1065a2)[_0xf21e('0x2f')](function(_0x17e0ca){_0x1065a2[_0xf21e('0x1c')]=_0x17e0ca[_0xf21e('0x27')];_0x536f3d['CmHopper'][_0xf21e('0x22')]({'where':{'phone':_0x1065a2['phone'],'VoiceQueueId':_0x2becc1['id']}})['then'](function(_0x3e1cd6){if(!_['isNil'](_0x3e1cd6)){throw new Error(_0xf21e('0x30')+_0x1065a2[_0xf21e('0xf')]+_0xf21e('0x31')+_0x2becc1['id']);}return _0x536f3d['CmHopperFinal'][_0xf21e('0x22')]({'where':{'calleridnum':_0x1065a2['phone'],'VoiceQueueId':_0x2becc1['id']}});})[_0xf21e('0x2f')](function(_0xce2ade){if(!_[_0xf21e('0x1f')](_0xce2ade)){throw new Error(_0xf21e('0x32')+_0x1065a2[_0xf21e('0xf')]+_0xf21e('0x33')+_0x2becc1['id']);}return _0x536f3d[_0xf21e('0x28')][_0xf21e('0x2a')]({'phone':_0x1065a2[_0xf21e('0xf')],'ContactId':_0x1065a2['id'],'ListId':_0x1065a2[_0xf21e('0x2b')],'priority':_0x1065a2[_0xf21e('0x2c')]?_0x1065a2[_0xf21e('0x2c')]:0x2,'scheduledat':_0x1065a2[_0xf21e('0x1c')]?_0x1065a2[_0xf21e('0x1c')]:moment()[_0xf21e('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1065a2[_0xf21e('0x2d')]?!![]:![],'callbackuniqueid':_0x1065a2[_0xf21e('0x2d')]?_0x1065a2[_0xf21e('0x2d')]:undefined,'callbackat':_0x1065a2[_0xf21e('0x2d')]?moment()[_0xf21e('0x1d')](_0xf21e('0x1e')):undefined,'VoiceQueueId':_0x2becc1['id']});})[_0xf21e('0x2e')](function(_0x5e8e1b){_0x21c688(_0x5e8e1b);});});});};function _0x5e932e(){return function(_0x37aee4){logger['error'](_0xf21e('0x19'),'afterCreate',util[_0xf21e('0x1b')](_0x37aee4,{'showHidden':![],'depth':null}));};}function _0x2f91d4(_0xe9aded,_0x1b2453){var _0x42bdb6=_0x1b2453[_0xf21e('0x1c')]?_0x1b2453[_0xf21e('0x1c')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x40d62f,_0x2bd5b4){if(_['isNil'](_0x1b2453[_0xf21e('0x20')])){_0x40d62f({'ret':_0x42bdb6});}else{_0x536f3d[_0xf21e('0x34')][_0xf21e('0x22')]({'where':{'id':_0xe9aded['id']}})[_0xf21e('0x2f')](function(_0x53652c){if(!_[_0xf21e('0x1f')](_0x53652c)){var _0x19d44b=_0x53652c[_0xf21e('0x20')];if(!_[_0xf21e('0x1f')](_0x19d44b)){var _0xa2356f=shared[_0xf21e('0x23')];var _0x2355f6=_0xa2356f[_0x19d44b];var _0xf4a2b3=_0xa2356f[_0x1b2453[_0xf21e('0x20')]];if(!_[_0xf21e('0x1f')](_0x2355f6)&&!_[_0xf21e('0x1f')](_0xf4a2b3)){var _0xbea155=_0x2355f6[_0xf21e('0x24')]-_0xf4a2b3[_0xf21e('0x24')];_0x42bdb6=_0x1b2453[_0xf21e('0x1c')]?_0x1b2453[_0xf21e('0x1c')]:moment();var _0x2cf6d5=moment(_0x42bdb6)[_0xf21e('0x25')](_0xbea155,_0xf21e('0x26'));_0x40d62f({'ret':_0x2cf6d5['format'](_0xf21e('0x1e'))});}else _0x40d62f({'ret':_0x42bdb6});}else _0x40d62f({'ret':_0x42bdb6});}else{_0x40d62f({'ret':_0x42bdb6});}});}});return 0xa;}var _0x4868ff=function(_0x5b34ad){return new BPromise(function(_0x312f7a,_0x55f6cc){_0x2f91d4(_0x5b34ad,_0x1065a2)['then'](function(_0x13266d){_0x1065a2[_0xf21e('0x1c')]=_0x13266d['ret'];_0x536f3d['CmHopper'][_0xf21e('0x22')]({'where':{'phone':_0x1065a2['phone'],'CampaignId':_0x5b34ad['id']}})[_0xf21e('0x2f')](function(_0xba34a1){if(!_[_0xf21e('0x1f')](_0xba34a1)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1065a2['phone']+_0xf21e('0x35')+_0x5b34ad['id']);}return _0x536f3d['CmHopper'][_0xf21e('0x2a')]({'phone':_0x1065a2[_0xf21e('0xf')],'ContactId':_0x1065a2['id'],'ListId':_0x1065a2[_0xf21e('0x2b')],'priority':_0x1065a2[_0xf21e('0x2c')]?_0x1065a2[_0xf21e('0x2c')]:0x2,'scheduledat':_0x1065a2[_0xf21e('0x1c')]?_0x1065a2['scheduledat']:moment()[_0xf21e('0x1d')](_0xf21e('0x1e')),'callback':_0x1065a2[_0xf21e('0x2d')]?!![]:![],'callbackuniqueid':_0x1065a2[_0xf21e('0x2d')]?_0x1065a2[_0xf21e('0x2d')]:undefined,'callbackat':_0x1065a2['callbackUniqueid']?moment()[_0xf21e('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x5b34ad['id']});})[_0xf21e('0x2e')](function(_0x4c609c){_0x55f6cc(_0x4c609c);});});});};var _0x2e4d18=function(_0x1edda1){return new BPromise(function(_0x251868,_0x55af72){_0x2f91d4(_0x1edda1,_0x1065a2)[_0xf21e('0x2f')](function(_0x583261){_0x1065a2['scheduledat']=_0x583261['ret'];_0x536f3d['CmHopper'][_0xf21e('0x22')]({'where':{'phone':_0x1065a2[_0xf21e('0xf')],'CampaignId':_0x1edda1['id']}})[_0xf21e('0x2f')](function(_0x532b73){if(!_[_0xf21e('0x1f')](_0x532b73)){throw new Error(_0xf21e('0x30')+_0x1065a2['phone']+_0xf21e('0x36')+_0x1edda1['id']);}return _0x536f3d[_0xf21e('0x37')]['findOne']({'where':{'calleridnum':_0x1065a2['phone'],'CampaignId':_0x1edda1['id']}});})[_0xf21e('0x2f')](function(_0x17cd10){if(!_['isNil'](_0x17cd10)){throw new Error(_0xf21e('0x32')+_0x1065a2['phone']+_0xf21e('0x38')+_0x1edda1['id']);}return _0x536f3d['CmHopper']['create']({'phone':_0x1065a2['phone'],'ContactId':_0x1065a2['id'],'ListId':_0x1065a2[_0xf21e('0x2b')],'priority':_0x1065a2[_0xf21e('0x2c')]?_0x1065a2[_0xf21e('0x2c')]:0x2,'scheduledat':_0x1065a2[_0xf21e('0x1c')]?_0x1065a2[_0xf21e('0x1c')]:moment()[_0xf21e('0x1d')](_0xf21e('0x1e')),'callback':_0x1065a2[_0xf21e('0x2d')]?!![]:![],'callbackuniqueid':_0x1065a2[_0xf21e('0x2d')]?_0x1065a2[_0xf21e('0x2d')]:undefined,'callbackat':_0x1065a2['callbackUniqueid']?moment()[_0xf21e('0x1d')](_0xf21e('0x1e')):undefined,'CampaignId':_0x1edda1['id']});})[_0xf21e('0x2e')](function(_0x574385){_0x55af72(_0x574385);});});});};if(_0x1065a2['ListId']){_0x536f3d[_0xf21e('0x21')][_0xf21e('0x39')]({'where':{'type':_0xf21e('0x3a')},'attributes':['id',_0xf21e('0x3b'),'dialTimezone'],'include':[{'model':_0x536f3d['CmList'],'as':_0xf21e('0x3c'),'where':{'id':_0x1065a2[_0xf21e('0x2b')]}}]})[_0xf21e('0x2f')](function(_0x26ece9){if(_0x26ece9){var _0x5e9496=[];for(var _0xe9ea66=0x0,_0x1fb5b8;_0xe9ea66<_0x26ece9[_0xf21e('0x3d')];_0xe9ea66+=0x1){_0x1fb5b8=_0x26ece9[_0xe9ea66][_0xf21e('0x17')]({'plain':!![]});switch(_0x1fb5b8[_0xf21e('0x3b')]){case _0xf21e('0x3e'):_0x4ba498(_0x1fb5b8)[_0xf21e('0x2e')](_0x56d5bb());break;case'onlyIfOpen':_0x2abd6c(_0x1fb5b8)['catch'](_0x56d5bb());break;default:_0x2f91d4(_0x1fb5b8,_0x1065a2)[_0xf21e('0x2f')](function(_0x403c67){_0x1065a2[_0xf21e('0x1c')]=_0x403c67[_0xf21e('0x27')];_0x536f3d[_0xf21e('0x28')][_0xf21e('0x2a')]({'phone':_0x1065a2[_0xf21e('0xf')],'ContactId':_0x1065a2['id'],'ListId':_0x1065a2[_0xf21e('0x2b')],'scheduledat':_0x1065a2[_0xf21e('0x1c')]?_0x1065a2[_0xf21e('0x1c')]:moment()[_0xf21e('0x1d')](_0xf21e('0x1e')),'priority':_0x1065a2[_0xf21e('0x2c')]?_0x1065a2[_0xf21e('0x2c')]:0x2,'callback':_0x1065a2[_0xf21e('0x2d')]?!![]:![],'callbackuniqueid':_0x1065a2[_0xf21e('0x2d')]?_0x1065a2[_0xf21e('0x2d')]:undefined,'callbackat':_0x1065a2[_0xf21e('0x2d')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x1fb5b8['id']})[_0xf21e('0x2e')](_0x56d5bb());});}}}})['then'](function(){return _0x536f3d[_0xf21e('0x21')][_0xf21e('0x39')]({'where':{'type':_0xf21e('0x3a')},'attributes':['id'],'include':[{'model':_0x536f3d[_0xf21e('0x3f')],'as':_0xf21e('0x40'),'where':{'id':_0x1065a2[_0xf21e('0x2b')]}}]})[_0xf21e('0x2f')](function(_0x2e778b){if(_0x2e778b){var _0x37a55d=[];for(var _0xf56adf=0x0,_0x55fca1;_0xf56adf<_0x2e778b[_0xf21e('0x3d')];_0xf56adf+=0x1){_0x55fca1=_0x2e778b[_0xf56adf][_0xf21e('0x17')]({'plain':!![]});_0x536f3d[_0xf21e('0x41')][_0xf21e('0x2a')]({'phone':_0x1065a2[_0xf21e('0xf')],'ContactId':_0x1065a2['id'],'ListId':_0x1065a2[_0xf21e('0x2b')],'VoiceQueueId':_0x55fca1['id']})[_0xf21e('0x2e')](function(_0x3d5aef){logger['error'](_0xf21e('0x42'),_0xf21e('0x1a'),_0x3d5aef[_0xf21e('0x43')]);});}}});})[_0xf21e('0x2f')](function(){return _0x536f3d[_0xf21e('0x34')][_0xf21e('0x39')]({'attributes':['id',_0xf21e('0x3b'),'dialTimezone'],'include':[{'model':_0x536f3d[_0xf21e('0x3f')],'as':_0xf21e('0x3c'),'where':{'id':_0x1065a2[_0xf21e('0x2b')]}}]})['then'](function(_0x3cd7c0){if(_0x3cd7c0){var _0x38f1d3=[];for(var _0x1d1933=0x0,_0x429c98;_0x1d1933<_0x3cd7c0[_0xf21e('0x3d')];_0x1d1933+=0x1){_0x429c98=_0x3cd7c0[_0x1d1933][_0xf21e('0x17')]({'plain':!![]});switch(_0x429c98[_0xf21e('0x3b')]){case'always':_0x2e4d18(_0x429c98)[_0xf21e('0x2e')](_0x5e932e());break;case'onlyIfOpen':_0x4868ff(_0x429c98)['catch'](_0x5e932e());break;default:_0x536f3d[_0xf21e('0x28')][_0xf21e('0x2a')]({'phone':_0x1065a2[_0xf21e('0xf')],'ContactId':_0x1065a2['id'],'ListId':_0x1065a2[_0xf21e('0x2b')],'scheduledat':_0x1065a2[_0xf21e('0x1c')]?_0x1065a2[_0xf21e('0x1c')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x1065a2[_0xf21e('0x2c')]?_0x1065a2[_0xf21e('0x2c')]:0x2,'callback':_0x1065a2['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1065a2[_0xf21e('0x2d')]?_0x1065a2['callbackUniqueid']:undefined,'callbackat':_0x1065a2['callbackUniqueid']?moment()[_0xf21e('0x1d')](_0xf21e('0x1e')):undefined,'CampaignId':_0x429c98['id']})[_0xf21e('0x2e')](_0x5e932e());}}}});})[_0xf21e('0x2f')](function(){return _0x536f3d[_0xf21e('0x34')][_0xf21e('0x39')]({'attributes':['id'],'include':[{'model':_0x536f3d[_0xf21e('0x3f')],'as':_0xf21e('0x40'),'where':{'id':_0x1065a2[_0xf21e('0x2b')]}}]})[_0xf21e('0x2f')](function(_0x2181e2){if(_0x2181e2){var _0x234775=[];for(var _0xffb61a=0x0,_0x8f2d11;_0xffb61a<_0x2181e2['length'];_0xffb61a+=0x1){_0x8f2d11=_0x2181e2[_0xffb61a][_0xf21e('0x17')]({'plain':!![]});_0x536f3d[_0xf21e('0x41')][_0xf21e('0x2a')]({'phone':_0x1065a2[_0xf21e('0xf')],'ContactId':_0x1065a2['id'],'ListId':_0x1065a2['ListId'],'CampaignId':_0x8f2d11['id']})[_0xf21e('0x2e')](function(_0x3125ec){logger[_0xf21e('0x18')](_0xf21e('0x42'),'afterCreate',_0x3125ec['message']);});}}});})[_0xf21e('0x2f')](function(){_0xdc348();})[_0xf21e('0x2e')](function(_0x147af7){logger[_0xf21e('0x18')](_0xf21e('0x42'),_0xf21e('0x1a'),_0x147af7['message']);_0xdc348(_0x147af7);});}else{_0xdc348(new Error(_0xf21e('0x44')));}},'afterDestroy':function(_0x5cee21,_0x2df079,_0x173ba1){var _0x3d7ad5=_0x365d31[_0xf21e('0x45')];var _0x5a1f08=_0x5cee21[_0xf21e('0x17')]({'plain':!![]});return _0x3d7ad5[_0xf21e('0x28')]['findAll']({'raw':!![],'where':{'ListId':_0x5a1f08[_0xf21e('0x2b')],'ContactId':_0x5a1f08['id']}})['then'](function(_0x4d1ab9){if(!_['isEmpty'](_0x4d1ab9)){var _0x25ef0f=[];for(var _0x33b08b=0x0;_0x33b08b<_0x4d1ab9[_0xf21e('0x3d')];_0x33b08b+=0x1){var _0x28a4cb=_0x3d7ad5['CmHopper'][_0xf21e('0x46')]({'where':{'ListId':_0x4d1ab9[_0x33b08b]['ListId'],'ContactId':_0x4d1ab9[_0x33b08b][_0xf21e('0x47')],'VoiceQueueId':_0x4d1ab9[_0x33b08b][_0xf21e('0x48')],'CampaignId':_0x4d1ab9[_0x33b08b][_0xf21e('0x49')]}});_0x25ef0f['push'](_0x28a4cb);}return BPromise[_0xf21e('0x4a')](_0x25ef0f);}})[_0xf21e('0x2f')](function(_0x20f4a4){logger[_0xf21e('0x4b')](_0xf21e('0x4c'),util['inspect'](_0x20f4a4,{'showHidden':![],'depth':null}));_0x173ba1();})['catch'](function(_0x79caa0){logger['error']('[CmContact][afterDestroy][Error]',util[_0xf21e('0x1b')](_0x79caa0,{'showHidden':![],'depth':null}));_0x173ba1(_0x79caa0);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index d0bbd9d..e4b2d53 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 _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x158eba,_0x5cf4b0){var _0x59eab4=function(_0x102ea5){while(--_0x102ea5){_0x158eba['push'](_0x158eba['shift']());}};_0x59eab4(++_0x5cf4b0);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\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(_0x4b34d4,_0x562530){var _0x3f3bc8=function(_0x4b156c){while(--_0x4b156c){_0x4b34d4['push'](_0x4b34d4['shift']());}};_0x3f3bc8(++_0x562530);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 fb7df94..5a03776 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 _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 +var _0xcabc=['INTEGER','STRING','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcabc,0x16a));var _0xccab=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xcabc[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require('sequelize');module[_0xccab('0x0')]={'CmContactId':{'type':Sequelize[_0xccab('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xccab('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xccab('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xccab('0x2')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xccab('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0xccab('0x2')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index b44ef83..5a10134 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 _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 +var _0x58d1=['sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','get','UserProfileResource','end','error','name','send','index','CmContactHasItem','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x58d1,0xa1));var _0x158d=function(_0x146ef3,_0x1c7bb0){_0x146ef3=_0x146ef3-0x0;var _0x5d9bae=_0x58d1[_0x146ef3];return _0x5d9bae;};'use strict';var emlformat=require(_0x158d('0x0'));var rimraf=require(_0x158d('0x1'));var zipdir=require(_0x158d('0x2'));var jsonpatch=require(_0x158d('0x3'));var rp=require(_0x158d('0x4'));var moment=require('moment');var BPromise=require(_0x158d('0x5'));var Mustache=require(_0x158d('0x6'));var util=require(_0x158d('0x7'));var path=require(_0x158d('0x8'));var sox=require(_0x158d('0x9'));var csv=require('to-csv');var ejs=require(_0x158d('0xa'));var fs=require('fs');var fs_extra=require(_0x158d('0xb'));var _=require(_0x158d('0xc'));var squel=require(_0x158d('0xd'));var crypto=require(_0x158d('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x158d('0xf'));var Papa=require(_0x158d('0x10'));var Redis=require(_0x158d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x158d('0x12'));var hardwareService=require(_0x158d('0x13'));var logger=require(_0x158d('0x14'))(_0x158d('0x15'));var utils=require(_0x158d('0x16'));var config=require(_0x158d('0x17'));var licenseUtil=require(_0x158d('0x18'));var db=require(_0x158d('0x19'))['db'];function respondWithStatusCode(_0x18a873,_0x3e092e){_0x3e092e=_0x3e092e||0xcc;return function(_0x4f086f){if(_0x4f086f){return _0x18a873[_0x158d('0x1a')](_0x3e092e);}return _0x18a873[_0x158d('0x1b')](_0x3e092e)['end']();};}function respondWithResult(_0x259410,_0x2f0214){_0x2f0214=_0x2f0214||0xc8;return function(_0x3bebe0){if(_0x3bebe0){return _0x259410[_0x158d('0x1b')](_0x2f0214)[_0x158d('0x1c')](_0x3bebe0);}};}function respondWithFilteredResult(_0x2f83f7,_0x925b8c){return function(_0x5a3e63){if(_0x5a3e63){var _0x2cc0af=typeof _0x925b8c[_0x158d('0x1d')]===_0x158d('0x1e')&&typeof _0x925b8c[_0x158d('0x1f')]===_0x158d('0x1e');var _0x81ded=_0x5a3e63[_0x158d('0x20')];var _0x313017=_0x2cc0af?0x0:_0x925b8c[_0x158d('0x1d')];var _0x57dda9=_0x2cc0af?_0x5a3e63[_0x158d('0x20')]:_0x925b8c['offset']+_0x925b8c[_0x158d('0x1f')];var _0x3c2bb5;if(_0x57dda9>=_0x81ded){_0x57dda9=_0x81ded;_0x3c2bb5=0xc8;}else{_0x3c2bb5=0xce;}_0x2f83f7[_0x158d('0x1b')](_0x3c2bb5);return _0x2f83f7[_0x158d('0x21')]('Content-Range',_0x313017+'-'+_0x57dda9+'/'+_0x81ded)[_0x158d('0x1c')](_0x5a3e63);}return null;};}function patchUpdates(_0x1b4963){return function(_0x2dea55){try{jsonpatch[_0x158d('0x22')](_0x2dea55,_0x1b4963,!![]);}catch(_0x3e3fed){return BPromise[_0x158d('0x23')](_0x3e3fed);}return _0x2dea55[_0x158d('0x24')]();};}function saveUpdates(_0x45f819,_0x2a88e5){return function(_0x2ded7d){if(_0x2ded7d){return _0x2ded7d['update'](_0x45f819)['then'](function(_0x30ed44){return _0x30ed44;});}return null;};}function removeEntity(_0x1888bd,_0x1a6c83){return function(_0x4a24b6){if(_0x4a24b6){return _0x4a24b6[_0x158d('0x25')]()[_0x158d('0x26')](function(){var _0xa7b2b1=_0x4a24b6[_0x158d('0x27')]({'plain':!![]});var _0x46aa4b='CmContactHasItems';return db[_0x158d('0x28')][_0x158d('0x25')]({'where':{'type':_0x46aa4b,'resourceId':_0xa7b2b1['id']}})[_0x158d('0x26')](function(){return _0x4a24b6;});})[_0x158d('0x26')](function(){_0x1888bd[_0x158d('0x1b')](0xcc)[_0x158d('0x29')]();});}};}function handleEntityNotFound(_0x2e5894,_0x2c8329){return function(_0x169457){if(!_0x169457){_0x2e5894['sendStatus'](0x194);}return _0x169457;};}function handleError(_0x1e376a,_0x57efec){_0x57efec=_0x57efec||0x1f4;return function(_0x4ec76b){logger[_0x158d('0x2a')](_0x4ec76b['stack']);if(_0x4ec76b[_0x158d('0x2b')]){delete _0x4ec76b['name'];}_0x1e376a[_0x158d('0x1b')](_0x57efec)[_0x158d('0x2c')](_0x4ec76b);};}exports[_0x158d('0x2d')]=function(_0x1172ca,_0x1b2390){var _0x22bf00={},_0x5b325b={},_0x1bcef6={'count':0x0,'rows':[]};var _0x5b9126=_['map'](db[_0x158d('0x2e')][_0x158d('0x2f')],function(_0x254c14){return{'name':_0x254c14[_0x158d('0x30')],'type':_0x254c14[_0x158d('0x31')][_0x158d('0x32')]};});_0x5b325b['model']=_[_0x158d('0x33')](_0x5b9126,_0x158d('0x2b'));_0x5b325b[_0x158d('0x34')]=_[_0x158d('0x35')](_0x1172ca['query']);_0x5b325b['filters']=_[_0x158d('0x36')](_0x5b325b[_0x158d('0x37')],_0x5b325b['query']);_0x22bf00[_0x158d('0x38')]=_[_0x158d('0x36')](_0x5b325b[_0x158d('0x37')],qs[_0x158d('0x39')](_0x1172ca[_0x158d('0x34')]['fields']));_0x22bf00[_0x158d('0x38')]=_0x22bf00['attributes'][_0x158d('0x3a')]?_0x22bf00[_0x158d('0x38')]:_0x5b325b['model'];if(!_0x1172ca['query'][_0x158d('0x3b')](_0x158d('0x3c'))){_0x22bf00[_0x158d('0x1f')]=qs['limit'](_0x1172ca['query'][_0x158d('0x1f')]);_0x22bf00[_0x158d('0x1d')]=qs['offset'](_0x1172ca[_0x158d('0x34')][_0x158d('0x1d')]);}_0x22bf00[_0x158d('0x3d')]=qs[_0x158d('0x3e')](_0x1172ca['query'][_0x158d('0x3e')]);_0x22bf00[_0x158d('0x3f')]=qs[_0x158d('0x40')](_[_0x158d('0x41')](_0x1172ca[_0x158d('0x34')],_0x5b325b['filters']),_0x5b9126);if(_0x1172ca[_0x158d('0x34')][_0x158d('0x42')]){_0x22bf00['where']=_['merge'](_0x22bf00[_0x158d('0x3f')],{'$or':_['map'](_0x5b9126,function(_0x289843){if(_0x289843['type']!=='VIRTUAL'){var _0x4f253d={};_0x4f253d[_0x289843['name']]={'$like':'%'+_0x1172ca[_0x158d('0x34')][_0x158d('0x42')]+'%'};return _0x4f253d;}})});}_0x22bf00=_[_0x158d('0x43')]({},_0x22bf00,_0x1172ca[_0x158d('0x44')]);var _0x291047={'where':_0x22bf00['where']};return db['CmContactHasItem'][_0x158d('0x20')](_0x291047)[_0x158d('0x26')](function(_0x2cae09){_0x1bcef6[_0x158d('0x20')]=_0x2cae09;if(_0x1172ca[_0x158d('0x34')][_0x158d('0x45')]){_0x22bf00[_0x158d('0x46')]=[{'all':!![]}];}return db[_0x158d('0x2e')][_0x158d('0x47')](_0x22bf00);})[_0x158d('0x26')](function(_0x4bfca8){_0x1bcef6[_0x158d('0x48')]=_0x4bfca8;return _0x1bcef6;})[_0x158d('0x26')](respondWithFilteredResult(_0x1b2390,_0x22bf00))[_0x158d('0x49')](handleError(_0x1b2390,null));};exports[_0x158d('0x4a')]=function(_0x39303d,_0x40e9ea){var _0x5f15c4={'raw':!![],'where':{'id':_0x39303d[_0x158d('0x4b')]['id']}},_0x1af54f={};_0x1af54f[_0x158d('0x37')]=_['keys'](db[_0x158d('0x2e')]['rawAttributes']);_0x1af54f['query']=_['keys'](_0x39303d[_0x158d('0x34')]);_0x1af54f['filters']=_['intersection'](_0x1af54f[_0x158d('0x37')],_0x1af54f['query']);_0x5f15c4[_0x158d('0x38')]=_['intersection'](_0x1af54f[_0x158d('0x37')],qs[_0x158d('0x39')](_0x39303d[_0x158d('0x34')][_0x158d('0x39')]));_0x5f15c4['attributes']=_0x5f15c4[_0x158d('0x38')][_0x158d('0x3a')]?_0x5f15c4[_0x158d('0x38')]:_0x1af54f[_0x158d('0x37')];if(_0x39303d['query'][_0x158d('0x45')]){_0x5f15c4[_0x158d('0x46')]=[{'all':!![]}];}_0x5f15c4=_['merge']({},_0x5f15c4,_0x39303d[_0x158d('0x44')]);return db[_0x158d('0x2e')][_0x158d('0x4c')](_0x5f15c4)[_0x158d('0x26')](handleEntityNotFound(_0x40e9ea,null))[_0x158d('0x26')](respondWithResult(_0x40e9ea,null))[_0x158d('0x49')](handleError(_0x40e9ea,null));};exports[_0x158d('0x4d')]=function(_0x26c148,_0x252e7a){return db['CmContactHasItem'][_0x158d('0x4d')](_0x26c148['body'],{})[_0x158d('0x26')](function(_0x436739){var _0x43b5a3=_0x26c148[_0x158d('0x4e')][_0x158d('0x27')]({'plain':!![]});if(!_0x43b5a3)throw new Error(_0x158d('0x4f'));if(_0x43b5a3['role']===_0x158d('0x4e')){var _0x98b9fb=_0x436739['get']({'plain':!![]});var _0x116339='CmContactHasItems';return db['UserProfileSection'][_0x158d('0x4c')]({'where':{'name':_0x116339,'userProfileId':_0x43b5a3[_0x158d('0x50')]},'raw':!![]})[_0x158d('0x26')](function(_0x256bc8){if(_0x256bc8&&_0x256bc8[_0x158d('0x51')]===0x0){return db[_0x158d('0x28')][_0x158d('0x4d')]({'name':_0x98b9fb[_0x158d('0x2b')],'resourceId':_0x98b9fb['id'],'type':_0x256bc8[_0x158d('0x2b')],'sectionId':_0x256bc8['id']},{})[_0x158d('0x26')](function(){return _0x436739;});}else{return _0x436739;}})['catch'](function(_0x2a23aa){logger[_0x158d('0x2a')](_0x158d('0x52'),_0x2a23aa);throw _0x2a23aa;});}return _0x436739;})[_0x158d('0x26')](respondWithResult(_0x252e7a,0xc9))[_0x158d('0x49')](handleError(_0x252e7a,null));};exports[_0x158d('0x53')]=function(_0x4256cc,_0xd0d7){if(_0x4256cc['body']['id']){delete _0x4256cc[_0x158d('0x54')]['id'];}return db[_0x158d('0x2e')]['find']({'where':{'id':_0x4256cc[_0x158d('0x4b')]['id']}})['then'](handleEntityNotFound(_0xd0d7,null))['then'](saveUpdates(_0x4256cc['body'],null))[_0x158d('0x26')](respondWithResult(_0xd0d7,null))['catch'](handleError(_0xd0d7,null));};exports[_0x158d('0x25')]=function(_0x407c61,_0x2c2102){return db['CmContactHasItem']['find']({'where':{'id':_0x407c61[_0x158d('0x4b')]['id']}})[_0x158d('0x26')](handleEntityNotFound(_0x2c2102,null))[_0x158d('0x26')](removeEntity(_0x2c2102,null))[_0x158d('0x49')](handleError(_0x2c2102,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index ebb0d9d..3e78ece 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 _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 +var _0x86ee=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x86ee,0x1d9));var _0xe86e=function(_0x39772f,_0x5605cb){_0x39772f=_0x39772f-0x0;var _0xc9edbf=_0x86ee[_0x39772f];return _0xc9edbf;};'use strict';var _=require(_0xe86e('0x0'));var util=require(_0xe86e('0x1'));var logger=require(_0xe86e('0x2'))(_0xe86e('0x3'));var moment=require(_0xe86e('0x4'));var BPromise=require(_0xe86e('0x5'));var rp=require(_0xe86e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe86e('0x7'));var config=require(_0xe86e('0x8'));var attributes=require(_0xe86e('0x9'));module[_0xe86e('0xa')]=function(_0x528244,_0xe05020){return _0x528244[_0xe86e('0xb')](_0xe86e('0xc'),attributes,{'tableName':_0xe86e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index c08b07c..d21b070 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 _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 +var _0xf7a7=['info','request\x20sent','error','code','message','CmContactHasItem,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x20790f,_0x36e596){var _0x4df7ec=function(_0x49e951){while(--_0x49e951){_0x20790f['push'](_0x20790f['shift']());}};_0x4df7ec(++_0x36e596);}(_0xf7a7,0x7b));var _0x7f7a=function(_0x4cb29e,_0x4fcb34){_0x4cb29e=_0x4cb29e-0x0;var _0x508ea=_0xf7a7[_0x4cb29e];return _0x508ea;};'use strict';var _=require(_0x7f7a('0x0'));var util=require(_0x7f7a('0x1'));var moment=require(_0x7f7a('0x2'));var BPromise=require(_0x7f7a('0x3'));var rs=require(_0x7f7a('0x4'));var fs=require('fs');var Redis=require(_0x7f7a('0x5'));var db=require(_0x7f7a('0x6'))['db'];var utils=require(_0x7f7a('0x7'));var logger=require(_0x7f7a('0x8'))('rpc');var config=require(_0x7f7a('0x9'));var jayson=require(_0x7f7a('0xa'));var client=jayson[_0x7f7a('0xb')][_0x7f7a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26c7a2,_0xb6e77,_0x27748a){return new BPromise(function(_0x3f2749,_0x1768e4){return client[_0x7f7a('0xd')](_0x26c7a2,_0x27748a)[_0x7f7a('0xe')](function(_0xff852f){logger[_0x7f7a('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0xb6e77,_0x7f7a('0x10'));logger['debug']('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0xb6e77,'request\x20sent',JSON['stringify'](_0xff852f));if(_0xff852f[_0x7f7a('0x11')]){if(_0xff852f['error'][_0x7f7a('0x12')]===0x1f4){logger[_0x7f7a('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0xb6e77,_0xff852f[_0x7f7a('0x11')]['message']);return _0x1768e4(_0xff852f[_0x7f7a('0x11')][_0x7f7a('0x13')]);}logger[_0x7f7a('0x11')](_0x7f7a('0x14'),_0xb6e77,_0xff852f['error']['message']);return _0x3f2749(_0xff852f['error'][_0x7f7a('0x13')]);}else{logger['info']('CmContactHasItem,\x20%s,\x20%s',_0xb6e77,_0x7f7a('0x10'));_0x3f2749(_0xff852f[_0x7f7a('0x15')][_0x7f7a('0x13')]);}})[_0x7f7a('0x16')](function(_0x2f3524){logger[_0x7f7a('0x11')](_0x7f7a('0x14'),_0xb6e77,_0x2f3524);_0x1768e4(_0x2f3524);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 5fabb9d..e5874f4 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 _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 +var _0x1a80=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','put','update','destroy'];(function(_0x38bbbc,_0x521d0d){var _0xabf156=function(_0x27f5ca){while(--_0x27f5ca){_0x38bbbc['push'](_0x38bbbc['shift']());}};_0xabf156(++_0x521d0d);}(_0x1a80,0x111));var _0x01a8=function(_0x2da1ee,_0x4d11b2){_0x2da1ee=_0x2da1ee-0x0;var _0x597680=_0x1a80[_0x2da1ee];return _0x597680;};'use strict';var multer=require(_0x01a8('0x0'));var util=require(_0x01a8('0x1'));var path=require(_0x01a8('0x2'));var timeout=require(_0x01a8('0x3'));var express=require('express');var router=express[_0x01a8('0x4')]();var fs_extra=require(_0x01a8('0x5'));var auth=require(_0x01a8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x01a8('0x7'));var controller=require('./cmContactHasItem.controller');router[_0x01a8('0x8')]('/',auth[_0x01a8('0x9')](),controller['index']);router[_0x01a8('0x8')](_0x01a8('0xa'),auth[_0x01a8('0x9')](),controller[_0x01a8('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x01a8('0xc')](_0x01a8('0xa'),auth['isAuthenticated'](),controller[_0x01a8('0xd')]);router['delete'](_0x01a8('0xa'),auth['isAuthenticated'](),controller[_0x01a8('0xe')]);module[_0x01a8('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 084c5d0..ca7faa9 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 _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 +var _0x3286=['TEXT','type','setDataValue','values','stringify','BOOLEAN','lodash','getDataValue','STRING','name'];(function(_0x5f472a,_0x58837b){var _0x52be8d=function(_0x20b760){while(--_0x20b760){_0x5f472a['push'](_0x5f472a['shift']());}};_0x52be8d(++_0x58837b);}(_0x3286,0x88));var _0x6328=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3286[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');var _=require(_0x6328('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x26c951){return this[_0x6328('0x1')]('alias');}},'alias':{'type':Sequelize[_0x6328('0x2')],'allowNull':![],'set':function(_0x2f5c61){this['setDataValue']('alias',_0x2f5c61?_0x2f5c61:this[_0x6328('0x1')](_0x6328('0x3')));}},'type':{'type':Sequelize[_0x6328('0x2')],'allowNull':![]},'values':{'type':Sequelize[_0x6328('0x4')]('long'),'get':function(){if(this[_0x6328('0x1')](_0x6328('0x5'))==='select'){return JSON['parse'](this['getDataValue']('values'));}else{return this[_0x6328('0x1')]('values');}},'set':function(_0x300a4b){if(Array['isArray'](_0x300a4b)){this[_0x6328('0x6')](_0x6328('0x7'),JSON[_0x6328('0x8')](_0x300a4b));}else{this['setDataValue'](_0x6328('0x7'),_0x300a4b);}}},'required':{'type':Sequelize[_0x6328('0x9')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x6328('0x9')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM']('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 300e6ac..2d9be36 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 _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 +var _0xc592=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','error','stack','name','index','map','CmCustomField','fieldName','type','key','differenceBy','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','body','find','create','sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch','defaultValue','queryInterface','cm_contacts','format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','ejs','fs-extra','crypto','desk.js','to-csv','querystring','papaparse'];(function(_0x479efd,_0x227b65){var _0x51652f=function(_0x488b86){while(--_0x488b86){_0x479efd['push'](_0x479efd['shift']());}};_0x51652f(++_0x227b65);}(_0xc592,0x17d));var _0x2c59=function(_0x17007d,_0xd37c27){_0x17007d=_0x17007d-0x0;var _0x39b37a=_0xc592[_0x17007d];return _0x39b37a;};'use strict';var emlformat=require(_0x2c59('0x0'));var rimraf=require(_0x2c59('0x1'));var zipdir=require(_0x2c59('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c59('0x3'));var moment=require(_0x2c59('0x4'));var BPromise=require(_0x2c59('0x5'));var Mustache=require(_0x2c59('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2c59('0x7'));var fs=require('fs');var fs_extra=require(_0x2c59('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2c59('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x2c59('0xa'));var toCsv=require(_0x2c59('0xb'));var querystring=require(_0x2c59('0xc'));var Papa=require(_0x2c59('0xd'));var Redis=require('ioredis');var authService=require(_0x2c59('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2c59('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c59('0x10'))(_0x2c59('0x11'));var utils=require('../../config/utils');var config=require(_0x2c59('0x12'));var licenseUtil=require(_0x2c59('0x13'));var db=require(_0x2c59('0x14'))['db'];function respondWithStatusCode(_0x212068,_0x6b6749){_0x6b6749=_0x6b6749||0xcc;return function(_0xe72460){if(_0xe72460){return _0x212068[_0x2c59('0x15')](_0x6b6749);}return _0x212068[_0x2c59('0x16')](_0x6b6749)[_0x2c59('0x17')]();};}function respondWithResult(_0x1466d8,_0x413f08){_0x413f08=_0x413f08||0xc8;return function(_0x340a81){if(_0x340a81){return _0x1466d8[_0x2c59('0x16')](_0x413f08)[_0x2c59('0x18')](_0x340a81);}};}function respondWithFilteredResult(_0x194aa6,_0x1f8992){return function(_0x2fcc1d){if(_0x2fcc1d){var _0x228b10=typeof _0x1f8992[_0x2c59('0x19')]===_0x2c59('0x1a')&&typeof _0x1f8992[_0x2c59('0x1b')]===_0x2c59('0x1a');var _0xba8181=_0x2fcc1d[_0x2c59('0x1c')];var _0x233cb1=_0x228b10?0x0:_0x1f8992[_0x2c59('0x19')];var _0xedd0ed=_0x228b10?_0x2fcc1d[_0x2c59('0x1c')]:_0x1f8992[_0x2c59('0x19')]+_0x1f8992[_0x2c59('0x1b')];var _0x152d60;if(_0xedd0ed>=_0xba8181){_0xedd0ed=_0xba8181;_0x152d60=0xc8;}else{_0x152d60=0xce;}_0x194aa6[_0x2c59('0x16')](_0x152d60);return _0x194aa6['set']('Content-Range',_0x233cb1+'-'+_0xedd0ed+'/'+_0xba8181)['json'](_0x2fcc1d);}return null;};}function patchUpdates(_0x472242){return function(_0x2b1041){try{jsonpatch['apply'](_0x2b1041,_0x472242,!![]);}catch(_0x606529){return BPromise[_0x2c59('0x1d')](_0x606529);}return _0x2b1041[_0x2c59('0x1e')]();};}function saveUpdates(_0x4ce07a,_0x469406){return function(_0x10c1ef){if(_0x10c1ef){return _0x10c1ef[_0x2c59('0x1f')](_0x4ce07a)[_0x2c59('0x20')](function(_0x249dce){return _0x249dce;});}return null;};}function removeEntity(_0x21882f,_0x3855ff){return function(_0x5cc15b){if(_0x5cc15b){return _0x5cc15b['destroy']()[_0x2c59('0x20')](function(){_0x21882f[_0x2c59('0x16')](0xcc)[_0x2c59('0x17')]();});}};}function handleEntityNotFound(_0x5a2cd3,_0xa8c60a){return function(_0x5d9bf6){if(!_0x5d9bf6){_0x5a2cd3[_0x2c59('0x15')](0x194);}return _0x5d9bf6;};}function handleError(_0x291e3a,_0x15c16c){_0x15c16c=_0x15c16c||0x1f4;return function(_0x579719){logger[_0x2c59('0x21')](_0x579719[_0x2c59('0x22')]);if(_0x579719[_0x2c59('0x23')]){delete _0x579719[_0x2c59('0x23')];}_0x291e3a[_0x2c59('0x16')](_0x15c16c)['send'](_0x579719);};}exports[_0x2c59('0x24')]=function(_0x43273a,_0x12a543){var _0x12f0c1={},_0x3abac5={},_0x2dfbfa={'count':0x0,'rows':[]};var _0x19667f=_[_0x2c59('0x25')](db[_0x2c59('0x26')]['rawAttributes'],function(_0xbe2eb6){return{'name':_0xbe2eb6[_0x2c59('0x27')],'type':_0xbe2eb6[_0x2c59('0x28')][_0x2c59('0x29')]};});_0x3abac5['model']=_[_0x2c59('0x2a')](_[_0x2c59('0x25')](_0x19667f,_0x2c59('0x23')),[_0x2c59('0x23')]);_0x3abac5[_0x2c59('0x2b')]=_['keys'](_0x43273a[_0x2c59('0x2b')]);_0x3abac5[_0x2c59('0x2c')]=_['intersection'](_0x3abac5[_0x2c59('0x2d')],_0x3abac5[_0x2c59('0x2b')]);_0x12f0c1[_0x2c59('0x2e')]=_[_0x2c59('0x2f')](_0x3abac5[_0x2c59('0x2d')],qs[_0x2c59('0x30')](_0x43273a[_0x2c59('0x2b')][_0x2c59('0x30')]));_0x12f0c1['attributes']=_0x12f0c1[_0x2c59('0x2e')][_0x2c59('0x31')]?_0x12f0c1[_0x2c59('0x2e')]:_0x3abac5[_0x2c59('0x2d')];if(!_0x43273a[_0x2c59('0x2b')][_0x2c59('0x32')]('nolimit')){_0x12f0c1[_0x2c59('0x1b')]=qs[_0x2c59('0x1b')](_0x43273a[_0x2c59('0x2b')][_0x2c59('0x1b')]);_0x12f0c1[_0x2c59('0x19')]=qs[_0x2c59('0x19')](_0x43273a[_0x2c59('0x2b')]['offset']);}_0x12f0c1['order']=qs['sort'](_0x43273a[_0x2c59('0x2b')]['sort']);_0x12f0c1[_0x2c59('0x33')]=qs[_0x2c59('0x2c')](_['pick'](_0x43273a[_0x2c59('0x2b')],_0x3abac5['filters']),_0x19667f);if(_0x43273a[_0x2c59('0x2b')][_0x2c59('0x34')]){_0x12f0c1['where']=_[_0x2c59('0x35')](_0x12f0c1[_0x2c59('0x33')],{'$or':_[_0x2c59('0x25')](_0x19667f,function(_0xe72045){if(_0xe72045[_0x2c59('0x28')]!==_0x2c59('0x36')){var _0x385df9={};_0x385df9[_0xe72045[_0x2c59('0x23')]]={'$like':'%'+_0x43273a[_0x2c59('0x2b')][_0x2c59('0x34')]+'%'};return _0x385df9;}})});}_0x12f0c1=_['merge']({},_0x12f0c1,_0x43273a[_0x2c59('0x37')]);var _0x23cdbf={'where':_0x12f0c1[_0x2c59('0x33')]};return db['CmCustomField'][_0x2c59('0x1c')](_0x23cdbf)[_0x2c59('0x20')](function(_0x5b7d35){_0x2dfbfa[_0x2c59('0x1c')]=_0x5b7d35;if(_0x43273a[_0x2c59('0x2b')][_0x2c59('0x38')]){_0x12f0c1['include']=[{'all':!![]}];}return db[_0x2c59('0x26')][_0x2c59('0x39')](_0x12f0c1);})['then'](function(_0x38e38a){_0x2dfbfa[_0x2c59('0x3a')]=_0x38e38a;return _0x2dfbfa;})['then'](respondWithFilteredResult(_0x12a543,_0x12f0c1))[_0x2c59('0x3b')](handleError(_0x12a543,null));};exports[_0x2c59('0x3c')]=function(_0x29849d,_0x16af81){var _0x1e2ec1={'raw':!![],'where':{'id':_0x29849d[_0x2c59('0x3d')]['id']}},_0x8f3137={};_0x8f3137[_0x2c59('0x2d')]=_[_0x2c59('0x3e')](db[_0x2c59('0x26')][_0x2c59('0x3f')]);_0x8f3137[_0x2c59('0x2b')]=_['keys'](_0x29849d[_0x2c59('0x2b')]);_0x8f3137[_0x2c59('0x2c')]=_[_0x2c59('0x2f')](_0x8f3137['model'],_0x8f3137[_0x2c59('0x2b')]);_0x1e2ec1['attributes']=_[_0x2c59('0x2f')](_0x8f3137[_0x2c59('0x2d')],qs[_0x2c59('0x30')](_0x29849d['query'][_0x2c59('0x30')]));_0x1e2ec1[_0x2c59('0x2e')]=_0x1e2ec1['attributes'][_0x2c59('0x31')]?_0x1e2ec1[_0x2c59('0x2e')]:_0x8f3137[_0x2c59('0x2d')];if(_0x29849d['query']['includeAll']){_0x1e2ec1[_0x2c59('0x40')]=[{'all':!![]}];}_0x1e2ec1=_[_0x2c59('0x35')]({},_0x1e2ec1,_0x29849d[_0x2c59('0x37')]);return db['CmCustomField']['find'](_0x1e2ec1)[_0x2c59('0x20')](handleEntityNotFound(_0x16af81,null))[_0x2c59('0x20')](respondWithResult(_0x16af81,null))[_0x2c59('0x3b')](handleError(_0x16af81,null));};exports[_0x2c59('0x1f')]=function(_0x2c5c5a,_0x45e3a3){if(_0x2c5c5a[_0x2c59('0x41')]['id']){delete _0x2c5c5a[_0x2c59('0x41')]['id'];}return db['CmCustomField'][_0x2c59('0x42')]({'where':{'id':_0x2c5c5a['params']['id']}})['then'](handleEntityNotFound(_0x45e3a3,null))[_0x2c59('0x20')](saveUpdates(_0x2c5c5a[_0x2c59('0x41')],null))[_0x2c59('0x20')](respondWithResult(_0x45e3a3,null))[_0x2c59('0x3b')](handleError(_0x45e3a3,null));};exports['destroy']=function(_0x35d65f,_0x5ee875){return db[_0x2c59('0x26')][_0x2c59('0x42')]({'where':{'id':_0x35d65f[_0x2c59('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5ee875,null))['then'](removeEntity(_0x5ee875,null))[_0x2c59('0x3b')](handleError(_0x5ee875,null));};exports[_0x2c59('0x43')]=function(_0x331083,_0x3aaf07){var _0x1368f8;return db[_0x2c59('0x44')][_0x2c59('0x45')](function(_0x5a363b){return db['CmCustomField'][_0x2c59('0x43')](_0x331083[_0x2c59('0x41')],{'transaction':_0x5a363b})[_0x2c59('0x20')](function(_0x322b7e){_0x1368f8=_0x322b7e;var _0x48e16a={'type':db[_0x2c59('0x46')][_0x2c59('0x47')],'transaction':_0x5a363b};switch(_0x331083[_0x2c59('0x41')][_0x2c59('0x28')]){case _0x2c59('0x48'):_0x48e16a[_0x2c59('0x28')]=db[_0x2c59('0x46')][_0x2c59('0x47')];break;case'number':_0x48e16a[_0x2c59('0x28')]=db[_0x2c59('0x46')][_0x2c59('0x49')];break;case _0x2c59('0x4a'):_0x48e16a[_0x2c59('0x28')]=db[_0x2c59('0x46')]['BOOLEAN'];_0x48e16a[_0x2c59('0x4b')]=![];break;default:}return db[_0x2c59('0x44')][_0x2c59('0x4c')]['addColumn'](_0x2c59('0x4d'),util[_0x2c59('0x4e')]('cf_%d',_0x1368f8['id']),_0x48e16a);})['then'](function(){return _0x1368f8;});})['then'](respondWithResult(_0x3aaf07,0xc9))[_0x2c59('0x3b')](handleError(_0x3aaf07,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index c8bb3c9..01b1366 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 _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 +var _0x7173=['exports','define','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes'];(function(_0x48e2bf,_0x2866d2){var _0x4a869d=function(_0x1b41b1){while(--_0x1b41b1){_0x48e2bf['push'](_0x48e2bf['shift']());}};_0x4a869d(++_0x2866d2);}(_0x7173,0x73));var _0x3717=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0x7173[_0x119280];return _0x481797;};'use strict';var _=require(_0x3717('0x0'));var util=require(_0x3717('0x1'));var logger=require(_0x3717('0x2'))(_0x3717('0x3'));var moment=require(_0x3717('0x4'));var BPromise=require(_0x3717('0x5'));var rp=require(_0x3717('0x6'));var fs=require('fs');var path=require(_0x3717('0x7'));var rimraf=require(_0x3717('0x8'));var config=require(_0x3717('0x9'));var attributes=require(_0x3717('0xa'));module[_0x3717('0xb')]=function(_0x1f7a46,_0x4f70b6){return _0x1f7a46[_0x3717('0xc')]('CmCustomField',attributes,{'tableName':_0x3717('0xd'),'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 8a19284..1752b12 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 _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 +var _0x9fff=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x534157,_0x5e0173){var _0x2bb356=function(_0x36abf3){while(--_0x36abf3){_0x534157['push'](_0x534157['shift']());}};_0x2bb356(++_0x5e0173);}(_0x9fff,0xb0));var _0xf9ff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9fff[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf9ff('0x0'));var moment=require(_0xf9ff('0x1'));var BPromise=require(_0xf9ff('0x2'));var rs=require(_0xf9ff('0x3'));var fs=require('fs');var Redis=require(_0xf9ff('0x4'));var db=require(_0xf9ff('0x5'))['db'];var utils=require(_0xf9ff('0x6'));var logger=require(_0xf9ff('0x7'))(_0xf9ff('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf9ff('0x9')][_0xf9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bb2e3,_0x3e1268,_0xcaf2b9){return new BPromise(function(_0x7a270e,_0x43fc93){return client[_0xf9ff('0xb')](_0x1bb2e3,_0xcaf2b9)['then'](function(_0x432314){logger[_0xf9ff('0xc')](_0xf9ff('0xd'),_0x3e1268,_0xf9ff('0xe'));logger['debug'](_0xf9ff('0xf'),_0x3e1268,'request\x20sent',JSON[_0xf9ff('0x10')](_0x432314));if(_0x432314[_0xf9ff('0x11')]){if(_0x432314['error'][_0xf9ff('0x12')]===0x1f4){logger[_0xf9ff('0x11')](_0xf9ff('0xd'),_0x3e1268,_0x432314[_0xf9ff('0x11')][_0xf9ff('0x13')]);return _0x43fc93(_0x432314[_0xf9ff('0x11')][_0xf9ff('0x13')]);}logger[_0xf9ff('0x11')]('CmCustomField,\x20%s,\x20%s',_0x3e1268,_0x432314[_0xf9ff('0x11')]['message']);return _0x7a270e(_0x432314[_0xf9ff('0x11')][_0xf9ff('0x13')]);}else{logger['info'](_0xf9ff('0xd'),_0x3e1268,_0xf9ff('0xe'));_0x7a270e(_0x432314[_0xf9ff('0x14')][_0xf9ff('0x13')]);}})[_0xf9ff('0x15')](function(_0x1ba8f2){logger[_0xf9ff('0x11')](_0xf9ff('0xd'),_0x3e1268,_0x1ba8f2);_0x43fc93(_0x1ba8f2);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 327c8c9..a21998b 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 _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 +var _0x2383=['/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2383,0xb2));var _0x3238=function(_0x1b0cd1,_0x23995c){_0x1b0cd1=_0x1b0cd1-0x0;var _0x145c91=_0x2383[_0x1b0cd1];return _0x145c91;};'use strict';var multer=require(_0x3238('0x0'));var util=require(_0x3238('0x1'));var path=require('path');var timeout=require(_0x3238('0x2'));var express=require(_0x3238('0x3'));var router=express[_0x3238('0x4')]();var fs_extra=require(_0x3238('0x5'));var auth=require(_0x3238('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0x3238('0x7')]('/',auth[_0x3238('0x8')](),controller['index']);router[_0x3238('0x7')](_0x3238('0x9'),auth[_0x3238('0x8')](),controller[_0x3238('0xa')]);router[_0x3238('0xb')]('/',auth['isAuthenticated'](),controller[_0x3238('0xc')]);router[_0x3238('0xd')](_0x3238('0x9'),auth[_0x3238('0x8')](),controller[_0x3238('0xe')]);router[_0x3238('0xf')]('/:id',auth[_0x3238('0x8')](),controller[_0x3238('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index df9d3f2..411af6e 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 _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 +var _0x43d8=['UNSIGNED','contactListQueue','moment','sequelize','exports','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING'];(function(_0x4204ec,_0x5b0df0){var _0x8488df=function(_0x56853a){while(--_0x56853a){_0x4204ec['push'](_0x4204ec['shift']());}};_0x8488df(++_0x5b0df0);}(_0x43d8,0x77));var _0x843d=function(_0x343d36,_0x5f248a){_0x343d36=_0x343d36-0x0;var _0x3bd305=_0x43d8[_0x343d36];return _0x3bd305;};'use strict';var moment=require(_0x843d('0x0'));var Sequelize=require(_0x843d('0x1'));module[_0x843d('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x843d('0x3')],'defaultValue':moment()['format'](_0x843d('0x4'))},'countbusyretry':{'type':Sequelize[_0x843d('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x843d('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x843d('0x6')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x843d('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x843d('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x843d('0x5')],'unique':_0x843d('0x8')},'ListId':{'type':Sequelize[_0x843d('0x5')],'unique':_0x843d('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x843d('0x5')],'unique':_0x843d('0x8')},'CampaignId':{'type':Sequelize[_0x843d('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x843d('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x843d('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 274f82c..1c6b927 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 _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 +var _0x2d17=['$ne','$eq','$not','$between','$notIn','$notLike','$iLike','$notILike','$overlap','$contained','$any','attributes','fields','length','model','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','include','body','describe','destroy','find','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','phone','campaigntype','queue','ivr','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','create','CmHopperAdditionalPhone','end','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','YYYY-MM-DD\x20HH:mm:ss','value','direction','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','literal','isEmpty','findOne','scheduledat','recallme','LOCK','CmContact','Contact','CmCompany','Company','Queue','dialActive','getPreviewRecall','UPDATE','CmList','List','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','moment','lodash','../../config/logger','api','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','update','then','sendStatus','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','filters','intersection','query','concat','$and','$gte','$lt','$lte'];(function(_0x278607,_0x52f65f){var _0x162d37=function(_0x34e139){while(--_0x34e139){_0x278607['push'](_0x278607['shift']());}};_0x162d37(++_0x52f65f);}(_0x2d17,0x17e));var _0x72d1=function(_0x4a1c18,_0x3d51ef){_0x4a1c18=_0x4a1c18-0x0;var _0x2412ff=_0x2d17[_0x4a1c18];return _0x2412ff;};'use strict';var moment=require(_0x72d1('0x0'));var _=require(_0x72d1('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x72d1('0x2'))(_0x72d1('0x3'));var shared=require('../../config/environment');var db=require(_0x72d1('0x4'))['db'];function respondWithResult(_0x38fec7,_0x55b722){_0x55b722=_0x55b722||0xc8;return function(_0x1dd6d8){if(_0x1dd6d8){return _0x38fec7['status'](_0x55b722)[_0x72d1('0x5')](_0x1dd6d8);}};}function respondWithFilteredResult(_0x50f551,_0x139ba0){return function(_0x239d1f){if(_0x239d1f){var _0x5b40a9=typeof _0x139ba0[_0x72d1('0x6')]===_0x72d1('0x7')&&typeof _0x139ba0[_0x72d1('0x8')]==='undefined';var _0x215536=_0x239d1f[_0x72d1('0x9')];var _0x283775=_0x5b40a9?0x0:_0x139ba0['offset'];var _0x1d7520=_0x5b40a9?_0x239d1f[_0x72d1('0x9')]:_0x139ba0[_0x72d1('0x6')]+_0x139ba0[_0x72d1('0x8')];var _0x3cb9c2;if(_0x1d7520>=_0x215536){_0x1d7520=_0x215536;_0x3cb9c2=0xc8;}else{_0x3cb9c2=0xce;}_0x50f551[_0x72d1('0xa')](_0x3cb9c2);return _0x50f551[_0x72d1('0xb')](_0x72d1('0xc'),_0x283775+'-'+_0x1d7520+'/'+_0x215536)[_0x72d1('0x5')](_0x239d1f);}return null;};}function saveUpdates(_0x2f5a78,_0x5ad4df){return function(_0x3cd1ae){if(_0x3cd1ae){return _0x3cd1ae[_0x72d1('0xd')](_0x2f5a78)[_0x72d1('0xe')](function(_0x115cd7){return _0x115cd7;});}return null;};}function handleEntityNotFound(_0x22ac6f,_0x685a27){return function(_0x143718){if(!_0x143718){_0x22ac6f[_0x72d1('0xf')](0x194);}return _0x143718;};}function handleError(_0x172fae,_0x3f190f){_0x3f190f=_0x3f190f||0x1f4;return function(_0x21c85e){logger[_0x72d1('0x10')](_0x21c85e[_0x72d1('0x11')]);if(_0x21c85e['name']){delete _0x21c85e[_0x72d1('0x12')];}_0x172fae['status'](_0x3f190f)[_0x72d1('0x13')](_0x21c85e);};}exports[_0x72d1('0x14')]=function(_0x59d7b5,_0x1061b7){var _0x1cbb45={},_0x1ca18d={},_0x49caf4={'count':0x0,'rows':[]};var _0x4925f6=_[_0x72d1('0x15')](db[_0x72d1('0x16')][_0x72d1('0x17')],function(_0x1865c1){return{'name':_0x1865c1[_0x72d1('0x18')],'type':_0x1865c1[_0x72d1('0x19')][_0x72d1('0x1a')]};});_0x1ca18d['model']=_[_0x72d1('0x15')](_0x4925f6,'name');_0x1ca18d['query']=_['keys'](_0x59d7b5['query']);_0x1ca18d[_0x72d1('0x1b')]=_[_0x72d1('0x1c')](_0x1ca18d['model'],_0x1ca18d[_0x72d1('0x1d')]);_0x1ca18d[_0x72d1('0x1b')]=_[_0x72d1('0x1e')](_0x1ca18d[_0x72d1('0x1b')],[_0x72d1('0x1f'),'$or','$gt',_0x72d1('0x20'),_0x72d1('0x21'),_0x72d1('0x22'),_0x72d1('0x23'),_0x72d1('0x24'),_0x72d1('0x25'),_0x72d1('0x26'),'$notBetween','$in',_0x72d1('0x27'),'$like',_0x72d1('0x28'),_0x72d1('0x29'),_0x72d1('0x2a'),'$like',_0x72d1('0x2b'),'$contains',_0x72d1('0x2c'),_0x72d1('0x2d')]);_0x1cbb45[_0x72d1('0x2e')]=_[_0x72d1('0x1c')](_0x1ca18d['model'],qs[_0x72d1('0x2f')](_0x59d7b5['query'][_0x72d1('0x2f')]));_0x1cbb45[_0x72d1('0x2e')]=_0x1cbb45['attributes'][_0x72d1('0x30')]?_0x1cbb45[_0x72d1('0x2e')]:_0x1ca18d[_0x72d1('0x31')];if(!_0x59d7b5[_0x72d1('0x1d')][_0x72d1('0x32')]('nolimit')){_0x1cbb45[_0x72d1('0x8')]=qs[_0x72d1('0x8')](_0x59d7b5[_0x72d1('0x1d')]['limit']);_0x1cbb45[_0x72d1('0x6')]=qs[_0x72d1('0x6')](_0x59d7b5['query'][_0x72d1('0x6')]);}_0x1cbb45[_0x72d1('0x33')]=qs[_0x72d1('0x34')](_0x59d7b5['query'][_0x72d1('0x34')]);_0x1cbb45['where']=qs[_0x72d1('0x1b')](_[_0x72d1('0x35')](_0x59d7b5[_0x72d1('0x1d')],_0x1ca18d[_0x72d1('0x1b')]),_0x4925f6);if(_0x59d7b5[_0x72d1('0x1d')][_0x72d1('0x36')]){_0x1cbb45[_0x72d1('0x37')]=_[_0x72d1('0x38')](_0x1cbb45[_0x72d1('0x37')],{'$or':_[_0x72d1('0x15')](_0x4925f6,function(_0x2029b5){if(_0x2029b5['type']!==_0x72d1('0x39')){var _0x2a60c4={};_0x2a60c4[_0x2029b5[_0x72d1('0x12')]]={'$like':'%'+_0x59d7b5[_0x72d1('0x1d')]['filter']+'%'};return _0x2a60c4;}})});}_0x1cbb45=_[_0x72d1('0x38')]({},_0x1cbb45,_0x59d7b5[_0x72d1('0x3a')]);var _0x2783bb={'where':_0x1cbb45['where']};return db[_0x72d1('0x16')][_0x72d1('0x9')](_0x2783bb)[_0x72d1('0xe')](function(_0x5b897f){_0x49caf4[_0x72d1('0x9')]=_0x5b897f;if(_0x59d7b5[_0x72d1('0x1d')][_0x72d1('0x3b')]){_0x1cbb45['include']=[{'all':!![]}];}return db[_0x72d1('0x16')][_0x72d1('0x3c')](_0x1cbb45);})[_0x72d1('0xe')](function(_0x14cb3d){_0x49caf4[_0x72d1('0x3d')]=_0x14cb3d;return _0x49caf4;})[_0x72d1('0xe')](respondWithFilteredResult(_0x1061b7,_0x1cbb45))[_0x72d1('0x3e')](handleError(_0x1061b7,null));};exports['show']=function(_0x12646c,_0x3ae4b5){var _0x440ac5={'raw':!![],'where':{'id':_0x12646c[_0x72d1('0x3f')]['id']}},_0x16407a={};_0x16407a[_0x72d1('0x31')]=_[_0x72d1('0x40')](db[_0x72d1('0x16')]['rawAttributes']);_0x16407a[_0x72d1('0x1d')]=_[_0x72d1('0x40')](_0x12646c[_0x72d1('0x1d')]);_0x16407a[_0x72d1('0x1b')]=_[_0x72d1('0x1c')](_0x16407a[_0x72d1('0x31')],_0x16407a[_0x72d1('0x1d')]);_0x440ac5[_0x72d1('0x2e')]=_['intersection'](_0x16407a['model'],qs[_0x72d1('0x2f')](_0x12646c[_0x72d1('0x1d')][_0x72d1('0x2f')]));_0x440ac5[_0x72d1('0x2e')]=_0x440ac5['attributes'][_0x72d1('0x30')]?_0x440ac5[_0x72d1('0x2e')]:_0x16407a['model'];if(_0x12646c[_0x72d1('0x1d')]['includeAll']){_0x440ac5[_0x72d1('0x41')]=[{'all':!![]}];}_0x440ac5=_[_0x72d1('0x38')]({},_0x440ac5,_0x12646c['options']);return db[_0x72d1('0x16')]['find'](_0x440ac5)['then'](handleEntityNotFound(_0x3ae4b5,null))['then'](respondWithResult(_0x3ae4b5,null))[_0x72d1('0x3e')](handleError(_0x3ae4b5,null));};exports['create']=function(_0x42ac27,_0x1ece64){return db[_0x72d1('0x16')]['create'](_0x42ac27['body'],{})[_0x72d1('0xe')](respondWithResult(_0x1ece64,0xc9))['catch'](handleError(_0x1ece64,null));};exports['update']=function(_0x2cb03d,_0x397f31){if(_0x2cb03d[_0x72d1('0x42')]['id']){delete _0x2cb03d['body']['id'];}return db['CmHopper']['find']({'where':{'id':_0x2cb03d['params']['id']}})[_0x72d1('0xe')](handleEntityNotFound(_0x397f31,null))[_0x72d1('0xe')](saveUpdates(_0x2cb03d[_0x72d1('0x42')],null))[_0x72d1('0xe')](respondWithResult(_0x397f31,null))[_0x72d1('0x3e')](handleError(_0x397f31,null));};exports[_0x72d1('0x43')]=function(_0x1d1465,_0x5924c){return db[_0x72d1('0x16')]['describe']()[_0x72d1('0xe')](respondWithResult(_0x5924c,null))[_0x72d1('0x3e')](handleError(_0x5924c,null));};exports[_0x72d1('0x44')]=function(_0x51b1a9,_0x418e6f){var _0x29c88f;var _0x12ad75=_0x51b1a9['params']['id'];return db[_0x72d1('0x16')][_0x72d1('0x45')]({'where':{'id':_0x51b1a9[_0x72d1('0x3f')]['id']}})[_0x72d1('0xe')](handleEntityNotFound(_0x418e6f,null))['then'](function(_0x5de802){if(_0x5de802){return _0x5de802[_0x72d1('0x44')]()[_0x72d1('0xe')](function(_0x1a8dd2){return _0x1a8dd2;});}})['then'](function(_0x402a04){_0x29c88f=_0x402a04;if(_0x402a04){if(_0x402a04[_0x72d1('0x46')]||_0x402a04[_0x72d1('0x47')]){return db[_0x402a04[_0x72d1('0x46')]?_0x72d1('0x48'):_0x72d1('0x49')][_0x72d1('0x45')]({'where':{'id':_0x402a04[_0x72d1('0x46')]?_0x402a04[_0x72d1('0x46')]:_0x402a04[_0x72d1('0x47')]},'attributes':['id',_0x72d1('0x12')],'raw':!![]});}}})['then'](function(_0x46b2f5){var _0x50d4d4={};if(_0x46b2f5){_['merge'](_0x50d4d4,_[_0x72d1('0x4a')](_0x29c88f['dataValues'],[_0x72d1('0x4b'),_0x72d1('0x4c'),'id']));_0x50d4d4[_0x72d1('0x4d')]=0x15;_0x50d4d4[_0x72d1('0x4e')]=_0x72d1('0x4f');_0x50d4d4[_0x72d1('0x50')]=_0x46b2f5[_0x72d1('0x12')];_0x50d4d4[_0x72d1('0x51')]=_0x51b1a9[_0x72d1('0x52')][_0x72d1('0x12')];_0x50d4d4[_0x72d1('0x53')]=_0x51b1a9['user']['id'];_0x50d4d4[_0x72d1('0x4f')]=!![];_0x50d4d4[_0x72d1('0x54')]=moment()[_0x72d1('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x50d4d4['calleridnum']=_0x29c88f[_0x72d1('0x56')];_0x50d4d4[_0x72d1('0x57')]=_0x29c88f[_0x72d1('0x46')]?_0x72d1('0x58'):_0x72d1('0x59');return db['CmContact'][_0x72d1('0x45')]({'where':{'id':_0x50d4d4['ContactId']},'attributes':[_0x72d1('0x5a'),_0x72d1('0x5b')]})[_0x72d1('0xe')](function(_0xe1faa9){if(!_[_0x72d1('0x5c')](_0x418e6f)&&!_[_0x72d1('0x5c')](_0xe1faa9[_0x72d1('0x5a')])){_0x50d4d4[_0x72d1('0x5d')]=_0xe1faa9[_0x72d1('0x5a')];if(!_[_0x72d1('0x5c')](_0xe1faa9[_0x72d1('0x5b')])){_0x50d4d4[_0x72d1('0x5d')]+='\x20'+_0xe1faa9[_0x72d1('0x5b')];}}})[_0x72d1('0x5e')](function(){return db[_0x72d1('0x5f')][_0x72d1('0x60')](_0x50d4d4);});}})[_0x72d1('0xe')](function(_0x5e63cc){return db[_0x72d1('0x61')][_0x72d1('0x44')]({'where':{'CmHopperId':_0x12ad75}});})[_0x72d1('0xe')](function(){return _0x418e6f[_0x72d1('0xa')](0xcc)[_0x72d1('0x62')]();})[_0x72d1('0x3e')](handleError(_0x418e6f,null));};exports['getPreview']=function(_0x1aec3d,_0x303508){var _0xb05cd9=[];return db['CmContact']['describe']()[_0x72d1('0xe')](function(_0x5f4614){_0xb05cd9=_[_0x72d1('0x40')](_0x5f4614);return _0x1aec3d[_0x72d1('0x52')][_0x72d1('0x63')]({'where':{'type':_0x72d1('0x64'),'dialActive':!![],'dialMethod':_0x72d1('0x65')},'attributes':['id',_0x72d1('0x66'),_0x72d1('0x67')],'raw':!![]});})[_0x72d1('0xe')](function(_0x28e42b){if(_0x28e42b&&_0x28e42b['length']){return db['sequelize'][_0x72d1('0x68')](function(_0x1d44f0){var _0x1bd80b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x72d1('0x69'))},'VoiceQueueId':{'$in':_[_0x72d1('0x15')](_0x28e42b,'id')},'$or':[{'UserId':null},{'UserId':_0x1aec3d['user']['id']}]};var _0x39d7f9={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x28e42b)[_0x72d1('0x36')]([_0x72d1('0x67'),0x0])[_0x72d1('0x15')]('id')[_0x72d1('0x6a')]()},'$or':[{'UserId':null},{'UserId':_0x1aec3d[_0x72d1('0x52')]['id']}]};var _0x102574={'$or':[_0x1bd80b,_0x39d7f9]};var _0x7925ec=[];if(_0x1aec3d[_0x72d1('0x42')][_0x72d1('0x6b')]&&_0x1aec3d[_0x72d1('0x42')][_0x72d1('0x6b')]==='prev'){if(!_['isEmpty'](_0x1aec3d[_0x72d1('0x42')][_0x72d1('0x6c')])){_0x102574['id']={'$in':_0x1aec3d[_0x72d1('0x42')][_0x72d1('0x6c')]};}_0x7925ec=[[_0x72d1('0x6d'),_0x72d1('0x6e')],[_0x72d1('0x6f'),_0x28e42b[0x0][_0x72d1('0x66')]==='ASC'?_0x72d1('0x70'):'ASC'],db[_0x72d1('0x71')][_0x72d1('0x72')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0x72d1('0x73')](_0x1aec3d[_0x72d1('0x42')][_0x72d1('0x6c')])){_0x102574['id']={'$notIn':_0x1aec3d[_0x72d1('0x42')][_0x72d1('0x6c')]};}_0x7925ec=[[_0x72d1('0x6d'),_0x72d1('0x70')],['scheduledAt',_0x28e42b[0x0][_0x72d1('0x66')]],db[_0x72d1('0x71')][_0x72d1('0x72')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x72d1('0x6e')]];}return db['CmHopper'][_0x72d1('0x74')]({'attributes':['id',_0x72d1('0x75'),'phone',_0x72d1('0x76')],'where':_0x102574,'order':_0x7925ec,'transaction':_0x1d44f0,'lock':_0x1d44f0[_0x72d1('0x77')]['UPDATE'],'include':[{'model':db[_0x72d1('0x78')],'as':_0x72d1('0x79'),'attributes':_0xb05cd9,'include':[{'model':db[_0x72d1('0x7a')],'as':_0x72d1('0x7b'),'attributes':['id','name']}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x72d1('0x12')]},{'model':db[_0x72d1('0x48')],'as':_0x72d1('0x7c'),'attributes':['id',_0x72d1('0x12'),_0x72d1('0x7d')]}]})[_0x72d1('0xe')](function(_0x577c9d){if(_0x577c9d){return _0x577c9d['update']({'UserId':_0x1aec3d[_0x72d1('0x52')]['id']},{'transaction':_0x1d44f0});}});});}})[_0x72d1('0xe')](handleEntityNotFound(_0x303508,null))[_0x72d1('0xe')](respondWithResult(_0x303508,null))[_0x72d1('0x3e')](handleError(_0x303508,null));};exports[_0x72d1('0x7e')]=function(_0x422391,_0x50d377,_0x23f0e3){var _0x4511a4=[];var _0x18cec8=_0x422391['params']['id'];var _0xa3e1ab=_0x422391[_0x72d1('0x52')]['id'];return db[_0x72d1('0x78')][_0x72d1('0x43')]()[_0x72d1('0xe')](function(_0x2c68c1){_0x4511a4=_[_0x72d1('0x40')](_0x2c68c1);return db[_0x72d1('0x71')]['transaction'](function(_0x317ad4){const _0x14530a={'id':_0x18cec8};return db[_0x72d1('0x16')][_0x72d1('0x74')]({'attributes':['id','scheduledat','recallme'],'where':_0x14530a,'transaction':_0x317ad4,'lock':_0x317ad4[_0x72d1('0x77')][_0x72d1('0x7f')],'include':[{'model':db['CmContact'],'as':_0x72d1('0x79'),'attributes':_0x4511a4,'include':[{'model':db[_0x72d1('0x7a')],'as':_0x72d1('0x7b'),'attributes':['id',_0x72d1('0x12')]}]},{'model':db[_0x72d1('0x80')],'as':_0x72d1('0x81'),'attributes':['id',_0x72d1('0x12')]},{'model':db[_0x72d1('0x48')],'as':'Queue','attributes':['id',_0x72d1('0x12'),_0x72d1('0x7d')]}]})[_0x72d1('0xe')](function(_0x3cbe00){if(_0x3cbe00){return _0x3cbe00[_0x72d1('0xd')]({'UserId':_0xa3e1ab},{'transaction':_0x317ad4});}});});})[_0x72d1('0xe')](handleEntityNotFound(_0x50d377,null))[_0x72d1('0xe')](respondWithResult(_0x50d377,null))[_0x72d1('0x3e')](handleError(_0x50d377,null));};exports['getOpenContacts']=function(_0x47585e,_0x466634){return _0x47585e[_0x72d1('0x52')][_0x72d1('0x63')]({'where':{'type':_0x72d1('0x64'),'dialActive':!![],'dialMethod':_0x72d1('0x65')},'attributes':['id'],'raw':!![]})['then'](function(_0x1c6547){if(_0x1c6547&&_0x1c6547[_0x72d1('0x30')]){return db['CmHopper'][_0x72d1('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x72d1('0x55')](_0x72d1('0x69'))},'VoiceQueueId':{'$in':_[_0x72d1('0x15')](_0x1c6547,'id')},'$or':[{'UserId':null},{'UserId':_0x47585e[_0x72d1('0x52')]['id']}]}});}return 0x0;})[_0x72d1('0xe')](function(_0x520a2f){if(!_[_0x72d1('0x5c')](_0x520a2f)&&_[_0x72d1('0x82')](_0x520a2f)){return _0x466634['status'](0xc8)['json']({'contacts':_0x520a2f});}else{logger[_0x72d1('0x10')](_0x72d1('0x83'),_0x72d1('0x84'),0x194,_0x72d1('0x85'));_0x466634['sendStatus'](0x194);}})[_0x72d1('0x3e')](handleError(_0x466634,null));};exports[_0x72d1('0x86')]=function(_0x1c4bc0,_0x353b96){var _0xe967e2=shared[_0x72d1('0x87')];var _0x2ab55a=[];_[_0x72d1('0x15')](_0xe967e2,function(_0x4fda8a){_0x2ab55a[_0x72d1('0x88')]({'id':_0x4fda8a[_0x72d1('0x12')],'name':_0x4fda8a[_0x72d1('0x12')],'utcOffset':_0x4fda8a[_0x72d1('0x89')]});});return _0x353b96['status'](0xc8)[_0x72d1('0x5')]({'tz':_0x2ab55a});};exports[_0x72d1('0x8a')]=function(_0x496442,_0xb8b082){var _0x5e3bd1=shared[_0x72d1('0x87')];var _0x57c1cd={};if(!_[_0x72d1('0x5c')](_0x5e3bd1[_0x496442[_0x72d1('0x42')]['id']]))_0x57c1cd=_0x5e3bd1[_0x496442[_0x72d1('0x42')]['id']];return _0xb8b082[_0x72d1('0xa')](0xc8)[_0x72d1('0x5')](_0x57c1cd);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 61f4552..f0a4b18 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 _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 +var _0x5fab=['./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x192a71,_0x2c7d12){var _0x5d6b6d=function(_0x3e7061){while(--_0x3e7061){_0x192a71['push'](_0x192a71['shift']());}};_0x5d6b6d(++_0x2c7d12);}(_0x5fab,0x177));var _0xb5fa=function(_0x290844,_0x366077){_0x290844=_0x290844-0x0;var _0x546847=_0x5fab[_0x290844];return _0x546847;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['scheduledat']},{'name':_0xb5fa('0xe'),'fields':[_0xb5fa('0xe')]},{'name':_0xb5fa('0xf'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 7701789..cdfda22 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 _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 +var _0x8a17=['info','GetCmHopper','debug','catch','error','message','raw','ShowCmHopper','CreateCmHopper','stringify','UpdateCmHopper','update','body','active','destroy','DestroyCmHopper','describe','sequelize','order','LOCK','CmContact','Contact','keys','User','Agent','length','UserId','push','includes','all','GetContactDialer','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','transaction','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','UPDATE','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','voicePause','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','bluebird','../../mysqldb','../../config/logger','rpc','CmHopper','findAll','options','where','attributes','limit','include','map','model','then'];(function(_0x5ce442,_0x5e5d0e){var _0x12c023=function(_0x3318f1){while(--_0x3318f1){_0x5ce442['push'](_0x5ce442['shift']());}};_0x12c023(++_0x5e5d0e);}(_0x8a17,0x135));var _0x78a1=function(_0x4884a7,_0x18e38a){_0x4884a7=_0x4884a7-0x0;var _0x56b60e=_0x8a17[_0x4884a7];return _0x56b60e;};'use strict';var _=require(_0x78a1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x78a1('0x1'));var db=require(_0x78a1('0x2'))['db'];var logger=require(_0x78a1('0x3'))(_0x78a1('0x4'));exports['GetCmHopper']=function(_0x2dee4d){var _0x168b2c=this;return new Promise(function(_0x30124e,_0x471d20){return db[_0x78a1('0x5')][_0x78a1('0x6')]({'raw':_0x2dee4d[_0x78a1('0x7')]?_0x2dee4d[_0x78a1('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x2dee4d[_0x78a1('0x7')]?_0x2dee4d[_0x78a1('0x7')][_0x78a1('0x8')]||null:null,'attributes':_0x2dee4d[_0x78a1('0x7')]?_0x2dee4d['options'][_0x78a1('0x9')]||null:null,'limit':_0x2dee4d[_0x78a1('0x7')]?_0x2dee4d[_0x78a1('0x7')][_0x78a1('0xa')]||null:null,'include':_0x2dee4d[_0x78a1('0x7')]?_0x2dee4d[_0x78a1('0x7')][_0x78a1('0xb')]?_[_0x78a1('0xc')](_0x2dee4d['options'][_0x78a1('0xb')],function(_0x2820bd){return{'model':db[_0x2820bd['model']],'as':_0x2820bd['as'],'attributes':_0x2820bd[_0x78a1('0x9')],'include':_0x2820bd['include']?_[_0x78a1('0xc')](_0x2820bd[_0x78a1('0xb')],function(_0x53ba7a){return{'model':db[_0x53ba7a[_0x78a1('0xd')]],'as':_0x53ba7a['as'],'attributes':_0x53ba7a[_0x78a1('0x9')],'include':_0x53ba7a[_0x78a1('0xb')]?_[_0x78a1('0xc')](_0x53ba7a[_0x78a1('0xb')],function(_0x8bb937){return{'model':db[_0x8bb937[_0x78a1('0xd')]],'as':_0x8bb937['as'],'attributes':_0x8bb937[_0x78a1('0x9')]};}):[]};}):[]};}):[]:[]})[_0x78a1('0xe')](function(_0x36a3c4){logger[_0x78a1('0xf')](_0x78a1('0x10'),_0x2dee4d);logger[_0x78a1('0x11')](_0x78a1('0x10'),_0x2dee4d,JSON['stringify'](_0x36a3c4));_0x30124e(_0x36a3c4);})[_0x78a1('0x12')](function(_0x1bcd21){logger[_0x78a1('0x13')](_0x78a1('0x10'),_0x1bcd21[_0x78a1('0x14')],_0x2dee4d);_0x471d20(_0x168b2c[_0x78a1('0x13')](0x1f4,_0x1bcd21['message']));});});};exports['ShowCmHopper']=function(_0x132282){var _0x25ed2d=this;return new Promise(function(_0x17050c,_0x5ac50e){return db[_0x78a1('0x5')]['find']({'raw':_0x132282[_0x78a1('0x7')]?_0x132282['options'][_0x78a1('0x15')]===undefined?!![]:![]:!![],'where':_0x132282['options']?_0x132282[_0x78a1('0x7')]['where']||null:null,'attributes':_0x132282[_0x78a1('0x7')]?_0x132282[_0x78a1('0x7')][_0x78a1('0x9')]||null:null,'include':_0x132282[_0x78a1('0x7')]?_0x132282[_0x78a1('0x7')]['include']?_['map'](_0x132282['options'][_0x78a1('0xb')],function(_0x4ba920){return{'model':db[_0x4ba920['model']],'as':_0x4ba920['as'],'attributes':_0x4ba920[_0x78a1('0x9')],'include':_0x4ba920[_0x78a1('0xb')]?_[_0x78a1('0xc')](_0x4ba920[_0x78a1('0xb')],function(_0x5c8eb8){return{'model':db[_0x5c8eb8[_0x78a1('0xd')]],'as':_0x5c8eb8['as'],'attributes':_0x5c8eb8['attributes'],'include':_0x5c8eb8[_0x78a1('0xb')]?_[_0x78a1('0xc')](_0x5c8eb8[_0x78a1('0xb')],function(_0x143bc4){return{'model':db[_0x143bc4[_0x78a1('0xd')]],'as':_0x143bc4['as'],'attributes':_0x143bc4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x44ac64){logger[_0x78a1('0xf')](_0x78a1('0x16'),_0x132282);logger[_0x78a1('0x11')](_0x78a1('0x16'),_0x132282,JSON['stringify'](_0x44ac64));_0x17050c(_0x44ac64);})[_0x78a1('0x12')](function(_0x3243da){logger[_0x78a1('0x13')](_0x78a1('0x16'),_0x3243da[_0x78a1('0x14')],_0x132282);_0x5ac50e(_0x25ed2d['error'](0x1f4,_0x3243da[_0x78a1('0x14')]));});});};exports[_0x78a1('0x17')]=function(_0x500211){var _0x59dbdf=this;return new Promise(function(_0x7f69fa,_0x4acaad){return db[_0x78a1('0x5')]['create'](_0x500211['body'],{'raw':_0x500211[_0x78a1('0x7')]?_0x500211['options'][_0x78a1('0x15')]===undefined?!![]:![]:!![]})[_0x78a1('0xe')](function(_0x37422d){logger[_0x78a1('0xf')](_0x78a1('0x17'),_0x500211);logger[_0x78a1('0x11')]('CreateCmHopper',_0x500211,JSON[_0x78a1('0x18')](_0x37422d));_0x7f69fa(_0x37422d);})[_0x78a1('0x12')](function(_0x23d3c4){logger[_0x78a1('0x13')]('CreateCmHopper',_0x23d3c4[_0x78a1('0x14')],_0x500211);_0x4acaad(_0x59dbdf[_0x78a1('0x13')](0x1f4,_0x23d3c4[_0x78a1('0x14')]));});});};exports[_0x78a1('0x19')]=function(_0x5107ee){var _0x264348=this;return new Promise(function(_0x5d2e7c,_0x359086){return db[_0x78a1('0x5')][_0x78a1('0x1a')](_0x5107ee[_0x78a1('0x1b')],{'raw':_0x5107ee[_0x78a1('0x7')]?_0x5107ee[_0x78a1('0x7')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5107ee[_0x78a1('0x7')]?_0x5107ee[_0x78a1('0x7')][_0x78a1('0x8')]||null:null,'attributes':_0x5107ee['options']?_0x5107ee[_0x78a1('0x7')][_0x78a1('0x9')]||null:null,'limit':_0x5107ee[_0x78a1('0x7')]?_0x5107ee['options']['limit']||null:null})[_0x78a1('0xe')](function(_0x3718da){logger[_0x78a1('0xf')](_0x78a1('0x19'),_0x5107ee);logger[_0x78a1('0xf')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x78a1('0x18')](_0x5107ee[_0x78a1('0x7')][_0x78a1('0x8')]),_0x5107ee[_0x78a1('0x1b')][_0x78a1('0x1c')]);logger[_0x78a1('0x11')](_0x78a1('0x19'),_0x5107ee,JSON[_0x78a1('0x18')](_0x3718da));_0x5d2e7c(_0x3718da);})[_0x78a1('0x12')](function(_0x5d38ff){logger[_0x78a1('0x13')](_0x78a1('0x19'),_0x5d38ff[_0x78a1('0x14')],_0x5107ee);_0x359086(_0x264348[_0x78a1('0x13')](0x1f4,_0x5d38ff[_0x78a1('0x14')]));});});};exports['DestroyCmHopper']=function(_0x509636){var _0x255743=this;return new Promise(function(_0x1714a0,_0x103350){return db[_0x78a1('0x5')][_0x78a1('0x1d')]({'where':_0x509636['options']?_0x509636[_0x78a1('0x7')]['where']||null:null})[_0x78a1('0xe')](function(_0x84be94){logger[_0x78a1('0xf')](_0x78a1('0x1e'),_0x509636);logger['debug'](_0x78a1('0x1e'),_0x509636,JSON[_0x78a1('0x18')](_0x84be94));_0x1714a0(_0x84be94);})[_0x78a1('0x12')](function(_0x351896){logger[_0x78a1('0x13')](_0x78a1('0x1e'),_0x351896[_0x78a1('0x14')],_0x509636);_0x103350(_0x255743[_0x78a1('0x13')](0x1f4,_0x351896[_0x78a1('0x14')]));});});};exports['GetContactDialer']=function(_0x578c04){var _0x39c41d=this;return new Promise(function(_0xc08c45,_0x5e038e){return db['CmContact'][_0x78a1('0x1f')]()[_0x78a1('0xe')](function(_0x2ff9c7){return db[_0x78a1('0x20')]['transaction'](function(_0x311c28){return db[_0x78a1('0x5')]['findAll']({'where':_0x578c04['options']?_0x578c04['options'][_0x78a1('0x8')]||null:null,'attributes':_0x578c04[_0x78a1('0x7')]?_0x578c04[_0x78a1('0x7')][_0x78a1('0x9')]||null:null,'limit':_0x578c04['options']?_0x578c04[_0x78a1('0x7')]['limit']||null:null,'order':_0x578c04[_0x78a1('0x7')]?_0x578c04[_0x78a1('0x7')][_0x78a1('0x21')]||null:null,'transaction':_0x311c28,'lock':_0x311c28[_0x78a1('0x22')]['UPDATE'],'include':[{'model':db[_0x78a1('0x23')],'as':_0x78a1('0x24'),'attributes':_[_0x78a1('0x25')](_0x2ff9c7)},{'model':db[_0x78a1('0x26')],'as':_0x78a1('0x27'),'attributes':['id','name','voicePause']}]})[_0x78a1('0xe')](function(_0x100b9c){var _0x175855=[];var _0x212f45=[];for(var _0x4acec3=0x0;_0x4acec3<_0x100b9c[_0x78a1('0x28')];_0x4acec3+=0x1){var _0x450141=_0x100b9c[_0x4acec3][_0x78a1('0x29')];if(_0x450141===null){_0x175855[_0x78a1('0x2a')](_0x100b9c[_0x4acec3][_0x78a1('0x1a')](_0x578c04[_0x78a1('0x1b')],{'transaction':_0x311c28}));}else if(!_0x212f45[_0x78a1('0x2b')](_0x450141)){_0x212f45[_0x78a1('0x2a')](_0x450141);_0x175855[_0x78a1('0x2a')](_0x100b9c[_0x4acec3][_0x78a1('0x1a')](_0x578c04[_0x78a1('0x1b')],{'transaction':_0x311c28}));}}return BPromise[_0x78a1('0x2c')](_0x175855);});})[_0x78a1('0xe')](function(_0x27197a){logger[_0x78a1('0xf')](_0x78a1('0x2d'),_0x578c04);if(_0x27197a['length']>0x0){logger[_0x78a1('0xf')](_0x78a1('0x2e'),_0x27197a[0x0][_0x78a1('0x2f')]['id'],_0x27197a[0x0][_0x78a1('0x2f')][_0x78a1('0x30')],_0x27197a[0x0][_0x78a1('0x2f')][_0x78a1('0x1c')]);}logger[_0x78a1('0x11')]('GetContactDialer',_0x578c04,JSON[_0x78a1('0x18')](_0x27197a));_0xc08c45(_0x27197a);})[_0x78a1('0x12')](function(_0x1921df){logger[_0x78a1('0x13')](_0x78a1('0x2d'),_0x1921df[_0x78a1('0x14')],_0x578c04);_0x5e038e(_0x39c41d[_0x78a1('0x13')](0x1f4,_0x1921df['message']));});});});};exports['MoveContactManagedDialer']=function(_0x18d5cb){var _0x5bc345=this;return new Promise(function(_0x4eece0,_0x214ec2){return db[_0x78a1('0x20')][_0x78a1('0x31')](function(_0x5a194e){return db[_0x78a1('0x32')][_0x78a1('0x33')](_0x18d5cb[_0x78a1('0x1b')],{'raw':_0x18d5cb['options']?_0x18d5cb[_0x78a1('0x7')]['raw']===undefined?!![]:![]:!![],'transaction':_0x5a194e})[_0x78a1('0xe')](function(){logger[_0x78a1('0xf')](_0x78a1('0x34'),JSON[_0x78a1('0x18')](_0x18d5cb[_0x78a1('0x7')][_0x78a1('0x8')]),_0x18d5cb[_0x78a1('0x7')][_0x78a1('0x8')]['active']);return db[_0x78a1('0x5')][_0x78a1('0x1d')]({'where':_0x18d5cb['options']?_0x18d5cb[_0x78a1('0x7')]['where']||null:null,'transaction':_0x5a194e});});})[_0x78a1('0xe')](function(_0x411f82){logger[_0x78a1('0xf')](_0x78a1('0x35'),_0x18d5cb);logger[_0x78a1('0x11')](_0x78a1('0x35'),_0x18d5cb,JSON[_0x78a1('0x18')](_0x411f82));_0x4eece0(_0x411f82);})[_0x78a1('0x12')](function(_0xcf5e2f){logger[_0x78a1('0x13')]('MoveContactManagedDialer',_0xcf5e2f[_0x78a1('0x14')],_0x18d5cb);_0x214ec2(_0x5bc345[_0x78a1('0x13')](0x1f4,_0xcf5e2f[_0x78a1('0x14')]));});});};exports[_0x78a1('0x36')]=function(_0x16e2de){var _0xd055ec=this;return new Promise(function(_0xde41c3,_0x3e2a72){return db[_0x78a1('0x5')]['findAll']({'raw':_0x16e2de[_0x78a1('0x7')]?_0x16e2de[_0x78a1('0x7')][_0x78a1('0x15')]===undefined?!![]:![]:!![],'where':_0x16e2de['options']?_0x16e2de['options'][_0x78a1('0x8')]||null:null,'attributes':[[db['sequelize']['fn'](_0x78a1('0x37'),db['sequelize']['fn']('IF',db[_0x78a1('0x20')][_0x78a1('0x38')](_0x78a1('0x39')+util[_0x78a1('0x3a')](_0x78a1('0x3b'),moment()[_0x78a1('0x3a')](_0x78a1('0x3c')))+_0x78a1('0x3d')))),'contactsRescheduled']]})['then'](function(_0x4fb871){logger[_0x78a1('0xf')](_0x78a1('0x36'),_0x16e2de);logger[_0x78a1('0x11')](_0x78a1('0x36'),_0x16e2de,JSON['stringify'](_0x4fb871));_0xde41c3(_0x4fb871);})[_0x78a1('0x12')](function(_0x5a5afb){logger['error'](_0x78a1('0x36'),_0x5a5afb[_0x78a1('0x14')],_0x16e2de);_0x3e2a72(_0xd055ec[_0x78a1('0x13')](0x1f4,_0x5a5afb[_0x78a1('0x14')]));});});};exports[_0x78a1('0x3e')]=function(_0x1e4316){var _0x375aea=this;return new Promise(function(_0x1ba76b,_0x1a92c3){return db[_0x78a1('0x23')]['describe']()[_0x78a1('0xe')](function(){return db[_0x78a1('0x20')][_0x78a1('0x31')](function(_0x183011){return db[_0x78a1('0x5')]['findAll']({'where':_0x1e4316[_0x78a1('0x7')]?_0x1e4316[_0x78a1('0x7')][_0x78a1('0x8')]||null:null,'attributes':_0x1e4316[_0x78a1('0x7')]?_0x1e4316[_0x78a1('0x7')][_0x78a1('0x9')]||null:null,'limit':0x1,'order':_0x1e4316['options']?_0x1e4316[_0x78a1('0x7')][_0x78a1('0x21')]||null:null,'group':db[_0x78a1('0x5')][_0x78a1('0x29')],'transaction':_0x183011,'lock':_0x183011[_0x78a1('0x22')][_0x78a1('0x3f')],'include':_0x1e4316[_0x78a1('0x7')]?_0x1e4316['options']['include']?_[_0x78a1('0xc')](_0x1e4316[_0x78a1('0x7')][_0x78a1('0xb')],function(_0x1bbda0){return{'model':db[_0x1bbda0[_0x78a1('0xd')]],'as':_0x1bbda0['as'],'attributes':_0x1bbda0[_0x78a1('0x9')],'include':_0x1bbda0[_0x78a1('0xb')]?_[_0x78a1('0xc')](_0x1bbda0[_0x78a1('0xb')],function(_0x1b2d94){return{'model':db[_0x1b2d94[_0x78a1('0xd')]],'as':_0x1b2d94['as'],'attributes':_0x1b2d94[_0x78a1('0x9')],'include':_0x1b2d94[_0x78a1('0xb')]?_['map'](_0x1b2d94[_0x78a1('0xb')],function(_0x84e0b0){return{'model':db[_0x84e0b0[_0x78a1('0xd')]],'as':_0x84e0b0['as'],'attributes':_0x84e0b0[_0x78a1('0x9')]};}):[]};}):[]};}):[]:[]})[_0x78a1('0xe')](function(_0x1b6723){var _0x3b81c6=[];for(var _0x275e91=0x0;_0x275e91<_0x1b6723[_0x78a1('0x28')];_0x275e91+=0x1){_0x3b81c6[_0x78a1('0x2a')](_0x1b6723[_0x275e91][_0x78a1('0x1a')](_0x1e4316[_0x78a1('0x1b')],{'transaction':_0x183011}));}return BPromise[_0x78a1('0x2c')](_0x3b81c6);});})[_0x78a1('0xe')](function(_0x215375){logger[_0x78a1('0xf')](_0x78a1('0x3e'),_0x1e4316);logger[_0x78a1('0x11')](_0x78a1('0x3e'),_0x1e4316,JSON['stringify'](_0x215375));_0x1ba76b(_0x215375);})['catch'](function(_0x48b810){logger[_0x78a1('0x13')](_0x78a1('0x3e'),_0x48b810[_0x78a1('0x14')],_0x1e4316);_0x1a92c3(_0x375aea[_0x78a1('0x13')](0x1f4,_0x48b810[_0x78a1('0x14')]));});});});};exports[_0x78a1('0x40')]=function(_0x3bde75){var _0x46221d=this;return new Promise(function(_0x4dc80c,_0x55b8c4){db[_0x78a1('0x23')][_0x78a1('0x1f')]()[_0x78a1('0xe')](function(_0x5ec35b){return db[_0x78a1('0x5')][_0x78a1('0x6')]({'raw':_0x3bde75[_0x78a1('0x7')]?_0x3bde75[_0x78a1('0x7')][_0x78a1('0x15')]===undefined?!![]:![]:!![],'where':_0x3bde75[_0x78a1('0x7')]?_0x3bde75[_0x78a1('0x7')][_0x78a1('0x8')]||null:null,'attributes':_0x3bde75['options']?_0x3bde75['options'][_0x78a1('0x9')]||null:null,'limit':_0x3bde75['options']?_0x3bde75[_0x78a1('0x7')][_0x78a1('0xa')]||null:null,'include':_0x3bde75['options']?_0x3bde75[_0x78a1('0x7')][_0x78a1('0xb')]?_[_0x78a1('0xc')](_0x3bde75[_0x78a1('0x7')][_0x78a1('0xb')],function(_0x5b496f){return{'model':db[_0x5b496f[_0x78a1('0xd')]],'as':_0x5b496f['as'],'attributes':_0x5b496f['as']===_0x78a1('0x24')?_[_0x78a1('0x25')](_0x5ec35b):_0x5b496f[_0x78a1('0x9')],'include':_0x5b496f[_0x78a1('0xb')]?_[_0x78a1('0xc')](_0x5b496f[_0x78a1('0xb')],function(_0x2307ba){return{'model':db[_0x2307ba[_0x78a1('0xd')]],'as':_0x2307ba['as'],'attributes':_0x2307ba[_0x78a1('0x9')],'include':_0x2307ba[_0x78a1('0xb')]?_['map'](_0x2307ba[_0x78a1('0xb')],function(_0x129aeb){return{'model':db[_0x129aeb['model']],'as':_0x129aeb['as'],'attributes':_0x129aeb['attributes']};}):[]};}):[]};}):[]:[]})[_0x78a1('0xe')](function(_0x537a69){logger['info'](_0x78a1('0x10'),_0x3bde75);logger['debug'](_0x78a1('0x10'),_0x3bde75,JSON[_0x78a1('0x18')](_0x537a69));_0x4dc80c(_0x537a69);})[_0x78a1('0x12')](function(_0x234662){logger[_0x78a1('0x13')](_0x78a1('0x10'),_0x234662[_0x78a1('0x14')],_0x3bde75);_0x55b8c4(_0x46221d[_0x78a1('0x13')](0x1f4,_0x234662[_0x78a1('0x14')]));});});});};exports[_0x78a1('0x41')]=function(_0x3f07f2){var _0x2c9864=this;return new Promise(function(_0x20f7ce,_0xc8f665){return db[_0x78a1('0x23')][_0x78a1('0x42')]({'raw':!![],'where':{'phone':_0x3f07f2[_0x78a1('0x7')]['where'][_0x78a1('0x43')]},'attributes':['id',_0x78a1('0x44')],'order':[['id',_0x78a1('0x45')]]})['then'](function(_0x17c689){logger['info'](_0x78a1('0x46'),_0x3f07f2);logger[_0x78a1('0x11')](_0x78a1('0x46'),_0x3f07f2,JSON['stringify'](_0x17c689));_0x20f7ce(_0x17c689);})[_0x78a1('0x12')](function(_0x1619de){logger[_0x78a1('0x13')](_0x78a1('0x46'),_0x1619de[_0x78a1('0x14')],_0x3f07f2);_0xc8f665(_0x2c9864[_0x78a1('0x13')](0x1f4,_0x1619de['message']));});});};exports['ResetActiveCalls']=function(_0x3ad1a9){var _0x29ef3e=this;return new Promise(function(_0x409270,_0x19cb0f){return db[_0x78a1('0x20')][_0x78a1('0x31')](function(_0x5cc3b5){var _0x2247b2=_0x3ad1a9['options']&&_0x3ad1a9['options'][_0x78a1('0x8')]?_0x3ad1a9['options'][_0x78a1('0x8')]:{};return db[_0x78a1('0x5')][_0x78a1('0x1a')](_0x3ad1a9[_0x78a1('0x1b')],{'where':_0x2247b2,'transaction':_0x5cc3b5})[_0x78a1('0xe')](function(_0x595555){logger[_0x78a1('0xf')](_0x78a1('0x47'),_0x3ad1a9);logger['debug'](_0x78a1('0x47'),_0x3ad1a9,JSON['stringify'](_0x595555));_0x409270(_0x595555);})[_0x78a1('0x12')](function(_0x4ec022){logger[_0x78a1('0x13')](_0x78a1('0x47'),_0x4ec022[_0x78a1('0x14')],_0x3ad1a9);_0x19cb0f(_0x29ef3e[_0x78a1('0x13')](0x1f4,_0x4ec022['message']));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x2f9e3e){var _0x192e4d=this;var _0x137935=_0x2f9e3e[_0x78a1('0x1b')][_0x78a1('0x8')]['voiceQueueIds'];var _0xa92d7a=_0x2f9e3e[_0x78a1('0x1b')]['where'][_0x78a1('0x48')];var _0x29de39=_0x2f9e3e[_0x78a1('0x1b')][_0x78a1('0x8')][_0x78a1('0x49')];return new Promise(function(_0x1ba5a8,_0x20b264){return db[_0x78a1('0x5')][_0x78a1('0x6')]({'where':{'voiceQueueId':{'$in':_0x137935},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x78a1('0x20')]['literal'](_0x78a1('0x4a')+_0xa92d7a+_0x78a1('0x4b')),'$gt':db[_0x78a1('0x20')][_0x78a1('0x38')](_0x78a1('0x4c'))}},'UserId':{'$in':_0x29de39}},'include':[{'model':db[_0x78a1('0x23')],'as':'Contact'},{'model':db[_0x78a1('0x26')],'as':_0x78a1('0x27'),'attributes':['id','name',_0x78a1('0x4d')]},{'model':db[_0x78a1('0x4e')],'as':_0x78a1('0x4f')}]})[_0x78a1('0xe')](function(_0x2eecf2){if(_0x2eecf2[_0x78a1('0x28')]>0x0){return db['sequelize'][_0x78a1('0x31')](function(_0x2be3a3){return db[_0x78a1('0x5')][_0x78a1('0x1a')]({'recallmeNotifiedDate':db[_0x78a1('0x20')]['literal'](_0x78a1('0x4c'))},{'where':{'id':{'$in':_['map'](_0x2eecf2,'id')}},'transaction':_0x2be3a3})[_0x78a1('0xe')](function(){_0x1ba5a8(_0x2eecf2);})[_0x78a1('0x12')](function(_0x114287){logger[_0x78a1('0x13')](_0x78a1('0x50'),_0x114287[_0x78a1('0x14')],_0x2f9e3e);_0x20b264(_0x192e4d[_0x78a1('0x13')](0x1f4,_0x114287['message']));});})[_0x78a1('0x12')](function(_0x94f87b){logger[_0x78a1('0x13')]('CmHopperHandlePreviewRecallNotifications',_0x94f87b[_0x78a1('0x14')],_0x2f9e3e);_0x20b264(_0x192e4d['error'](0x1f4,_0x94f87b[_0x78a1('0x14')]));});}else{_0x1ba5a8(_0x2eecf2);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 49bd5d7..528d3fc 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 _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 +var _0xc70e=['destroy','exports','express','Router','./cmHopper.controller','get','index','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','put','delete'];(function(_0x21b093,_0x49a7cf){var _0x39d5a9=function(_0x54febf){while(--_0x54febf){_0x21b093['push'](_0x21b093['shift']());}};_0x39d5a9(++_0x49a7cf);}(_0xc70e,0x98));var _0xec70=function(_0x1324ec,_0x3c781b){_0x1324ec=_0x1324ec-0x0;var _0x2c76e1=_0xc70e[_0x1324ec];return _0x2c76e1;};'use strict';var express=require(_0xec70('0x0'));var router=express[_0xec70('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xec70('0x2'));router[_0xec70('0x3')]('/',auth['isAuthenticated'](),controller[_0xec70('0x4')]);router[_0xec70('0x3')](_0xec70('0x5'),auth[_0xec70('0x6')](),controller[_0xec70('0x7')]);router['get'](_0xec70('0x8'),auth['isAuthenticated'](),controller[_0xec70('0x9')]);router['get'](_0xec70('0xa'),auth['isAuthenticated'](),controller[_0xec70('0xb')]);router[_0xec70('0x3')](_0xec70('0xc'),auth['isAuthenticated'](),controller[_0xec70('0xd')]);router['get'](_0xec70('0xe'),auth[_0xec70('0x6')](),controller[_0xec70('0xf')]);router[_0xec70('0x10')]('/',auth[_0xec70('0x6')](),controller[_0xec70('0x11')]);router['post'](_0xec70('0x12'),auth[_0xec70('0x6')](),controller[_0xec70('0x13')]);router['post'](_0xec70('0x14'),auth[_0xec70('0x6')](),controller['getTimezone']);router[_0xec70('0x15')](_0xec70('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xec70('0x16')](_0xec70('0xc'),auth[_0xec70('0x6')](),controller[_0xec70('0x17')]);module[_0xec70('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 4f6cd56..8990ecd 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 _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 +var _0x3756=['format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','INTEGER','STRING','DATE'];(function(_0x4b6800,_0x52dbd4){var _0x333f7c=function(_0x59e572){while(--_0x59e572){_0x4b6800['push'](_0x4b6800['shift']());}};_0x333f7c(++_0x52dbd4);}(_0x3756,0x144));var _0x6375=function(_0x394c3f,_0x73ea9d){_0x394c3f=_0x394c3f-0x0;var _0x3f3886=_0x3756[_0x394c3f];return _0x3f3886;};'use strict';var moment=require(_0x6375('0x0'));var Sequelize=require(_0x6375('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0x6375('0x2')]},'phone':{'type':Sequelize[_0x6375('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x6375('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x6375('0x4')],'defaultValue':moment()[_0x6375('0x5')](_0x6375('0x6'))},'countbusyretry':{'type':Sequelize[_0x6375('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6375('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x6375('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6375('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6375('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6375('0x2')],'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 74dbc55..d43b4b9 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 _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 +var _0xa3d5=['jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','destroy','then','get','UserProfileResource','end','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','CmHopperAdditionalPhone','includeAll','findAll','rows','catch','show','keys','include','find','create','body','role','user','CmHopperAdditionalPhones','UserProfileSection','userProfileId','autoAssociation','update','params','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto'];(function(_0xf2f6a,_0x28ce5a){var _0x49f7eb=function(_0x4e08b4){while(--_0x4e08b4){_0xf2f6a['push'](_0xf2f6a['shift']());}};_0x49f7eb(++_0x28ce5a);}(_0xa3d5,0x1e0));var _0x5a3d=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0xa3d5[_0x1ca890];return _0x3f8e01;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a3d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a3d('0x1'));var rp=require(_0x5a3d('0x2'));var moment=require('moment');var BPromise=require(_0x5a3d('0x3'));var Mustache=require(_0x5a3d('0x4'));var util=require(_0x5a3d('0x5'));var path=require(_0x5a3d('0x6'));var sox=require('sox');var csv=require(_0x5a3d('0x7'));var ejs=require(_0x5a3d('0x8'));var fs=require('fs');var fs_extra=require(_0x5a3d('0x9'));var _=require('lodash');var squel=require(_0x5a3d('0xa'));var crypto=require(_0x5a3d('0xb'));var jsforce=require(_0x5a3d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5a3d('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5a3d('0xe'));var qs=require(_0x5a3d('0xf'));var as=require(_0x5a3d('0x10'));var hardwareService=require(_0x5a3d('0x11'));var logger=require(_0x5a3d('0x12'))(_0x5a3d('0x13'));var utils=require(_0x5a3d('0x14'));var config=require(_0x5a3d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a3d('0x16'))['db'];function respondWithStatusCode(_0x28c011,_0x1f794d){_0x1f794d=_0x1f794d||0xcc;return function(_0x20cee8){if(_0x20cee8){return _0x28c011[_0x5a3d('0x17')](_0x1f794d);}return _0x28c011[_0x5a3d('0x18')](_0x1f794d)['end']();};}function respondWithResult(_0xbc7143,_0x1e30bf){_0x1e30bf=_0x1e30bf||0xc8;return function(_0x329e64){if(_0x329e64){return _0xbc7143[_0x5a3d('0x18')](_0x1e30bf)[_0x5a3d('0x19')](_0x329e64);}};}function respondWithFilteredResult(_0x5d2231,_0x2f9d58){return function(_0x2024b6){if(_0x2024b6){var _0x1a0db2=typeof _0x2f9d58[_0x5a3d('0x1a')]===_0x5a3d('0x1b')&&typeof _0x2f9d58[_0x5a3d('0x1c')]===_0x5a3d('0x1b');var _0x5c98e5=_0x2024b6[_0x5a3d('0x1d')];var _0x37e97b=_0x1a0db2?0x0:_0x2f9d58[_0x5a3d('0x1a')];var _0x575ccd=_0x1a0db2?_0x2024b6['count']:_0x2f9d58[_0x5a3d('0x1a')]+_0x2f9d58['limit'];var _0x4038cb;if(_0x575ccd>=_0x5c98e5){_0x575ccd=_0x5c98e5;_0x4038cb=0xc8;}else{_0x4038cb=0xce;}_0x5d2231[_0x5a3d('0x18')](_0x4038cb);return _0x5d2231[_0x5a3d('0x1e')](_0x5a3d('0x1f'),_0x37e97b+'-'+_0x575ccd+'/'+_0x5c98e5)[_0x5a3d('0x19')](_0x2024b6);}return null;};}function patchUpdates(_0x417ae7){return function(_0x3be3ce){try{jsonpatch['apply'](_0x3be3ce,_0x417ae7,!![]);}catch(_0x544741){return BPromise[_0x5a3d('0x20')](_0x544741);}return _0x3be3ce['save']();};}function saveUpdates(_0x1c9f07,_0x1ab0a4){return function(_0x1e2c57){if(_0x1e2c57){return _0x1e2c57['update'](_0x1c9f07)['then'](function(_0x5c6dc2){return _0x5c6dc2;});}return null;};}function removeEntity(_0x3cc2ac,_0x2b4693){return function(_0x1c57be){if(_0x1c57be){return _0x1c57be[_0x5a3d('0x21')]()[_0x5a3d('0x22')](function(){var _0x244215=_0x1c57be[_0x5a3d('0x23')]({'plain':!![]});var _0x5ec400='CmHopperAdditionalPhones';return db[_0x5a3d('0x24')]['destroy']({'where':{'type':_0x5ec400,'resourceId':_0x244215['id']}})['then'](function(){return _0x1c57be;});})[_0x5a3d('0x22')](function(){_0x3cc2ac[_0x5a3d('0x18')](0xcc)[_0x5a3d('0x25')]();});}};}function handleEntityNotFound(_0x3d3631,_0x5bf18e){return function(_0x55a32c){if(!_0x55a32c){_0x3d3631[_0x5a3d('0x17')](0x194);}return _0x55a32c;};}function handleError(_0x4af200,_0x1546c9){_0x1546c9=_0x1546c9||0x1f4;return function(_0x2b5c32){logger[_0x5a3d('0x26')](_0x2b5c32[_0x5a3d('0x27')]);if(_0x2b5c32['name']){delete _0x2b5c32[_0x5a3d('0x28')];}_0x4af200['status'](_0x1546c9)[_0x5a3d('0x29')](_0x2b5c32);};}exports[_0x5a3d('0x2a')]=function(_0x59b22e,_0x1952e7){var _0x57a019={},_0x15381e={},_0x47c221={'count':0x0,'rows':[]};var _0x19e5d7=_['map'](db['CmHopperAdditionalPhone'][_0x5a3d('0x2b')],function(_0x400695){return{'name':_0x400695[_0x5a3d('0x2c')],'type':_0x400695[_0x5a3d('0x2d')]['key']};});_0x15381e[_0x5a3d('0x2e')]=_[_0x5a3d('0x2f')](_0x19e5d7,_0x5a3d('0x28'));_0x15381e['query']=_['keys'](_0x59b22e[_0x5a3d('0x30')]);_0x15381e['filters']=_['intersection'](_0x15381e['model'],_0x15381e['query']);_0x57a019[_0x5a3d('0x31')]=_[_0x5a3d('0x32')](_0x15381e[_0x5a3d('0x2e')],qs[_0x5a3d('0x33')](_0x59b22e['query']['fields']));_0x57a019[_0x5a3d('0x31')]=_0x57a019[_0x5a3d('0x31')][_0x5a3d('0x34')]?_0x57a019['attributes']:_0x15381e[_0x5a3d('0x2e')];if(!_0x59b22e[_0x5a3d('0x30')][_0x5a3d('0x35')](_0x5a3d('0x36'))){_0x57a019['limit']=qs['limit'](_0x59b22e[_0x5a3d('0x30')][_0x5a3d('0x1c')]);_0x57a019[_0x5a3d('0x1a')]=qs[_0x5a3d('0x1a')](_0x59b22e[_0x5a3d('0x30')]['offset']);}_0x57a019[_0x5a3d('0x37')]=qs[_0x5a3d('0x38')](_0x59b22e[_0x5a3d('0x30')][_0x5a3d('0x38')]);_0x57a019[_0x5a3d('0x39')]=qs[_0x5a3d('0x3a')](_[_0x5a3d('0x3b')](_0x59b22e[_0x5a3d('0x30')],_0x15381e[_0x5a3d('0x3a')]),_0x19e5d7);if(_0x59b22e[_0x5a3d('0x30')][_0x5a3d('0x3c')]){_0x57a019['where']=_[_0x5a3d('0x3d')](_0x57a019[_0x5a3d('0x39')],{'$or':_[_0x5a3d('0x2f')](_0x19e5d7,function(_0x1d38da){if(_0x1d38da['type']!=='VIRTUAL'){var _0x36f25c={};_0x36f25c[_0x1d38da[_0x5a3d('0x28')]]={'$like':'%'+_0x59b22e[_0x5a3d('0x30')][_0x5a3d('0x3c')]+'%'};return _0x36f25c;}})});}_0x57a019=_[_0x5a3d('0x3d')]({},_0x57a019,_0x59b22e[_0x5a3d('0x3e')]);var _0x574026={'where':_0x57a019[_0x5a3d('0x39')]};return db[_0x5a3d('0x3f')]['count'](_0x574026)[_0x5a3d('0x22')](function(_0x91d408){_0x47c221[_0x5a3d('0x1d')]=_0x91d408;if(_0x59b22e[_0x5a3d('0x30')][_0x5a3d('0x40')]){_0x57a019['include']=[{'all':!![]}];}return db[_0x5a3d('0x3f')][_0x5a3d('0x41')](_0x57a019);})[_0x5a3d('0x22')](function(_0x1eaa30){_0x47c221[_0x5a3d('0x42')]=_0x1eaa30;return _0x47c221;})[_0x5a3d('0x22')](respondWithFilteredResult(_0x1952e7,_0x57a019))[_0x5a3d('0x43')](handleError(_0x1952e7,null));};exports[_0x5a3d('0x44')]=function(_0x1e485d,_0x2dab12){var _0x11f959={'raw':!![],'where':{'id':_0x1e485d['params']['id']}},_0x184e1d={};_0x184e1d['model']=_[_0x5a3d('0x45')](db[_0x5a3d('0x3f')][_0x5a3d('0x2b')]);_0x184e1d[_0x5a3d('0x30')]=_[_0x5a3d('0x45')](_0x1e485d[_0x5a3d('0x30')]);_0x184e1d['filters']=_[_0x5a3d('0x32')](_0x184e1d[_0x5a3d('0x2e')],_0x184e1d[_0x5a3d('0x30')]);_0x11f959[_0x5a3d('0x31')]=_[_0x5a3d('0x32')](_0x184e1d['model'],qs[_0x5a3d('0x33')](_0x1e485d[_0x5a3d('0x30')][_0x5a3d('0x33')]));_0x11f959[_0x5a3d('0x31')]=_0x11f959[_0x5a3d('0x31')][_0x5a3d('0x34')]?_0x11f959['attributes']:_0x184e1d[_0x5a3d('0x2e')];if(_0x1e485d[_0x5a3d('0x30')][_0x5a3d('0x40')]){_0x11f959[_0x5a3d('0x46')]=[{'all':!![]}];}_0x11f959=_[_0x5a3d('0x3d')]({},_0x11f959,_0x1e485d[_0x5a3d('0x3e')]);return db[_0x5a3d('0x3f')][_0x5a3d('0x47')](_0x11f959)[_0x5a3d('0x22')](handleEntityNotFound(_0x2dab12,null))[_0x5a3d('0x22')](respondWithResult(_0x2dab12,null))[_0x5a3d('0x43')](handleError(_0x2dab12,null));};exports[_0x5a3d('0x48')]=function(_0xd09c3d,_0x1aabf5){return db[_0x5a3d('0x3f')][_0x5a3d('0x48')](_0xd09c3d[_0x5a3d('0x49')],{})[_0x5a3d('0x22')](function(_0x197439){var _0x28bbc5=_0xd09c3d['user'][_0x5a3d('0x23')]({'plain':!![]});if(!_0x28bbc5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x28bbc5[_0x5a3d('0x4a')]===_0x5a3d('0x4b')){var _0x4889ed=_0x197439[_0x5a3d('0x23')]({'plain':!![]});var _0x381977=_0x5a3d('0x4c');return db[_0x5a3d('0x4d')][_0x5a3d('0x47')]({'where':{'name':_0x381977,'userProfileId':_0x28bbc5[_0x5a3d('0x4e')]},'raw':!![]})[_0x5a3d('0x22')](function(_0x30c5ee){if(_0x30c5ee&&_0x30c5ee[_0x5a3d('0x4f')]===0x0){return db[_0x5a3d('0x24')][_0x5a3d('0x48')]({'name':_0x4889ed[_0x5a3d('0x28')],'resourceId':_0x4889ed['id'],'type':_0x30c5ee[_0x5a3d('0x28')],'sectionId':_0x30c5ee['id']},{})['then'](function(){return _0x197439;});}else{return _0x197439;}})['catch'](function(_0x583b8b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x583b8b);throw _0x583b8b;});}return _0x197439;})[_0x5a3d('0x22')](respondWithResult(_0x1aabf5,0xc9))[_0x5a3d('0x43')](handleError(_0x1aabf5,null));};exports[_0x5a3d('0x50')]=function(_0x4631b0,_0x1c8088){if(_0x4631b0[_0x5a3d('0x49')]['id']){delete _0x4631b0[_0x5a3d('0x49')]['id'];}return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x4631b0[_0x5a3d('0x51')]['id']}})[_0x5a3d('0x22')](handleEntityNotFound(_0x1c8088,null))[_0x5a3d('0x22')](saveUpdates(_0x4631b0[_0x5a3d('0x49')],null))[_0x5a3d('0x22')](respondWithResult(_0x1c8088,null))[_0x5a3d('0x43')](handleError(_0x1c8088,null));};exports[_0x5a3d('0x21')]=function(_0x146357,_0x2dc742){return db[_0x5a3d('0x3f')][_0x5a3d('0x47')]({'where':{'id':_0x146357[_0x5a3d('0x51')]['id']}})[_0x5a3d('0x22')](handleEntityNotFound(_0x2dc742,null))['then'](removeEntity(_0x2dc742,null))[_0x5a3d('0x43')](handleError(_0x2dc742,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index d77c51e..e770af8 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 _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 +var _0x9dbf=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone','lodash'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0x9dbf,0x99));var _0xf9db=function(_0x3bdf48,_0x1fa313){_0x3bdf48=_0x3bdf48-0x0;var _0x7a63c6=_0x9dbf[_0x3bdf48];return _0x7a63c6;};'use strict';var _=require(_0xf9db('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf9db('0x1'));var moment=require(_0xf9db('0x2'));var BPromise=require(_0xf9db('0x3'));var rp=require(_0xf9db('0x4'));var fs=require('fs');var path=require(_0xf9db('0x5'));var rimraf=require(_0xf9db('0x6'));var config=require(_0xf9db('0x7'));var attributes=require(_0xf9db('0x8'));module['exports']=function(_0xc9f8a7,_0x127970){return _0xc9f8a7[_0xf9db('0x9')](_0xf9db('0xa'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 1392971..0cc4eca 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 _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 +var _0xd376=['CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','findOne','countbusyretry','countnoanswerretry','entity','dialGlobalMaxRetry','SwapAdditionalPhones','ListId','VoiceQueueId','duration','waitTime','isNil','scheduledat','add','minutes','phone','countmachineretry','createdAt','updatedAt','transaction','update','IncrementPreviewCounters','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VerifyAdditionalPhones','CmHopper','ContactId','body'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xd376,0x16e));var _0x6d37=function(_0xc6b104,_0x1d805a){_0xc6b104=_0xc6b104-0x0;var _0x1c6fce=_0xd376[_0xc6b104];return _0x1c6fce;};'use strict';var _=require(_0x6d37('0x0'));var util=require(_0x6d37('0x1'));var moment=require('moment');var BPromise=require(_0x6d37('0x2'));var rs=require(_0x6d37('0x3'));var fs=require('fs');var Redis=require(_0x6d37('0x4'));var db=require(_0x6d37('0x5'))['db'];var utils=require(_0x6d37('0x6'));var logger=require(_0x6d37('0x7'))(_0x6d37('0x8'));var config=require(_0x6d37('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6d37('0xa')][_0x6d37('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x218630,_0x1e0d15,_0xbb4db8){return new BPromise(function(_0x191371,_0x59f675){return client['request'](_0x218630,_0xbb4db8)[_0x6d37('0xc')](function(_0x16fe9f){logger[_0x6d37('0xd')](_0x6d37('0xe'),_0x1e0d15,_0x6d37('0xf'));logger['debug'](_0x6d37('0x10'),_0x1e0d15,_0x6d37('0xf'),JSON['stringify'](_0x16fe9f));if(_0x16fe9f[_0x6d37('0x11')]){if(_0x16fe9f['error'][_0x6d37('0x12')]===0x1f4){logger[_0x6d37('0x11')](_0x6d37('0xe'),_0x1e0d15,_0x16fe9f[_0x6d37('0x11')][_0x6d37('0x13')]);return _0x59f675(_0x16fe9f['error']['message']);}logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1e0d15,_0x16fe9f['error']['message']);return _0x191371(_0x16fe9f[_0x6d37('0x11')][_0x6d37('0x13')]);}else{logger[_0x6d37('0xd')](_0x6d37('0xe'),_0x1e0d15,_0x6d37('0xf'));_0x191371(_0x16fe9f[_0x6d37('0x14')]['message']);}})[_0x6d37('0x15')](function(_0x394877){logger[_0x6d37('0x11')](_0x6d37('0xe'),_0x1e0d15,_0x394877);_0x59f675(_0x394877);});});}exports[_0x6d37('0x16')]=function(_0x5b6e85){var _0x34585e=this;return new Promise(function(_0x208e20,_0x715c0c){return db[_0x6d37('0x17')]['findOne']({'raw':!![],'where':{'ContactId':_0x5b6e85['body'][_0x6d37('0x18')],'ListId':_0x5b6e85[_0x6d37('0x19')]['ListId'],'VoiceQueueId':_0x5b6e85[_0x6d37('0x19')]['VoiceQueueId']===undefined?null:_0x5b6e85[_0x6d37('0x19')]['VoiceQueueId'],'CampaignId':_0x5b6e85[_0x6d37('0x19')][_0x6d37('0x1a')]===undefined?null:_0x5b6e85[_0x6d37('0x19')][_0x6d37('0x1a')]}})[_0x6d37('0xc')](function(_0x3b0802){if(_0x3b0802!=null){return db[_0x6d37('0x1b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x3b0802['id'],'OrderBy':{'$gt':_0x3b0802['OrderBy']}},'order':[[_0x6d37('0x1c'),_0x6d37('0x1d')]]})['then'](function(_0x42548b){var _0x4435ce=0x0;if(_0x42548b){if(_0x42548b['countbusyretry']+_0x42548b[_0x6d37('0x1e')]+_0x42548b['countnoanswerretry']+_0x42548b[_0x6d37('0x1f')]+_0x42548b[_0x6d37('0x20')]+_0x42548b[_0x6d37('0x21')]+_0x42548b['countmachineretry']+_0x42548b[_0x6d37('0x22')]<_0x5b6e85['entity']['dialGlobalMaxRetry'])_0x4435ce=0x1;_0x208e20({'additional':_0x4435ce});}else{return db['CmHopperAdditionalPhone'][_0x6d37('0x23')]({'raw':!![],'where':{'CmHopperId':_0x3b0802['id']},'order':[[_0x6d37('0x1c'),_0x6d37('0x1d')]]})[_0x6d37('0xc')](function(_0x27b2d1){var _0x443925=0x0;if(_0x27b2d1){if(_0x27b2d1[_0x6d37('0x24')]+_0x27b2d1[_0x6d37('0x1e')]+_0x27b2d1[_0x6d37('0x25')]+_0x27b2d1[_0x6d37('0x1f')]+_0x27b2d1[_0x6d37('0x20')]+_0x27b2d1[_0x6d37('0x21')]+_0x27b2d1['countmachineretry']+_0x27b2d1[_0x6d37('0x22')]<_0x5b6e85[_0x6d37('0x26')][_0x6d37('0x27')])_0x443925=0x1;_0x208e20({'additional':_0x443925});}else{_0x208e20({'additional':0x0});}})[_0x6d37('0x15')](function(_0x5d73d9){logger[_0x6d37('0x11')](_0x6d37('0x16'),_0x5d73d9[_0x6d37('0x13')]);_0x715c0c(_0x34585e[_0x6d37('0x11')](0x1f4,_0x5d73d9['message']));});}})['catch'](function(_0x698efa){logger[_0x6d37('0x11')](_0x6d37('0x16'),_0x698efa[_0x6d37('0x13')]);_0x715c0c(_0x34585e[_0x6d37('0x11')](0x1f4,_0x698efa[_0x6d37('0x13')]));});}else _0x208e20({'additional':0x0});});});};exports[_0x6d37('0x28')]=function(_0x57d73b){var _0x4271fa=this;return new Promise(function(_0xa1affc,_0x542081){return db[_0x6d37('0x17')]['findOne']({'raw':!![],'where':{'ContactId':_0x57d73b[_0x6d37('0x19')][_0x6d37('0x18')],'ListId':_0x57d73b['body'][_0x6d37('0x29')],'VoiceQueueId':_0x57d73b['body']['VoiceQueueId']===undefined?null:_0x57d73b[_0x6d37('0x19')][_0x6d37('0x2a')],'CampaignId':_0x57d73b['body'][_0x6d37('0x1a')]===undefined?null:_0x57d73b[_0x6d37('0x19')][_0x6d37('0x1a')]}})[_0x6d37('0xc')](function(_0x68ae3b){if(_0x68ae3b!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x68ae3b['id'],'OrderBy':{'$gte':_0x68ae3b[_0x6d37('0x1c')]}},'order':[['OrderBy',_0x6d37('0x1d')]]})[_0x6d37('0xc')](function(_0x26ae7e){if(_0x26ae7e)return activateAdditionalPhone(_0x68ae3b,_0x57d73b[_0x6d37('0x19')],_0x26ae7e,_0x57d73b[_0x6d37('0x2b')],_0x57d73b[_0x6d37('0x2c')])[_0x6d37('0xc')](function(_0x663a44){_0xa1affc(_0x663a44);});else{return db[_0x6d37('0x1b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x68ae3b['id']},'order':[[_0x6d37('0x1c'),_0x6d37('0x1d')]]})[_0x6d37('0xc')](function(_0x419d29){if(_0x419d29)return activateAdditionalPhone(_0x68ae3b,_0x57d73b[_0x6d37('0x19')],_0x419d29,_0x57d73b['duration'],_0x57d73b[_0x6d37('0x2c')])[_0x6d37('0xc')](function(_0x58a20f){_0xa1affc(_0x58a20f);});else{_0xa1affc({'id':_0x68ae3b['id'],'phone':''});}})[_0x6d37('0x15')](function(_0x4da62f){logger[_0x6d37('0x11')](_0x6d37('0x16'),_0x4da62f[_0x6d37('0x13')]);_0x542081(_0x4271fa[_0x6d37('0x11')](0x1f4,_0x4da62f[_0x6d37('0x13')]));});}})['catch'](function(_0xde63cb){logger[_0x6d37('0x11')]('VerifyAdditionalPhones',_0xde63cb['message']);_0x542081(_0x4271fa[_0x6d37('0x11')](0x1f4,_0xde63cb[_0x6d37('0x13')]));});}else _0xa1affc(0x1);});});};function activateAdditionalPhone(_0x239d8a,_0x3ae900,_0x47330f,_0x7037f0,_0x3406d5){return new Promise(function(_0x6676b4,_0x1283fa){var _0x82cac;if(_[_0x6d37('0x2d')](_0x47330f['scheduledat'])){_0x47330f[_0x6d37('0x2e')]=moment();}if(moment()>moment(_0x47330f[_0x6d37('0x2e')])){_0x82cac=moment()[_0x6d37('0x2f')](_0x3406d5||0x3,_0x6d37('0x30'));}else{if(_0x47330f['OrderBy']==0x0){_0x82cac=moment(_0x47330f[_0x6d37('0x2e')]);}else{_0x82cac=moment()['add'](_0x3406d5||0x3,_0x6d37('0x30'));}}if(_[_0x6d37('0x2d')](_0x82cac)){_0x82cac=moment()[_0x6d37('0x2f')](_0x3406d5||0x3,_0x6d37('0x30'));}var _0x857649={'phone':_0x239d8a[_0x6d37('0x31')],'active':0x0,'OrderBy':_[_0x6d37('0x2d')](_0x239d8a[_0x6d37('0x1c')])?0x0:_0x239d8a[_0x6d37('0x1c')],'scheduledat':moment()[_0x6d37('0x2f')](_0x7037f0||0x1,_0x6d37('0x30')),'countbusyretry':_0x3ae900[_0x6d37('0x24')],'countcongestionretry':_0x3ae900[_0x6d37('0x1e')],'countnoanswerretry':_0x3ae900['countnoanswerretry'],'countnosuchnumberretry':_0x3ae900['countnosuchnumberretry'],'countdropretry':_0x3ae900[_0x6d37('0x20')],'countabandonedretry':_0x3ae900[_0x6d37('0x21')],'countmachineretry':_0x3ae900[_0x6d37('0x32')],'countagentrejectretry':_0x3ae900[_0x6d37('0x22')],'createdAt':_0x3ae900[_0x6d37('0x33')],'updatedAt':_0x3ae900[_0x6d37('0x34')]};var _0x47017c={'CmHopperId':_0x239d8a['id'],'phone':_0x47330f['phone'],'active':0x0,'OrderBy':_['isNil'](_0x47330f[_0x6d37('0x1c')])?0x0:_0x47330f['OrderBy'],'scheduledat':_0x82cac,'countbusyretry':_0x47330f['countbusyretry'],'countcongestionretry':_0x47330f[_0x6d37('0x1e')],'countnoanswerretry':_0x47330f[_0x6d37('0x25')],'countnosuchnumberretry':_0x47330f['countnosuchnumberretry'],'countdropretry':_0x47330f[_0x6d37('0x20')],'countabandonedretry':_0x47330f['countabandonedretry'],'countmachineretry':_0x47330f[_0x6d37('0x32')],'countagentrejectretry':_0x47330f['countagentrejectretry'],'createdAt':_0x47330f[_0x6d37('0x33')],'updatedAt':_0x47330f['updatedAt']};return db['sequelize'][_0x6d37('0x35')](function(_0xdf69bd){return db['CmHopperAdditionalPhone'][_0x6d37('0x36')](_0x857649,{'where':{'id':_0x47330f['id']}},{'transaction':_0xdf69bd})['then'](function(){return db[_0x6d37('0x17')][_0x6d37('0x36')](_0x47017c,{'where':{'id':_0x239d8a['id']}},{'transaction':_0xdf69bd});});})[_0x6d37('0xc')](function(_0x322066){_0x6676b4({'id':_0x239d8a['id'],'phone':_0x47330f['phone']});})[_0x6d37('0x15')](function(_0x3c25fb){logger[_0x6d37('0x11')]('activateAdditionalPhone',_0x3c25fb[_0x6d37('0x13')]);_0x1283fa({'error':_0x3c25fb[_0x6d37('0x13')]});});});}exports['IncrementPreviewCounters']=function(_0x2d46e4){var _0x2eed39=this;return new Promise(function(_0x2bf3f6,_0x23f8f1){return db[_0x6d37('0x17')][_0x6d37('0x36')](_0x2d46e4[_0x6d37('0x19')]['field'],{'where':{'id':_0x2d46e4[_0x6d37('0x19')]['id']}})[_0x6d37('0xc')](function(_0xc02c0b){_0x2bf3f6(_0xc02c0b);})['catch'](function(_0x5a40a8){logger[_0x6d37('0x11')](_0x6d37('0x37'),_0x5a40a8[_0x6d37('0x13')]);_0x23f8f1(_0x2eed39[_0x6d37('0x11')](0x1f4,_0x5a40a8[_0x6d37('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index bcd9af7..c975456 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 _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 +var _0xa30e=['../../config/environment','./cmHopperAdditionalPhone.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x386c0b,_0x25a98b){var _0x1ebc25=function(_0xfbc73d){while(--_0xfbc73d){_0x386c0b['push'](_0x386c0b['shift']());}};_0x1ebc25(++_0x25a98b);}(_0xa30e,0x117));var _0xea30=function(_0x1b7ea6,_0x195a62){_0x1b7ea6=_0x1b7ea6-0x0;var _0x4fcea6=_0xa30e[_0x1b7ea6];return _0x4fcea6;};'use strict';var multer=require(_0xea30('0x0'));var util=require(_0xea30('0x1'));var path=require(_0xea30('0x2'));var timeout=require(_0xea30('0x3'));var express=require(_0xea30('0x4'));var router=express[_0xea30('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xea30('0x6'));var controller=require(_0xea30('0x7'));router[_0xea30('0x8')]('/',auth['isAuthenticated'](),controller[_0xea30('0x9')]);router[_0xea30('0x8')](_0xea30('0xa'),auth[_0xea30('0xb')](),controller[_0xea30('0xc')]);router[_0xea30('0xd')]('/',auth[_0xea30('0xb')](),controller[_0xea30('0xe')]);router[_0xea30('0xf')](_0xea30('0xa'),auth[_0xea30('0xb')](),controller[_0xea30('0x10')]);router['delete']('/:id',auth[_0xea30('0xb')](),controller[_0xea30('0x11')]);module[_0xea30('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 2edb1bb..b3ba011 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 _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 +var _0x6e0e=['moment','sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x4e4c49,_0x5ba587){var _0x2b1b26=function(_0x18a12a){while(--_0x18a12a){_0x4e4c49['push'](_0x4e4c49['shift']());}};_0x2b1b26(++_0x5ba587);}(_0x6e0e,0x90));var _0xe6e0=function(_0x4e2cab,_0x27eb77){_0x4e2cab=_0x4e2cab-0x0;var _0xc4a809=_0x6e0e[_0x4e2cab];return _0xc4a809;};'use strict';var moment=require(_0xe6e0('0x0'));var Sequelize=require(_0xe6e0('0x1'));module[_0xe6e0('0x2')]={'phone':{'type':Sequelize[_0xe6e0('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xe6e0('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xe6e0('0x4')],'unique':_0xe6e0('0x5')},'VoiceQueueId':{'type':Sequelize[_0xe6e0('0x4')],'unique':_0xe6e0('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 4502fcb..0722a74 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 _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 +var _0xa693=['include','find','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','apply','reject','update','then','destroy','end','stack','name','send','CmHopperBlack','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xa693,0x97));var _0x3a69=function(_0x22431e,_0x5af0a3){_0x22431e=_0x22431e-0x0;var _0xd978e9=_0xa693[_0x22431e];return _0xd978e9;};'use strict';var emlformat=require(_0x3a69('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3a69('0x1'));var jsonpatch=require(_0x3a69('0x2'));var rp=require(_0x3a69('0x3'));var moment=require('moment');var BPromise=require(_0x3a69('0x4'));var Mustache=require(_0x3a69('0x5'));var util=require('util');var path=require(_0x3a69('0x6'));var sox=require(_0x3a69('0x7'));var csv=require(_0x3a69('0x8'));var ejs=require(_0x3a69('0x9'));var fs=require('fs');var fs_extra=require(_0x3a69('0xa'));var _=require(_0x3a69('0xb'));var squel=require(_0x3a69('0xc'));var crypto=require(_0x3a69('0xd'));var jsforce=require(_0x3a69('0xe'));var deskjs=require(_0x3a69('0xf'));var toCsv=require(_0x3a69('0x8'));var querystring=require(_0x3a69('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3a69('0x11'));var qs=require(_0x3a69('0x12'));var as=require(_0x3a69('0x13'));var hardwareService=require(_0x3a69('0x14'));var logger=require('../../config/logger')(_0x3a69('0x15'));var utils=require('../../config/utils');var config=require(_0x3a69('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3a69('0x17'))['db'];function respondWithStatusCode(_0x114815,_0x360cfe){_0x360cfe=_0x360cfe||0xcc;return function(_0x45c722){if(_0x45c722){return _0x114815[_0x3a69('0x18')](_0x360cfe);}return _0x114815['status'](_0x360cfe)['end']();};}function respondWithResult(_0x51e42b,_0x56fff9){_0x56fff9=_0x56fff9||0xc8;return function(_0x52ebb2){if(_0x52ebb2){return _0x51e42b['status'](_0x56fff9)[_0x3a69('0x19')](_0x52ebb2);}};}function respondWithFilteredResult(_0x14128e,_0x1277db){return function(_0x11e2ea){if(_0x11e2ea){var _0x3cce21=typeof _0x1277db[_0x3a69('0x1a')]===_0x3a69('0x1b')&&typeof _0x1277db[_0x3a69('0x1c')]===_0x3a69('0x1b');var _0x212b93=_0x11e2ea[_0x3a69('0x1d')];var _0x17a2a5=_0x3cce21?0x0:_0x1277db[_0x3a69('0x1a')];var _0x28c9ee=_0x3cce21?_0x11e2ea[_0x3a69('0x1d')]:_0x1277db[_0x3a69('0x1a')]+_0x1277db['limit'];var _0x321898;if(_0x28c9ee>=_0x212b93){_0x28c9ee=_0x212b93;_0x321898=0xc8;}else{_0x321898=0xce;}_0x14128e[_0x3a69('0x1e')](_0x321898);return _0x14128e[_0x3a69('0x1f')]('Content-Range',_0x17a2a5+'-'+_0x28c9ee+'/'+_0x212b93)[_0x3a69('0x19')](_0x11e2ea);}return null;};}function patchUpdates(_0x16f7c0){return function(_0x114966){try{jsonpatch[_0x3a69('0x20')](_0x114966,_0x16f7c0,!![]);}catch(_0x4455a8){return BPromise[_0x3a69('0x21')](_0x4455a8);}return _0x114966['save']();};}function saveUpdates(_0x3f83b8,_0x161368){return function(_0x2cbd37){if(_0x2cbd37){return _0x2cbd37[_0x3a69('0x22')](_0x3f83b8)[_0x3a69('0x23')](function(_0x3490f8){return _0x3490f8;});}return null;};}function removeEntity(_0x4c65d6,_0x5f4ac9){return function(_0xe7c8b2){if(_0xe7c8b2){return _0xe7c8b2[_0x3a69('0x24')]()[_0x3a69('0x23')](function(){_0x4c65d6[_0x3a69('0x1e')](0xcc)[_0x3a69('0x25')]();});}};}function handleEntityNotFound(_0x2e5b50,_0x797fa1){return function(_0x294d7a){if(!_0x294d7a){_0x2e5b50[_0x3a69('0x18')](0x194);}return _0x294d7a;};}function handleError(_0x419d93,_0x3a0279){_0x3a0279=_0x3a0279||0x1f4;return function(_0x2d1a1a){logger['error'](_0x2d1a1a[_0x3a69('0x26')]);if(_0x2d1a1a[_0x3a69('0x27')]){delete _0x2d1a1a['name'];}_0x419d93[_0x3a69('0x1e')](_0x3a0279)[_0x3a69('0x28')](_0x2d1a1a);};}exports['index']=function(_0x428bff,_0x407301){var _0x26b86f={},_0x39927e={},_0x4e20c3={'count':0x0,'rows':[]};var _0x975ede=_['map'](db[_0x3a69('0x29')][_0x3a69('0x2a')],function(_0x487e3c){return{'name':_0x487e3c[_0x3a69('0x2b')],'type':_0x487e3c['type'][_0x3a69('0x2c')]};});_0x39927e[_0x3a69('0x2d')]=_[_0x3a69('0x2e')](_0x975ede,'name');_0x39927e[_0x3a69('0x2f')]=_['keys'](_0x428bff[_0x3a69('0x2f')]);_0x39927e['filters']=_[_0x3a69('0x30')](_0x39927e['model'],_0x39927e['query']);_0x26b86f[_0x3a69('0x31')]=_[_0x3a69('0x30')](_0x39927e['model'],qs[_0x3a69('0x32')](_0x428bff[_0x3a69('0x2f')]['fields']));_0x26b86f[_0x3a69('0x31')]=_0x26b86f[_0x3a69('0x31')][_0x3a69('0x33')]?_0x26b86f[_0x3a69('0x31')]:_0x39927e[_0x3a69('0x2d')];if(!_0x428bff[_0x3a69('0x2f')][_0x3a69('0x34')](_0x3a69('0x35'))){_0x26b86f[_0x3a69('0x1c')]=qs[_0x3a69('0x1c')](_0x428bff[_0x3a69('0x2f')][_0x3a69('0x1c')]);_0x26b86f[_0x3a69('0x1a')]=qs[_0x3a69('0x1a')](_0x428bff['query'][_0x3a69('0x1a')]);}_0x26b86f[_0x3a69('0x36')]=qs[_0x3a69('0x37')](_0x428bff['query']['sort']);_0x26b86f['where']=qs[_0x3a69('0x38')](_[_0x3a69('0x39')](_0x428bff['query'],_0x39927e[_0x3a69('0x38')]),_0x975ede);if(_0x428bff['query'][_0x3a69('0x3a')]){_0x26b86f['where']=_[_0x3a69('0x3b')](_0x26b86f[_0x3a69('0x3c')],{'$or':_[_0x3a69('0x2e')](_0x975ede,function(_0x211edd){if(_0x211edd[_0x3a69('0x3d')]!==_0x3a69('0x3e')){var _0x3e5062={};_0x3e5062[_0x211edd[_0x3a69('0x27')]]={'$like':'%'+_0x428bff[_0x3a69('0x2f')]['filter']+'%'};return _0x3e5062;}})});}_0x26b86f=_[_0x3a69('0x3b')]({},_0x26b86f,_0x428bff[_0x3a69('0x3f')]);var _0x1f81a2={'where':_0x26b86f[_0x3a69('0x3c')]};return db[_0x3a69('0x29')]['count'](_0x1f81a2)[_0x3a69('0x23')](function(_0x192225){_0x4e20c3['count']=_0x192225;if(_0x428bff[_0x3a69('0x2f')][_0x3a69('0x40')]){_0x26b86f['include']=[{'all':!![]}];}return db[_0x3a69('0x29')][_0x3a69('0x41')](_0x26b86f);})[_0x3a69('0x23')](function(_0x248ad5){_0x4e20c3[_0x3a69('0x42')]=_0x248ad5;return _0x4e20c3;})[_0x3a69('0x23')](respondWithFilteredResult(_0x407301,_0x26b86f))[_0x3a69('0x43')](handleError(_0x407301,null));};exports[_0x3a69('0x44')]=function(_0x5e8681,_0x5766f6){var _0x378977={'raw':!![],'where':{'id':_0x5e8681[_0x3a69('0x45')]['id']}},_0x2f2b49={};_0x2f2b49[_0x3a69('0x2d')]=_[_0x3a69('0x46')](db['CmHopperBlack'][_0x3a69('0x2a')]);_0x2f2b49[_0x3a69('0x2f')]=_[_0x3a69('0x46')](_0x5e8681['query']);_0x2f2b49[_0x3a69('0x38')]=_[_0x3a69('0x30')](_0x2f2b49['model'],_0x2f2b49[_0x3a69('0x2f')]);_0x378977['attributes']=_[_0x3a69('0x30')](_0x2f2b49[_0x3a69('0x2d')],qs[_0x3a69('0x32')](_0x5e8681[_0x3a69('0x2f')][_0x3a69('0x32')]));_0x378977[_0x3a69('0x31')]=_0x378977[_0x3a69('0x31')][_0x3a69('0x33')]?_0x378977['attributes']:_0x2f2b49[_0x3a69('0x2d')];if(_0x5e8681[_0x3a69('0x2f')][_0x3a69('0x40')]){_0x378977[_0x3a69('0x47')]=[{'all':!![]}];}_0x378977=_[_0x3a69('0x3b')]({},_0x378977,_0x5e8681['options']);return db['CmHopperBlack'][_0x3a69('0x48')](_0x378977)[_0x3a69('0x23')](handleEntityNotFound(_0x5766f6,null))[_0x3a69('0x23')](respondWithResult(_0x5766f6,null))['catch'](handleError(_0x5766f6,null));};exports[_0x3a69('0x22')]=function(_0x1c24e9,_0x5ec7de){if(_0x1c24e9[_0x3a69('0x49')]['id']){delete _0x1c24e9['body']['id'];}return db[_0x3a69('0x29')]['find']({'where':{'id':_0x1c24e9['params']['id']}})[_0x3a69('0x23')](handleEntityNotFound(_0x5ec7de,null))['then'](saveUpdates(_0x1c24e9[_0x3a69('0x49')],null))[_0x3a69('0x23')](respondWithResult(_0x5ec7de,null))[_0x3a69('0x43')](handleError(_0x5ec7de,null));};exports['destroy']=function(_0x178128,_0x202532){return db[_0x3a69('0x29')][_0x3a69('0x48')]({'where':{'id':_0x178128[_0x3a69('0x45')]['id']}})[_0x3a69('0x23')](handleEntityNotFound(_0x202532,null))[_0x3a69('0x23')](removeEntity(_0x202532,null))[_0x3a69('0x43')](handleError(_0x202532,null));};exports['describe']=function(_0x552420,_0x1eceab){return db[_0x3a69('0x29')]['describe']()[_0x3a69('0x23')](respondWithResult(_0x1eceab,null))['catch'](handleError(_0x1eceab,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index c76ef74..bcec0c8 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 _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 +var _0x2603=['moment','request-promise','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','lodash','util','../../config/logger'];(function(_0x4eb84e,_0x16f906){var _0x10f727=function(_0x3b28d8){while(--_0x3b28d8){_0x4eb84e['push'](_0x4eb84e['shift']());}};_0x10f727(++_0x16f906);}(_0x2603,0x10b));var _0x3260=function(_0x19776e,_0x3690de){_0x19776e=_0x19776e-0x0;var _0xce4b5f=_0x2603[_0x19776e];return _0xce4b5f;};'use strict';var _=require(_0x3260('0x0'));var util=require(_0x3260('0x1'));var logger=require(_0x3260('0x2'))('api');var moment=require(_0x3260('0x3'));var BPromise=require('bluebird');var rp=require(_0x3260('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3260('0x5'));var config=require(_0x3260('0x6'));var attributes=require(_0x3260('0x7'));module[_0x3260('0x8')]=function(_0x110609,_0x9a33fe){return _0x110609['define'](_0x3260('0x9'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 4f27975..f280999 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 _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 +var _0x0886=['util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetCmHopperBlack','findAll','options','where','limit','include','map','model','attributes','then','UpdateCmHopperBlack','update','raw','DestroyCmHopperBlack','CmHopperBlack','destroy'];(function(_0x297e02,_0x1c203e){var _0x54a202=function(_0x382fae){while(--_0x382fae){_0x297e02['push'](_0x297e02['shift']());}};_0x54a202(++_0x1c203e);}(_0x0886,0x118));var _0x6088=function(_0x5a6706,_0x1c0e48){_0x5a6706=_0x5a6706-0x0;var _0x540658=_0x0886[_0x5a6706];return _0x540658;};'use strict';var _=require('lodash');var util=require(_0x6088('0x0'));var moment=require(_0x6088('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6088('0x2'));var db=require(_0x6088('0x3'))['db'];var utils=require(_0x6088('0x4'));var logger=require('../../config/logger')(_0x6088('0x5'));var config=require('../../config/environment');var jayson=require(_0x6088('0x6'));var client=jayson[_0x6088('0x7')][_0x6088('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25ba94,_0x2386e6,_0x41d67d){return new BPromise(function(_0x13e883,_0x573a9e){return client['request'](_0x25ba94,_0x41d67d)['then'](function(_0x5f48b1){logger['info'](_0x6088('0x9'),_0x2386e6,_0x6088('0xa'));logger[_0x6088('0xb')](_0x6088('0xc'),_0x2386e6,_0x6088('0xa'),JSON[_0x6088('0xd')](_0x5f48b1));if(_0x5f48b1[_0x6088('0xe')]){if(_0x5f48b1[_0x6088('0xe')][_0x6088('0xf')]===0x1f4){logger[_0x6088('0xe')](_0x6088('0x9'),_0x2386e6,_0x5f48b1[_0x6088('0xe')][_0x6088('0x10')]);return _0x573a9e(_0x5f48b1[_0x6088('0xe')][_0x6088('0x10')]);}logger[_0x6088('0xe')](_0x6088('0x9'),_0x2386e6,_0x5f48b1['error'][_0x6088('0x10')]);return _0x13e883(_0x5f48b1[_0x6088('0xe')][_0x6088('0x10')]);}else{logger[_0x6088('0x11')](_0x6088('0x9'),_0x2386e6,'request\x20sent');_0x13e883(_0x5f48b1['result'][_0x6088('0x10')]);}})[_0x6088('0x12')](function(_0x1356b5){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x2386e6,_0x1356b5);_0x573a9e(_0x1356b5);});});}exports[_0x6088('0x13')]=function(_0x234c38){var _0x3c88a8=this;return new Promise(function(_0x4e1ec6,_0x1c1827){return db['CmHopperBlack'][_0x6088('0x14')]({'raw':_0x234c38[_0x6088('0x15')]?_0x234c38[_0x6088('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x234c38[_0x6088('0x15')]?_0x234c38[_0x6088('0x15')][_0x6088('0x16')]||null:null,'attributes':_0x234c38['options']?_0x234c38[_0x6088('0x15')]['attributes']||null:null,'limit':_0x234c38[_0x6088('0x15')]?_0x234c38['options'][_0x6088('0x17')]||null:null,'include':_0x234c38[_0x6088('0x15')]?_0x234c38[_0x6088('0x15')][_0x6088('0x18')]?_[_0x6088('0x19')](_0x234c38['options'][_0x6088('0x18')],function(_0x475e5d){return{'model':db[_0x475e5d[_0x6088('0x1a')]],'as':_0x475e5d['as'],'attributes':_0x475e5d[_0x6088('0x1b')],'include':_0x475e5d[_0x6088('0x18')]?_[_0x6088('0x19')](_0x475e5d[_0x6088('0x18')],function(_0x5d0f15){return{'model':db[_0x5d0f15['model']],'as':_0x5d0f15['as'],'attributes':_0x5d0f15[_0x6088('0x1b')],'include':_0x5d0f15[_0x6088('0x18')]?_[_0x6088('0x19')](_0x5d0f15['include'],function(_0x3871a1){return{'model':db[_0x3871a1['model']],'as':_0x3871a1['as'],'attributes':_0x3871a1[_0x6088('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6088('0x1c')](function(_0x51c679){logger[_0x6088('0x11')](_0x6088('0x13'),_0x234c38);logger[_0x6088('0xb')]('GetCmHopperBlack',_0x234c38,JSON['stringify'](_0x51c679));_0x4e1ec6(_0x51c679);})[_0x6088('0x12')](function(_0x48530c){logger[_0x6088('0xe')](_0x6088('0x13'),_0x48530c['message'],_0x234c38);_0x1c1827(_0x3c88a8[_0x6088('0xe')](0x1f4,_0x48530c[_0x6088('0x10')]));});});};exports[_0x6088('0x1d')]=function(_0x4a4113){var _0x26e06=this;return new Promise(function(_0x3e80fa,_0x4d624c){return db['CmHopperBlack'][_0x6088('0x1e')](_0x4a4113['body'],{'raw':_0x4a4113[_0x6088('0x15')]?_0x4a4113[_0x6088('0x15')][_0x6088('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a4113[_0x6088('0x15')]?_0x4a4113['options'][_0x6088('0x16')]||null:null,'attributes':_0x4a4113[_0x6088('0x15')]?_0x4a4113[_0x6088('0x15')][_0x6088('0x1b')]||null:null,'limit':_0x4a4113[_0x6088('0x15')]?_0x4a4113['options'][_0x6088('0x17')]||null:null})[_0x6088('0x1c')](function(_0x5087b7){logger['info'](_0x6088('0x1d'),_0x4a4113);logger[_0x6088('0xb')](_0x6088('0x1d'),_0x4a4113,JSON[_0x6088('0xd')](_0x5087b7));_0x3e80fa(_0x5087b7);})[_0x6088('0x12')](function(_0x2ea480){logger['error'](_0x6088('0x1d'),_0x2ea480['message'],_0x4a4113);_0x4d624c(_0x26e06[_0x6088('0xe')](0x1f4,_0x2ea480[_0x6088('0x10')]));});});};exports[_0x6088('0x20')]=function(_0xd0c3cd){var _0xdc3632=this;return new Promise(function(_0x13b169,_0x890a2d){return db[_0x6088('0x21')][_0x6088('0x22')]({'where':_0xd0c3cd[_0x6088('0x15')]?_0xd0c3cd['options'][_0x6088('0x16')]||null:null})[_0x6088('0x1c')](function(_0x1ff27d){logger[_0x6088('0x11')]('DestroyCmHopperBlack',_0xd0c3cd);logger['debug']('DestroyCmHopperBlack',_0xd0c3cd,JSON['stringify'](_0x1ff27d));_0x13b169(_0x1ff27d);})[_0x6088('0x12')](function(_0x4a631c){logger[_0x6088('0xe')](_0x6088('0x20'),_0x4a631c[_0x6088('0x10')],_0xd0c3cd);_0x890a2d(_0xdc3632[_0x6088('0xe')](0x1f4,_0x4a631c[_0x6088('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 01f1bf5..69692e3 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 _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 +var _0xfdbd=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','isAuthenticated','index','describe','get','show','put','/:id','update','delete','destroy'];(function(_0x3ab5bd,_0x56fbcf){var _0xe4109d=function(_0x36418b){while(--_0x36418b){_0x3ab5bd['push'](_0x3ab5bd['shift']());}};_0xe4109d(++_0x56fbcf);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x21a2b2,_0x22ba1e){_0x21a2b2=_0x21a2b2-0x0;var _0x2060b4=_0xfdbd[_0x21a2b2];return _0x2060b4;};'use strict';var multer=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var path=require(_0xdfdb('0x2'));var timeout=require(_0xdfdb('0x3'));var express=require(_0xdfdb('0x4'));var router=express[_0xdfdb('0x5')]();var fs_extra=require(_0xdfdb('0x6'));var auth=require(_0xdfdb('0x7'));var interaction=require(_0xdfdb('0x8'));var config=require('../../config/environment');var controller=require(_0xdfdb('0x9'));router['get']('/',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xdfdb('0xc')]);router[_0xdfdb('0xd')]('/:id',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0xe')]);router[_0xdfdb('0xf')](_0xdfdb('0x10'),auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x11')]);router[_0xdfdb('0x12')]('/:id',auth[_0xdfdb('0xa')](),controller[_0xdfdb('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 09a60cf..18cba59 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 _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 +var _0xc146=['seconds','BOOLEAN','sequelize','moment','STRING','INTEGER','DATE','setDataValue','followuptime'];(function(_0x1cf180,_0x280c42){var _0xbf4c9a=function(_0x5c3e4a){while(--_0x5c3e4a){_0x1cf180['push'](_0x1cf180['shift']());}};_0xbf4c9a(++_0x280c42);}(_0xc146,0x1b2));var _0x6c14=function(_0x2c7c8f,_0x1b6a0d){_0x2c7c8f=_0x2c7c8f-0x0;var _0x1a36ce=_0xc146[_0x2c7c8f];return _0x1a36ce;};'use strict';var Sequelize=require(_0x6c14('0x0'));var moment=require(_0x6c14('0x1'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x6c14('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6c14('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x6c14('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x6c14('0x2')]},'originatecalleridname':{'type':Sequelize[_0x6c14('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6c14('0x2')]},'starttime':{'type':Sequelize[_0x6c14('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x6c14('0x4')]},'droptime':{'type':Sequelize[_0x6c14('0x4')]},'endtime':{'type':Sequelize[_0x6c14('0x4')]},'ringtime':{'type':Sequelize[_0x6c14('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6c14('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6c14('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6c14('0x2')]},'campaign':{'type':Sequelize[_0x6c14('0x2')]},'campaigntype':{'type':Sequelize[_0x6c14('0x2')]},'membername':{'type':Sequelize[_0x6c14('0x2')]},'reason':{'type':Sequelize[_0x6c14('0x2')]},'disposition':{'type':Sequelize[_0x6c14('0x2')]},'secondDisposition':{'type':Sequelize[_0x6c14('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x6c14('0x4')],'set':function(_0x21ec9b){var _0xdca0db=this['getDataValue']('endtime');if(_0xdca0db&&_0x21ec9b){this[_0x6c14('0x5')](_0x6c14('0x6'),moment(_0x21ec9b)['diff'](moment(_0xdca0db),_0x6c14('0x7')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x6c14('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x6c14('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x6c14('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x6c14('0x4')]},'callback':{'type':Sequelize[_0x6c14('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6c14('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6c14('0x4')]},'deleted':{'type':Sequelize[_0x6c14('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x6c14('0x4')]},'recallme':{'type':Sequelize[_0x6c14('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x6c14('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x6c14('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6c14('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6c14('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6c14('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6c14('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 1e714a0..e8bac8a 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 _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 +var _0x6d38=['calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','stack','name','send','index','map','CmHopperFinal','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','keys','filters','intersection','describe','catch','body','uniqueid','find','params','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','busyContacts','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','moveContactsQueueCampaignHopperFinal','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','from','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','Campaign','cm_hopper','CampaignId','ANY_VALUE(ListId)','CampaignId\x20=\x20?','state'];(function(_0x336de0,_0x50b920){var _0x4872f7=function(_0x3ae566){while(--_0x3ae566){_0x336de0['push'](_0x336de0['shift']());}};_0x4872f7(++_0x50b920);}(_0x6d38,0x1ef));var _0x86d3=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x6d38[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];function respondWithStatusCode(_0x7d4d2e,_0x440a55){_0x440a55=_0x440a55||0xcc;return function(_0x26d64c){if(_0x26d64c){return _0x7d4d2e[_0x86d3('0x14')](_0x440a55);}return _0x7d4d2e[_0x86d3('0x15')](_0x440a55)[_0x86d3('0x16')]();};}function respondWithResult(_0x12ef4a,_0x5ce2ff){_0x5ce2ff=_0x5ce2ff||0xc8;return function(_0x1c1ba8){if(_0x1c1ba8){return _0x12ef4a[_0x86d3('0x15')](_0x5ce2ff)[_0x86d3('0x17')](_0x1c1ba8);}};}function respondWithFilteredResult(_0x207f6f,_0x1ea535){return function(_0x34fb3b){if(_0x34fb3b){var _0x1ff008=typeof _0x1ea535[_0x86d3('0x18')]==='undefined'&&typeof _0x1ea535[_0x86d3('0x19')]===_0x86d3('0x1a');var _0x431b3f=_0x34fb3b[_0x86d3('0x1b')];var _0x46feec=_0x1ff008?0x0:_0x1ea535[_0x86d3('0x18')];var _0x33e459=_0x1ff008?_0x34fb3b[_0x86d3('0x1b')]:_0x1ea535[_0x86d3('0x18')]+_0x1ea535['limit'];var _0x191ba5;if(_0x33e459>=_0x431b3f){_0x33e459=_0x431b3f;_0x191ba5=0xc8;}else{_0x191ba5=0xce;}_0x207f6f['status'](_0x191ba5);return _0x207f6f[_0x86d3('0x1c')]('Content-Range',_0x46feec+'-'+_0x33e459+'/'+_0x431b3f)['json'](_0x34fb3b);}return null;};}function patchUpdates(_0x41486a){return function(_0x1edb6d){try{jsonpatch[_0x86d3('0x1d')](_0x1edb6d,_0x41486a,!![]);}catch(_0x1720ae){return BPromise['reject'](_0x1720ae);}return _0x1edb6d[_0x86d3('0x1e')]();};}function saveUpdates(_0x55e1c3,_0x36e0fa){return function(_0x3fdf67){if(_0x3fdf67){return _0x3fdf67[_0x86d3('0x1f')](_0x55e1c3)['then'](function(_0x39d819){return _0x39d819;});}return null;};}function removeEntity(_0x72b3d4,_0x1fa4ac){return function(_0x4bf5b8){if(_0x4bf5b8){return _0x4bf5b8['destroy']()[_0x86d3('0x20')](function(){_0x72b3d4['status'](0xcc)[_0x86d3('0x16')]();});}};}function handleEntityNotFound(_0x1bea5e,_0x3dfecd){return function(_0x3c5fe4){if(!_0x3c5fe4){_0x1bea5e['sendStatus'](0x194);}return _0x3c5fe4;};}function handleError(_0x481077,_0x3359e4){_0x3359e4=_0x3359e4||0x1f4;return function(_0x611764){logger['error'](_0x611764[_0x86d3('0x21')]);if(_0x611764['name']){delete _0x611764[_0x86d3('0x22')];}_0x481077[_0x86d3('0x15')](_0x3359e4)[_0x86d3('0x23')](_0x611764);};}exports[_0x86d3('0x24')]=function(_0x11a6fd,_0x14c9ff){var _0x1f203e={},_0x35d708={},_0x303f13={'count':0x0,'rows':[]};var _0x44dacf=_[_0x86d3('0x25')](db[_0x86d3('0x26')][_0x86d3('0x27')],function(_0x28c25e){return{'name':_0x28c25e['fieldName'],'type':_0x28c25e[_0x86d3('0x28')][_0x86d3('0x29')]};});_0x35d708[_0x86d3('0x2a')]=_[_0x86d3('0x25')](_0x44dacf,_0x86d3('0x22'));_0x35d708[_0x86d3('0x2b')]=_['keys'](_0x11a6fd[_0x86d3('0x2b')]);_0x35d708['filters']=_['intersection'](_0x35d708[_0x86d3('0x2a')],_0x35d708[_0x86d3('0x2b')]);_0x1f203e[_0x86d3('0x2c')]=_['intersection'](_0x35d708[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x11a6fd['query'][_0x86d3('0x2d')]));_0x1f203e[_0x86d3('0x2c')]=_0x1f203e[_0x86d3('0x2c')][_0x86d3('0x2e')]?_0x1f203e[_0x86d3('0x2c')]:_0x35d708[_0x86d3('0x2a')];if(!_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x2f')]('nolimit')){_0x1f203e['limit']=qs['limit'](_0x11a6fd[_0x86d3('0x2b')]['limit']);_0x1f203e[_0x86d3('0x18')]=qs['offset'](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x18')]);}_0x1f203e[_0x86d3('0x30')]=qs[_0x86d3('0x31')](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x31')]);_0x1f203e[_0x86d3('0x32')]=qs['filters'](_[_0x86d3('0x33')](_0x11a6fd[_0x86d3('0x2b')],_0x35d708['filters']),_0x44dacf);if(_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]){_0x1f203e[_0x86d3('0x32')]=_[_0x86d3('0x35')](_0x1f203e['where'],{'$or':_[_0x86d3('0x25')](_0x44dacf,function(_0x42ac0d){if(_0x42ac0d[_0x86d3('0x28')]!=='VIRTUAL'){var _0x5762ca={};_0x5762ca[_0x42ac0d[_0x86d3('0x22')]]={'$like':'%'+_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]+'%'};return _0x5762ca;}})});}_0x1f203e=_[_0x86d3('0x35')]({},_0x1f203e,_0x11a6fd[_0x86d3('0x36')]);var _0x3666fc={'where':_0x1f203e[_0x86d3('0x32')]};return db['CmHopperFinal'][_0x86d3('0x1b')](_0x3666fc)[_0x86d3('0x20')](function(_0x2bdc67){_0x303f13[_0x86d3('0x1b')]=_0x2bdc67;if(_0x11a6fd['query'][_0x86d3('0x37')]){_0x1f203e[_0x86d3('0x38')]=[{'all':!![]}];}return db[_0x86d3('0x26')][_0x86d3('0x39')](_0x1f203e);})['then'](function(_0x587747){_0x303f13[_0x86d3('0x3a')]=_0x587747;return _0x303f13;})['then'](respondWithFilteredResult(_0x14c9ff,_0x1f203e))['catch'](handleError(_0x14c9ff,null));};exports[_0x86d3('0x3b')]=function(_0x1385fc,_0x43490a){var _0x35d6fe={'raw':!![],'where':{'id':_0x1385fc['params']['id']}},_0x23ef72={};_0x23ef72[_0x86d3('0x2a')]=_[_0x86d3('0x3c')](db[_0x86d3('0x26')]['rawAttributes']);_0x23ef72[_0x86d3('0x2b')]=_[_0x86d3('0x3c')](_0x1385fc['query']);_0x23ef72[_0x86d3('0x3d')]=_[_0x86d3('0x3e')](_0x23ef72['model'],_0x23ef72['query']);_0x35d6fe['attributes']=_[_0x86d3('0x3e')](_0x23ef72[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x2d')]));_0x35d6fe[_0x86d3('0x2c')]=_0x35d6fe['attributes'][_0x86d3('0x2e')]?_0x35d6fe[_0x86d3('0x2c')]:_0x23ef72['model'];if(_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x37')]){_0x35d6fe[_0x86d3('0x38')]=[{'all':!![]}];}_0x35d6fe=_[_0x86d3('0x35')]({},_0x35d6fe,_0x1385fc[_0x86d3('0x36')]);return db[_0x86d3('0x26')]['find'](_0x35d6fe)[_0x86d3('0x20')](handleEntityNotFound(_0x43490a,null))[_0x86d3('0x20')](respondWithResult(_0x43490a,null))['catch'](handleError(_0x43490a,null));};exports[_0x86d3('0x3f')]=function(_0x412d0e,_0xd20863){return db[_0x86d3('0x26')][_0x86d3('0x3f')]()['then'](respondWithResult(_0xd20863,null))[_0x86d3('0x40')](handleError(_0xd20863,null));};exports[_0x86d3('0x1f')]=function(_0x3226b5,_0x14fa58){if(_0x3226b5[_0x86d3('0x41')][_0x86d3('0x42')]){delete _0x3226b5[_0x86d3('0x41')][_0x86d3('0x42')];}return db[_0x86d3('0x26')][_0x86d3('0x43')]({'where':{'uniqueid':_0x3226b5[_0x86d3('0x44')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x14fa58,null))['then'](saveUpdates(_0x3226b5[_0x86d3('0x41')],null))[_0x86d3('0x20')](respondWithResult(_0x14fa58,null))['catch'](handleError(_0x14fa58,null));};exports[_0x86d3('0x45')]=function(_0x23a6ee,_0x197047,_0x2e9af5){return db[_0x86d3('0x26')][_0x86d3('0x39')]({'raw':![],'where':{'VoiceQueueId':_0x23a6ee['params']['id']},'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x48')))),_0x86d3('0x49')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db['sequelize'][_0x86d3('0x47')](_0x86d3('0x4b')))),_0x86d3('0x4c')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')]['literal'](_0x86d3('0x4d')))),'busyContacts'],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')]('`state`\x20=\x208,\x201,\x20null'))),_0x86d3('0x4e')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x86d3('0x4f')))),'dropContacts'],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x50')))),_0x86d3('0x51')],[db[_0x86d3('0x46')]['fn']('COUNT',db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x52')))),'answeringMachine']]})[_0x86d3('0x20')](handleEntityNotFound(_0x197047,null))[_0x86d3('0x20')](respondWithResult(_0x197047,null))['catch'](handleError(_0x197047,null));};exports[_0x86d3('0x53')]=function(_0x416428,_0x15cdd0,_0x29bdee){return db[_0x86d3('0x26')][_0x86d3('0x39')]({'raw':![],'where':{'CampaignId':_0x416428[_0x86d3('0x44')]['id']},'attributes':[[db['sequelize']['fn']('COUNT',db[_0x86d3('0x46')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x86d3('0x49')],[db['sequelize']['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x4b')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x4d')))),_0x86d3('0x54')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x55')))),_0x86d3('0x4e')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x86d3('0x56')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x57')))),_0x86d3('0x58')],[db['sequelize']['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x50')))),_0x86d3('0x51')],[db[_0x86d3('0x46')]['fn']('COUNT',db[_0x86d3('0x46')]['fn']('IF',db['sequelize'][_0x86d3('0x47')](_0x86d3('0x52')))),'answeringMachine']]})[_0x86d3('0x20')](handleEntityNotFound(_0x15cdd0,null))[_0x86d3('0x20')](respondWithResult(_0x15cdd0,null))[_0x86d3('0x40')](handleError(_0x15cdd0,null));};exports[_0x86d3('0x59')]=function(_0x308fed,_0x1c966a,_0x379799){return db['VoiceQueue'][_0x86d3('0x43')]({'where':{'id':_0x308fed[_0x86d3('0x44')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x1c966a,null))[_0x86d3('0x20')](function(_0x46e356){var _0x47f72e;if(_0x46e356){_0x47f72e=squel[_0x86d3('0x5a')]()[_0x86d3('0x5b')]('cm_hopper')[_0x86d3('0x5c')]([_0x86d3('0x5d'),_0x86d3('0x5e'),_0x86d3('0x5f'),_0x86d3('0x60'),_0x86d3('0x61'),_0x86d3('0x62'),_0x86d3('0x63')],squel[_0x86d3('0x64')]()[_0x86d3('0x65')](_0x86d3('0x66'),_0x86d3('0x5d'))[_0x86d3('0x65')](_0x86d3('0x67'),'scheduledAt')[_0x86d3('0x65')](_0x86d3('0x68'),_0x86d3('0x5f'))[_0x86d3('0x65')]('ANY_VALUE(ListId)',_0x86d3('0x60'))[_0x86d3('0x65')](_0x86d3('0x69'),_0x86d3('0x61'))['field']('NOW()',_0x86d3('0x62'))['field'](_0x86d3('0x67'),'updatedAt')['from'](_0x86d3('0x6a'))[_0x86d3('0x32')](_0x86d3('0x6b'),_0x308fed[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]())['where'](_0x86d3('0x6d'),_0x308fed[_0x86d3('0x41')]['state'][_0x86d3('0x6c')]())[_0x86d3('0x32')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x86d3('0x32')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x86d3('0x64')]()['field']('phone')[_0x86d3('0x6e')]('cm_hopper')[_0x86d3('0x32')](_0x86d3('0x6b'),_0x308fed[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]()))[_0x86d3('0x32')](_0x86d3('0x6f'),squel[_0x86d3('0x64')]()[_0x86d3('0x65')]('calleridnum')[_0x86d3('0x6e')](_0x86d3('0x6a'))[_0x86d3('0x32')](_0x86d3('0x6b'),_0x308fed[_0x86d3('0x44')]['id']['toString']())[_0x86d3('0x32')](_0x86d3('0x70')))[_0x86d3('0x71')](_0x86d3('0x5f')))[_0x86d3('0x6c')]();return db[_0x86d3('0x46')][_0x86d3('0x2b')](_0x47f72e);}return[];})['then'](respondWithResult(_0x1c966a,null))[_0x86d3('0x40')](handleError(_0x1c966a,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0xca2e0,_0x596b1d,_0x5a22ca){return db[_0x86d3('0x72')][_0x86d3('0x43')]({'where':{'id':_0xca2e0['params']['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x596b1d,null))[_0x86d3('0x20')](function(_0x879a8b){var _0x1c1384;if(_0x879a8b){_0x1c1384=squel[_0x86d3('0x5a')]()[_0x86d3('0x5b')](_0x86d3('0x73'))['fromQuery'](['phone',_0x86d3('0x5e'),_0x86d3('0x5f'),_0x86d3('0x60'),_0x86d3('0x74'),_0x86d3('0x62'),_0x86d3('0x63')],squel['select']()[_0x86d3('0x65')](_0x86d3('0x66'),_0x86d3('0x5d'))[_0x86d3('0x65')](_0x86d3('0x67'),_0x86d3('0x5e'))[_0x86d3('0x65')](_0x86d3('0x68'),_0x86d3('0x5f'))['field'](_0x86d3('0x75'),_0x86d3('0x60'))['field']('ANY_VALUE(CampaignId)',_0x86d3('0x74'))[_0x86d3('0x65')](_0x86d3('0x67'),'createdAt')[_0x86d3('0x65')](_0x86d3('0x67'),_0x86d3('0x63'))[_0x86d3('0x6e')](_0x86d3('0x6a'))['where'](_0x86d3('0x76'),_0xca2e0[_0x86d3('0x44')]['id']['toString']())[_0x86d3('0x32')](_0x86d3('0x6d'),_0xca2e0[_0x86d3('0x41')][_0x86d3('0x77')]['toString']())[_0x86d3('0x32')](_0x86d3('0x78'))[_0x86d3('0x32')](_0x86d3('0x6f'),squel[_0x86d3('0x64')]()['field'](_0x86d3('0x5d'))[_0x86d3('0x6e')](_0x86d3('0x73'))[_0x86d3('0x32')](_0x86d3('0x76'),_0xca2e0[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]()))[_0x86d3('0x32')](_0x86d3('0x6f'),squel[_0x86d3('0x64')]()['field']('calleridnum')[_0x86d3('0x6e')](_0x86d3('0x6a'))['where'](_0x86d3('0x76'),_0xca2e0[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]())[_0x86d3('0x32')](_0x86d3('0x70')))[_0x86d3('0x71')](_0x86d3('0x5f')))[_0x86d3('0x6c')]();return db[_0x86d3('0x46')]['query'](_0x1c1384);}return[];})['then'](respondWithResult(_0x596b1d,null))['catch'](handleError(_0x596b1d,null));};exports['checkContactHopper']=function(_0xad83bf,_0x2514c1,_0x28a509){return db[_0x86d3('0x79')][_0x86d3('0x7a')]({'where':{'VoiceQueueId':_0xad83bf[_0x86d3('0x41')][_0x86d3('0x61')],'CampaignId':_0xad83bf['body'][_0x86d3('0x74')],'ContactId':_0xad83bf[_0x86d3('0x41')][_0x86d3('0x5f')]}})[_0x86d3('0x20')](handleEntityNotFound(_0x2514c1,null))['then'](function(_0xe239b5){if(_0xe239b5){return _0xe239b5;}return null;})['then'](respondWithResult(_0x2514c1,null))[_0x86d3('0x40')](handleError(_0x2514c1,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index a666b6f..cdea724 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 _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 +var _0x1291=['moment','rimraf','define','CmHopperFinal','calleridnum','uniqueid','util','api'];(function(_0x5e73da,_0x2641a8){var _0x5646cb=function(_0x46f9e5){while(--_0x46f9e5){_0x5e73da['push'](_0x5e73da['shift']());}};_0x5646cb(++_0x2641a8);}(_0x1291,0x166));var _0x1129=function(_0x37fdb5,_0x1314c4){_0x37fdb5=_0x37fdb5-0x0;var _0x2f3eef=_0x1291[_0x37fdb5];return _0x2f3eef;};'use strict';var _=require('lodash');var util=require(_0x1129('0x0'));var logger=require('../../config/logger')(_0x1129('0x1'));var moment=require(_0x1129('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1129('0x3'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x131f76,_0x706171){return _0x131f76[_0x1129('0x4')](_0x1129('0x5'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x1129('0x6'),'fields':[_0x1129('0x6')]},{'name':_0x1129('0x7'),'fields':[_0x1129('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 18ca4e4..0592b1e 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(_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 +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3de0ed,_0x1fe64d){var _0x2f9eb8=function(_0x272c5b){while(--_0x272c5b){_0x3de0ed['push'](_0x3de0ed['shift']());}};_0x2f9eb8(++_0x1fe64d);}(_0x7a54,0x106));var _0x47a5=function(_0x3a5c41,_0x583b06){_0x3a5c41=_0x3a5c41-0x0;var _0x296301=_0x7a54[_0x3a5c41];return _0x296301;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 1fcf64e..c5b0376 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 _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 +var _0x4698=['/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperFinal.controller','isAuthenticated','get','/describe','describe','/:id','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post'];(function(_0x23eb8c,_0x5618e8){var _0x4978ba=function(_0x1512ed){while(--_0x1512ed){_0x23eb8c['push'](_0x23eb8c['shift']());}};_0x4978ba(++_0x5618e8);}(_0x4698,0x8a));var _0x8469=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x4698[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x8469('0x0'));var util=require(_0x8469('0x1'));var path=require('path');var timeout=require(_0x8469('0x2'));var express=require(_0x8469('0x3'));var router=express[_0x8469('0x4')]();var fs_extra=require(_0x8469('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8469('0x6'));var config=require('../../config/environment');var controller=require(_0x8469('0x7'));router['get']('/',auth[_0x8469('0x8')](),controller['index']);router[_0x8469('0x9')](_0x8469('0xa'),auth[_0x8469('0x8')](),controller[_0x8469('0xb')]);router[_0x8469('0x9')](_0x8469('0xc'),auth[_0x8469('0x8')](),controller[_0x8469('0xd')]);router[_0x8469('0x9')]('/voice/queue/countAttributes/:id',auth[_0x8469('0x8')](),controller[_0x8469('0xe')]);router[_0x8469('0x9')](_0x8469('0xf'),auth[_0x8469('0x8')](),controller[_0x8469('0x10')]);router[_0x8469('0x11')](_0x8469('0x12'),auth['isAuthenticated'](),controller[_0x8469('0x13')]);router[_0x8469('0x11')](_0x8469('0x14'),auth[_0x8469('0x8')](),controller[_0x8469('0x15')]);router[_0x8469('0x11')](_0x8469('0x16'),auth['isAuthenticated'](),controller[_0x8469('0x17')]);router[_0x8469('0x18')](_0x8469('0xc'),auth[_0x8469('0x8')](),controller['update']);module[_0x8469('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index bd52e1d..b5b706a 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 _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 +var _0x7989=['DATE','BOOLEAN','INTEGER','STRING'];(function(_0x206338,_0x2d800b){var _0x2b87f2=function(_0x436c1c){while(--_0x436c1c){_0x206338['push'](_0x206338['shift']());}};_0x2b87f2(++_0x2d800b);}(_0x7989,0x82));var _0x9798=function(_0x595e7b,_0x32000d){_0x595e7b=_0x595e7b-0x0;var _0x330302=_0x7989[_0x595e7b];return _0x330302;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x9798('0x0')](0x2)},'statedesc':{'type':Sequelize[_0x9798('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x9798('0x0')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9798('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9798('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9798('0x1')]},'originatecalleridnum':{'type':Sequelize[_0x9798('0x1')]},'originatecalleridname':{'type':Sequelize[_0x9798('0x1')]},'calleridnum':{'type':Sequelize[_0x9798('0x1')]},'calleridname':{'type':Sequelize[_0x9798('0x1')]},'starttime':{'type':Sequelize[_0x9798('0x2')]},'responsetime':{'type':Sequelize[_0x9798('0x2')]},'answertime':{'type':Sequelize[_0x9798('0x2')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x9798('0x2')]},'ringtime':{'type':Sequelize[_0x9798('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x9798('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9798('0x1')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x9798('0x1')]},'membername':{'type':Sequelize[_0x9798('0x1')]},'reason':{'type':Sequelize[_0x9798('0x1')]},'amd':{'type':Sequelize[_0x9798('0x3')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9798('0x3')],'defaultValue':![]},'callback':{'type':Sequelize[_0x9798('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9798('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9798('0x2')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x9798('0x2')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9798('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9798('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9798('0x0')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9798('0x0')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index f8f026e..f902fcf 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 _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 +var _0x7d85=['pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','rows','catch','keys','CmHopperHistory','create','body','describe','uniqueid','find','params','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x20d7b2,_0x1cd564){var _0x483991=function(_0x1405b4){while(--_0x1405b4){_0x20d7b2['push'](_0x20d7b2['shift']());}};_0x483991(++_0x1cd564);}(_0x7d85,0xf7));var _0x57d8=function(_0x1c6abe,_0x5bedb0){_0x1c6abe=_0x1c6abe-0x0;var _0x546015=_0x7d85[_0x1c6abe];return _0x546015;};'use strict';var emlformat=require(_0x57d8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x57d8('0x1'));var moment=require(_0x57d8('0x2'));var BPromise=require(_0x57d8('0x3'));var Mustache=require(_0x57d8('0x4'));var util=require(_0x57d8('0x5'));var path=require(_0x57d8('0x6'));var sox=require(_0x57d8('0x7'));var csv=require(_0x57d8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x57d8('0x9'));var _=require('lodash');var squel=require(_0x57d8('0xa'));var crypto=require(_0x57d8('0xb'));var jsforce=require(_0x57d8('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x57d8('0xd'));var Redis=require(_0x57d8('0xe'));var authService=require(_0x57d8('0xf'));var qs=require(_0x57d8('0x10'));var as=require(_0x57d8('0x11'));var hardwareService=require(_0x57d8('0x12'));var logger=require(_0x57d8('0x13'))(_0x57d8('0x14'));var utils=require(_0x57d8('0x15'));var config=require(_0x57d8('0x16'));var licenseUtil=require(_0x57d8('0x17'));var db=require(_0x57d8('0x18'))['db'];function respondWithStatusCode(_0x5e02fd,_0x9dfdc3){_0x9dfdc3=_0x9dfdc3||0xcc;return function(_0x56a9b6){if(_0x56a9b6){return _0x5e02fd[_0x57d8('0x19')](_0x9dfdc3);}return _0x5e02fd[_0x57d8('0x1a')](_0x9dfdc3)[_0x57d8('0x1b')]();};}function respondWithResult(_0x523822,_0x471fa5){_0x471fa5=_0x471fa5||0xc8;return function(_0x3abca6){if(_0x3abca6){return _0x523822[_0x57d8('0x1a')](_0x471fa5)[_0x57d8('0x1c')](_0x3abca6);}};}function respondWithFilteredResult(_0x16a518,_0x5409ed){return function(_0x932eee){if(_0x932eee){var _0x11bf08=typeof _0x5409ed[_0x57d8('0x1d')]===_0x57d8('0x1e')&&typeof _0x5409ed[_0x57d8('0x1f')]===_0x57d8('0x1e');var _0x3d8f53=_0x932eee[_0x57d8('0x20')];var _0x298fd0=_0x11bf08?0x0:_0x5409ed['offset'];var _0x52dda7=_0x11bf08?_0x932eee[_0x57d8('0x20')]:_0x5409ed[_0x57d8('0x1d')]+_0x5409ed[_0x57d8('0x1f')];var _0x1c4fef;if(_0x52dda7>=_0x3d8f53){_0x52dda7=_0x3d8f53;_0x1c4fef=0xc8;}else{_0x1c4fef=0xce;}_0x16a518[_0x57d8('0x1a')](_0x1c4fef);return _0x16a518['set'](_0x57d8('0x21'),_0x298fd0+'-'+_0x52dda7+'/'+_0x3d8f53)[_0x57d8('0x1c')](_0x932eee);}return null;};}function patchUpdates(_0x35cc77){return function(_0x5eae6e){try{jsonpatch[_0x57d8('0x22')](_0x5eae6e,_0x35cc77,!![]);}catch(_0x334e6a){return BPromise['reject'](_0x334e6a);}return _0x5eae6e[_0x57d8('0x23')]();};}function saveUpdates(_0x1a6a66,_0x457fae){return function(_0x54a413){if(_0x54a413){return _0x54a413[_0x57d8('0x24')](_0x1a6a66)['then'](function(_0x2a8881){return _0x2a8881;});}return null;};}function removeEntity(_0x54453f,_0x573403){return function(_0x5de0e1){if(_0x5de0e1){return _0x5de0e1[_0x57d8('0x25')]()['then'](function(){_0x54453f[_0x57d8('0x1a')](0xcc)[_0x57d8('0x1b')]();});}};}function handleEntityNotFound(_0x5a97df,_0x43c2eb){return function(_0x54b118){if(!_0x54b118){_0x5a97df[_0x57d8('0x19')](0x194);}return _0x54b118;};}function handleError(_0x13683b,_0x2876bb){_0x2876bb=_0x2876bb||0x1f4;return function(_0x38ba2b){logger[_0x57d8('0x26')](_0x38ba2b[_0x57d8('0x27')]);if(_0x38ba2b['name']){delete _0x38ba2b[_0x57d8('0x28')];}_0x13683b[_0x57d8('0x1a')](_0x2876bb)[_0x57d8('0x29')](_0x38ba2b);};}exports['index']=function(_0x4e3382,_0x529768){var _0x1039c3={},_0x310203={},_0x445182={'count':0x0,'rows':[]};var _0x1ccad4=_[_0x57d8('0x2a')](db['CmHopperHistory'][_0x57d8('0x2b')],function(_0xcac314){return{'name':_0xcac314[_0x57d8('0x2c')],'type':_0xcac314[_0x57d8('0x2d')][_0x57d8('0x2e')]};});_0x310203['model']=_[_0x57d8('0x2a')](_0x1ccad4,'name');_0x310203[_0x57d8('0x2f')]=_['keys'](_0x4e3382['query']);_0x310203[_0x57d8('0x30')]=_[_0x57d8('0x31')](_0x310203['model'],_0x310203['query']);_0x1039c3[_0x57d8('0x32')]=_[_0x57d8('0x31')](_0x310203[_0x57d8('0x33')],qs[_0x57d8('0x34')](_0x4e3382[_0x57d8('0x2f')]['fields']));_0x1039c3[_0x57d8('0x32')]=_0x1039c3[_0x57d8('0x32')][_0x57d8('0x35')]?_0x1039c3[_0x57d8('0x32')]:_0x310203[_0x57d8('0x33')];if(!_0x4e3382['query'][_0x57d8('0x36')](_0x57d8('0x37'))){_0x1039c3[_0x57d8('0x1f')]=qs[_0x57d8('0x1f')](_0x4e3382[_0x57d8('0x2f')]['limit']);_0x1039c3[_0x57d8('0x1d')]=qs[_0x57d8('0x1d')](_0x4e3382[_0x57d8('0x2f')]['offset']);}_0x1039c3['order']=qs[_0x57d8('0x38')](_0x4e3382['query']['sort']);_0x1039c3['where']=qs[_0x57d8('0x30')](_[_0x57d8('0x39')](_0x4e3382[_0x57d8('0x2f')],_0x310203[_0x57d8('0x30')]),_0x1ccad4);if(_0x4e3382['query'][_0x57d8('0x3a')]){_0x1039c3[_0x57d8('0x3b')]=_[_0x57d8('0x3c')](_0x1039c3['where'],{'$or':_[_0x57d8('0x2a')](_0x1ccad4,function(_0x242a82){if(_0x242a82[_0x57d8('0x2d')]!==_0x57d8('0x3d')){var _0x1eab3d={};_0x1eab3d[_0x242a82[_0x57d8('0x28')]]={'$like':'%'+_0x4e3382['query'][_0x57d8('0x3a')]+'%'};return _0x1eab3d;}})});}_0x1039c3=_['merge']({},_0x1039c3,_0x4e3382[_0x57d8('0x3e')]);var _0x11b30a={'where':_0x1039c3['where']};return db['CmHopperHistory'][_0x57d8('0x20')](_0x11b30a)[_0x57d8('0x3f')](function(_0x1bfd18){_0x445182[_0x57d8('0x20')]=_0x1bfd18;if(_0x4e3382[_0x57d8('0x2f')][_0x57d8('0x40')]){_0x1039c3[_0x57d8('0x41')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x1039c3);})['then'](function(_0x1e7a95){_0x445182[_0x57d8('0x42')]=_0x1e7a95;return _0x445182;})[_0x57d8('0x3f')](respondWithFilteredResult(_0x529768,_0x1039c3))[_0x57d8('0x43')](handleError(_0x529768,null));};exports['show']=function(_0x4f3fe0,_0x3fc5fb){var _0x53eff8={'raw':!![],'where':{'id':_0x4f3fe0['params']['id']}},_0xc386={};_0xc386[_0x57d8('0x33')]=_[_0x57d8('0x44')](db[_0x57d8('0x45')][_0x57d8('0x2b')]);_0xc386[_0x57d8('0x2f')]=_['keys'](_0x4f3fe0[_0x57d8('0x2f')]);_0xc386[_0x57d8('0x30')]=_[_0x57d8('0x31')](_0xc386['model'],_0xc386[_0x57d8('0x2f')]);_0x53eff8[_0x57d8('0x32')]=_['intersection'](_0xc386[_0x57d8('0x33')],qs['fields'](_0x4f3fe0[_0x57d8('0x2f')]['fields']));_0x53eff8[_0x57d8('0x32')]=_0x53eff8['attributes'][_0x57d8('0x35')]?_0x53eff8[_0x57d8('0x32')]:_0xc386[_0x57d8('0x33')];if(_0x4f3fe0[_0x57d8('0x2f')][_0x57d8('0x40')]){_0x53eff8['include']=[{'all':!![]}];}_0x53eff8=_[_0x57d8('0x3c')]({},_0x53eff8,_0x4f3fe0[_0x57d8('0x3e')]);return db['CmHopperHistory']['find'](_0x53eff8)['then'](handleEntityNotFound(_0x3fc5fb,null))[_0x57d8('0x3f')](respondWithResult(_0x3fc5fb,null))['catch'](handleError(_0x3fc5fb,null));};exports[_0x57d8('0x46')]=function(_0xb5efe,_0x39f5fb){return db[_0x57d8('0x45')][_0x57d8('0x46')](_0xb5efe[_0x57d8('0x47')],{})['then'](respondWithResult(_0x39f5fb,0xc9))[_0x57d8('0x43')](handleError(_0x39f5fb,null));};exports[_0x57d8('0x48')]=function(_0x1b7d54,_0xe4e79f){return db[_0x57d8('0x45')][_0x57d8('0x48')]()['then'](respondWithResult(_0xe4e79f,null))[_0x57d8('0x43')](handleError(_0xe4e79f,null));};exports['update']=function(_0x249055,_0x59cc19){if(_0x249055[_0x57d8('0x47')][_0x57d8('0x49')]){delete _0x249055[_0x57d8('0x47')][_0x57d8('0x49')];}return db[_0x57d8('0x45')][_0x57d8('0x4a')]({'where':{'uniqueid':_0x249055[_0x57d8('0x4b')]['id']}})[_0x57d8('0x3f')](handleEntityNotFound(_0x59cc19,null))[_0x57d8('0x3f')](saveUpdates(_0x249055['body'],null))[_0x57d8('0x3f')](respondWithResult(_0x59cc19,null))[_0x57d8('0x43')](handleError(_0x59cc19,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 18afdd4..5427f01 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 _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 +var _0x7374=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','CmHopperHistory','endtime','uniqueid','lodash'];(function(_0x5c2e65,_0x20e630){var _0x445359=function(_0x2588d4){while(--_0x2588d4){_0x5c2e65['push'](_0x5c2e65['shift']());}};_0x445359(++_0x20e630);}(_0x7374,0x1b9));var _0x4737=function(_0x2af077,_0x1df2ce){_0x2af077=_0x2af077-0x0;var _0x128d43=_0x7374[_0x2af077];return _0x128d43;};'use strict';var _=require(_0x4737('0x0'));var util=require(_0x4737('0x1'));var logger=require(_0x4737('0x2'))(_0x4737('0x3'));var moment=require(_0x4737('0x4'));var BPromise=require('bluebird');var rp=require(_0x4737('0x5'));var fs=require('fs');var path=require(_0x4737('0x6'));var rimraf=require(_0x4737('0x7'));var config=require(_0x4737('0x8'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x162bf0,_0xc35930){return _0x162bf0[_0x4737('0x9')](_0x4737('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x4737('0xb'),'fields':[_0x4737('0xb')]},{'name':_0x4737('0xc'),'fields':[_0x4737('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 3dd065a..e8b02cf 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 _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 +var _0x3238=['info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateCmHopperHistory','CmHopperHistory','body','options','raw','catch','AvgHandleTime','findAll','where','sequelize','col','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x3af289,_0x47a430){var _0x51a5fe=function(_0x1edcd7){while(--_0x1edcd7){_0x3af289['push'](_0x3af289['shift']());}};_0x51a5fe(++_0x47a430);}(_0x3238,0x13e));var _0x8323=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3238[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8323('0x0'));var util=require('util');var moment=require(_0x8323('0x1'));var BPromise=require(_0x8323('0x2'));var rs=require(_0x8323('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8323('0x4'))['db'];var utils=require(_0x8323('0x5'));var logger=require(_0x8323('0x6'))(_0x8323('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8323('0x8')][_0x8323('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40b1f0,_0x14b3b5,_0x4ddf1f){return new BPromise(function(_0x232f4b,_0x5950e2){return client[_0x8323('0xa')](_0x40b1f0,_0x4ddf1f)[_0x8323('0xb')](function(_0x1577a6){logger[_0x8323('0xc')](_0x8323('0xd'),_0x14b3b5,_0x8323('0xe'));logger[_0x8323('0xf')](_0x8323('0x10'),_0x14b3b5,'request\x20sent',JSON[_0x8323('0x11')](_0x1577a6));if(_0x1577a6[_0x8323('0x12')]){if(_0x1577a6[_0x8323('0x12')]['code']===0x1f4){logger[_0x8323('0x12')](_0x8323('0xd'),_0x14b3b5,_0x1577a6[_0x8323('0x12')][_0x8323('0x13')]);return _0x5950e2(_0x1577a6[_0x8323('0x12')][_0x8323('0x13')]);}logger[_0x8323('0x12')](_0x8323('0xd'),_0x14b3b5,_0x1577a6[_0x8323('0x12')][_0x8323('0x13')]);return _0x232f4b(_0x1577a6[_0x8323('0x12')][_0x8323('0x13')]);}else{logger[_0x8323('0xc')](_0x8323('0xd'),_0x14b3b5,'request\x20sent');_0x232f4b(_0x1577a6[_0x8323('0x14')][_0x8323('0x13')]);}})['catch'](function(_0x320e7f){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x14b3b5,_0x320e7f);_0x5950e2(_0x320e7f);});});}exports[_0x8323('0x15')]=function(_0x3bb436){var _0x2bb7c5=this;return new Promise(function(_0x46a42c,_0x3b3ba9){return db[_0x8323('0x16')]['create'](_0x3bb436[_0x8323('0x17')],{'raw':_0x3bb436['options']?_0x3bb436[_0x8323('0x18')][_0x8323('0x19')]===undefined?!![]:![]:!![]})[_0x8323('0xb')](function(_0x4d1ef3){logger[_0x8323('0xc')]('CreateCmHopperHistory',_0x3bb436);logger['debug'](_0x8323('0x15'),_0x3bb436,JSON[_0x8323('0x11')](_0x4d1ef3));_0x46a42c(_0x4d1ef3);})[_0x8323('0x1a')](function(_0x49fdb1){logger['error'](_0x8323('0x15'),_0x49fdb1[_0x8323('0x13')],_0x3bb436);_0x3b3ba9(_0x2bb7c5[_0x8323('0x12')](0x1f4,_0x49fdb1[_0x8323('0x13')]));});});};exports[_0x8323('0x1b')]=function(_0x372ce6){var _0x3185d3=this;return new Promise(function(_0xe839b3,_0x2ded41){return db['CmHopperHistory'][_0x8323('0x1c')]({'raw':_0x372ce6['options']?_0x372ce6['options']['raw']===undefined?!![]:![]:!![],'where':_0x372ce6[_0x8323('0x18')]?_0x372ce6[_0x8323('0x18')][_0x8323('0x1d')]||null:null,'attributes':[[db[_0x8323('0x1e')]['fn']('COUNT',db[_0x8323('0x1e')][_0x8323('0x1f')]('id')),'predictiveIntervalTotalCalls'],[db[_0x8323('0x1e')]['fn'](_0x8323('0x20'),db[_0x8323('0x1e')]['fn']('IF',db[_0x8323('0x1e')][_0x8323('0x21')](_0x8323('0x22')))),_0x8323('0x23')],[db['sequelize']['fn'](_0x8323('0x20'),db[_0x8323('0x1e')]['fn']('IF',db['sequelize'][_0x8323('0x21')](_0x8323('0x24')))),_0x8323('0x25')],[db[_0x8323('0x1e')]['fn'](_0x8323('0x20'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0x8323('0x26')],[db[_0x8323('0x1e')]['fn'](_0x8323('0x27'),db['sequelize']['fn']('IF',db['sequelize'][_0x8323('0x21')](_0x8323('0x28')))),_0x8323('0x29')],[db[_0x8323('0x1e')]['fn'](_0x8323('0x27'),db[_0x8323('0x1e')]['fn']('IF',db[_0x8323('0x1e')]['literal'](_0x8323('0x2a')))),_0x8323('0x2b')]]})['then'](function(_0x20a582){logger[_0x8323('0xc')](_0x8323('0x1b'),_0x372ce6);logger[_0x8323('0xf')](_0x8323('0x1b'),_0x372ce6,JSON[_0x8323('0x11')](_0x20a582));_0xe839b3(_0x20a582);})[_0x8323('0x1a')](function(_0x52b01b){logger[_0x8323('0x12')](_0x8323('0x1b'),_0x52b01b[_0x8323('0x13')],_0x372ce6);_0x2ded41(_0x3185d3[_0x8323('0x12')](0x1f4,_0x52b01b[_0x8323('0x13')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x580d06){var _0x41efea=this;return new Promise(function(_0x2d6c39,_0xada275){return db[_0x8323('0x16')][_0x8323('0x1c')]({'raw':_0x580d06[_0x8323('0x18')]?_0x580d06['options'][_0x8323('0x19')]===undefined?!![]:![]:!![],'where':_0x580d06[_0x8323('0x18')]?_0x580d06['options'][_0x8323('0x1d')]||null:null,'attributes':[[_0x8323('0x2c'),_0x8323('0x2d')],[db[_0x8323('0x1e')]['fn'](_0x8323('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x8323('0x21')](_0x8323('0x2e')))),'outboundNoSuchCallsDay'],[db[_0x8323('0x1e')]['fn'](_0x8323('0x20'),db[_0x8323('0x1e')]['fn']('IF',db[_0x8323('0x1e')][_0x8323('0x21')](_0x8323('0x2f')))),_0x8323('0x30')],[db['sequelize']['fn'](_0x8323('0x20'),db[_0x8323('0x1e')]['fn']('IF',db[_0x8323('0x1e')][_0x8323('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x8323('0x31')],[db[_0x8323('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8323('0x1e')][_0x8323('0x21')](_0x8323('0x32')))),_0x8323('0x33')],[db[_0x8323('0x1e')]['fn']('COUNT',db[_0x8323('0x1e')]['fn']('IF',db[_0x8323('0x1e')][_0x8323('0x21')](_0x8323('0x34')))),'outboundCongestionCallsDay'],[db[_0x8323('0x1e')]['fn'](_0x8323('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x8323('0x21')]('`state`\x20=\x2010\x20,\x201,\x20null'))),'outboundDropCallsDayTimeout'],[db[_0x8323('0x1e')]['fn']('COUNT',db[_0x8323('0x1e')]['fn']('IF',db['sequelize'][_0x8323('0x21')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0x8323('0x1e')]['fn'](_0x8323('0x20'),db[_0x8323('0x1e')]['fn']('IF',db[_0x8323('0x1e')][_0x8323('0x21')](_0x8323('0x35')))),_0x8323('0x36')],[db[_0x8323('0x1e')]['fn'](_0x8323('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x8323('0x21')](_0x8323('0x37')))),_0x8323('0x38')],[db[_0x8323('0x1e')]['fn'](_0x8323('0x20'),db[_0x8323('0x1e')]['fn']('IF',db[_0x8323('0x1e')]['literal'](_0x8323('0x39')))),'outboundOriginateFailureCallsDay'],[db[_0x8323('0x1e')]['fn']('COUNT',db[_0x8323('0x1e')]['fn']('IF',db[_0x8323('0x1e')][_0x8323('0x21')](_0x8323('0x3a')))),_0x8323('0x3b')],[db[_0x8323('0x1e')]['fn'](_0x8323('0x20'),db[_0x8323('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x8323('0x3c')))),'outboundAnswerAgiCallsDay'],[db[_0x8323('0x1e')]['fn']('COUNT',db[_0x8323('0x1e')]['fn']('IF',db[_0x8323('0x1e')][_0x8323('0x21')](_0x8323('0x3d')))),'outboundRejectCallsDay'],[db[_0x8323('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0x8323('0x2c')]})[_0x8323('0xb')](function(_0x16b073){logger[_0x8323('0xc')](_0x8323('0x3e'),_0x580d06);logger[_0x8323('0xf')](_0x8323('0x3e'),_0x580d06,JSON[_0x8323('0x11')](_0x16b073));_0x2d6c39(_0x16b073);})[_0x8323('0x1a')](function(_0x14d0b1){logger[_0x8323('0x12')](_0x8323('0x3e'),_0x14d0b1[_0x8323('0x13')],_0x580d06);_0xada275(_0x41efea['error'](0x1f4,_0x14d0b1[_0x8323('0x13')]));});});};exports[_0x8323('0x3f')]=function(_0x20637e){var _0xa10750=this;return new Promise(function(_0x3b37ca,_0xd6f24){return db['CmHopperHistory']['findAll']({'raw':_0x20637e['options']?_0x20637e['options']['raw']===undefined?!![]:![]:!![],'where':_0x20637e[_0x8323('0x18')]?_0x20637e[_0x8323('0x18')][_0x8323('0x1d')]||null:null,'attributes':[[_0x8323('0x2c'),'name'],[db[_0x8323('0x1e')]['fn']('COUNT',db[_0x8323('0x1e')][_0x8323('0x1f')]('id')),_0x8323('0x40')],[db[_0x8323('0x1e')]['fn'](_0x8323('0x20'),db[_0x8323('0x1e')]['fn']('IF',db[_0x8323('0x1e')][_0x8323('0x21')](_0x8323('0x22')))),_0x8323('0x41')]],'group':['campaign']})[_0x8323('0xb')](function(_0x46cf89){logger[_0x8323('0xc')](_0x8323('0x3f'),_0x20637e);logger[_0x8323('0xf')](_0x8323('0x3f'),_0x20637e,JSON[_0x8323('0x11')](_0x46cf89));_0x3b37ca(_0x46cf89);})[_0x8323('0x1a')](function(_0x1a8a0c){logger['error'](_0x8323('0x3f'),_0x1a8a0c['message'],_0x20637e);_0xd6f24(_0xa10750[_0x8323('0x12')](0x1f4,_0x1a8a0c['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index f10294c..ec5ec6b 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 _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 +var _0x0f80=['../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index','show','post','create','/:id','update','exports','connect-timeout','Router','fs-extra'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x0f80,0xc1));var _0x00f8=function(_0x7031a3,_0x256857){_0x7031a3=_0x7031a3-0x0;var _0x260eaa=_0x0f80[_0x7031a3];return _0x260eaa;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x00f8('0x0'));var express=require('express');var router=express[_0x00f8('0x1')]();var fs_extra=require(_0x00f8('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x00f8('0x3'));var config=require('../../config/environment');var controller=require(_0x00f8('0x4'));router[_0x00f8('0x5')]('/',auth[_0x00f8('0x6')](),controller[_0x00f8('0x7')]);router[_0x00f8('0x5')]('/describe',auth[_0x00f8('0x6')](),controller['describe']);router[_0x00f8('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x00f8('0x8')]);router[_0x00f8('0x9')]('/',auth[_0x00f8('0x6')](),controller[_0x00f8('0xa')]);router['put'](_0x00f8('0xb'),auth['isAuthenticated'](),controller[_0x00f8('0xc')]);module[_0x00f8('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 9fd17aa..60ef92c 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 _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 +var _0x2fda=['sequelize','name','STRING'];(function(_0x933ec2,_0x5c29ed){var _0x2a2ccd=function(_0xa0fbbd){while(--_0xa0fbbd){_0x933ec2['push'](_0x933ec2['shift']());}};_0x2a2ccd(++_0x5c29ed);}(_0x2fda,0x186));var _0xa2fd=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x2fda[_0xf50820];return _0x2a9b10;};'use strict';var Sequelize=require(_0xa2fd('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xa2fd('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa2fd('0x2')]},'dialPrefix':{'type':Sequelize[_0xa2fd('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 7cf6be2..9f2fcba 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 _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 +var _0xe748=['defaults','localhost','socket.io-emitter','./cmList.socket','register','json','offset','limit','undefined','count','status','set','Content-Range','apply','save','update','then','get','Lists','UserProfileResource','end','sendStatus','error','stack','name','index','map','CmList','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','addDisposition','Disposition','getDispositions','findOne','order','where','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','ListId','push','each','omit','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','getContactsCsv','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','c.cf_','alias','field','item','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','writeFileSync','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','addCustomField','sequelize','transaction','TEXT','Sequelize','INTEGER','switch','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','getGlobalCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','info','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xe748,0x130));var _0x8e74=function(_0x5d94ff,_0x505c9e){_0x5d94ff=_0x5d94ff-0x0;var _0x409883=_0xe748[_0x5d94ff];return _0x409883;};'use strict';var emlformat=require(_0x8e74('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8e74('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e74('0x2'));var moment=require(_0x8e74('0x3'));var BPromise=require(_0x8e74('0x4'));var Mustache=require('mustache');var util=require(_0x8e74('0x5'));var path=require(_0x8e74('0x6'));var sox=require(_0x8e74('0x7'));var csv=require(_0x8e74('0x8'));var ejs=require(_0x8e74('0x9'));var fs=require('fs');var fs_extra=require(_0x8e74('0xa'));var _=require(_0x8e74('0xb'));var squel=require(_0x8e74('0xc'));var crypto=require(_0x8e74('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8e74('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8e74('0xf'));var Papa=require(_0x8e74('0x10'));var Redis=require(_0x8e74('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8e74('0x12'));var hardwareService=require(_0x8e74('0x13'));var logger=require(_0x8e74('0x14'))(_0x8e74('0x15'));var utils=require('../../config/utils');var config=require(_0x8e74('0x16'));var licenseUtil=require(_0x8e74('0x17'));var db=require(_0x8e74('0x18'))['db'];var csv_results;config[_0x8e74('0x19')]=_[_0x8e74('0x1a')](config[_0x8e74('0x19')],{'host':_0x8e74('0x1b'),'port':0x18eb});var socket=require(_0x8e74('0x1c'))(new Redis(config[_0x8e74('0x19')]));require(_0x8e74('0x1d'))[_0x8e74('0x1e')](socket);function respondWithStatusCode(_0x4c7b01,_0x1b55ce){_0x1b55ce=_0x1b55ce||0xcc;return function(_0x3961e9){if(_0x3961e9){return _0x4c7b01['sendStatus'](_0x1b55ce);}return _0x4c7b01['status'](_0x1b55ce)['end']();};}function respondWithResult(_0x56ad72,_0x3b9b1c){_0x3b9b1c=_0x3b9b1c||0xc8;return function(_0x4eb25c){if(_0x4eb25c){return _0x56ad72['status'](_0x3b9b1c)[_0x8e74('0x1f')](_0x4eb25c);}};}function respondWithFilteredResult(_0x71927,_0x4b6a7e){return function(_0x140925){if(_0x140925){var _0x371056=typeof _0x4b6a7e[_0x8e74('0x20')]==='undefined'&&typeof _0x4b6a7e[_0x8e74('0x21')]===_0x8e74('0x22');var _0x50dacd=_0x140925[_0x8e74('0x23')];var _0x2fd7a8=_0x371056?0x0:_0x4b6a7e[_0x8e74('0x20')];var _0xafd7b5=_0x371056?_0x140925[_0x8e74('0x23')]:_0x4b6a7e['offset']+_0x4b6a7e[_0x8e74('0x21')];var _0x569b28;if(_0xafd7b5>=_0x50dacd){_0xafd7b5=_0x50dacd;_0x569b28=0xc8;}else{_0x569b28=0xce;}_0x71927[_0x8e74('0x24')](_0x569b28);return _0x71927[_0x8e74('0x25')](_0x8e74('0x26'),_0x2fd7a8+'-'+_0xafd7b5+'/'+_0x50dacd)['json'](_0x140925);}return null;};}function patchUpdates(_0x36b1d5){return function(_0x35cecf){try{jsonpatch[_0x8e74('0x27')](_0x35cecf,_0x36b1d5,!![]);}catch(_0x53c404){return BPromise['reject'](_0x53c404);}return _0x35cecf[_0x8e74('0x28')]();};}function saveUpdates(_0x1de9d8,_0x5b159c){return function(_0x273ed6){if(_0x273ed6){return _0x273ed6[_0x8e74('0x29')](_0x1de9d8)[_0x8e74('0x2a')](function(_0x47ee7a){return _0x47ee7a;});}return null;};}function removeEntity(_0x20f62a,_0x14931e){return function(_0x117367){if(_0x117367){return _0x117367['destroy']()[_0x8e74('0x2a')](function(){var _0x56f08c=_0x117367[_0x8e74('0x2b')]({'plain':!![]});var _0x3ed70d=_0x8e74('0x2c');return db[_0x8e74('0x2d')]['destroy']({'where':{'type':_0x3ed70d,'resourceId':_0x56f08c['id']}})[_0x8e74('0x2a')](function(){return _0x117367;});})[_0x8e74('0x2a')](function(){_0x20f62a[_0x8e74('0x24')](0xcc)[_0x8e74('0x2e')]();});}};}function handleEntityNotFound(_0xa9a61,_0x44ab51){return function(_0x3c2214){if(!_0x3c2214){_0xa9a61[_0x8e74('0x2f')](0x194);}return _0x3c2214;};}function handleError(_0x4268a2,_0x519c38){_0x519c38=_0x519c38||0x1f4;return function(_0xc02fae){logger[_0x8e74('0x30')](_0xc02fae[_0x8e74('0x31')]);if(_0xc02fae[_0x8e74('0x32')]){delete _0xc02fae[_0x8e74('0x32')];}_0x4268a2[_0x8e74('0x24')](_0x519c38)['send'](_0xc02fae);};}exports[_0x8e74('0x33')]=function(_0x3e6cc3,_0x28e403){var _0x589678={},_0x1f7de2={},_0x15b4db={'count':0x0,'rows':[]};var _0x4fac62=_[_0x8e74('0x34')](db[_0x8e74('0x35')][_0x8e74('0x36')],function(_0x369259){return{'name':_0x369259['fieldName'],'type':_0x369259[_0x8e74('0x37')][_0x8e74('0x38')]};});_0x1f7de2[_0x8e74('0x39')]=_[_0x8e74('0x34')](_0x4fac62,_0x8e74('0x32'));_0x1f7de2[_0x8e74('0x3a')]=_[_0x8e74('0x3b')](_0x3e6cc3['query']);_0x1f7de2['filters']=_[_0x8e74('0x3c')](_0x1f7de2[_0x8e74('0x39')],_0x1f7de2[_0x8e74('0x3a')]);_0x589678['attributes']=_[_0x8e74('0x3c')](_0x1f7de2[_0x8e74('0x39')],qs[_0x8e74('0x3d')](_0x3e6cc3[_0x8e74('0x3a')][_0x8e74('0x3d')]));_0x589678[_0x8e74('0x3e')]=_0x589678[_0x8e74('0x3e')][_0x8e74('0x3f')]?_0x589678[_0x8e74('0x3e')]:_0x1f7de2['model'];if(!_0x3e6cc3['query'][_0x8e74('0x40')](_0x8e74('0x41'))){_0x589678[_0x8e74('0x21')]=qs[_0x8e74('0x21')](_0x3e6cc3[_0x8e74('0x3a')][_0x8e74('0x21')]);_0x589678[_0x8e74('0x20')]=qs[_0x8e74('0x20')](_0x3e6cc3[_0x8e74('0x3a')][_0x8e74('0x20')]);}_0x589678['order']=qs[_0x8e74('0x42')](_0x3e6cc3['query'][_0x8e74('0x42')]);_0x589678['where']=qs[_0x8e74('0x43')](_[_0x8e74('0x44')](_0x3e6cc3[_0x8e74('0x3a')],_0x1f7de2[_0x8e74('0x43')]),_0x4fac62);if(_0x3e6cc3[_0x8e74('0x3a')][_0x8e74('0x45')]){_0x589678['where']=_[_0x8e74('0x46')](_0x589678['where'],{'$or':_['map'](_0x4fac62,function(_0x116819){if(_0x116819['type']!==_0x8e74('0x47')){var _0x37a639={};_0x37a639[_0x116819[_0x8e74('0x32')]]={'$like':'%'+_0x3e6cc3[_0x8e74('0x3a')][_0x8e74('0x45')]+'%'};return _0x37a639;}})});}_0x589678=_[_0x8e74('0x46')]({},_0x589678,_0x3e6cc3[_0x8e74('0x48')]);var _0x50ed6b={'where':_0x589678['where']};return db[_0x8e74('0x35')][_0x8e74('0x23')](_0x50ed6b)[_0x8e74('0x2a')](function(_0x2627d4){_0x15b4db[_0x8e74('0x23')]=_0x2627d4;if(_0x3e6cc3['query'][_0x8e74('0x49')]){_0x589678['include']=[{'all':!![]}];}return db[_0x8e74('0x35')]['findAll'](_0x589678);})[_0x8e74('0x2a')](function(_0x5b9d42){_0x15b4db[_0x8e74('0x4a')]=_0x5b9d42;return _0x15b4db;})[_0x8e74('0x2a')](respondWithFilteredResult(_0x28e403,_0x589678))['catch'](handleError(_0x28e403,null));};exports[_0x8e74('0x4b')]=function(_0x3088ee,_0x5d5ca7){var _0x512c6e={'raw':![],'where':{'id':_0x3088ee[_0x8e74('0x4c')]['id']}},_0x1dbb2a={};_0x1dbb2a[_0x8e74('0x39')]=_['keys'](db[_0x8e74('0x35')][_0x8e74('0x36')]);_0x1dbb2a[_0x8e74('0x3a')]=_[_0x8e74('0x3b')](_0x3088ee[_0x8e74('0x3a')]);_0x1dbb2a[_0x8e74('0x43')]=_[_0x8e74('0x3c')](_0x1dbb2a[_0x8e74('0x39')],_0x1dbb2a['query']);_0x512c6e[_0x8e74('0x3e')]=_[_0x8e74('0x3c')](_0x1dbb2a[_0x8e74('0x39')],qs[_0x8e74('0x3d')](_0x3088ee[_0x8e74('0x3a')][_0x8e74('0x3d')]));_0x512c6e[_0x8e74('0x3e')]=_0x512c6e[_0x8e74('0x3e')]['length']?_0x512c6e[_0x8e74('0x3e')]:_0x1dbb2a['model'];if(_0x3088ee['query'][_0x8e74('0x49')]){_0x512c6e[_0x8e74('0x4d')]=[{'all':!![]}];}_0x512c6e=_[_0x8e74('0x46')]({},_0x512c6e,_0x3088ee[_0x8e74('0x48')]);return db['CmList'][_0x8e74('0x4e')](_0x512c6e)[_0x8e74('0x2a')](handleEntityNotFound(_0x5d5ca7,null))[_0x8e74('0x2a')](respondWithResult(_0x5d5ca7,null))[_0x8e74('0x4f')](handleError(_0x5d5ca7,null));};exports[_0x8e74('0x50')]=function(_0x107cb3,_0x5a7cdb){return db[_0x8e74('0x35')][_0x8e74('0x50')](_0x107cb3['body'],{})[_0x8e74('0x2a')](function(_0x139f75){var _0x49dbd3=_0x107cb3[_0x8e74('0x51')][_0x8e74('0x2b')]({'plain':!![]});if(!_0x49dbd3)throw new Error(_0x8e74('0x52'));if(_0x49dbd3[_0x8e74('0x53')]===_0x8e74('0x51')){var _0x5c6038=_0x139f75[_0x8e74('0x2b')]({'plain':!![]});var _0x31a613=_0x8e74('0x2c');return db[_0x8e74('0x54')][_0x8e74('0x4e')]({'where':{'name':_0x31a613,'userProfileId':_0x49dbd3[_0x8e74('0x55')]},'raw':!![]})['then'](function(_0x56b8a1){if(_0x56b8a1&&_0x56b8a1['autoAssociation']===0x0){return db['UserProfileResource'][_0x8e74('0x50')]({'name':_0x5c6038[_0x8e74('0x32')],'resourceId':_0x5c6038['id'],'type':_0x56b8a1[_0x8e74('0x32')],'sectionId':_0x56b8a1['id']},{})[_0x8e74('0x2a')](function(){return _0x139f75;});}else{return _0x139f75;}})[_0x8e74('0x4f')](function(_0x4beae2){logger[_0x8e74('0x30')](_0x8e74('0x56'),_0x4beae2);throw _0x4beae2;});}return _0x139f75;})['then'](respondWithResult(_0x5a7cdb,0xc9))[_0x8e74('0x4f')](handleError(_0x5a7cdb,null));};exports[_0x8e74('0x29')]=function(_0x235510,_0x337999){if(_0x235510['body']['id']){delete _0x235510[_0x8e74('0x57')]['id'];}return db['CmList'][_0x8e74('0x4e')]({'where':{'id':_0x235510[_0x8e74('0x4c')]['id']}})[_0x8e74('0x2a')](handleEntityNotFound(_0x337999,null))[_0x8e74('0x2a')](saveUpdates(_0x235510[_0x8e74('0x57')],null))[_0x8e74('0x2a')](respondWithResult(_0x337999,null))['catch'](handleError(_0x337999,null));};exports[_0x8e74('0x58')]=function(_0x1a0c21,_0x4f01ad){return db[_0x8e74('0x35')][_0x8e74('0x4e')]({'where':{'id':_0x1a0c21[_0x8e74('0x4c')]['id']}})[_0x8e74('0x2a')](handleEntityNotFound(_0x4f01ad,null))[_0x8e74('0x2a')](removeEntity(_0x4f01ad,null))[_0x8e74('0x4f')](handleError(_0x4f01ad,null));};exports[_0x8e74('0x59')]=function(_0x5215ad,_0x46b00d){return db[_0x8e74('0x35')][_0x8e74('0x59')]()[_0x8e74('0x2a')](respondWithResult(_0x46b00d,null))[_0x8e74('0x4f')](handleError(_0x46b00d,null));};exports[_0x8e74('0x5a')]=function(_0x12177e,_0x458ca1,_0x5de915){if(_0x12177e['body']['id']){delete _0x12177e[_0x8e74('0x57')]['id'];}return db['CmList'][_0x8e74('0x4e')]({'where':{'id':_0x12177e[_0x8e74('0x4c')]['id']}})[_0x8e74('0x2a')](handleEntityNotFound(_0x458ca1,null))[_0x8e74('0x2a')](function(_0x20cfa1){if(_0x20cfa1){_0x12177e[_0x8e74('0x57')]['ListId']=_0x20cfa1['id'];return db[_0x8e74('0x5b')][_0x8e74('0x50')](_0x12177e[_0x8e74('0x57')]);}})['then'](respondWithResult(_0x458ca1,null))['catch'](handleError(_0x458ca1,null));};exports[_0x8e74('0x5c')]=function(_0x52a84c,_0x42ba7c,_0xe3b523){var _0x4640d6={'raw':![],'where':{}};var _0x4159bb={};var _0x20ff49={'count':0x0,'rows':[]};return db['CmList'][_0x8e74('0x5d')]({'where':{'id':_0x52a84c[_0x8e74('0x4c')]['id']}})['then'](handleEntityNotFound(_0x42ba7c,null))['then'](function(_0x2183fa){if(_0x2183fa){_0x4159bb[_0x8e74('0x39')]=_[_0x8e74('0x3b')](db[_0x8e74('0x5b')]['rawAttributes']);_0x4159bb[_0x8e74('0x3a')]=_[_0x8e74('0x3b')](_0x52a84c[_0x8e74('0x3a')]);_0x4159bb['filters']=_[_0x8e74('0x3c')](_0x4159bb['model'],_0x4159bb['query']);_0x4640d6[_0x8e74('0x3e')]=_[_0x8e74('0x3c')](_0x4159bb['model'],qs['fields'](_0x52a84c[_0x8e74('0x3a')]['fields']));_0x4640d6['attributes']=_0x4640d6['attributes'][_0x8e74('0x3f')]?_0x4640d6[_0x8e74('0x3e')]:_0x4159bb[_0x8e74('0x39')];if(!_0x52a84c[_0x8e74('0x3a')][_0x8e74('0x40')](_0x8e74('0x41'))){_0x4640d6[_0x8e74('0x21')]=qs[_0x8e74('0x21')](_0x52a84c[_0x8e74('0x3a')]['limit']);_0x4640d6[_0x8e74('0x20')]=qs[_0x8e74('0x20')](_0x52a84c['query']['offset']);}_0x4640d6[_0x8e74('0x5e')]=qs['sort'](_0x52a84c[_0x8e74('0x3a')][_0x8e74('0x42')]);_0x4640d6[_0x8e74('0x5f')]=qs['filters'](_[_0x8e74('0x44')](_0x52a84c['query'],_0x4159bb[_0x8e74('0x43')]));_0x4640d6['where']['ListId']=_0x2183fa['id'];if(_0x52a84c[_0x8e74('0x3a')]['filter']){_0x4640d6['where']=_[_0x8e74('0x46')](_0x4640d6['where'],{'$or':_['map'](_0x4640d6[_0x8e74('0x3e')],function(_0x246984){var _0x4bcce7={};_0x4bcce7[_0x246984]={'$like':'%'+_0x52a84c['query'][_0x8e74('0x45')]+'%'};return _0x4bcce7;})});}_0x4640d6=_[_0x8e74('0x46')]({},_0x4640d6,_0x52a84c[_0x8e74('0x48')]);return db['Disposition'][_0x8e74('0x23')]({'where':_0x4640d6['where']})[_0x8e74('0x2a')](function(_0x1e5bdd){_0x20ff49['count']=_0x1e5bdd;if(_0x52a84c[_0x8e74('0x3a')][_0x8e74('0x49')]){_0x4640d6[_0x8e74('0x4d')]=[{'all':!![]}];}return db[_0x8e74('0x5b')][_0x8e74('0x60')](_0x4640d6);})[_0x8e74('0x2a')](function(_0xd87c97){_0x20ff49[_0x8e74('0x4a')]=_0xd87c97;return _0x20ff49;});}})['then'](respondWithFilteredResult(_0x42ba7c,_0x4640d6))[_0x8e74('0x4f')](handleError(_0x42ba7c,null));};exports[_0x8e74('0x61')]=function(_0x52b37c,_0x2b933e,_0x56aa7c){return db[_0x8e74('0x35')]['find']({'where':{'id':_0x52b37c['params']['id']}})['then'](handleEntityNotFound(_0x2b933e,null))['then'](function(_0x384558){if(_0x384558){return _0x384558[_0x8e74('0x61')](_0x52b37c[_0x8e74('0x3a')][_0x8e74('0x62')]);}})[_0x8e74('0x2a')](respondWithStatusCode(_0x2b933e,null))[_0x8e74('0x4f')](handleError(_0x2b933e,null));};exports[_0x8e74('0x63')]=function(_0x1dc448,_0x2808b9,_0x55646f){return db[_0x8e74('0x35')]['find']({'where':{'id':_0x1dc448['params']['id']}})[_0x8e74('0x2a')](handleEntityNotFound(_0x2808b9,null))[_0x8e74('0x2a')](function(_0x4ea563){if(_0x4ea563){var _0x4c85ef=[];var _0x57e792={'success':[],'errors':[]};return db[_0x8e74('0x64')][_0x8e74('0x59')]()[_0x8e74('0x2a')](function(_0x534cf6){if(_0x1dc448[_0x8e74('0x57')][_0x8e74('0x65')]&&_['isArray'](_0x1dc448[_0x8e74('0x57')][_0x8e74('0x65')])){if(_0x1dc448[_0x8e74('0x57')][_0x8e74('0x65')][_0x8e74('0x3f')]){_0x1dc448['body']['tags']=_0x1dc448[_0x8e74('0x57')][_0x8e74('0x65')]['join'](';')+';';}else{_0x1dc448[_0x8e74('0x57')][_0x8e74('0x65')]=null;}}else{_0x1dc448[_0x8e74('0x57')][_0x8e74('0x65')]=null;}if(_0x1dc448[_0x8e74('0x57')]&&_[_0x8e74('0x66')](_0x1dc448['body'])){for(var _0x13d00a=0x0;_0x13d00a<_0x1dc448[_0x8e74('0x57')]['length'];_0x13d00a+=0x1){_0x1dc448[_0x8e74('0x57')][_0x13d00a][_0x8e74('0x67')]=_0x1dc448[_0x8e74('0x4c')]['id'];_0x4c85ef[_0x8e74('0x68')](_0x1dc448[_0x8e74('0x57')][_0x13d00a]);}return BPromise[_0x8e74('0x69')](_0x4c85ef,function(_0x4d80e9){return db['CmContact'][_0x8e74('0x50')](_[_0x8e74('0x6a')](_0x4d80e9,[_0x8e74('0x62'),'id'])||{},{'fields':_[_0x8e74('0x3b')](_0x534cf6),'raw':!![]})[_0x8e74('0x2a')](function(_0x3daf96){_0x57e792['success'][_0x8e74('0x68')](_0x3daf96[_0x8e74('0x6b')]);})[_0x8e74('0x4f')](function(_0x4117ee){_0x57e792[_0x8e74('0x6c')][_0x8e74('0x68')]({'data':_0x4d80e9,'error':_0x4117ee[_0x8e74('0x6d')]});});})[_0x8e74('0x2a')](function(_0x492fa6){return _0x57e792;})[_0x8e74('0x4f')](function(_0x176b87){return _0x176b87;});}else{_0x2808b9[_0x8e74('0x24')](0x190)[_0x8e74('0x1f')]({'message':_0x8e74('0x6e')});}});}})['then'](respondWithResult(_0x2808b9,null))[_0x8e74('0x4f')](handleError(_0x2808b9,null));};exports[_0x8e74('0x6f')]=function(_0x54dd1c,_0x5444b5,_0x27b279){var _0xfc0aa;return db[_0x8e74('0x35')][_0x8e74('0x4e')]({'where':{'id':_0x54dd1c[_0x8e74('0x4c')]['id']},'include':[{'model':db[_0x8e74('0x70')],'as':_0x8e74('0x71')}]})[_0x8e74('0x2a')](handleEntityNotFound(_0x5444b5,null))[_0x8e74('0x2a')](function(_0x40b049){if(_0x40b049){_0xfc0aa=_0x40b049;return db[_0x8e74('0x64')][_0x8e74('0x36')];}})[_0x8e74('0x2a')](function(_0x8e6312){if(_0x8e6312){var _0x1f2fdf={};var _0x8a3e99={};_0x8a3e99[_0x8e74('0x39')]=_[_0x8e74('0x72')](_[_0x8e74('0x3b')](_0x8e6312),_[_0x8e74('0x34')](_0xfc0aa['CustomFields'],function(_0x57d9cc){return util['format'](_0x8e74('0x73'),_0x57d9cc['id']);}));_0x8a3e99[_0x8e74('0x3a')]=_['keys'](_0x54dd1c[_0x8e74('0x3a')]);_0x8a3e99[_0x8e74('0x43')]=_[_0x8e74('0x3c')](_0x8a3e99[_0x8e74('0x39')],_0x8a3e99[_0x8e74('0x3a')]);_0x1f2fdf[_0x8e74('0x3e')]=_[_0x8e74('0x3c')](_0x8a3e99[_0x8e74('0x39')],qs[_0x8e74('0x3d')](_0x54dd1c['query'][_0x8e74('0x3d')]));_0x1f2fdf[_0x8e74('0x3e')]=_0x1f2fdf['attributes'][_0x8e74('0x3f')]?_0x1f2fdf['attributes']:_0x8a3e99['model'];if(!_0x54dd1c[_0x8e74('0x3a')][_0x8e74('0x40')](_0x8e74('0x41'))){_0x1f2fdf[_0x8e74('0x21')]=qs['limit'](_0x54dd1c[_0x8e74('0x3a')][_0x8e74('0x21')]);_0x1f2fdf[_0x8e74('0x20')]=qs[_0x8e74('0x20')](_0x54dd1c[_0x8e74('0x3a')]['offset']);}_0x1f2fdf[_0x8e74('0x5e')]=qs[_0x8e74('0x42')](_0x54dd1c[_0x8e74('0x3a')]['sort']);_0x1f2fdf[_0x8e74('0x5f')]=qs[_0x8e74('0x43')](_['pick'](_0x54dd1c[_0x8e74('0x3a')],_0x8a3e99['filters']));_0x1f2fdf['raw']=!![];if(_0x54dd1c[_0x8e74('0x3a')]['filter']){_0x1f2fdf['where']=_[_0x8e74('0x46')](_0x1f2fdf['where'],{'$or':_[_0x8e74('0x34')](_0x1f2fdf[_0x8e74('0x3e')],function(_0x20e328){var _0xaa6388={};_0xaa6388[_0x20e328]={'$like':'%'+_0x54dd1c[_0x8e74('0x3a')][_0x8e74('0x45')]+'%'};return _0xaa6388;})});}_0x1f2fdf=_[_0x8e74('0x46')]({},_0x1f2fdf,_0x54dd1c[_0x8e74('0x48')]);return _0xfc0aa['getContacts'](_0x1f2fdf);}})['then'](respondWithResult(_0x5444b5,null))[_0x8e74('0x4f')](handleError(_0x5444b5,null));};exports[_0x8e74('0x74')]=function(_0x27a001,_0x255438,_0x243bc4){var _0xee9c46;var _0x10d092;var _0x213460;var _0x47a0fc=_0x27a001[_0x8e74('0x4c')]['id'];csv_results=[];return db['ContactItemType'][_0x8e74('0x60')]({'attributes':['id',_0x8e74('0x32')],'raw':!![],'order':['OrderBy']})[_0x8e74('0x2a')](function(_0x102401){_0xee9c46=_0x102401;var _0x28f650=_[_0x8e74('0x3b')](db[_0x8e74('0x64')][_0x8e74('0x36')]);return db[_0x8e74('0x70')][_0x8e74('0x60')]({'raw':!![],'attributes':['id','alias']})[_0x8e74('0x2a')](function(_0x8a16b2){_0x10d092=_0x8a16b2;var _0x41cc40=squel[_0x8e74('0x75')]()['fields'](_0x28f650)[_0x8e74('0x76')](_0x8e74('0x77'),'c')[_0x8e74('0x5f')](_0x8e74('0x78'),_0x47a0fc)[_0x8e74('0x5f')](_0x8e74('0x79'))[_0x8e74('0x7a')]();for(var _0x33d4ab=0x0;_0x33d4ab<_0x10d092[_0x8e74('0x3f')];_0x33d4ab++){_0x41cc40['field'](_0x8e74('0x7b')+_0x10d092[_0x33d4ab]['id'],'customField_'+_0x10d092[_0x33d4ab][_0x8e74('0x7c')]);}for(var _0x33d4ab=0x0;_0x33d4ab<_0xee9c46['length'];_0x33d4ab++){_0x41cc40[_0x8e74('0x7d')](squel['select']()[_0x8e74('0x7d')](_0x8e74('0x7e'))[_0x8e74('0x76')]('cm_contact_has_items')[_0x8e74('0x5f')](_0x8e74('0x7f'),_0xee9c46[_0x33d4ab]['id'])[_0x8e74('0x5f')](_0x8e74('0x80')),_0x8e74('0x81')+_0xee9c46[_0x33d4ab][_0x8e74('0x32')]);_0x41cc40[_0x8e74('0x7d')](squel[_0x8e74('0x75')]()['field'](_0x8e74('0x82'))[_0x8e74('0x76')]('cm_contact_has_items')['where'](_0x8e74('0x7f'),_0xee9c46[_0x33d4ab]['id'])[_0x8e74('0x5f')]('CmContactId\x20=\x20c.id'),_0x8e74('0x83')+_0xee9c46[_0x33d4ab]['name']);}var _0x4628a3=[];_0x4628a3['push'](_0x41cc40[_0x8e74('0x84')]());BPromise['each'](_0x4628a3,handleQuery)['then'](function(_0x4d5e64){handleQuery(_0x41cc40[_0x8e74('0x84')]());var _0x143f1c=csv_results[0x0];if(!_[_0x8e74('0x85')](_0x143f1c)){var _0x3ebb3e=toCsv(_0x143f1c);var _0x12c307=Date['now']();fs[_0x8e74('0x86')](util[_0x8e74('0x87')](_0x8e74('0x88'),_0x47a0fc,_0x12c307),_0x3ebb3e);_0x255438[_0x8e74('0x89')](_0x8e74('0x8a'),_0x8e74('0x8b')+util[_0x8e74('0x87')](_0x8e74('0x8c'),_0x47a0fc,_0x12c307));_0x255438[_0x8e74('0x89')](_0x8e74('0x8d'),_0x8e74('0x8e'));return _0x255438['download'](util['format'](_0x8e74('0x88'),_0x47a0fc,_0x12c307));}else{return _0x255438[_0x8e74('0x2f')](0xcc);}});});});};exports[_0x8e74('0x8f')]=function(_0x3e388d,_0xb9ce6d,_0x2da3d3){var _0x41b7e4;delete _0x3e388d[_0x8e74('0x57')]['id'];return db[_0x8e74('0x35')][_0x8e74('0x5d')]({'where':{'id':_0x3e388d[_0x8e74('0x4c')]['id']}})['then'](handleEntityNotFound(_0xb9ce6d,null))['then'](function(_0x4bb396){if(_0x4bb396){return db[_0x8e74('0x90')][_0x8e74('0x91')](function(_0x1d0d6f){return db[_0x8e74('0x70')]['create'](_0x3e388d[_0x8e74('0x57')],{'transaction':_0x1d0d6f})['then'](function(_0x3e09fc){_0x41b7e4=_0x3e09fc;return _0x4bb396['addCustomFields'](_0x3e09fc,{'transaction':_0x1d0d6f});})[_0x8e74('0x2a')](function(){var _0x94113e={'type':db['Sequelize'][_0x8e74('0x92')],'transaction':_0x1d0d6f};switch(_0x3e388d[_0x8e74('0x57')][_0x8e74('0x37')]){case'text':_0x94113e[_0x8e74('0x37')]=db['Sequelize'][_0x8e74('0x92')];break;case'number':_0x94113e['type']=db[_0x8e74('0x93')][_0x8e74('0x94')];break;case _0x8e74('0x95'):_0x94113e[_0x8e74('0x37')]=db[_0x8e74('0x93')]['BOOLEAN'];_0x94113e[_0x8e74('0x96')]=![];break;default:}return db[_0x8e74('0x90')][_0x8e74('0x97')][_0x8e74('0x98')](_0x8e74('0x77'),util[_0x8e74('0x87')](_0x8e74('0x99'),_0x41b7e4['id']),_0x94113e);})[_0x8e74('0x2a')](function(){return _0x41b7e4;});});}})[_0x8e74('0x2a')](respondWithResult(_0xb9ce6d,null))[_0x8e74('0x4f')](handleError(_0xb9ce6d,null));};exports[_0x8e74('0x9a')]=function(_0x4baa5b,_0x35f8a6,_0x12b685){var _0x126ece={};var _0x4ccc87={};var _0x5a6a69;var _0x13ec63;return db[_0x8e74('0x35')][_0x8e74('0x5d')]({'where':{'id':_0x4baa5b[_0x8e74('0x4c')]['id']}})['then'](handleEntityNotFound(_0x35f8a6,null))['then'](function(_0x4b74a7){if(_0x4b74a7){_0x5a6a69=_0x4b74a7;_0x4ccc87[_0x8e74('0x39')]=_['keys'](db['CmCustomField']['rawAttributes']);_0x4ccc87[_0x8e74('0x3a')]=_[_0x8e74('0x3b')](_0x4baa5b[_0x8e74('0x3a')]);_0x4ccc87[_0x8e74('0x43')]=_[_0x8e74('0x3c')](_0x4ccc87[_0x8e74('0x39')],_0x4ccc87[_0x8e74('0x3a')]);_0x126ece[_0x8e74('0x3e')]=_[_0x8e74('0x3c')](_0x4ccc87[_0x8e74('0x39')],qs['fields'](_0x4baa5b[_0x8e74('0x3a')][_0x8e74('0x3d')]));_0x126ece['attributes']=_0x126ece[_0x8e74('0x3e')][_0x8e74('0x3f')]?_0x126ece[_0x8e74('0x3e')]:_0x4ccc87[_0x8e74('0x39')];_0x126ece[_0x8e74('0x5e')]=qs['sort'](_0x4baa5b['query']['sort']);_0x126ece['where']=qs[_0x8e74('0x43')](_[_0x8e74('0x44')](_0x4baa5b[_0x8e74('0x3a')],_0x4ccc87[_0x8e74('0x43')]));_0x126ece[_0x8e74('0x5f')]=_[_0x8e74('0x46')](_0x126ece[_0x8e74('0x5f')],{'$or':[{'ListId':_0x4b74a7['id']},{'ListId':null}]});if(_0x4baa5b[_0x8e74('0x3a')][_0x8e74('0x45')]){_0x126ece[_0x8e74('0x5f')]=_[_0x8e74('0x46')](_0x126ece['where'],{'$or':_['map'](_0x126ece[_0x8e74('0x3e')],function(_0x76afe8){var _0x48c63f={};_0x48c63f[_0x76afe8]={'$like':'%'+_0x4baa5b[_0x8e74('0x3a')][_0x8e74('0x45')]+'%'};return _0x48c63f;})});}_0x126ece=_[_0x8e74('0x46')]({},_0x126ece,_0x4baa5b[_0x8e74('0x48')]);return db[_0x8e74('0x70')]['findAndCountAll'](_0x126ece);}})[_0x8e74('0x2a')](respondWithResult(_0x35f8a6,null))['catch'](handleError(_0x35f8a6,null));};exports[_0x8e74('0x9b')]=function(_0x2c028f,_0x4b4fc2){return db['CmCustomField'][_0x8e74('0x9c')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x4b4fc2,null))[_0x8e74('0x2a')](function(_0x49e008){return _0x49e008;})['then'](respondWithResult(_0x4b4fc2,null))[_0x8e74('0x4f')](handleError(_0x4b4fc2,null));};exports['addAgents']=function(_0x2a709a,_0x416164,_0x3d6693){return db['CmList']['find']({'where':{'id':_0x2a709a[_0x8e74('0x4c')]['id']}})[_0x8e74('0x2a')](handleEntityNotFound(_0x416164,null))['then'](function(_0x2e916b){if(_0x2e916b){return _0x2e916b[_0x8e74('0x9d')](_0x2a709a[_0x8e74('0x57')][_0x8e74('0x62')],_[_0x8e74('0x6a')](_0x2a709a[_0x8e74('0x57')],[_0x8e74('0x62'),'id'])||{})[_0x8e74('0x9e')](function(_0x5eecf2){for(var _0x101bcd=0x0;_0x101bcd<_0x2a709a['body'][_0x8e74('0x62')][_0x8e74('0x3f')];_0x101bcd+=0x1){socket[_0x8e74('0x9f')](_0x8e74('0xa0'),{'UserId':Number(_0x2a709a[_0x8e74('0x57')][_0x8e74('0x62')][_0x101bcd]),'CmListId':Number(_0x2a709a[_0x8e74('0x4c')]['id'])});}return _0x5eecf2;});}})[_0x8e74('0x2a')](respondWithResult(_0x416164,null))[_0x8e74('0x4f')](handleError(_0x416164,null));};exports[_0x8e74('0xa1')]=function(_0x186139,_0x3746e7,_0x182cb0){return db[_0x8e74('0x35')][_0x8e74('0x4e')]({'where':{'id':_0x186139[_0x8e74('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3746e7,null))['then'](function(_0x398edc){if(_0x398edc){return _0x398edc['removeAgents'](_0x186139[_0x8e74('0x3a')][_0x8e74('0x62')])[_0x8e74('0x2a')](function(){if(_[_0x8e74('0x66')](_0x186139[_0x8e74('0x3a')][_0x8e74('0x62')])){for(var _0x261340=0x0;_0x261340<_0x186139['query']['ids'][_0x8e74('0x3f')];_0x261340+=0x1){socket[_0x8e74('0x9f')](_0x8e74('0xa2'),{'UserId':Number(_0x186139[_0x8e74('0x3a')][_0x8e74('0x62')][_0x261340]),'CmListId':Number(_0x186139[_0x8e74('0x4c')]['id'])});}}else{socket[_0x8e74('0x9f')](_0x8e74('0xa2'),{'UserId':Number(_0x186139[_0x8e74('0x3a')]['ids']),'CmListId':Number(_0x186139[_0x8e74('0x4c')]['id'])});}});}})[_0x8e74('0x2a')](respondWithStatusCode(_0x3746e7,null))['catch'](handleError(_0x3746e7,null));};exports[_0x8e74('0xa3')]=function(_0x16d1d2,_0x9a6b49,_0x2eb289){var _0x13839a={};var _0x4d8b67={};var _0x1d4fa5;var _0x160075;return db['CmList'][_0x8e74('0x5d')]({'where':{'id':_0x16d1d2[_0x8e74('0x4c')]['id']}})[_0x8e74('0x2a')](handleEntityNotFound(_0x9a6b49,null))[_0x8e74('0x2a')](function(_0x1ef733){if(_0x1ef733){_0x1d4fa5=_0x1ef733;_0x4d8b67['model']=_[_0x8e74('0x3b')](db['User'][_0x8e74('0x36')]);_0x4d8b67[_0x8e74('0x3a')]=_[_0x8e74('0x3b')](_0x16d1d2['query']);_0x4d8b67[_0x8e74('0x43')]=_[_0x8e74('0x3c')](_0x4d8b67[_0x8e74('0x39')],_0x4d8b67[_0x8e74('0x3a')]);_0x13839a['attributes']=_[_0x8e74('0x3c')](_0x4d8b67[_0x8e74('0x39')],qs[_0x8e74('0x3d')](_0x16d1d2[_0x8e74('0x3a')][_0x8e74('0x3d')]));_0x13839a['attributes']=_0x13839a[_0x8e74('0x3e')]['length']?_0x13839a[_0x8e74('0x3e')]:_0x4d8b67[_0x8e74('0x39')];_0x13839a[_0x8e74('0x5e')]=qs[_0x8e74('0x42')](_0x16d1d2['query'][_0x8e74('0x42')]);_0x13839a[_0x8e74('0x5f')]=qs[_0x8e74('0x43')](_[_0x8e74('0x44')](_0x16d1d2[_0x8e74('0x3a')],_0x4d8b67[_0x8e74('0x43')]));if(_0x16d1d2[_0x8e74('0x3a')][_0x8e74('0x45')]){_0x13839a[_0x8e74('0x5f')]=_[_0x8e74('0x46')](_0x13839a[_0x8e74('0x5f')],{'$or':_[_0x8e74('0x34')](_0x13839a['attributes'],function(_0x2de608){var _0x299ba2={};_0x299ba2[_0x2de608]={'$like':'%'+_0x16d1d2['query'][_0x8e74('0x45')]+'%'};return _0x299ba2;})});}_0x13839a=_[_0x8e74('0x46')]({},_0x13839a,_0x16d1d2[_0x8e74('0x48')]);return _0x1d4fa5[_0x8e74('0xa3')](_0x13839a);}})[_0x8e74('0x2a')](function(_0x57bedc){if(_0x57bedc){_0x160075=_0x57bedc['length'];if(!_0x16d1d2['query'][_0x8e74('0x40')](_0x8e74('0x41'))){_0x13839a['limit']=qs[_0x8e74('0x21')](_0x16d1d2[_0x8e74('0x3a')][_0x8e74('0x21')]);_0x13839a[_0x8e74('0x20')]=qs['offset'](_0x16d1d2[_0x8e74('0x3a')][_0x8e74('0x20')]);}return _0x1d4fa5[_0x8e74('0xa3')](_0x13839a);}})[_0x8e74('0x2a')](function(_0x19feaf){if(_0x19feaf){return _0x19feaf?{'count':_0x160075,'rows':_0x19feaf}:null;}})[_0x8e74('0x2a')](respondWithResult(_0x9a6b49,null))[_0x8e74('0x4f')](handleError(_0x9a6b49,null));};function handleQuery(_0x2faed4){logger[_0x8e74('0xa4')](_0x2faed4);return db['sequelize'][_0x8e74('0x3a')](_0x2faed4)['spread'](function(_0x1daeb2){csv_results[_0x8e74('0x68')](_0x1daeb2);})[_0x8e74('0x4f')](function(_0x1cf769){logger[_0x8e74('0x30')](_0x1cf769[_0x8e74('0x6d')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 4433454..24ccf00 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 _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 +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(_0xb9b58d,_0x1dd8fb){_0xb9b58d=_0xb9b58d-0x0;var _0x567ea4=_0x326f[_0xb9b58d];return _0x567ea4;};'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 ad35cf6..ed58145 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 _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 +var _0xec56=['define','CmList','cm_lists','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports'];(function(_0x3e7990,_0x3581f6){var _0x9de195=function(_0x173bfc){while(--_0x173bfc){_0x3e7990['push'](_0x3e7990['shift']());}};_0x9de195(++_0x3581f6);}(_0xec56,0x1bd));var _0x6ec5=function(_0x50031f,_0x22e972){_0x50031f=_0x50031f-0x0;var _0x154270=_0xec56[_0x50031f];return _0x154270;};'use strict';var _=require(_0x6ec5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6ec5('0x1'));var moment=require(_0x6ec5('0x2'));var BPromise=require(_0x6ec5('0x3'));var rp=require(_0x6ec5('0x4'));var fs=require('fs');var path=require(_0x6ec5('0x5'));var rimraf=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var attributes=require(_0x6ec5('0x8'));module[_0x6ec5('0x9')]=function(_0x28b12b,_0x2d0a93){return _0x28b12b[_0x6ec5('0xa')](_0x6ec5('0xb'),attributes,{'tableName':_0x6ec5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 462a8dd..c2d37ea 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 _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 +var _0x5b4b=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./cmList.socket','request','then','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x5b4b,0x195));var _0xb5b4=function(_0x597174,_0x369916){_0x597174=_0x597174-0x0;var _0x42db10=_0x5b4b[_0x597174];return _0x42db10;};'use strict';var _=require(_0xb5b4('0x0'));var util=require(_0xb5b4('0x1'));var moment=require(_0xb5b4('0x2'));var BPromise=require(_0xb5b4('0x3'));var rs=require(_0xb5b4('0x4'));var fs=require('fs');var Redis=require(_0xb5b4('0x5'));var db=require(_0xb5b4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb5b4('0x7'))(_0xb5b4('0x8'));var config=require(_0xb5b4('0x9'));var jayson=require(_0xb5b4('0xa'));var client=jayson[_0xb5b4('0xb')][_0xb5b4('0xc')]({'port':0x232a});config[_0xb5b4('0xd')]=_[_0xb5b4('0xe')](config[_0xb5b4('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xb5b4('0xf'))(new Redis(config[_0xb5b4('0xd')]));require(_0xb5b4('0x10'))['register'](socket);function respondWithRpcPromise(_0x5029b6,_0x11cfc9,_0x1e4b64){return new BPromise(function(_0x1f9756,_0x5e970d){return client[_0xb5b4('0x11')](_0x5029b6,_0x1e4b64)[_0xb5b4('0x12')](function(_0x105a0b){logger['info'](_0xb5b4('0x13'),_0x11cfc9,_0xb5b4('0x14'));logger['debug'](_0xb5b4('0x15'),_0x11cfc9,_0xb5b4('0x14'),JSON[_0xb5b4('0x16')](_0x105a0b));if(_0x105a0b[_0xb5b4('0x17')]){if(_0x105a0b[_0xb5b4('0x17')][_0xb5b4('0x18')]===0x1f4){logger[_0xb5b4('0x17')]('CmList,\x20%s,\x20%s',_0x11cfc9,_0x105a0b[_0xb5b4('0x17')][_0xb5b4('0x19')]);return _0x5e970d(_0x105a0b['error']['message']);}logger[_0xb5b4('0x17')]('CmList,\x20%s,\x20%s',_0x11cfc9,_0x105a0b['error'][_0xb5b4('0x19')]);return _0x1f9756(_0x105a0b[_0xb5b4('0x17')][_0xb5b4('0x19')]);}else{logger[_0xb5b4('0x1a')](_0xb5b4('0x13'),_0x11cfc9,'request\x20sent');_0x1f9756(_0x105a0b[_0xb5b4('0x1b')]['message']);}})[_0xb5b4('0x1c')](function(_0xcbd4a9){logger[_0xb5b4('0x17')](_0xb5b4('0x13'),_0x11cfc9,_0xcbd4a9);_0x5e970d(_0xcbd4a9);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 485c8f2..0522f11 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 _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 +var _0x67d6=['save','update','emit','removeListener','register','cmList:'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x67d6,0x7e));var _0x667d=function(_0x5dee2a,_0x47d02a){_0x5dee2a=_0x5dee2a-0x0;var _0x31e98e=_0x67d6[_0x5dee2a];return _0x31e98e;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x667d('0x0'),'remove',_0x667d('0x1')];function createListener(_0x1343b0,_0x287c0e){return function(_0xf09919){_0x287c0e[_0x667d('0x2')](_0x1343b0,_0xf09919);};}function removeListener(_0x9ea422,_0x385bb2){return function(){CmListEvents[_0x667d('0x3')](_0x9ea422,_0x385bb2);};}exports[_0x667d('0x4')]=function(_0x3ef5b8){for(var _0xa5c19f=0x0,_0x31c4ee=events['length'];_0xa5c19f<_0x31c4ee;_0xa5c19f++){var _0x3abaed=events[_0xa5c19f];var _0x556dbf=createListener(_0x667d('0x5')+_0x3abaed,_0x3ef5b8);CmListEvents['on'](_0x3abaed,_0x556dbf);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 5a12855..6b3d3d7 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 _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 +var _0xe4b2=['show','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','/:id/fields','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/global_fields','getGlobalCustomFields','/:id'];(function(_0x231b1a,_0x1d0612){var _0x5d8438=function(_0x329121){while(--_0x329121){_0x231b1a['push'](_0x231b1a['shift']());}};_0x5d8438(++_0x1d0612);}(_0xe4b2,0x81));var _0x2e4b=function(_0x543001,_0x288c02){_0x543001=_0x543001-0x0;var _0x296954=_0xe4b2[_0x543001];return _0x296954;};'use strict';var multer=require('multer');var util=require(_0x2e4b('0x0'));var path=require(_0x2e4b('0x1'));var timeout=require(_0x2e4b('0x2'));var express=require(_0x2e4b('0x3'));var router=express[_0x2e4b('0x4')]();var fs_extra=require(_0x2e4b('0x5'));var auth=require(_0x2e4b('0x6'));var interaction=require(_0x2e4b('0x7'));var config=require('../../config/environment');var controller=require('./cmList.controller');router[_0x2e4b('0x8')]('/',auth[_0x2e4b('0x9')](),controller[_0x2e4b('0xa')]);router[_0x2e4b('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x2e4b('0xb')]);router[_0x2e4b('0x8')](_0x2e4b('0xc'),auth['isAuthenticated'](),controller[_0x2e4b('0xd')]);router[_0x2e4b('0x8')](_0x2e4b('0xe'),auth[_0x2e4b('0x9')](),controller[_0x2e4b('0xf')]);router[_0x2e4b('0x8')]('/:id/dispositions',auth[_0x2e4b('0x9')](),controller['getDispositions']);router[_0x2e4b('0x8')](_0x2e4b('0x10'),auth['isAuthenticated'](),controller[_0x2e4b('0x11')]);router[_0x2e4b('0x8')](_0x2e4b('0x12'),auth[_0x2e4b('0x9')](),controller[_0x2e4b('0x13')]);router[_0x2e4b('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2e4b('0x14')]);router[_0x2e4b('0x8')](_0x2e4b('0x15'),auth[_0x2e4b('0x9')](),controller[_0x2e4b('0x16')]);router[_0x2e4b('0x17')]('/',auth[_0x2e4b('0x9')](),controller[_0x2e4b('0x18')]);router['post'](_0x2e4b('0x19'),auth[_0x2e4b('0x9')](),controller[_0x2e4b('0x1a')]);router[_0x2e4b('0x17')]('/:id/contacts',auth[_0x2e4b('0x9')](),controller['addContacts']);router[_0x2e4b('0x17')](_0x2e4b('0x1b'),auth[_0x2e4b('0x9')](),controller['addCustomField']);router[_0x2e4b('0x17')](_0x2e4b('0x15'),auth[_0x2e4b('0x9')](),controller[_0x2e4b('0x1c')]);router[_0x2e4b('0x1d')]('/:id',auth[_0x2e4b('0x9')](),controller[_0x2e4b('0x1e')]);router[_0x2e4b('0x1f')](_0x2e4b('0xe'),auth['isAuthenticated'](),controller[_0x2e4b('0x20')]);router[_0x2e4b('0x1f')]('/:id/dispositions',auth[_0x2e4b('0x9')](),controller[_0x2e4b('0x21')]);router[_0x2e4b('0x1f')](_0x2e4b('0x15'),auth[_0x2e4b('0x9')](),controller[_0x2e4b('0x22')]);module[_0x2e4b('0x23')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 92352e2..ab03046 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 _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 +var _0xd705=['STRING','sequelize','exports','field'];(function(_0x8d5286,_0x1afb5c){var _0x45891a=function(_0x2ba20b){while(--_0x2ba20b){_0x8d5286['push'](_0x8d5286['shift']());}};_0x45891a(++_0x1afb5c);}(_0xd705,0x1a9));var _0x5d70=function(_0x38094c,_0x38e065){_0x38094c=_0x38094c-0x0;var _0x4ad11a=_0xd705[_0x38094c];return _0x4ad11a;};'use strict';var Sequelize=require(_0x5d70('0x0'));module[_0x5d70('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4173fd){return this['getDataValue'](_0x5d70('0x2'));}},'field':{'type':Sequelize[_0x5d70('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x5d70('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x5d70('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 6128ad3..ced75a8 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 _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 +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(_0x2d6f60,_0x58df1e){var _0x356352=function(_0x53cb72){while(--_0x53cb72){_0x2d6f60['push'](_0x2d6f60['shift']());}};_0x356352(++_0x58df1e);}(_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 afbb85f..8ef77ad 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 _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 +var _0x2945=['./condition.attributes','exports','define','Condition','tools_conditions','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4aadbd,_0x5714d3){var _0x5bd5a9=function(_0x1c0dfa){while(--_0x1c0dfa){_0x4aadbd['push'](_0x4aadbd['shift']());}};_0x5bd5a9(++_0x5714d3);}(_0x2945,0xef));var _0x5294=function(_0x2b23ab,_0x5ed076){_0x2b23ab=_0x2b23ab-0x0;var _0x36414c=_0x2945[_0x2b23ab];return _0x36414c;};'use strict';var _=require(_0x5294('0x0'));var util=require('util');var logger=require(_0x5294('0x1'))(_0x5294('0x2'));var moment=require('moment');var BPromise=require(_0x5294('0x3'));var rp=require(_0x5294('0x4'));var fs=require('fs');var path=require(_0x5294('0x5'));var rimraf=require(_0x5294('0x6'));var config=require(_0x5294('0x7'));var attributes=require(_0x5294('0x8'));module[_0x5294('0x9')]=function(_0x1e0e8a,_0x5667b0){return _0x1e0e8a[_0x5294('0xa')](_0x5294('0xb'),attributes,{'tableName':_0x5294('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 99c5ec3..680e700 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 _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 +var _0x6031=['../../config/environment','http','request','info','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','Condition,\x20%s,\x20%s','result','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc'];(function(_0x323163,_0x2d6465){var _0x269520=function(_0x20994f){while(--_0x20994f){_0x323163['push'](_0x323163['shift']());}};_0x269520(++_0x2d6465);}(_0x6031,0x71));var _0x1603=function(_0x58e7d7,_0x3a9929){_0x58e7d7=_0x58e7d7-0x0;var _0x1bef4e=_0x6031[_0x58e7d7];return _0x1bef4e;};'use strict';var _=require(_0x1603('0x0'));var util=require('util');var moment=require(_0x1603('0x1'));var BPromise=require(_0x1603('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1603('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1603('0x4'))(_0x1603('0x5'));var config=require(_0x1603('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1603('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1f547b,_0x227771,_0x726d20){return new BPromise(function(_0x3a1530,_0x3e7294){return client[_0x1603('0x8')](_0x1f547b,_0x726d20)['then'](function(_0x4ad9f8){logger[_0x1603('0x9')]('Condition,\x20%s,\x20%s',_0x227771,'request\x20sent');logger[_0x1603('0xa')](_0x1603('0xb'),_0x227771,_0x1603('0xc'),JSON['stringify'](_0x4ad9f8));if(_0x4ad9f8[_0x1603('0xd')]){if(_0x4ad9f8[_0x1603('0xd')]['code']===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0x227771,_0x4ad9f8[_0x1603('0xd')][_0x1603('0xe')]);return _0x3e7294(_0x4ad9f8['error'][_0x1603('0xe')]);}logger[_0x1603('0xd')](_0x1603('0xf'),_0x227771,_0x4ad9f8[_0x1603('0xd')][_0x1603('0xe')]);return _0x3a1530(_0x4ad9f8['error']['message']);}else{logger[_0x1603('0x9')](_0x1603('0xf'),_0x227771,_0x1603('0xc'));_0x3a1530(_0x4ad9f8[_0x1603('0x10')]['message']);}})['catch'](function(_0x1904b5){logger[_0x1603('0xd')](_0x1603('0xf'),_0x227771,_0x1904b5);_0x3e7294(_0x1904b5);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 6f22051..e148cd1 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 _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 +var _0x59c2=['put','/:id','isAuthenticated','update','delete','destroy','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller'];(function(_0x1bfcca,_0x28b479){var _0x4dce81=function(_0x24f7ea){while(--_0x24f7ea){_0x1bfcca['push'](_0x1bfcca['shift']());}};_0x4dce81(++_0x28b479);}(_0x59c2,0x103));var _0x259c=function(_0x1e48d3,_0x5d8c43){_0x1e48d3=_0x1e48d3-0x0;var _0x2852b1=_0x59c2[_0x1e48d3];return _0x2852b1;};'use strict';var multer=require(_0x259c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x259c('0x1')]();var fs_extra=require(_0x259c('0x2'));var auth=require(_0x259c('0x3'));var interaction=require(_0x259c('0x4'));var config=require(_0x259c('0x5'));var controller=require(_0x259c('0x6'));router[_0x259c('0x7')](_0x259c('0x8'),auth[_0x259c('0x9')](),controller[_0x259c('0xa')]);router[_0x259c('0xb')]('/:id',auth[_0x259c('0x9')](),controller[_0x259c('0xc')]);module[_0x259c('0xd')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 2d9bed6..c45f967 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 _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 +var _0xa374=['name','INTEGER','exports'];(function(_0x33b2bd,_0x1ef479){var _0xba7d57=function(_0x443b3f){while(--_0x443b3f){_0x33b2bd['push'](_0x33b2bd['shift']());}};_0xba7d57(++_0x1ef479);}(_0xa374,0xe0));var _0x4a37=function(_0x3b5efe,_0x2752ce){_0x3b5efe=_0x3b5efe-0x0;var _0x9a1dce=_0xa374[_0x3b5efe];return _0x9a1dce;};'use strict';var Sequelize=require('sequelize');module[_0x4a37('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4a37('0x1')},'OrderBy':{'type':Sequelize[_0x4a37('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 6b39170..1707108 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 _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 +var _0x351d=['path','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','end','status','json','limit','count','offset','apply','reject','save','update','destroy','then','get','ContactItemTypes','error','stack','name','send','map','ContactItemType','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','show','length','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util'];(function(_0x23fd4d,_0x49dd20){var _0x2d7f84=function(_0x58959c){while(--_0x58959c){_0x23fd4d['push'](_0x23fd4d['shift']());}};_0x2d7f84(++_0x49dd20);}(_0x351d,0x90));var _0xd351=function(_0x15e860,_0x2b0fa8){_0x15e860=_0x15e860-0x0;var _0x11e969=_0x351d[_0x15e860];return _0x11e969;};'use strict';var emlformat=require(_0xd351('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd351('0x1'));var jsonpatch=require(_0xd351('0x2'));var rp=require(_0xd351('0x3'));var moment=require('moment');var BPromise=require(_0xd351('0x4'));var Mustache=require('mustache');var util=require(_0xd351('0x5'));var path=require(_0xd351('0x6'));var sox=require('sox');var csv=require(_0xd351('0x7'));var ejs=require(_0xd351('0x8'));var fs=require('fs');var fs_extra=require(_0xd351('0x9'));var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd351('0xe'));var as=require(_0xd351('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd351('0x10'))(_0xd351('0x11'));var utils=require('../../config/utils');var config=require(_0xd351('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eb40c,_0x15549a){_0x15549a=_0x15549a||0xcc;return function(_0x23445f){if(_0x23445f){return _0x3eb40c[_0xd351('0x13')](_0x15549a);}return _0x3eb40c['status'](_0x15549a)[_0xd351('0x14')]();};}function respondWithResult(_0x316cf6,_0x597d7c){_0x597d7c=_0x597d7c||0xc8;return function(_0xc5a145){if(_0xc5a145){return _0x316cf6[_0xd351('0x15')](_0x597d7c)[_0xd351('0x16')](_0xc5a145);}};}function respondWithFilteredResult(_0xf1c285,_0x3867fb){return function(_0x4d238c){if(_0x4d238c){var _0x9f790f=typeof _0x3867fb['offset']==='undefined'&&typeof _0x3867fb[_0xd351('0x17')]==='undefined';var _0x21e591=_0x4d238c[_0xd351('0x18')];var _0x4e0164=_0x9f790f?0x0:_0x3867fb['offset'];var _0x1e1a3c=_0x9f790f?_0x4d238c[_0xd351('0x18')]:_0x3867fb[_0xd351('0x19')]+_0x3867fb[_0xd351('0x17')];var _0x51f265;if(_0x1e1a3c>=_0x21e591){_0x1e1a3c=_0x21e591;_0x51f265=0xc8;}else{_0x51f265=0xce;}_0xf1c285[_0xd351('0x15')](_0x51f265);return _0xf1c285['set']('Content-Range',_0x4e0164+'-'+_0x1e1a3c+'/'+_0x21e591)[_0xd351('0x16')](_0x4d238c);}return null;};}function patchUpdates(_0x4a427b){return function(_0x33b1e5){try{jsonpatch[_0xd351('0x1a')](_0x33b1e5,_0x4a427b,!![]);}catch(_0x3634c9){return BPromise[_0xd351('0x1b')](_0x3634c9);}return _0x33b1e5[_0xd351('0x1c')]();};}function saveUpdates(_0x53e729,_0x18625b){return function(_0xbbc58){if(_0xbbc58){return _0xbbc58[_0xd351('0x1d')](_0x53e729)['then'](function(_0x1ce7f7){return _0x1ce7f7;});}return null;};}function removeEntity(_0x2d9aa0,_0x365bbc){return function(_0x59fb6d){if(_0x59fb6d){return _0x59fb6d[_0xd351('0x1e')]()[_0xd351('0x1f')](function(){var _0x4626c4=_0x59fb6d[_0xd351('0x20')]({'plain':!![]});var _0x489c9a=_0xd351('0x21');return db['UserProfileResource'][_0xd351('0x1e')]({'where':{'type':_0x489c9a,'resourceId':_0x4626c4['id']}})[_0xd351('0x1f')](function(){return _0x59fb6d;});})['then'](function(){_0x2d9aa0[_0xd351('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50d67e,_0x1d0cb1){return function(_0x560be9){if(!_0x560be9){_0x50d67e['sendStatus'](0x194);}return _0x560be9;};}function handleError(_0x134580,_0x555a50){_0x555a50=_0x555a50||0x1f4;return function(_0x38471c){logger[_0xd351('0x22')](_0x38471c[_0xd351('0x23')]);if(_0x38471c['name']){delete _0x38471c[_0xd351('0x24')];}_0x134580['status'](_0x555a50)[_0xd351('0x25')](_0x38471c);};}exports['index']=function(_0x5f07b1,_0xeb4da9){var _0x38c82f={},_0x3f9ef3={},_0x33b43d={'count':0x0,'rows':[]};var _0x48aa96=_[_0xd351('0x26')](db[_0xd351('0x27')][_0xd351('0x28')],function(_0x41da60){return{'name':_0x41da60[_0xd351('0x29')],'type':_0x41da60[_0xd351('0x2a')][_0xd351('0x2b')]};});_0x3f9ef3[_0xd351('0x2c')]=_[_0xd351('0x26')](_0x48aa96,'name');_0x3f9ef3[_0xd351('0x2d')]=_[_0xd351('0x2e')](_0x5f07b1[_0xd351('0x2d')]);_0x3f9ef3[_0xd351('0x2f')]=_['intersection'](_0x3f9ef3[_0xd351('0x2c')],_0x3f9ef3[_0xd351('0x2d')]);_0x38c82f[_0xd351('0x30')]=_[_0xd351('0x31')](_0x3f9ef3[_0xd351('0x2c')],qs[_0xd351('0x32')](_0x5f07b1[_0xd351('0x2d')][_0xd351('0x32')]));_0x38c82f[_0xd351('0x30')]=_0x38c82f['attributes']['length']?_0x38c82f[_0xd351('0x30')]:_0x3f9ef3[_0xd351('0x2c')];if(!_0x5f07b1[_0xd351('0x2d')][_0xd351('0x33')](_0xd351('0x34'))){_0x38c82f[_0xd351('0x17')]=qs['limit'](_0x5f07b1['query'][_0xd351('0x17')]);_0x38c82f['offset']=qs[_0xd351('0x19')](_0x5f07b1[_0xd351('0x2d')][_0xd351('0x19')]);}_0x38c82f[_0xd351('0x35')]=qs[_0xd351('0x36')](_0x5f07b1[_0xd351('0x2d')][_0xd351('0x36')]);_0x38c82f[_0xd351('0x37')]=qs[_0xd351('0x2f')](_[_0xd351('0x38')](_0x5f07b1[_0xd351('0x2d')],_0x3f9ef3['filters']),_0x48aa96);if(_0x5f07b1[_0xd351('0x2d')]['filter']){_0x38c82f[_0xd351('0x37')]=_[_0xd351('0x39')](_0x38c82f[_0xd351('0x37')],{'$or':_[_0xd351('0x26')](_0x48aa96,function(_0x3b42e7){if(_0x3b42e7[_0xd351('0x2a')]!=='VIRTUAL'){var _0x3ad98e={};_0x3ad98e[_0x3b42e7[_0xd351('0x24')]]={'$like':'%'+_0x5f07b1['query'][_0xd351('0x3a')]+'%'};return _0x3ad98e;}})});}_0x38c82f=_[_0xd351('0x39')]({},_0x38c82f,_0x5f07b1[_0xd351('0x3b')]);var _0x1fc216={'where':_0x38c82f[_0xd351('0x37')]};return db['ContactItemType']['count'](_0x1fc216)[_0xd351('0x1f')](function(_0x3935aa){_0x33b43d['count']=_0x3935aa;if(_0x5f07b1['query'][_0xd351('0x3c')]){_0x38c82f[_0xd351('0x3d')]=[{'all':!![]}];}return db['ContactItemType']['findAll'](_0x38c82f);})[_0xd351('0x1f')](function(_0x18f9d1){_0x33b43d[_0xd351('0x3e')]=_0x18f9d1;return _0x33b43d;})[_0xd351('0x1f')](respondWithFilteredResult(_0xeb4da9,_0x38c82f))[_0xd351('0x3f')](handleError(_0xeb4da9,null));};exports[_0xd351('0x40')]=function(_0x6192c3,_0x110458){var _0x129605={'raw':!![],'where':{'id':_0x6192c3['params']['id']}},_0x553360={};_0x553360[_0xd351('0x2c')]=_[_0xd351('0x2e')](db[_0xd351('0x27')][_0xd351('0x28')]);_0x553360[_0xd351('0x2d')]=_[_0xd351('0x2e')](_0x6192c3[_0xd351('0x2d')]);_0x553360[_0xd351('0x2f')]=_[_0xd351('0x31')](_0x553360[_0xd351('0x2c')],_0x553360[_0xd351('0x2d')]);_0x129605[_0xd351('0x30')]=_[_0xd351('0x31')](_0x553360[_0xd351('0x2c')],qs[_0xd351('0x32')](_0x6192c3[_0xd351('0x2d')]['fields']));_0x129605[_0xd351('0x30')]=_0x129605[_0xd351('0x30')][_0xd351('0x41')]?_0x129605['attributes']:_0x553360[_0xd351('0x2c')];if(_0x6192c3[_0xd351('0x2d')][_0xd351('0x3c')]){_0x129605[_0xd351('0x3d')]=[{'all':!![]}];}_0x129605=_[_0xd351('0x39')]({},_0x129605,_0x6192c3['options']);return db[_0xd351('0x27')]['find'](_0x129605)[_0xd351('0x1f')](handleEntityNotFound(_0x110458,null))[_0xd351('0x1f')](respondWithResult(_0x110458,null))['catch'](handleError(_0x110458,null));};exports['create']=function(_0x1bd727,_0x444206){return db[_0xd351('0x27')]['create'](_0x1bd727[_0xd351('0x42')],{})[_0xd351('0x1f')](function(_0x548d90){var _0xf3ce5=_0x1bd727['user'][_0xd351('0x20')]({'plain':!![]});if(!_0xf3ce5)throw new Error(_0xd351('0x43'));if(_0xf3ce5['role']==='user'){var _0x25ea1e=_0x548d90['get']({'plain':!![]});var _0xf9f375=_0xd351('0x21');return db[_0xd351('0x44')]['find']({'where':{'name':_0xf9f375,'userProfileId':_0xf3ce5[_0xd351('0x45')]},'raw':!![]})['then'](function(_0x5527da){if(_0x5527da&&_0x5527da['autoAssociation']===0x0){return db[_0xd351('0x46')][_0xd351('0x47')]({'name':_0x25ea1e[_0xd351('0x24')],'resourceId':_0x25ea1e['id'],'type':_0x5527da['name'],'sectionId':_0x5527da['id']},{})['then'](function(){return _0x548d90;});}else{return _0x548d90;}})[_0xd351('0x3f')](function(_0x42f248){logger['error'](_0xd351('0x48'),_0x42f248);throw _0x42f248;});}return _0x548d90;})[_0xd351('0x1f')](respondWithResult(_0x444206,0xc9))['catch'](handleError(_0x444206,null));};exports[_0xd351('0x1d')]=function(_0x59ab0f,_0x22394e){if(_0x59ab0f['body']['id']){delete _0x59ab0f[_0xd351('0x42')]['id'];}return db[_0xd351('0x27')][_0xd351('0x49')]({'where':{'id':_0x59ab0f[_0xd351('0x4a')]['id']}})[_0xd351('0x1f')](handleEntityNotFound(_0x22394e,null))[_0xd351('0x1f')](saveUpdates(_0x59ab0f[_0xd351('0x42')],null))['then'](respondWithResult(_0x22394e,null))['catch'](handleError(_0x22394e,null));};exports[_0xd351('0x1e')]=function(_0x624224,_0x53a9da){return db[_0xd351('0x27')][_0xd351('0x49')]({'where':{'id':_0x624224[_0xd351('0x4a')]['id']}})['then'](handleEntityNotFound(_0x53a9da,null))[_0xd351('0x1f')](db['CmContactHasItem']['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x624224[_0xd351('0x4a')]['id']}}))[_0xd351('0x1f')](removeEntity(_0x53a9da,null))['catch'](handleError(_0x53a9da,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 9e9195a..66b588e 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 _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 +var _0xdeea=['request-promise','path','../../config/environment','./contactItemType.attributes','exports','ContactItemType','lodash','util','moment','bluebird'];(function(_0x4abb57,_0xb659e3){var _0x5f0371=function(_0x503c2a){while(--_0x503c2a){_0x4abb57['push'](_0x4abb57['shift']());}};_0x5f0371(++_0xb659e3);}(_0xdeea,0xf6));var _0xadee=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xdeea[_0x44bcb0];return _0xfaf881;};'use strict';var _=require(_0xadee('0x0'));var util=require(_0xadee('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xadee('0x2'));var BPromise=require(_0xadee('0x3'));var rp=require(_0xadee('0x4'));var fs=require('fs');var path=require(_0xadee('0x5'));var rimraf=require('rimraf');var config=require(_0xadee('0x6'));var attributes=require(_0xadee('0x7'));module[_0xadee('0x8')]=function(_0x5a72ae,_0x504b82){return _0x5a72ae['define'](_0xadee('0x9'),attributes,{'tableName':'tools_contact_item_types','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 beea5c8..cdebd80 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 _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 +var _0xa1aa=['request','info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x38576d,_0x527dc7){var _0x32534a=function(_0x2fd590){while(--_0x2fd590){_0x38576d['push'](_0x38576d['shift']());}};_0x32534a(++_0x527dc7);}(_0xa1aa,0x81));var _0xaa1a=function(_0x19e570,_0x23be57){_0x19e570=_0x19e570-0x0;var _0x218c87=_0xa1aa[_0x19e570];return _0x218c87;};'use strict';var _=require(_0xaa1a('0x0'));var util=require(_0xaa1a('0x1'));var moment=require(_0xaa1a('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa1a('0x3'));var fs=require('fs');var Redis=require(_0xaa1a('0x4'));var db=require(_0xaa1a('0x5'))['db'];var utils=require(_0xaa1a('0x6'));var logger=require(_0xaa1a('0x7'))('rpc');var config=require(_0xaa1a('0x8'));var jayson=require(_0xaa1a('0x9'));var client=jayson['client'][_0xaa1a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28d0a9,_0x4a20b6,_0x58d242){return new BPromise(function(_0x309dba,_0x12c5e8){return client[_0xaa1a('0xb')](_0x28d0a9,_0x58d242)['then'](function(_0x15b73b){logger[_0xaa1a('0xc')](_0xaa1a('0xd'),_0x4a20b6,_0xaa1a('0xe'));logger['debug'](_0xaa1a('0xf'),_0x4a20b6,_0xaa1a('0xe'),JSON[_0xaa1a('0x10')](_0x15b73b));if(_0x15b73b[_0xaa1a('0x11')]){if(_0x15b73b['error']['code']===0x1f4){logger[_0xaa1a('0x11')](_0xaa1a('0xd'),_0x4a20b6,_0x15b73b['error']['message']);return _0x12c5e8(_0x15b73b[_0xaa1a('0x11')]['message']);}logger['error'](_0xaa1a('0xd'),_0x4a20b6,_0x15b73b['error']['message']);return _0x309dba(_0x15b73b[_0xaa1a('0x11')][_0xaa1a('0x12')]);}else{logger['info']('ContactItemType,\x20%s,\x20%s',_0x4a20b6,_0xaa1a('0xe'));_0x309dba(_0x15b73b['result'][_0xaa1a('0x12')]);}})[_0xaa1a('0x13')](function(_0x318d02){logger[_0xaa1a('0x11')](_0xaa1a('0xd'),_0x4a20b6,_0x318d02);_0x12c5e8(_0x318d02);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index e4b9023..914812b 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 _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 +var _0x16ec=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','path'];(function(_0x2462d4,_0x243523){var _0x178eec=function(_0x524d05){while(--_0x524d05){_0x2462d4['push'](_0x2462d4['shift']());}};_0x178eec(++_0x243523);}(_0x16ec,0x1a1));var _0xc16e=function(_0x493c4c,_0x13c20e){_0x493c4c=_0x493c4c-0x0;var _0x52dab0=_0x16ec[_0x493c4c];return _0x52dab0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc16e('0x0'));var timeout=require(_0xc16e('0x1'));var express=require(_0xc16e('0x2'));var router=express[_0xc16e('0x3')]();var fs_extra=require(_0xc16e('0x4'));var auth=require(_0xc16e('0x5'));var interaction=require(_0xc16e('0x6'));var config=require('../../config/environment');var controller=require(_0xc16e('0x7'));router[_0xc16e('0x8')]('/',auth[_0xc16e('0x9')](),controller[_0xc16e('0xa')]);router['get'](_0xc16e('0xb'),auth[_0xc16e('0x9')](),controller[_0xc16e('0xc')]);router[_0xc16e('0xd')]('/',auth[_0xc16e('0x9')](),controller[_0xc16e('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc16e('0xf')]);router[_0xc16e('0x10')](_0xc16e('0xb'),auth[_0xc16e('0x9')](),controller[_0xc16e('0x11')]);module[_0xc16e('0x12')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index f0053e0..492207d 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 _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 +var _0xb7e7=['STRING','sequelize'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb7e7[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 24bcda9..0576296 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 _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 +var _0x812a=['socket.io-emitter','./dashboard.socket','register','status','end','json','limit','undefined','count','offset','Content-Range','apply','save','then','get','CustomDashboards','UserProfileResource','destroy','error','stack','name','send','index','map','Dashboard','fieldName','type','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','model','rawAttributes','find','create','body','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','autoAssociation','update','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','voice','web-report','attrReport','attrRefresh','stringify','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost'];(function(_0x2412c4,_0x1434e6){var _0x78f95b=function(_0x4c3de5){while(--_0x4c3de5){_0x2412c4['push'](_0x2412c4['shift']());}};_0x78f95b(++_0x1434e6);}(_0x812a,0x64));var _0xa812=function(_0x1bf5a9,_0xb20fae){_0x1bf5a9=_0x1bf5a9-0x0;var _0x1494b9=_0x812a[_0x1bf5a9];return _0x1494b9;};'use strict';var emlformat=require(_0xa812('0x0'));var rimraf=require(_0xa812('0x1'));var zipdir=require(_0xa812('0x2'));var jsonpatch=require(_0xa812('0x3'));var rp=require(_0xa812('0x4'));var moment=require(_0xa812('0x5'));var BPromise=require(_0xa812('0x6'));var Mustache=require('mustache');var util=require(_0xa812('0x7'));var path=require(_0xa812('0x8'));var sox=require(_0xa812('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa812('0xa'));var _=require(_0xa812('0xb'));var squel=require(_0xa812('0xc'));var crypto=require(_0xa812('0xd'));var jsforce=require(_0xa812('0xe'));var deskjs=require(_0xa812('0xf'));var toCsv=require(_0xa812('0x10'));var querystring=require(_0xa812('0x11'));var Papa=require('papaparse');var Redis=require(_0xa812('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa812('0x13'));var as=require(_0xa812('0x14'));var hardwareService=require(_0xa812('0x15'));var logger=require(_0xa812('0x16'))('api');var utils=require(_0xa812('0x17'));var config=require(_0xa812('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa812('0x19'))['db'];config[_0xa812('0x1a')]=_[_0xa812('0x1b')](config['redis'],{'host':_0xa812('0x1c'),'port':0x18eb});var socket=require(_0xa812('0x1d'))(new Redis(config[_0xa812('0x1a')]));require(_0xa812('0x1e'))[_0xa812('0x1f')](socket);function respondWithStatusCode(_0x41c4f8,_0xd5005){_0xd5005=_0xd5005||0xcc;return function(_0x2f89ef){if(_0x2f89ef){return _0x41c4f8['sendStatus'](_0xd5005);}return _0x41c4f8[_0xa812('0x20')](_0xd5005)[_0xa812('0x21')]();};}function respondWithResult(_0x134cbb,_0x4fa496){_0x4fa496=_0x4fa496||0xc8;return function(_0x596a74){if(_0x596a74){return _0x134cbb[_0xa812('0x20')](_0x4fa496)[_0xa812('0x22')](_0x596a74);}};}function respondWithFilteredResult(_0x375b9e,_0x572116){return function(_0x2c157a){if(_0x2c157a){var _0xe9d23a=typeof _0x572116['offset']==='undefined'&&typeof _0x572116[_0xa812('0x23')]===_0xa812('0x24');var _0x1cd649=_0x2c157a[_0xa812('0x25')];var _0x3079d2=_0xe9d23a?0x0:_0x572116[_0xa812('0x26')];var _0x2a9725=_0xe9d23a?_0x2c157a[_0xa812('0x25')]:_0x572116[_0xa812('0x26')]+_0x572116[_0xa812('0x23')];var _0x3aeeba;if(_0x2a9725>=_0x1cd649){_0x2a9725=_0x1cd649;_0x3aeeba=0xc8;}else{_0x3aeeba=0xce;}_0x375b9e[_0xa812('0x20')](_0x3aeeba);return _0x375b9e['set'](_0xa812('0x27'),_0x3079d2+'-'+_0x2a9725+'/'+_0x1cd649)['json'](_0x2c157a);}return null;};}function patchUpdates(_0x2140a3){return function(_0x39dc3f){try{jsonpatch[_0xa812('0x28')](_0x39dc3f,_0x2140a3,!![]);}catch(_0x455bc5){return BPromise['reject'](_0x455bc5);}return _0x39dc3f[_0xa812('0x29')]();};}function saveUpdates(_0x14056c,_0x18d6c2){return function(_0x3b766f){if(_0x3b766f){return _0x3b766f['update'](_0x14056c)[_0xa812('0x2a')](function(_0x551788){return _0x551788;});}return null;};}function removeEntity(_0x23418a,_0x23d021){return function(_0x16d568){if(_0x16d568){return _0x16d568['destroy']()['then'](function(){var _0x2fef0c=_0x16d568[_0xa812('0x2b')]({'plain':!![]});var _0x2d38fc=_0xa812('0x2c');return db[_0xa812('0x2d')][_0xa812('0x2e')]({'where':{'type':_0x2d38fc,'resourceId':_0x2fef0c['id']}})[_0xa812('0x2a')](function(){return _0x16d568;});})['then'](function(){_0x23418a[_0xa812('0x20')](0xcc)[_0xa812('0x21')]();});}};}function handleEntityNotFound(_0x2c29e7,_0x15664d){return function(_0x467031){if(!_0x467031){_0x2c29e7['sendStatus'](0x194);}return _0x467031;};}function handleError(_0x22a924,_0x2ef94a){_0x2ef94a=_0x2ef94a||0x1f4;return function(_0x3a3ff5){logger[_0xa812('0x2f')](_0x3a3ff5[_0xa812('0x30')]);if(_0x3a3ff5[_0xa812('0x31')]){delete _0x3a3ff5[_0xa812('0x31')];}_0x22a924[_0xa812('0x20')](_0x2ef94a)[_0xa812('0x32')](_0x3a3ff5);};}exports[_0xa812('0x33')]=function(_0x3b97ee,_0x5160ae){var _0x196037={},_0x545012={},_0xa3b87e={'count':0x0,'rows':[]};var _0x35ab42=_[_0xa812('0x34')](db[_0xa812('0x35')]['rawAttributes'],function(_0x4f9b66){return{'name':_0x4f9b66[_0xa812('0x36')],'type':_0x4f9b66[_0xa812('0x37')]['key']};});_0x545012['model']=_['map'](_0x35ab42,_0xa812('0x31'));_0x545012[_0xa812('0x38')]=_[_0xa812('0x39')](_0x3b97ee[_0xa812('0x38')]);_0x545012[_0xa812('0x3a')]=_[_0xa812('0x3b')](_0x545012['model'],_0x545012[_0xa812('0x38')]);_0x196037[_0xa812('0x3c')]=_['intersection'](_0x545012['model'],qs[_0xa812('0x3d')](_0x3b97ee[_0xa812('0x38')][_0xa812('0x3d')]));_0x196037[_0xa812('0x3c')]=_0x196037[_0xa812('0x3c')][_0xa812('0x3e')]?_0x196037[_0xa812('0x3c')]:_0x545012['model'];if(!_0x3b97ee[_0xa812('0x38')][_0xa812('0x3f')](_0xa812('0x40'))){_0x196037[_0xa812('0x23')]=qs[_0xa812('0x23')](_0x3b97ee['query'][_0xa812('0x23')]);_0x196037[_0xa812('0x26')]=qs['offset'](_0x3b97ee[_0xa812('0x38')][_0xa812('0x26')]);}_0x196037[_0xa812('0x41')]=qs[_0xa812('0x42')](_0x3b97ee['query'][_0xa812('0x42')]);_0x196037['where']=qs[_0xa812('0x3a')](_[_0xa812('0x43')](_0x3b97ee[_0xa812('0x38')],_0x545012[_0xa812('0x3a')]),_0x35ab42);if(_0x3b97ee[_0xa812('0x38')][_0xa812('0x44')]){_0x196037[_0xa812('0x45')]=_[_0xa812('0x46')](_0x196037['where'],{'$or':_[_0xa812('0x34')](_0x35ab42,function(_0x3acebf){if(_0x3acebf[_0xa812('0x37')]!=='VIRTUAL'){var _0x194953={};_0x194953[_0x3acebf['name']]={'$like':'%'+_0x3b97ee[_0xa812('0x38')][_0xa812('0x44')]+'%'};return _0x194953;}})});}_0x196037=_[_0xa812('0x46')]({},_0x196037,_0x3b97ee[_0xa812('0x47')]);var _0x2653a7={'where':_0x196037['where']};return db[_0xa812('0x35')][_0xa812('0x25')](_0x2653a7)[_0xa812('0x2a')](function(_0x108ee5){_0xa3b87e['count']=_0x108ee5;if(_0x3b97ee['query'][_0xa812('0x48')]){_0x196037[_0xa812('0x49')]=[{'all':!![]}];}return db[_0xa812('0x35')]['findAll'](_0x196037);})[_0xa812('0x2a')](function(_0x41500c){_0xa3b87e[_0xa812('0x4a')]=_0x41500c;return _0xa3b87e;})[_0xa812('0x2a')](respondWithFilteredResult(_0x5160ae,_0x196037))[_0xa812('0x4b')](handleError(_0x5160ae,null));};exports[_0xa812('0x4c')]=function(_0x32614a,_0x128a75){var _0x1bed14={'raw':![],'where':{'id':_0x32614a[_0xa812('0x4d')]['id']}},_0xe09277={};_0xe09277[_0xa812('0x4e')]=_['keys'](db[_0xa812('0x35')][_0xa812('0x4f')]);_0xe09277[_0xa812('0x38')]=_[_0xa812('0x39')](_0x32614a[_0xa812('0x38')]);_0xe09277[_0xa812('0x3a')]=_[_0xa812('0x3b')](_0xe09277[_0xa812('0x4e')],_0xe09277['query']);_0x1bed14[_0xa812('0x3c')]=_[_0xa812('0x3b')](_0xe09277[_0xa812('0x4e')],qs[_0xa812('0x3d')](_0x32614a[_0xa812('0x38')][_0xa812('0x3d')]));_0x1bed14['attributes']=_0x1bed14[_0xa812('0x3c')][_0xa812('0x3e')]?_0x1bed14['attributes']:_0xe09277['model'];if(_0x32614a['query']['includeAll']){_0x1bed14[_0xa812('0x49')]=[{'all':!![]}];}_0x1bed14=_[_0xa812('0x46')]({},_0x1bed14,_0x32614a[_0xa812('0x47')]);return db[_0xa812('0x35')][_0xa812('0x50')](_0x1bed14)[_0xa812('0x2a')](handleEntityNotFound(_0x128a75,null))[_0xa812('0x2a')](respondWithResult(_0x128a75,null))['catch'](handleError(_0x128a75,null));};exports[_0xa812('0x51')]=function(_0x83f74b,_0xc44615){return db[_0xa812('0x35')][_0xa812('0x51')](_0x83f74b[_0xa812('0x52')],{})[_0xa812('0x2a')](function(_0x4dbbb4){var _0x29c4fc=_0x83f74b['user'][_0xa812('0x2b')]({'plain':!![]});if(!_0x29c4fc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29c4fc['role']===_0xa812('0x53')){var _0x3806ac=_0x4dbbb4[_0xa812('0x2b')]({'plain':!![]});var _0x3db03f=_0xa812('0x2c');return db[_0xa812('0x54')][_0xa812('0x50')]({'where':{'name':_0x3db03f,'userProfileId':_0x29c4fc[_0xa812('0x55')]},'raw':!![]})[_0xa812('0x2a')](function(_0x3cfaf9){if(_0x3cfaf9&&_0x3cfaf9['autoAssociation']===0x0){return db[_0xa812('0x2d')]['create']({'name':_0x3806ac[_0xa812('0x31')],'resourceId':_0x3806ac['id'],'type':_0x3cfaf9[_0xa812('0x31')],'sectionId':_0x3cfaf9['id']},{})['then'](function(){return _0x4dbbb4;});}else{return _0x4dbbb4;}})['catch'](function(_0x32cbc8){logger[_0xa812('0x2f')](_0xa812('0x56'),_0x32cbc8);throw _0x32cbc8;});}return _0x4dbbb4;})['then'](respondWithResult(_0xc44615,0xc9))[_0xa812('0x4b')](handleError(_0xc44615,null));};exports[_0xa812('0x57')]=function(_0x2d0140,_0x4f9f76){var _0x432b5e={'where':{'id':_0x2d0140[_0xa812('0x4d')]['id']}},_0x1f4be2={};_0x1f4be2['model']=_[_0xa812('0x39')](db['Dashboard'][_0xa812('0x4f')]);_0x432b5e[_0xa812('0x3c')]=_[_0xa812('0x3b')](_0x1f4be2[_0xa812('0x4e')],qs['fields'](_0x2d0140['query'][_0xa812('0x3d')]));_0x432b5e['attributes']=_0x432b5e[_0xa812('0x3c')]['length']?_0x432b5e[_0xa812('0x3c')]:_0x1f4be2['model'];if(_0x2d0140['query'][_0xa812('0x48')]){_0x432b5e['include']=[{'all':!![]}];}_0x432b5e=_[_0xa812('0x46')]({},_0x432b5e,_0x2d0140['options']);return db[_0xa812('0x35')][_0xa812('0x50')](_0x432b5e)['then'](handleEntityNotFound(_0x4f9f76,null))[_0xa812('0x2a')](function(_0x15204c){if(_0x15204c){var _0x381ba2=_0x15204c['get']({'plain':!![]});_0x381ba2=qs[_0xa812('0x58')](_0x381ba2,['id',_0xa812('0x59'),_0xa812('0x5a')]);_0x2d0140[_0xa812('0x52')]=_[_0xa812('0x58')](_0x2d0140[_0xa812('0x52')],['id',_0xa812('0x59'),_0xa812('0x5a')]);return db[_0xa812('0x35')][_0xa812('0x51')](_['merge'](_0x381ba2,_0x2d0140['body']),{'include':_0x2d0140[_0xa812('0x38')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2695fe){var _0x821a8=_0x2d0140['user']['get']({'plain':!![]});if(!_0x821a8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x821a8[_0xa812('0x5b')]===_0xa812('0x53')){var _0x3c44ca=_0x2695fe['get']({'plain':!![]});var _0x5d68bb=_0xa812('0x2c');return db[_0xa812('0x54')][_0xa812('0x50')]({'where':{'name':_0x5d68bb,'userProfileId':_0x821a8['userProfileId']},'raw':!![]})[_0xa812('0x2a')](function(_0x252e71){if(_0x252e71&&_0x252e71[_0xa812('0x5c')]===0x0){return db['UserProfileResource'][_0xa812('0x51')]({'name':_0x3c44ca['name'],'resourceId':_0x3c44ca['id'],'type':_0x252e71['name'],'sectionId':_0x252e71['id']},{})[_0xa812('0x2a')](function(){return _0x2695fe;});}else{return _0x2695fe;}})[_0xa812('0x4b')](function(_0x4f4f2d){logger[_0xa812('0x2f')](_0xa812('0x56'),_0x4f4f2d);throw _0x4f4f2d;});}return _0x2695fe;});}})[_0xa812('0x2a')](respondWithResult(_0x4f9f76,0xc9))[_0xa812('0x4b')](handleError(_0x4f9f76,null));};exports[_0xa812('0x5d')]=function(_0xeaf2a9,_0x3e958c){if(_0xeaf2a9['body']['id']){delete _0xeaf2a9[_0xa812('0x52')]['id'];}return db[_0xa812('0x35')][_0xa812('0x50')]({'where':{'id':_0xeaf2a9['params']['id']}})[_0xa812('0x2a')](handleEntityNotFound(_0x3e958c,null))[_0xa812('0x2a')](saveUpdates(_0xeaf2a9[_0xa812('0x52')],null))['then'](respondWithResult(_0x3e958c,null))[_0xa812('0x4b')](handleError(_0x3e958c,null));};exports[_0xa812('0x2e')]=function(_0x305974,_0x2b998f){return db[_0xa812('0x35')]['find']({'where':{'id':_0x305974[_0xa812('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2b998f,null))[_0xa812('0x2a')](removeEntity(_0x2b998f,null))[_0xa812('0x4b')](handleError(_0x2b998f,null));};function widgetAttributes(_0x467cfd){try{switch(_0x467cfd['type']){case'iframe':return[{'name':_0xa812('0x5e'),'value':_0x467cfd['attrUrl']||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd[_0xa812('0x5f')][0x0]?_0x467cfd['attrs'][0x0][_0xa812('0x60')]:undefined)||_0xa812('0x61')}];case _0xa812('0x62'):return[{'name':_0xa812('0x63'),'value':_0x467cfd[_0xa812('0x63')]||(_0x467cfd['attrs']&&_0x467cfd[_0xa812('0x5f')][0x0]?_0x467cfd[_0xa812('0x5f')][0x0][_0xa812('0x60')]:undefined)||''}];case'clock':return[{'name':_0xa812('0x64'),'value':_0x467cfd[_0xa812('0x64')]||(_0x467cfd['attrs']&&_0x467cfd[_0xa812('0x5f')][0x0]?_0x467cfd['attrs'][0x0][_0xa812('0x60')]:undefined)||_0xa812('0x65')},{'name':_0xa812('0x66'),'value':_0x467cfd[_0xa812('0x66')]||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd[_0xa812('0x5f')][0x1]?_0x467cfd['attrs'][0x1][_0xa812('0x60')]:undefined)||_0xa812('0x67')},{'name':_0xa812('0x68'),'value':_0x467cfd[_0xa812('0x68')]||(_0x467cfd['attrs']&&_0x467cfd[_0xa812('0x5f')][0x2]?_0x467cfd['attrs'][0x2]['value']:undefined)||0xc}];case _0xa812('0x69'):return[{'name':'attrMetric','value':_0x467cfd['attrMetric']||(_0x467cfd['attrs']&&_0x467cfd[_0xa812('0x5f')][0x0]?_0x467cfd[_0xa812('0x5f')][0x0][_0xa812('0x60')]:undefined)||'total'},{'name':_0xa812('0x6a'),'value':_0x467cfd[_0xa812('0x6a')]||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd[_0xa812('0x5f')][0x1]?_0x467cfd[_0xa812('0x5f')][0x1]['value']:undefined)||[]},{'name':_0xa812('0x68'),'value':_0x467cfd[_0xa812('0x68')]||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd['attrs'][0x2]?_0x467cfd['attrs'][0x2][_0xa812('0x60')]:undefined)||0x14},{'name':_0xa812('0x6b'),'value':_0x467cfd[_0xa812('0x6b')]||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd[_0xa812('0x5f')][0x3]?_0x467cfd[_0xa812('0x5f')][0x3]['value']:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x467cfd[_0xa812('0x6c')]||(_0x467cfd['attrs']&&_0x467cfd[_0xa812('0x5f')][0x4]?_0x467cfd['attrs'][0x4][_0xa812('0x60')]:undefined)||''},{'name':_0xa812('0x6d'),'value':_0x467cfd['attrFaxAccounts']||(_0x467cfd['attrs']&&_0x467cfd[_0xa812('0x5f')][0x5]?_0x467cfd[_0xa812('0x5f')][0x5][_0xa812('0x60')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x467cfd[_0xa812('0x6e')]||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd[_0xa812('0x5f')][0x6]?_0x467cfd[_0xa812('0x5f')][0x6][_0xa812('0x60')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x467cfd[_0xa812('0x6f')]||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd[_0xa812('0x5f')][0x7]?_0x467cfd[_0xa812('0x5f')][0x7][_0xa812('0x60')]:undefined)||''},{'name':_0xa812('0x70'),'value':_0x467cfd[_0xa812('0x70')]||(_0x467cfd['attrs']&&_0x467cfd[_0xa812('0x5f')][0x8]?_0x467cfd['attrs'][0x8][_0xa812('0x60')]:undefined)||''},{'name':_0xa812('0x71'),'value':_0x467cfd[_0xa812('0x71')]||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd[_0xa812('0x5f')][0x9]?_0x467cfd[_0xa812('0x5f')][0x9][_0xa812('0x60')]:undefined)||''}];case _0xa812('0x72'):case _0xa812('0x73'):return[{'name':_0xa812('0x74'),'value':_0x467cfd['attrSerie1']||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd[_0xa812('0x5f')][0x0]?_0x467cfd[_0xa812('0x5f')][0x0]['value']:undefined)||_0xa812('0x75')},{'name':_0xa812('0x76'),'value':_0x467cfd[_0xa812('0x76')]||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd[_0xa812('0x5f')][0x1]?_0x467cfd[_0xa812('0x5f')][0x1]['value']:undefined)||null},{'name':_0xa812('0x77'),'value':_0x467cfd[_0xa812('0x77')]||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd[_0xa812('0x5f')][0x2]?_0x467cfd['attrs'][0x2][_0xa812('0x60')]:undefined)||null},{'name':_0xa812('0x6a'),'value':_0x467cfd[_0xa812('0x6a')]||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd['attrs'][0x3]?_0x467cfd[_0xa812('0x5f')][0x3][_0xa812('0x60')]:undefined)||[]},{'name':_0xa812('0x6b'),'value':_0x467cfd[_0xa812('0x6b')]||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd[_0xa812('0x5f')][0x4]?_0x467cfd[_0xa812('0x5f')][0x4]['value']:undefined)||_0xa812('0x78')},{'name':_0xa812('0x6c'),'value':_0x467cfd[_0xa812('0x6c')]||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd[_0xa812('0x5f')][0x5]?_0x467cfd[_0xa812('0x5f')][0x5]['value']:undefined)||''},{'name':_0xa812('0x6d'),'value':_0x467cfd[_0xa812('0x6d')]||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd[_0xa812('0x5f')][0x6]?_0x467cfd[_0xa812('0x5f')][0x6][_0xa812('0x60')]:undefined)||''},{'name':_0xa812('0x6e'),'value':_0x467cfd[_0xa812('0x6e')]||(_0x467cfd['attrs']&&_0x467cfd[_0xa812('0x5f')][0x7]?_0x467cfd['attrs'][0x7][_0xa812('0x60')]:undefined)||''},{'name':_0xa812('0x6f'),'value':_0x467cfd[_0xa812('0x6f')]||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd['attrs'][0x8]?_0x467cfd['attrs'][0x8][_0xa812('0x60')]:undefined)||''},{'name':_0xa812('0x70'),'value':_0x467cfd[_0xa812('0x70')]||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd[_0xa812('0x5f')][0x9]?_0x467cfd['attrs'][0x9][_0xa812('0x60')]:undefined)||''},{'name':'attrChatWebsites','value':_0x467cfd[_0xa812('0x71')]||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd[_0xa812('0x5f')][0xa]?_0x467cfd[_0xa812('0x5f')][0xa]['value']:undefined)||''}];case _0xa812('0x79'):return[{'name':'attrReport','type':_0x467cfd['reportType']||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd[_0xa812('0x5f')][0x0]?_0x467cfd[_0xa812('0x5f')][0x0]['type']:undefined)||null,'value':_0x467cfd[_0xa812('0x7a')]||(_0x467cfd['attrs']&&_0x467cfd['attrs'][0x0]?_0x467cfd[_0xa812('0x5f')][0x0][_0xa812('0x60')]:undefined)||null},{'name':_0xa812('0x7b'),'value':_0x467cfd[_0xa812('0x7b')]||(_0x467cfd[_0xa812('0x5f')]&&_0x467cfd[_0xa812('0x5f')][0x1]?_0x467cfd['attrs'][0x1][_0xa812('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x400594){logger['error']('widgetAttributes:\x20%s',JSON[_0xa812('0x7c')](_0x400594));return[];}}exports['addItem']=function(_0x26bfb8,_0x38c415,_0x55fc14){if(_0x26bfb8[_0xa812('0x52')]['id']){delete _0x26bfb8[_0xa812('0x52')]['id'];}return db[_0xa812('0x35')][_0xa812('0x50')]({'where':{'id':_0x26bfb8[_0xa812('0x4d')]['id']}})[_0xa812('0x2a')](handleEntityNotFound(_0x38c415,null))[_0xa812('0x2a')](function(_0xbaaee1){if(_0xbaaee1){_0x26bfb8['body'][_0xa812('0x7d')]=_0xbaaee1['id'];_0x26bfb8[_0xa812('0x52')][_0xa812('0x5f')]=widgetAttributes(_0x26bfb8[_0xa812('0x52')]);return db[_0xa812('0x7e')][_0xa812('0x51')](_0x26bfb8['body']);}})[_0xa812('0x2a')](respondWithResult(_0x38c415,null))[_0xa812('0x4b')](handleError(_0x38c415,null));};exports[_0xa812('0x7f')]=function(_0x183b8c,_0x50fe7b,_0x39e6d3){var _0x52a19={};var _0x278e04={};var _0x4ae348;var _0x26f352;return db[_0xa812('0x35')][_0xa812('0x80')]({'where':{'id':_0x183b8c[_0xa812('0x4d')]['id']}})[_0xa812('0x2a')](handleEntityNotFound(_0x50fe7b,null))['then'](function(_0x34dc14){if(_0x34dc14){_0x4ae348=_0x34dc14;_0x278e04[_0xa812('0x4e')]=_[_0xa812('0x39')](db[_0xa812('0x7e')][_0xa812('0x4f')]);_0x278e04[_0xa812('0x38')]=_[_0xa812('0x39')](_0x183b8c[_0xa812('0x38')]);_0x278e04[_0xa812('0x3a')]=_['intersection'](_0x278e04[_0xa812('0x4e')],_0x278e04[_0xa812('0x38')]);_0x52a19[_0xa812('0x3c')]=_[_0xa812('0x3b')](_0x278e04[_0xa812('0x4e')],qs[_0xa812('0x3d')](_0x183b8c['query'][_0xa812('0x3d')]));_0x52a19[_0xa812('0x3c')]=_0x52a19[_0xa812('0x3c')][_0xa812('0x3e')]?_0x52a19['attributes']:_0x278e04[_0xa812('0x4e')];_0x52a19[_0xa812('0x41')]=qs['sort'](_0x183b8c[_0xa812('0x38')][_0xa812('0x42')]);_0x52a19[_0xa812('0x45')]=qs[_0xa812('0x3a')](_['pick'](_0x183b8c[_0xa812('0x38')],_0x278e04[_0xa812('0x3a')]));if(_0x183b8c[_0xa812('0x38')][_0xa812('0x44')]){_0x52a19[_0xa812('0x45')]=_[_0xa812('0x46')](_0x52a19[_0xa812('0x45')],{'$or':_[_0xa812('0x34')](_0x52a19[_0xa812('0x3c')],function(_0x39894a){var _0x418353={};_0x418353[_0x39894a]={'$like':'%'+_0x183b8c['query'][_0xa812('0x44')]+'%'};return _0x418353;})});}_0x52a19=_[_0xa812('0x46')]({},_0x52a19,_0x183b8c[_0xa812('0x47')]);return _0x4ae348[_0xa812('0x7f')](_0x52a19);}})[_0xa812('0x2a')](function(_0x2583fd){if(_0x2583fd){_0x26f352=_0x2583fd['length'];if(!_0x183b8c[_0xa812('0x38')][_0xa812('0x3f')]('nolimit')){_0x52a19[_0xa812('0x23')]=qs[_0xa812('0x23')](_0x183b8c['query'][_0xa812('0x23')]);_0x52a19[_0xa812('0x26')]=qs[_0xa812('0x26')](_0x183b8c[_0xa812('0x38')][_0xa812('0x26')]);}return _0x4ae348[_0xa812('0x7f')](_0x52a19);}})[_0xa812('0x2a')](function(_0x6ce702){if(_0x6ce702){return _0x6ce702?{'count':_0x26f352,'rows':_0x6ce702}:null;}})['then'](respondWithResult(_0x50fe7b,null))[_0xa812('0x4b')](handleError(_0x50fe7b,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index bcdc299..d6fc574 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 _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 +var _0x1cc6=['hasOwnProperty','hook','exports','events','Dashboard','setMaxListeners','save','remove','emit'];(function(_0x1e05c1,_0x3cffa3){var _0x15f1ca=function(_0x3a9594){while(--_0x3a9594){_0x1e05c1['push'](_0x1e05c1['shift']());}};_0x15f1ca(++_0x3cffa3);}(_0x1cc6,0x174));var _0x61cc=function(_0x6e1239,_0x3562ac){_0x6e1239=_0x6e1239-0x0;var _0x418150=_0x1cc6[_0x6e1239];return _0x418150;};'use strict';var EventEmitter=require(_0x61cc('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x61cc('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x61cc('0x2')](0x0);var events={'afterCreate':_0x61cc('0x3'),'afterUpdate':'update','afterDestroy':_0x61cc('0x4')};function emitEvent(_0x29c52c){return function(_0x3443b9,_0x4adf76,_0x1d7e04){DashboardEvents[_0x61cc('0x5')](_0x29c52c+':'+_0x3443b9['id'],_0x3443b9);DashboardEvents[_0x61cc('0x5')](_0x29c52c,_0x3443b9);_0x1d7e04(null);};}for(var e in events){if(events[_0x61cc('0x6')](e)){var event=events[e];Dashboard[_0x61cc('0x7')](e,emitEvent(event));}}module[_0x61cc('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 3a0d754..d3adbbb 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 _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 +var _0x48d3=['../../config/environment','exports','define','Dashboard','lodash','util','../../config/logger','api','path','rimraf'];(function(_0x434fba,_0x455b0c){var _0x326ad0=function(_0x5a6882){while(--_0x5a6882){_0x434fba['push'](_0x434fba['shift']());}};_0x326ad0(++_0x455b0c);}(_0x48d3,0x90));var _0x348d=function(_0x1ca2c3,_0x534ac1){_0x1ca2c3=_0x1ca2c3-0x0;var _0xda5b8a=_0x48d3[_0x1ca2c3];return _0xda5b8a;};'use strict';var _=require(_0x348d('0x0'));var util=require(_0x348d('0x1'));var logger=require(_0x348d('0x2'))(_0x348d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x348d('0x4'));var rimraf=require(_0x348d('0x5'));var config=require(_0x348d('0x6'));var attributes=require('./dashboard.attributes');module[_0x348d('0x7')]=function(_0x20ca97,_0x49a548){return _0x20ca97[_0x348d('0x8')](_0x348d('0x9'),attributes,{'tableName':'dashboards','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 7fd776e..af99499 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 _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 +var _0xd9fe=['Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0xd9fe,0x1a6));var _0xed9f=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xd9fe[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xed9f('0x0'));var util=require(_0xed9f('0x1'));var moment=require(_0xed9f('0x2'));var BPromise=require(_0xed9f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed9f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed9f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xed9f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xed9f('0x7')]({'port':0x232a});config['redis']=_[_0xed9f('0x8')](config[_0xed9f('0x9')],{'host':_0xed9f('0xa'),'port':0x18eb});var socket=require(_0xed9f('0xb'))(new Redis(config[_0xed9f('0x9')]));require(_0xed9f('0xc'))[_0xed9f('0xd')](socket);function respondWithRpcPromise(_0x568232,_0x558526,_0x556811){return new BPromise(function(_0x1f356c,_0x240eca){return client[_0xed9f('0xe')](_0x568232,_0x556811)[_0xed9f('0xf')](function(_0xe1009c){logger[_0xed9f('0x10')](_0xed9f('0x11'),_0x558526,_0xed9f('0x12'));logger[_0xed9f('0x13')](_0xed9f('0x14'),_0x558526,_0xed9f('0x12'),JSON[_0xed9f('0x15')](_0xe1009c));if(_0xe1009c['error']){if(_0xe1009c[_0xed9f('0x16')][_0xed9f('0x17')]===0x1f4){logger[_0xed9f('0x16')](_0xed9f('0x11'),_0x558526,_0xe1009c['error']['message']);return _0x240eca(_0xe1009c[_0xed9f('0x16')]['message']);}logger[_0xed9f('0x16')](_0xed9f('0x11'),_0x558526,_0xe1009c['error'][_0xed9f('0x18')]);return _0x1f356c(_0xe1009c['error'][_0xed9f('0x18')]);}else{logger['info'](_0xed9f('0x11'),_0x558526,_0xed9f('0x12'));_0x1f356c(_0xe1009c['result'][_0xed9f('0x18')]);}})[_0xed9f('0x19')](function(_0xe036a){logger['error'](_0xed9f('0x11'),_0x558526,_0xe036a);_0x240eca(_0xe036a);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 2693879..c376c8c 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 _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 +var _0x2407=['save','remove','update','emit','removeListener','register','length','dashboard:','./dashboard.events'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x2407,0xe0));var _0x7240=function(_0x2d991c,_0x1583d4){_0x2d991c=_0x2d991c-0x0;var _0x3d5af5=_0x2407[_0x2d991c];return _0x3d5af5;};'use strict';var DashboardEvents=require(_0x7240('0x0'));var events=[_0x7240('0x1'),_0x7240('0x2'),_0x7240('0x3')];function createListener(_0x168271,_0x577e7f){return function(_0x4f2ca1){_0x577e7f[_0x7240('0x4')](_0x168271,_0x4f2ca1);};}function removeListener(_0x4c81c1,_0x3d39f7){return function(){DashboardEvents[_0x7240('0x5')](_0x4c81c1,_0x3d39f7);};}exports[_0x7240('0x6')]=function(_0x46cdb9){for(var _0xb56a63=0x0,_0x3ea315=events[_0x7240('0x7')];_0xb56a63<_0x3ea315;_0xb56a63++){var _0x4b6df4=events[_0xb56a63];var _0xedaa9=createListener(_0x7240('0x8')+_0x4b6df4,_0x46cdb9);DashboardEvents['on'](_0x4b6df4,_0xedaa9);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index beba888..bcc5517 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 _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 +var _0x4b79=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./dashboard.controller','get','index','/:id','isAuthenticated','/:id/items','getItems','create','post','clone','addItem','put','delete','destroy'];(function(_0x3a1cab,_0x487dfe){var _0x5cd766=function(_0x3e7857){while(--_0x3e7857){_0x3a1cab['push'](_0x3a1cab['shift']());}};_0x5cd766(++_0x487dfe);}(_0x4b79,0x9b));var _0x94b7=function(_0x3d9871,_0x1026ec){_0x3d9871=_0x3d9871-0x0;var _0x2fd746=_0x4b79[_0x3d9871];return _0x2fd746;};'use strict';var multer=require(_0x94b7('0x0'));var util=require(_0x94b7('0x1'));var path=require(_0x94b7('0x2'));var timeout=require(_0x94b7('0x3'));var express=require(_0x94b7('0x4'));var router=express[_0x94b7('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x94b7('0x6'));var config=require('../../config/environment');var controller=require(_0x94b7('0x7'));router[_0x94b7('0x8')]('/',auth['isAuthenticated'](),controller[_0x94b7('0x9')]);router[_0x94b7('0x8')](_0x94b7('0xa'),auth[_0x94b7('0xb')](),controller['show']);router[_0x94b7('0x8')](_0x94b7('0xc'),auth[_0x94b7('0xb')](),controller[_0x94b7('0xd')]);router['post']('/',auth[_0x94b7('0xb')](),controller[_0x94b7('0xe')]);router[_0x94b7('0xf')]('/:id/clone',auth['isAuthenticated'](),controller[_0x94b7('0x10')]);router[_0x94b7('0xf')](_0x94b7('0xc'),auth[_0x94b7('0xb')](),controller[_0x94b7('0x11')]);router[_0x94b7('0x12')](_0x94b7('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x94b7('0x13')](_0x94b7('0xa'),auth['isAuthenticated'](),controller[_0x94b7('0x14')]);module[_0x94b7('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 7b4d8c9..094dc13 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 _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 +var _0xeff8=['sequelize','squel','exports','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0x1b80da,_0x156fef){var _0x59c408=function(_0x273559){while(--_0x273559){_0x1b80da['push'](_0x1b80da['shift']());}};_0x59c408(++_0x156fef);}(_0xeff8,0x186));var _0x8eff=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0xeff8[_0xf0bc07];return _0x1c50c2;};'use strict';var Sequelize=require(_0x8eff('0x0'));var squel=require(_0x8eff('0x1'));var _=require('lodash');module[_0x8eff('0x2')]={'title':{'type':Sequelize[_0x8eff('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8eff('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x8eff('0x4')),'get':function(){try{return JSON[_0x8eff('0x5')](this[_0x8eff('0x6')](_0x8eff('0x7')));}catch(_0x4ac51c){return[];}},'set':function(_0x469641){try{this[_0x8eff('0x8')](_0x8eff('0x7'),JSON[_0x8eff('0x9')](_0x469641));}catch(_0x491f01){this[_0x8eff('0x8')](_0x8eff('0x7'),JSON[_0x8eff('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x8eff('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x8eff('0xa')]},'background':{'type':Sequelize[_0x8eff('0x3')],'allowNull':![],'defaultValue':_0x8eff('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8eff('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x8eff('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 1682f11..9386ac3 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 _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 +var _0x323f=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','find','destroy','catch','type','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrEmailAccounts','web-report','attrReport','reportType','error','stringify','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4eca44,_0x3482ee){var _0x1a8b00=function(_0x456685){while(--_0x456685){_0x4eca44['push'](_0x4eca44['shift']());}};_0x1a8b00(++_0x3482ee);}(_0x323f,0x1ee));var _0xf323=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x323f[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf323('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf323('0x1'));var rp=require(_0xf323('0x2'));var moment=require(_0xf323('0x3'));var BPromise=require(_0xf323('0x4'));var Mustache=require(_0xf323('0x5'));var util=require(_0xf323('0x6'));var path=require(_0xf323('0x7'));var sox=require(_0xf323('0x8'));var csv=require(_0xf323('0x9'));var ejs=require(_0xf323('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf323('0xb'));var squel=require(_0xf323('0xc'));var crypto=require(_0xf323('0xd'));var jsforce=require(_0xf323('0xe'));var deskjs=require(_0xf323('0xf'));var toCsv=require(_0xf323('0x9'));var querystring=require(_0xf323('0x10'));var Papa=require(_0xf323('0x11'));var Redis=require(_0xf323('0x12'));var authService=require(_0xf323('0x13'));var qs=require(_0xf323('0x14'));var as=require(_0xf323('0x15'));var hardwareService=require(_0xf323('0x16'));var logger=require(_0xf323('0x17'))(_0xf323('0x18'));var utils=require(_0xf323('0x19'));var config=require(_0xf323('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xf323('0x1b'))['db'];config[_0xf323('0x1c')]=_[_0xf323('0x1d')](config['redis'],{'host':_0xf323('0x1e'),'port':0x18eb});var socket=require(_0xf323('0x1f'))(new Redis(config[_0xf323('0x1c')]));require(_0xf323('0x20'))[_0xf323('0x21')](socket);function respondWithStatusCode(_0x144db9,_0x59ffbc){_0x59ffbc=_0x59ffbc||0xcc;return function(_0x4cc3ce){if(_0x4cc3ce){return _0x144db9[_0xf323('0x22')](_0x59ffbc);}return _0x144db9[_0xf323('0x23')](_0x59ffbc)[_0xf323('0x24')]();};}function respondWithResult(_0x3858ee,_0x3db58a){_0x3db58a=_0x3db58a||0xc8;return function(_0x55d87d){if(_0x55d87d){return _0x3858ee[_0xf323('0x23')](_0x3db58a)[_0xf323('0x25')](_0x55d87d);}};}function respondWithFilteredResult(_0xb9859f,_0x44671c){return function(_0x49b115){if(_0x49b115){var _0x2db977=typeof _0x44671c[_0xf323('0x26')]===_0xf323('0x27')&&typeof _0x44671c[_0xf323('0x28')]==='undefined';var _0x409b16=_0x49b115[_0xf323('0x29')];var _0x5baab2=_0x2db977?0x0:_0x44671c[_0xf323('0x26')];var _0x44378e=_0x2db977?_0x49b115[_0xf323('0x29')]:_0x44671c[_0xf323('0x26')]+_0x44671c['limit'];var _0xdc7891;if(_0x44378e>=_0x409b16){_0x44378e=_0x409b16;_0xdc7891=0xc8;}else{_0xdc7891=0xce;}_0xb9859f[_0xf323('0x23')](_0xdc7891);return _0xb9859f[_0xf323('0x2a')]('Content-Range',_0x5baab2+'-'+_0x44378e+'/'+_0x409b16)[_0xf323('0x25')](_0x49b115);}return null;};}function patchUpdates(_0x375473){return function(_0x3e1c49){try{jsonpatch[_0xf323('0x2b')](_0x3e1c49,_0x375473,!![]);}catch(_0x13ec1f){return BPromise[_0xf323('0x2c')](_0x13ec1f);}return _0x3e1c49[_0xf323('0x2d')]();};}function saveUpdates(_0x43bc05,_0x44d324){return function(_0x47fb15){if(_0x47fb15){return _0x47fb15[_0xf323('0x2e')](_0x43bc05)[_0xf323('0x2f')](function(_0x33dc52){return _0x33dc52;});}return null;};}function removeEntity(_0x292ce0,_0x87ec45){return function(_0x1027a7){if(_0x1027a7){return _0x1027a7['destroy']()[_0xf323('0x2f')](function(){_0x292ce0['status'](0xcc)[_0xf323('0x24')]();});}};}function handleEntityNotFound(_0x3902eb,_0x56be0c){return function(_0x46663b){if(!_0x46663b){_0x3902eb[_0xf323('0x22')](0x194);}return _0x46663b;};}function handleError(_0x2b6254,_0x3dcf65){_0x3dcf65=_0x3dcf65||0x1f4;return function(_0x46e3b1){logger['error'](_0x46e3b1[_0xf323('0x30')]);if(_0x46e3b1[_0xf323('0x31')]){delete _0x46e3b1[_0xf323('0x31')];}_0x2b6254[_0xf323('0x23')](_0x3dcf65)[_0xf323('0x32')](_0x46e3b1);};}exports[_0xf323('0x33')]=function(_0x17cb4d,_0x1723b7){var _0x139adc={'raw':![],'where':{'id':_0x17cb4d[_0xf323('0x34')]['id']}},_0x52300b={};_0x52300b[_0xf323('0x35')]=_[_0xf323('0x36')](db[_0xf323('0x37')][_0xf323('0x38')]);_0x52300b['query']=_[_0xf323('0x36')](_0x17cb4d[_0xf323('0x39')]);_0x52300b[_0xf323('0x3a')]=_[_0xf323('0x3b')](_0x52300b[_0xf323('0x35')],_0x52300b['query']);_0x139adc[_0xf323('0x3c')]=_[_0xf323('0x3b')](_0x52300b[_0xf323('0x35')],qs[_0xf323('0x3d')](_0x17cb4d['query'][_0xf323('0x3d')]));_0x139adc['attributes']=_0x139adc[_0xf323('0x3c')][_0xf323('0x3e')]?_0x139adc['attributes']:_0x52300b[_0xf323('0x35')];if(_0x17cb4d['query'][_0xf323('0x3f')]){_0x139adc['include']=[{'all':!![]}];}_0x139adc=_[_0xf323('0x40')]({},_0x139adc,_0x17cb4d['options']);return db[_0xf323('0x37')][_0xf323('0x41')](_0x139adc)['then'](handleEntityNotFound(_0x1723b7,null))['then'](respondWithResult(_0x1723b7,null))['catch'](handleError(_0x1723b7,null));};exports[_0xf323('0x42')]=function(_0x277a6c,_0x79e636){return db[_0xf323('0x37')][_0xf323('0x41')]({'where':{'id':_0x277a6c['params']['id']}})['then'](handleEntityNotFound(_0x79e636,null))['then'](removeEntity(_0x79e636,null))[_0xf323('0x43')](handleError(_0x79e636,null));};function widgetAttributes(_0x59fee2){try{switch(_0x59fee2[_0xf323('0x44')]){case'iframe':return[{'name':_0xf323('0x45'),'value':_0x59fee2[_0xf323('0x45')]||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x0]?_0x59fee2[_0xf323('0x46')][0x0]['value']:undefined)||_0xf323('0x47')}];case _0xf323('0x48'):return[{'name':_0xf323('0x49'),'value':_0x59fee2[_0xf323('0x49')]||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x0]?_0x59fee2[_0xf323('0x46')][0x0][_0xf323('0x4a')]:undefined)||''}];case _0xf323('0x4b'):return[{'name':_0xf323('0x4c'),'value':_0x59fee2[_0xf323('0x4c')]||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x0]?_0x59fee2[_0xf323('0x46')][0x0][_0xf323('0x4a')]:undefined)||_0xf323('0x4d')},{'name':'attrTimezone','value':_0x59fee2['attrTimezone']||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x1]?_0x59fee2[_0xf323('0x46')][0x1][_0xf323('0x4a')]:undefined)||_0xf323('0x4e')},{'name':_0xf323('0x4f'),'value':_0x59fee2[_0xf323('0x4f')]||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x2]?_0x59fee2[_0xf323('0x46')][0x2][_0xf323('0x4a')]:undefined)||0xc}];case _0xf323('0x50'):return[{'name':_0xf323('0x51'),'value':_0x59fee2['attrMetric']||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2['attrs'][0x0]?_0x59fee2['attrs'][0x0][_0xf323('0x4a')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x59fee2[_0xf323('0x52')]||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x1]?_0x59fee2[_0xf323('0x46')][0x1][_0xf323('0x4a')]:undefined)||[]},{'name':_0xf323('0x4f'),'value':_0x59fee2[_0xf323('0x4f')]||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x2]?_0x59fee2[_0xf323('0x46')][0x2][_0xf323('0x4a')]:undefined)||0x14},{'name':'attrChannel','value':_0x59fee2[_0xf323('0x53')]||(_0x59fee2['attrs']&&_0x59fee2[_0xf323('0x46')][0x3]?_0x59fee2[_0xf323('0x46')][0x3][_0xf323('0x4a')]:undefined)||_0xf323('0x54')},{'name':'attrEmailAccounts','value':_0x59fee2['attrEmailAccounts']||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2['attrs'][0x4]?_0x59fee2[_0xf323('0x46')][0x4]['value']:undefined)||''},{'name':_0xf323('0x55'),'value':_0x59fee2[_0xf323('0x55')]||(_0x59fee2['attrs']&&_0x59fee2[_0xf323('0x46')][0x5]?_0x59fee2[_0xf323('0x46')][0x5][_0xf323('0x4a')]:undefined)||''},{'name':_0xf323('0x56'),'value':_0x59fee2[_0xf323('0x56')]||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x6]?_0x59fee2[_0xf323('0x46')][0x6][_0xf323('0x4a')]:undefined)||''},{'name':_0xf323('0x57'),'value':_0x59fee2[_0xf323('0x57')]||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x7]?_0x59fee2['attrs'][0x7][_0xf323('0x4a')]:undefined)||''},{'name':_0xf323('0x58'),'value':_0x59fee2[_0xf323('0x58')]||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x8]?_0x59fee2[_0xf323('0x46')][0x8]['value']:undefined)||''},{'name':_0xf323('0x59'),'value':_0x59fee2[_0xf323('0x59')]||(_0x59fee2['attrs']&&_0x59fee2[_0xf323('0x46')][0x9]?_0x59fee2[_0xf323('0x46')][0x9]['value']:undefined)||''}];case'multibar-chart':case _0xf323('0x5a'):return[{'name':_0xf323('0x5b'),'value':_0x59fee2[_0xf323('0x5b')]||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x0]?_0x59fee2[_0xf323('0x46')][0x0][_0xf323('0x4a')]:undefined)||_0xf323('0x5c')},{'name':'attrSerie2','value':_0x59fee2[_0xf323('0x5d')]||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x1]?_0x59fee2[_0xf323('0x46')][0x1][_0xf323('0x4a')]:undefined)||null},{'name':_0xf323('0x5e'),'value':_0x59fee2[_0xf323('0x5e')]||(_0x59fee2['attrs']&&_0x59fee2[_0xf323('0x46')][0x2]?_0x59fee2[_0xf323('0x46')][0x2][_0xf323('0x4a')]:undefined)||null},{'name':_0xf323('0x52'),'value':_0x59fee2[_0xf323('0x52')]||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x3]?_0x59fee2[_0xf323('0x46')][0x3][_0xf323('0x4a')]:undefined)||[]},{'name':'attrChannel','value':_0x59fee2[_0xf323('0x53')]||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x4]?_0x59fee2['attrs'][0x4][_0xf323('0x4a')]:undefined)||_0xf323('0x54')},{'name':'attrEmailAccounts','value':_0x59fee2[_0xf323('0x5f')]||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2['attrs'][0x5]?_0x59fee2[_0xf323('0x46')][0x5][_0xf323('0x4a')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x59fee2[_0xf323('0x55')]||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x6]?_0x59fee2[_0xf323('0x46')][0x6][_0xf323('0x4a')]:undefined)||''},{'name':_0xf323('0x56'),'value':_0x59fee2[_0xf323('0x56')]||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x7]?_0x59fee2['attrs'][0x7][_0xf323('0x4a')]:undefined)||''},{'name':_0xf323('0x57'),'value':_0x59fee2['attrOpenchannelAccounts']||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x8]?_0x59fee2['attrs'][0x8][_0xf323('0x4a')]:undefined)||''},{'name':_0xf323('0x58'),'value':_0x59fee2[_0xf323('0x58')]||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2['attrs'][0x9]?_0x59fee2[_0xf323('0x46')][0x9][_0xf323('0x4a')]:undefined)||''},{'name':_0xf323('0x59'),'value':_0x59fee2[_0xf323('0x59')]||(_0x59fee2['attrs']&&_0x59fee2[_0xf323('0x46')][0xa]?_0x59fee2[_0xf323('0x46')][0xa][_0xf323('0x4a')]:undefined)||''}];case _0xf323('0x60'):return[{'name':_0xf323('0x61'),'type':_0x59fee2[_0xf323('0x62')]||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x0]?_0x59fee2[_0xf323('0x46')][0x0][_0xf323('0x44')]:undefined)||null,'value':_0x59fee2[_0xf323('0x61')]||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x0]?_0x59fee2[_0xf323('0x46')][0x0][_0xf323('0x4a')]:undefined)||null},{'name':'attrRefresh','value':_0x59fee2['attrRefresh']||(_0x59fee2[_0xf323('0x46')]&&_0x59fee2[_0xf323('0x46')][0x1]?_0x59fee2[_0xf323('0x46')][0x1][_0xf323('0x4a')]:undefined)||0x0}];default:return[];}}catch(_0x16c9f4){logger[_0xf323('0x63')]('widgetAttributes:\x20%s',JSON[_0xf323('0x64')](_0x16c9f4));return[];}}exports[_0xf323('0x65')]=function(_0x3c103e,_0x3add7c){if(_0x3c103e['body']){_0x3c103e['body'][_0xf323('0x46')]=widgetAttributes(_0x3c103e[_0xf323('0x66')]);}return db[_0xf323('0x37')][_0xf323('0x65')](_0x3c103e[_0xf323('0x66')],{})[_0xf323('0x2f')](respondWithResult(_0x3add7c,0xc9))[_0xf323('0x43')](handleError(_0x3add7c,null));};exports['update']=function(_0x55ba28,_0x2f9d4a){if(_0x55ba28[_0xf323('0x66')]['id']){delete _0x55ba28[_0xf323('0x66')]['id'];}_0x55ba28[_0xf323('0x66')][_0xf323('0x46')]=widgetAttributes(_0x55ba28[_0xf323('0x66')]);return db['DashboardItem'][_0xf323('0x41')]({'where':{'id':_0x55ba28[_0xf323('0x34')]['id']}})['then'](handleEntityNotFound(_0x2f9d4a,null))['then'](saveUpdates(_0x55ba28[_0xf323('0x66')],null))[_0xf323('0x2f')](respondWithResult(_0x2f9d4a,null))['catch'](handleError(_0x2f9d4a,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index d7b4fe6..ad7d4a3 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 _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 +var _0xe8b1=['hasOwnProperty','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x268358,_0x7b4bcd){var _0x43a4dd=function(_0x7b17aa){while(--_0x7b17aa){_0x268358['push'](_0x268358['shift']());}};_0x43a4dd(++_0x7b4bcd);}(_0xe8b1,0x104));var _0x1e8b=function(_0x574de7,_0x24ce60){_0x574de7=_0x574de7-0x0;var _0x568f46=_0xe8b1[_0x574de7];return _0x568f46;};'use strict';var EventEmitter=require(_0x1e8b('0x0'));var DashboardItem=require(_0x1e8b('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x1e8b('0x2')](0x0);var events={'afterCreate':_0x1e8b('0x3'),'afterUpdate':_0x1e8b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x47f47e){return function(_0x1cd060,_0xfe3a85,_0x17d414){DashboardItemEvents[_0x1e8b('0x5')](_0x47f47e+':'+_0x1cd060['id'],_0x1cd060);DashboardItemEvents[_0x1e8b('0x5')](_0x47f47e,_0x1cd060);_0x17d414(null);};}for(var e in events){if(events[_0x1e8b('0x6')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index be4738c..81cba85 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 _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 +var _0xf041=['path','../../config/environment','define','DashboardItem','dashboard_items','../../config/logger','api','moment','bluebird'];(function(_0x451361,_0x4ae155){var _0x273cc1=function(_0xa3c1b4){while(--_0xa3c1b4){_0x451361['push'](_0x451361['shift']());}};_0x273cc1(++_0x4ae155);}(_0xf041,0x15b));var _0x1f04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf041[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1f04('0x0'))(_0x1f04('0x1'));var moment=require(_0x1f04('0x2'));var BPromise=require(_0x1f04('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f04('0x4'));var rimraf=require('rimraf');var config=require(_0x1f04('0x5'));var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x25d578,_0x504d71){return _0x25d578[_0x1f04('0x6')](_0x1f04('0x7'),attributes,{'tableName':_0x1f04('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 420692e..5b7993d 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 _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 +var _0x507b=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x2f133c,_0x2d0ee7){var _0x17fe82=function(_0x42cd77){while(--_0x42cd77){_0x2f133c['push'](_0x2f133c['shift']());}};_0x17fe82(++_0x2d0ee7);}(_0x507b,0x6b));var _0xb507=function(_0x59578a,_0x122395){_0x59578a=_0x59578a-0x0;var _0x5f25dc=_0x507b[_0x59578a];return _0x5f25dc;};'use strict';var _=require(_0xb507('0x0'));var util=require(_0xb507('0x1'));var moment=require(_0xb507('0x2'));var BPromise=require(_0xb507('0x3'));var rs=require(_0xb507('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb507('0x5'))['db'];var utils=require(_0xb507('0x6'));var logger=require('../../config/logger')(_0xb507('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb507('0x8')][_0xb507('0x9')]({'port':0x232a});config[_0xb507('0xa')]=_[_0xb507('0xb')](config[_0xb507('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xb507('0xc'))(new Redis(config['redis']));require(_0xb507('0xd'))[_0xb507('0xe')](socket);function respondWithRpcPromise(_0x2d950a,_0x3626b6,_0x205e54){return new BPromise(function(_0x1384f0,_0x2e2b9a){return client[_0xb507('0xf')](_0x2d950a,_0x205e54)[_0xb507('0x10')](function(_0x5e7915){logger[_0xb507('0x11')]('DashboardItem,\x20%s,\x20%s',_0x3626b6,_0xb507('0x12'));logger[_0xb507('0x13')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x3626b6,'request\x20sent',JSON[_0xb507('0x14')](_0x5e7915));if(_0x5e7915['error']){if(_0x5e7915[_0xb507('0x15')][_0xb507('0x16')]===0x1f4){logger[_0xb507('0x15')](_0xb507('0x17'),_0x3626b6,_0x5e7915[_0xb507('0x15')][_0xb507('0x18')]);return _0x2e2b9a(_0x5e7915['error'][_0xb507('0x18')]);}logger[_0xb507('0x15')]('DashboardItem,\x20%s,\x20%s',_0x3626b6,_0x5e7915[_0xb507('0x15')]['message']);return _0x1384f0(_0x5e7915[_0xb507('0x15')][_0xb507('0x18')]);}else{logger[_0xb507('0x11')](_0xb507('0x17'),_0x3626b6,'request\x20sent');_0x1384f0(_0x5e7915[_0xb507('0x19')][_0xb507('0x18')]);}})[_0xb507('0x1a')](function(_0x56c1ba){logger[_0xb507('0x15')]('DashboardItem,\x20%s,\x20%s',_0x3626b6,_0x56c1ba);_0x2e2b9a(_0x56c1ba);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 5b68ef4..0e554e3 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 _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 +var _0x2263=['emit','removeListener','length','dashboardItem:','save','remove','update'];(function(_0x3c4dad,_0x25ffd5){var _0x1a4f49=function(_0x6fe6c){while(--_0x6fe6c){_0x3c4dad['push'](_0x3c4dad['shift']());}};_0x1a4f49(++_0x25ffd5);}(_0x2263,0x138));var _0x3226=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0x2263[_0x52e363];return _0x3fc2b5;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x3226('0x0'),_0x3226('0x1'),_0x3226('0x2')];function createListener(_0x5df4f4,_0x2a2e06){return function(_0x56e107){_0x2a2e06[_0x3226('0x3')](_0x5df4f4,_0x56e107);};}function removeListener(_0x1230aa,_0x35c183){return function(){DashboardItemEvents[_0x3226('0x4')](_0x1230aa,_0x35c183);};}exports['register']=function(_0x37b4f5){for(var _0x4a0c52=0x0,_0x27fa82=events[_0x3226('0x5')];_0x4a0c52<_0x27fa82;_0x4a0c52++){var _0x1c0c3e=events[_0x4a0c52];var _0x1cd3c7=createListener(_0x3226('0x6')+_0x1c0c3e,_0x37b4f5);DashboardItemEvents['on'](_0x1c0c3e,_0x1cd3c7);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 3321522..ddc47cc 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 _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 +var _0x580f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','put','update','delete','destroy','multer','util','path'];(function(_0x3f6a22,_0x3aabbc){var _0x266a2e=function(_0x45d1ef){while(--_0x45d1ef){_0x3f6a22['push'](_0x3f6a22['shift']());}};_0x266a2e(++_0x3aabbc);}(_0x580f,0x107));var _0xf580=function(_0x2def0c,_0x2b9d5f){_0x2def0c=_0x2def0c-0x0;var _0x1c2a60=_0x580f[_0x2def0c];return _0x1c2a60;};'use strict';var multer=require(_0xf580('0x0'));var util=require(_0xf580('0x1'));var path=require(_0xf580('0x2'));var timeout=require(_0xf580('0x3'));var express=require(_0xf580('0x4'));var router=express[_0xf580('0x5')]();var fs_extra=require(_0xf580('0x6'));var auth=require(_0xf580('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf580('0x8'));var controller=require(_0xf580('0x9'));router[_0xf580('0xa')](_0xf580('0xb'),auth[_0xf580('0xc')](),controller[_0xf580('0xd')]);router[_0xf580('0xe')]('/',auth[_0xf580('0xc')](),controller['create']);router[_0xf580('0xf')]('/:id',auth[_0xf580('0xc')](),controller[_0xf580('0x10')]);router[_0xf580('0x11')](_0xf580('0xb'),auth[_0xf580('0xc')](),controller[_0xf580('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 5a324a2..24542b3 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 _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 +var _0x07b6=['ENUM','second','third','first','STRING'];(function(_0x47a5cd,_0x15053b){var _0x353fce=function(_0x19612c){while(--_0x19612c){_0x47a5cd['push'](_0x47a5cd['shift']());}};_0x353fce(++_0x15053b);}(_0x07b6,0x149));var _0x607b=function(_0x23f642,_0x3c8f66){_0x23f642=_0x23f642-0x0;var _0x4ba0d0=_0x07b6[_0x23f642];return _0x4ba0d0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x607b('0x0')],'allowNull':![]},'level':{'type':Sequelize[_0x607b('0x1')]('first',_0x607b('0x2'),_0x607b('0x3')),'allowNull':![],'defaultValue':_0x607b('0x4')},'description':{'type':Sequelize[_0x607b('0x0')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 87d2dfb..cee823e 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 _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 +var _0x61d7=['set','Content-Range','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','order','sort','pick','filters','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x41ead9,_0x3d1582){var _0x43d26c=function(_0x1a1d03){while(--_0x1a1d03){_0x41ead9['push'](_0x41ead9['shift']());}};_0x43d26c(++_0x3d1582);}(_0x61d7,0x1dd));var _0x761d=function(_0x39c86d,_0x102701){_0x39c86d=_0x39c86d-0x0;var _0x490874=_0x61d7[_0x39c86d];return _0x490874;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x761d('0x0'));var zipdir=require(_0x761d('0x1'));var jsonpatch=require(_0x761d('0x2'));var rp=require(_0x761d('0x3'));var moment=require(_0x761d('0x4'));var BPromise=require(_0x761d('0x5'));var Mustache=require(_0x761d('0x6'));var util=require(_0x761d('0x7'));var path=require(_0x761d('0x8'));var sox=require(_0x761d('0x9'));var csv=require(_0x761d('0xa'));var ejs=require(_0x761d('0xb'));var fs=require('fs');var fs_extra=require(_0x761d('0xc'));var _=require('lodash');var squel=require(_0x761d('0xd'));var crypto=require(_0x761d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x761d('0xf'));var toCsv=require(_0x761d('0xa'));var querystring=require(_0x761d('0x10'));var Papa=require(_0x761d('0x11'));var Redis=require(_0x761d('0x12'));var authService=require(_0x761d('0x13'));var qs=require(_0x761d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x761d('0x15'))(_0x761d('0x16'));var utils=require(_0x761d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x761d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1406c0,_0x7496c8){_0x7496c8=_0x7496c8||0xcc;return function(_0x1e3456){if(_0x1e3456){return _0x1406c0[_0x761d('0x19')](_0x7496c8);}return _0x1406c0[_0x761d('0x1a')](_0x7496c8)[_0x761d('0x1b')]();};}function respondWithResult(_0x196c4a,_0x400503){_0x400503=_0x400503||0xc8;return function(_0x2a5a4b){if(_0x2a5a4b){return _0x196c4a[_0x761d('0x1a')](_0x400503)[_0x761d('0x1c')](_0x2a5a4b);}};}function respondWithFilteredResult(_0x1854eb,_0x479000){return function(_0x538ff5){if(_0x538ff5){var _0x56a5ca=typeof _0x479000[_0x761d('0x1d')]===_0x761d('0x1e')&&typeof _0x479000[_0x761d('0x1f')]===_0x761d('0x1e');var _0x34e083=_0x538ff5[_0x761d('0x20')];var _0x49fab5=_0x56a5ca?0x0:_0x479000['offset'];var _0x14798f=_0x56a5ca?_0x538ff5[_0x761d('0x20')]:_0x479000[_0x761d('0x1d')]+_0x479000[_0x761d('0x1f')];var _0x11b411;if(_0x14798f>=_0x34e083){_0x14798f=_0x34e083;_0x11b411=0xc8;}else{_0x11b411=0xce;}_0x1854eb[_0x761d('0x1a')](_0x11b411);return _0x1854eb[_0x761d('0x21')](_0x761d('0x22'),_0x49fab5+'-'+_0x14798f+'/'+_0x34e083)[_0x761d('0x1c')](_0x538ff5);}return null;};}function patchUpdates(_0xe9ea52){return function(_0x45430f){try{jsonpatch['apply'](_0x45430f,_0xe9ea52,!![]);}catch(_0x4cab91){return BPromise[_0x761d('0x23')](_0x4cab91);}return _0x45430f[_0x761d('0x24')]();};}function saveUpdates(_0x540e32,_0x119be2){return function(_0x31bf2e){if(_0x31bf2e){return _0x31bf2e[_0x761d('0x25')](_0x540e32)[_0x761d('0x26')](function(_0x280f64){return _0x280f64;});}return null;};}function removeEntity(_0x3bd3db,_0x4b7f83){return function(_0x4d739f){if(_0x4d739f){return _0x4d739f[_0x761d('0x27')]()[_0x761d('0x26')](function(){var _0x1b33c6=_0x4d739f[_0x761d('0x28')]({'plain':!![]});var _0x4a54b7=_0x761d('0x29');return db[_0x761d('0x2a')]['destroy']({'where':{'type':_0x4a54b7,'resourceId':_0x1b33c6['id']}})[_0x761d('0x26')](function(){return _0x4d739f;});})[_0x761d('0x26')](function(){_0x3bd3db[_0x761d('0x1a')](0xcc)[_0x761d('0x1b')]();});}};}function handleEntityNotFound(_0x55478f,_0x5bf161){return function(_0x4c59a4){if(!_0x4c59a4){_0x55478f[_0x761d('0x19')](0x194);}return _0x4c59a4;};}function handleError(_0x32fe2a,_0x261234){_0x261234=_0x261234||0x1f4;return function(_0x505e8c){logger[_0x761d('0x2b')](_0x505e8c[_0x761d('0x2c')]);if(_0x505e8c[_0x761d('0x2d')]){delete _0x505e8c[_0x761d('0x2d')];}_0x32fe2a[_0x761d('0x1a')](_0x261234)[_0x761d('0x2e')](_0x505e8c);};}exports[_0x761d('0x2f')]=function(_0x10a049,_0x4b33aa){var _0x1d9cb7={},_0x2c5eaf={},_0x28c7aa={'count':0x0,'rows':[]};var _0x57ce5a=_[_0x761d('0x30')](db[_0x761d('0x31')][_0x761d('0x32')],function(_0x246f22){return{'name':_0x246f22[_0x761d('0x33')],'type':_0x246f22['type'][_0x761d('0x34')]};});_0x2c5eaf['model']=_[_0x761d('0x30')](_0x57ce5a,_0x761d('0x2d'));_0x2c5eaf[_0x761d('0x35')]=_[_0x761d('0x36')](_0x10a049[_0x761d('0x35')]);_0x2c5eaf['filters']=_[_0x761d('0x37')](_0x2c5eaf[_0x761d('0x38')],_0x2c5eaf[_0x761d('0x35')]);_0x1d9cb7['attributes']=_['intersection'](_0x2c5eaf[_0x761d('0x38')],qs[_0x761d('0x39')](_0x10a049[_0x761d('0x35')][_0x761d('0x39')]));_0x1d9cb7['attributes']=_0x1d9cb7[_0x761d('0x3a')]['length']?_0x1d9cb7['attributes']:_0x2c5eaf['model'];if(!_0x10a049[_0x761d('0x35')][_0x761d('0x3b')]('nolimit')){_0x1d9cb7[_0x761d('0x1f')]=qs[_0x761d('0x1f')](_0x10a049[_0x761d('0x35')][_0x761d('0x1f')]);_0x1d9cb7[_0x761d('0x1d')]=qs[_0x761d('0x1d')](_0x10a049[_0x761d('0x35')][_0x761d('0x1d')]);}_0x1d9cb7[_0x761d('0x3c')]=qs[_0x761d('0x3d')](_0x10a049[_0x761d('0x35')][_0x761d('0x3d')]);_0x1d9cb7['where']=qs['filters'](_[_0x761d('0x3e')](_0x10a049['query'],_0x2c5eaf[_0x761d('0x3f')]),_0x57ce5a);if(_0x10a049['query'][_0x761d('0x40')]){_0x1d9cb7['where']=_[_0x761d('0x41')](_0x1d9cb7[_0x761d('0x42')],{'$or':_[_0x761d('0x30')](_0x57ce5a,function(_0x113701){if(_0x113701['type']!==_0x761d('0x43')){var _0x802106={};_0x802106[_0x113701[_0x761d('0x2d')]]={'$like':'%'+_0x10a049[_0x761d('0x35')][_0x761d('0x40')]+'%'};return _0x802106;}})});}_0x1d9cb7=_[_0x761d('0x41')]({},_0x1d9cb7,_0x10a049[_0x761d('0x44')]);var _0x1d9ed2={'where':_0x1d9cb7[_0x761d('0x42')]};return db[_0x761d('0x31')][_0x761d('0x20')](_0x1d9ed2)[_0x761d('0x26')](function(_0x19a346){_0x28c7aa[_0x761d('0x20')]=_0x19a346;if(_0x10a049[_0x761d('0x35')][_0x761d('0x45')]){_0x1d9cb7[_0x761d('0x46')]=[{'all':!![]}];}return db[_0x761d('0x31')][_0x761d('0x47')](_0x1d9cb7);})[_0x761d('0x26')](function(_0x161773){_0x28c7aa[_0x761d('0x48')]=_0x161773;return _0x28c7aa;})[_0x761d('0x26')](respondWithFilteredResult(_0x4b33aa,_0x1d9cb7))[_0x761d('0x49')](handleError(_0x4b33aa,null));};exports[_0x761d('0x4a')]=function(_0x17e226,_0x59bdb0){var _0x3f6468={'raw':!![],'where':{'id':_0x17e226[_0x761d('0x4b')]['id']}},_0x43198e={};_0x43198e['model']=_[_0x761d('0x36')](db[_0x761d('0x31')][_0x761d('0x32')]);_0x43198e['query']=_[_0x761d('0x36')](_0x17e226[_0x761d('0x35')]);_0x43198e['filters']=_[_0x761d('0x37')](_0x43198e[_0x761d('0x38')],_0x43198e[_0x761d('0x35')]);_0x3f6468[_0x761d('0x3a')]=_[_0x761d('0x37')](_0x43198e[_0x761d('0x38')],qs[_0x761d('0x39')](_0x17e226[_0x761d('0x35')][_0x761d('0x39')]));_0x3f6468[_0x761d('0x3a')]=_0x3f6468[_0x761d('0x3a')][_0x761d('0x4c')]?_0x3f6468[_0x761d('0x3a')]:_0x43198e[_0x761d('0x38')];if(_0x17e226['query'][_0x761d('0x45')]){_0x3f6468['include']=[{'all':!![]}];}_0x3f6468=_[_0x761d('0x41')]({},_0x3f6468,_0x17e226[_0x761d('0x44')]);return db[_0x761d('0x31')]['find'](_0x3f6468)[_0x761d('0x26')](handleEntityNotFound(_0x59bdb0,null))[_0x761d('0x26')](respondWithResult(_0x59bdb0,null))[_0x761d('0x49')](handleError(_0x59bdb0,null));};exports[_0x761d('0x4d')]=function(_0x597c42,_0x15fe72){return db['Disposition'][_0x761d('0x4d')](_0x597c42[_0x761d('0x4e')],{})[_0x761d('0x26')](function(_0x1c664f){var _0x58d75b=_0x597c42[_0x761d('0x4f')]['get']({'plain':!![]});if(!_0x58d75b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58d75b[_0x761d('0x50')]==='user'){var _0x29b2d2=_0x1c664f['get']({'plain':!![]});var _0x2c6804='Dispositions';return db[_0x761d('0x51')][_0x761d('0x52')]({'where':{'name':_0x2c6804,'userProfileId':_0x58d75b[_0x761d('0x53')]},'raw':!![]})[_0x761d('0x26')](function(_0x44aa07){if(_0x44aa07&&_0x44aa07['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x29b2d2[_0x761d('0x2d')],'resourceId':_0x29b2d2['id'],'type':_0x44aa07[_0x761d('0x2d')],'sectionId':_0x44aa07['id']},{})[_0x761d('0x26')](function(){return _0x1c664f;});}else{return _0x1c664f;}})[_0x761d('0x49')](function(_0x5ec463){logger['error'](_0x761d('0x54'),_0x5ec463);throw _0x5ec463;});}return _0x1c664f;})[_0x761d('0x26')](respondWithResult(_0x15fe72,0xc9))['catch'](handleError(_0x15fe72,null));};exports[_0x761d('0x25')]=function(_0x3a1aed,_0x32321b){if(_0x3a1aed[_0x761d('0x4e')]['id']){delete _0x3a1aed['body']['id'];}return db[_0x761d('0x31')]['find']({'where':{'id':_0x3a1aed[_0x761d('0x4b')]['id']}})[_0x761d('0x26')](handleEntityNotFound(_0x32321b,null))[_0x761d('0x26')](saveUpdates(_0x3a1aed[_0x761d('0x4e')],null))[_0x761d('0x26')](respondWithResult(_0x32321b,null))['catch'](handleError(_0x32321b,null));};exports[_0x761d('0x27')]=function(_0x2321f4,_0x306506){return db[_0x761d('0x31')]['find']({'where':{'id':_0x2321f4[_0x761d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x306506,null))[_0x761d('0x26')](removeEntity(_0x306506,null))['catch'](handleError(_0x306506,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index cce39d3..946736a 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 _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 +var _0x7b94=['name_whatsapp','WhatsappAccountId','util','../../config/logger','api','moment','bluebird','path','rimraf','./disposition.attributes','exports','define','Disposition','tools_dispositions','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId'];(function(_0x259ed8,_0x5218b8){var _0x2f7b27=function(_0x793071){while(--_0x793071){_0x259ed8['push'](_0x259ed8['shift']());}};_0x2f7b27(++_0x5218b8);}(_0x7b94,0x12e));var _0x47b9=function(_0xa35654,_0x43c6eb){_0xa35654=_0xa35654-0x0;var _0x5814e5=_0x7b94[_0xa35654];return _0x5814e5;};'use strict';var _=require('lodash');var util=require(_0x47b9('0x0'));var logger=require(_0x47b9('0x1'))(_0x47b9('0x2'));var moment=require(_0x47b9('0x3'));var BPromise=require(_0x47b9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47b9('0x5'));var rimraf=require(_0x47b9('0x6'));var config=require('../../config/environment');var attributes=require(_0x47b9('0x7'));module[_0x47b9('0x8')]=function(_0x575805,_0x26b78d){return _0x575805[_0x47b9('0x9')](_0x47b9('0xa'),attributes,{'tableName':_0x47b9('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x47b9('0xc'),_0x47b9('0xd')]},{'unique':!![],'name':_0x47b9('0xe'),'fields':[_0x47b9('0xc'),_0x47b9('0xf')]},{'unique':!![],'name':_0x47b9('0x10'),'fields':[_0x47b9('0xc'),_0x47b9('0x11')]},{'unique':!![],'name':_0x47b9('0x12'),'fields':[_0x47b9('0xc'),_0x47b9('0x13')]},{'unique':!![],'name':_0x47b9('0x14'),'fields':[_0x47b9('0xc'),_0x47b9('0x15')]},{'unique':!![],'name':'name_openchannel','fields':[_0x47b9('0xc'),_0x47b9('0x16')]},{'unique':!![],'name':_0x47b9('0x17'),'fields':[_0x47b9('0xc'),_0x47b9('0x18')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index d85a49e..15fba70 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(_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 +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(_0x36c37d,_0x1df748){var _0x6c04bd=function(_0x2e4415){while(--_0x2e4415){_0x36c37d['push'](_0x36c37d['shift']());}};_0x6c04bd(++_0x1df748);}(_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 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 ef3669b..14d2555 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 _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 +var _0xb419=['/:id','show','post','create','put','update','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated'];(function(_0x589f71,_0x212326){var _0x5763bd=function(_0x2cb8e1){while(--_0x2cb8e1){_0x589f71['push'](_0x589f71['shift']());}};_0x5763bd(++_0x212326);}(_0xb419,0x6e));var _0x9b41=function(_0xe71f99,_0x2a50d7){_0xe71f99=_0xe71f99-0x0;var _0x6da2f2=_0xb419[_0xe71f99];return _0x6da2f2;};'use strict';var multer=require('multer');var util=require(_0x9b41('0x0'));var path=require(_0x9b41('0x1'));var timeout=require('connect-timeout');var express=require(_0x9b41('0x2'));var router=express[_0x9b41('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9b41('0x4'));var interaction=require(_0x9b41('0x5'));var config=require('../../config/environment');var controller=require(_0x9b41('0x6'));router[_0x9b41('0x7')]('/',auth[_0x9b41('0x8')](),controller['index']);router[_0x9b41('0x7')](_0x9b41('0x9'),auth[_0x9b41('0x8')](),controller[_0x9b41('0xa')]);router[_0x9b41('0xb')]('/',auth['isAuthenticated'](),controller[_0x9b41('0xc')]);router[_0x9b41('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x9b41('0xe')]);router['delete'](_0x9b41('0x9'),auth[_0x9b41('0x8')](),controller[_0x9b41('0xf')]);module[_0x9b41('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 22ff10c..b3cae92 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 _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 +var _0x663b=['sequelize','exports','STRING','ENUM','yes','localstationid','2400','7200','9600','12000','14400','4800','INTEGER','SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x5cd05a,_0x2ebac7){var _0x2c3d94=function(_0x41f5b2){while(--_0x41f5b2){_0x5cd05a['push'](_0x5cd05a['shift']());}};_0x2c3d94(++_0x2ebac7);}(_0x663b,0x120));var _0xb663=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x663b[_0x342700];return _0x53406f;};'use strict';var Sequelize=require(_0xb663('0x0'));module[_0xb663('0x1')]={'name':{'type':Sequelize[_0xb663('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb663('0x2')]},'ecm':{'type':Sequelize[_0xb663('0x3')](_0xb663('0x4'),'no'),'defaultValue':_0xb663('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xb663('0x2')],'unique':_0xb663('0x5')},'minrate':{'type':Sequelize['ENUM'](_0xb663('0x6'),'4800',_0xb663('0x7'),_0xb663('0x8'),_0xb663('0x9'),_0xb663('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xb663('0x3')](_0xb663('0x6'),_0xb663('0xb'),_0xb663('0x7'),_0xb663('0x8'),_0xb663('0x9'),_0xb663('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xb663('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xb663('0x2')],'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[_0xb663('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xb663('0x3')](_0xb663('0xd'),_0xb663('0xe'),_0xb663('0xf'),'KHOMP'),'defaultValue':_0xb663('0xd')},'key':{'type':Sequelize[_0xb663('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb663('0x10')],'defaultValue':function(){return _0xb663('0x11');}},'notificationSound':{'type':Sequelize[_0xb663('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb663('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb663('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb663('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb663('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xb663('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xb663('0x12')],'defaultValue':![],'comment':_0xb663('0x14'),'set':function(_0x3c9c81){if(!_0x3c9c81)this[_0xb663('0x15')](_0xb663('0x16'),null);this[_0xb663('0x15')](_0xb663('0x17'),_0x3c9c81);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 106926a..94ab9a3 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 _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 +var _0xc433=['Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','stack','finally','getApplications','context','from-voip-provider','exten','system','description','Fax\x20Extension','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','/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','updateAccountApplications','VoiceExtension','tech','key','createdAt','updatedAt','TrunkId','ListId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','DESC','attachments','join','root','server/files/attachments','isNil','from','format','List','Contacts','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','filename','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','squel','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','client','request','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','name','send','index','map','FaxAccount','rawAttributes','type','model','keys','query','intersection','attributes','fields','length','nolimit','offset','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','addDisposition','FaxAccountId','getDispositions','Disposition','hasOwnProperty','order','rows','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','Owner','fullname','Tag'];(function(_0x51f569,_0x1b3701){var _0xf533c0=function(_0xe85a1a){while(--_0xe85a1a){_0x51f569['push'](_0x51f569['shift']());}};_0xf533c0(++_0x1b3701);}(_0xc433,0x1dc));var _0x3c43=function(_0x55e454,_0x453e39){_0x55e454=_0x55e454-0x0;var _0x21b676=_0xc433[_0x55e454];return _0x21b676;};'use strict';var emlformat=require(_0x3c43('0x0'));var rimraf=require(_0x3c43('0x1'));var zipdir=require(_0x3c43('0x2'));var jsonpatch=require(_0x3c43('0x3'));var rp=require(_0x3c43('0x4'));var moment=require(_0x3c43('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3c43('0x6'));var util=require('util');var path=require(_0x3c43('0x7'));var sox=require(_0x3c43('0x8'));var csv=require('to-csv');var ejs=require(_0x3c43('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3c43('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3c43('0xb'));var querystring=require(_0x3c43('0xc'));var Papa=require('papaparse');var Redis=require(_0x3c43('0xd'));var authService=require(_0x3c43('0xe'));var qs=require(_0x3c43('0xf'));var as=require(_0x3c43('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c43('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x3c43('0x12'));var licenseUtil=require(_0x3c43('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x3c43('0x14')],{'host':_0x3c43('0x15'),'port':0x18eb});var socket=require(_0x3c43('0x16'))(new Redis(config[_0x3c43('0x14')]));require(_0x3c43('0x17'))[_0x3c43('0x18')](socket);var jayson=require(_0x3c43('0x19'));var client=jayson['client'][_0x3c43('0x1a')]({'port':0x232c});var client9002=jayson[_0x3c43('0x1b')][_0x3c43('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x10d17b,_0x444fcd,_0x1568d6,_0x286e92){return new BPromise(function(_0x49469a,_0x54fd2a){var _0x413660=_0x286e92||client;return _0x413660[_0x3c43('0x1c')](_0x10d17b,_0x1568d6)['then'](function(_0x14a4a1){logger['info'](_0x3c43('0x1d'),_0x444fcd,_0x3c43('0x1e'));logger[_0x3c43('0x1f')](_0x3c43('0x20'),_0x444fcd,'request\x20sent',JSON['stringify'](_0x14a4a1));if(_0x14a4a1['error']){if(_0x14a4a1[_0x3c43('0x21')][_0x3c43('0x22')]===0x1f4){logger[_0x3c43('0x21')](_0x3c43('0x1d'),_0x444fcd,_0x14a4a1[_0x3c43('0x21')]['message']);return _0x54fd2a(_0x14a4a1[_0x3c43('0x21')][_0x3c43('0x23')]);}logger[_0x3c43('0x21')](_0x3c43('0x1d'),_0x444fcd,_0x14a4a1[_0x3c43('0x21')][_0x3c43('0x23')]);return _0x49469a(_0x14a4a1[_0x3c43('0x21')][_0x3c43('0x23')]);}else{logger[_0x3c43('0x24')](_0x3c43('0x1d'),_0x444fcd,_0x3c43('0x1e'));_0x49469a(_0x14a4a1['result'][_0x3c43('0x23')]);}})['catch'](function(_0x3e45eb){logger[_0x3c43('0x21')](_0x3c43('0x1d'),_0x444fcd,_0x3e45eb);_0x54fd2a(_0x3e45eb);});});}function respondWithStatusCode(_0x2a35e5,_0x3c57d0){_0x3c57d0=_0x3c57d0||0xcc;return function(_0x4359c7){if(_0x4359c7){return _0x2a35e5[_0x3c43('0x25')](_0x3c57d0);}return _0x2a35e5[_0x3c43('0x26')](_0x3c57d0)[_0x3c43('0x27')]();};}function respondWithResult(_0x4de215,_0x415095){_0x415095=_0x415095||0xc8;return function(_0x4500d2){if(_0x4500d2){return _0x4de215[_0x3c43('0x26')](_0x415095)[_0x3c43('0x28')](_0x4500d2);}};}function respondWithFilteredResult(_0x421178,_0x56e754){return function(_0x25a0b5){if(_0x25a0b5){var _0x6e0d19=typeof _0x56e754['offset']===_0x3c43('0x29')&&typeof _0x56e754[_0x3c43('0x2a')]===_0x3c43('0x29');var _0x3ebb21=_0x25a0b5[_0x3c43('0x2b')];var _0x116c06=_0x6e0d19?0x0:_0x56e754['offset'];var _0x391eb0=_0x6e0d19?_0x25a0b5['count']:_0x56e754['offset']+_0x56e754['limit'];var _0x5004bc;if(_0x391eb0>=_0x3ebb21){_0x391eb0=_0x3ebb21;_0x5004bc=0xc8;}else{_0x5004bc=0xce;}_0x421178['status'](_0x5004bc);return _0x421178[_0x3c43('0x2c')](_0x3c43('0x2d'),_0x116c06+'-'+_0x391eb0+'/'+_0x3ebb21)[_0x3c43('0x28')](_0x25a0b5);}return null;};}function patchUpdates(_0x23543f){return function(_0x4a16f9){try{jsonpatch[_0x3c43('0x2e')](_0x4a16f9,_0x23543f,!![]);}catch(_0x357813){return BPromise[_0x3c43('0x2f')](_0x357813);}return _0x4a16f9[_0x3c43('0x30')]();};}function saveUpdates(_0x49bbb,_0x41089e){return function(_0x975b27){if(_0x975b27){return _0x975b27[_0x3c43('0x31')](_0x49bbb)[_0x3c43('0x32')](function(_0x49c244){return _0x49c244;});}return null;};}function removeEntity(_0x538bd7,_0x5ca080){return function(_0x5243f9){if(_0x5243f9){return _0x5243f9['destroy']()[_0x3c43('0x32')](function(){var _0x4140a5=_0x5243f9[_0x3c43('0x33')]({'plain':!![]});var _0x382229='FaxAccounts';return db[_0x3c43('0x34')][_0x3c43('0x35')]({'where':{'type':_0x382229,'resourceId':_0x4140a5['id']}})[_0x3c43('0x32')](function(){return _0x5243f9;});})[_0x3c43('0x32')](function(){_0x538bd7[_0x3c43('0x26')](0xcc)[_0x3c43('0x27')]();});}};}function handleEntityNotFound(_0x4658c8,_0x277f1b){return function(_0x2ca104){if(!_0x2ca104){_0x4658c8['sendStatus'](0x194);}return _0x2ca104;};}function handleError(_0x4fa0a7,_0x3e309c){_0x3e309c=_0x3e309c||0x1f4;return function(_0x475fa6){logger[_0x3c43('0x21')](_0x475fa6['stack']);if(_0x475fa6[_0x3c43('0x36')]){delete _0x475fa6[_0x3c43('0x36')];}_0x4fa0a7[_0x3c43('0x26')](_0x3e309c)[_0x3c43('0x37')](_0x475fa6);};}exports[_0x3c43('0x38')]=function(_0x377f5d,_0x8a2020){var _0x203824={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x317da2={},_0x367dbd={'count':0x0,'rows':[]};var _0x293ed1=_[_0x3c43('0x39')](db[_0x3c43('0x3a')][_0x3c43('0x3b')],function(_0x12edeb){return{'name':_0x12edeb['fieldName'],'type':_0x12edeb[_0x3c43('0x3c')]['key']};});_0x317da2[_0x3c43('0x3d')]=_[_0x3c43('0x39')](_0x293ed1,_0x3c43('0x36'));_0x317da2['query']=_[_0x3c43('0x3e')](_0x377f5d[_0x3c43('0x3f')]);_0x317da2['filters']=_[_0x3c43('0x40')](_0x317da2[_0x3c43('0x3d')],_0x317da2[_0x3c43('0x3f')]);_0x203824[_0x3c43('0x41')]=_[_0x3c43('0x40')](_0x317da2['model'],qs['fields'](_0x377f5d[_0x3c43('0x3f')][_0x3c43('0x42')]));_0x203824['attributes']=_0x203824[_0x3c43('0x41')][_0x3c43('0x43')]?_0x203824[_0x3c43('0x41')]:_0x317da2['model'];if(!_0x377f5d['query']['hasOwnProperty'](_0x3c43('0x44'))){_0x203824[_0x3c43('0x2a')]=qs['limit'](_0x377f5d['query'][_0x3c43('0x2a')]);_0x203824['offset']=qs[_0x3c43('0x45')](_0x377f5d[_0x3c43('0x3f')][_0x3c43('0x45')]);}_0x203824['order']=qs[_0x3c43('0x46')](_0x377f5d[_0x3c43('0x3f')]['sort']);_0x203824[_0x3c43('0x47')]=qs[_0x3c43('0x48')](_[_0x3c43('0x49')](_0x377f5d[_0x3c43('0x3f')],_0x317da2[_0x3c43('0x48')]),_0x293ed1);if(_0x377f5d[_0x3c43('0x3f')][_0x3c43('0x4a')]){_0x203824[_0x3c43('0x47')]=_[_0x3c43('0x4b')](_0x203824[_0x3c43('0x47')],{'$or':_[_0x3c43('0x39')](_0x293ed1,function(_0x39d142){if(_0x39d142['type']!==_0x3c43('0x4c')){var _0x582d48={};_0x582d48[_0x39d142[_0x3c43('0x36')]]={'$like':'%'+_0x377f5d[_0x3c43('0x3f')][_0x3c43('0x4a')]+'%'};return _0x582d48;}})});}_0x203824=_[_0x3c43('0x4b')]({},_0x203824,_0x377f5d[_0x3c43('0x4d')]);var _0x47d954={'where':_0x203824[_0x3c43('0x47')]};return db[_0x3c43('0x3a')][_0x3c43('0x2b')](_0x47d954)[_0x3c43('0x32')](function(_0x1243d0){_0x367dbd[_0x3c43('0x2b')]=_0x1243d0;if(_0x377f5d[_0x3c43('0x3f')][_0x3c43('0x4e')]){_0x203824[_0x3c43('0x4f')]=[{'all':!![]}];}return db[_0x3c43('0x3a')][_0x3c43('0x50')](_0x203824);})[_0x3c43('0x32')](function(_0x59c363){_0x367dbd['rows']=_0x59c363;return _0x367dbd;})['then'](respondWithFilteredResult(_0x8a2020,_0x203824))[_0x3c43('0x51')](handleError(_0x8a2020,null));};exports[_0x3c43('0x52')]=function(_0x15bdea,_0x1a6ddf){var _0x3c254f={'raw':![],'where':{'id':_0x15bdea[_0x3c43('0x53')]['id']},'include':[{'model':db[_0x3c43('0x54')],'as':'mandatoryDispositionPause'}]},_0x4eb069={};_0x4eb069['model']=_[_0x3c43('0x3e')](db['FaxAccount'][_0x3c43('0x3b')]);_0x4eb069[_0x3c43('0x3f')]=_[_0x3c43('0x3e')](_0x15bdea['query']);_0x4eb069[_0x3c43('0x48')]=_['intersection'](_0x4eb069['model'],_0x4eb069['query']);_0x3c254f[_0x3c43('0x41')]=_['intersection'](_0x4eb069[_0x3c43('0x3d')],qs[_0x3c43('0x42')](_0x15bdea['query'][_0x3c43('0x42')]));_0x3c254f[_0x3c43('0x41')]=_0x3c254f[_0x3c43('0x41')]['length']?_0x3c254f[_0x3c43('0x41')]:_0x4eb069[_0x3c43('0x3d')];if(_0x15bdea[_0x3c43('0x3f')][_0x3c43('0x4e')]){_0x3c254f[_0x3c43('0x4f')]=[{'all':!![]}];}_0x3c254f=_['merge']({},_0x3c254f,_0x15bdea[_0x3c43('0x4d')]);return db['FaxAccount'][_0x3c43('0x55')](_0x3c254f)[_0x3c43('0x32')](handleEntityNotFound(_0x1a6ddf,null))['then'](respondWithResult(_0x1a6ddf,null))[_0x3c43('0x51')](handleError(_0x1a6ddf,null));};exports['create']=function(_0x1e9920,_0x3a6230){return db[_0x3c43('0x3a')][_0x3c43('0x56')](_0x1e9920[_0x3c43('0x57')],{})[_0x3c43('0x32')](function(_0x35c245){var _0x41bc0c=_0x1e9920[_0x3c43('0x58')][_0x3c43('0x33')]({'plain':!![]});if(!_0x41bc0c)throw new Error(_0x3c43('0x59'));if(_0x41bc0c['role']===_0x3c43('0x58')){var _0x19382b=_0x35c245[_0x3c43('0x33')]({'plain':!![]});var _0x38769c=_0x3c43('0x5a');return db[_0x3c43('0x5b')][_0x3c43('0x55')]({'where':{'name':_0x38769c,'userProfileId':_0x41bc0c[_0x3c43('0x5c')]},'raw':!![]})['then'](function(_0x5f470e){if(_0x5f470e&&_0x5f470e[_0x3c43('0x5d')]===0x0){return db[_0x3c43('0x34')][_0x3c43('0x56')]({'name':_0x19382b[_0x3c43('0x36')],'resourceId':_0x19382b['id'],'type':_0x5f470e['name'],'sectionId':_0x5f470e['id']},{})[_0x3c43('0x32')](function(){return _0x35c245;});}else{return _0x35c245;}})['catch'](function(_0xb8b502){logger[_0x3c43('0x21')](_0x3c43('0x5e'),_0xb8b502);throw _0xb8b502;});}return _0x35c245;})[_0x3c43('0x32')](respondWithResult(_0x3a6230,0xc9))[_0x3c43('0x51')](handleError(_0x3a6230,null));};exports['update']=function(_0x56965a,_0x175b9b){if(_0x56965a['body']['id']){delete _0x56965a['body']['id'];}return db[_0x3c43('0x3a')][_0x3c43('0x55')]({'where':{'id':_0x56965a[_0x3c43('0x53')]['id']},'include':[{'model':db[_0x3c43('0x54')],'as':_0x3c43('0x5f')}]})['then'](handleEntityNotFound(_0x175b9b,null))[_0x3c43('0x32')](saveUpdates(_0x56965a[_0x3c43('0x57')],null))[_0x3c43('0x32')](respondWithResult(_0x175b9b,null))[_0x3c43('0x51')](handleError(_0x175b9b,null));};exports[_0x3c43('0x35')]=function(_0x109d13,_0x4ec84d){return db[_0x3c43('0x3a')]['find']({'where':{'id':_0x109d13[_0x3c43('0x53')]['id']}})[_0x3c43('0x32')](handleEntityNotFound(_0x4ec84d,null))['then'](removeEntity(_0x4ec84d,null))['catch'](handleError(_0x4ec84d,null));};exports['describe']=function(_0x30471e,_0x8c7675){return db[_0x3c43('0x3a')]['describe']()['then'](respondWithResult(_0x8c7675,null))['catch'](handleError(_0x8c7675,null));};exports[_0x3c43('0x60')]=function(_0x203fca,_0x229bef,_0x53e20e){if(_0x203fca[_0x3c43('0x57')]['id']){delete _0x203fca[_0x3c43('0x57')]['id'];}return db[_0x3c43('0x3a')]['find']({'where':{'id':_0x203fca[_0x3c43('0x53')]['id']}})[_0x3c43('0x32')](handleEntityNotFound(_0x229bef,null))[_0x3c43('0x32')](function(_0x3fc9c4){if(_0x3fc9c4){_0x203fca['body'][_0x3c43('0x61')]=_0x3fc9c4['id'];return db['Disposition']['create'](_0x203fca[_0x3c43('0x57')]);}})[_0x3c43('0x32')](respondWithResult(_0x229bef,null))[_0x3c43('0x51')](handleError(_0x229bef,null));};exports[_0x3c43('0x62')]=function(_0x5f5d69,_0x285ac6,_0x1bae1e){var _0x281c2f={'raw':![],'where':{}};var _0x1a6e72={};var _0x34233a={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x5f5d69['params']['id']}})[_0x3c43('0x32')](handleEntityNotFound(_0x285ac6,null))[_0x3c43('0x32')](function(_0x2fc383){if(_0x2fc383){_0x1a6e72[_0x3c43('0x3d')]=_[_0x3c43('0x3e')](db[_0x3c43('0x63')]['rawAttributes']);_0x1a6e72[_0x3c43('0x3f')]=_[_0x3c43('0x3e')](_0x5f5d69[_0x3c43('0x3f')]);_0x1a6e72['filters']=_['intersection'](_0x1a6e72['model'],_0x1a6e72[_0x3c43('0x3f')]);_0x281c2f[_0x3c43('0x41')]=_['intersection'](_0x1a6e72[_0x3c43('0x3d')],qs['fields'](_0x5f5d69[_0x3c43('0x3f')][_0x3c43('0x42')]));_0x281c2f[_0x3c43('0x41')]=_0x281c2f[_0x3c43('0x41')][_0x3c43('0x43')]?_0x281c2f[_0x3c43('0x41')]:_0x1a6e72['model'];if(!_0x5f5d69['query'][_0x3c43('0x64')](_0x3c43('0x44'))){_0x281c2f[_0x3c43('0x2a')]=qs['limit'](_0x5f5d69[_0x3c43('0x3f')][_0x3c43('0x2a')]);_0x281c2f[_0x3c43('0x45')]=qs['offset'](_0x5f5d69[_0x3c43('0x3f')][_0x3c43('0x45')]);}_0x281c2f[_0x3c43('0x65')]=qs[_0x3c43('0x46')](_0x5f5d69[_0x3c43('0x3f')][_0x3c43('0x46')]);_0x281c2f[_0x3c43('0x47')]=qs[_0x3c43('0x48')](_[_0x3c43('0x49')](_0x5f5d69[_0x3c43('0x3f')],_0x1a6e72[_0x3c43('0x48')]));_0x281c2f[_0x3c43('0x47')][_0x3c43('0x61')]=_0x2fc383['id'];if(_0x5f5d69[_0x3c43('0x3f')][_0x3c43('0x4a')]){_0x281c2f[_0x3c43('0x47')]=_[_0x3c43('0x4b')](_0x281c2f[_0x3c43('0x47')],{'$or':_['map'](_0x281c2f[_0x3c43('0x41')],function(_0x2a216a){var _0x2d3c99={};_0x2d3c99[_0x2a216a]={'$like':'%'+_0x5f5d69['query'][_0x3c43('0x4a')]+'%'};return _0x2d3c99;})});}_0x281c2f=_[_0x3c43('0x4b')]({},_0x281c2f,_0x5f5d69[_0x3c43('0x4d')]);return db[_0x3c43('0x63')][_0x3c43('0x2b')]({'where':_0x281c2f[_0x3c43('0x47')]})[_0x3c43('0x32')](function(_0x54f5ac){_0x34233a[_0x3c43('0x2b')]=_0x54f5ac;if(_0x5f5d69[_0x3c43('0x3f')][_0x3c43('0x4e')]){_0x281c2f[_0x3c43('0x4f')]=[{'all':!![]}];}return db[_0x3c43('0x63')]['findAll'](_0x281c2f);})[_0x3c43('0x32')](function(_0x1bac4e){_0x34233a[_0x3c43('0x66')]=_0x1bac4e;return _0x34233a;});}})[_0x3c43('0x32')](respondWithFilteredResult(_0x285ac6,_0x281c2f))[_0x3c43('0x51')](handleError(_0x285ac6,null));};exports[_0x3c43('0x67')]=function(_0x15307e,_0x3983c1,_0x4ad820){return db[_0x3c43('0x3a')][_0x3c43('0x55')]({'where':{'id':_0x15307e['params']['id']}})[_0x3c43('0x32')](handleEntityNotFound(_0x3983c1,null))[_0x3c43('0x32')](function(_0xb59b3c){if(_0xb59b3c){return _0xb59b3c[_0x3c43('0x67')](_0x15307e[_0x3c43('0x3f')][_0x3c43('0x68')]);}})[_0x3c43('0x32')](respondWithStatusCode(_0x3983c1,null))[_0x3c43('0x51')](handleError(_0x3983c1,null));};exports['addAnswer']=function(_0x161c2d,_0x1ae492,_0x490568){if(_0x161c2d[_0x3c43('0x57')]['id']){delete _0x161c2d[_0x3c43('0x57')]['id'];}return db[_0x3c43('0x3a')][_0x3c43('0x55')]({'where':{'id':_0x161c2d[_0x3c43('0x53')]['id']}})['then'](handleEntityNotFound(_0x1ae492,null))[_0x3c43('0x32')](function(_0x18b1b0){if(_0x18b1b0){_0x161c2d[_0x3c43('0x57')][_0x3c43('0x61')]=_0x18b1b0['id'];return db[_0x3c43('0x69')][_0x3c43('0x56')](_0x161c2d[_0x3c43('0x57')]);}})['then'](respondWithResult(_0x1ae492,null))[_0x3c43('0x51')](handleError(_0x1ae492,null));};exports[_0x3c43('0x6a')]=function(_0x3fb281,_0x278cb6,_0x2e4174){var _0x3dceb9={'raw':![],'where':{}};var _0x140917={};var _0x344c39={'count':0x0,'rows':[]};return db[_0x3c43('0x3a')][_0x3c43('0x6b')]({'where':{'id':_0x3fb281[_0x3c43('0x53')]['id']}})['then'](handleEntityNotFound(_0x278cb6,null))[_0x3c43('0x32')](function(_0x15b122){if(_0x15b122){_0x140917[_0x3c43('0x3d')]=_[_0x3c43('0x3e')](db[_0x3c43('0x69')][_0x3c43('0x3b')]);_0x140917[_0x3c43('0x3f')]=_[_0x3c43('0x3e')](_0x3fb281[_0x3c43('0x3f')]);_0x140917[_0x3c43('0x48')]=_[_0x3c43('0x40')](_0x140917[_0x3c43('0x3d')],_0x140917[_0x3c43('0x3f')]);_0x3dceb9[_0x3c43('0x41')]=_[_0x3c43('0x40')](_0x140917[_0x3c43('0x3d')],qs[_0x3c43('0x42')](_0x3fb281['query'][_0x3c43('0x42')]));_0x3dceb9[_0x3c43('0x41')]=_0x3dceb9['attributes']['length']?_0x3dceb9[_0x3c43('0x41')]:_0x140917[_0x3c43('0x3d')];if(!_0x3fb281[_0x3c43('0x3f')][_0x3c43('0x64')](_0x3c43('0x44'))){_0x3dceb9[_0x3c43('0x2a')]=qs[_0x3c43('0x2a')](_0x3fb281[_0x3c43('0x3f')]['limit']);_0x3dceb9[_0x3c43('0x45')]=qs[_0x3c43('0x45')](_0x3fb281[_0x3c43('0x3f')][_0x3c43('0x45')]);}_0x3dceb9['order']=qs[_0x3c43('0x46')](_0x3fb281[_0x3c43('0x3f')][_0x3c43('0x46')]);_0x3dceb9[_0x3c43('0x47')]=qs[_0x3c43('0x48')](_[_0x3c43('0x49')](_0x3fb281[_0x3c43('0x3f')],_0x140917['filters']));_0x3dceb9[_0x3c43('0x47')]['FaxAccountId']=_0x15b122['id'];if(_0x3fb281['query'][_0x3c43('0x4a')]){_0x3dceb9[_0x3c43('0x47')]=_[_0x3c43('0x4b')](_0x3dceb9['where'],{'$or':_[_0x3c43('0x39')](_0x3dceb9['attributes'],function(_0x33602e){var _0x11180e={};_0x11180e[_0x33602e]={'$like':'%'+_0x3fb281[_0x3c43('0x3f')][_0x3c43('0x4a')]+'%'};return _0x11180e;})});}_0x3dceb9=_['merge']({},_0x3dceb9,_0x3fb281[_0x3c43('0x4d')]);return db[_0x3c43('0x69')]['count']({'where':_0x3dceb9[_0x3c43('0x47')]})[_0x3c43('0x32')](function(_0x371016){_0x344c39[_0x3c43('0x2b')]=_0x371016;if(_0x3fb281[_0x3c43('0x3f')][_0x3c43('0x4e')]){_0x3dceb9[_0x3c43('0x4f')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3c43('0x50')](_0x3dceb9);})[_0x3c43('0x32')](function(_0x2fc592){_0x344c39['rows']=_0x2fc592;return _0x344c39;});}})['then'](respondWithFilteredResult(_0x278cb6,_0x3dceb9))[_0x3c43('0x51')](handleError(_0x278cb6,null));};exports[_0x3c43('0x6c')]=function(_0xf35622,_0x37a2e5,_0x418124){return db[_0x3c43('0x3a')][_0x3c43('0x55')]({'where':{'id':_0xf35622[_0x3c43('0x53')]['id']}})[_0x3c43('0x32')](handleEntityNotFound(_0x37a2e5,null))[_0x3c43('0x32')](function(_0x69db14){if(_0x69db14){return _0x69db14[_0x3c43('0x6c')](_0xf35622['query'][_0x3c43('0x68')]);}})[_0x3c43('0x32')](respondWithStatusCode(_0x37a2e5,null))['catch'](handleError(_0x37a2e5,null));};exports[_0x3c43('0x6d')]=function(_0x51561e,_0x1f9418,_0x177721){return db['FaxInteraction']['find']({'where':{'id':_0x51561e[_0x3c43('0x53')]['id']}})['then'](handleEntityNotFound(_0x1f9418,null))[_0x3c43('0x32')](function(_0x3c05cc){if(_0x3c05cc){return _0x3c05cc[_0x3c43('0x6d')](_0x51561e[_0x3c43('0x57')][_0x3c43('0x68')],_[_0x3c43('0x6e')](_0x51561e['body'],[_0x3c43('0x68'),'id'])||{});}})[_0x3c43('0x32')](respondWithResult(_0x1f9418,null))[_0x3c43('0x51')](handleError(_0x1f9418,null));};exports[_0x3c43('0x6f')]=function(_0x3bbbc9,_0x2f0097,_0x20d7f5){var _0x542a20={'raw':![],'where':{}};var _0x101cfb={};var _0x40f15e={'count':0x0,'rows':[]};return db[_0x3c43('0x3a')][_0x3c43('0x6b')]({'where':{'id':_0x3bbbc9[_0x3c43('0x53')]['id']}})['then'](handleEntityNotFound(_0x2f0097,null))[_0x3c43('0x32')](function(_0x191071){if(_0x191071){_0x101cfb[_0x3c43('0x3d')]=_[_0x3c43('0x3e')](db[_0x3c43('0x70')][_0x3c43('0x3b')]);_0x101cfb[_0x3c43('0x3f')]=_[_0x3c43('0x3e')](_0x3bbbc9[_0x3c43('0x3f')]);_0x101cfb[_0x3c43('0x48')]=_[_0x3c43('0x40')](_0x101cfb[_0x3c43('0x3d')],_0x101cfb['query']);_0x542a20[_0x3c43('0x41')]=_[_0x3c43('0x40')](_0x101cfb[_0x3c43('0x3d')],qs['fields'](_0x3bbbc9[_0x3c43('0x3f')][_0x3c43('0x42')]));_0x542a20[_0x3c43('0x41')]=_0x542a20[_0x3c43('0x41')][_0x3c43('0x43')]?_0x542a20[_0x3c43('0x41')]:_0x101cfb[_0x3c43('0x3d')];if(!_0x3bbbc9[_0x3c43('0x3f')][_0x3c43('0x64')]('nolimit')){_0x542a20[_0x3c43('0x2a')]=qs[_0x3c43('0x2a')](_0x3bbbc9[_0x3c43('0x3f')][_0x3c43('0x2a')]);_0x542a20[_0x3c43('0x45')]=qs[_0x3c43('0x45')](_0x3bbbc9['query'][_0x3c43('0x45')]);}_0x542a20[_0x3c43('0x65')]=qs['sort'](_0x3bbbc9[_0x3c43('0x3f')][_0x3c43('0x46')]);_0x542a20['where']=qs[_0x3c43('0x48')](_['pick'](_0x3bbbc9[_0x3c43('0x3f')],_0x101cfb[_0x3c43('0x48')]));_0x542a20['where'][_0x3c43('0x61')]=_0x191071['id'];if(_0x3bbbc9[_0x3c43('0x3f')][_0x3c43('0x4a')]){_0x542a20[_0x3c43('0x47')]=_[_0x3c43('0x4b')](_0x542a20[_0x3c43('0x47')],{'$or':_[_0x3c43('0x39')](_0x542a20['attributes'],function(_0x4cd69a){var _0xdc64ad={};_0xdc64ad[_0x4cd69a]={'$like':'%'+_0x3bbbc9[_0x3c43('0x3f')][_0x3c43('0x4a')]+'%'};return _0xdc64ad;})});}_0x542a20=_[_0x3c43('0x4b')]({},_0x542a20,_0x3bbbc9[_0x3c43('0x4d')]);return db['FaxInteraction'][_0x3c43('0x2b')]({'where':_0x542a20[_0x3c43('0x47')]})['then'](function(_0x7c2fe){_0x40f15e['count']=_0x7c2fe;if(_0x3bbbc9[_0x3c43('0x3f')][_0x3c43('0x4e')]){_0x542a20[_0x3c43('0x4f')]=[{'model':db[_0x3c43('0x71')],'as':_0x3c43('0x72'),'required':![]},{'model':db['User'],'as':_0x3c43('0x73'),'attributes':['name',_0x3c43('0x74'),'internal'],'required':![]},{'model':db[_0x3c43('0x75')],'as':_0x3c43('0x76'),'attributes':['id',_0x3c43('0x36'),_0x3c43('0x77')],'where':_0x3bbbc9[_0x3c43('0x3f')]['tag']?{'id':_0x3bbbc9[_0x3c43('0x3f')][_0x3c43('0x78')]}:undefined,'required':_0x3bbbc9[_0x3c43('0x3f')][_0x3c43('0x78')]?!![]:![]}];}return db['FaxInteraction'][_0x3c43('0x50')](_0x542a20);})[_0x3c43('0x32')](function(_0x49484b){_0x40f15e[_0x3c43('0x66')]=_0x49484b;return _0x40f15e;});}})[_0x3c43('0x32')](respondWithFilteredResult(_0x2f0097,_0x542a20))[_0x3c43('0x51')](handleError(_0x2f0097,null));};exports[_0x3c43('0x79')]=function(_0x2e7c83,_0x34a008){var _0x182c39=_0x2e7c83[_0x3c43('0x53')]['id'];var _0x2720f0=_0x2e7c83[_0x3c43('0x57')];var _0x58e845=0xc8;var _0x5d365e=null;return db[_0x3c43('0x7a')][_0x3c43('0x7b')]({'isolationLevel':db['sequelize'][_0x3c43('0x7c')][_0x3c43('0x7d')][_0x3c43('0x7e')]},function(_0x294770){return db[_0x3c43('0x3a')][_0x3c43('0x6b')]({'where':{'id':_0x182c39},'transaction':_0x294770})[_0x3c43('0x32')](function(_0x362e6e){if(_0x362e6e){return db[_0x3c43('0x7f')]['destroy']({'where':{'FaxAccountId':_0x182c39},'transaction':_0x294770})[_0x3c43('0x32')](function(){var _0x37d1ff=_[_0x3c43('0x39')](_0x2720f0,function(_0x149fd3){_0x149fd3[_0x3c43('0x61')]=_0x182c39;return _0x149fd3;});return db[_0x3c43('0x7f')][_0x3c43('0x80')](_0x37d1ff,{'transaction':_0x294770});});}else{_0x58e845=0x194;_0x5d365e=[];}});})[_0x3c43('0x32')](function(){if(_0x58e845!==0x194){return db[_0x3c43('0x7f')][_0x3c43('0x81')]({'where':{'FaxAccountId':_0x182c39},'order':'priority'})[_0x3c43('0x32')](function(_0x4205ed){_0x5d365e=_0x4205ed;});}})[_0x3c43('0x51')](function(_0x42afa2){_0x58e845=0x1f4;logger[_0x3c43('0x21')](_0x42afa2[_0x3c43('0x82')]);if(_0x42afa2[_0x3c43('0x36')]){delete _0x42afa2[_0x3c43('0x36')];}_0x5d365e=_0x42afa2;})[_0x3c43('0x83')](function(){if(_0x5d365e===null){_0x34a008['sendStatus'](_0x58e845);}else{if(_0x58e845===0x1f4){_0x34a008[_0x3c43('0x26')](_0x58e845)[_0x3c43('0x37')](_0x5d365e);}else{_0x34a008[_0x3c43('0x26')](_0x58e845)[_0x3c43('0x28')](_0x5d365e);}}});};exports['getApplications']=function(_0x2ba661,_0x15314d,_0x4a6d8d){var _0x2ee6ea={};var _0x161a3b={};var _0x2445f3;var _0x1b775a;return db[_0x3c43('0x3a')]['findOne']({'where':{'id':_0x2ba661[_0x3c43('0x53')]['id']}})['then'](handleEntityNotFound(_0x15314d,null))[_0x3c43('0x32')](function(_0x472664){if(_0x472664){_0x2445f3=_0x472664;_0x161a3b[_0x3c43('0x3d')]=_[_0x3c43('0x3e')](db[_0x3c43('0x7f')][_0x3c43('0x3b')]);_0x161a3b[_0x3c43('0x3f')]=_[_0x3c43('0x3e')](_0x2ba661[_0x3c43('0x3f')]);_0x161a3b[_0x3c43('0x48')]=_['intersection'](_0x161a3b[_0x3c43('0x3d')],_0x161a3b['query']);_0x2ee6ea[_0x3c43('0x41')]=_['intersection'](_0x161a3b[_0x3c43('0x3d')],qs['fields'](_0x2ba661[_0x3c43('0x3f')]['fields']));_0x2ee6ea[_0x3c43('0x41')]=_0x2ee6ea[_0x3c43('0x41')]['length']?_0x2ee6ea[_0x3c43('0x41')]:_0x161a3b[_0x3c43('0x3d')];_0x2ee6ea[_0x3c43('0x65')]=qs[_0x3c43('0x46')](_0x2ba661['query'][_0x3c43('0x46')]);_0x2ee6ea[_0x3c43('0x47')]=qs[_0x3c43('0x48')](_['pick'](_0x2ba661['query'],_0x161a3b[_0x3c43('0x48')]));if(_0x2ba661['query']['filter']){_0x2ee6ea['where']=_[_0x3c43('0x4b')](_0x2ee6ea[_0x3c43('0x47')],{'$or':_['map'](_0x2ee6ea[_0x3c43('0x41')],function(_0xdeb8e8){var _0x3e46b2={};_0x3e46b2[_0xdeb8e8]={'$like':'%'+_0x2ba661[_0x3c43('0x3f')][_0x3c43('0x4a')]+'%'};return _0x3e46b2;})});}_0x2ee6ea=_[_0x3c43('0x4b')]({},_0x2ee6ea,_0x2ba661['options']);return _0x2445f3[_0x3c43('0x84')](_0x2ee6ea);}})[_0x3c43('0x32')](function(_0x314640){if(_0x314640){_0x1b775a=_0x314640[_0x3c43('0x43')];if(!_0x2ba661[_0x3c43('0x3f')]['hasOwnProperty'](_0x3c43('0x44'))){_0x2ee6ea[_0x3c43('0x2a')]=qs[_0x3c43('0x2a')](_0x2ba661['query'][_0x3c43('0x2a')]);_0x2ee6ea[_0x3c43('0x45')]=qs[_0x3c43('0x45')](_0x2ba661[_0x3c43('0x3f')][_0x3c43('0x45')]);}return _0x2445f3[_0x3c43('0x84')](_0x2ee6ea);}})[_0x3c43('0x32')](function(_0x4c9092){if(_0x4c9092){return _0x4c9092?{'count':_0x1b775a,'rows':_0x4c9092}:null;}})[_0x3c43('0x32')](respondWithResult(_0x15314d,null))['catch'](handleError(_0x15314d,null));};function Extension(_0x330f39,_0x221246,_0x55ca4f,_0x4ee983){this[_0x3c43('0x85')]=_0x3c43('0x86');this[_0x3c43('0x87')]=_0x330f39['localstationid'];this['app']=_0x4ee983;this['type']=_0x3c43('0x88');this[_0x3c43('0x89')]=_0x3c43('0x8a');this[_0x3c43('0x61')]=_0x330f39['id'];this[_0x3c43('0x8b')]=_0x221246;this[_0x3c43('0x8c')]=_0x55ca4f;}function createExtensionsReciveFax(_0x5b366f){var _0x1e251c=0x1;var _0x45f69e=[];_0x45f69e[_0x3c43('0x8d')](new Extension(_0x5b366f,_0x1e251c,'',_0x3c43('0x8e')));_0x1e251c+=0x1;_0x45f69e[_0x3c43('0x8d')](new Extension(_0x5b366f,_0x1e251c,_0x3c43('0x8f'),_0x3c43('0x90')));_0x1e251c+=0x1;for(var _0xf7e316 in _0x5b366f){if(_0x5b366f['hasOwnProperty'](_0xf7e316)&&(_0xf7e316==='ecm'||_0xf7e316==='localstationid'||_0xf7e316==='gateway'||_0xf7e316===_0x3c43('0x91')||_0xf7e316===_0x3c43('0x92')||_0xf7e316===_0x3c43('0x93')||_0xf7e316===_0x3c43('0x94')||_0xf7e316===_0x3c43('0x95')||_0xf7e316===_0x3c43('0x96'))){_0x45f69e[_0x3c43('0x8d')](new Extension(_0x5b366f,_0x1e251c,_0x3c43('0x97')+_0xf7e316+')='+_0x5b366f[_0xf7e316],_0x3c43('0x90')));_0x1e251c+=0x1;}}_0x45f69e[_0x3c43('0x8d')](new Extension(_0x5b366f,_0x1e251c,'6','Wait'));_0x1e251c+=0x1;_0x45f69e[_0x3c43('0x8d')](new Extension(_0x5b366f,_0x1e251c,_0x3c43('0x98'),_0x3c43('0x99')));_0x1e251c=0x0;return _0x45f69e;}exports[_0x3c43('0x9a')]=function(_0x60589c,_0x4694a8,_0x15b80d){var _0x3297d0;return db[_0x3c43('0x7a')][_0x3c43('0x7b')](function(_0x4d5f13){return db[_0x3c43('0x3a')]['create'](_0x60589c[_0x3c43('0x57')],{'transaction':_0x4d5f13})[_0x3c43('0x32')](function(_0x376e47){_0x3297d0=_0x376e47[_0x3c43('0x33')]({'plain':!![]});return db['VoiceExtension'][_0x3c43('0x80')](createExtensionsReciveFax(_0x3297d0),{'transaction':_0x4d5f13});});})[_0x3c43('0x32')](function(){return _0x3297d0;})[_0x3c43('0x32')](respondWithResult(_0x4694a8,null))['catch'](handleError(_0x4694a8,null));};exports[_0x3c43('0x9b')]=function(_0x1aa31e,_0x1a7e26,_0xbdf5ba){var _0x51c3df;return db[_0x3c43('0x7a')][_0x3c43('0x7b')](function(_0xfe005e){return db[_0x3c43('0x3a')][_0x3c43('0x31')](_0x1aa31e['body'],{'where':{'id':_0x1aa31e['body']['id']},'transaction':_0xfe005e})[_0x3c43('0x32')](function(_0x2d96ad){return db['VoiceExtension'][_0x3c43('0x35')]({'where':{'FaxAccountId':_0x1aa31e['body']['id']},'transaction':_0xfe005e})[_0x3c43('0x32')](function(_0x1693b1){return db[_0x3c43('0x9c')][_0x3c43('0x80')](createExtensionsReciveFax(_[_0x3c43('0x6e')](_0x1aa31e[_0x3c43('0x57')],[_0x3c43('0x9d'),_0x3c43('0x9e'),_0x3c43('0x9f'),_0x3c43('0xa0'),_0x3c43('0xa1'),_0x3c43('0xa2')])),{'transaction':_0xfe005e});});});})[_0x3c43('0x32')](function(){return db[_0x3c43('0x3a')]['findById'](_0x1aa31e[_0x3c43('0x57')]['id']);})[_0x3c43('0x32')](respondWithResult(_0x1a7e26,null))['catch'](handleError(_0x1a7e26,null));};exports[_0x3c43('0xa3')]=function(_0x22ccfc,_0x493424,_0x5c3c01){var _0x47675a={'raw':!![],'where':{}};var _0x27eb5c={};var _0x5d9929={'count':0x0,'rows':[]};return db[_0x3c43('0x3a')][_0x3c43('0x6b')]({'where':{'id':_0x22ccfc['params']['id']}})[_0x3c43('0x32')](handleEntityNotFound(_0x493424,null))[_0x3c43('0x32')](function(_0xae7b4b){if(_0xae7b4b){_0x27eb5c[_0x3c43('0x3d')]=_[_0x3c43('0x3e')](db['FaxMessage'][_0x3c43('0x3b')]);_0x27eb5c[_0x3c43('0x3f')]=_['keys'](_0x22ccfc[_0x3c43('0x3f')]);_0x27eb5c[_0x3c43('0x48')]=_[_0x3c43('0x40')](_0x27eb5c[_0x3c43('0x3d')],_0x27eb5c[_0x3c43('0x3f')]);_0x47675a[_0x3c43('0x41')]=_['intersection'](_0x27eb5c[_0x3c43('0x3d')],qs[_0x3c43('0x42')](_0x22ccfc[_0x3c43('0x3f')][_0x3c43('0x42')]));_0x47675a[_0x3c43('0x41')]=_0x47675a[_0x3c43('0x41')][_0x3c43('0x43')]?_0x47675a[_0x3c43('0x41')]:_0x27eb5c['model'];if(!_0x22ccfc[_0x3c43('0x3f')][_0x3c43('0x64')](_0x3c43('0x44'))){_0x47675a[_0x3c43('0x2a')]=qs[_0x3c43('0x2a')](_0x22ccfc['query'][_0x3c43('0x2a')]);_0x47675a[_0x3c43('0x45')]=qs[_0x3c43('0x45')](_0x22ccfc[_0x3c43('0x3f')][_0x3c43('0x45')]);}_0x47675a['order']=qs[_0x3c43('0x46')](_0x22ccfc[_0x3c43('0x3f')][_0x3c43('0x46')]);_0x47675a['where']=qs[_0x3c43('0x48')](_[_0x3c43('0x49')](_0x22ccfc[_0x3c43('0x3f')],_0x27eb5c[_0x3c43('0x48')]));_0x47675a[_0x3c43('0x47')]['FaxAccountId']=_0xae7b4b['id'];if(_0x22ccfc[_0x3c43('0x3f')][_0x3c43('0x4a')]){_0x47675a[_0x3c43('0x47')]=_[_0x3c43('0x4b')](_0x47675a[_0x3c43('0x47')],{'$or':_[_0x3c43('0x39')](_0x47675a[_0x3c43('0x41')],function(_0x45b4df){var _0xcf7426={};_0xcf7426[_0x45b4df]={'$like':'%'+_0x22ccfc['query']['filter']+'%'};return _0xcf7426;})});}if(_0x22ccfc[_0x3c43('0x3f')][_0x3c43('0xa4')]){var _0x3d30b8=_0x22ccfc[_0x3c43('0x3f')][_0x3c43('0xa4')][_0x3c43('0xa5')](',');var _0xbbd29b={};_0xbbd29b[_0x3d30b8[0x0]]={'$gte':moment(_0x3d30b8[0x1])['format'](_0x3c43('0xa6'))};_0x47675a['where']=_['merge'](_0x47675a[_0x3c43('0x47')],_0xbbd29b);}_0x47675a=_['merge']({},_0x47675a,_0x22ccfc[_0x3c43('0x4d')]);return db[_0x3c43('0xa7')][_0x3c43('0x2b')]({'where':_0x47675a[_0x3c43('0x47')]})['then'](function(_0x21f38e){_0x5d9929[_0x3c43('0x2b')]=_0x21f38e;if(_0x22ccfc[_0x3c43('0x3f')][_0x3c43('0x4e')]){_0x47675a[_0x3c43('0x4f')]=[{'all':!![]}];}return db[_0x3c43('0xa7')][_0x3c43('0x50')](_0x47675a);})[_0x3c43('0x32')](function(_0x520ea6){_0x5d9929[_0x3c43('0x66')]=_0x520ea6;return _0x5d9929;});}})[_0x3c43('0x32')](respondWithFilteredResult(_0x493424,_0x47675a))['catch'](handleError(_0x493424,null));};exports[_0x3c43('0x37')]=function(_0x548fc1,_0x5650f1,_0x26b5a1){var _0x5b3a9c,_0x49504d={},_0x1219ba;if(_0x548fc1[_0x3c43('0x57')]['to']){_0x1219ba=_0x548fc1[_0x3c43('0x57')]['to'][0x0];}return db[_0x3c43('0x3a')][_0x3c43('0x55')]({'where':{'id':_0x548fc1[_0x3c43('0x53')]['id']},'include':[{'model':db[_0x3c43('0xa8')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x1219ba},'limit':0x1,'order':[['updatedAt',_0x3c43('0xa9')]]}]}]})[_0x3c43('0x32')](handleEntityNotFound(_0x5650f1,null))[_0x3c43('0x32')](function(_0x5355c4){_0x5b3a9c=_0x5355c4;if(_0x548fc1['body'][_0x3c43('0xaa')]&&_0x548fc1[_0x3c43('0x57')][_0x3c43('0xaa')]['length']){for(var _0x1efdaf=0x0;_0x1efdaf<_0x548fc1['body']['attachments'][_0x3c43('0x43')];_0x1efdaf+=0x1){_0x548fc1['body'][_0x3c43('0xaa')][_0x1efdaf]={'filename':_0x548fc1[_0x3c43('0x57')][_0x3c43('0xaa')][_0x1efdaf][_0x3c43('0x36')],'id':_0x548fc1[_0x3c43('0x57')][_0x3c43('0xaa')][_0x1efdaf]['id'],'path':path[_0x3c43('0xab')](config[_0x3c43('0xac')],_0x3c43('0xad'),_0x548fc1['body'][_0x3c43('0xaa')][_0x1efdaf]['basename'])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_[_0x3c43('0xae')](_0x548fc1[_0x3c43('0x53')]['id'])?undefined:_0x548fc1[_0x3c43('0x53')]['id'],'path':_['isNil'](_0x548fc1[_0x3c43('0x57')][_0x3c43('0xaa')][0x0][_0x3c43('0x7')])?undefined:_0x548fc1[_0x3c43('0x57')][_0x3c43('0xaa')][0x0][_0x3c43('0x7')],'fax':_[_0x3c43('0xae')](_0x548fc1[_0x3c43('0x57')]['to'][0x0])?undefined:_0x548fc1[_0x3c43('0x57')]['to'][0x0]},client9002);})['then'](function(){if(_0x5b3a9c){if(_[_0x3c43('0xae')](_0x548fc1[_0x3c43('0x57')][_0x3c43('0xaf')])){_0x548fc1[_0x3c43('0x57')]['from']=util[_0x3c43('0xb0')]('\x22%s\x22\x20<%s>',_0x5b3a9c[_0x3c43('0x36')],_0x5b3a9c['fax']);}if(_0x5b3a9c['List']){if(_0x5b3a9c[_0x3c43('0xb1')][_0x3c43('0xb2')][_0x3c43('0x43')]){return _0x5b3a9c['List'][_0x3c43('0xb2')][0x0];}else{return db[_0x3c43('0x71')]['create'](_[_0x3c43('0xb3')](_0x548fc1[_0x3c43('0x57')],{'firstName':_0x548fc1['body']['to'][0x0],'phone':_0x548fc1['body']['to'][0x0],'fax':_0x548fc1[_0x3c43('0x57')]['to'][0x0],'ListId':_0x5b3a9c[_0x3c43('0xa2')]}));}}else{throw new Error(_0x3c43('0xb4'));}}else{throw new Error(_0x3c43('0xb5'));}})['then'](function(_0x4a7ca7){if(_0x4a7ca7){return db[_0x3c43('0x70')]['find']({'where':{'ContactId':_0x4a7ca7['id'],'closed':![],'FaxAccountId':_0x5b3a9c['id']}})[_0x3c43('0x32')](function(_0x2473d6){if(_0x2473d6){return[_0x2473d6,![]];}return db[_0x3c43('0x70')][_0x3c43('0x56')]({'UserId':_0x548fc1[_0x3c43('0x58')]['id'],'ContactId':_0x4a7ca7['id'],'FaxAccountId':_0x5b3a9c['id'],'fax':_0x548fc1[_0x3c43('0x57')]['to'][0x0],'firstMsgDirection':_0x3c43('0xb6'),'Messages':[_[_0x3c43('0x4b')](_0x548fc1['body'],{'read':![],'body':_0x548fc1[_0x3c43('0x57')][_0x3c43('0xaa')][0x0]['filename'],'FaxAccountId':_0x5b3a9c['id'],'UserId':_0x548fc1[_0x3c43('0x58')]['id'],'ContactId':_0x4a7ca7['id'],'AttachmentId':_0x548fc1[_0x3c43('0x57')]['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x3c43('0xb7')}]})[_0x3c43('0x32')](function(_0x2d63d2){return[_0x2d63d2,!![]];});});}else{throw new Error(_0x3c43('0xb8'));}})['spread'](function(_0x3e56c7,_0x1ca34a){if(_0x1ca34a){return _0x3e56c7;}return db['FaxMessage'][_0x3c43('0x56')]({'direction':_0x3c43('0xb6'),'read':![],'body':_0x548fc1[_0x3c43('0x57')]['attachments'][0x0][_0x3c43('0xb9')],'FaxAccountId':_0x5b3a9c['id'],'FaxInteractionId':_0x3e56c7['id'],'UserId':_0x548fc1['user']['id'],'ContactId':_0x3e56c7['ContactId'],'AttachmentId':_0x548fc1[_0x3c43('0x57')][_0x3c43('0xaa')][0x0]['id']})[_0x3c43('0x32')](function(_0x3e77e2){_0x3e56c7[_0x3c43('0xba')][_0x3c43('0xb7')]=[];_0x3e56c7[_0x3c43('0xba')]['Messages']['push'](_0x3e77e2[_0x3c43('0xba')]);return _0x3e56c7;});})[_0x3c43('0x32')](function(_0x438e66){respondWithRpcPromise(_0x3c43('0xbb'),'SendFax',{'FaxAccountId':_[_0x3c43('0xae')](_0x548fc1[_0x3c43('0x53')]['id'])?undefined:_0x548fc1[_0x3c43('0x53')]['id'],'path':_[_0x3c43('0xae')](_0x548fc1[_0x3c43('0x57')][_0x3c43('0xaa')][0x0][_0x3c43('0x7')])?undefined:_0x548fc1['body'][_0x3c43('0xaa')][0x0][_0x3c43('0x7')],'fax':_[_0x3c43('0xae')](_0x548fc1[_0x3c43('0x57')]['to'][0x0])?undefined:_0x548fc1['body']['to'][0x0],'AttachmentId':_0x548fc1[_0x3c43('0x57')][_0x3c43('0xaa')][0x0]['id']},client9002)[_0x3c43('0x32')](function(_0x3ac15a){logger[_0x3c43('0x24')](_0x3c43('0xbc'),_0x3ac15a);})[_0x3c43('0x51')](function(_0x2d0681){logger[_0x3c43('0x24')](_0x3c43('0xbc'),_0x2d0681);});return _0x438e66;})[_0x3c43('0x32')](respondWithResult(_0x5650f1,null))[_0x3c43('0x51')](handleError(_0x5650f1,null));};exports[_0x3c43('0xbd')]=function(_0x1f7265,_0x439aa6,_0x55b0d0){return db['FaxAccount'][_0x3c43('0x55')]({'where':{'id':_0x1f7265[_0x3c43('0x53')]['id']}})[_0x3c43('0x32')](handleEntityNotFound(_0x439aa6,null))[_0x3c43('0x32')](function(_0x455f6c){if(_0x455f6c){return _0x455f6c[_0x3c43('0xbd')](_0x1f7265['body'][_0x3c43('0x68')],_['omit'](_0x1f7265[_0x3c43('0x57')],[_0x3c43('0x68'),'id'])||{})[_0x3c43('0xbe')](function(_0xd6c20e){for(var _0x28aa6f=0x0;_0x28aa6f<_0x1f7265[_0x3c43('0x57')][_0x3c43('0x68')][_0x3c43('0x43')];_0x28aa6f+=0x1){socket[_0x3c43('0xbf')](_0x3c43('0xc0'),{'UserId':Number(_0x1f7265['body'][_0x3c43('0x68')][_0x28aa6f]),'FaxAccountId':Number(_0x1f7265['params']['id'])});}return _0xd6c20e;});}})[_0x3c43('0x32')](respondWithResult(_0x439aa6,null))[_0x3c43('0x51')](handleError(_0x439aa6,null));};exports[_0x3c43('0xc1')]=function(_0x396e9b,_0x47746e,_0x142bb8){return db[_0x3c43('0x3a')]['find']({'where':{'id':_0x396e9b[_0x3c43('0x53')]['id']}})[_0x3c43('0x32')](handleEntityNotFound(_0x47746e,null))[_0x3c43('0x32')](function(_0x171c64){if(_0x171c64){return _0x171c64[_0x3c43('0xc1')](_0x396e9b[_0x3c43('0x3f')][_0x3c43('0x68')])[_0x3c43('0x32')](function(){if(_[_0x3c43('0xc2')](_0x396e9b[_0x3c43('0x3f')][_0x3c43('0x68')])){for(var _0x3c32d7=0x0;_0x3c32d7<_0x396e9b[_0x3c43('0x3f')][_0x3c43('0x68')][_0x3c43('0x43')];_0x3c32d7+=0x1){socket[_0x3c43('0xbf')](_0x3c43('0xc3'),{'UserId':Number(_0x396e9b['query'][_0x3c43('0x68')][_0x3c32d7]),'FaxAccountId':Number(_0x396e9b[_0x3c43('0x53')]['id'])});}}else{socket[_0x3c43('0xbf')]('userFaxAccount:remove',{'UserId':Number(_0x396e9b[_0x3c43('0x3f')][_0x3c43('0x68')]),'FaxAccountId':Number(_0x396e9b['params']['id'])});}});}})['then'](respondWithStatusCode(_0x47746e,null))[_0x3c43('0x51')](handleError(_0x47746e,null));};exports[_0x3c43('0xc4')]=function(_0x28abf2,_0x815a9b,_0x331ff3){var _0x97edf5={};var _0x5d2b84={};var _0x426936;var _0x5bc973;return db['FaxAccount'][_0x3c43('0x6b')]({'where':{'id':_0x28abf2['params']['id']}})['then'](handleEntityNotFound(_0x815a9b,null))[_0x3c43('0x32')](function(_0x953771){if(_0x953771){_0x426936=_0x953771;_0x5d2b84[_0x3c43('0x3d')]=_[_0x3c43('0x3e')](db[_0x3c43('0xc5')][_0x3c43('0x3b')]);_0x5d2b84[_0x3c43('0x3f')]=_[_0x3c43('0x3e')](_0x28abf2[_0x3c43('0x3f')]);_0x5d2b84[_0x3c43('0x48')]=_[_0x3c43('0x40')](_0x5d2b84['model'],_0x5d2b84[_0x3c43('0x3f')]);_0x97edf5[_0x3c43('0x41')]=_[_0x3c43('0x40')](_0x5d2b84[_0x3c43('0x3d')],qs[_0x3c43('0x42')](_0x28abf2[_0x3c43('0x3f')][_0x3c43('0x42')]));_0x97edf5[_0x3c43('0x41')]=_0x97edf5[_0x3c43('0x41')][_0x3c43('0x43')]?_0x97edf5[_0x3c43('0x41')]:_0x5d2b84[_0x3c43('0x3d')];_0x97edf5[_0x3c43('0x65')]=qs[_0x3c43('0x46')](_0x28abf2[_0x3c43('0x3f')][_0x3c43('0x46')]);_0x97edf5['where']=qs['filters'](_[_0x3c43('0x49')](_0x28abf2[_0x3c43('0x3f')],_0x5d2b84[_0x3c43('0x48')]));if(_0x28abf2[_0x3c43('0x3f')][_0x3c43('0x4a')]){_0x97edf5[_0x3c43('0x47')]=_[_0x3c43('0x4b')](_0x97edf5[_0x3c43('0x47')],{'$or':_['map'](_0x97edf5[_0x3c43('0x41')],function(_0x4aeca3){var _0x136e0={};_0x136e0[_0x4aeca3]={'$like':'%'+_0x28abf2[_0x3c43('0x3f')][_0x3c43('0x4a')]+'%'};return _0x136e0;})});}_0x97edf5=_['merge']({},_0x97edf5,_0x28abf2['options']);return _0x426936['getAgents'](_0x97edf5);}})[_0x3c43('0x32')](function(_0x54069e){if(_0x54069e){_0x5bc973=_0x54069e['length'];if(!_0x28abf2[_0x3c43('0x3f')][_0x3c43('0x64')](_0x3c43('0x44'))){_0x97edf5[_0x3c43('0x2a')]=qs[_0x3c43('0x2a')](_0x28abf2[_0x3c43('0x3f')][_0x3c43('0x2a')]);_0x97edf5['offset']=qs['offset'](_0x28abf2[_0x3c43('0x3f')]['offset']);}return _0x426936['getAgents'](_0x97edf5);}})['then'](function(_0x4b90ee){if(_0x4b90ee){return _0x4b90ee?{'count':_0x5bc973,'rows':_0x4b90ee}:null;}})[_0x3c43('0x32')](respondWithResult(_0x815a9b,null))[_0x3c43('0x51')](handleError(_0x815a9b,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index c7b210d..f8a3521 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 _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 +var _0x7dde=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x42e0b1,_0xad3dac){var _0x3805cf=function(_0x42883a){while(--_0x42883a){_0x42e0b1['push'](_0x42e0b1['shift']());}};_0x3805cf(++_0xad3dac);}(_0x7dde,0x11f));var _0xe7dd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7dde[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0xe7dd('0x0'));var FaxAccount=require(_0xe7dd('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe7dd('0x2'),'afterUpdate':_0xe7dd('0x3'),'afterDestroy':_0xe7dd('0x4')};function emitEvent(_0x2a8c65){return function(_0x312039,_0x52aaf2,_0x556afb){FaxAccountEvents[_0xe7dd('0x5')](_0x2a8c65+':'+_0x312039['id'],_0x312039);FaxAccountEvents[_0xe7dd('0x5')](_0x2a8c65,_0x312039);_0x556afb(null);};}for(var e in events){if(events[_0xe7dd('0x6')](e)){var event=events[e];FaxAccount[_0xe7dd('0x7')](e,emitEvent(event));}}module[_0xe7dd('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 4e181d4..8d8ff9e 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 _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 +var _0x8588=['FaxAccount','fax_accounts','util','../../config/logger','api','moment','bluebird','path','rimraf','./faxAccount.attributes','exports','define'];(function(_0x37afbc,_0x30e5a4){var _0x57556c=function(_0x2e9bfb){while(--_0x2e9bfb){_0x37afbc['push'](_0x37afbc['shift']());}};_0x57556c(++_0x30e5a4);}(_0x8588,0x12e));var _0x8858=function(_0x29baaf,_0x273412){_0x29baaf=_0x29baaf-0x0;var _0x184fe2=_0x8588[_0x29baaf];return _0x184fe2;};'use strict';var _=require('lodash');var util=require(_0x8858('0x0'));var logger=require(_0x8858('0x1'))(_0x8858('0x2'));var moment=require(_0x8858('0x3'));var BPromise=require(_0x8858('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8858('0x5'));var rimraf=require(_0x8858('0x6'));var config=require('../../config/environment');var attributes=require(_0x8858('0x7'));module[_0x8858('0x8')]=function(_0x156250,_0x5720a9){return _0x156250[_0x8858('0x9')](_0x8858('0xa'),attributes,{'tableName':_0x8858('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index ba40235..0cd7322 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 _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 +var _0xd56b=['FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxAccount','NotifyFaxAccount','body','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','keys','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmContact','Contacts','DESC','FaxApplication','applications','list','priority','asc','Applications','List','defaults','create','contact','fax','find','FaxInteraction','autoclose','push','length','unmanaged','*,*,*,*','created','ContactId','AttachmentId','interaction','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info'];(function(_0x18df32,_0x482361){var _0x1de5f1=function(_0x20d742){while(--_0x20d742){_0x18df32['push'](_0x18df32['shift']());}};_0x1de5f1(++_0x482361);}(_0xd56b,0xa2));var _0xbd56=function(_0x5e435d,_0x12da69){_0x5e435d=_0x5e435d-0x0;var _0x6c15e2=_0xd56b[_0x5e435d];return _0x6c15e2;};'use strict';var _=require(_0xbd56('0x0'));var util=require(_0xbd56('0x1'));var moment=require(_0xbd56('0x2'));var BPromise=require(_0xbd56('0x3'));var rs=require(_0xbd56('0x4'));var fs=require('fs');var Redis=require(_0xbd56('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbd56('0x6'));var logger=require(_0xbd56('0x7'))(_0xbd56('0x8'));var config=require(_0xbd56('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbd56('0xa')][_0xbd56('0xb')]({'port':0x232c});config['redis']=_['defaults'](config[_0xbd56('0xc')],{'host':_0xbd56('0xd'),'port':0x18eb});var socket=require(_0xbd56('0xe'))(new Redis(config[_0xbd56('0xc')]));require(_0xbd56('0xf'))[_0xbd56('0x10')](socket);function respondWithRpcPromise(_0x3fb0a2,_0x325c5d,_0xaeb331){return new BPromise(function(_0x1ef9d2,_0x194931){return client[_0xbd56('0x11')](_0x3fb0a2,_0xaeb331)[_0xbd56('0x12')](function(_0x37511f){logger[_0xbd56('0x13')](_0xbd56('0x14'),_0x325c5d,_0xbd56('0x15'));logger[_0xbd56('0x16')](_0xbd56('0x17'),_0x325c5d,_0xbd56('0x15'),JSON[_0xbd56('0x18')](_0x37511f));if(_0x37511f[_0xbd56('0x19')]){if(_0x37511f['error'][_0xbd56('0x1a')]===0x1f4){logger[_0xbd56('0x19')](_0xbd56('0x14'),_0x325c5d,_0x37511f['error'][_0xbd56('0x1b')]);return _0x194931(_0x37511f[_0xbd56('0x19')]['message']);}logger[_0xbd56('0x19')](_0xbd56('0x14'),_0x325c5d,_0x37511f[_0xbd56('0x19')][_0xbd56('0x1b')]);return _0x1ef9d2(_0x37511f[_0xbd56('0x19')]['message']);}else{logger[_0xbd56('0x13')](_0xbd56('0x14'),_0x325c5d,_0xbd56('0x15'));_0x1ef9d2(_0x37511f['result']['message']);}})[_0xbd56('0x1c')](function(_0x426a15){logger[_0xbd56('0x19')](_0xbd56('0x14'),_0x325c5d,_0x426a15);_0x194931(_0x426a15);});});}exports['GetFaxAccount']=function(_0x51f337){var _0x21dbb8=this;return new Promise(function(_0x3ad87d,_0x2af60d){return db[_0xbd56('0x1d')][_0xbd56('0x1e')]({'raw':_0x51f337[_0xbd56('0x1f')]?_0x51f337[_0xbd56('0x1f')][_0xbd56('0x20')]===undefined?!![]:![]:!![],'where':_0x51f337['options']?_0x51f337[_0xbd56('0x1f')][_0xbd56('0x21')]||null:null,'attributes':_0x51f337[_0xbd56('0x1f')]?_0x51f337[_0xbd56('0x1f')][_0xbd56('0x22')]||null:null,'limit':_0x51f337[_0xbd56('0x1f')]?_0x51f337[_0xbd56('0x1f')][_0xbd56('0x23')]||null:null,'include':_0x51f337[_0xbd56('0x1f')]?_0x51f337[_0xbd56('0x1f')][_0xbd56('0x24')]?_[_0xbd56('0x25')](_0x51f337['options'][_0xbd56('0x24')],function(_0x2186a9){return{'model':db[_0x2186a9['model']],'as':_0x2186a9['as'],'attributes':_0x2186a9[_0xbd56('0x22')],'include':_0x2186a9[_0xbd56('0x24')]?_[_0xbd56('0x25')](_0x2186a9[_0xbd56('0x24')],function(_0x974d69){return{'model':db[_0x974d69['model']],'as':_0x974d69['as'],'attributes':_0x974d69[_0xbd56('0x22')],'include':_0x974d69[_0xbd56('0x24')]?_[_0xbd56('0x25')](_0x974d69[_0xbd56('0x24')],function(_0x2d56c3){return{'model':db[_0x2d56c3[_0xbd56('0x26')]],'as':_0x2d56c3['as'],'attributes':_0x2d56c3['attributes']};}):[]};}):[]};}):[]:[]})[_0xbd56('0x12')](function(_0x3b4079){logger[_0xbd56('0x13')](_0xbd56('0x27'),_0x51f337);logger[_0xbd56('0x16')](_0xbd56('0x27'),_0x51f337,JSON[_0xbd56('0x18')](_0x3b4079));_0x3ad87d(_0x3b4079);})[_0xbd56('0x1c')](function(_0x1e66e0){logger[_0xbd56('0x19')](_0xbd56('0x27'),_0x1e66e0['message'],_0x51f337);_0x2af60d(_0x21dbb8[_0xbd56('0x19')](0x1f4,_0x1e66e0[_0xbd56('0x1b')]));});});};exports[_0xbd56('0x28')]=function(_0x1561ca,_0x1fadc3,_0x469e64){var _0x46752d=this;return new Promise(function(_0x1a117e,_0x1d5f5e){var _0x4c186e={'body':_0x1561ca[_0xbd56('0x29')],'channel':'fax'};var _0xeaf742=[];var _0x393164=[];var _0x3ab79d={};return db['CmContact'][_0xbd56('0x2a')]()[_0xbd56('0x12')](function(_0x4d0ada){if(!_0x4d0ada){throw new db[(_0xbd56('0x2b'))][(_0xbd56('0x2c'))](_0xbd56('0x2d'));}_0xeaf742=_[_0xbd56('0x2e')](_['keys'](_0x4d0ada),['createdAt',_0xbd56('0x2f')]);_0x393164=_[_0xbd56('0x2e')](_[_0xbd56('0x30')](_0x4d0ada),[_0xbd56('0x31'),'updatedAt',_0xbd56('0x32'),_0xbd56('0x33')]);if(_0x1561ca[_0xbd56('0x29')]['id']){delete _0x1561ca[_0xbd56('0x29')]['id'];}if(_[_0xbd56('0x34')](_0x1561ca[_0xbd56('0x29')][_0xbd56('0x35')])){throw new db['Sequelize']['ValidationError'](_0xbd56('0x36'));}if(_[_0xbd56('0x34')](_0x1561ca[_0xbd56('0x29')]['body'])||_0x1561ca[_0xbd56('0x29')][_0xbd56('0x29')]===''){throw new db['Sequelize'][(_0xbd56('0x2c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xbd56('0x34')](_0x1561ca['body'][_0xbd56('0x37')])){throw new db['Sequelize'][(_0xbd56('0x2c'))](_0xbd56('0x38')+_0x393164);}if(!_['includes'](_0x393164,_0x1561ca[_0xbd56('0x29')][_0xbd56('0x37')])){throw new db[(_0xbd56('0x2b'))][(_0xbd56('0x2c'))](_0xbd56('0x39')+_0x393164);}_0x3ab79d[_0x1561ca[_0xbd56('0x29')][_0xbd56('0x37')]]=_0x1561ca['body'][_0xbd56('0x35')];})[_0xbd56('0x12')](function(){return db['FaxAccount']['find']({'where':{'id':_0x1561ca[_0xbd56('0x3a')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xbd56('0x3b')],'as':_0xbd56('0x3c'),'where':_0x3ab79d,'limit':0x1,'order':[['updatedAt',_0xbd56('0x3d')]]}]},{'model':db[_0xbd56('0x3e')],'as':'Applications'}]});})[_0xbd56('0x12')](function(_0x8736a6){if(_0x8736a6&&_0x8736a6['List']){var _0x588c22=_0x8736a6['get']({'plain':!![]});_0x4c186e[_0xbd56('0x3a')]=_0x588c22;_0x4c186e[_0xbd56('0x3f')]=_0x588c22['Applications'];_0x4c186e[_0xbd56('0x40')]=_0x588c22['List'];_0x4c186e[_0xbd56('0x3f')]=_['orderBy'](_0x4c186e[_0xbd56('0x3f')],[_0xbd56('0x41')],[_0xbd56('0x42')]);if(_0x4c186e[_0xbd56('0x3a')]['Applications']){delete _0x4c186e[_0xbd56('0x3a')][_0xbd56('0x43')];}if(_0x4c186e[_0xbd56('0x3a')]['List']&&_0x4c186e[_0xbd56('0x3a')][_0xbd56('0x44')][_0xbd56('0x3c')]['length']){return _0x4c186e['account'][_0xbd56('0x44')]['Contacts'][0x0];}var _0x526741=_[_0xbd56('0x45')](_0x1561ca[_0xbd56('0x29')],{'firstName':_0x1561ca[_0xbd56('0x29')][_0xbd56('0x35')],'ListId':_0x588c22[_0xbd56('0x33')]});_0x526741[_0x1561ca[_0xbd56('0x29')][_0xbd56('0x37')]]=_0x1561ca[_0xbd56('0x29')]['from'];return db[_0xbd56('0x3b')][_0xbd56('0x46')](_0x526741,{'fields':_0xeaf742,'raw':!![]});}})[_0xbd56('0x12')](function(_0x4c4bc4){_0x4c186e[_0xbd56('0x47')]=_0x4c4bc4;if(_0x4c4bc4){var _0x1c000a={'ContactId':_0x4c4bc4['id'],'FaxAccountId':_0x1561ca['account']['id'],'fax':_0x4c4bc4[_0xbd56('0x48')]};return db['FaxInteraction'][_0xbd56('0x49')]({'where':{'ContactId':_0x4c4bc4['id'],'closed':![],'FaxAccountId':_0x1561ca['account']['id']}})[_0xbd56('0x12')](function(_0x58c58c){if(_0x58c58c){return[_0x58c58c,![]];}return db[_0xbd56('0x4a')][_0xbd56('0x46')](_0x1c000a)[_0xbd56('0x12')](function(_0x50be16){return[_0x50be16,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x5b873e,_0x303abf){var _0x3aa42a=_0x5b873e['get']({'plain':!![]});if(_0x303abf){if(_0x4c186e['account'][_0xbd56('0x4b')]){_0x4c186e['applications'][_0xbd56('0x4c')]({'id':0x0,'priority':_0x4c186e[_0xbd56('0x3f')][_0xbd56('0x4d')]+0x1,'app':'close','appdata':_0xbd56('0x4e'),'interval':_0xbd56('0x4f')});}_0x3aa42a[_0xbd56('0x50')]=!![];}else{_0x3aa42a[_0xbd56('0x50')]=![];}_0x4c186e['interaction']=_0x3aa42a;return db['FaxMessage'][_0xbd56('0x46')]({'body':_0x1561ca['body'][_0xbd56('0x29')],'FaxAccountId':_0x1561ca[_0xbd56('0x3a')]['id'],'FaxInteractionId':_0x5b873e['id'],'direction':'in','ContactId':_0x5b873e[_0xbd56('0x51')],'AttachmentId':_0x1561ca['body'][_0xbd56('0x52')]});})[_0xbd56('0x12')](function(_0x513d5f){_0x4c186e[_0xbd56('0x1b')]=_0x513d5f;if(_0x4c186e[_0xbd56('0x53')][_0xbd56('0x54')]){return db[_0xbd56('0x55')][_0xbd56('0x49')]({'attributes':['id',_0xbd56('0x56')],'where':{'id':_0x4c186e[_0xbd56('0x53')]['UserId']}})[_0xbd56('0x12')](function(_0x1380b2){if(_0x1380b2){_0x4c186e[_0xbd56('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0xbd56('0x57'),'appdata':_0x1380b2[_0xbd56('0x56')]+','+(_0x4c186e['account'][_0xbd56('0x58')]||0xa),'interval':_0xbd56('0x4f')});}return respondWithRpcPromise(_0xbd56('0x59'),_0xbd56('0x5a'),_0x4c186e);});}return respondWithRpcPromise('Start',_0xbd56('0x5a'),_0x4c186e);})[_0xbd56('0x12')](function(_0x14c55c){_0x1a117e(_0x14c55c);})[_0xbd56('0x1c')](function(_0x430f30){_0x1d5f5e(_0x46752d[_0xbd56('0x19')](0x1f4,_0x430f30['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 7d2e98c..9edb790 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 _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 +var _0xb4ed=['./faxAccount.events','remove','update','emit','removeListener','register','faxAccount:'];(function(_0x2f2579,_0xcf2d7){var _0x312dc2=function(_0x2970ab){while(--_0x2970ab){_0x2f2579['push'](_0x2f2579['shift']());}};_0x312dc2(++_0xcf2d7);}(_0xb4ed,0xbd));var _0xdb4e=function(_0x1ff575,_0xdba21f){_0x1ff575=_0x1ff575-0x0;var _0x48fc9e=_0xb4ed[_0x1ff575];return _0x48fc9e;};'use strict';var FaxAccountEvents=require(_0xdb4e('0x0'));var events=['save',_0xdb4e('0x1'),_0xdb4e('0x2')];function createListener(_0x2a7130,_0x5891c2){return function(_0x351de1){_0x5891c2[_0xdb4e('0x3')](_0x2a7130,_0x351de1);};}function removeListener(_0x2f6c92,_0x880590){return function(){FaxAccountEvents[_0xdb4e('0x4')](_0x2f6c92,_0x880590);};}exports[_0xdb4e('0x5')]=function(_0x52a6fb){for(var _0x3d2799=0x0,_0x4f5955=events['length'];_0x3d2799<_0x4f5955;_0x3d2799++){var _0x626e40=events[_0x3d2799];var _0x5efe34=createListener(_0xdb4e('0x6')+_0x626e40,_0x52a6fb);FaxAccountEvents['on'](_0x626e40,_0x5efe34);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 1e07849..1359f06 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(_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 +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(_0x15e051,_0x1b608d){var _0x3c1a38=function(_0x31db8b){while(--_0x31db8b){_0x15e051['push'](_0x15e051['shift']());}};_0x3c1a38(++_0x1b608d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 c894f07..b13bec6 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 _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 +var _0x69ea=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x26b047,_0x3988e0){var _0x2826b8=function(_0x4637a9){while(--_0x4637a9){_0x26b047['push'](_0x26b047['shift']());}};_0x2826b8(++_0x3988e0);}(_0x69ea,0x1d2));var _0xa69e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x69ea[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');module[_0xa69e('0x0')]={'priority':{'type':Sequelize[_0xa69e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa69e('0x2')],'allowNull':![],'defaultValue':_0xa69e('0x3')},'appdata':{'type':Sequelize[_0xa69e('0x4')]()},'description':{'type':Sequelize[_0xa69e('0x2')]},'interval':{'type':Sequelize[_0xa69e('0x2')],'defaultValue':_0xa69e('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 9f2675c..c0d91c9 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 _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 +var _0xf39a=['bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then','findAll','catch','show','length','includeAll','include','options','find','create','body','params','destroy','eml-format','zip-dir','request-promise','moment'];(function(_0x3ce4d8,_0x235eb5){var _0x1c3704=function(_0x3e7a95){while(--_0x3e7a95){_0x3ce4d8['push'](_0x3ce4d8['shift']());}};_0x1c3704(++_0x235eb5);}(_0xf39a,0x1d0));var _0xaf39=function(_0x58f2a5,_0x272332){_0x58f2a5=_0x58f2a5-0x0;var _0x232b2e=_0xf39a[_0x58f2a5];return _0x232b2e;};'use strict';var emlformat=require(_0xaf39('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaf39('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf39('0x2'));var moment=require(_0xaf39('0x3'));var BPromise=require(_0xaf39('0x4'));var Mustache=require(_0xaf39('0x5'));var util=require(_0xaf39('0x6'));var path=require('path');var sox=require(_0xaf39('0x7'));var csv=require('to-csv');var ejs=require(_0xaf39('0x8'));var fs=require('fs');var fs_extra=require(_0xaf39('0x9'));var _=require('lodash');var squel=require(_0xaf39('0xa'));var crypto=require(_0xaf39('0xb'));var jsforce=require(_0xaf39('0xc'));var deskjs=require(_0xaf39('0xd'));var toCsv=require(_0xaf39('0xe'));var querystring=require('querystring');var Papa=require(_0xaf39('0xf'));var Redis=require(_0xaf39('0x10'));var authService=require(_0xaf39('0x11'));var qs=require(_0xaf39('0x12'));var as=require(_0xaf39('0x13'));var hardwareService=require(_0xaf39('0x14'));var logger=require(_0xaf39('0x15'))(_0xaf39('0x16'));var utils=require(_0xaf39('0x17'));var config=require(_0xaf39('0x18'));var licenseUtil=require(_0xaf39('0x19'));var db=require(_0xaf39('0x1a'))['db'];function respondWithStatusCode(_0x94a43a,_0x3f3707){_0x3f3707=_0x3f3707||0xcc;return function(_0x4512b9){if(_0x4512b9){return _0x94a43a[_0xaf39('0x1b')](_0x3f3707);}return _0x94a43a[_0xaf39('0x1c')](_0x3f3707)[_0xaf39('0x1d')]();};}function respondWithResult(_0x1c7c2f,_0x1a6466){_0x1a6466=_0x1a6466||0xc8;return function(_0x17df71){if(_0x17df71){return _0x1c7c2f[_0xaf39('0x1c')](_0x1a6466)[_0xaf39('0x1e')](_0x17df71);}};}function respondWithFilteredResult(_0x1aa256,_0x5ac956){return function(_0x1c6623){if(_0x1c6623){var _0x4ab937=typeof _0x5ac956[_0xaf39('0x1f')]===_0xaf39('0x20')&&typeof _0x5ac956[_0xaf39('0x21')]===_0xaf39('0x20');var _0x52dc88=_0x1c6623[_0xaf39('0x22')];var _0x308c8b=_0x4ab937?0x0:_0x5ac956[_0xaf39('0x1f')];var _0x4a1b68=_0x4ab937?_0x1c6623[_0xaf39('0x22')]:_0x5ac956[_0xaf39('0x1f')]+_0x5ac956[_0xaf39('0x21')];var _0x3c3923;if(_0x4a1b68>=_0x52dc88){_0x4a1b68=_0x52dc88;_0x3c3923=0xc8;}else{_0x3c3923=0xce;}_0x1aa256[_0xaf39('0x1c')](_0x3c3923);return _0x1aa256[_0xaf39('0x23')](_0xaf39('0x24'),_0x308c8b+'-'+_0x4a1b68+'/'+_0x52dc88)[_0xaf39('0x1e')](_0x1c6623);}return null;};}function patchUpdates(_0x5e5ea7){return function(_0x11a8bf){try{jsonpatch[_0xaf39('0x25')](_0x11a8bf,_0x5e5ea7,!![]);}catch(_0x257aa1){return BPromise[_0xaf39('0x26')](_0x257aa1);}return _0x11a8bf['save']();};}function saveUpdates(_0x2d3dff,_0x327089){return function(_0xf6976b){if(_0xf6976b){return _0xf6976b['update'](_0x2d3dff)['then'](function(_0x4b1d5e){return _0x4b1d5e;});}return null;};}function removeEntity(_0x177040,_0x203659){return function(_0x2e3db1){if(_0x2e3db1){return _0x2e3db1['destroy']()['then'](function(){_0x177040[_0xaf39('0x1c')](0xcc)[_0xaf39('0x1d')]();});}};}function handleEntityNotFound(_0x1888aa,_0x3b3d4a){return function(_0x2ce78a){if(!_0x2ce78a){_0x1888aa[_0xaf39('0x1b')](0x194);}return _0x2ce78a;};}function handleError(_0x3f4845,_0x5c58ef){_0x5c58ef=_0x5c58ef||0x1f4;return function(_0x47e0f3){logger['error'](_0x47e0f3[_0xaf39('0x27')]);if(_0x47e0f3[_0xaf39('0x28')]){delete _0x47e0f3['name'];}_0x3f4845[_0xaf39('0x1c')](_0x5c58ef)[_0xaf39('0x29')](_0x47e0f3);};}exports[_0xaf39('0x2a')]=function(_0x5f14da,_0xe5edc8){var _0x579e9b={},_0x1b30bd={},_0x27c17d={'count':0x0,'rows':[]};var _0x37d944=_[_0xaf39('0x2b')](db[_0xaf39('0x2c')][_0xaf39('0x2d')],function(_0x7f6f29){return{'name':_0x7f6f29[_0xaf39('0x2e')],'type':_0x7f6f29[_0xaf39('0x2f')][_0xaf39('0x30')]};});_0x1b30bd[_0xaf39('0x31')]=_[_0xaf39('0x2b')](_0x37d944,_0xaf39('0x28'));_0x1b30bd[_0xaf39('0x32')]=_[_0xaf39('0x33')](_0x5f14da[_0xaf39('0x32')]);_0x1b30bd[_0xaf39('0x34')]=_[_0xaf39('0x35')](_0x1b30bd[_0xaf39('0x31')],_0x1b30bd['query']);_0x579e9b['attributes']=_[_0xaf39('0x35')](_0x1b30bd[_0xaf39('0x31')],qs[_0xaf39('0x36')](_0x5f14da[_0xaf39('0x32')]['fields']));_0x579e9b[_0xaf39('0x37')]=_0x579e9b[_0xaf39('0x37')]['length']?_0x579e9b[_0xaf39('0x37')]:_0x1b30bd[_0xaf39('0x31')];if(!_0x5f14da[_0xaf39('0x32')][_0xaf39('0x38')](_0xaf39('0x39'))){_0x579e9b['limit']=qs[_0xaf39('0x21')](_0x5f14da[_0xaf39('0x32')][_0xaf39('0x21')]);_0x579e9b['offset']=qs[_0xaf39('0x1f')](_0x5f14da[_0xaf39('0x32')][_0xaf39('0x1f')]);}_0x579e9b[_0xaf39('0x3a')]=qs[_0xaf39('0x3b')](_0x5f14da[_0xaf39('0x32')]['sort']);_0x579e9b['where']=qs[_0xaf39('0x34')](_[_0xaf39('0x3c')](_0x5f14da[_0xaf39('0x32')],_0x1b30bd['filters']),_0x37d944);if(_0x5f14da[_0xaf39('0x32')][_0xaf39('0x3d')]){_0x579e9b[_0xaf39('0x3e')]=_[_0xaf39('0x3f')](_0x579e9b['where'],{'$or':_[_0xaf39('0x2b')](_0x37d944,function(_0x258aba){if(_0x258aba['type']!==_0xaf39('0x40')){var _0x2b4fd9={};_0x2b4fd9[_0x258aba[_0xaf39('0x28')]]={'$like':'%'+_0x5f14da['query']['filter']+'%'};return _0x2b4fd9;}})});}_0x579e9b=_['merge']({},_0x579e9b,_0x5f14da['options']);var _0x4d0b73={'where':_0x579e9b[_0xaf39('0x3e')]};return db[_0xaf39('0x2c')][_0xaf39('0x22')](_0x4d0b73)[_0xaf39('0x41')](function(_0x4ec60e){_0x27c17d[_0xaf39('0x22')]=_0x4ec60e;if(_0x5f14da[_0xaf39('0x32')]['includeAll']){_0x579e9b['include']=[{'all':!![]}];}return db[_0xaf39('0x2c')][_0xaf39('0x42')](_0x579e9b);})[_0xaf39('0x41')](function(_0x5af944){_0x27c17d['rows']=_0x5af944;return _0x27c17d;})[_0xaf39('0x41')](respondWithFilteredResult(_0xe5edc8,_0x579e9b))[_0xaf39('0x43')](handleError(_0xe5edc8,null));};exports[_0xaf39('0x44')]=function(_0x1895b9,_0x42c1ad){var _0x5ab68e={'raw':!![],'where':{'id':_0x1895b9['params']['id']}},_0x1fe26c={};_0x1fe26c['model']=_[_0xaf39('0x33')](db['FaxApplication']['rawAttributes']);_0x1fe26c[_0xaf39('0x32')]=_[_0xaf39('0x33')](_0x1895b9[_0xaf39('0x32')]);_0x1fe26c['filters']=_[_0xaf39('0x35')](_0x1fe26c[_0xaf39('0x31')],_0x1fe26c['query']);_0x5ab68e[_0xaf39('0x37')]=_[_0xaf39('0x35')](_0x1fe26c[_0xaf39('0x31')],qs[_0xaf39('0x36')](_0x1895b9[_0xaf39('0x32')][_0xaf39('0x36')]));_0x5ab68e[_0xaf39('0x37')]=_0x5ab68e['attributes'][_0xaf39('0x45')]?_0x5ab68e['attributes']:_0x1fe26c[_0xaf39('0x31')];if(_0x1895b9[_0xaf39('0x32')][_0xaf39('0x46')]){_0x5ab68e[_0xaf39('0x47')]=[{'all':!![]}];}_0x5ab68e=_[_0xaf39('0x3f')]({},_0x5ab68e,_0x1895b9[_0xaf39('0x48')]);return db[_0xaf39('0x2c')][_0xaf39('0x49')](_0x5ab68e)[_0xaf39('0x41')](handleEntityNotFound(_0x42c1ad,null))[_0xaf39('0x41')](respondWithResult(_0x42c1ad,null))[_0xaf39('0x43')](handleError(_0x42c1ad,null));};exports[_0xaf39('0x4a')]=function(_0x2cb292,_0x30f287){return db[_0xaf39('0x2c')][_0xaf39('0x4a')](_0x2cb292[_0xaf39('0x4b')],{})[_0xaf39('0x41')](respondWithResult(_0x30f287,0xc9))[_0xaf39('0x43')](handleError(_0x30f287,null));};exports['update']=function(_0x543504,_0x16bd1d){if(_0x543504['body']['id']){delete _0x543504[_0xaf39('0x4b')]['id'];}return db[_0xaf39('0x2c')][_0xaf39('0x49')]({'where':{'id':_0x543504[_0xaf39('0x4c')]['id']}})[_0xaf39('0x41')](handleEntityNotFound(_0x16bd1d,null))[_0xaf39('0x41')](saveUpdates(_0x543504[_0xaf39('0x4b')],null))[_0xaf39('0x41')](respondWithResult(_0x16bd1d,null))['catch'](handleError(_0x16bd1d,null));};exports[_0xaf39('0x4d')]=function(_0x2b970b,_0x2b3002){return db[_0xaf39('0x2c')][_0xaf39('0x49')]({'where':{'id':_0x2b970b[_0xaf39('0x4c')]['id']}})[_0xaf39('0x41')](handleEntityNotFound(_0x2b3002,null))[_0xaf39('0x41')](removeEntity(_0x2b3002,null))[_0xaf39('0x43')](handleError(_0x2b3002,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 4bd8d01..19d8536 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 _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 +var _0xff12=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','fax_applications','utf8mb4'];(function(_0x34237a,_0x478417){var _0x354c6a=function(_0x1d73ce){while(--_0x1d73ce){_0x34237a['push'](_0x34237a['shift']());}};_0x354c6a(++_0x478417);}(_0xff12,0x1bc));var _0x2ff1=function(_0x4f9047,_0x3e37e9){_0x4f9047=_0x4f9047-0x0;var _0x1ee721=_0xff12[_0x4f9047];return _0x1ee721;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2ff1('0x0'))(_0x2ff1('0x1'));var moment=require(_0x2ff1('0x2'));var BPromise=require(_0x2ff1('0x3'));var rp=require(_0x2ff1('0x4'));var fs=require('fs');var path=require(_0x2ff1('0x5'));var rimraf=require(_0x2ff1('0x6'));var config=require(_0x2ff1('0x7'));var attributes=require('./faxApplication.attributes');module[_0x2ff1('0x8')]=function(_0x561152,_0x1ff2eb){return _0x561152[_0x2ff1('0x9')]('FaxApplication',attributes,{'tableName':_0x2ff1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2ff1('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 3f1a2b8..ef0fb66 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 _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 +var _0xd2ba=['FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateFaxApplication','FaxApplication','update','options','attributes','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x105fbb,_0x1f0ccc){var _0x36aa31=function(_0x10867a){while(--_0x10867a){_0x105fbb['push'](_0x105fbb['shift']());}};_0x36aa31(++_0x1f0ccc);}(_0xd2ba,0xf2));var _0xad2b=function(_0xf2b598,_0x57bdc9){_0xf2b598=_0xf2b598-0x0;var _0x48ada9=_0xd2ba[_0xf2b598];return _0x48ada9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xad2b('0x0'));var BPromise=require(_0xad2b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad2b('0x2'))['db'];var utils=require(_0xad2b('0x3'));var logger=require(_0xad2b('0x4'))('rpc');var config=require(_0xad2b('0x5'));var jayson=require(_0xad2b('0x6'));var client=jayson[_0xad2b('0x7')][_0xad2b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2481c1,_0x37c7d9,_0x32bd8d){return new BPromise(function(_0x3a7bcf,_0x41fc5f){return client['request'](_0x2481c1,_0x32bd8d)[_0xad2b('0x9')](function(_0x42cf98){logger[_0xad2b('0xa')](_0xad2b('0xb'),_0x37c7d9,_0xad2b('0xc'));logger['debug'](_0xad2b('0xd'),_0x37c7d9,_0xad2b('0xc'),JSON[_0xad2b('0xe')](_0x42cf98));if(_0x42cf98[_0xad2b('0xf')]){if(_0x42cf98[_0xad2b('0xf')]['code']===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x37c7d9,_0x42cf98['error']['message']);return _0x41fc5f(_0x42cf98['error'][_0xad2b('0x10')]);}logger[_0xad2b('0xf')](_0xad2b('0xb'),_0x37c7d9,_0x42cf98['error'][_0xad2b('0x10')]);return _0x3a7bcf(_0x42cf98[_0xad2b('0xf')][_0xad2b('0x10')]);}else{logger[_0xad2b('0xa')](_0xad2b('0xb'),_0x37c7d9,_0xad2b('0xc'));_0x3a7bcf(_0x42cf98['result'][_0xad2b('0x10')]);}})[_0xad2b('0x11')](function(_0x2d6e59){logger['error'](_0xad2b('0xb'),_0x37c7d9,_0x2d6e59);_0x41fc5f(_0x2d6e59);});});}exports[_0xad2b('0x12')]=function(_0x3e7f4b){var _0x20b3b6=this;return new Promise(function(_0x410856,_0x41a27c){return db[_0xad2b('0x13')][_0xad2b('0x14')](_0x3e7f4b['body'],{'raw':_0x3e7f4b[_0xad2b('0x15')]?_0x3e7f4b['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e7f4b[_0xad2b('0x15')]?_0x3e7f4b['options']['where']||null:null,'attributes':_0x3e7f4b['options']?_0x3e7f4b['options'][_0xad2b('0x16')]||null:null,'limit':_0x3e7f4b[_0xad2b('0x15')]?_0x3e7f4b[_0xad2b('0x15')]['limit']||null:null})[_0xad2b('0x9')](function(_0x52be1e){logger['info'](_0xad2b('0x12'),_0x3e7f4b);logger['debug'](_0xad2b('0x12'),_0x3e7f4b,JSON['stringify'](_0x52be1e));_0x410856(_0x52be1e);})[_0xad2b('0x11')](function(_0x51c08f){logger[_0xad2b('0xf')](_0xad2b('0x12'),_0x51c08f[_0xad2b('0x10')],_0x3e7f4b);_0x41a27c(_0x20b3b6['error'](0x1f4,_0x51c08f['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 9505e8d..9c596c6 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 _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 +var _0xb62e=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','get','show','post','/:id','update','delete','destroy','exports','multer','util'];(function(_0x3adcc1,_0x2b9ee4){var _0x6b9e1f=function(_0xf4fc3e){while(--_0xf4fc3e){_0x3adcc1['push'](_0x3adcc1['shift']());}};_0x6b9e1f(++_0x2b9ee4);}(_0xb62e,0x1de));var _0xeb62=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb62e[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var path=require(_0xeb62('0x2'));var timeout=require(_0xeb62('0x3'));var express=require('express');var router=express[_0xeb62('0x4')]();var fs_extra=require(_0xeb62('0x5'));var auth=require(_0xeb62('0x6'));var interaction=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var controller=require(_0xeb62('0x9'));router['get']('/',auth[_0xeb62('0xa')](),controller[_0xeb62('0xb')]);router[_0xeb62('0xc')]('/:id',auth[_0xeb62('0xa')](),controller[_0xeb62('0xd')]);router[_0xeb62('0xe')]('/',auth[_0xeb62('0xa')](),controller['create']);router['put'](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x10')]);router[_0xeb62('0x11')](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x12')]);module[_0xeb62('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 8347135..ce74cca 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 _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 +var _0x8f83=['DATE','ENUM','out','sequelize','exports','STRING'];(function(_0xdfef52,_0x5d59f0){var _0x263589=function(_0x5f4e49){while(--_0x5f4e49){_0xdfef52['push'](_0xdfef52['shift']());}};_0x263589(++_0x5d59f0);}(_0x8f83,0x129));var _0x38f8=function(_0x1c532a,_0x791a93){_0x1c532a=_0x1c532a-0x0;var _0x16e144=_0x8f83[_0x1c532a];return _0x16e144;};'use strict';var Sequelize=require(_0x38f8('0x0'));module[_0x38f8('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x38f8('0x2')]},'secondDisposition':{'type':Sequelize[_0x38f8('0x2')]},'thirdDisposition':{'type':Sequelize[_0x38f8('0x2')]},'note':{'type':Sequelize[_0x38f8('0x2')]},'read1stAt':{'type':Sequelize[_0x38f8('0x3')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x38f8('0x4')]('in',_0x38f8('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x38f8('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x38f8('0x4')]('in',_0x38f8('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 6a24539..007bba4 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 _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 +var _0xe80e=['include','merge','options','find','catch','create','body','update','destroy','describe','FaxMessage','addMessage','ids','getMessages','findOne','filters','hasOwnProperty','limit','order','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','omit','spread','Tag','name','color','emit','removeTags','toString','root','server','tmp','files','attachments','join','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','existsSync','createReadStream','pipe','resolve','download','log','err','unlinkSync','rimraf','zip-dir','util','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','then','end','error','stack','send','index','map','FaxInteraction','rawAttributes','fieldName','type','getOptions','findAll','user','show','params','keys','query','model','intersection','fields','attributes','length'];(function(_0xc9396b,_0x734ceb){var _0x56d6ee=function(_0x2456c0){while(--_0x2456c0){_0xc9396b['push'](_0xc9396b['shift']());}};_0x56d6ee(++_0x734ceb);}(_0xe80e,0x10e));var _0xee80=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0xe80e[_0x55ff3e];return _0x2709eb;};'use strict';var rimraf=require(_0xee80('0x0'));var zipdir=require(_0xee80('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xee80('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0xee80('0x3'));var interaction=require(_0xee80('0x4'));var qs=require(_0xee80('0x5'));var logger=require(_0xee80('0x6'))('api');var config=require(_0xee80('0x7'));var db=require(_0xee80('0x8'))['db'];config[_0xee80('0x9')]=_['defaults'](config[_0xee80('0x9')],{'host':_0xee80('0xa'),'port':0x18eb});var socket=require(_0xee80('0xb'))(new Redis(config[_0xee80('0x9')]));require(_0xee80('0xc'))[_0xee80('0xd')](socket);function respondWithStatusCode(_0x158da8,_0x600ad2){_0x600ad2=_0x600ad2||0xcc;return function(_0x1b6b2d){if(_0x1b6b2d){return _0x158da8[_0xee80('0xe')](_0x600ad2);}return _0x158da8[_0xee80('0xf')](_0x600ad2)['end']();};}function respondWithResult(_0x15b530,_0x221c40){_0x221c40=_0x221c40||0xc8;return function(_0x2e0f1f){if(_0x2e0f1f){return _0x15b530[_0xee80('0xf')](_0x221c40)[_0xee80('0x10')](_0x2e0f1f);}};}function respondWithFilteredResult(_0x163845,_0x4807a3){return function(_0x32bbb6){if(_0x32bbb6){var _0x22d980=typeof _0x4807a3[_0xee80('0x11')]===_0xee80('0x12')&&typeof _0x4807a3['limit']===_0xee80('0x12');var _0x9e5c46=_0x32bbb6[_0xee80('0x13')];var _0x421a39=_0x22d980?0x0:_0x4807a3[_0xee80('0x11')];var _0x20290a=_0x22d980?_0x32bbb6[_0xee80('0x13')]:_0x4807a3[_0xee80('0x11')]+_0x4807a3['limit'];var _0x2bf6df;if(_0x20290a>=_0x9e5c46){_0x20290a=_0x9e5c46;_0x2bf6df=0xc8;}else{_0x2bf6df=0xce;}_0x163845['status'](_0x2bf6df);return _0x163845[_0xee80('0x14')](_0xee80('0x15'),_0x421a39+'-'+_0x20290a+'/'+_0x9e5c46)[_0xee80('0x10')](_0x32bbb6);}return null;};}function saveUpdates(_0x1673fc){return function(_0xd45cc9){if(_0xd45cc9){return _0xd45cc9['update'](_0x1673fc)[_0xee80('0x16')](function(_0x4dee73){return _0x4dee73;});}return null;};}function removeEntity(_0x5ed2b9){return function(_0x590f29){if(_0x590f29){return _0x590f29['destroy']()['then'](function(){_0x5ed2b9['status'](0xcc)[_0xee80('0x17')]();});}};}function handleEntityNotFound(_0x5a33f4){return function(_0x65ff23){if(!_0x65ff23){_0x5a33f4[_0xee80('0xe')](0x194);}return _0x65ff23;};}function handleError(_0x4d6e27,_0x3e033c){_0x3e033c=_0x3e033c||0x1f4;return function(_0xd57b6d){logger[_0xee80('0x18')](_0xd57b6d[_0xee80('0x19')]);if(_0xd57b6d['name']){delete _0xd57b6d['name'];}_0x4d6e27[_0xee80('0xf')](_0x3e033c)[_0xee80('0x1a')](_0xd57b6d);};}exports[_0xee80('0x1b')]=function(_0x1f7040,_0x41801f){var _0x409164={};var _0x20adf8=_[_0xee80('0x1c')](db[_0xee80('0x1d')][_0xee80('0x1e')],function(_0x591c89){return{'name':_0x591c89[_0xee80('0x1f')],'type':_0x591c89[_0xee80('0x20')]['key']};});_0x409164=qs[_0xee80('0x21')](_0x20adf8,_0x1f7040);return interaction[_0xee80('0x22')]('fax',_0x1f7040['query'],_0x1f7040[_0xee80('0x23')],_0x409164,_0x20adf8)[_0xee80('0x16')](respondWithFilteredResult(_0x41801f,_0x409164))['catch'](handleError(_0x41801f,null));};exports[_0xee80('0x24')]=function(_0x2a3169,_0x53ef7b){var _0x1f72ae={'raw':![],'where':{'id':_0x2a3169[_0xee80('0x25')]['id']}},_0x1e3de9={};_0x1e3de9['model']=_[_0xee80('0x26')](db[_0xee80('0x1d')]['rawAttributes']);_0x1e3de9['query']=_[_0xee80('0x26')](_0x2a3169[_0xee80('0x27')]);_0x1e3de9['filters']=_['intersection'](_0x1e3de9[_0xee80('0x28')],_0x1e3de9['query']);_0x1f72ae['attributes']=_[_0xee80('0x29')](_0x1e3de9[_0xee80('0x28')],qs[_0xee80('0x2a')](_0x2a3169[_0xee80('0x27')]['fields']));_0x1f72ae[_0xee80('0x2b')]=_0x1f72ae[_0xee80('0x2b')][_0xee80('0x2c')]?_0x1f72ae[_0xee80('0x2b')]:_0x1e3de9[_0xee80('0x28')];if(_0x2a3169['query']['includeAll']){_0x1f72ae[_0xee80('0x2d')]=[{'all':!![]}];}_0x1f72ae=_[_0xee80('0x2e')]({},_0x1f72ae,_0x2a3169[_0xee80('0x2f')]);return db['FaxInteraction'][_0xee80('0x30')](_0x1f72ae)[_0xee80('0x16')](handleEntityNotFound(_0x53ef7b,null))[_0xee80('0x16')](respondWithResult(_0x53ef7b,null))[_0xee80('0x31')](handleError(_0x53ef7b,null));};exports[_0xee80('0x32')]=function(_0x2095f5,_0x4b43fc){return db[_0xee80('0x1d')][_0xee80('0x32')](_0x2095f5[_0xee80('0x33')],{})[_0xee80('0x16')](respondWithResult(_0x4b43fc,0xc9))[_0xee80('0x31')](handleError(_0x4b43fc,null));};exports[_0xee80('0x34')]=function(_0x322bae,_0x58d4e7){if(_0x322bae['body']['id']){delete _0x322bae['body']['id'];}return db[_0xee80('0x1d')][_0xee80('0x30')]({'where':{'id':_0x322bae['params']['id']}})[_0xee80('0x16')](handleEntityNotFound(_0x58d4e7,null))[_0xee80('0x16')](saveUpdates(_0x322bae[_0xee80('0x33')],null))['then'](respondWithResult(_0x58d4e7,null))[_0xee80('0x31')](handleError(_0x58d4e7,null));};exports[_0xee80('0x35')]=function(_0x309aad,_0x19805a){return db[_0xee80('0x1d')]['find']({'where':{'id':_0x309aad[_0xee80('0x25')]['id']}})['then'](handleEntityNotFound(_0x19805a,null))[_0xee80('0x16')](removeEntity(_0x19805a,null))[_0xee80('0x31')](handleError(_0x19805a,null));};exports['describe']=function(_0x345b35,_0x3d7aba){return db[_0xee80('0x1d')][_0xee80('0x36')]()[_0xee80('0x16')](respondWithResult(_0x3d7aba,null))[_0xee80('0x31')](handleError(_0x3d7aba,null));};exports['addMessage']=function(_0x3ac859,_0x47eeb9){return db[_0xee80('0x37')]['find']({'where':{'id':_0x3ac859[_0xee80('0x25')]['id']}})[_0xee80('0x16')](handleEntityNotFound(_0x47eeb9,null))[_0xee80('0x16')](function(_0x15bed3){if(_0x15bed3){return _0x15bed3[_0xee80('0x38')](_0x3ac859['body'][_0xee80('0x39')],_['omit'](_0x3ac859[_0xee80('0x33')],[_0xee80('0x39'),'id'])||{});}})[_0xee80('0x16')](respondWithResult(_0x47eeb9,null))[_0xee80('0x31')](handleError(_0x47eeb9,null));};exports[_0xee80('0x3a')]=function(_0x2c6664,_0x37ae56){var _0x2a68c1={'raw':![],'where':{}};var _0x41b7b1={};var _0x36bb5b={'count':0x0,'rows':[]};return db[_0xee80('0x1d')][_0xee80('0x3b')]({'where':{'id':_0x2c6664[_0xee80('0x25')]['id']}})[_0xee80('0x16')](handleEntityNotFound(_0x37ae56,null))[_0xee80('0x16')](function(_0x20be27){if(_0x20be27){_0x41b7b1['model']=_[_0xee80('0x26')](db[_0xee80('0x37')]['rawAttributes']);_0x41b7b1[_0xee80('0x27')]=_[_0xee80('0x26')](_0x2c6664[_0xee80('0x27')]);_0x41b7b1[_0xee80('0x3c')]=_['intersection'](_0x41b7b1[_0xee80('0x28')],_0x41b7b1[_0xee80('0x27')]);_0x2a68c1[_0xee80('0x2b')]=_[_0xee80('0x29')](_0x41b7b1[_0xee80('0x28')],qs['fields'](_0x2c6664[_0xee80('0x27')]['fields']));_0x2a68c1['attributes']=_0x2a68c1[_0xee80('0x2b')]['length']?_0x2a68c1[_0xee80('0x2b')]:_0x41b7b1[_0xee80('0x28')];if(!_0x2c6664[_0xee80('0x27')][_0xee80('0x3d')]('nolimit')){_0x2a68c1['limit']=qs[_0xee80('0x3e')](_0x2c6664[_0xee80('0x27')][_0xee80('0x3e')]);_0x2a68c1['offset']=qs[_0xee80('0x11')](_0x2c6664[_0xee80('0x27')][_0xee80('0x11')]);}_0x2a68c1[_0xee80('0x3f')]=qs['sort'](_0x2c6664[_0xee80('0x27')][_0xee80('0x40')]);_0x2a68c1[_0xee80('0x41')]=qs[_0xee80('0x3c')](_[_0xee80('0x42')](_0x2c6664[_0xee80('0x27')],_0x41b7b1[_0xee80('0x3c')]));_0x2a68c1[_0xee80('0x41')]['FaxInteractionId']=_0x20be27['id'];if(_0x2c6664[_0xee80('0x27')][_0xee80('0x43')]){_0x2a68c1[_0xee80('0x41')]=_[_0xee80('0x2e')](_0x2a68c1[_0xee80('0x41')],{'$or':_[_0xee80('0x1c')](_0x2a68c1['attributes'],function(_0x45eb39){var _0x64efc2={};_0x64efc2[_0x45eb39]={'$like':'%'+_0x2c6664['query'][_0xee80('0x43')]+'%'};return _0x64efc2;})});}if(_0x2c6664[_0xee80('0x27')][_0xee80('0x44')]){var _0x230398=_0x2c6664['query'][_0xee80('0x44')][_0xee80('0x45')](',');var _0x1df238={};_0x1df238[_0x230398[0x0]]={'$gte':moment(_0x230398[0x1])[_0xee80('0x46')](_0xee80('0x47'))};_0x2a68c1['where']=_['merge'](_0x2a68c1['where'],_0x1df238);}_0x2a68c1=_[_0xee80('0x2e')]({},_0x2a68c1,_0x2c6664[_0xee80('0x2f')]);return db[_0xee80('0x37')][_0xee80('0x13')]({'where':_0x2a68c1['where']})['then'](function(_0x28ece0){_0x36bb5b[_0xee80('0x13')]=_0x28ece0;if(_0x2c6664['query'][_0xee80('0x48')]){_0x2a68c1['include']=[{'all':!![]}];}return db[_0xee80('0x37')][_0xee80('0x22')](_0x2a68c1);})[_0xee80('0x16')](function(_0x3f92ad){_0x36bb5b[_0xee80('0x49')]=_0x3f92ad;return _0x36bb5b;});}})[_0xee80('0x16')](respondWithFilteredResult(_0x37ae56,_0x2a68c1))[_0xee80('0x31')](handleError(_0x37ae56,null));};exports[_0xee80('0x4a')]=function(_0x1844d9,_0x1e9f44){return db['FaxInteraction'][_0xee80('0x30')]({'where':{'id':_0x1844d9[_0xee80('0x25')]['id']}})[_0xee80('0x16')](handleEntityNotFound(_0x1e9f44,null))['then'](function(_0x326252){if(_0x326252){return _0x326252[_0xee80('0x4b')](_0x1844d9[_0xee80('0x33')]['ids'],_[_0xee80('0x4c')](_0x1844d9[_0xee80('0x33')],['ids','id'])||{})[_0xee80('0x4d')](function(){return db[_0xee80('0x4e')][_0xee80('0x22')]({'attributes':['id',_0xee80('0x4f'),_0xee80('0x50')],'where':{'id':_0x1844d9['body']['ids']}});})[_0xee80('0x16')](function(_0x372fd1){socket[_0xee80('0x51')]('faxInteractionTags:save',{'id':Number(_0x1844d9['params']['id']),'tags':_0x372fd1||[]});return{'id':Number(_0x1844d9[_0xee80('0x25')]['id']),'tags':_0x372fd1||[]};});}})[_0xee80('0x16')](respondWithResult(_0x1e9f44,null))[_0xee80('0x31')](handleError(_0x1e9f44,null));};exports[_0xee80('0x52')]=function(_0x4da363,_0x3a13d6){return db[_0xee80('0x1d')][_0xee80('0x30')]({'where':{'id':_0x4da363['params']['id']}})[_0xee80('0x16')](handleEntityNotFound(_0x3a13d6,null))[_0xee80('0x16')](function(_0x218467){if(_0x218467){return _0x218467[_0xee80('0x52')](_0x4da363[_0xee80('0x27')]['ids']);}})[_0xee80('0x16')](respondWithStatusCode(_0x3a13d6,null))[_0xee80('0x31')](handleError(_0x3a13d6,null));};exports['download']=function(_0x1d583a,_0x5c053d){var _0x24d40a=moment()['unix']()[_0xee80('0x53')]();var _0x54e253=path['join'](config[_0xee80('0x54')],_0xee80('0x55'),'files',_0xee80('0x56'));var _0x2aae52=path['join'](config[_0xee80('0x54')],_0xee80('0x55'),_0xee80('0x57'),_0xee80('0x58'));var _0x442e4b=path[_0xee80('0x59')](_0x54e253,_0x24d40a);var _0x44273a=util[_0xee80('0x46')](_0xee80('0x5a'),_0x1d583a[_0xee80('0x25')]['id'],_0x24d40a);var _0x9b26e7=path[_0xee80('0x59')](_0x54e253,_0x44273a);var _0x2b9b4f=[];_0x2b9b4f[_0xee80('0x5b')]({'model':db[_0xee80('0x5c')],'as':'Attachment','raw':!![]});var _0x5888b5=[{'model':db['FaxMessage'],'as':_0xee80('0x5d'),'attributes':['id',_0xee80('0x33'),_0xee80('0x5e')],'include':_0x2b9b4f}];return db['FaxInteraction'][_0xee80('0x30')]({'where':{'id':_0x1d583a[_0xee80('0x25')]['id']},'include':_0x5888b5})[_0xee80('0x16')](handleEntityNotFound(_0x5c053d,null))['then'](function(_0x2ff2c4){if(_0x2ff2c4&&_0x2ff2c4[_0xee80('0x5d')]){var _0x691f80=_0x2ff2c4[_0xee80('0x5f')]({'plain':!![]});fs[_0xee80('0x60')](_0x442e4b);for(var _0x335fbf=0x0;_0x335fbf<_0x691f80[_0xee80('0x5d')][_0xee80('0x2c')];_0x335fbf++){var _0x331e46=_0x691f80[_0xee80('0x5d')][_0x335fbf][_0xee80('0x5c')];if(_0x331e46){var _0x16fa3e=path[_0xee80('0x59')](_0x2aae52,_0x331e46['basename']);if(fs[_0xee80('0x61')](_0x16fa3e)){fs[_0xee80('0x62')](_0x16fa3e)[_0xee80('0x63')](fs['createWriteStream'](path['join'](_0x442e4b,_0x331e46['basename'])));}}}return BPromise[_0xee80('0x64')]()['then'](function(){return new BPromise(function(_0x22a9f8,_0x398861){zipdir(_0x442e4b,{'saveTo':_0x9b26e7},function(_0x4f74e0,_0x40cca7){if(_0x4f74e0)return _0x398861(_0x4f74e0);return _0x22a9f8(_0x40cca7);});})[_0xee80('0x16')](function(){return new BPromise(function(_0x77041f,_0x223a32){rimraf(_0x442e4b,function(_0x4d9d3f){if(_0x4d9d3f)_0x223a32(_0x4d9d3f);return _0x77041f();});});})[_0xee80('0x16')](function(){return _0x5c053d[_0xee80('0x65')](_0x9b26e7,_0x44273a,function(_0x258faf){if(_0x258faf){console[_0xee80('0x66')](_0xee80('0x67'),_0x258faf);}else{fs[_0xee80('0x68')](_0x9b26e7);}});});});}else{return _0x5c053d['sendStatus'](0xc8);}})['catch'](handleError(_0x5c053d,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index c9eba34..6bc317e 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 _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 +var _0xc22f=['hook','exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch'];(function(_0x4c1cb3,_0x1e47c1){var _0x47c6da=function(_0x1ce81c){while(--_0x1ce81c){_0x4c1cb3['push'](_0x4c1cb3['shift']());}};_0x47c6da(++_0x1e47c1);}(_0xc22f,0x134));var _0xfc22=function(_0x7c543a,_0xb03f24){_0x7c543a=_0x7c543a-0x0;var _0x3b6680=_0xc22f[_0x7c543a];return _0x3b6680;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xfc22('0x0'))['db'][_0xfc22('0x1')];var FaxMessage=require(_0xfc22('0x0'))['db'][_0xfc22('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xfc22('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfc22('0x4'),'afterDestroy':_0xfc22('0x5')};function emitEvent(_0x3f6ec7){return function(_0x495d6a,_0x3a8bd2,_0x308304){_0x495d6a[_0xfc22('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x171001){_0x495d6a[_0xfc22('0x7')](_0xfc22('0x8'),_0x171001[_0xfc22('0x9')](function(_0x891c40){return{'id':_0x891c40['id']};}));return FaxMessage[_0xfc22('0xa')]({'where':{'FaxInteractionId':_0x495d6a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfc22('0xb')](function(_0x5de7f6){_0x495d6a[_0xfc22('0x7')](_0xfc22('0xc'),_0x5de7f6[_0xfc22('0xd')]);FaxInteractionEvents[_0xfc22('0xe')](_0x3f6ec7+':'+_0x495d6a['id'],_0x495d6a);FaxInteractionEvents[_0xfc22('0xe')](_0x3f6ec7,_0x495d6a);_0x308304(null);})[_0xfc22('0xf')](_0x308304(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xfc22('0x10')](e,emitEvent(event));}}module[_0xfc22('0x11')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 96dc66e..381f8b1 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 _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 +var _0x336c=['api','moment','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger'];(function(_0x3d3e12,_0x57c459){var _0x1dcd36=function(_0x1bfab2){while(--_0x1bfab2){_0x3d3e12['push'](_0x3d3e12['shift']());}};_0x1dcd36(++_0x57c459);}(_0x336c,0xa8));var _0xc336=function(_0x4d553a,_0x12783a){_0x4d553a=_0x4d553a-0x0;var _0x4ec8a5=_0x336c[_0x4d553a];return _0x4ec8a5;};'use strict';var _=require('lodash');var util=require(_0xc336('0x0'));var logger=require(_0xc336('0x1'))(_0xc336('0x2'));var moment=require(_0xc336('0x3'));var BPromise=require('bluebird');var rp=require(_0xc336('0x4'));var fs=require('fs');var path=require(_0xc336('0x5'));var rimraf=require(_0xc336('0x6'));var config=require(_0xc336('0x7'));var attributes=require(_0xc336('0x8'));module[_0xc336('0x9')]=function(_0x1ffba,_0x5753c4){return _0x1ffba[_0xc336('0xa')](_0xc336('0xb'),attributes,{'tableName':_0xc336('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5e7ee6,_0x162913,_0x274c84){if(_0x5e7ee6[_0xc336('0xd')]('closed')){_0x5e7ee6[_0xc336('0xe')]=moment()[_0xc336('0xf')](_0xc336('0x10'));}_0x274c84(null,_0x5e7ee6);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index c8dab2e..168cda4 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 _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 +var _0x8a3a=['result','update','body','options','raw','where','limit','info','UpdateFaxInteraction','catch','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','FaxInteraction,\x20%s,\x20%s','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x4ac424,_0x554b5d){var _0xe1b890=function(_0x5e85c4){while(--_0x5e85c4){_0x4ac424['push'](_0x4ac424['shift']());}};_0xe1b890(++_0x554b5d);}(_0x8a3a,0x90));var _0xa8a3=function(_0xba95dd,_0x289889){_0xba95dd=_0xba95dd-0x0;var _0x308132=_0x8a3a[_0xba95dd];return _0x308132;};'use strict';var _=require(_0xa8a3('0x0'));var util=require(_0xa8a3('0x1'));var moment=require(_0xa8a3('0x2'));var BPromise=require(_0xa8a3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa8a3('0x4'));var db=require(_0xa8a3('0x5'))['db'];var utils=require(_0xa8a3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa8a3('0x7'));var jayson=require(_0xa8a3('0x8'));var client=jayson[_0xa8a3('0x9')][_0xa8a3('0xa')]({'port':0x232a});config[_0xa8a3('0xb')]=_[_0xa8a3('0xc')](config['redis'],{'host':_0xa8a3('0xd'),'port':0x18eb});var socket=require(_0xa8a3('0xe'))(new Redis(config[_0xa8a3('0xb')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x1bc940,_0x247ce4,_0x5da970){return new BPromise(function(_0x596964,_0x58db57){return client[_0xa8a3('0xf')](_0x1bc940,_0x5da970)[_0xa8a3('0x10')](function(_0x494877){logger['info'](_0xa8a3('0x11'),_0x247ce4,'request\x20sent');logger['debug'](_0xa8a3('0x12'),_0x247ce4,_0xa8a3('0x13'),JSON[_0xa8a3('0x14')](_0x494877));if(_0x494877[_0xa8a3('0x15')]){if(_0x494877[_0xa8a3('0x15')][_0xa8a3('0x16')]===0x1f4){logger[_0xa8a3('0x15')](_0xa8a3('0x11'),_0x247ce4,_0x494877['error']['message']);return _0x58db57(_0x494877['error'][_0xa8a3('0x17')]);}logger[_0xa8a3('0x15')](_0xa8a3('0x11'),_0x247ce4,_0x494877[_0xa8a3('0x15')][_0xa8a3('0x17')]);return _0x596964(_0x494877[_0xa8a3('0x15')][_0xa8a3('0x17')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x247ce4,_0xa8a3('0x13'));_0x596964(_0x494877[_0xa8a3('0x18')][_0xa8a3('0x17')]);}})['catch'](function(_0x3d9905){logger[_0xa8a3('0x15')](_0xa8a3('0x11'),_0x247ce4,_0x3d9905);_0x58db57(_0x3d9905);});});}exports['UpdateFaxInteraction']=function(_0x5ef2db){var _0x4eeda0=this;return new Promise(function(_0x529f54,_0x1c8c07){return db['FaxInteraction'][_0xa8a3('0x19')](_0x5ef2db[_0xa8a3('0x1a')],{'raw':_0x5ef2db[_0xa8a3('0x1b')]?_0x5ef2db[_0xa8a3('0x1b')][_0xa8a3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ef2db[_0xa8a3('0x1b')]?_0x5ef2db[_0xa8a3('0x1b')][_0xa8a3('0x1d')]||null:null,'attributes':_0x5ef2db[_0xa8a3('0x1b')]?_0x5ef2db[_0xa8a3('0x1b')]['attributes']||null:null,'limit':_0x5ef2db[_0xa8a3('0x1b')]?_0x5ef2db[_0xa8a3('0x1b')][_0xa8a3('0x1e')]||null:null})[_0xa8a3('0x10')](function(_0x3ab994){logger[_0xa8a3('0x1f')]('UpdateFaxInteraction',_0x5ef2db);logger['debug'](_0xa8a3('0x20'),_0x5ef2db,JSON['stringify'](_0x3ab994));_0x529f54(_0x3ab994);})[_0xa8a3('0x21')](function(_0x533f2e){logger['error'](_0xa8a3('0x20'),_0x533f2e[_0xa8a3('0x17')],_0x5ef2db);_0x1c8c07(_0x4eeda0[_0xa8a3('0x15')](0x1f4,_0x533f2e['message']));});});};exports[_0xa8a3('0x22')]=function(_0x24dd12){return new Promise(function(_0x255545,_0x55af60){return db['FaxInteraction'][_0xa8a3('0x23')]({'where':_0x24dd12[_0xa8a3('0x1b')]?_0x24dd12[_0xa8a3('0x1b')]['where']||null:null})[_0xa8a3('0x10')](function(_0x412b81){if(_0x412b81){return _0x412b81[_0xa8a3('0x24')](_0x24dd12['body'][_0xa8a3('0x25')],_[_0xa8a3('0x26')](_0x24dd12[_0xa8a3('0x1a')],[_0xa8a3('0x25'),'id'])||{});}})[_0xa8a3('0x27')](function(_0x5b1ac3){logger[_0xa8a3('0x1f')](_0xa8a3('0x28'),_0x24dd12);logger[_0xa8a3('0x29')](_0xa8a3('0x28'),_0x24dd12,JSON[_0xa8a3('0x14')](_0x5b1ac3));_0x255545(_0x5b1ac3);})['catch'](function(_0x3f6b72){logger[_0xa8a3('0x15')](_0xa8a3('0x28'),_0x3f6b72['message'],_0x24dd12);_0x55af60(_this[_0xa8a3('0x15')](0x1f4,_0x3f6b72[_0xa8a3('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index d8c0d4d..387b388 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 _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 +var _0xea01=['register','length','faxInteraction:','save','remove','update','emit','removeListener'];(function(_0xa54290,_0x50b0cf){var _0x37625f=function(_0x17d8b0){while(--_0x17d8b0){_0xa54290['push'](_0xa54290['shift']());}};_0x37625f(++_0x50b0cf);}(_0xea01,0x1a3));var _0x1ea0=function(_0x302c30,_0xd40a14){_0x302c30=_0x302c30-0x0;var _0x16e434=_0xea01[_0x302c30];return _0x16e434;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x1ea0('0x0'),_0x1ea0('0x1'),_0x1ea0('0x2')];function createListener(_0x554457,_0x37d3ce){return function(_0x2c713b){_0x37d3ce[_0x1ea0('0x3')](_0x554457,_0x2c713b);};}function removeListener(_0xa15b41,_0x10ee1b){return function(){FaxInteractionEvents[_0x1ea0('0x4')](_0xa15b41,_0x10ee1b);};}exports[_0x1ea0('0x5')]=function(_0x13af7d){for(var _0x43c2e5=0x0,_0x2c1226=events[_0x1ea0('0x6')];_0x43c2e5<_0x2c1226;_0x43c2e5++){var _0x517644=events[_0x43c2e5];var _0x4e5e4f=createListener(_0x1ea0('0x7')+_0x517644,_0x13af7d);FaxInteractionEvents['on'](_0x517644,_0x4e5e4f);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index bb0ad17..0b951d8 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 _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 +var _0x30a7=['faxinteraction:addtags','/:id','tracked','faxinteraction:update','delete','faxinteraction:destroy','removeTags','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./faxInteraction.controller','isAuthenticated','get','describe','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','fax'];(function(_0x5571d2,_0x352fbe){var _0x487159=function(_0x5a928d){while(--_0x5a928d){_0x5571d2['push'](_0x5571d2['shift']());}};_0x487159(++_0x352fbe);}(_0x30a7,0xf1));var _0x730a=function(_0xc69a06,_0x57827d){_0xc69a06=_0xc69a06-0x0;var _0x1d4b47=_0x30a7[_0xc69a06];return _0x1d4b47;};'use strict';var multer=require('multer');var util=require(_0x730a('0x0'));var path=require(_0x730a('0x1'));var timeout=require(_0x730a('0x2'));var express=require(_0x730a('0x3'));var router=express['Router']();var fs_extra=require(_0x730a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x730a('0x5'));var config=require('../../config/environment');var controller=require(_0x730a('0x6'));router['get']('/',auth[_0x730a('0x7')](),controller['index']);router[_0x730a('0x8')]('/describe',auth[_0x730a('0x7')](),controller[_0x730a('0x9')]);router[_0x730a('0x8')]('/:id',auth[_0x730a('0x7')](),controller[_0x730a('0xa')]);router[_0x730a('0x8')](_0x730a('0xb'),auth['isAuthenticated'](),controller['getMessages']);router[_0x730a('0x8')](_0x730a('0xc'),auth[_0x730a('0x7')](),controller[_0x730a('0xd')]);router[_0x730a('0xe')]('/',auth['isAuthenticated'](),controller[_0x730a('0xf')]);router[_0x730a('0xe')](_0x730a('0xb'),auth[_0x730a('0x7')](),controller[_0x730a('0x10')]);router['post'](_0x730a('0x11'),auth['isAuthenticated'](),interaction['tracked'](_0x730a('0x12'),_0x730a('0x13')),controller['addTags']);router['put'](_0x730a('0x14'),auth[_0x730a('0x7')](),interaction[_0x730a('0x15')](_0x730a('0x12'),_0x730a('0x16')),controller['update']);router[_0x730a('0x17')]('/:id',auth['isAuthenticated'](),interaction['tracked']('fax',_0x730a('0x18')),controller['destroy']);router[_0x730a('0x17')](_0x730a('0x11'),auth[_0x730a('0x7')](),controller[_0x730a('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index ff57bc5..dc21b39 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 _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 +var _0xfd28=['exports','TEXT','BOOLEAN','out'];(function(_0x3f641f,_0x19961c){var _0x547c8c=function(_0x58400b){while(--_0x58400b){_0x3f641f['push'](_0x3f641f['shift']());}};_0x547c8c(++_0x19961c);}(_0xfd28,0x148));var _0x8fd2=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xfd28[_0xc8a931];return _0x28bd27;};'use strict';var Sequelize=require('sequelize');module[_0x8fd2('0x0')]={'body':{'type':Sequelize[_0x8fd2('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8fd2('0x3')),'defaultValue':_0x8fd2('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8fd2('0x1')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 73c52b9..210bc81 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 _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 +var _0x0b72=['rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','keys','options','body','find','../../config/logger','fax-interactions','accept','read','format','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','SELECT','contact','User','fullname','email','internal','agent','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','basename','download','join','root','server','Attachment','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','stack','name','send','index','map','FaxMessage'];(function(_0x25e37d,_0x48304f){var _0x9db28d=function(_0x2df556){while(--_0x2df556){_0x25e37d['push'](_0x25e37d['shift']());}};_0x9db28d(++_0x48304f);}(_0x0b72,0x16b));var _0x20b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b72[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x20b7('0x0'));var rimraf=require(_0x20b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x20b7('0x2'));var rp=require('request-promise');var moment=require(_0x20b7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x20b7('0x4'));var util=require(_0x20b7('0x5'));var path=require(_0x20b7('0x6'));var sox=require(_0x20b7('0x7'));var csv=require(_0x20b7('0x8'));var ejs=require(_0x20b7('0x9'));var fs=require('fs');var fs_extra=require(_0x20b7('0xa'));var _=require(_0x20b7('0xb'));var squel=require(_0x20b7('0xc'));var crypto=require('crypto');var jsforce=require(_0x20b7('0xd'));var deskjs=require(_0x20b7('0xe'));var toCsv=require(_0x20b7('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x20b7('0xf'));var qs=require(_0x20b7('0x10'));var as=require(_0x20b7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x20b7('0x12'));var utils=require(_0x20b7('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x20b7('0x14'));var db=require(_0x20b7('0x15'))['db'];config[_0x20b7('0x16')]=_['defaults'](config[_0x20b7('0x16')],{'host':_0x20b7('0x17'),'port':0x18eb});var socket=require(_0x20b7('0x18'))(new Redis(config[_0x20b7('0x16')]));require(_0x20b7('0x19'))[_0x20b7('0x1a')](socket);var jayson=require(_0x20b7('0x1b'));var client=jayson[_0x20b7('0x1c')][_0x20b7('0x1d')]({'port':0x232c});var client9002=jayson[_0x20b7('0x1c')][_0x20b7('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x160104,_0x2f22cc,_0xc38c01,_0x599cc2){return new BPromise(function(_0x535f67,_0x523565){var _0x6b210a=_0x599cc2||client;return _0x6b210a[_0x20b7('0x1e')](_0x160104,_0xc38c01)['then'](function(_0x4f0f55){logger[_0x20b7('0x1f')](_0x20b7('0x20'),_0x2f22cc,'request\x20sent');logger[_0x20b7('0x21')](_0x20b7('0x22'),_0x2f22cc,_0x20b7('0x23'),JSON[_0x20b7('0x24')](_0x4f0f55));if(_0x4f0f55[_0x20b7('0x25')]){if(_0x4f0f55['error'][_0x20b7('0x26')]===0x1f4){logger[_0x20b7('0x25')](_0x20b7('0x20'),_0x2f22cc,_0x4f0f55[_0x20b7('0x25')][_0x20b7('0x27')]);return _0x523565(_0x4f0f55['error']['message']);}logger[_0x20b7('0x25')](_0x20b7('0x20'),_0x2f22cc,_0x4f0f55[_0x20b7('0x25')][_0x20b7('0x27')]);return _0x535f67(_0x4f0f55['error'][_0x20b7('0x27')]);}else{logger[_0x20b7('0x1f')](_0x20b7('0x20'),_0x2f22cc,_0x20b7('0x23'));_0x535f67(_0x4f0f55['result'][_0x20b7('0x27')]);}})[_0x20b7('0x28')](function(_0x4b8a73){logger['error'](_0x20b7('0x20'),_0x2f22cc,_0x4b8a73);_0x523565(_0x4b8a73);});});}function respondWithStatusCode(_0x4e7110,_0x571153){_0x571153=_0x571153||0xcc;return function(_0x4e0101){if(_0x4e0101){return _0x4e7110[_0x20b7('0x29')](_0x571153);}return _0x4e7110[_0x20b7('0x2a')](_0x571153)[_0x20b7('0x2b')]();};}function respondWithResult(_0x6ef0d4,_0x3a7f7a){_0x3a7f7a=_0x3a7f7a||0xc8;return function(_0x2c07e7){if(_0x2c07e7){return _0x6ef0d4[_0x20b7('0x2a')](_0x3a7f7a)[_0x20b7('0x2c')](_0x2c07e7);}};}function respondWithFilteredResult(_0x5b01d3,_0x6f0c12){return function(_0x19c97c){if(_0x19c97c){var _0x1acb9a=typeof _0x6f0c12[_0x20b7('0x2d')]===_0x20b7('0x2e')&&typeof _0x6f0c12[_0x20b7('0x2f')]==='undefined';var _0x5ec4ee=_0x19c97c[_0x20b7('0x30')];var _0x25400d=_0x1acb9a?0x0:_0x6f0c12[_0x20b7('0x2d')];var _0x1bbfb4=_0x1acb9a?_0x19c97c['count']:_0x6f0c12['offset']+_0x6f0c12[_0x20b7('0x2f')];var _0x127db8;if(_0x1bbfb4>=_0x5ec4ee){_0x1bbfb4=_0x5ec4ee;_0x127db8=0xc8;}else{_0x127db8=0xce;}_0x5b01d3['status'](_0x127db8);return _0x5b01d3['set']('Content-Range',_0x25400d+'-'+_0x1bbfb4+'/'+_0x5ec4ee)[_0x20b7('0x2c')](_0x19c97c);}return null;};}function patchUpdates(_0x11758f){return function(_0xcb3e4f){try{jsonpatch[_0x20b7('0x31')](_0xcb3e4f,_0x11758f,!![]);}catch(_0x48a88b){return BPromise['reject'](_0x48a88b);}return _0xcb3e4f[_0x20b7('0x32')]();};}function saveUpdates(_0x14c3ba,_0x4e6d9d){return function(_0x565448){if(_0x565448){return _0x565448[_0x20b7('0x33')](_0x14c3ba)[_0x20b7('0x34')](function(_0x1722b3){return _0x1722b3;});}return null;};}function removeEntity(_0xc5de90,_0x4a854b){return function(_0x40ec64){if(_0x40ec64){return _0x40ec64[_0x20b7('0x35')]()[_0x20b7('0x34')](function(){_0xc5de90[_0x20b7('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11dc3d,_0x1b7334){return function(_0x3a7767){if(!_0x3a7767){_0x11dc3d[_0x20b7('0x29')](0x194);}return _0x3a7767;};}function handleError(_0x16b1f1,_0x36cbf8){_0x36cbf8=_0x36cbf8||0x1f4;return function(_0x2a2540){logger[_0x20b7('0x25')](_0x2a2540[_0x20b7('0x36')]);if(_0x2a2540[_0x20b7('0x37')]){delete _0x2a2540['name'];}_0x16b1f1[_0x20b7('0x2a')](_0x36cbf8)[_0x20b7('0x38')](_0x2a2540);};}exports[_0x20b7('0x39')]=function(_0x581a4e,_0x31a217){var _0x19cb53={},_0x4d5966={},_0x3df6fd={'count':0x0,'rows':[]};var _0x37ba9c=_[_0x20b7('0x3a')](db[_0x20b7('0x3b')][_0x20b7('0x3c')],function(_0x41c84c){return{'name':_0x41c84c[_0x20b7('0x3d')],'type':_0x41c84c['type'][_0x20b7('0x3e')]};});_0x4d5966[_0x20b7('0x3f')]=_[_0x20b7('0x3a')](_0x37ba9c,'name');_0x4d5966[_0x20b7('0x40')]=_['keys'](_0x581a4e[_0x20b7('0x40')]);_0x4d5966['filters']=_[_0x20b7('0x41')](_0x4d5966[_0x20b7('0x3f')],_0x4d5966[_0x20b7('0x40')]);_0x19cb53['attributes']=_['intersection'](_0x4d5966['model'],qs[_0x20b7('0x42')](_0x581a4e[_0x20b7('0x40')][_0x20b7('0x42')]));_0x19cb53['attributes']=_0x19cb53[_0x20b7('0x43')][_0x20b7('0x44')]?_0x19cb53['attributes']:_0x4d5966[_0x20b7('0x3f')];if(!_0x581a4e[_0x20b7('0x40')][_0x20b7('0x45')]('nolimit')){_0x19cb53[_0x20b7('0x2f')]=qs[_0x20b7('0x2f')](_0x581a4e['query']['limit']);_0x19cb53[_0x20b7('0x2d')]=qs['offset'](_0x581a4e[_0x20b7('0x40')][_0x20b7('0x2d')]);}_0x19cb53[_0x20b7('0x46')]=qs['sort'](_0x581a4e[_0x20b7('0x40')][_0x20b7('0x47')]);_0x19cb53[_0x20b7('0x48')]=qs[_0x20b7('0x49')](_['pick'](_0x581a4e[_0x20b7('0x40')],_0x4d5966[_0x20b7('0x49')]),_0x37ba9c);if(_0x581a4e[_0x20b7('0x40')]['filter']){_0x19cb53[_0x20b7('0x48')]=_[_0x20b7('0x4a')](_0x19cb53[_0x20b7('0x48')],{'$or':_[_0x20b7('0x3a')](_0x37ba9c,function(_0x40ee32){if(_0x40ee32[_0x20b7('0x4b')]!==_0x20b7('0x4c')){var _0x3666c7={};_0x3666c7[_0x40ee32[_0x20b7('0x37')]]={'$like':'%'+_0x581a4e['query'][_0x20b7('0x4d')]+'%'};return _0x3666c7;}})});}_0x19cb53=_[_0x20b7('0x4a')]({},_0x19cb53,_0x581a4e['options']);var _0x4b6703={'where':_0x19cb53[_0x20b7('0x48')]};return db[_0x20b7('0x3b')][_0x20b7('0x30')](_0x4b6703)[_0x20b7('0x34')](function(_0x40caef){_0x3df6fd['count']=_0x40caef;if(_0x581a4e['query'][_0x20b7('0x4e')]){_0x19cb53[_0x20b7('0x4f')]=[{'all':!![]}];}return db[_0x20b7('0x3b')][_0x20b7('0x50')](_0x19cb53);})[_0x20b7('0x34')](function(_0x473a2d){_0x3df6fd[_0x20b7('0x51')]=_0x473a2d;return _0x3df6fd;})[_0x20b7('0x34')](respondWithFilteredResult(_0x31a217,_0x19cb53))['catch'](handleError(_0x31a217,null));};exports[_0x20b7('0x52')]=function(_0x340d4a,_0xb907c3){var _0x2c6c63={'raw':!![],'where':{'id':_0x340d4a[_0x20b7('0x53')]['id']}},_0x27981b={};_0x27981b[_0x20b7('0x3f')]=_[_0x20b7('0x54')](db['FaxMessage'][_0x20b7('0x3c')]);_0x27981b['query']=_[_0x20b7('0x54')](_0x340d4a['query']);_0x27981b[_0x20b7('0x49')]=_[_0x20b7('0x41')](_0x27981b[_0x20b7('0x3f')],_0x27981b[_0x20b7('0x40')]);_0x2c6c63[_0x20b7('0x43')]=_[_0x20b7('0x41')](_0x27981b['model'],qs[_0x20b7('0x42')](_0x340d4a[_0x20b7('0x40')]['fields']));_0x2c6c63[_0x20b7('0x43')]=_0x2c6c63['attributes'][_0x20b7('0x44')]?_0x2c6c63[_0x20b7('0x43')]:_0x27981b[_0x20b7('0x3f')];if(_0x340d4a[_0x20b7('0x40')]['includeAll']){_0x2c6c63[_0x20b7('0x4f')]=[{'all':!![]}];}_0x2c6c63=_[_0x20b7('0x4a')]({},_0x2c6c63,_0x340d4a[_0x20b7('0x55')]);return db[_0x20b7('0x3b')]['find'](_0x2c6c63)['then'](handleEntityNotFound(_0xb907c3,null))['then'](respondWithResult(_0xb907c3,null))['catch'](handleError(_0xb907c3,null));};exports[_0x20b7('0x33')]=function(_0x4ef4b8,_0x1833f2){if(_0x4ef4b8[_0x20b7('0x56')]['id']){delete _0x4ef4b8[_0x20b7('0x56')]['id'];}return db[_0x20b7('0x3b')][_0x20b7('0x57')]({'where':{'id':_0x4ef4b8[_0x20b7('0x53')]['id']}})['then'](handleEntityNotFound(_0x1833f2,null))[_0x20b7('0x34')](saveUpdates(_0x4ef4b8[_0x20b7('0x56')],null))[_0x20b7('0x34')](respondWithResult(_0x1833f2,null))[_0x20b7('0x28')](handleError(_0x1833f2,null));};exports[_0x20b7('0x35')]=function(_0x3bdbb9,_0x426a3f){return db[_0x20b7('0x3b')]['find']({'where':{'id':_0x3bdbb9[_0x20b7('0x53')]['id']}})[_0x20b7('0x34')](handleEntityNotFound(_0x426a3f,null))[_0x20b7('0x34')](removeEntity(_0x426a3f,null))[_0x20b7('0x28')](handleError(_0x426a3f,null));};exports['describe']=function(_0x15e794,_0x5a6c1e){return db[_0x20b7('0x3b')]['describe']()[_0x20b7('0x34')](respondWithResult(_0x5a6c1e,null))[_0x20b7('0x28')](handleError(_0x5a6c1e,null));};var interaction_log=require(_0x20b7('0x58'))(_0x20b7('0x59'));exports[_0x20b7('0x5a')]=function(_0x4e1c72,_0x320e8f,_0x282335){var _0x4ed73d={'agent':{},'channel':'fax'};if(_0x4e1c72[_0x20b7('0x56')]['id']){delete _0x4e1c72[_0x20b7('0x56')]['id'];}_0x4e1c72[_0x20b7('0x56')][_0x20b7('0x5b')]=!![];_0x4e1c72[_0x20b7('0x56')]['readAt']=moment()[_0x20b7('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x4e1c72[_0x20b7('0x56')]['UserId']=_0x4e1c72[_0x20b7('0x56')][_0x20b7('0x5d')]||_0x4e1c72[_0x20b7('0x5e')]['id'];_0x4ed73d['agent']['id']=_0x4e1c72[_0x20b7('0x56')][_0x20b7('0x5d')];return db[_0x20b7('0x3b')][_0x20b7('0x57')]({'where':{'id':_0x4e1c72[_0x20b7('0x53')]['id'],'UserId':null}})[_0x20b7('0x34')](handleEntityNotFound(_0x320e8f,null))[_0x20b7('0x34')](saveUpdates(_0x4e1c72[_0x20b7('0x56')],null))['then'](function(_0x328631){if(_0x328631){_0x4ed73d[_0x20b7('0x27')]=_0x328631[_0x20b7('0x5f')]({'plain':!![]});return db[_0x20b7('0x60')]['find']({'where':{'id':_0x328631[_0x20b7('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x320e8f,null))['then'](function(_0x179b2f){if(_0x179b2f){return _0x179b2f['update']({'UserId':_0x4e1c72[_0x20b7('0x56')][_0x20b7('0x5d')],'read1stAt':_[_0x20b7('0x62')](_0x179b2f[_0x20b7('0x63')])?moment()[_0x20b7('0x5c')](_0x20b7('0x64')):undefined});}return null;})[_0x20b7('0x34')](function(_0x563b75){if(_0x563b75){_0x4ed73d['interaction']=_0x563b75[_0x20b7('0x5f')]({'plain':!![]});interaction_log[_0x20b7('0x1f')](_0x20b7('0x65'),_0x4e1c72[_0x20b7('0x5e')]['id'],_0x4e1c72[_0x20b7('0x5e')]['name'],_0x4e1c72['user']['role'],_0x4ed73d[_0x20b7('0x66')]['id'],_0x4e1c72['body']?JSON[_0x20b7('0x24')](_0x4e1c72[_0x20b7('0x56')]):_0x20b7('0x67'));return respondWithRpcPromise(_0x20b7('0x68'),'acceptMessage',_0x4ed73d);}return null;})[_0x20b7('0x34')](function(_0x17f07a){var _0x28b97b=_0x20b7('0x69')+_0x17f07a[_0x20b7('0x27')][_0x20b7('0x6a')];return db['sequelize'][_0x20b7('0x40')](_0x28b97b,{'type':db['Sequelize']['QueryTypes'][_0x20b7('0x6b')],'raw':!![]})['then'](function(_0x51e5fa){return _0x51e5fa;});})[_0x20b7('0x34')](function(_0x50f82f){if(_0x50f82f){_0x4ed73d[_0x20b7('0x27')][_0x20b7('0x6c')]=_0x50f82f[0x0];if(!_0x4e1c72[_0x20b7('0x56')][_0x20b7('0x5d')])return;return db[_0x20b7('0x6d')][_0x20b7('0x57')]({'where':{'id':_0x4e1c72['body'][_0x20b7('0x5d')],'role':'agent'},'attributes':['id',_0x20b7('0x37'),_0x20b7('0x6e'),_0x20b7('0x6f'),_0x20b7('0x70')],'raw':!![]});}return null;})[_0x20b7('0x34')](function(_0x5d6526){if(!_0x5d6526)return null;_0x4ed73d[_0x20b7('0x27')][_0x20b7('0x71')]=_0x5d6526;return _0x4ed73d;})[_0x20b7('0x34')](function(_0x56c0c3){if(_0x56c0c3){if(_0x4e1c72[_0x20b7('0x56')][_0x20b7('0x72')]){_0x4ed73d[_0x20b7('0x27')][_0x20b7('0x73')]=util[_0x20b7('0x5c')](_0x20b7('0x74'),_0x4e1c72[_0x20b7('0x5e')][_0x20b7('0x37')]);_0x4ed73d[_0x20b7('0x27')]['channel']=_0x4ed73d[_0x20b7('0x75')];_0x4ed73d[_0x20b7('0x27')][_0x20b7('0x76')]=_0x4ed73d[_0x20b7('0x75')];_0x4ed73d[_0x20b7('0x27')][_0x20b7('0x77')]=_0x20b7('0x5a');return respondWithRpcPromise(_0x20b7('0x78'),_0x20b7('0x78'),{'event':_0x20b7('0x79'),'message':_0x4ed73d['message']},client9002)[_0x20b7('0x34')](function(){return _0x4ed73d;});}return _0x4ed73d;}return null;})[_0x20b7('0x34')](respondWithResult(_0x320e8f,null))[_0x20b7('0x28')](handleError(_0x320e8f,null));};var interaction_log=require(_0x20b7('0x58'))(_0x20b7('0x59'));exports[_0x20b7('0x7a')]=function(_0x174181,_0x55a4e0,_0x34bd2c){var _0x559411={'agent':{},'channel':_0x20b7('0x7b')};if(_0x174181[_0x20b7('0x56')]['id']){delete _0x174181[_0x20b7('0x56')]['id'];}_0x174181[_0x20b7('0x56')][_0x20b7('0x5d')]=_0x174181[_0x20b7('0x56')][_0x20b7('0x5d')]||_0x174181[_0x20b7('0x5e')]['id'];_0x559411['agent']['id']=_0x174181[_0x20b7('0x56')]['UserId'];return db[_0x20b7('0x3b')][_0x20b7('0x57')]({'where':{'id':_0x174181[_0x20b7('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x55a4e0,null))[_0x20b7('0x34')](function(_0x3a5659){if(_0x3a5659){_0x559411[_0x20b7('0x27')]=_0x3a5659[_0x20b7('0x5f')]({'plain':!![]});return db[_0x20b7('0x60')][_0x20b7('0x57')]({'where':{'id':_0x3a5659[_0x20b7('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x55a4e0,null))[_0x20b7('0x34')](function(_0x507c4e){if(_0x507c4e){_0x559411[_0x20b7('0x66')]=_0x507c4e['get']({'plain':!![]});interaction_log['info'](_0x20b7('0x7c'),_0x174181['user']['id'],_0x174181[_0x20b7('0x5e')][_0x20b7('0x37')],_0x174181[_0x20b7('0x5e')][_0x20b7('0x7d')],_0x559411[_0x20b7('0x66')]['id'],_0x174181[_0x20b7('0x56')]?JSON[_0x20b7('0x24')](_0x174181[_0x20b7('0x56')]):_0x20b7('0x67'));return respondWithRpcPromise(_0x20b7('0x7e'),_0x20b7('0x7f'),_0x559411);}return null;})['then'](function(_0x14d44a){var _0x357d37=_0x20b7('0x69')+_0x14d44a[_0x20b7('0x27')][_0x20b7('0x6a')];return db['sequelize'][_0x20b7('0x40')](_0x357d37,{'type':db['Sequelize']['QueryTypes'][_0x20b7('0x6b')],'raw':!![]})[_0x20b7('0x34')](function(_0x36dd57){return _0x36dd57;});})[_0x20b7('0x34')](function(_0xecead6){if(_0xecead6){_0x559411[_0x20b7('0x27')]['contact']=_0xecead6[0x0];if(!_0x174181[_0x20b7('0x56')][_0x20b7('0x5d')])return;return db[_0x20b7('0x6d')][_0x20b7('0x57')]({'where':{'id':_0x174181['body']['UserId'],'role':_0x20b7('0x71')},'attributes':['id','name',_0x20b7('0x6e'),_0x20b7('0x6f'),_0x20b7('0x70')],'raw':!![]});}return null;})['then'](function(_0x11da0f){if(!_0x11da0f)return null;_0x559411[_0x20b7('0x27')]['agent']=_0x11da0f;return _0x559411;})[_0x20b7('0x34')](function(_0x42affc){if(_0x42affc){_0x42affc[_0x20b7('0x27')][_0x20b7('0x73')]=util['format'](_0x20b7('0x74'),_0x174181[_0x20b7('0x5e')][_0x20b7('0x37')]);_0x42affc[_0x20b7('0x27')][_0x20b7('0x75')]=_0x559411['channel'];_0x42affc[_0x20b7('0x27')][_0x20b7('0x76')]=_0x559411[_0x20b7('0x75')];_0x42affc[_0x20b7('0x27')]['event']=_0x20b7('0x7a');respondWithRpcPromise(_0x20b7('0x78'),'EventManager',{'event':_0x20b7('0x80'),'message':_0x42affc['message']},client9002);return _0x559411;}return null;})[_0x20b7('0x34')](respondWithResult(_0x55a4e0,null))[_0x20b7('0x28')](handleError(_0x55a4e0,null));};exports[_0x20b7('0x81')]=function(_0x11f25f,_0x1819fa){var _0x1e3df5;return db[_0x20b7('0x3b')][_0x20b7('0x81')](_0x11f25f[_0x20b7('0x56')],{})['then'](function(_0x3de8dc){_0x1e3df5=_0x3de8dc;return db[_0x20b7('0x82')][_0x20b7('0x83')]({'where':{'id':_0x1e3df5[_0x20b7('0x6a')]}});})['then'](function(_0x5be987){if(_[_0x20b7('0x62')](_0x5be987)){return;}else{_0x1e3df5['fax']=_0x5be987['fax'];return db['Attachment'][_0x20b7('0x83')]({'where':{'id':_0x1e3df5[_0x20b7('0x84')]}});}})['then'](function(_0x2e2555){return respondWithRpcPromise(_0x20b7('0x85'),_0x20b7('0x85'),{'FaxAccountId':_[_0x20b7('0x62')](_0x11f25f[_0x20b7('0x56')])?undefined:_0x11f25f['body'][_0x20b7('0x86')],'path':_[_0x20b7('0x62')](_0x2e2555)?undefined:util[_0x20b7('0x5c')]('/var/opt/motion2/server/files/attachments/%s',_0x2e2555[_0x20b7('0x87')]),'fax':_[_0x20b7('0x62')](_0x1e3df5[_0x20b7('0x7b')])?undefined:_0x1e3df5[_0x20b7('0x7b')],'AttachmentId':_0x1e3df5[_0x20b7('0x84')]},client9002);})['then'](respondWithResult(_0x1819fa,0xc9))['catch'](handleError(_0x1819fa,null));};exports[_0x20b7('0x88')]=function(_0x1d8ea1,_0x36a386){var _0x5d9824=path[_0x20b7('0x89')](config[_0x20b7('0x8a')],_0x20b7('0x8b'),'files','attachments');return db[_0x20b7('0x3b')]['find']({'where':{'id':_0x1d8ea1['params']['id']},'include':[{'model':db[_0x20b7('0x8c')],'as':_0x20b7('0x8c')}]})['then'](handleEntityNotFound(_0x36a386,null))[_0x20b7('0x34')](function(_0xcaaa2){if(_0xcaaa2){return _0x36a386[_0x20b7('0x88')](path[_0x20b7('0x89')](_0x5d9824,_0xcaaa2[_0x20b7('0x8c')]['basename']));}})[_0x20b7('0x28')](handleError(_0x36a386,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index b66f925..3d30127 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 _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 +var _0x4d68=['update','emit','hasOwnProperty','events','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4d68,0x1c3));var _0x84d6=function(_0x32bb6b,_0x1a5fbe){_0x32bb6b=_0x32bb6b-0x0;var _0x58dcb4=_0x4d68[_0x32bb6b];return _0x58dcb4;};'use strict';var EventEmitter=require(_0x84d6('0x0'));var FaxMessage=require(_0x84d6('0x1'))['db'][_0x84d6('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x84d6('0x3')](0x0);var events={'afterCreate':_0x84d6('0x4'),'afterUpdate':_0x84d6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x319f1f){return function(_0x5ee114,_0x3a2f0b,_0x589711){FaxMessageEvents[_0x84d6('0x6')](_0x319f1f+':'+_0x5ee114['id'],_0x5ee114);FaxMessageEvents[_0x84d6('0x6')](_0x319f1f,_0x5ee114);_0x589711(null);};}for(var e in events){if(events[_0x84d6('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 4f2305c..c77d5d9 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 _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 +var _0xffbe=['../../config/logger','moment','rimraf','../../config/environment','./faxMessage.attributes','exports','define','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','toLowerCase','error','utf8mb4','util'];(function(_0x5b0674,_0x2d3b91){var _0x1c34a9=function(_0xa9aa8){while(--_0xa9aa8){_0x5b0674['push'](_0x5b0674['shift']());}};_0x1c34a9(++_0x2d3b91);}(_0xffbe,0x19f));var _0xeffb=function(_0x3e0454,_0x39f216){_0x3e0454=_0x3e0454-0x0;var _0x4bb6ce=_0xffbe[_0x3e0454];return _0x4bb6ce;};'use strict';var _=require('lodash');var util=require(_0xeffb('0x0'));var logger=require(_0xeffb('0x1'))('api');var moment=require(_0xeffb('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeffb('0x3'));var config=require(_0xeffb('0x4'));var attributes=require(_0xeffb('0x5'));module[_0xeffb('0x6')]=function(_0x3c6ad6,_0x296230){return _0x3c6ad6[_0xeffb('0x7')]('FaxMessage',attributes,{'tableName':_0xeffb('0x8'),'paranoid':![],'indexes':[{'name':_0xeffb('0x9'),'fields':[_0xeffb('0xa')],'type':_0xeffb('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3635b6,_0x31f95e,_0xdeba2b){var _0x3d3017=_0x3c6ad6[_0xeffb('0xc')];var _0x947819=_0x3635b6[_0xeffb('0xd')]({'plain':!![]});if(_0x947819[_0xeffb('0xe')]['toLowerCase']()==='in'||_0x947819[_0xeffb('0xe')]['toLowerCase']()===_0xeffb('0xf')&&!_0x947819[_0xeffb('0x10')]&&!_[_0xeffb('0x11')](_0x947819[_0xeffb('0x12')])){_0x3d3017[_0xeffb('0x13')][_0xeffb('0x14')]({'where':{'id':_0x947819[_0xeffb('0x15')]}})[_0xeffb('0x16')](function(_0x198161){if(_0x198161){_0x198161['update']({'lastMsgAt':_0x947819['createdAt'],'lastMsgDirection':_0x947819[_0xeffb('0xe')][_0xeffb('0x17')]()});}})['catch'](function(_0x56248f){console[_0xeffb('0x18')](_0x56248f);});}_0xdeba2b();}},'charset':_0xeffb('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index c97ec4a..cc373ae 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 _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 +var _0x4b84=['CreateFaxMessage','FaxMessage','create','body','options','raw','stringify','UpdateFaxMessage','attributes','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','http','defaults','localhost','./faxMessage.socket','register','request','then','info','request\x20sent','debug','error','message','FaxMessage,\x20%s,\x20%s','result'];(function(_0x128268,_0x5b219f){var _0x335903=function(_0x13eacf){while(--_0x13eacf){_0x128268['push'](_0x128268['shift']());}};_0x335903(++_0x5b219f);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1196bd,_0xba4aea){_0x1196bd=_0x1196bd-0x0;var _0x26014f=_0x4b84[_0x1196bd];return _0x26014f;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});config['redis']=_[_0x44b8('0x7')](config['redis'],{'host':_0x44b8('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x44b8('0x9'))[_0x44b8('0xa')](socket);function respondWithRpcPromise(_0x30ebc3,_0x48a371,_0xc650ec){return new BPromise(function(_0x2cc74b,_0x4315f6){return client[_0x44b8('0xb')](_0x30ebc3,_0xc650ec)[_0x44b8('0xc')](function(_0x37e471){logger[_0x44b8('0xd')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x44b8('0xe'));logger[_0x44b8('0xf')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x48a371,_0x44b8('0xe'),JSON['stringify'](_0x37e471));if(_0x37e471[_0x44b8('0x10')]){if(_0x37e471[_0x44b8('0x10')]['code']===0x1f4){logger[_0x44b8('0x10')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x37e471['error'][_0x44b8('0x11')]);return _0x4315f6(_0x37e471[_0x44b8('0x10')][_0x44b8('0x11')]);}logger[_0x44b8('0x10')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x37e471['error']['message']);return _0x2cc74b(_0x37e471[_0x44b8('0x10')]['message']);}else{logger[_0x44b8('0xd')](_0x44b8('0x12'),_0x48a371,'request\x20sent');_0x2cc74b(_0x37e471[_0x44b8('0x13')][_0x44b8('0x11')]);}})['catch'](function(_0x89bc30){logger[_0x44b8('0x10')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x89bc30);_0x4315f6(_0x89bc30);});});}exports[_0x44b8('0x14')]=function(_0x8b4301){var _0xebfe79=this;return new Promise(function(_0x235bdc,_0x102ef9){return db[_0x44b8('0x15')][_0x44b8('0x16')](_0x8b4301[_0x44b8('0x17')],{'raw':_0x8b4301[_0x44b8('0x18')]?_0x8b4301[_0x44b8('0x18')][_0x44b8('0x19')]===undefined?!![]:![]:!![]})[_0x44b8('0xc')](function(_0x48327e){logger[_0x44b8('0xd')](_0x44b8('0x14'),_0x8b4301);logger[_0x44b8('0xf')](_0x44b8('0x14'),_0x8b4301,JSON[_0x44b8('0x1a')](_0x48327e));_0x235bdc(_0x48327e);})['catch'](function(_0x402497){logger['error'](_0x44b8('0x14'),_0x402497[_0x44b8('0x11')],_0x8b4301);_0x102ef9(_0xebfe79[_0x44b8('0x10')](0x1f4,_0x402497[_0x44b8('0x11')]));});});};exports[_0x44b8('0x1b')]=function(_0x59acbc){var _0x474f01=this;return new Promise(function(_0x502acf,_0x41d673){return db[_0x44b8('0x15')]['update'](_0x59acbc[_0x44b8('0x17')],{'raw':_0x59acbc[_0x44b8('0x18')]?_0x59acbc[_0x44b8('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59acbc[_0x44b8('0x18')]?_0x59acbc[_0x44b8('0x18')]['where']||null:null,'attributes':_0x59acbc[_0x44b8('0x18')]?_0x59acbc['options'][_0x44b8('0x1c')]||null:null,'limit':_0x59acbc['options']?_0x59acbc['options']['limit']||null:null})[_0x44b8('0xc')](function(_0x29b18d){logger[_0x44b8('0xd')](_0x44b8('0x1b'),_0x59acbc);logger[_0x44b8('0xf')](_0x44b8('0x1b'),_0x59acbc,JSON[_0x44b8('0x1a')](_0x29b18d));_0x502acf(_0x29b18d);})[_0x44b8('0x1d')](function(_0xd1d320){logger[_0x44b8('0x10')](_0x44b8('0x1b'),_0xd1d320[_0x44b8('0x11')],_0x59acbc);_0x41d673(_0x474f01[_0x44b8('0x10')](0x1f4,_0xd1d320['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 8dd27de..2089729 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 _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 +var _0x76ce=['emit','register','length','faxMessage:','save'];(function(_0x9b7a64,_0x38d4a8){var _0x33fd98=function(_0x15c82b){while(--_0x15c82b){_0x9b7a64['push'](_0x9b7a64['shift']());}};_0x33fd98(++_0x38d4a8);}(_0x76ce,0x153));var _0xe76c=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x76ce[_0x4ea69d];return _0x5318e0;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xe76c('0x0'),'remove','update'];function createListener(_0x5b42ea,_0x553f7c){return function(_0x1dced1){_0x553f7c[_0xe76c('0x1')](_0x5b42ea,_0x1dced1);};}function removeListener(_0x233adb,_0x5ca5cc){return function(){FaxMessageEvents['removeListener'](_0x233adb,_0x5ca5cc);};}exports[_0xe76c('0x2')]=function(_0x334c99){for(var _0x580161=0x0,_0x3c8a6b=events[_0xe76c('0x3')];_0x580161<_0x3c8a6b;_0x580161++){var _0x34436c=events[_0x580161];var _0x381c33=createListener(_0xe76c('0x4')+_0x34436c,_0x334c99);FaxMessageEvents['on'](_0x34436c,_0x381c33);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 613a239..ea9d033 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 _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 +var _0xc368=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id','download','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','delete','destroy','exports','util','connect-timeout'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xc368,0x7b));var _0x8c36=function(_0x288a6d,_0x1048f9){_0x288a6d=_0x288a6d-0x0;var _0x23261d=_0xc368[_0x288a6d];return _0x23261d;};'use strict';var multer=require('multer');var util=require(_0x8c36('0x0'));var path=require('path');var timeout=require(_0x8c36('0x1'));var express=require(_0x8c36('0x2'));var router=express[_0x8c36('0x3')]();var fs_extra=require(_0x8c36('0x4'));var auth=require(_0x8c36('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8c36('0x6'));var controller=require(_0x8c36('0x7'));router[_0x8c36('0x8')]('/',auth[_0x8c36('0x9')](),controller['index']);router['get'](_0x8c36('0xa'),auth[_0x8c36('0x9')](),controller[_0x8c36('0xb')]);router[_0x8c36('0x8')](_0x8c36('0xc'),auth[_0x8c36('0x9')](),controller['show']);router['get']('/:id/download',auth[_0x8c36('0x9')](),controller[_0x8c36('0xd')]);router['post']('/',auth[_0x8c36('0x9')](),interaction[_0x8c36('0xe')](_0x8c36('0xf'),_0x8c36('0x10')),controller[_0x8c36('0x11')]);router[_0x8c36('0x12')](_0x8c36('0xc'),auth[_0x8c36('0x9')](),controller[_0x8c36('0x13')]);router[_0x8c36('0x12')](_0x8c36('0x14'),auth[_0x8c36('0x9')](),controller[_0x8c36('0x15')]);router[_0x8c36('0x12')]('/:id/reject',auth[_0x8c36('0x9')](),controller['reject']);router[_0x8c36('0x16')](_0x8c36('0xc'),auth[_0x8c36('0x9')](),controller[_0x8c36('0x17')]);module[_0x8c36('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 3e4cc8f..f789c2c 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 _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 +var _0xd7cf=['name','INTEGER','ENUM','roundrobin','STRING'];(function(_0x4bfd25,_0x1583a7){var _0x4c9547=function(_0x12473c){while(--_0x12473c){_0x4bfd25['push'](_0x4bfd25['shift']());}};_0x4c9547(++_0x1583a7);}(_0xd7cf,0x12b));var _0xfd7c=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0xd7cf[_0x1e6db3];return _0x1de886;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfd7c('0x0')],'unique':_0xfd7c('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xfd7c('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfd7c('0x3')]('rrmemory','beepall',_0xfd7c('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xfd7c('0x2')],'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 eb1837a..20453d5 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 _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 +var _0x8318=['request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./faxQueue.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','get','FaxQueues','destroy','error','name','send','map','FaxQueue','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','body','describe','getMembers','UserFaxQueue','FaxQueueId','User','agent','faxPause','updatedAt','createdAt','%s/%s','SIP','getTeams','findOne','Team','addTeams','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userFaxQueue:save','Agents','select','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','removeTeams','ids','isEmpty','userFaxQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','zip-dir','fast-json-patch'];(function(_0x59162a,_0x10e547){var _0x35e50d=function(_0x578425){while(--_0x578425){_0x59162a['push'](_0x59162a['shift']());}};_0x35e50d(++_0x10e547);}(_0x8318,0x1ae));var _0x8831=function(_0x22212d,_0x2b9a8b){_0x22212d=_0x22212d-0x0;var _0x2a63c4=_0x8318[_0x22212d];return _0x2a63c4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8831('0x0'));var jsonpatch=require(_0x8831('0x1'));var rp=require(_0x8831('0x2'));var moment=require(_0x8831('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8831('0x4'));var path=require(_0x8831('0x5'));var sox=require('sox');var csv=require(_0x8831('0x6'));var ejs=require(_0x8831('0x7'));var fs=require('fs');var fs_extra=require(_0x8831('0x8'));var _=require('lodash');var squel=require(_0x8831('0x9'));var crypto=require(_0x8831('0xa'));var jsforce=require(_0x8831('0xb'));var deskjs=require(_0x8831('0xc'));var toCsv=require(_0x8831('0x6'));var querystring=require(_0x8831('0xd'));var Papa=require('papaparse');var Redis=require(_0x8831('0xe'));var authService=require(_0x8831('0xf'));var qs=require(_0x8831('0x10'));var as=require(_0x8831('0x11'));var hardwareService=require(_0x8831('0x12'));var logger=require('../../config/logger')(_0x8831('0x13'));var utils=require(_0x8831('0x14'));var config=require(_0x8831('0x15'));var licenseUtil=require(_0x8831('0x16'));var db=require(_0x8831('0x17'))['db'];config['redis']=_[_0x8831('0x18')](config['redis'],{'host':_0x8831('0x19'),'port':0x18eb});var socket=require(_0x8831('0x1a'))(new Redis(config[_0x8831('0x1b')]));require(_0x8831('0x1c'))[_0x8831('0x1d')](socket);function respondWithStatusCode(_0x2a8f90,_0x4d021c){_0x4d021c=_0x4d021c||0xcc;return function(_0x2d0d8e){if(_0x2d0d8e){return _0x2a8f90[_0x8831('0x1e')](_0x4d021c);}return _0x2a8f90['status'](_0x4d021c)[_0x8831('0x1f')]();};}function respondWithResult(_0x4fcf19,_0x50154e){_0x50154e=_0x50154e||0xc8;return function(_0x4ab410){if(_0x4ab410){return _0x4fcf19[_0x8831('0x20')](_0x50154e)[_0x8831('0x21')](_0x4ab410);}};}function respondWithFilteredResult(_0x1bac27,_0x3a7983){return function(_0x39eff8){if(_0x39eff8){var _0x517aa1=typeof _0x3a7983[_0x8831('0x22')]==='undefined'&&typeof _0x3a7983[_0x8831('0x23')]===_0x8831('0x24');var _0x4197ef=_0x39eff8['count'];var _0x57085f=_0x517aa1?0x0:_0x3a7983[_0x8831('0x22')];var _0xaaf2a8=_0x517aa1?_0x39eff8[_0x8831('0x25')]:_0x3a7983[_0x8831('0x22')]+_0x3a7983[_0x8831('0x23')];var _0xea6283;if(_0xaaf2a8>=_0x4197ef){_0xaaf2a8=_0x4197ef;_0xea6283=0xc8;}else{_0xea6283=0xce;}_0x1bac27[_0x8831('0x20')](_0xea6283);return _0x1bac27[_0x8831('0x26')](_0x8831('0x27'),_0x57085f+'-'+_0xaaf2a8+'/'+_0x4197ef)[_0x8831('0x21')](_0x39eff8);}return null;};}function patchUpdates(_0x381fb3){return function(_0x320178){try{jsonpatch[_0x8831('0x28')](_0x320178,_0x381fb3,!![]);}catch(_0x22fd7f){return BPromise['reject'](_0x22fd7f);}return _0x320178[_0x8831('0x29')]();};}function saveUpdates(_0x46b5d0,_0x58a3a0){return function(_0x252598){if(_0x252598){return _0x252598[_0x8831('0x2a')](_0x46b5d0)[_0x8831('0x2b')](function(_0x5393a5){return _0x5393a5;});}return null;};}function removeEntity(_0x54d639,_0x1d3edd){return function(_0x5af92f){if(_0x5af92f){return _0x5af92f['destroy']()[_0x8831('0x2b')](function(){var _0xd24d4d=_0x5af92f[_0x8831('0x2c')]({'plain':!![]});var _0x2dbba9=_0x8831('0x2d');return db['UserProfileResource'][_0x8831('0x2e')]({'where':{'type':_0x2dbba9,'resourceId':_0xd24d4d['id']}})[_0x8831('0x2b')](function(){return _0x5af92f;});})[_0x8831('0x2b')](function(){_0x54d639[_0x8831('0x20')](0xcc)[_0x8831('0x1f')]();});}};}function handleEntityNotFound(_0x568b0b,_0x33dd8d){return function(_0x2ce9a6){if(!_0x2ce9a6){_0x568b0b['sendStatus'](0x194);}return _0x2ce9a6;};}function handleError(_0x91cdd1,_0x2bff56){_0x2bff56=_0x2bff56||0x1f4;return function(_0x4c9f72){logger[_0x8831('0x2f')](_0x4c9f72['stack']);if(_0x4c9f72[_0x8831('0x30')]){delete _0x4c9f72['name'];}_0x91cdd1[_0x8831('0x20')](_0x2bff56)[_0x8831('0x31')](_0x4c9f72);};}exports['index']=function(_0x39ff35,_0x541881){var _0x390384={},_0x27a36b={},_0x3f51a9={'count':0x0,'rows':[]};var _0x32bb9e=_[_0x8831('0x32')](db[_0x8831('0x33')][_0x8831('0x34')],function(_0x2eba00){return{'name':_0x2eba00['fieldName'],'type':_0x2eba00['type'][_0x8831('0x35')]};});_0x27a36b[_0x8831('0x36')]=_[_0x8831('0x32')](_0x32bb9e,_0x8831('0x30'));_0x27a36b['query']=_[_0x8831('0x37')](_0x39ff35[_0x8831('0x38')]);_0x27a36b[_0x8831('0x39')]=_[_0x8831('0x3a')](_0x27a36b[_0x8831('0x36')],_0x27a36b[_0x8831('0x38')]);_0x390384[_0x8831('0x3b')]=_[_0x8831('0x3a')](_0x27a36b[_0x8831('0x36')],qs[_0x8831('0x3c')](_0x39ff35[_0x8831('0x38')][_0x8831('0x3c')]));_0x390384[_0x8831('0x3b')]=_0x390384[_0x8831('0x3b')][_0x8831('0x3d')]?_0x390384[_0x8831('0x3b')]:_0x27a36b['model'];if(!_0x39ff35[_0x8831('0x38')][_0x8831('0x3e')](_0x8831('0x3f'))){_0x390384['limit']=qs[_0x8831('0x23')](_0x39ff35[_0x8831('0x38')][_0x8831('0x23')]);_0x390384[_0x8831('0x22')]=qs['offset'](_0x39ff35[_0x8831('0x38')][_0x8831('0x22')]);}_0x390384[_0x8831('0x40')]=qs[_0x8831('0x41')](_0x39ff35[_0x8831('0x38')][_0x8831('0x41')]);_0x390384[_0x8831('0x42')]=qs['filters'](_[_0x8831('0x43')](_0x39ff35[_0x8831('0x38')],_0x27a36b['filters']),_0x32bb9e);if(_0x39ff35['query'][_0x8831('0x44')]){_0x390384['where']=_[_0x8831('0x45')](_0x390384['where'],{'$or':_[_0x8831('0x32')](_0x32bb9e,function(_0x20b41f){if(_0x20b41f[_0x8831('0x46')]!==_0x8831('0x47')){var _0x1d4f25={};_0x1d4f25[_0x20b41f[_0x8831('0x30')]]={'$like':'%'+_0x39ff35[_0x8831('0x38')]['filter']+'%'};return _0x1d4f25;}})});}_0x390384=_[_0x8831('0x45')]({},_0x390384,_0x39ff35[_0x8831('0x48')]);var _0x2e11a4={'where':_0x390384[_0x8831('0x42')]};return db['FaxQueue'][_0x8831('0x25')](_0x2e11a4)[_0x8831('0x2b')](function(_0x1effcc){_0x3f51a9['count']=_0x1effcc;if(_0x39ff35['query'][_0x8831('0x49')]){_0x390384['include']=[{'all':!![]}];}return db[_0x8831('0x33')][_0x8831('0x4a')](_0x390384);})[_0x8831('0x2b')](function(_0x1a2f25){_0x3f51a9[_0x8831('0x4b')]=_0x1a2f25;return _0x3f51a9;})[_0x8831('0x2b')](respondWithFilteredResult(_0x541881,_0x390384))[_0x8831('0x4c')](handleError(_0x541881,null));};exports[_0x8831('0x4d')]=function(_0x57ee1a,_0x440b01){var _0xd1b4a0={'raw':!![],'where':{'id':_0x57ee1a[_0x8831('0x4e')]['id']}},_0xce69e6={};_0xce69e6[_0x8831('0x36')]=_[_0x8831('0x37')](db['FaxQueue'][_0x8831('0x34')]);_0xce69e6[_0x8831('0x38')]=_[_0x8831('0x37')](_0x57ee1a[_0x8831('0x38')]);_0xce69e6[_0x8831('0x39')]=_[_0x8831('0x3a')](_0xce69e6[_0x8831('0x36')],_0xce69e6['query']);_0xd1b4a0[_0x8831('0x3b')]=_['intersection'](_0xce69e6['model'],qs[_0x8831('0x3c')](_0x57ee1a['query'][_0x8831('0x3c')]));_0xd1b4a0['attributes']=_0xd1b4a0[_0x8831('0x3b')][_0x8831('0x3d')]?_0xd1b4a0[_0x8831('0x3b')]:_0xce69e6[_0x8831('0x36')];if(_0x57ee1a[_0x8831('0x38')][_0x8831('0x49')]){_0xd1b4a0[_0x8831('0x4f')]=[{'all':!![]}];}_0xd1b4a0=_['merge']({},_0xd1b4a0,_0x57ee1a[_0x8831('0x48')]);return db['FaxQueue']['find'](_0xd1b4a0)['then'](handleEntityNotFound(_0x440b01,null))[_0x8831('0x2b')](respondWithResult(_0x440b01,null))[_0x8831('0x4c')](handleError(_0x440b01,null));};exports['create']=function(_0x412fd5,_0x4ffa2f){return db['FaxQueue'][_0x8831('0x50')](_0x412fd5['body'],{})[_0x8831('0x2b')](function(_0x267d03){var _0x335984=_0x412fd5[_0x8831('0x51')]['get']({'plain':!![]});if(!_0x335984)throw new Error(_0x8831('0x52'));if(_0x335984[_0x8831('0x53')]===_0x8831('0x51')){var _0x46f0ca=_0x267d03[_0x8831('0x2c')]({'plain':!![]});var _0x14672f=_0x8831('0x2d');return db[_0x8831('0x54')][_0x8831('0x55')]({'where':{'name':_0x14672f,'userProfileId':_0x335984[_0x8831('0x56')]},'raw':!![]})['then'](function(_0x202c38){if(_0x202c38&&_0x202c38[_0x8831('0x57')]===0x0){return db[_0x8831('0x58')][_0x8831('0x50')]({'name':_0x46f0ca[_0x8831('0x30')],'resourceId':_0x46f0ca['id'],'type':_0x202c38['name'],'sectionId':_0x202c38['id']},{})['then'](function(){return _0x267d03;});}else{return _0x267d03;}})[_0x8831('0x4c')](function(_0x777305){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x777305);throw _0x777305;});}return _0x267d03;})[_0x8831('0x2b')](respondWithResult(_0x4ffa2f,0xc9))[_0x8831('0x4c')](handleError(_0x4ffa2f,null));};exports[_0x8831('0x2a')]=function(_0x83f583,_0xbe6ddf){if(_0x83f583['body']['id']){delete _0x83f583[_0x8831('0x59')]['id'];}return db['FaxQueue'][_0x8831('0x55')]({'where':{'id':_0x83f583[_0x8831('0x4e')]['id']}})[_0x8831('0x2b')](handleEntityNotFound(_0xbe6ddf,null))['then'](saveUpdates(_0x83f583['body'],null))[_0x8831('0x2b')](respondWithResult(_0xbe6ddf,null))[_0x8831('0x4c')](handleError(_0xbe6ddf,null));};exports[_0x8831('0x2e')]=function(_0x51c77b,_0x4f3dfd){return db['FaxQueue'][_0x8831('0x55')]({'where':{'id':_0x51c77b[_0x8831('0x4e')]['id']}})[_0x8831('0x2b')](handleEntityNotFound(_0x4f3dfd,null))[_0x8831('0x2b')](removeEntity(_0x4f3dfd,null))['catch'](handleError(_0x4f3dfd,null));};exports[_0x8831('0x5a')]=function(_0xab6bb7,_0x56060e){return db['FaxQueue'][_0x8831('0x5a')]()['then'](respondWithResult(_0x56060e,null))[_0x8831('0x4c')](handleError(_0x56060e,null));};exports[_0x8831('0x5b')]=function(_0xb4c020,_0x57e8ec,_0x182c9e){var _0xc3a4b4={'raw':!![],'where':{}},_0x366de0={},_0x2d6438;return db['FaxQueue']['findOne']({'where':{'id':_0xb4c020[_0x8831('0x4e')]['id']}})['then'](handleEntityNotFound(_0x57e8ec,null))[_0x8831('0x2b')](function(_0x441794){if(_0x441794){_0x2d6438=_0x441794[_0x8831('0x2c')]({'plain':!![]});_0x366de0['model']=_[_0x8831('0x37')](db[_0x8831('0x5c')][_0x8831('0x34')]);_0x366de0['query']=_[_0x8831('0x37')](_0xb4c020[_0x8831('0x38')]);_0x366de0[_0x8831('0x39')]=_['intersection'](_0x366de0[_0x8831('0x36')],_0x366de0[_0x8831('0x38')]);_0xc3a4b4[_0x8831('0x3b')]=_['intersection'](_0x366de0[_0x8831('0x36')],qs[_0x8831('0x3c')](_0xb4c020[_0x8831('0x38')][_0x8831('0x3c')]));_0xc3a4b4['attributes']=_0xc3a4b4[_0x8831('0x3b')]['length']?_0xc3a4b4['attributes']:_0x366de0['model'];if(!_0xb4c020['query']['hasOwnProperty'](_0x8831('0x3f'))){_0xc3a4b4[_0x8831('0x23')]=qs[_0x8831('0x23')](_0xb4c020['query'][_0x8831('0x23')]);_0xc3a4b4[_0x8831('0x22')]=qs[_0x8831('0x22')](_0xb4c020['query'][_0x8831('0x22')]);}_0xc3a4b4['order']=qs[_0x8831('0x41')](_0xb4c020['query'][_0x8831('0x41')]);_0xc3a4b4['where']=qs[_0x8831('0x39')](_[_0x8831('0x43')](_0xb4c020[_0x8831('0x38')],_0x366de0['filters']));_0xc3a4b4[_0x8831('0x42')][_0x8831('0x5d')]=_0x441794['id'];if(_0xb4c020[_0x8831('0x38')][_0x8831('0x44')]){_0xc3a4b4['where']=_[_0x8831('0x45')](_0xc3a4b4['where'],{'$or':_[_0x8831('0x32')](_0xc3a4b4[_0x8831('0x3b')],function(_0x12a50f){var _0x22b451={};_0x22b451[_0x12a50f]={'$like':'%'+_0xb4c020[_0x8831('0x38')][_0x8831('0x44')]+'%'};return _0x22b451;})});}_0xc3a4b4=_['merge']({},_0xc3a4b4,_0xb4c020[_0x8831('0x48')]);return db[_0x8831('0x5c')]['findAll'](_0xc3a4b4);}})[_0x8831('0x2b')](function(_0xca24af){if(_0xca24af){return db[_0x8831('0x5e')]['findAndCountAll']({'where':{'id':_[_0x8831('0x32')](_0xca24af,'UserId'),'role':_0x8831('0x5f')},'attributes':['id',_0x8831('0x30'),_0x8831('0x60'),_0x8831('0x61'),_0x8831('0x62')]});}})[_0x8831('0x2b')](function(_0x1d0958){if(_0x1d0958){return{'count':_0x1d0958[_0x8831('0x25')],'rows':_[_0x8831('0x32')](_0x1d0958[_0x8831('0x4b')],function(_0x577ba3){return{'membername':_0x577ba3[_0x8831('0x30')],'UserId':_0x577ba3['id'],'queue_name':_0x2d6438['name'],'FaxQueueId':_0x2d6438['id'],'interface':util['format'](_0x8831('0x63'),_0x8831('0x64'),_0x577ba3[_0x8831('0x30')]),'penalty':0x0,'paused':_0x577ba3[_0x8831('0x60')],'createdAt':_0x577ba3['createdAt'],'updatedAt':_0x577ba3[_0x8831('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x57e8ec,_0xc3a4b4))['catch'](handleError(_0x57e8ec,null));};exports[_0x8831('0x65')]=function(_0x4230ea,_0x28ea85,_0x3bb3ce){var _0x38eaa4={};var _0x20eb1d={};var _0x1e6a73;var _0x33146c;return db[_0x8831('0x33')][_0x8831('0x66')]({'where':{'id':_0x4230ea[_0x8831('0x4e')]['id']}})[_0x8831('0x2b')](handleEntityNotFound(_0x28ea85,null))[_0x8831('0x2b')](function(_0x39c815){if(_0x39c815){_0x1e6a73=_0x39c815;_0x20eb1d[_0x8831('0x36')]=_[_0x8831('0x37')](db[_0x8831('0x67')][_0x8831('0x34')]);_0x20eb1d[_0x8831('0x38')]=_[_0x8831('0x37')](_0x4230ea[_0x8831('0x38')]);_0x20eb1d[_0x8831('0x39')]=_[_0x8831('0x3a')](_0x20eb1d['model'],_0x20eb1d['query']);_0x38eaa4[_0x8831('0x3b')]=_[_0x8831('0x3a')](_0x20eb1d[_0x8831('0x36')],qs['fields'](_0x4230ea[_0x8831('0x38')][_0x8831('0x3c')]));_0x38eaa4[_0x8831('0x3b')]=_0x38eaa4[_0x8831('0x3b')][_0x8831('0x3d')]?_0x38eaa4['attributes']:_0x20eb1d[_0x8831('0x36')];_0x38eaa4['order']=qs['sort'](_0x4230ea[_0x8831('0x38')][_0x8831('0x41')]);_0x38eaa4['where']=qs[_0x8831('0x39')](_[_0x8831('0x43')](_0x4230ea['query'],_0x20eb1d[_0x8831('0x39')]));if(_0x4230ea[_0x8831('0x38')][_0x8831('0x44')]){_0x38eaa4['where']=_[_0x8831('0x45')](_0x38eaa4[_0x8831('0x42')],{'$or':_[_0x8831('0x32')](_0x38eaa4[_0x8831('0x3b')],function(_0x251bb1){var _0x4ff22a={};_0x4ff22a[_0x251bb1]={'$like':'%'+_0x4230ea['query'][_0x8831('0x44')]+'%'};return _0x4ff22a;})});}_0x38eaa4=_[_0x8831('0x45')]({},_0x38eaa4,_0x4230ea[_0x8831('0x48')]);return _0x1e6a73[_0x8831('0x65')](_0x38eaa4);}})[_0x8831('0x2b')](function(_0x2da382){if(_0x2da382){_0x33146c=_0x2da382[_0x8831('0x3d')];if(!_0x4230ea[_0x8831('0x38')]['hasOwnProperty'](_0x8831('0x3f'))){_0x38eaa4[_0x8831('0x23')]=qs[_0x8831('0x23')](_0x4230ea[_0x8831('0x38')]['limit']);_0x38eaa4['offset']=qs[_0x8831('0x22')](_0x4230ea[_0x8831('0x38')]['offset']);}return _0x1e6a73[_0x8831('0x65')](_0x38eaa4);}})[_0x8831('0x2b')](function(_0x212b5f){if(_0x212b5f){return _0x212b5f?{'count':_0x33146c,'rows':_0x212b5f}:null;}})[_0x8831('0x2b')](respondWithResult(_0x28ea85,null))[_0x8831('0x4c')](handleError(_0x28ea85,null));};exports[_0x8831('0x68')]=function(_0x33b2bc,_0xb95491,_0x3c6d5d){var _0x330ec4=_0x33b2bc[_0x8831('0x59')]['ids'];return db[_0x8831('0x67')][_0x8831('0x4a')]({'where':{'id':_0x330ec4},'attributes':['id'],'include':[{'model':db[_0x8831('0x5e')],'as':'Agents','attributes':['id','name',_0x8831('0x69'),_0x8831('0x6a'),_0x8831('0x6b')],'raw':!![]}]})['then'](function(_0x39d348){if(_0x39d348){var _0x332f54=_[_0x8831('0x6c')](_0x39d348,function(_0xd00311){var _0x121e33=_0xd00311[_0x8831('0x2c')]({'plain':!![]});return _0x121e33['Agents'];});return db[_0x8831('0x33')][_0x8831('0x55')]({'where':{'id':_0x33b2bc[_0x8831('0x4e')]['id']}})[_0x8831('0x2b')](function(_0x1b3c24){return db[_0x8831('0x6d')][_0x8831('0x6e')](function(_0x54e21d){return _0x1b3c24[_0x8831('0x68')](_0x330ec4,{'transaction':_0x54e21d})['then'](function(){return BPromise['each'](_0x332f54,function(_0x4ebed6){return db[_0x8831('0x5c')][_0x8831('0x6f')]({'where':{'UserId':_0x4ebed6['id'],'FaxQueueId':_0x33b2bc['params']['id']},'transaction':_0x54e21d});});})['then'](function(){_0x332f54[_0x8831('0x70')](function(_0x9f744d){socket[_0x8831('0x71')](_0x8831('0x72'),{'UserId':_0x9f744d['id'],'FaxQueueId':_0x1b3c24['id']});});});});});}})[_0x8831('0x2b')](respondWithStatusCode(_0xb95491,null))['catch'](handleError(_0xb95491,null));};exports['removeTeams']=function(_0x6559a1,_0x1fa00a,_0x23854d){return db[_0x8831('0x67')][_0x8831('0x4a')]({'where':{'id':_0x6559a1[_0x8831('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8831('0x5e')],'as':_0x8831('0x73'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1fa00a,null))[_0x8831('0x2b')](function(_0x4228ec){var _0x4ffe78=_[_0x8831('0x32')](_0x4228ec,'id');var _0xc10608=[];var _0x3b4489=[];var _0x11d5a=squel[_0x8831('0x74')]();_0x11d5a['field'](_0x8831('0x75'))[_0x8831('0x76')](_0x8831('0x77'),'tq')[_0x8831('0x78')](_0x8831('0x79'),'ut',_0x8831('0x7a'))[_0x8831('0x42')]('FaxQueueId\x20=\x20?',_0x6559a1[_0x8831('0x4e')]['id']);for(var _0xf592fc=0x0;_0xf592fc<_0x4228ec['length'];_0xf592fc+=0x1){let _0x36a4f3=_0x4228ec[_0xf592fc];for(var _0x5aed22=0x0;_0x5aed22<_0x36a4f3['Agents']['length'];_0x5aed22+=0x1){let _0x1a867c=_0x36a4f3['Agents'][_0x5aed22];var _0x33dc02=_0x11d5a[_0x8831('0x7b')]();_0x33dc02[_0x8831('0x42')](_0x8831('0x7c'),_0x1a867c['id']);_0x3b4489[_0x8831('0x7d')](db[_0x8831('0x6d')][_0x8831('0x38')](_0x33dc02[_0x8831('0x7e')](),{'type':db[_0x8831('0x6d')][_0x8831('0x7f')][_0x8831('0x80')]})[_0x8831('0x2b')](function(_0x451058){if(_0x451058[_0x8831('0x3d')]===0x1){return _0x1a867c['id'];}else{var _0x52cd6e=_[_0x8831('0x81')](_[_0x8831('0x32')](_0x451058,'TeamId'),function(_0xbe588c){return _[_0x8831('0x82')](_0x4ffe78,_0xbe588c);});if(_0x52cd6e){return _0x1a867c['id'];}}}));}}return BPromise[_0x8831('0x83')](_0x3b4489)[_0x8831('0x2b')](function(_0x3e4d06){_0xc10608=_(_0xc10608)[_0x8831('0x84')](_0x3e4d06)[_0x8831('0x85')]()[_0x8831('0x86')]();return db['FaxQueue'][_0x8831('0x55')]({'where':{'id':_0x6559a1[_0x8831('0x4e')]['id']}})[_0x8831('0x2b')](function(_0x4ae8f8){return db['sequelize'][_0x8831('0x6e')](function(_0x2724a9){return _0x4ae8f8[_0x8831('0x87')](_0x6559a1[_0x8831('0x38')][_0x8831('0x88')],{'transaction':_0x2724a9})[_0x8831('0x2b')](function(){if(!_[_0x8831('0x89')](_0xc10608)){return _0x4ae8f8['removeAgents'](_0xc10608,{'transaction':_0x2724a9});}})[_0x8831('0x2b')](function(){_0xc10608[_0x8831('0x70')](function(_0x1cf737){socket[_0x8831('0x71')](_0x8831('0x8a'),{'UserId':_0x1cf737,'FaxQueueId':_0x4ae8f8['id']});});});});});});})[_0x8831('0x2b')](respondWithStatusCode(_0x1fa00a,null))[_0x8831('0x4c')](handleError(_0x1fa00a,null));};exports[_0x8831('0x8b')]=function(_0x9c36a7,_0x38f001,_0x1cec78){return db[_0x8831('0x33')]['find']({'where':{'id':_0x9c36a7[_0x8831('0x4e')]['id']}})[_0x8831('0x2b')](handleEntityNotFound(_0x38f001,null))[_0x8831('0x2b')](function(_0x5f4129){if(_0x5f4129){return _0x5f4129[_0x8831('0x8b')](_0x9c36a7[_0x8831('0x59')]['ids'],_['omit'](_0x9c36a7[_0x8831('0x59')],['ids','id'])||{})[_0x8831('0x8c')](function(_0x43f62c){for(var _0x436fd1=0x0;_0x436fd1<_0x9c36a7[_0x8831('0x59')]['ids'][_0x8831('0x3d')];_0x436fd1+=0x1){socket[_0x8831('0x71')]('userFaxQueue:save',{'UserId':Number(_0x9c36a7['body']['ids'][_0x436fd1]),'FaxQueueId':Number(_0x9c36a7[_0x8831('0x4e')]['id'])});}return _0x43f62c;});}})[_0x8831('0x2b')](respondWithResult(_0x38f001,null))[_0x8831('0x4c')](handleError(_0x38f001,null));};exports[_0x8831('0x8d')]=function(_0x5cd189,_0x3fd6d4,_0x1669a9){return db[_0x8831('0x33')]['find']({'where':{'id':_0x5cd189[_0x8831('0x4e')]['id']}})[_0x8831('0x2b')](handleEntityNotFound(_0x3fd6d4,null))['then'](function(_0x3b99db){if(_0x3b99db){return _0x3b99db[_0x8831('0x8d')](_0x5cd189[_0x8831('0x38')][_0x8831('0x88')])[_0x8831('0x2b')](function(){if(_[_0x8831('0x8e')](_0x5cd189[_0x8831('0x38')][_0x8831('0x88')])){for(var _0xd86f85=0x0;_0xd86f85<_0x5cd189['query']['ids'][_0x8831('0x3d')];_0xd86f85+=0x1){socket[_0x8831('0x71')](_0x8831('0x8a'),{'UserId':Number(_0x5cd189['query'][_0x8831('0x88')][_0xd86f85]),'FaxQueueId':Number(_0x5cd189[_0x8831('0x4e')]['id'])});}}else{socket[_0x8831('0x71')](_0x8831('0x8a'),{'UserId':Number(_0x5cd189['query']['ids']),'FaxQueueId':Number(_0x5cd189[_0x8831('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x3fd6d4,null))[_0x8831('0x4c')](handleError(_0x3fd6d4,null));};exports[_0x8831('0x8f')]=function(_0x18a262,_0x1222c3,_0x376efb){var _0x2e0e8a={};var _0x51d6b1={};var _0x6fe23b;var _0x167c73;return db[_0x8831('0x33')][_0x8831('0x66')]({'where':{'id':_0x18a262['params']['id']}})[_0x8831('0x2b')](handleEntityNotFound(_0x1222c3,null))[_0x8831('0x2b')](function(_0x3e0d85){if(_0x3e0d85){_0x6fe23b=_0x3e0d85;_0x51d6b1[_0x8831('0x36')]=_[_0x8831('0x37')](db['User']['rawAttributes']);_0x51d6b1[_0x8831('0x38')]=_[_0x8831('0x37')](_0x18a262[_0x8831('0x38')]);_0x51d6b1[_0x8831('0x39')]=_[_0x8831('0x3a')](_0x51d6b1[_0x8831('0x36')],_0x51d6b1['query']);_0x2e0e8a[_0x8831('0x3b')]=_[_0x8831('0x3a')](_0x51d6b1[_0x8831('0x36')],qs[_0x8831('0x3c')](_0x18a262[_0x8831('0x38')][_0x8831('0x3c')]));_0x2e0e8a[_0x8831('0x3b')]=_0x2e0e8a[_0x8831('0x3b')][_0x8831('0x3d')]?_0x2e0e8a[_0x8831('0x3b')]:_0x51d6b1[_0x8831('0x36')];_0x2e0e8a[_0x8831('0x40')]=qs[_0x8831('0x41')](_0x18a262[_0x8831('0x38')][_0x8831('0x41')]);_0x2e0e8a['where']=qs[_0x8831('0x39')](_[_0x8831('0x43')](_0x18a262[_0x8831('0x38')],_0x51d6b1[_0x8831('0x39')]));if(_0x18a262[_0x8831('0x38')][_0x8831('0x44')]){_0x2e0e8a['where']=_[_0x8831('0x45')](_0x2e0e8a[_0x8831('0x42')],{'$or':_[_0x8831('0x32')](_0x2e0e8a[_0x8831('0x3b')],function(_0x299254){var _0x38277e={};_0x38277e[_0x299254]={'$like':'%'+_0x18a262[_0x8831('0x38')][_0x8831('0x44')]+'%'};return _0x38277e;})});}_0x2e0e8a=_['merge']({},_0x2e0e8a,_0x18a262[_0x8831('0x48')]);return _0x6fe23b[_0x8831('0x8f')](_0x2e0e8a);}})[_0x8831('0x2b')](function(_0x34676e){if(_0x34676e){_0x167c73=_0x34676e[_0x8831('0x3d')];if(!_0x18a262[_0x8831('0x38')][_0x8831('0x3e')](_0x8831('0x3f'))){_0x2e0e8a[_0x8831('0x23')]=qs[_0x8831('0x23')](_0x18a262[_0x8831('0x38')][_0x8831('0x23')]);_0x2e0e8a['offset']=qs[_0x8831('0x22')](_0x18a262['query']['offset']);}return _0x6fe23b['getAgents'](_0x2e0e8a);}})[_0x8831('0x2b')](function(_0x22cfbc){if(_0x22cfbc){return _0x22cfbc?{'count':_0x167c73,'rows':_0x22cfbc}:null;}})[_0x8831('0x2b')](respondWithResult(_0x1222c3,null))['catch'](handleError(_0x1222c3,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index b283487..98010e9 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 _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 +var _0x2066=['../../mysqldb','FaxQueue','setMaxListeners','save','remove','hasOwnProperty','exports'];(function(_0x1ab180,_0x382b2c){var _0xfb2c2d=function(_0x1c5fd3){while(--_0x1c5fd3){_0x1ab180['push'](_0x1ab180['shift']());}};_0xfb2c2d(++_0x382b2c);}(_0x2066,0x142));var _0x6206=function(_0x2c58e9,_0x1ec24e){_0x2c58e9=_0x2c58e9-0x0;var _0x148b0e=_0x2066[_0x2c58e9];return _0x148b0e;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x6206('0x0'))['db'][_0x6206('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x6206('0x2')](0x0);var events={'afterCreate':_0x6206('0x3'),'afterUpdate':'update','afterDestroy':_0x6206('0x4')};function emitEvent(_0x2288cd){return function(_0x45195a,_0x13884c,_0x3c7455){FaxQueueEvents['emit'](_0x2288cd+':'+_0x45195a['id'],_0x45195a);FaxQueueEvents['emit'](_0x2288cd,_0x45195a);_0x3c7455(null);};}for(var e in events){if(events[_0x6206('0x5')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x6206('0x6')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index e2960c6..6816e6a 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 _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 +var _0x5074=['./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1a3f30,_0x5e09e8){var _0x129b0c=function(_0x3ab042){while(--_0x3ab042){_0x1a3f30['push'](_0x1a3f30['shift']());}};_0x129b0c(++_0x5e09e8);}(_0x5074,0x1a5));var _0x4507=function(_0x291d3f,_0x3ef99f){_0x291d3f=_0x291d3f-0x0;var _0x242080=_0x5074[_0x291d3f];return _0x242080;};'use strict';var _=require(_0x4507('0x0'));var util=require(_0x4507('0x1'));var logger=require('../../config/logger')(_0x4507('0x2'));var moment=require(_0x4507('0x3'));var BPromise=require(_0x4507('0x4'));var rp=require(_0x4507('0x5'));var fs=require('fs');var path=require(_0x4507('0x6'));var rimraf=require('rimraf');var config=require(_0x4507('0x7'));var attributes=require(_0x4507('0x8'));module[_0x4507('0x9')]=function(_0x4b20e8,_0x4297b5){return _0x4b20e8[_0x4507('0xa')](_0x4507('0xb'),attributes,{'tableName':_0x4507('0xc'),'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 4b38d34..4ef5c8a 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 _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 +var _0x38da=['../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','info','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxQueue,\x20%s,\x20%s','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','find','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x133296,_0xe8ff9a){var _0x193517=function(_0x161ffd){while(--_0x161ffd){_0x133296['push'](_0x133296['shift']());}};_0x193517(++_0xe8ff9a);}(_0x38da,0x1c6));var _0xa38d=function(_0x5958d2,_0x550300){_0x5958d2=_0x5958d2-0x0;var _0x2a4809=_0x38da[_0x5958d2];return _0x2a4809;};'use strict';var _=require(_0xa38d('0x0'));var util=require(_0xa38d('0x1'));var moment=require(_0xa38d('0x2'));var BPromise=require(_0xa38d('0x3'));var rs=require(_0xa38d('0x4'));var fs=require('fs');var Redis=require(_0xa38d('0x5'));var db=require(_0xa38d('0x6'))['db'];var utils=require(_0xa38d('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xa38d('0x8'));var jayson=require(_0xa38d('0x9'));var client=jayson['client'][_0xa38d('0xa')]({'port':0x232a});config[_0xa38d('0xb')]=_[_0xa38d('0xc')](config[_0xa38d('0xb')],{'host':_0xa38d('0xd'),'port':0x18eb});var socket=require(_0xa38d('0xe'))(new Redis(config['redis']));require(_0xa38d('0xf'))[_0xa38d('0x10')](socket);function respondWithRpcPromise(_0x3d9cd8,_0x529a64,_0x3c3e15){return new BPromise(function(_0x20d6ad,_0xda2666){return client[_0xa38d('0x11')](_0x3d9cd8,_0x3c3e15)['then'](function(_0x199f1e){logger[_0xa38d('0x12')]('FaxQueue,\x20%s,\x20%s',_0x529a64,'request\x20sent');logger[_0xa38d('0x13')](_0xa38d('0x14'),_0x529a64,'request\x20sent',JSON[_0xa38d('0x15')](_0x199f1e));if(_0x199f1e['error']){if(_0x199f1e[_0xa38d('0x16')][_0xa38d('0x17')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x529a64,_0x199f1e[_0xa38d('0x16')][_0xa38d('0x18')]);return _0xda2666(_0x199f1e['error']['message']);}logger[_0xa38d('0x16')](_0xa38d('0x19'),_0x529a64,_0x199f1e[_0xa38d('0x16')][_0xa38d('0x18')]);return _0x20d6ad(_0x199f1e[_0xa38d('0x16')]['message']);}else{logger[_0xa38d('0x12')](_0xa38d('0x19'),_0x529a64,'request\x20sent');_0x20d6ad(_0x199f1e[_0xa38d('0x1a')][_0xa38d('0x18')]);}})[_0xa38d('0x1b')](function(_0xeb147e){logger['error'](_0xa38d('0x19'),_0x529a64,_0xeb147e);_0xda2666(_0xeb147e);});});}exports[_0xa38d('0x1c')]=function(_0x158ab8){var _0x448f04=this;return new Promise(function(_0x32ab3b,_0x2e549a){return db[_0xa38d('0x1d')][_0xa38d('0x1e')]({'raw':_0x158ab8[_0xa38d('0x1f')]?_0x158ab8[_0xa38d('0x1f')][_0xa38d('0x20')]===undefined?!![]:![]:!![],'where':_0x158ab8[_0xa38d('0x1f')]?_0x158ab8[_0xa38d('0x1f')][_0xa38d('0x21')]||null:null,'attributes':_0x158ab8[_0xa38d('0x1f')]?_0x158ab8['options'][_0xa38d('0x22')]||null:null,'limit':_0x158ab8[_0xa38d('0x1f')]?_0x158ab8[_0xa38d('0x1f')][_0xa38d('0x23')]||null:null,'include':_0x158ab8[_0xa38d('0x1f')]?_0x158ab8[_0xa38d('0x1f')][_0xa38d('0x24')]?_[_0xa38d('0x25')](_0x158ab8['options'][_0xa38d('0x24')],function(_0x3661de){return{'model':db[_0x3661de[_0xa38d('0x26')]],'as':_0x3661de['as'],'attributes':_0x3661de[_0xa38d('0x22')],'include':_0x3661de['include']?_[_0xa38d('0x25')](_0x3661de[_0xa38d('0x24')],function(_0x506e9a){return{'model':db[_0x506e9a[_0xa38d('0x26')]],'as':_0x506e9a['as'],'attributes':_0x506e9a[_0xa38d('0x22')],'include':_0x506e9a[_0xa38d('0x24')]?_[_0xa38d('0x25')](_0x506e9a['include'],function(_0x242eaf){return{'model':db[_0x242eaf[_0xa38d('0x26')]],'as':_0x242eaf['as'],'attributes':_0x242eaf[_0xa38d('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa38d('0x27')](function(_0x4aa883){logger['info'](_0xa38d('0x1c'),_0x158ab8);logger['debug'](_0xa38d('0x1c'),_0x158ab8,JSON[_0xa38d('0x15')](_0x4aa883));_0x32ab3b(_0x4aa883);})[_0xa38d('0x1b')](function(_0x428c25){logger['error'](_0xa38d('0x1c'),_0x428c25[_0xa38d('0x18')],_0x158ab8);_0x2e549a(_0x448f04[_0xa38d('0x16')](0x1f4,_0x428c25[_0xa38d('0x18')]));});});};exports['ShowFaxQueue']=function(_0x3d2d6a){var _0x3bbbaa=this;return new Promise(function(_0x22c34d,_0x7ea2ae){return db[_0xa38d('0x1d')][_0xa38d('0x28')]({'raw':_0x3d2d6a[_0xa38d('0x1f')]?_0x3d2d6a[_0xa38d('0x1f')][_0xa38d('0x20')]===undefined?!![]:![]:!![],'where':_0x3d2d6a[_0xa38d('0x1f')]?_0x3d2d6a[_0xa38d('0x1f')][_0xa38d('0x21')]||null:null,'attributes':_0x3d2d6a[_0xa38d('0x1f')]?_0x3d2d6a[_0xa38d('0x1f')]['attributes']||null:null,'include':_0x3d2d6a['options']?_0x3d2d6a[_0xa38d('0x1f')][_0xa38d('0x24')]?_[_0xa38d('0x25')](_0x3d2d6a[_0xa38d('0x1f')]['include'],function(_0x4237d0){return{'model':db[_0x4237d0['model']],'as':_0x4237d0['as'],'attributes':_0x4237d0[_0xa38d('0x22')],'include':_0x4237d0[_0xa38d('0x24')]?_[_0xa38d('0x25')](_0x4237d0[_0xa38d('0x24')],function(_0x3800b6){return{'model':db[_0x3800b6[_0xa38d('0x26')]],'as':_0x3800b6['as'],'attributes':_0x3800b6[_0xa38d('0x22')],'include':_0x3800b6[_0xa38d('0x24')]?_[_0xa38d('0x25')](_0x3800b6[_0xa38d('0x24')],function(_0x7078a5){return{'model':db[_0x7078a5[_0xa38d('0x26')]],'as':_0x7078a5['as'],'attributes':_0x7078a5['attributes']};}):[]};}):[]};}):[]:[]})[_0xa38d('0x27')](function(_0x1ab1cc){logger[_0xa38d('0x12')](_0xa38d('0x29'),_0x3d2d6a);logger[_0xa38d('0x13')](_0xa38d('0x29'),_0x3d2d6a,JSON['stringify'](_0x1ab1cc));_0x22c34d(_0x1ab1cc);})[_0xa38d('0x1b')](function(_0x5d61a2){logger[_0xa38d('0x16')](_0xa38d('0x29'),_0x5d61a2[_0xa38d('0x18')],_0x3d2d6a);_0x7ea2ae(_0x3bbbaa['error'](0x1f4,_0x5d61a2['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 650cb9e..106282a 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 _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 +var _0xe107=['remove','update','removeListener','register','length','./faxQueue.events'];(function(_0xf2acd5,_0x1c4cc0){var _0x2ae8b9=function(_0x105a26){while(--_0x105a26){_0xf2acd5['push'](_0xf2acd5['shift']());}};_0x2ae8b9(++_0x1c4cc0);}(_0xe107,0xb3));var _0x7e10=function(_0x24fd0e,_0x4a3b07){_0x24fd0e=_0x24fd0e-0x0;var _0x4ddc9d=_0xe107[_0x24fd0e];return _0x4ddc9d;};'use strict';var FaxQueueEvents=require(_0x7e10('0x0'));var events=['save',_0x7e10('0x1'),_0x7e10('0x2')];function createListener(_0x2871b0,_0x570b2a){return function(_0x31212d){_0x570b2a['emit'](_0x2871b0,_0x31212d);};}function removeListener(_0x4db676,_0x2bdf3c){return function(){FaxQueueEvents[_0x7e10('0x3')](_0x4db676,_0x2bdf3c);};}exports[_0x7e10('0x4')]=function(_0x5be19f){for(var _0x5f1edf=0x0,_0x1dd3de=events[_0x7e10('0x5')];_0x5f1edf<_0x1dd3de;_0x5f1edf++){var _0x156c56=events[_0x5f1edf];var _0x3413f7=createListener('faxQueue:'+_0x156c56,_0x5be19f);FaxQueueEvents['on'](_0x156c56,_0x3413f7);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 2cb7b7a..3deb462 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 _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 +var _0x8aad=['removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','isAuthenticated','index','get','describe','/:id','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','/:id/teams','removeTeams'];(function(_0x27051e,_0x533102){var _0xb0765b=function(_0xed0d82){while(--_0xed0d82){_0x27051e['push'](_0x27051e['shift']());}};_0xb0765b(++_0x533102);}(_0x8aad,0x146));var _0xd8aa=function(_0x400efe,_0x33b028){_0x400efe=_0x400efe-0x0;var _0x60b7d1=_0x8aad[_0x400efe];return _0x60b7d1;};'use strict';var multer=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var path=require('path');var timeout=require(_0xd8aa('0x2'));var express=require('express');var router=express[_0xd8aa('0x3')]();var fs_extra=require(_0xd8aa('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd8aa('0x5'));var controller=require('./faxQueue.controller');router['get']('/',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x7')]);router[_0xd8aa('0x8')]('/describe',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x9')]);router[_0xd8aa('0x8')](_0xd8aa('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd8aa('0x8')](_0xd8aa('0xb'),auth[_0xd8aa('0x6')](),controller[_0xd8aa('0xc')]);router[_0xd8aa('0x8')]('/:id/teams',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0xd')]);router[_0xd8aa('0x8')](_0xd8aa('0xe'),auth[_0xd8aa('0x6')](),controller[_0xd8aa('0xf')]);router[_0xd8aa('0x10')]('/',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x11')]);router[_0xd8aa('0x10')]('/:id/teams',auth['isAuthenticated'](),controller[_0xd8aa('0x12')]);router[_0xd8aa('0x10')](_0xd8aa('0xe'),auth['isAuthenticated'](),controller[_0xd8aa('0x13')]);router[_0xd8aa('0x14')](_0xd8aa('0xa'),auth[_0xd8aa('0x6')](),controller['update']);router[_0xd8aa('0x15')](_0xd8aa('0xa'),auth['isAuthenticated'](),controller[_0xd8aa('0x16')]);router[_0xd8aa('0x15')](_0xd8aa('0x17'),auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x18')]);router['delete'](_0xd8aa('0xe'),auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x19')]);module[_0xd8aa('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 063db95..a9042f3 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 _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 +var _0xc418=['STRING','DATE','moment','sequelize','exports'];(function(_0x24edd4,_0x5e1a30){var _0x291119=function(_0x41065a){while(--_0x41065a){_0x24edd4['push'](_0x24edd4['shift']());}};_0x291119(++_0x5e1a30);}(_0xc418,0xd9));var _0x8c41=function(_0x4a513d,_0x4d7fd2){_0x4a513d=_0x4a513d-0x0;var _0xea3311=_0xc418[_0x4a513d];return _0xea3311;};'use strict';var moment=require(_0x8c41('0x0'));var Sequelize=require(_0x8c41('0x1'));module[_0x8c41('0x2')]={'uniqueid':{'type':Sequelize[_0x8c41('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x8c41('0x3')]},'joinAt':{'type':Sequelize[_0x8c41('0x4')]},'leaveAt':{'type':Sequelize[_0x8c41('0x4')]},'acceptAt':{'type':Sequelize[_0x8c41('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x8c41('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index e253f69..71c3ff7 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 _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 +var _0xc73e=['error','stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc73e,0x1e9));var _0xec73=function(_0x18eb3d,_0x56dce7){_0x18eb3d=_0x18eb3d-0x0;var _0x4d87f2=_0xc73e[_0x18eb3d];return _0x4d87f2;};'use strict';var emlformat=require(_0xec73('0x0'));var rimraf=require(_0xec73('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec73('0x2'));var rp=require(_0xec73('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xec73('0x4'));var path=require(_0xec73('0x5'));var sox=require('sox');var csv=require(_0xec73('0x6'));var ejs=require(_0xec73('0x7'));var fs=require('fs');var fs_extra=require(_0xec73('0x8'));var _=require(_0xec73('0x9'));var squel=require('squel');var crypto=require(_0xec73('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xec73('0xb'));var toCsv=require(_0xec73('0x6'));var querystring=require(_0xec73('0xc'));var Papa=require(_0xec73('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xec73('0xe'));var as=require(_0xec73('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xec73('0x10'));var utils=require(_0xec73('0x11'));var config=require(_0xec73('0x12'));var licenseUtil=require(_0xec73('0x13'));var db=require(_0xec73('0x14'))['db'];function respondWithStatusCode(_0x19d0f2,_0x1e67ac){_0x1e67ac=_0x1e67ac||0xcc;return function(_0x5f5594){if(_0x5f5594){return _0x19d0f2[_0xec73('0x15')](_0x1e67ac);}return _0x19d0f2['status'](_0x1e67ac)[_0xec73('0x16')]();};}function respondWithResult(_0x4be73c,_0x10f003){_0x10f003=_0x10f003||0xc8;return function(_0x1e4869){if(_0x1e4869){return _0x4be73c[_0xec73('0x17')](_0x10f003)[_0xec73('0x18')](_0x1e4869);}};}function respondWithFilteredResult(_0x3690c3,_0x2a3296){return function(_0x35be28){if(_0x35be28){var _0x2b4e70=typeof _0x2a3296['offset']===_0xec73('0x19')&&typeof _0x2a3296[_0xec73('0x1a')]===_0xec73('0x19');var _0x219119=_0x35be28[_0xec73('0x1b')];var _0x2d646e=_0x2b4e70?0x0:_0x2a3296['offset'];var _0x1bacbf=_0x2b4e70?_0x35be28[_0xec73('0x1b')]:_0x2a3296[_0xec73('0x1c')]+_0x2a3296['limit'];var _0x57ac66;if(_0x1bacbf>=_0x219119){_0x1bacbf=_0x219119;_0x57ac66=0xc8;}else{_0x57ac66=0xce;}_0x3690c3[_0xec73('0x17')](_0x57ac66);return _0x3690c3[_0xec73('0x1d')](_0xec73('0x1e'),_0x2d646e+'-'+_0x1bacbf+'/'+_0x219119)[_0xec73('0x18')](_0x35be28);}return null;};}function patchUpdates(_0x1169c4){return function(_0x5d4c7c){try{jsonpatch['apply'](_0x5d4c7c,_0x1169c4,!![]);}catch(_0x3eeaff){return BPromise[_0xec73('0x1f')](_0x3eeaff);}return _0x5d4c7c[_0xec73('0x20')]();};}function saveUpdates(_0x60bfec,_0x451715){return function(_0x4a862b){if(_0x4a862b){return _0x4a862b[_0xec73('0x21')](_0x60bfec)['then'](function(_0x3d58bc){return _0x3d58bc;});}return null;};}function removeEntity(_0x4f95d2,_0x4df08e){return function(_0x490ee2){if(_0x490ee2){return _0x490ee2[_0xec73('0x22')]()[_0xec73('0x23')](function(){_0x4f95d2[_0xec73('0x17')](0xcc)[_0xec73('0x16')]();});}};}function handleEntityNotFound(_0x3df864,_0x5b48c3){return function(_0x572a81){if(!_0x572a81){_0x3df864[_0xec73('0x15')](0x194);}return _0x572a81;};}function handleError(_0x34e706,_0x5a6e81){_0x5a6e81=_0x5a6e81||0x1f4;return function(_0x358d67){logger[_0xec73('0x24')](_0x358d67[_0xec73('0x25')]);if(_0x358d67[_0xec73('0x26')]){delete _0x358d67[_0xec73('0x26')];}_0x34e706[_0xec73('0x17')](_0x5a6e81)[_0xec73('0x27')](_0x358d67);};}exports[_0xec73('0x28')]=function(_0x49a1da,_0x595635){var _0x2bec99={},_0x2af2db={},_0x3f3104={'count':0x0,'rows':[]};var _0x178aa2=_['map'](db[_0xec73('0x29')][_0xec73('0x2a')],function(_0x24268b){return{'name':_0x24268b[_0xec73('0x2b')],'type':_0x24268b[_0xec73('0x2c')][_0xec73('0x2d')]};});_0x2af2db['model']=_[_0xec73('0x2e')](_0x178aa2,_0xec73('0x26'));_0x2af2db[_0xec73('0x2f')]=_[_0xec73('0x30')](_0x49a1da[_0xec73('0x2f')]);_0x2af2db[_0xec73('0x31')]=_['intersection'](_0x2af2db[_0xec73('0x32')],_0x2af2db[_0xec73('0x2f')]);_0x2bec99[_0xec73('0x33')]=_[_0xec73('0x34')](_0x2af2db[_0xec73('0x32')],qs[_0xec73('0x35')](_0x49a1da[_0xec73('0x2f')]['fields']));_0x2bec99[_0xec73('0x33')]=_0x2bec99['attributes'][_0xec73('0x36')]?_0x2bec99[_0xec73('0x33')]:_0x2af2db[_0xec73('0x32')];if(!_0x49a1da[_0xec73('0x2f')][_0xec73('0x37')](_0xec73('0x38'))){_0x2bec99[_0xec73('0x1a')]=qs[_0xec73('0x1a')](_0x49a1da[_0xec73('0x2f')]['limit']);_0x2bec99['offset']=qs[_0xec73('0x1c')](_0x49a1da[_0xec73('0x2f')][_0xec73('0x1c')]);}_0x2bec99[_0xec73('0x39')]=qs[_0xec73('0x3a')](_0x49a1da[_0xec73('0x2f')][_0xec73('0x3a')]);_0x2bec99[_0xec73('0x3b')]=qs['filters'](_[_0xec73('0x3c')](_0x49a1da[_0xec73('0x2f')],_0x2af2db[_0xec73('0x31')]),_0x178aa2);if(_0x49a1da['query']['filter']){_0x2bec99['where']=_[_0xec73('0x3d')](_0x2bec99['where'],{'$or':_[_0xec73('0x2e')](_0x178aa2,function(_0x5c7776){if(_0x5c7776['type']!==_0xec73('0x3e')){var _0x59cceb={};_0x59cceb[_0x5c7776[_0xec73('0x26')]]={'$like':'%'+_0x49a1da['query'][_0xec73('0x3f')]+'%'};return _0x59cceb;}})});}_0x2bec99=_['merge']({},_0x2bec99,_0x49a1da[_0xec73('0x40')]);var _0x2780cf={'where':_0x2bec99['where']};return db['FaxQueueReport']['count'](_0x2780cf)[_0xec73('0x23')](function(_0x4b7da4){_0x3f3104[_0xec73('0x1b')]=_0x4b7da4;if(_0x49a1da[_0xec73('0x2f')][_0xec73('0x41')]){_0x2bec99['include']=[{'all':!![]}];}return db[_0xec73('0x29')][_0xec73('0x42')](_0x2bec99);})[_0xec73('0x23')](function(_0x1c5e2b){_0x3f3104[_0xec73('0x43')]=_0x1c5e2b;return _0x3f3104;})['then'](respondWithFilteredResult(_0x595635,_0x2bec99))['catch'](handleError(_0x595635,null));};exports[_0xec73('0x44')]=function(_0x60c562,_0x38fec3){var _0x46c8c7={'raw':!![],'where':{'id':_0x60c562[_0xec73('0x45')]['id']}},_0x1f6eeb={};_0x1f6eeb[_0xec73('0x32')]=_[_0xec73('0x30')](db[_0xec73('0x29')][_0xec73('0x2a')]);_0x1f6eeb[_0xec73('0x2f')]=_[_0xec73('0x30')](_0x60c562[_0xec73('0x2f')]);_0x1f6eeb[_0xec73('0x31')]=_['intersection'](_0x1f6eeb['model'],_0x1f6eeb[_0xec73('0x2f')]);_0x46c8c7[_0xec73('0x33')]=_[_0xec73('0x34')](_0x1f6eeb[_0xec73('0x32')],qs[_0xec73('0x35')](_0x60c562[_0xec73('0x2f')][_0xec73('0x35')]));_0x46c8c7[_0xec73('0x33')]=_0x46c8c7[_0xec73('0x33')]['length']?_0x46c8c7['attributes']:_0x1f6eeb[_0xec73('0x32')];if(_0x60c562['query'][_0xec73('0x41')]){_0x46c8c7['include']=[{'all':!![]}];}_0x46c8c7=_[_0xec73('0x3d')]({},_0x46c8c7,_0x60c562[_0xec73('0x40')]);return db[_0xec73('0x29')][_0xec73('0x46')](_0x46c8c7)[_0xec73('0x23')](handleEntityNotFound(_0x38fec3,null))['then'](respondWithResult(_0x38fec3,null))[_0xec73('0x47')](handleError(_0x38fec3,null));};exports[_0xec73('0x48')]=function(_0x57d608,_0x28c84d){return db[_0xec73('0x29')][_0xec73('0x48')](_0x57d608[_0xec73('0x49')],{})[_0xec73('0x23')](respondWithResult(_0x28c84d,0xc9))['catch'](handleError(_0x28c84d,null));};exports['update']=function(_0x42e20f,_0x2a7bec){if(_0x42e20f[_0xec73('0x49')]['id']){delete _0x42e20f['body']['id'];}return db[_0xec73('0x29')]['find']({'where':{'id':_0x42e20f[_0xec73('0x45')]['id']}})[_0xec73('0x23')](handleEntityNotFound(_0x2a7bec,null))[_0xec73('0x23')](saveUpdates(_0x42e20f[_0xec73('0x49')],null))[_0xec73('0x23')](respondWithResult(_0x2a7bec,null))[_0xec73('0x47')](handleError(_0x2a7bec,null));};exports['destroy']=function(_0x5ab01e,_0x40de69){return db['FaxQueueReport'][_0xec73('0x46')]({'where':{'id':_0x5ab01e[_0xec73('0x45')]['id']}})[_0xec73('0x23')](handleEntityNotFound(_0x40de69,null))['then'](removeEntity(_0x40de69,null))[_0xec73('0x47')](handleError(_0x40de69,null));};exports[_0xec73('0x4a')]=function(_0x3a4fd1,_0x16bbdb){return db[_0xec73('0x29')][_0xec73('0x4a')]()[_0xec73('0x23')](respondWithResult(_0x16bbdb,null))[_0xec73('0x47')](handleError(_0x16bbdb,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 5db7925..4e73490 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(_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 +var _0xf494=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash'];(function(_0x1289ab,_0x500f6d){var _0x1cc66c=function(_0x5eb550){while(--_0x5eb550){_0x1289ab['push'](_0x1289ab['shift']());}};_0x1cc66c(++_0x500f6d);}(_0xf494,0x1c6));var _0x4f49=function(_0x2424a2,_0x52f372){_0x2424a2=_0x2424a2-0x0;var _0x1b510c=_0xf494[_0x2424a2];return _0x1b510c;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index b3ee83d..8800bd3 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 _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 +var _0xb687=['body','options','raw','UpdateFaxQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','catch','CreateFaxQueueReport','create'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xb687,0x188));var _0x7b68=function(_0x1d5859,_0x5eddf4){_0x1d5859=_0x1d5859-0x0;var _0x40f0e9=_0xb687[_0x1d5859];return _0x40f0e9;};'use strict';var _=require(_0x7b68('0x0'));var util=require(_0x7b68('0x1'));var moment=require(_0x7b68('0x2'));var BPromise=require(_0x7b68('0x3'));var rs=require(_0x7b68('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b68('0x5'))['db'];var utils=require(_0x7b68('0x6'));var logger=require('../../config/logger')(_0x7b68('0x7'));var config=require(_0x7b68('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7b68('0x9')][_0x7b68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29c3b0,_0x5b6b12,_0x4ca31e){return new BPromise(function(_0x4a3f69,_0x50cc12){return client['request'](_0x29c3b0,_0x4ca31e)[_0x7b68('0xb')](function(_0x43f112){logger[_0x7b68('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x5b6b12,_0x7b68('0xd'));logger[_0x7b68('0xe')](_0x7b68('0xf'),_0x5b6b12,'request\x20sent',JSON[_0x7b68('0x10')](_0x43f112));if(_0x43f112[_0x7b68('0x11')]){if(_0x43f112['error'][_0x7b68('0x12')]===0x1f4){logger[_0x7b68('0x11')](_0x7b68('0x13'),_0x5b6b12,_0x43f112[_0x7b68('0x11')][_0x7b68('0x14')]);return _0x50cc12(_0x43f112[_0x7b68('0x11')][_0x7b68('0x14')]);}logger[_0x7b68('0x11')](_0x7b68('0x13'),_0x5b6b12,_0x43f112[_0x7b68('0x11')][_0x7b68('0x14')]);return _0x4a3f69(_0x43f112[_0x7b68('0x11')][_0x7b68('0x14')]);}else{logger[_0x7b68('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x5b6b12,_0x7b68('0xd'));_0x4a3f69(_0x43f112['result'][_0x7b68('0x14')]);}})[_0x7b68('0x15')](function(_0x776fed){logger[_0x7b68('0x11')](_0x7b68('0x13'),_0x5b6b12,_0x776fed);_0x50cc12(_0x776fed);});});}exports[_0x7b68('0x16')]=function(_0x2c9217){var _0x452153=this;return new Promise(function(_0x2681f8,_0x665649){return db['FaxQueueReport'][_0x7b68('0x17')](_0x2c9217[_0x7b68('0x18')],{'raw':_0x2c9217[_0x7b68('0x19')]?_0x2c9217[_0x7b68('0x19')][_0x7b68('0x1a')]===undefined?!![]:![]:!![]})[_0x7b68('0xb')](function(_0x4d8e2b){logger[_0x7b68('0xc')](_0x7b68('0x16'),_0x2c9217);logger[_0x7b68('0xe')](_0x7b68('0x16'),_0x2c9217,JSON[_0x7b68('0x10')](_0x4d8e2b));_0x2681f8(_0x4d8e2b);})[_0x7b68('0x15')](function(_0x593636){logger[_0x7b68('0x11')](_0x7b68('0x16'),_0x593636[_0x7b68('0x14')],_0x2c9217);_0x665649(_0x452153[_0x7b68('0x11')](0x1f4,_0x593636[_0x7b68('0x14')]));});});};exports[_0x7b68('0x1b')]=function(_0x5d4161){var _0x33af0f=this;return new Promise(function(_0xc9fbd2,_0x3758c2){return db['FaxQueueReport'][_0x7b68('0x1c')](_0x5d4161[_0x7b68('0x18')],{'raw':_0x5d4161[_0x7b68('0x19')]?_0x5d4161['options'][_0x7b68('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d4161[_0x7b68('0x19')]?_0x5d4161[_0x7b68('0x19')][_0x7b68('0x1d')]||null:null,'attributes':_0x5d4161['options']?_0x5d4161[_0x7b68('0x19')][_0x7b68('0x1e')]||null:null,'limit':_0x5d4161[_0x7b68('0x19')]?_0x5d4161[_0x7b68('0x19')][_0x7b68('0x1f')]||null:null})[_0x7b68('0xb')](function(_0x6d3383){logger[_0x7b68('0xc')](_0x7b68('0x1b'),_0x5d4161);logger['debug']('UpdateFaxQueueReport',_0x5d4161,JSON[_0x7b68('0x10')](_0x6d3383));_0xc9fbd2(_0x6d3383);})[_0x7b68('0x15')](function(_0x16715c){logger[_0x7b68('0x11')](_0x7b68('0x1b'),_0x16715c[_0x7b68('0x14')],_0x5d4161);_0x3758c2(_0x33af0f[_0x7b68('0x11')](0x1f4,_0x16715c[_0x7b68('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 35f9e81..9617b20 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 _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 +var _0xea3c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','describe','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x27d398,_0x34f356){var _0x56be6d=function(_0x3b5e5b){while(--_0x3b5e5b){_0x27d398['push'](_0x27d398['shift']());}};_0x56be6d(++_0x34f356);}(_0xea3c,0xd7));var _0xcea3=function(_0x31b1b3,_0x30d369){_0x31b1b3=_0x31b1b3-0x0;var _0x328df4=_0xea3c[_0x31b1b3];return _0x328df4;};'use strict';var multer=require(_0xcea3('0x0'));var util=require(_0xcea3('0x1'));var path=require(_0xcea3('0x2'));var timeout=require(_0xcea3('0x3'));var express=require(_0xcea3('0x4'));var router=express[_0xcea3('0x5')]();var fs_extra=require(_0xcea3('0x6'));var auth=require(_0xcea3('0x7'));var interaction=require(_0xcea3('0x8'));var config=require(_0xcea3('0x9'));var controller=require(_0xcea3('0xa'));router[_0xcea3('0xb')]('/',auth[_0xcea3('0xc')](),controller[_0xcea3('0xd')]);router[_0xcea3('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xcea3('0xe')]);router[_0xcea3('0xb')](_0xcea3('0xf'),auth[_0xcea3('0xc')](),controller['show']);router[_0xcea3('0x10')]('/',auth[_0xcea3('0xc')](),controller[_0xcea3('0x11')]);router[_0xcea3('0x12')]('/:id',auth[_0xcea3('0xc')](),controller['update']);router[_0xcea3('0x13')](_0xcea3('0xf'),auth['isAuthenticated'](),controller[_0xcea3('0x14')]);module[_0xcea3('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 1a5c51e..7dd77c4 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 _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 +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x11d910,_0xb81183){var _0x3da5af=function(_0x48f852){while(--_0x48f852){_0x11d910['push'](_0x11d910['shift']());}};_0x3da5af(++_0xb81183);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x00bb[_0x4baae2];return _0x1a2285;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index d4d3fc6..6856b7b 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 _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 +var _0xd809=['undefined','count','offset','Content-Range','json','reject','save','update','then','destroy','error','stack','name','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','options','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit'];(function(_0xf2c188,_0x5b3338){var _0x10d970=function(_0x1ee612){while(--_0x1ee612){_0xf2c188['push'](_0xf2c188['shift']());}};_0x10d970(++_0x5b3338);}(_0xd809,0x10c));var _0x9d80=function(_0x4c1363,_0x4d4486){_0x4c1363=_0x4c1363-0x0;var _0xd9c1f=_0xd809[_0x4c1363];return _0xd9c1f;};'use strict';var emlformat=require(_0x9d80('0x0'));var rimraf=require(_0x9d80('0x1'));var zipdir=require(_0x9d80('0x2'));var jsonpatch=require(_0x9d80('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9d80('0x4'));var Mustache=require('mustache');var util=require(_0x9d80('0x5'));var path=require(_0x9d80('0x6'));var sox=require(_0x9d80('0x7'));var csv=require(_0x9d80('0x8'));var ejs=require(_0x9d80('0x9'));var fs=require('fs');var fs_extra=require(_0x9d80('0xa'));var _=require(_0x9d80('0xb'));var squel=require(_0x9d80('0xc'));var crypto=require(_0x9d80('0xd'));var jsforce=require(_0x9d80('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9d80('0x8'));var querystring=require('querystring');var Papa=require(_0x9d80('0xf'));var Redis=require(_0x9d80('0x10'));var authService=require(_0x9d80('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d80('0x12'));var logger=require(_0x9d80('0x13'))(_0x9d80('0x14'));var utils=require(_0x9d80('0x15'));var config=require(_0x9d80('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d80('0x17'))['db'];function respondWithStatusCode(_0x342d46,_0x4ae1e7){_0x4ae1e7=_0x4ae1e7||0xcc;return function(_0x558911){if(_0x558911){return _0x342d46[_0x9d80('0x18')](_0x4ae1e7);}return _0x342d46[_0x9d80('0x19')](_0x4ae1e7)[_0x9d80('0x1a')]();};}function respondWithResult(_0x5c9931,_0x4e6247){_0x4e6247=_0x4e6247||0xc8;return function(_0x525bc1){if(_0x525bc1){return _0x5c9931[_0x9d80('0x19')](_0x4e6247)['json'](_0x525bc1);}};}function respondWithFilteredResult(_0x1e6733,_0xbe3831){return function(_0x2fe5b2){if(_0x2fe5b2){var _0x7cd760=typeof _0xbe3831['offset']==='undefined'&&typeof _0xbe3831[_0x9d80('0x1b')]===_0x9d80('0x1c');var _0x2fac15=_0x2fe5b2[_0x9d80('0x1d')];var _0x3b8cc9=_0x7cd760?0x0:_0xbe3831[_0x9d80('0x1e')];var _0x2ddf89=_0x7cd760?_0x2fe5b2[_0x9d80('0x1d')]:_0xbe3831[_0x9d80('0x1e')]+_0xbe3831[_0x9d80('0x1b')];var _0x3039ef;if(_0x2ddf89>=_0x2fac15){_0x2ddf89=_0x2fac15;_0x3039ef=0xc8;}else{_0x3039ef=0xce;}_0x1e6733[_0x9d80('0x19')](_0x3039ef);return _0x1e6733['set'](_0x9d80('0x1f'),_0x3b8cc9+'-'+_0x2ddf89+'/'+_0x2fac15)[_0x9d80('0x20')](_0x2fe5b2);}return null;};}function patchUpdates(_0x2ce655){return function(_0x397ddf){try{jsonpatch['apply'](_0x397ddf,_0x2ce655,!![]);}catch(_0x208448){return BPromise[_0x9d80('0x21')](_0x208448);}return _0x397ddf[_0x9d80('0x22')]();};}function saveUpdates(_0x13b3bb,_0x14bc9b){return function(_0x10e27a){if(_0x10e27a){return _0x10e27a[_0x9d80('0x23')](_0x13b3bb)[_0x9d80('0x24')](function(_0x932741){return _0x932741;});}return null;};}function removeEntity(_0x9e91c,_0x2aa355){return function(_0x12bc06){if(_0x12bc06){return _0x12bc06[_0x9d80('0x25')]()[_0x9d80('0x24')](function(){_0x9e91c['status'](0xcc)[_0x9d80('0x1a')]();});}};}function handleEntityNotFound(_0x350fac,_0x3c62be){return function(_0x2296b8){if(!_0x2296b8){_0x350fac[_0x9d80('0x18')](0x194);}return _0x2296b8;};}function handleError(_0x99088f,_0x81d1f5){_0x81d1f5=_0x81d1f5||0x1f4;return function(_0xe93415){logger[_0x9d80('0x26')](_0xe93415[_0x9d80('0x27')]);if(_0xe93415[_0x9d80('0x28')]){delete _0xe93415[_0x9d80('0x28')];}_0x99088f[_0x9d80('0x19')](_0x81d1f5)['send'](_0xe93415);};}exports[_0x9d80('0x29')]=function(_0x16d295,_0x552d16){var _0x4315d2={},_0xb0703={},_0x10a522={'count':0x0,'rows':[]};var _0x3658cb=_[_0x9d80('0x2a')](db[_0x9d80('0x2b')][_0x9d80('0x2c')],function(_0x5c5424){return{'name':_0x5c5424[_0x9d80('0x2d')],'type':_0x5c5424[_0x9d80('0x2e')][_0x9d80('0x2f')]};});_0xb0703[_0x9d80('0x30')]=_['map'](_0x3658cb,_0x9d80('0x28'));_0xb0703[_0x9d80('0x31')]=_['keys'](_0x16d295['query']);_0xb0703[_0x9d80('0x32')]=_[_0x9d80('0x33')](_0xb0703[_0x9d80('0x30')],_0xb0703['query']);_0x4315d2[_0x9d80('0x34')]=_[_0x9d80('0x33')](_0xb0703['model'],qs[_0x9d80('0x35')](_0x16d295['query'][_0x9d80('0x35')]));_0x4315d2[_0x9d80('0x34')]=_0x4315d2[_0x9d80('0x34')][_0x9d80('0x36')]?_0x4315d2[_0x9d80('0x34')]:_0xb0703[_0x9d80('0x30')];if(!_0x16d295[_0x9d80('0x31')][_0x9d80('0x37')](_0x9d80('0x38'))){_0x4315d2[_0x9d80('0x1b')]=qs[_0x9d80('0x1b')](_0x16d295[_0x9d80('0x31')][_0x9d80('0x1b')]);_0x4315d2[_0x9d80('0x1e')]=qs[_0x9d80('0x1e')](_0x16d295[_0x9d80('0x31')]['offset']);}_0x4315d2[_0x9d80('0x39')]=qs[_0x9d80('0x3a')](_0x16d295['query'][_0x9d80('0x3a')]);_0x4315d2[_0x9d80('0x3b')]=qs['filters'](_['pick'](_0x16d295[_0x9d80('0x31')],_0xb0703[_0x9d80('0x32')]),_0x3658cb);if(_0x16d295['query']['filter']){_0x4315d2[_0x9d80('0x3b')]=_[_0x9d80('0x3c')](_0x4315d2['where'],{'$or':_[_0x9d80('0x2a')](_0x3658cb,function(_0x499d11){if(_0x499d11[_0x9d80('0x2e')]!==_0x9d80('0x3d')){var _0x350ed4={};_0x350ed4[_0x499d11[_0x9d80('0x28')]]={'$like':'%'+_0x16d295['query']['filter']+'%'};return _0x350ed4;}})});}_0x4315d2=_[_0x9d80('0x3c')]({},_0x4315d2,_0x16d295['options']);var _0x34dd22={'where':_0x4315d2[_0x9d80('0x3b')]};return db[_0x9d80('0x2b')][_0x9d80('0x1d')](_0x34dd22)[_0x9d80('0x24')](function(_0x43bf25){_0x10a522[_0x9d80('0x1d')]=_0x43bf25;if(_0x16d295[_0x9d80('0x31')][_0x9d80('0x3e')]){_0x4315d2[_0x9d80('0x3f')]=[{'all':!![]}];}return db[_0x9d80('0x2b')][_0x9d80('0x40')](_0x4315d2);})[_0x9d80('0x24')](function(_0x39e4aa){_0x10a522[_0x9d80('0x41')]=_0x39e4aa;return _0x10a522;})['then'](respondWithFilteredResult(_0x552d16,_0x4315d2))['catch'](handleError(_0x552d16,null));};exports[_0x9d80('0x42')]=function(_0x1c9754,_0xea8180){var _0x4ca26b={'raw':!![],'where':{'id':_0x1c9754[_0x9d80('0x43')]['id']}},_0x45f3b3={};_0x45f3b3[_0x9d80('0x30')]=_['keys'](db[_0x9d80('0x2b')][_0x9d80('0x2c')]);_0x45f3b3[_0x9d80('0x31')]=_[_0x9d80('0x44')](_0x1c9754[_0x9d80('0x31')]);_0x45f3b3[_0x9d80('0x32')]=_[_0x9d80('0x33')](_0x45f3b3[_0x9d80('0x30')],_0x45f3b3[_0x9d80('0x31')]);_0x4ca26b[_0x9d80('0x34')]=_[_0x9d80('0x33')](_0x45f3b3[_0x9d80('0x30')],qs[_0x9d80('0x35')](_0x1c9754['query'][_0x9d80('0x35')]));_0x4ca26b[_0x9d80('0x34')]=_0x4ca26b[_0x9d80('0x34')][_0x9d80('0x36')]?_0x4ca26b[_0x9d80('0x34')]:_0x45f3b3[_0x9d80('0x30')];if(_0x1c9754[_0x9d80('0x31')][_0x9d80('0x3e')]){_0x4ca26b[_0x9d80('0x3f')]=[{'all':!![]}];}_0x4ca26b=_[_0x9d80('0x3c')]({},_0x4ca26b,_0x1c9754[_0x9d80('0x45')]);return db[_0x9d80('0x2b')]['find'](_0x4ca26b)[_0x9d80('0x24')](handleEntityNotFound(_0xea8180,null))['then'](respondWithResult(_0xea8180,null))[_0x9d80('0x46')](handleError(_0xea8180,null));};exports['create']=function(_0x30dba3,_0x142385){return db[_0x9d80('0x2b')][_0x9d80('0x47')](_0x30dba3[_0x9d80('0x48')],{})[_0x9d80('0x24')](respondWithResult(_0x142385,0xc9))[_0x9d80('0x46')](handleError(_0x142385,null));};exports[_0x9d80('0x23')]=function(_0x30bea6,_0x5bb191){if(_0x30bea6['body']['id']){delete _0x30bea6[_0x9d80('0x48')]['id'];}return db[_0x9d80('0x2b')][_0x9d80('0x49')]({'where':{'id':_0x30bea6['params']['id']}})['then'](handleEntityNotFound(_0x5bb191,null))[_0x9d80('0x24')](saveUpdates(_0x30bea6['body'],null))[_0x9d80('0x24')](respondWithResult(_0x5bb191,null))[_0x9d80('0x46')](handleError(_0x5bb191,null));};exports[_0x9d80('0x25')]=function(_0x426fe8,_0x364fdf){return db[_0x9d80('0x2b')][_0x9d80('0x49')]({'where':{'id':_0x426fe8['params']['id']}})[_0x9d80('0x24')](handleEntityNotFound(_0x364fdf,null))[_0x9d80('0x24')](removeEntity(_0x364fdf,null))[_0x9d80('0x46')](handleError(_0x364fdf,null));};exports['describe']=function(_0x3cf827,_0x58233b){return db[_0x9d80('0x2b')]['describe']()[_0x9d80('0x24')](respondWithResult(_0x58233b,null))[_0x9d80('0x46')](handleError(_0x58233b,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 695ac7d..5011fb4 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 _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 +var _0xe7a3=['./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','uniqueid','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5ce848,_0x4c8981){var _0x14bde2=function(_0x1137f3){while(--_0x1137f3){_0x5ce848['push'](_0x5ce848['shift']());}};_0x14bde2(++_0x4c8981);}(_0xe7a3,0x1bf));var _0x3e7a=function(_0xb230d8,_0x24f0ad){_0xb230d8=_0xb230d8-0x0;var _0x42a754=_0xe7a3[_0xb230d8];return _0x42a754;};'use strict';var _=require('lodash');var util=require(_0x3e7a('0x0'));var logger=require('../../config/logger')(_0x3e7a('0x1'));var moment=require(_0x3e7a('0x2'));var BPromise=require(_0x3e7a('0x3'));var rp=require(_0x3e7a('0x4'));var fs=require('fs');var path=require(_0x3e7a('0x5'));var rimraf=require(_0x3e7a('0x6'));var config=require(_0x3e7a('0x7'));var attributes=require(_0x3e7a('0x8'));module['exports']=function(_0x381056,_0x3f798e){return _0x381056[_0x3e7a('0x9')](_0x3e7a('0xa'),attributes,{'tableName':_0x3e7a('0xb'),'paranoid':![],'indexes':[{'name':_0x3e7a('0xc'),'fields':[_0x3e7a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 6eaca6a..0d8c8d9 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 _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 +var _0x6807=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x6807,0x106));var _0x7680=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x6807[_0x1a36a5];return _0x746243;};'use strict';var _=require('lodash');var util=require(_0x7680('0x0'));var moment=require(_0x7680('0x1'));var BPromise=require(_0x7680('0x2'));var rs=require(_0x7680('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7680('0x4'))['db'];var utils=require(_0x7680('0x5'));var logger=require(_0x7680('0x6'))(_0x7680('0x7'));var config=require(_0x7680('0x8'));var jayson=require(_0x7680('0x9'));var client=jayson[_0x7680('0xa')][_0x7680('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d0cc2,_0x5602b7,_0x658a63){return new BPromise(function(_0x3fe79a,_0x113e98){return client[_0x7680('0xc')](_0x4d0cc2,_0x658a63)['then'](function(_0x2d9982){logger[_0x7680('0xd')](_0x7680('0xe'),_0x5602b7,'request\x20sent');logger[_0x7680('0xf')](_0x7680('0x10'),_0x5602b7,_0x7680('0x11'),JSON[_0x7680('0x12')](_0x2d9982));if(_0x2d9982[_0x7680('0x13')]){if(_0x2d9982['error'][_0x7680('0x14')]===0x1f4){logger[_0x7680('0x13')](_0x7680('0xe'),_0x5602b7,_0x2d9982[_0x7680('0x13')]['message']);return _0x113e98(_0x2d9982['error'][_0x7680('0x15')]);}logger[_0x7680('0x13')](_0x7680('0xe'),_0x5602b7,_0x2d9982[_0x7680('0x13')]['message']);return _0x3fe79a(_0x2d9982[_0x7680('0x13')][_0x7680('0x15')]);}else{logger[_0x7680('0xd')](_0x7680('0xe'),_0x5602b7,_0x7680('0x11'));_0x3fe79a(_0x2d9982[_0x7680('0x16')][_0x7680('0x15')]);}})[_0x7680('0x17')](function(_0x464bd8){logger[_0x7680('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x5602b7,_0x464bd8);_0x113e98(_0x464bd8);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index ed5581c..2d047ce 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 _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 +var _0x394c=['update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','get','/describe','/:id','show','post','create'];(function(_0x4185df,_0x3cbf64){var _0x4e900f=function(_0x2e211e){while(--_0x2e211e){_0x4185df['push'](_0x4185df['shift']());}};_0x4e900f(++_0x3cbf64);}(_0x394c,0x120));var _0xc394=function(_0x39551a,_0x116007){_0x39551a=_0x39551a-0x0;var _0x4b0b62=_0x394c[_0x39551a];return _0x4b0b62;};'use strict';var multer=require(_0xc394('0x0'));var util=require(_0xc394('0x1'));var path=require('path');var timeout=require(_0xc394('0x2'));var express=require(_0xc394('0x3'));var router=express[_0xc394('0x4')]();var fs_extra=require(_0xc394('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc394('0x6'));var config=require(_0xc394('0x7'));var controller=require(_0xc394('0x8'));router['get']('/',auth[_0xc394('0x9')](),controller['index']);router[_0xc394('0xa')](_0xc394('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xc394('0xa')](_0xc394('0xc'),auth[_0xc394('0x9')](),controller[_0xc394('0xd')]);router[_0xc394('0xe')]('/',auth[_0xc394('0x9')](),controller[_0xc394('0xf')]);router['put'](_0xc394('0xc'),auth[_0xc394('0x9')](),controller[_0xc394('0x10')]);router[_0xc394('0x11')](_0xc394('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xc394('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 0a0e2de..2248a2f 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 _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 +var _0x030c=['getFields','post','create','/:id/configurations','put','/:id','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getConfigurations','/:id/fields'];(function(_0xb8de81,_0x3a4c94){var _0x5d9004=function(_0xb683a1){while(--_0xb683a1){_0xb8de81['push'](_0xb8de81['shift']());}};_0x5d9004(++_0x3a4c94);}(_0x030c,0x1a7));var _0xc030=function(_0x1337be,_0x1e0176){_0x1337be=_0x1337be-0x0;var _0x5e4df9=_0x030c[_0x1337be];return _0x5e4df9;};'use strict';var multer=require(_0xc030('0x0'));var util=require(_0xc030('0x1'));var path=require(_0xc030('0x2'));var timeout=require('connect-timeout');var express=require(_0xc030('0x3'));var router=express['Router']();var fs_extra=require(_0xc030('0x4'));var auth=require(_0xc030('0x5'));var interaction=require(_0xc030('0x6'));var config=require(_0xc030('0x7'));var controller=require('./intDeskAccount.controller');router[_0xc030('0x8')]('/',auth[_0xc030('0x9')](),controller[_0xc030('0xa')]);router[_0xc030('0x8')]('/:id',auth[_0xc030('0x9')](),controller[_0xc030('0xb')]);router[_0xc030('0x8')]('/:id/configurations',auth[_0xc030('0x9')](),controller[_0xc030('0xc')]);router[_0xc030('0x8')](_0xc030('0xd'),auth[_0xc030('0x9')](),controller[_0xc030('0xe')]);router[_0xc030('0xf')]('/',auth[_0xc030('0x9')](),controller[_0xc030('0x10')]);router[_0xc030('0xf')](_0xc030('0x11'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xc030('0x12')](_0xc030('0x13'),auth[_0xc030('0x9')](),controller[_0xc030('0x14')]);router[_0xc030('0x15')]('/:id',auth[_0xc030('0x9')](),controller[_0xc030('0x16')]);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 1af6fc3..f149b2c 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 _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 +var _0xb0e3=['STRING','ENUM','basic','newTab','integrationTab','sequelize','exports'];(function(_0x44379c,_0x63c052){var _0x2254a9=function(_0x5df134){while(--_0x5df134){_0x44379c['push'](_0x44379c['shift']());}};_0x2254a9(++_0x63c052);}(_0xb0e3,0x83));var _0x3b0e=function(_0x4a343e,_0x5df78d){_0x4a343e=_0x4a343e-0x0;var _0xff7501=_0xb0e3[_0x4a343e];return _0xff7501;};'use strict';var Sequelize=require(_0x3b0e('0x0'));module[_0x3b0e('0x1')]={'name':{'type':Sequelize[_0x3b0e('0x2')]},'description':{'type':Sequelize[_0x3b0e('0x2')]},'username':{'type':Sequelize[_0x3b0e('0x2')]},'remoteUri':{'type':Sequelize[_0x3b0e('0x2')]},'authType':{'type':Sequelize[_0x3b0e('0x3')](_0x3b0e('0x4')),'defaultValue':_0x3b0e('0x4')},'password':{'type':Sequelize[_0x3b0e('0x2')]},'consumerKey':{'type':Sequelize[_0x3b0e('0x2')]},'consumerSecret':{'type':Sequelize[_0x3b0e('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x3b0e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3b0e('0x3')]('integrationTab',_0x3b0e('0x5')),'defaultValue':_0x3b0e('0x6')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 8608522..7c02319 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 _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 +var _0x5357=['Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','type','VIRTUAL','filter','options','DeskAccount','includeAll','include','rows','show','params','fields','find','catch','create','body','getConfigurations','findOne','addConfiguration','Subjects','channel','getDescriptions','DeskConfiguration','DeskField','Descriptions','getFields','priority','remoteUri','username','password','consumerKey','consumerSecret','token','tokenSecret','substring','GET','format','%s/custom_fields','application/json','basic','%s:%s','toString','concat','_embedded','entries','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send'];(function(_0x5c883f,_0x38f092){var _0x4210cc=function(_0x51be71){while(--_0x51be71){_0x5c883f['push'](_0x5c883f['shift']());}};_0x4210cc(++_0x38f092);}(_0x5357,0x1b5));var _0x7535=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x5357[_0x5d80de];return _0x1c7556;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7535('0x0'));var zipdir=require(_0x7535('0x1'));var jsonpatch=require(_0x7535('0x2'));var rp=require('request-promise');var moment=require(_0x7535('0x3'));var BPromise=require(_0x7535('0x4'));var Mustache=require(_0x7535('0x5'));var util=require(_0x7535('0x6'));var path=require('path');var sox=require(_0x7535('0x7'));var csv=require(_0x7535('0x8'));var ejs=require(_0x7535('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7535('0xa'));var crypto=require(_0x7535('0xb'));var jsforce=require(_0x7535('0xc'));var deskjs=require(_0x7535('0xd'));var toCsv=require(_0x7535('0x8'));var querystring=require(_0x7535('0xe'));var Papa=require('papaparse');var Redis=require(_0x7535('0xf'));var authService=require(_0x7535('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7535('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7535('0x12'))(_0x7535('0x13'));var utils=require(_0x7535('0x14'));var config=require(_0x7535('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7535('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4a01e9,_0x247f9a){_0x247f9a=_0x247f9a||0xcc;return function(_0x2331de){if(_0x2331de){return _0x4a01e9[_0x7535('0x17')](_0x247f9a);}return _0x4a01e9[_0x7535('0x18')](_0x247f9a)['end']();};}function respondWithResult(_0x4b9fb2,_0x1f9ee8){_0x1f9ee8=_0x1f9ee8||0xc8;return function(_0x22fda0){if(_0x22fda0){return _0x4b9fb2[_0x7535('0x18')](_0x1f9ee8)[_0x7535('0x19')](_0x22fda0);}};}function respondWithFilteredResult(_0x5aef16,_0x22c541){return function(_0x55eb56){if(_0x55eb56){var _0x5043f0=typeof _0x22c541[_0x7535('0x1a')]===_0x7535('0x1b')&&typeof _0x22c541['limit']===_0x7535('0x1b');var _0xf33b42=_0x55eb56[_0x7535('0x1c')];var _0x54d0d3=_0x5043f0?0x0:_0x22c541[_0x7535('0x1a')];var _0x325083=_0x5043f0?_0x55eb56[_0x7535('0x1c')]:_0x22c541[_0x7535('0x1a')]+_0x22c541[_0x7535('0x1d')];var _0x2b9130;if(_0x325083>=_0xf33b42){_0x325083=_0xf33b42;_0x2b9130=0xc8;}else{_0x2b9130=0xce;}_0x5aef16[_0x7535('0x18')](_0x2b9130);return _0x5aef16[_0x7535('0x1e')](_0x7535('0x1f'),_0x54d0d3+'-'+_0x325083+'/'+_0xf33b42)[_0x7535('0x19')](_0x55eb56);}return null;};}function patchUpdates(_0x1246e1){return function(_0x14f943){try{jsonpatch[_0x7535('0x20')](_0x14f943,_0x1246e1,!![]);}catch(_0x35b9df){return BPromise[_0x7535('0x21')](_0x35b9df);}return _0x14f943[_0x7535('0x22')]();};}function saveUpdates(_0x2dc985,_0xecb3cd){return function(_0x1ea5bb){if(_0x1ea5bb){return _0x1ea5bb[_0x7535('0x23')](_0x2dc985)[_0x7535('0x24')](function(_0x5223ba){return _0x5223ba;});}return null;};}function removeEntity(_0xaaa8b7,_0x1ba9cd){return function(_0x56ae12){if(_0x56ae12){return _0x56ae12[_0x7535('0x25')]()[_0x7535('0x24')](function(){_0xaaa8b7[_0x7535('0x18')](0xcc)[_0x7535('0x26')]();});}};}function handleEntityNotFound(_0x5f413e,_0x2edc23){return function(_0x3704d8){if(!_0x3704d8){_0x5f413e['sendStatus'](0x194);}return _0x3704d8;};}function handleError(_0x16e030,_0x2fceff){_0x2fceff=_0x2fceff||0x1f4;return function(_0xe5c7bd){logger[_0x7535('0x27')](_0xe5c7bd[_0x7535('0x28')]);if(_0xe5c7bd['name']){delete _0xe5c7bd[_0x7535('0x29')];}_0x16e030[_0x7535('0x18')](_0x2fceff)['send'](_0xe5c7bd);};}exports[_0x7535('0x2a')]=function(_0x14cd30,_0x2747c5){var _0x4440b0={},_0x297f49={},_0x4bef15={'count':0x0,'rows':[]};var _0x3184ea=_[_0x7535('0x2b')](db['DeskAccount'][_0x7535('0x2c')],function(_0x2aa0f1){return{'name':_0x2aa0f1[_0x7535('0x2d')],'type':_0x2aa0f1['type']['key']};});_0x297f49[_0x7535('0x2e')]=_[_0x7535('0x2b')](_0x3184ea,_0x7535('0x29'));_0x297f49[_0x7535('0x2f')]=_[_0x7535('0x30')](_0x14cd30['query']);_0x297f49[_0x7535('0x31')]=_[_0x7535('0x32')](_0x297f49[_0x7535('0x2e')],_0x297f49[_0x7535('0x2f')]);_0x4440b0[_0x7535('0x33')]=_[_0x7535('0x32')](_0x297f49[_0x7535('0x2e')],qs['fields'](_0x14cd30[_0x7535('0x2f')]['fields']));_0x4440b0['attributes']=_0x4440b0['attributes'][_0x7535('0x34')]?_0x4440b0['attributes']:_0x297f49[_0x7535('0x2e')];if(!_0x14cd30[_0x7535('0x2f')][_0x7535('0x35')](_0x7535('0x36'))){_0x4440b0[_0x7535('0x1d')]=qs['limit'](_0x14cd30[_0x7535('0x2f')][_0x7535('0x1d')]);_0x4440b0['offset']=qs[_0x7535('0x1a')](_0x14cd30[_0x7535('0x2f')]['offset']);}_0x4440b0['order']=qs[_0x7535('0x37')](_0x14cd30[_0x7535('0x2f')][_0x7535('0x37')]);_0x4440b0['where']=qs['filters'](_[_0x7535('0x38')](_0x14cd30['query'],_0x297f49[_0x7535('0x31')]),_0x3184ea);if(_0x14cd30[_0x7535('0x2f')]['filter']){_0x4440b0[_0x7535('0x39')]=_[_0x7535('0x3a')](_0x4440b0[_0x7535('0x39')],{'$or':_['map'](_0x3184ea,function(_0x16234c){if(_0x16234c[_0x7535('0x3b')]!==_0x7535('0x3c')){var _0x1f4ea9={};_0x1f4ea9[_0x16234c[_0x7535('0x29')]]={'$like':'%'+_0x14cd30[_0x7535('0x2f')][_0x7535('0x3d')]+'%'};return _0x1f4ea9;}})});}_0x4440b0=_[_0x7535('0x3a')]({},_0x4440b0,_0x14cd30[_0x7535('0x3e')]);var _0xb45ad0={'where':_0x4440b0[_0x7535('0x39')]};return db[_0x7535('0x3f')][_0x7535('0x1c')](_0xb45ad0)[_0x7535('0x24')](function(_0x1971f5){_0x4bef15[_0x7535('0x1c')]=_0x1971f5;if(_0x14cd30[_0x7535('0x2f')][_0x7535('0x40')]){_0x4440b0[_0x7535('0x41')]=[{'all':!![]}];}return db[_0x7535('0x3f')]['findAll'](_0x4440b0);})[_0x7535('0x24')](function(_0x47689b){_0x4bef15[_0x7535('0x42')]=_0x47689b;return _0x4bef15;})[_0x7535('0x24')](respondWithFilteredResult(_0x2747c5,_0x4440b0))['catch'](handleError(_0x2747c5,null));};exports[_0x7535('0x43')]=function(_0x566394,_0x39f961){var _0x16ca16={'raw':![],'where':{'id':_0x566394[_0x7535('0x44')]['id']}},_0x5610a8={};_0x5610a8[_0x7535('0x2e')]=_['keys'](db['DeskAccount'][_0x7535('0x2c')]);_0x5610a8[_0x7535('0x2f')]=_[_0x7535('0x30')](_0x566394['query']);_0x5610a8[_0x7535('0x31')]=_[_0x7535('0x32')](_0x5610a8['model'],_0x5610a8[_0x7535('0x2f')]);_0x16ca16[_0x7535('0x33')]=_[_0x7535('0x32')](_0x5610a8['model'],qs[_0x7535('0x45')](_0x566394[_0x7535('0x2f')][_0x7535('0x45')]));_0x16ca16[_0x7535('0x33')]=_0x16ca16[_0x7535('0x33')][_0x7535('0x34')]?_0x16ca16[_0x7535('0x33')]:_0x5610a8['model'];if(_0x566394['query'][_0x7535('0x40')]){_0x16ca16['include']=[{'all':!![]}];}_0x16ca16=_[_0x7535('0x3a')]({},_0x16ca16,_0x566394['options']);return db[_0x7535('0x3f')][_0x7535('0x46')](_0x16ca16)['then'](handleEntityNotFound(_0x39f961,null))[_0x7535('0x24')](respondWithResult(_0x39f961,null))[_0x7535('0x47')](handleError(_0x39f961,null));};exports[_0x7535('0x48')]=function(_0x4aaf68,_0x2d910f){return db[_0x7535('0x3f')][_0x7535('0x48')](_0x4aaf68[_0x7535('0x49')],{})[_0x7535('0x24')](respondWithResult(_0x2d910f,0xc9))['catch'](handleError(_0x2d910f,null));};exports[_0x7535('0x23')]=function(_0x733ef5,_0x12b361){if(_0x733ef5[_0x7535('0x49')]['id']){delete _0x733ef5[_0x7535('0x49')]['id'];}return db['DeskAccount'][_0x7535('0x46')]({'where':{'id':_0x733ef5['params']['id']}})[_0x7535('0x24')](handleEntityNotFound(_0x12b361,null))[_0x7535('0x24')](saveUpdates(_0x733ef5[_0x7535('0x49')],null))['then'](respondWithResult(_0x12b361,null))[_0x7535('0x47')](handleError(_0x12b361,null));};exports[_0x7535('0x25')]=function(_0x3a6e95,_0x3dbec8){return db[_0x7535('0x3f')][_0x7535('0x46')]({'where':{'id':_0x3a6e95[_0x7535('0x44')]['id']}})[_0x7535('0x24')](handleEntityNotFound(_0x3dbec8,null))[_0x7535('0x24')](removeEntity(_0x3dbec8,null))[_0x7535('0x47')](handleError(_0x3dbec8,null));};exports[_0x7535('0x4a')]=function(_0x545b5b,_0x3ab1b3,_0x4f743e){var _0xcbb4d7={};var _0x1d6283={};var _0x8ee2e2;var _0x79db7e;return db[_0x7535('0x3f')][_0x7535('0x4b')]({'where':{'id':_0x545b5b['params']['id']}})[_0x7535('0x24')](handleEntityNotFound(_0x3ab1b3,null))[_0x7535('0x24')](function(_0x393ab8){if(_0x393ab8){_0x8ee2e2=_0x393ab8;_0x1d6283[_0x7535('0x2e')]=_[_0x7535('0x30')](db['DeskConfiguration']['rawAttributes']);_0x1d6283['query']=_[_0x7535('0x30')](_0x545b5b[_0x7535('0x2f')]);_0x1d6283[_0x7535('0x31')]=_['intersection'](_0x1d6283[_0x7535('0x2e')],_0x1d6283[_0x7535('0x2f')]);_0xcbb4d7[_0x7535('0x33')]=_[_0x7535('0x32')](_0x1d6283['model'],qs[_0x7535('0x45')](_0x545b5b['query']['fields']));_0xcbb4d7['attributes']=_0xcbb4d7[_0x7535('0x33')][_0x7535('0x34')]?_0xcbb4d7[_0x7535('0x33')]:_0x1d6283[_0x7535('0x2e')];_0xcbb4d7['order']=qs['sort'](_0x545b5b['query'][_0x7535('0x37')]);_0xcbb4d7[_0x7535('0x39')]=qs[_0x7535('0x31')](_[_0x7535('0x38')](_0x545b5b['query'],_0x1d6283[_0x7535('0x31')]));if(_0x545b5b[_0x7535('0x2f')][_0x7535('0x3d')]){_0xcbb4d7[_0x7535('0x39')]=_[_0x7535('0x3a')](_0xcbb4d7[_0x7535('0x39')],{'$or':_['map'](_0xcbb4d7[_0x7535('0x33')],function(_0x495bb0){var _0x4a54bd={};_0x4a54bd[_0x495bb0]={'$like':'%'+_0x545b5b[_0x7535('0x2f')][_0x7535('0x3d')]+'%'};return _0x4a54bd;})});}_0xcbb4d7=_[_0x7535('0x3a')]({},_0xcbb4d7,_0x545b5b[_0x7535('0x3e')]);return _0x8ee2e2[_0x7535('0x4a')](_0xcbb4d7);}})[_0x7535('0x24')](function(_0x14c54d){if(_0x14c54d){_0x79db7e=_0x14c54d[_0x7535('0x34')];if(!_0x545b5b[_0x7535('0x2f')][_0x7535('0x35')](_0x7535('0x36'))){_0xcbb4d7[_0x7535('0x1d')]=qs[_0x7535('0x1d')](_0x545b5b['query'][_0x7535('0x1d')]);_0xcbb4d7[_0x7535('0x1a')]=qs[_0x7535('0x1a')](_0x545b5b[_0x7535('0x2f')][_0x7535('0x1a')]);}return _0x8ee2e2['getConfigurations'](_0xcbb4d7);}})['then'](function(_0x1d8236){if(_0x1d8236){return _0x1d8236?{'count':_0x79db7e,'rows':_0x1d8236}:null;}})[_0x7535('0x24')](respondWithResult(_0x3ab1b3,null))[_0x7535('0x47')](handleError(_0x3ab1b3,null));};exports[_0x7535('0x4c')]=function(_0x149148,_0x58a30c,_0x161779){if(_0x149148['body']['id']){delete _0x149148[_0x7535('0x49')]['id'];}return db[_0x7535('0x3f')][_0x7535('0x4b')]({'where':{'id':_0x149148[_0x7535('0x44')]['id']}})[_0x7535('0x24')](handleEntityNotFound(_0x58a30c,null))[_0x7535('0x24')](function(_0x302175){if(_0x302175){_0x149148[_0x7535('0x49')]['AccountId']=_0x302175['id'];_0x149148[_0x7535('0x49')][_0x7535('0x4d')]=integrations['getSubjects'](_0x149148['body'][_0x7535('0x4e')],_0x149148[_0x7535('0x49')]['type']);_0x149148[_0x7535('0x49')]['Descriptions']=integrations[_0x7535('0x4f')](_0x149148[_0x7535('0x49')][_0x7535('0x4e')],_0x149148[_0x7535('0x49')]['type']);return db[_0x7535('0x50')][_0x7535('0x48')](_0x149148['body'],{'include':[{'model':db[_0x7535('0x51')],'as':_0x7535('0x4d')},{'model':db['DeskField'],'as':_0x7535('0x52')}]});}return null;})[_0x7535('0x24')](respondWithResult(_0x58a30c,null))['catch'](handleError(_0x58a30c,null));};exports[_0x7535('0x53')]=function(_0xfb00c4,_0x1009e5,_0x16416d){var _0x2f2de4=[{'name':_0x7535('0x54'),'label':_0x7535('0x54'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x3ee93f='';return db[_0x7535('0x3f')][_0x7535('0x4b')]({'where':{'id':_0xfb00c4['params']['id']},'attributes':['id',_0x7535('0x55'),'authType',_0x7535('0x56'),_0x7535('0x57'),_0x7535('0x58'),_0x7535('0x59'),_0x7535('0x5a'),_0x7535('0x5b')]})[_0x7535('0x24')](handleEntityNotFound(_0x1009e5,null))[_0x7535('0x24')](function(_0x5ce4af){if(_0x5ce4af){_0x3ee93f=_0x5ce4af[_0x7535('0x55')];var _0x5bbba0=_0x3ee93f['slice'](-0x1);if(_0x5bbba0==='/'){_0x3ee93f=_0x3ee93f[_0x7535('0x5c')](0x0,_0x3ee93f['lastIndexOf'](_0x5bbba0));}var _0x1ad4a7={'method':_0x7535('0x5d'),'uri':util[_0x7535('0x5e')](_0x7535('0x5f'),_0x3ee93f),'headers':{'Content-Type':'application/json','Accept':_0x7535('0x60')},'json':!![]};if(_0x5ce4af['authType']===_0x7535('0x61')){_0x1ad4a7['headers']['Authorization']=util['format']('Basic\x20%s',new Buffer(util[_0x7535('0x5e')](_0x7535('0x62'),_0x5ce4af[_0x7535('0x56')],_0x5ce4af[_0x7535('0x57')]))[_0x7535('0x63')]('base64'));}return rp(_0x1ad4a7)['then'](function(_0x6e0d87){return _0x2f2de4[_0x7535('0x64')](_[_0x7535('0x2b')](_0x6e0d87[_0x7535('0x65')][_0x7535('0x66')],function(_0x560957){return{'id':_0x560957[_0x7535('0x29')],'name':_0x560957['name'],'type':_0x560957[_0x7535('0x3b')],'active':_0x560957['active'],'label':_0x560957['label'],'custom':!![]};}));});}})[_0x7535('0x24')](function(_0x5b4f94){return{'count':_0x5b4f94[_0x7535('0x34')],'rows':_0x5b4f94};})[_0x7535('0x24')](respondWithResult(_0x1009e5,null))[_0x7535('0x47')](function(_0x5ba5e1){var _0xc2ecde=_0xfb00c4[_0x7535('0x2f')][_0x7535('0x67')]?0x1f4:_0x5ba5e1[_0x7535('0x68')]||0x1f4;logger['error'](_0x7535('0x69'),_0x7535('0x53'),_0xc2ecde,JSON[_0x7535('0x6a')](_0x5ba5e1));delete _0x5ba5e1[_0x7535('0x29')];if(_0xc2ecde===0x191){_0xc2ecde=0x190;}_0x1009e5[_0x7535('0x18')](_0xc2ecde)[_0x7535('0x6b')](_0xfb00c4['query'][_0x7535('0x67')]?{'message':_0x7535('0x6c'),'statusCode':_0x5ba5e1[_0x7535('0x68')]}:_0x5ba5e1);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 700deee..052e7de 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 _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 +var _0xe6c5=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x2aa147,_0x2d9ec0){var _0x2cf6d5=function(_0x10be7b){while(--_0x10be7b){_0x2aa147['push'](_0x2aa147['shift']());}};_0x2cf6d5(++_0x2d9ec0);}(_0xe6c5,0x168));var _0x5e6c=function(_0x4d6fe9,_0x3d5e99){_0x4d6fe9=_0x4d6fe9-0x0;var _0x131b2a=_0xe6c5[_0x4d6fe9];return _0x131b2a;};'use strict';var _=require(_0x5e6c('0x0'));var util=require('util');var logger=require(_0x5e6c('0x1'))(_0x5e6c('0x2'));var moment=require('moment');var BPromise=require(_0x5e6c('0x3'));var rp=require(_0x5e6c('0x4'));var fs=require('fs');var path=require(_0x5e6c('0x5'));var rimraf=require(_0x5e6c('0x6'));var config=require(_0x5e6c('0x7'));var attributes=require(_0x5e6c('0x8'));var integrations=require(_0x5e6c('0x9'));module[_0x5e6c('0xa')]=function(_0xa07862,_0x1a6c63){return _0xa07862[_0x5e6c('0xb')]('DeskAccount',attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 94883ee..384c53d 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 _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 +var _0xe644=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','debug','stringify','code','error','message','DeskAccount,\x20%s,\x20%s','info','result','GetDeskAccount','DeskAccount','findAll','options','attributes','limit','include','map','model','then','catch','ShowDeskAccount','find','raw','where','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4c19ca,_0xce72af){var _0x42b66a=function(_0x2d5909){while(--_0x2d5909){_0x4c19ca['push'](_0x4c19ca['shift']());}};_0x42b66a(++_0xce72af);}(_0xe644,0x104));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var moment=require(_0x4e64('0x2'));var BPromise=require(_0x4e64('0x3'));var rs=require(_0x4e64('0x4'));var fs=require('fs');var Redis=require(_0x4e64('0x5'));var db=require(_0x4e64('0x6'))['db'];var utils=require(_0x4e64('0x7'));var logger=require(_0x4e64('0x8'))(_0x4e64('0x9'));var config=require(_0x4e64('0xa'));var jayson=require(_0x4e64('0xb'));var client=jayson['client'][_0x4e64('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11f91f,_0x5ab39f,_0x3e6475){return new BPromise(function(_0x22f4a6,_0x3335f1){return client[_0x4e64('0xd')](_0x11f91f,_0x3e6475)['then'](function(_0x33c10b){logger['info']('DeskAccount,\x20%s,\x20%s',_0x5ab39f,_0x4e64('0xe'));logger[_0x4e64('0xf')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x5ab39f,_0x4e64('0xe'),JSON[_0x4e64('0x10')](_0x33c10b));if(_0x33c10b['error']){if(_0x33c10b['error'][_0x4e64('0x11')]===0x1f4){logger[_0x4e64('0x12')]('DeskAccount,\x20%s,\x20%s',_0x5ab39f,_0x33c10b[_0x4e64('0x12')][_0x4e64('0x13')]);return _0x3335f1(_0x33c10b[_0x4e64('0x12')][_0x4e64('0x13')]);}logger['error'](_0x4e64('0x14'),_0x5ab39f,_0x33c10b[_0x4e64('0x12')][_0x4e64('0x13')]);return _0x22f4a6(_0x33c10b[_0x4e64('0x12')][_0x4e64('0x13')]);}else{logger[_0x4e64('0x15')](_0x4e64('0x14'),_0x5ab39f,_0x4e64('0xe'));_0x22f4a6(_0x33c10b[_0x4e64('0x16')][_0x4e64('0x13')]);}})['catch'](function(_0x4dd60d){logger[_0x4e64('0x12')]('DeskAccount,\x20%s,\x20%s',_0x5ab39f,_0x4dd60d);_0x3335f1(_0x4dd60d);});});}exports[_0x4e64('0x17')]=function(_0x442502){var _0x4ced50=this;return new Promise(function(_0x5ae549,_0x44840b){return db[_0x4e64('0x18')][_0x4e64('0x19')]({'raw':_0x442502[_0x4e64('0x1a')]?_0x442502['options']['raw']===undefined?!![]:![]:!![],'where':_0x442502[_0x4e64('0x1a')]?_0x442502[_0x4e64('0x1a')]['where']||null:null,'attributes':_0x442502[_0x4e64('0x1a')]?_0x442502[_0x4e64('0x1a')][_0x4e64('0x1b')]||null:null,'limit':_0x442502[_0x4e64('0x1a')]?_0x442502['options'][_0x4e64('0x1c')]||null:null,'include':_0x442502[_0x4e64('0x1a')]?_0x442502['options'][_0x4e64('0x1d')]?_[_0x4e64('0x1e')](_0x442502[_0x4e64('0x1a')][_0x4e64('0x1d')],function(_0x243a2a){return{'model':db[_0x243a2a[_0x4e64('0x1f')]],'as':_0x243a2a['as'],'attributes':_0x243a2a[_0x4e64('0x1b')],'include':_0x243a2a[_0x4e64('0x1d')]?_[_0x4e64('0x1e')](_0x243a2a['include'],function(_0x2dda65){return{'model':db[_0x2dda65[_0x4e64('0x1f')]],'as':_0x2dda65['as'],'attributes':_0x2dda65['attributes'],'include':_0x2dda65[_0x4e64('0x1d')]?_[_0x4e64('0x1e')](_0x2dda65[_0x4e64('0x1d')],function(_0x575c1b){return{'model':db[_0x575c1b[_0x4e64('0x1f')]],'as':_0x575c1b['as'],'attributes':_0x575c1b[_0x4e64('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4e64('0x20')](function(_0x3f7cd3){logger[_0x4e64('0x15')](_0x4e64('0x17'),_0x442502);logger[_0x4e64('0xf')](_0x4e64('0x17'),_0x442502,JSON[_0x4e64('0x10')](_0x3f7cd3));_0x5ae549(_0x3f7cd3);})[_0x4e64('0x21')](function(_0x171d21){logger['error'](_0x4e64('0x17'),_0x171d21[_0x4e64('0x13')],_0x442502);_0x44840b(_0x4ced50['error'](0x1f4,_0x171d21[_0x4e64('0x13')]));});});};exports[_0x4e64('0x22')]=function(_0x4ee410){var _0x3ecd17=this;return new Promise(function(_0x3cc51b,_0x220440){return db[_0x4e64('0x18')][_0x4e64('0x23')]({'raw':_0x4ee410[_0x4e64('0x1a')]?_0x4ee410['options'][_0x4e64('0x24')]===undefined?!![]:![]:!![],'where':_0x4ee410[_0x4e64('0x1a')]?_0x4ee410['options'][_0x4e64('0x25')]||null:null,'attributes':_0x4ee410[_0x4e64('0x1a')]?_0x4ee410[_0x4e64('0x1a')][_0x4e64('0x1b')]||null:null,'include':_0x4ee410[_0x4e64('0x1a')]?_0x4ee410[_0x4e64('0x1a')][_0x4e64('0x1d')]?_['map'](_0x4ee410[_0x4e64('0x1a')]['include'],function(_0x4a4bd5){return{'model':db[_0x4a4bd5[_0x4e64('0x1f')]],'as':_0x4a4bd5['as'],'attributes':_0x4a4bd5[_0x4e64('0x1b')],'include':_0x4a4bd5[_0x4e64('0x1d')]?_[_0x4e64('0x1e')](_0x4a4bd5[_0x4e64('0x1d')],function(_0x295732){return{'model':db[_0x295732[_0x4e64('0x1f')]],'as':_0x295732['as'],'attributes':_0x295732['attributes'],'include':_0x295732[_0x4e64('0x1d')]?_['map'](_0x295732[_0x4e64('0x1d')],function(_0x3c2f9e){return{'model':db[_0x3c2f9e[_0x4e64('0x1f')]],'as':_0x3c2f9e['as'],'attributes':_0x3c2f9e[_0x4e64('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4e64('0x20')](function(_0x2bcf61){logger[_0x4e64('0x15')]('ShowDeskAccount',_0x4ee410);logger[_0x4e64('0xf')](_0x4e64('0x22'),_0x4ee410,JSON[_0x4e64('0x10')](_0x2bcf61));_0x3cc51b(_0x2bcf61);})[_0x4e64('0x21')](function(_0x306d63){logger[_0x4e64('0x12')]('ShowDeskAccount',_0x306d63[_0x4e64('0x13')],_0x4ee410);_0x220440(_0x3ecd17[_0x4e64('0x12')](0x1f4,_0x306d63['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 1d3b5a2..a59c991 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_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 +var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xdbf4d0,_0xde309b){var _0x1d5450=function(_0x3a4577){while(--_0x3a4577){_0xdbf4d0['push'](_0xdbf4d0['shift']());}};_0x1d5450(++_0xde309b);}(_0x008c,0x188));var _0xc008=function(_0x455161,_0x520f10){_0x455161=_0x455161-0x0;var _0x3e7c03=_0x008c[_0x455161];return _0x3e7c03;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 9d46f28..ddc210e 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 _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 +var _0x59d2=['exports','STRING','sequelize'];(function(_0x468c03,_0x190103){var _0x5b12ba=function(_0xcc8da0){while(--_0xcc8da0){_0x468c03['push'](_0x468c03['shift']());}};_0x5b12ba(++_0x190103);}(_0x59d2,0x77));var _0x259d=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0x59d2[_0x26b8b5];return _0x2150a9;};'use strict';var Sequelize=require(_0x259d('0x0'));module[_0x259d('0x1')]={'name':{'type':Sequelize[_0x259d('0x2')]},'description':{'type':Sequelize[_0x259d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 77a5fec..f06b927 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 _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 +var _0xcac8=['intersection','attributes','fields','length','nolimit','sort','filters','where','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getFields','findOne','DeskField','order','hasOwnProperty','getSubjects','getDescriptions','pick','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskConfiguration','fieldName','type','key','model','query','keys'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0xcac8,0x1f0));var _0x8cac=function(_0x526cf2,_0x13387e){_0x526cf2=_0x526cf2-0x0;var _0x5afdf1=_0xcac8[_0x526cf2];return _0x5afdf1;};'use strict';var emlformat=require(_0x8cac('0x0'));var rimraf=require(_0x8cac('0x1'));var zipdir=require(_0x8cac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8cac('0x3'));var BPromise=require(_0x8cac('0x4'));var Mustache=require(_0x8cac('0x5'));var util=require(_0x8cac('0x6'));var path=require(_0x8cac('0x7'));var sox=require(_0x8cac('0x8'));var csv=require(_0x8cac('0x9'));var ejs=require(_0x8cac('0xa'));var fs=require('fs');var fs_extra=require(_0x8cac('0xb'));var _=require(_0x8cac('0xc'));var squel=require(_0x8cac('0xd'));var crypto=require(_0x8cac('0xe'));var jsforce=require(_0x8cac('0xf'));var deskjs=require(_0x8cac('0x10'));var toCsv=require(_0x8cac('0x9'));var querystring=require(_0x8cac('0x11'));var Papa=require(_0x8cac('0x12'));var Redis=require(_0x8cac('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8cac('0x14'));var as=require(_0x8cac('0x15'));var hardwareService=require(_0x8cac('0x16'));var logger=require(_0x8cac('0x17'))(_0x8cac('0x18'));var utils=require(_0x8cac('0x19'));var config=require(_0x8cac('0x1a'));var licenseUtil=require(_0x8cac('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x184dd7,_0x1338de){_0x1338de=_0x1338de||0xcc;return function(_0xa5ae3f){if(_0xa5ae3f){return _0x184dd7[_0x8cac('0x1c')](_0x1338de);}return _0x184dd7[_0x8cac('0x1d')](_0x1338de)[_0x8cac('0x1e')]();};}function respondWithResult(_0x48c233,_0x29a8ee){_0x29a8ee=_0x29a8ee||0xc8;return function(_0x5e15c7){if(_0x5e15c7){return _0x48c233[_0x8cac('0x1d')](_0x29a8ee)['json'](_0x5e15c7);}};}function respondWithFilteredResult(_0x87c446,_0x1eec14){return function(_0x1930f8){if(_0x1930f8){var _0x14c157=typeof _0x1eec14[_0x8cac('0x1f')]===_0x8cac('0x20')&&typeof _0x1eec14[_0x8cac('0x21')]===_0x8cac('0x20');var _0x428493=_0x1930f8['count'];var _0x3186fa=_0x14c157?0x0:_0x1eec14[_0x8cac('0x1f')];var _0x1f569c=_0x14c157?_0x1930f8['count']:_0x1eec14[_0x8cac('0x1f')]+_0x1eec14[_0x8cac('0x21')];var _0x18ff56;if(_0x1f569c>=_0x428493){_0x1f569c=_0x428493;_0x18ff56=0xc8;}else{_0x18ff56=0xce;}_0x87c446[_0x8cac('0x1d')](_0x18ff56);return _0x87c446[_0x8cac('0x22')](_0x8cac('0x23'),_0x3186fa+'-'+_0x1f569c+'/'+_0x428493)[_0x8cac('0x24')](_0x1930f8);}return null;};}function patchUpdates(_0x143812){return function(_0x39a924){try{jsonpatch[_0x8cac('0x25')](_0x39a924,_0x143812,!![]);}catch(_0x288781){return BPromise[_0x8cac('0x26')](_0x288781);}return _0x39a924[_0x8cac('0x27')]();};}function saveUpdates(_0x58dbd8,_0x13ae4c){return function(_0x160cb8){if(_0x160cb8){return _0x160cb8[_0x8cac('0x28')](_0x58dbd8)[_0x8cac('0x29')](function(_0x159244){return _0x159244;});}return null;};}function removeEntity(_0x46a4f0,_0x450329){return function(_0x1b2ad4){if(_0x1b2ad4){return _0x1b2ad4[_0x8cac('0x2a')]()['then'](function(){_0x46a4f0[_0x8cac('0x1d')](0xcc)[_0x8cac('0x1e')]();});}};}function handleEntityNotFound(_0x553899,_0x434e09){return function(_0x52e06b){if(!_0x52e06b){_0x553899[_0x8cac('0x1c')](0x194);}return _0x52e06b;};}function handleError(_0x364c61,_0x3bb9f7){_0x3bb9f7=_0x3bb9f7||0x1f4;return function(_0x4fc526){logger[_0x8cac('0x2b')](_0x4fc526[_0x8cac('0x2c')]);if(_0x4fc526[_0x8cac('0x2d')]){delete _0x4fc526[_0x8cac('0x2d')];}_0x364c61[_0x8cac('0x1d')](_0x3bb9f7)[_0x8cac('0x2e')](_0x4fc526);};}exports[_0x8cac('0x2f')]=function(_0x5125cb,_0x1766a0){var _0x219791={},_0x285c7f={},_0x4ea435={'count':0x0,'rows':[]};var _0x2b95dd=_[_0x8cac('0x30')](db[_0x8cac('0x31')]['rawAttributes'],function(_0x58442b){return{'name':_0x58442b[_0x8cac('0x32')],'type':_0x58442b[_0x8cac('0x33')][_0x8cac('0x34')]};});_0x285c7f[_0x8cac('0x35')]=_['map'](_0x2b95dd,'name');_0x285c7f[_0x8cac('0x36')]=_[_0x8cac('0x37')](_0x5125cb['query']);_0x285c7f['filters']=_[_0x8cac('0x38')](_0x285c7f['model'],_0x285c7f['query']);_0x219791[_0x8cac('0x39')]=_[_0x8cac('0x38')](_0x285c7f[_0x8cac('0x35')],qs[_0x8cac('0x3a')](_0x5125cb[_0x8cac('0x36')][_0x8cac('0x3a')]));_0x219791[_0x8cac('0x39')]=_0x219791[_0x8cac('0x39')][_0x8cac('0x3b')]?_0x219791['attributes']:_0x285c7f['model'];if(!_0x5125cb[_0x8cac('0x36')]['hasOwnProperty'](_0x8cac('0x3c'))){_0x219791[_0x8cac('0x21')]=qs[_0x8cac('0x21')](_0x5125cb[_0x8cac('0x36')][_0x8cac('0x21')]);_0x219791[_0x8cac('0x1f')]=qs[_0x8cac('0x1f')](_0x5125cb[_0x8cac('0x36')][_0x8cac('0x1f')]);}_0x219791['order']=qs[_0x8cac('0x3d')](_0x5125cb[_0x8cac('0x36')][_0x8cac('0x3d')]);_0x219791['where']=qs[_0x8cac('0x3e')](_['pick'](_0x5125cb['query'],_0x285c7f[_0x8cac('0x3e')]),_0x2b95dd);if(_0x5125cb[_0x8cac('0x36')]['filter']){_0x219791[_0x8cac('0x3f')]=_[_0x8cac('0x40')](_0x219791[_0x8cac('0x3f')],{'$or':_['map'](_0x2b95dd,function(_0x30c561){if(_0x30c561[_0x8cac('0x33')]!==_0x8cac('0x41')){var _0x5bd05c={};_0x5bd05c[_0x30c561[_0x8cac('0x2d')]]={'$like':'%'+_0x5125cb[_0x8cac('0x36')][_0x8cac('0x42')]+'%'};return _0x5bd05c;}})});}_0x219791=_[_0x8cac('0x40')]({},_0x219791,_0x5125cb[_0x8cac('0x43')]);var _0x50f414={'where':_0x219791[_0x8cac('0x3f')]};return db[_0x8cac('0x31')]['count'](_0x50f414)[_0x8cac('0x29')](function(_0x248969){_0x4ea435[_0x8cac('0x44')]=_0x248969;if(_0x5125cb['query'][_0x8cac('0x45')]){_0x219791[_0x8cac('0x46')]=[{'all':!![]}];}return db[_0x8cac('0x31')][_0x8cac('0x47')](_0x219791);})[_0x8cac('0x29')](function(_0x47d302){_0x4ea435[_0x8cac('0x48')]=_0x47d302;return _0x4ea435;})['then'](respondWithFilteredResult(_0x1766a0,_0x219791))[_0x8cac('0x49')](handleError(_0x1766a0,null));};exports[_0x8cac('0x4a')]=function(_0x376227,_0x3c62b8){var _0x1bb305={'raw':![],'where':{'id':_0x376227[_0x8cac('0x4b')]['id']}},_0x12ef5f={};_0x12ef5f[_0x8cac('0x35')]=_['keys'](db['DeskConfiguration'][_0x8cac('0x4c')]);_0x12ef5f[_0x8cac('0x36')]=_[_0x8cac('0x37')](_0x376227['query']);_0x12ef5f[_0x8cac('0x3e')]=_[_0x8cac('0x38')](_0x12ef5f[_0x8cac('0x35')],_0x12ef5f[_0x8cac('0x36')]);_0x1bb305[_0x8cac('0x39')]=_['intersection'](_0x12ef5f[_0x8cac('0x35')],qs['fields'](_0x376227[_0x8cac('0x36')][_0x8cac('0x3a')]));_0x1bb305['attributes']=_0x1bb305[_0x8cac('0x39')][_0x8cac('0x3b')]?_0x1bb305[_0x8cac('0x39')]:_0x12ef5f['model'];if(_0x376227[_0x8cac('0x36')][_0x8cac('0x45')]){_0x1bb305[_0x8cac('0x46')]=[{'all':!![]}];}_0x1bb305=_[_0x8cac('0x40')]({},_0x1bb305,_0x376227['options']);return db[_0x8cac('0x31')][_0x8cac('0x4d')](_0x1bb305)['then'](handleEntityNotFound(_0x3c62b8,null))[_0x8cac('0x29')](respondWithResult(_0x3c62b8,null))[_0x8cac('0x49')](handleError(_0x3c62b8,null));};exports[_0x8cac('0x4e')]=function(_0x380591,_0xe61517){return db[_0x8cac('0x31')][_0x8cac('0x4e')](_0x380591['body'],{})[_0x8cac('0x29')](respondWithResult(_0xe61517,0xc9))['catch'](handleError(_0xe61517,null));};exports[_0x8cac('0x28')]=function(_0x1b2473,_0x27cee8){if(_0x1b2473[_0x8cac('0x4f')]['id']){delete _0x1b2473[_0x8cac('0x4f')]['id'];}return db[_0x8cac('0x31')]['find']({'where':{'id':_0x1b2473['params']['id']}})[_0x8cac('0x29')](handleEntityNotFound(_0x27cee8,null))[_0x8cac('0x29')](saveUpdates(_0x1b2473[_0x8cac('0x4f')],null))[_0x8cac('0x29')](respondWithResult(_0x27cee8,null))[_0x8cac('0x49')](handleError(_0x27cee8,null));};exports['destroy']=function(_0x207b9f,_0x584cad){return db[_0x8cac('0x31')]['find']({'where':{'id':_0x207b9f[_0x8cac('0x4b')]['id']}})[_0x8cac('0x29')](handleEntityNotFound(_0x584cad,null))['then'](removeEntity(_0x584cad,null))[_0x8cac('0x49')](handleError(_0x584cad,null));};exports[_0x8cac('0x50')]=function(_0x4c7699,_0x1015b4,_0x3ec8d0){var _0x3c4fd4={};var _0x3ea7dd={};var _0x11a977;var _0x16d9a3;return db[_0x8cac('0x31')][_0x8cac('0x51')]({'where':{'id':_0x4c7699[_0x8cac('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1015b4,null))[_0x8cac('0x29')](function(_0xd073){if(_0xd073){_0x11a977=_0xd073;_0x3ea7dd[_0x8cac('0x35')]=_[_0x8cac('0x37')](db[_0x8cac('0x52')]['rawAttributes']);_0x3ea7dd[_0x8cac('0x36')]=_['keys'](_0x4c7699['query']);_0x3ea7dd[_0x8cac('0x3e')]=_[_0x8cac('0x38')](_0x3ea7dd[_0x8cac('0x35')],_0x3ea7dd[_0x8cac('0x36')]);_0x3c4fd4[_0x8cac('0x39')]=_[_0x8cac('0x38')](_0x3ea7dd['model'],qs[_0x8cac('0x3a')](_0x4c7699[_0x8cac('0x36')][_0x8cac('0x3a')]));_0x3c4fd4['attributes']=_0x3c4fd4[_0x8cac('0x39')]['length']?_0x3c4fd4[_0x8cac('0x39')]:_0x3ea7dd['model'];_0x3c4fd4[_0x8cac('0x53')]=qs[_0x8cac('0x3d')](_0x4c7699['query'][_0x8cac('0x3d')]);_0x3c4fd4[_0x8cac('0x3f')]=qs['filters'](_['pick'](_0x4c7699[_0x8cac('0x36')],_0x3ea7dd[_0x8cac('0x3e')]));if(_0x4c7699['query'][_0x8cac('0x42')]){_0x3c4fd4[_0x8cac('0x3f')]=_[_0x8cac('0x40')](_0x3c4fd4['where'],{'$or':_[_0x8cac('0x30')](_0x3c4fd4[_0x8cac('0x39')],function(_0x208858){var _0x20facf={};_0x20facf[_0x208858]={'$like':'%'+_0x4c7699[_0x8cac('0x36')][_0x8cac('0x42')]+'%'};return _0x20facf;})});}_0x3c4fd4=_['merge']({},_0x3c4fd4,_0x4c7699[_0x8cac('0x43')]);return _0x11a977[_0x8cac('0x50')](_0x3c4fd4);}})[_0x8cac('0x29')](function(_0xe20550){if(_0xe20550){_0x16d9a3=_0xe20550[_0x8cac('0x3b')];if(!_0x4c7699[_0x8cac('0x36')][_0x8cac('0x54')](_0x8cac('0x3c'))){_0x3c4fd4[_0x8cac('0x21')]=qs[_0x8cac('0x21')](_0x4c7699[_0x8cac('0x36')][_0x8cac('0x21')]);_0x3c4fd4['offset']=qs['offset'](_0x4c7699[_0x8cac('0x36')][_0x8cac('0x1f')]);}return _0x11a977[_0x8cac('0x50')](_0x3c4fd4);}})[_0x8cac('0x29')](function(_0x2b28e2){if(_0x2b28e2){return _0x2b28e2?{'count':_0x16d9a3,'rows':_0x2b28e2}:null;}})[_0x8cac('0x29')](respondWithResult(_0x1015b4,null))[_0x8cac('0x49')](handleError(_0x1015b4,null));};exports[_0x8cac('0x55')]=function(_0x50ce5c,_0x39af5b,_0x2cd0ad){var _0x4e651a={};var _0x3e2314={};var _0xee2761;var _0x5f1da4;return db['DeskConfiguration'][_0x8cac('0x51')]({'where':{'id':_0x50ce5c[_0x8cac('0x4b')]['id']}})['then'](handleEntityNotFound(_0x39af5b,null))['then'](function(_0x1404f8){if(_0x1404f8){_0xee2761=_0x1404f8;_0x3e2314[_0x8cac('0x35')]=_['keys'](db[_0x8cac('0x52')][_0x8cac('0x4c')]);_0x3e2314[_0x8cac('0x36')]=_['keys'](_0x50ce5c['query']);_0x3e2314[_0x8cac('0x3e')]=_['intersection'](_0x3e2314[_0x8cac('0x35')],_0x3e2314['query']);_0x4e651a['attributes']=_[_0x8cac('0x38')](_0x3e2314[_0x8cac('0x35')],qs[_0x8cac('0x3a')](_0x50ce5c[_0x8cac('0x36')][_0x8cac('0x3a')]));_0x4e651a[_0x8cac('0x39')]=_0x4e651a['attributes'][_0x8cac('0x3b')]?_0x4e651a[_0x8cac('0x39')]:_0x3e2314['model'];_0x4e651a[_0x8cac('0x53')]=qs['sort'](_0x50ce5c[_0x8cac('0x36')][_0x8cac('0x3d')]);_0x4e651a['where']=qs[_0x8cac('0x3e')](_['pick'](_0x50ce5c[_0x8cac('0x36')],_0x3e2314[_0x8cac('0x3e')]));if(_0x50ce5c[_0x8cac('0x36')]['filter']){_0x4e651a[_0x8cac('0x3f')]=_['merge'](_0x4e651a[_0x8cac('0x3f')],{'$or':_[_0x8cac('0x30')](_0x4e651a[_0x8cac('0x39')],function(_0x40057e){var _0x1f4b67={};_0x1f4b67[_0x40057e]={'$like':'%'+_0x50ce5c[_0x8cac('0x36')][_0x8cac('0x42')]+'%'};return _0x1f4b67;})});}_0x4e651a=_[_0x8cac('0x40')]({},_0x4e651a,_0x50ce5c[_0x8cac('0x43')]);return _0xee2761[_0x8cac('0x55')](_0x4e651a);}})[_0x8cac('0x29')](function(_0x4fb3cf){if(_0x4fb3cf){_0x5f1da4=_0x4fb3cf[_0x8cac('0x3b')];if(!_0x50ce5c[_0x8cac('0x36')][_0x8cac('0x54')](_0x8cac('0x3c'))){_0x4e651a[_0x8cac('0x21')]=qs[_0x8cac('0x21')](_0x50ce5c['query']['limit']);_0x4e651a[_0x8cac('0x1f')]=qs[_0x8cac('0x1f')](_0x50ce5c[_0x8cac('0x36')][_0x8cac('0x1f')]);}return _0xee2761[_0x8cac('0x55')](_0x4e651a);}})[_0x8cac('0x29')](function(_0xfb4287){if(_0xfb4287){return _0xfb4287?{'count':_0x5f1da4,'rows':_0xfb4287}:null;}})[_0x8cac('0x29')](respondWithResult(_0x39af5b,null))['catch'](handleError(_0x39af5b,null));};exports[_0x8cac('0x56')]=function(_0x4c251e,_0x15da57,_0x3f7275){var _0x519aba={};var _0x25bdcd={};var _0x2fe76a;var _0x35d91e;return db[_0x8cac('0x31')][_0x8cac('0x51')]({'where':{'id':_0x4c251e[_0x8cac('0x4b')]['id']}})[_0x8cac('0x29')](handleEntityNotFound(_0x15da57,null))[_0x8cac('0x29')](function(_0x1d2394){if(_0x1d2394){_0x2fe76a=_0x1d2394;_0x25bdcd[_0x8cac('0x35')]=_[_0x8cac('0x37')](db[_0x8cac('0x52')]['rawAttributes']);_0x25bdcd[_0x8cac('0x36')]=_[_0x8cac('0x37')](_0x4c251e[_0x8cac('0x36')]);_0x25bdcd[_0x8cac('0x3e')]=_[_0x8cac('0x38')](_0x25bdcd['model'],_0x25bdcd[_0x8cac('0x36')]);_0x519aba[_0x8cac('0x39')]=_[_0x8cac('0x38')](_0x25bdcd[_0x8cac('0x35')],qs['fields'](_0x4c251e['query']['fields']));_0x519aba[_0x8cac('0x39')]=_0x519aba['attributes']['length']?_0x519aba[_0x8cac('0x39')]:_0x25bdcd[_0x8cac('0x35')];_0x519aba[_0x8cac('0x53')]=qs['sort'](_0x4c251e[_0x8cac('0x36')][_0x8cac('0x3d')]);_0x519aba[_0x8cac('0x3f')]=qs[_0x8cac('0x3e')](_[_0x8cac('0x57')](_0x4c251e['query'],_0x25bdcd['filters']));if(_0x4c251e[_0x8cac('0x36')][_0x8cac('0x42')]){_0x519aba[_0x8cac('0x3f')]=_['merge'](_0x519aba[_0x8cac('0x3f')],{'$or':_[_0x8cac('0x30')](_0x519aba['attributes'],function(_0x249879){var _0xfc4133={};_0xfc4133[_0x249879]={'$like':'%'+_0x4c251e[_0x8cac('0x36')][_0x8cac('0x42')]+'%'};return _0xfc4133;})});}_0x519aba=_[_0x8cac('0x40')]({},_0x519aba,_0x4c251e[_0x8cac('0x43')]);return _0x2fe76a[_0x8cac('0x56')](_0x519aba);}})['then'](function(_0x45c1e4){if(_0x45c1e4){_0x35d91e=_0x45c1e4[_0x8cac('0x3b')];if(!_0x4c251e[_0x8cac('0x36')]['hasOwnProperty'](_0x8cac('0x3c'))){_0x519aba[_0x8cac('0x21')]=qs['limit'](_0x4c251e[_0x8cac('0x36')][_0x8cac('0x21')]);_0x519aba[_0x8cac('0x1f')]=qs[_0x8cac('0x1f')](_0x4c251e[_0x8cac('0x36')][_0x8cac('0x1f')]);}return _0x2fe76a[_0x8cac('0x56')](_0x519aba);}})['then'](function(_0x5790cd){if(_0x5790cd){return _0x5790cd?{'count':_0x35d91e,'rows':_0x5790cd}:null;}})[_0x8cac('0x29')](respondWithResult(_0x15da57,null))[_0x8cac('0x49')](handleError(_0x15da57,null));};exports['getTags']=function(_0xfdec28,_0x2eaa5a,_0xb8af62){var _0x37a752={};var _0x21494e={};var _0x3eb61e;var _0x510879;return db[_0x8cac('0x31')]['findOne']({'where':{'id':_0xfdec28['params']['id']}})['then'](handleEntityNotFound(_0x2eaa5a,null))[_0x8cac('0x29')](function(_0x4dca2b){if(_0x4dca2b){_0x3eb61e=_0x4dca2b;_0x21494e[_0x8cac('0x35')]=_['keys'](db[_0x8cac('0x58')][_0x8cac('0x4c')]);_0x21494e['query']=_['keys'](_0xfdec28[_0x8cac('0x36')]);_0x21494e[_0x8cac('0x3e')]=_['intersection'](_0x21494e[_0x8cac('0x35')],_0x21494e[_0x8cac('0x36')]);_0x37a752[_0x8cac('0x39')]=_['intersection'](_0x21494e[_0x8cac('0x35')],qs['fields'](_0xfdec28[_0x8cac('0x36')][_0x8cac('0x3a')]));_0x37a752[_0x8cac('0x39')]=_0x37a752[_0x8cac('0x39')][_0x8cac('0x3b')]?_0x37a752['attributes']:_0x21494e['model'];_0x37a752[_0x8cac('0x53')]=qs['sort'](_0xfdec28[_0x8cac('0x36')]['sort']);_0x37a752[_0x8cac('0x3f')]=qs['filters'](_[_0x8cac('0x57')](_0xfdec28[_0x8cac('0x36')],_0x21494e[_0x8cac('0x3e')]));if(_0xfdec28['query'][_0x8cac('0x42')]){_0x37a752[_0x8cac('0x3f')]=_[_0x8cac('0x40')](_0x37a752[_0x8cac('0x3f')],{'$or':_[_0x8cac('0x30')](_0x37a752[_0x8cac('0x39')],function(_0x117a9c){var _0x2df4b6={};_0x2df4b6[_0x117a9c]={'$like':'%'+_0xfdec28['query'][_0x8cac('0x42')]+'%'};return _0x2df4b6;})});}_0x37a752=_[_0x8cac('0x40')]({},_0x37a752,_0xfdec28[_0x8cac('0x43')]);return _0x3eb61e['getTags'](_0x37a752);}})['then'](function(_0x11cf0f){if(_0x11cf0f){_0x510879=_0x11cf0f[_0x8cac('0x3b')];if(!_0xfdec28[_0x8cac('0x36')][_0x8cac('0x54')]('nolimit')){_0x37a752['limit']=qs[_0x8cac('0x21')](_0xfdec28[_0x8cac('0x36')]['limit']);_0x37a752[_0x8cac('0x1f')]=qs['offset'](_0xfdec28[_0x8cac('0x36')][_0x8cac('0x1f')]);}return _0x3eb61e[_0x8cac('0x59')](_0x37a752);}})[_0x8cac('0x29')](function(_0x1021ca){if(_0x1021ca){return _0x1021ca?{'count':_0x510879,'rows':_0x1021ca}:null;}})['then'](respondWithResult(_0x2eaa5a,null))['catch'](handleError(_0x2eaa5a,null));};exports['setTags']=function(_0x1b6e28,_0x18f220,_0xa611f9){if(_0x1b6e28['body']['id']){delete _0x1b6e28[_0x8cac('0x4f')]['id'];}return db[_0x8cac('0x31')]['findOne']({'where':{'id':_0x1b6e28[_0x8cac('0x4b')]['id']}})[_0x8cac('0x29')](handleEntityNotFound(_0x18f220,null))[_0x8cac('0x29')](function(_0x5f3d3a){if(_0x5f3d3a){return _0x5f3d3a[_0x8cac('0x5a')](_0x1b6e28['body'][_0x8cac('0x5b')]||[]);}return null;})[_0x8cac('0x29')](respondWithResult(_0x18f220,null))['catch'](handleError(_0x18f220,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 264cd97..5353e52 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 _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 +var _0xbbdd=['define','DeskConfiguration','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x28cd1c,_0x80d8fb){var _0x574b49=function(_0x1c8887){while(--_0x1c8887){_0x28cd1c['push'](_0x28cd1c['shift']());}};_0x574b49(++_0x80d8fb);}(_0xbbdd,0xa2));var _0xdbbd=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xbbdd[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdbbd('0x0'))('api');var moment=require('moment');var BPromise=require(_0xdbbd('0x1'));var rp=require(_0xdbbd('0x2'));var fs=require('fs');var path=require(_0xdbbd('0x3'));var rimraf=require(_0xdbbd('0x4'));var config=require(_0xdbbd('0x5'));var attributes=require(_0xdbbd('0x6'));module[_0xdbbd('0x7')]=function(_0x58a7ed,_0x247dc9){return _0x58a7ed[_0xdbbd('0x8')](_0xdbbd('0x9'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index b812380..58af557 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 _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 +var _0xf6fa=['info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x594de8,_0x46d0d2){var _0x5fcbf=function(_0x48c215){while(--_0x48c215){_0x594de8['push'](_0x594de8['shift']());}};_0x5fcbf(++_0x46d0d2);}(_0xf6fa,0x87));var _0xaf6f=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf6fa[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0xaf6f('0x0'));var moment=require('moment');var BPromise=require(_0xaf6f('0x1'));var rs=require(_0xaf6f('0x2'));var fs=require('fs');var Redis=require(_0xaf6f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaf6f('0x4'))(_0xaf6f('0x5'));var config=require(_0xaf6f('0x6'));var jayson=require(_0xaf6f('0x7'));var client=jayson[_0xaf6f('0x8')][_0xaf6f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x878ae0,_0x2e1eb8,_0x290271){return new BPromise(function(_0x9c9b7b,_0x4efcfa){return client[_0xaf6f('0xa')](_0x878ae0,_0x290271)[_0xaf6f('0xb')](function(_0x2c89c1){logger[_0xaf6f('0xc')](_0xaf6f('0xd'),_0x2e1eb8,_0xaf6f('0xe'));logger['debug'](_0xaf6f('0xf'),_0x2e1eb8,_0xaf6f('0xe'),JSON[_0xaf6f('0x10')](_0x2c89c1));if(_0x2c89c1[_0xaf6f('0x11')]){if(_0x2c89c1['error']['code']===0x1f4){logger[_0xaf6f('0x11')](_0xaf6f('0xd'),_0x2e1eb8,_0x2c89c1[_0xaf6f('0x11')]['message']);return _0x4efcfa(_0x2c89c1['error']['message']);}logger['error'](_0xaf6f('0xd'),_0x2e1eb8,_0x2c89c1[_0xaf6f('0x11')]['message']);return _0x9c9b7b(_0x2c89c1[_0xaf6f('0x11')][_0xaf6f('0x12')]);}else{logger[_0xaf6f('0xc')](_0xaf6f('0xd'),_0x2e1eb8,'request\x20sent');_0x9c9b7b(_0x2c89c1[_0xaf6f('0x13')][_0xaf6f('0x12')]);}})[_0xaf6f('0x14')](function(_0x566adb){logger[_0xaf6f('0x11')](_0xaf6f('0xd'),_0x2e1eb8,_0x566adb);_0x4efcfa(_0x566adb);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index bc3a846..b6cdc72 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 _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 +var _0x27d7=['destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','get','/:id','show','post','create','put','update','delete'];(function(_0xbfa61c,_0x4d9a1d){var _0x45cd82=function(_0x4d87c1){while(--_0x4d87c1){_0xbfa61c['push'](_0xbfa61c['shift']());}};_0x45cd82(++_0x4d9a1d);}(_0x27d7,0xa4));var _0x727d=function(_0x46261b,_0xd68542){_0x46261b=_0x46261b-0x0;var _0x31e36f=_0x27d7[_0x46261b];return _0x31e36f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x727d('0x0'));var timeout=require(_0x727d('0x1'));var express=require('express');var router=express[_0x727d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x727d('0x3'));var interaction=require(_0x727d('0x4'));var config=require(_0x727d('0x5'));var controller=require(_0x727d('0x6'));router['get']('/',auth[_0x727d('0x7')](),controller['index']);router[_0x727d('0x8')](_0x727d('0x9'),auth[_0x727d('0x7')](),controller[_0x727d('0xa')]);router[_0x727d('0xb')]('/',auth[_0x727d('0x7')](),controller[_0x727d('0xc')]);router[_0x727d('0xd')](_0x727d('0x9'),auth[_0x727d('0x7')](),controller[_0x727d('0xe')]);router[_0x727d('0xf')](_0x727d('0x9'),auth[_0x727d('0x7')](),controller[_0x727d('0x10')]);module[_0x727d('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 372c527..d1bad1d 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 _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 +var _0x55d7=['ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports'];(function(_0x31a655,_0x581842){var _0x361094=function(_0x2529bc){while(--_0x2529bc){_0x31a655['push'](_0x31a655['shift']());}};_0x361094(++_0x581842);}(_0x55d7,0x17a));var _0x755d=function(_0x179038,_0x5cdc63){_0x179038=_0x179038-0x0;var _0x437bbb=_0x55d7[_0x179038];return _0x437bbb;};'use strict';var Sequelize=require(_0x755d('0x0'));module[_0x755d('0x1')]={'type':{'type':Sequelize[_0x755d('0x2')]('string',_0x755d('0x3'),_0x755d('0x4'),_0x755d('0x5'),_0x755d('0x6')),'defaultValue':_0x755d('0x7')},'content':{'type':Sequelize[_0x755d('0x8')]},'key':{'type':Sequelize[_0x755d('0x8')]},'keyType':{'type':Sequelize[_0x755d('0x2')](_0x755d('0x7'),_0x755d('0x3'),_0x755d('0x4'))},'keyContent':{'type':Sequelize[_0x755d('0x8')]},'idField':{'type':Sequelize[_0x755d('0x8')]},'nameField':{'type':Sequelize[_0x755d('0x8')]},'customField':{'type':Sequelize[_0x755d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x755d('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 2a781f6..874d0b6 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 _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 +var _0xbc48=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','DeskField','length','create','body','update','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x227ea7,_0x41c043){var _0x11705c=function(_0x29d01f){while(--_0x29d01f){_0x227ea7['push'](_0x227ea7['shift']());}};_0x11705c(++_0x41c043);}(_0xbc48,0x111));var _0x8bc4=function(_0x4bd8ec,_0x114640){_0x4bd8ec=_0x4bd8ec-0x0;var _0x50b294=_0xbc48[_0x4bd8ec];return _0x50b294;};'use strict';var emlformat=require(_0x8bc4('0x0'));var rimraf=require(_0x8bc4('0x1'));var zipdir=require(_0x8bc4('0x2'));var jsonpatch=require(_0x8bc4('0x3'));var rp=require('request-promise');var moment=require(_0x8bc4('0x4'));var BPromise=require(_0x8bc4('0x5'));var Mustache=require(_0x8bc4('0x6'));var util=require(_0x8bc4('0x7'));var path=require('path');var sox=require(_0x8bc4('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8bc4('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8bc4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x8bc4('0xb'));var querystring=require(_0x8bc4('0xc'));var Papa=require(_0x8bc4('0xd'));var Redis=require(_0x8bc4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8bc4('0xf'));var as=require(_0x8bc4('0x10'));var hardwareService=require(_0x8bc4('0x11'));var logger=require(_0x8bc4('0x12'))(_0x8bc4('0x13'));var utils=require(_0x8bc4('0x14'));var config=require(_0x8bc4('0x15'));var licenseUtil=require(_0x8bc4('0x16'));var db=require(_0x8bc4('0x17'))['db'];function respondWithStatusCode(_0x1f842d,_0xf04517){_0xf04517=_0xf04517||0xcc;return function(_0x1ec0e2){if(_0x1ec0e2){return _0x1f842d[_0x8bc4('0x18')](_0xf04517);}return _0x1f842d[_0x8bc4('0x19')](_0xf04517)[_0x8bc4('0x1a')]();};}function respondWithResult(_0x55e23a,_0x2617dc){_0x2617dc=_0x2617dc||0xc8;return function(_0x198f18){if(_0x198f18){return _0x55e23a[_0x8bc4('0x19')](_0x2617dc)[_0x8bc4('0x1b')](_0x198f18);}};}function respondWithFilteredResult(_0x2e1213,_0x3e3690){return function(_0x5cd8f7){if(_0x5cd8f7){var _0x4d2530=typeof _0x3e3690['offset']===_0x8bc4('0x1c')&&typeof _0x3e3690['limit']===_0x8bc4('0x1c');var _0x45244b=_0x5cd8f7[_0x8bc4('0x1d')];var _0x5982e6=_0x4d2530?0x0:_0x3e3690[_0x8bc4('0x1e')];var _0x968929=_0x4d2530?_0x5cd8f7['count']:_0x3e3690[_0x8bc4('0x1e')]+_0x3e3690['limit'];var _0x659ae3;if(_0x968929>=_0x45244b){_0x968929=_0x45244b;_0x659ae3=0xc8;}else{_0x659ae3=0xce;}_0x2e1213['status'](_0x659ae3);return _0x2e1213['set'](_0x8bc4('0x1f'),_0x5982e6+'-'+_0x968929+'/'+_0x45244b)[_0x8bc4('0x1b')](_0x5cd8f7);}return null;};}function patchUpdates(_0x415598){return function(_0x3c5dba){try{jsonpatch[_0x8bc4('0x20')](_0x3c5dba,_0x415598,!![]);}catch(_0xf0a578){return BPromise[_0x8bc4('0x21')](_0xf0a578);}return _0x3c5dba[_0x8bc4('0x22')]();};}function saveUpdates(_0x26c5e9,_0x3b402f){return function(_0x148fda){if(_0x148fda){return _0x148fda['update'](_0x26c5e9)[_0x8bc4('0x23')](function(_0x33f5b1){return _0x33f5b1;});}return null;};}function removeEntity(_0x23329e,_0x546d83){return function(_0x327e90){if(_0x327e90){return _0x327e90[_0x8bc4('0x24')]()['then'](function(){_0x23329e[_0x8bc4('0x19')](0xcc)[_0x8bc4('0x1a')]();});}};}function handleEntityNotFound(_0x45118c,_0x4cb042){return function(_0x324e59){if(!_0x324e59){_0x45118c['sendStatus'](0x194);}return _0x324e59;};}function handleError(_0x57b437,_0xb44005){_0xb44005=_0xb44005||0x1f4;return function(_0x29aef5){logger[_0x8bc4('0x25')](_0x29aef5[_0x8bc4('0x26')]);if(_0x29aef5[_0x8bc4('0x27')]){delete _0x29aef5[_0x8bc4('0x27')];}_0x57b437[_0x8bc4('0x19')](_0xb44005)[_0x8bc4('0x28')](_0x29aef5);};}exports['index']=function(_0x56f462,_0x2f9cf4){var _0x39f657={},_0x3bada3={},_0x44fc89={'count':0x0,'rows':[]};var _0x134760=_[_0x8bc4('0x29')](db['DeskField'][_0x8bc4('0x2a')],function(_0x88f990){return{'name':_0x88f990[_0x8bc4('0x2b')],'type':_0x88f990[_0x8bc4('0x2c')]['key']};});_0x3bada3[_0x8bc4('0x2d')]=_[_0x8bc4('0x29')](_0x134760,_0x8bc4('0x27'));_0x3bada3[_0x8bc4('0x2e')]=_[_0x8bc4('0x2f')](_0x56f462['query']);_0x3bada3[_0x8bc4('0x30')]=_['intersection'](_0x3bada3[_0x8bc4('0x2d')],_0x3bada3[_0x8bc4('0x2e')]);_0x39f657[_0x8bc4('0x31')]=_[_0x8bc4('0x32')](_0x3bada3['model'],qs['fields'](_0x56f462[_0x8bc4('0x2e')][_0x8bc4('0x33')]));_0x39f657[_0x8bc4('0x31')]=_0x39f657[_0x8bc4('0x31')]['length']?_0x39f657['attributes']:_0x3bada3['model'];if(!_0x56f462[_0x8bc4('0x2e')][_0x8bc4('0x34')](_0x8bc4('0x35'))){_0x39f657['limit']=qs['limit'](_0x56f462['query']['limit']);_0x39f657['offset']=qs[_0x8bc4('0x1e')](_0x56f462[_0x8bc4('0x2e')][_0x8bc4('0x1e')]);}_0x39f657['order']=qs[_0x8bc4('0x36')](_0x56f462[_0x8bc4('0x2e')][_0x8bc4('0x36')]);_0x39f657['where']=qs[_0x8bc4('0x30')](_[_0x8bc4('0x37')](_0x56f462[_0x8bc4('0x2e')],_0x3bada3[_0x8bc4('0x30')]),_0x134760);if(_0x56f462[_0x8bc4('0x2e')]['filter']){_0x39f657[_0x8bc4('0x38')]=_[_0x8bc4('0x39')](_0x39f657[_0x8bc4('0x38')],{'$or':_['map'](_0x134760,function(_0xe9a913){if(_0xe9a913[_0x8bc4('0x2c')]!==_0x8bc4('0x3a')){var _0x14a511={};_0x14a511[_0xe9a913[_0x8bc4('0x27')]]={'$like':'%'+_0x56f462[_0x8bc4('0x2e')][_0x8bc4('0x3b')]+'%'};return _0x14a511;}})});}_0x39f657=_[_0x8bc4('0x39')]({},_0x39f657,_0x56f462[_0x8bc4('0x3c')]);var _0x2fb60d={'where':_0x39f657[_0x8bc4('0x38')]};return db['DeskField']['count'](_0x2fb60d)[_0x8bc4('0x23')](function(_0x1f89f2){_0x44fc89['count']=_0x1f89f2;if(_0x56f462[_0x8bc4('0x2e')][_0x8bc4('0x3d')]){_0x39f657[_0x8bc4('0x3e')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x39f657);})[_0x8bc4('0x23')](function(_0x31be57){_0x44fc89[_0x8bc4('0x3f')]=_0x31be57;return _0x44fc89;})[_0x8bc4('0x23')](respondWithFilteredResult(_0x2f9cf4,_0x39f657))[_0x8bc4('0x40')](handleError(_0x2f9cf4,null));};exports[_0x8bc4('0x41')]=function(_0x270a7c,_0x53d524){var _0x4cceab={'raw':!![],'where':{'id':_0x270a7c['params']['id']}},_0x23f7a5={};_0x23f7a5['model']=_[_0x8bc4('0x2f')](db[_0x8bc4('0x42')][_0x8bc4('0x2a')]);_0x23f7a5[_0x8bc4('0x2e')]=_[_0x8bc4('0x2f')](_0x270a7c[_0x8bc4('0x2e')]);_0x23f7a5['filters']=_[_0x8bc4('0x32')](_0x23f7a5[_0x8bc4('0x2d')],_0x23f7a5['query']);_0x4cceab[_0x8bc4('0x31')]=_['intersection'](_0x23f7a5[_0x8bc4('0x2d')],qs['fields'](_0x270a7c[_0x8bc4('0x2e')][_0x8bc4('0x33')]));_0x4cceab[_0x8bc4('0x31')]=_0x4cceab['attributes'][_0x8bc4('0x43')]?_0x4cceab[_0x8bc4('0x31')]:_0x23f7a5[_0x8bc4('0x2d')];if(_0x270a7c[_0x8bc4('0x2e')]['includeAll']){_0x4cceab['include']=[{'all':!![]}];}_0x4cceab=_[_0x8bc4('0x39')]({},_0x4cceab,_0x270a7c[_0x8bc4('0x3c')]);return db[_0x8bc4('0x42')]['find'](_0x4cceab)['then'](handleEntityNotFound(_0x53d524,null))[_0x8bc4('0x23')](respondWithResult(_0x53d524,null))['catch'](handleError(_0x53d524,null));};exports[_0x8bc4('0x44')]=function(_0x38da9c,_0x1c758c){return db[_0x8bc4('0x42')][_0x8bc4('0x44')](_0x38da9c[_0x8bc4('0x45')],{})[_0x8bc4('0x23')](respondWithResult(_0x1c758c,0xc9))[_0x8bc4('0x40')](handleError(_0x1c758c,null));};exports[_0x8bc4('0x46')]=function(_0x2b739f,_0x188bce){if(_0x2b739f[_0x8bc4('0x45')]['id']){delete _0x2b739f[_0x8bc4('0x45')]['id'];}return db[_0x8bc4('0x42')][_0x8bc4('0x47')]({'where':{'id':_0x2b739f[_0x8bc4('0x48')]['id']}})['then'](handleEntityNotFound(_0x188bce,null))[_0x8bc4('0x23')](saveUpdates(_0x2b739f[_0x8bc4('0x45')],null))[_0x8bc4('0x23')](respondWithResult(_0x188bce,null))[_0x8bc4('0x40')](handleError(_0x188bce,null));};exports[_0x8bc4('0x24')]=function(_0x1c7b27,_0x1e6641){return db[_0x8bc4('0x42')]['find']({'where':{'id':_0x1c7b27[_0x8bc4('0x48')]['id']}})[_0x8bc4('0x23')](handleEntityNotFound(_0x1e6641,null))[_0x8bc4('0x23')](removeEntity(_0x1e6641,null))[_0x8bc4('0x40')](handleError(_0x1e6641,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index dab6650..50d8764 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 _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 +var _0x7def=['../../config/environment','exports','define','DeskField','int_desk_fields','idField','FieldId','lodash','util','../../config/logger','api','request-promise'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x7def,0xf7));var _0xf7de=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x7def[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0xf7de('0x0'));var util=require(_0xf7de('0x1'));var logger=require(_0xf7de('0x2'))(_0xf7de('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf7de('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf7de('0x5'));var attributes=require('./intDeskField.attributes');module[_0xf7de('0x6')]=function(_0x5cdc7b,_0x5911ca){return _0x5cdc7b[_0xf7de('0x7')](_0xf7de('0x8'),attributes,{'tableName':_0xf7de('0x9'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xf7de('0xa'),_0xf7de('0xb')],'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 7c73fe8..9278fac 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 _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 +var _0x9516=['result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x43776a,_0x4eb74c){var _0x18eb8f=function(_0x319afb){while(--_0x319afb){_0x43776a['push'](_0x43776a['shift']());}};_0x18eb8f(++_0x4eb74c);}(_0x9516,0xca));var _0x6951=function(_0x354404,_0x141542){_0x354404=_0x354404-0x0;var _0x1c10f8=_0x9516[_0x354404];return _0x1c10f8;};'use strict';var _=require('lodash');var util=require(_0x6951('0x0'));var moment=require(_0x6951('0x1'));var BPromise=require(_0x6951('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6951('0x3'))['db'];var utils=require(_0x6951('0x4'));var logger=require(_0x6951('0x5'))(_0x6951('0x6'));var config=require('../../config/environment');var jayson=require(_0x6951('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e1689,_0xec55d7,_0x2736a8){return new BPromise(function(_0x2fa692,_0x389d62){return client[_0x6951('0x8')](_0x5e1689,_0x2736a8)['then'](function(_0x5d9daa){logger[_0x6951('0x9')](_0x6951('0xa'),_0xec55d7,_0x6951('0xb'));logger[_0x6951('0xc')](_0x6951('0xd'),_0xec55d7,_0x6951('0xb'),JSON[_0x6951('0xe')](_0x5d9daa));if(_0x5d9daa[_0x6951('0xf')]){if(_0x5d9daa[_0x6951('0xf')][_0x6951('0x10')]===0x1f4){logger[_0x6951('0xf')](_0x6951('0xa'),_0xec55d7,_0x5d9daa[_0x6951('0xf')]['message']);return _0x389d62(_0x5d9daa['error'][_0x6951('0x11')]);}logger[_0x6951('0xf')](_0x6951('0xa'),_0xec55d7,_0x5d9daa[_0x6951('0xf')][_0x6951('0x11')]);return _0x2fa692(_0x5d9daa['error'][_0x6951('0x11')]);}else{logger[_0x6951('0x9')](_0x6951('0xa'),_0xec55d7,_0x6951('0xb'));_0x2fa692(_0x5d9daa[_0x6951('0x12')][_0x6951('0x11')]);}})[_0x6951('0x13')](function(_0xdbcb38){logger['error']('DeskField,\x20%s,\x20%s',_0xec55d7,_0xdbcb38);_0x389d62(_0xdbcb38);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 71f424b..36fe5af 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 _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 +var _0x56e8=['delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','post','create','addConfiguration','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x56e8,0x162));var _0x856e=function(_0x465c53,_0x313f50){_0x465c53=_0x465c53-0x0;var _0x4d0e3d=_0x56e8[_0x465c53];return _0x4d0e3d;};'use strict';var multer=require(_0x856e('0x0'));var util=require(_0x856e('0x1'));var path=require(_0x856e('0x2'));var timeout=require(_0x856e('0x3'));var express=require('express');var router=express[_0x856e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x856e('0x5'));var interaction=require(_0x856e('0x6'));var config=require(_0x856e('0x7'));var controller=require(_0x856e('0x8'));router[_0x856e('0x9')]('/',auth[_0x856e('0xa')](),controller['index']);router['get'](_0x856e('0xb'),auth[_0x856e('0xa')](),controller[_0x856e('0xc')]);router[_0x856e('0x9')](_0x856e('0xd'),auth[_0x856e('0xa')](),controller[_0x856e('0xe')]);router[_0x856e('0x9')]('/:id/fields',auth[_0x856e('0xa')](),controller['getFields']);router[_0x856e('0xf')]('/',auth[_0x856e('0xa')](),controller[_0x856e('0x10')]);router[_0x856e('0xf')](_0x856e('0xd'),auth['isAuthenticated'](),controller[_0x856e('0x11')]);router[_0x856e('0x12')]('/:id',auth[_0x856e('0xa')](),controller[_0x856e('0x13')]);router[_0x856e('0x14')](_0x856e('0xb'),auth[_0x856e('0xa')](),controller['destroy']);module[_0x856e('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 368164f..87dd9ec 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 _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 +var _0x0c42=['BOOLEAN','sequelize','exports','STRING'];(function(_0x4993ab,_0x5dce73){var _0x3d87f8=function(_0x2593c2){while(--_0x2593c2){_0x4993ab['push'](_0x4993ab['shift']());}};_0x3d87f8(++_0x5dce73);}(_0x0c42,0x191));var _0x20c4=function(_0xa5994f,_0x594f2d){_0xa5994f=_0xa5994f-0x0;var _0x4d578e=_0x0c42[_0xa5994f];return _0x4d578e;};'use strict';var Sequelize=require(_0x20c4('0x0'));module[_0x20c4('0x1')]={'name':{'type':Sequelize[_0x20c4('0x2')]},'username':{'type':Sequelize[_0x20c4('0x2')]},'password':{'type':Sequelize[_0x20c4('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x20c4('0x2')]},'clientSecret':{'type':Sequelize[_0x20c4('0x2')]},'serverUrl':{'type':Sequelize[_0x20c4('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x20c4('0x2')]},'modernAuthentication':{'type':Sequelize[_0x20c4('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 91e6da6..7c908f6 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 _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 +var _0x1611=['util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','limit','count','set','json','update','then','destroy','error','stack','name','send','index','Dynamics365Account','rawAttributes','type','model','map','keys','intersection','query','attributes','fields','length','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','getConfigurations','findOne','Dynamics365Configuration','nolimit','AccountId','getSubjects','Descriptions','channel','Subjects','Dynamics365Field','slice','substring','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','emailaddress','entitlementidname','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productserialnumber','resolveby','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','access_token','data5','/oauth2/token','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','DecimalAttributeMetadata','test','Wrong\x20credentials','statusCode','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Value','DisplayName','Label',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x1611,0xb9));var _0x1161=function(_0x367387,_0x152aec){_0x367387=_0x367387-0x0;var _0x146e53=_0x1611[_0x367387];return _0x146e53;};'use strict';var rp=require(_0x1161('0x0'));var util=require(_0x1161('0x1'));var _=require(_0x1161('0x2'));var qs=require(_0x1161('0x3'));var logger=require(_0x1161('0x4'))(_0x1161('0x5'));var db=require(_0x1161('0x6'))['db'];var integrations=require(_0x1161('0x7'));function respondWithResult(_0xc19c53,_0x126c04){_0x126c04=_0x126c04||0xc8;return function(_0x5d8228){if(_0x5d8228){return _0xc19c53[_0x1161('0x8')](_0x126c04)['json'](_0x5d8228);}};}function respondWithFilteredResult(_0x1ab40a,_0xf5f3ee){return function(_0x12fb93){if(_0x12fb93){var _0x532ca2=typeof _0xf5f3ee[_0x1161('0x9')]===_0x1161('0xa')&&typeof _0xf5f3ee[_0x1161('0xb')]===_0x1161('0xa');var _0x5a9fb9=_0x12fb93['count'];var _0x4a080a=_0x532ca2?0x0:_0xf5f3ee[_0x1161('0x9')];var _0xae99d8=_0x532ca2?_0x12fb93[_0x1161('0xc')]:_0xf5f3ee[_0x1161('0x9')]+_0xf5f3ee['limit'];var _0x15adc3;if(_0xae99d8>=_0x5a9fb9){_0xae99d8=_0x5a9fb9;_0x15adc3=0xc8;}else{_0x15adc3=0xce;}_0x1ab40a['status'](_0x15adc3);return _0x1ab40a[_0x1161('0xd')]('Content-Range',_0x4a080a+'-'+_0xae99d8+'/'+_0x5a9fb9)[_0x1161('0xe')](_0x12fb93);}return null;};}function saveUpdates(_0x28a6f8){return function(_0x5ccbb9){if(_0x5ccbb9){return _0x5ccbb9[_0x1161('0xf')](_0x28a6f8)[_0x1161('0x10')](function(_0x2cdb81){return _0x2cdb81;});}return null;};}function removeEntity(_0x53cdca){return function(_0x7d310e){if(_0x7d310e){return _0x7d310e[_0x1161('0x11')]()[_0x1161('0x10')](function(){_0x53cdca['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c2f46){return function(_0x4b535f){if(!_0x4b535f){_0x4c2f46['sendStatus'](0x194);}return _0x4b535f;};}function handleError(_0x193de0,_0x8786e8){_0x8786e8=_0x8786e8||0x1f4;return function(_0x3c9cff){logger[_0x1161('0x12')](_0x3c9cff[_0x1161('0x13')]);if(_0x3c9cff['name']){delete _0x3c9cff[_0x1161('0x14')];}_0x193de0[_0x1161('0x8')](_0x8786e8)[_0x1161('0x15')](_0x3c9cff);};}exports[_0x1161('0x16')]=function(_0x53d68a,_0x43dd10){var _0x464fb1={},_0x25a273={},_0x25467a={'count':0x0,'rows':[]};var _0x28642e=_['map'](db[_0x1161('0x17')][_0x1161('0x18')],function(_0x33beda){return{'name':_0x33beda['fieldName'],'type':_0x33beda[_0x1161('0x19')]['key']};});_0x25a273[_0x1161('0x1a')]=_[_0x1161('0x1b')](_0x28642e,'name');_0x25a273['query']=_[_0x1161('0x1c')](_0x53d68a['query']);_0x25a273['filters']=_[_0x1161('0x1d')](_0x25a273[_0x1161('0x1a')],_0x25a273[_0x1161('0x1e')]);_0x464fb1[_0x1161('0x1f')]=_[_0x1161('0x1d')](_0x25a273[_0x1161('0x1a')],qs['fields'](_0x53d68a['query'][_0x1161('0x20')]));_0x464fb1[_0x1161('0x1f')]=_0x464fb1[_0x1161('0x1f')][_0x1161('0x21')]?_0x464fb1[_0x1161('0x1f')]:_0x25a273[_0x1161('0x1a')];if(!_0x53d68a['query']['hasOwnProperty']('nolimit')){_0x464fb1[_0x1161('0xb')]=qs['limit'](_0x53d68a['query'][_0x1161('0xb')]);_0x464fb1[_0x1161('0x9')]=qs[_0x1161('0x9')](_0x53d68a[_0x1161('0x1e')][_0x1161('0x9')]);}_0x464fb1[_0x1161('0x22')]=qs[_0x1161('0x23')](_0x53d68a[_0x1161('0x1e')][_0x1161('0x23')]);_0x464fb1[_0x1161('0x24')]=qs[_0x1161('0x25')](_[_0x1161('0x26')](_0x53d68a['query'],_0x25a273[_0x1161('0x25')]),_0x28642e);if(_0x53d68a[_0x1161('0x1e')][_0x1161('0x27')]){_0x464fb1[_0x1161('0x24')]=_[_0x1161('0x28')](_0x464fb1[_0x1161('0x24')],{'$or':_[_0x1161('0x1b')](_0x28642e,function(_0x295f05){if(_0x295f05[_0x1161('0x19')]!=='VIRTUAL'){var _0x273552={};_0x273552[_0x295f05[_0x1161('0x14')]]={'$like':'%'+_0x53d68a[_0x1161('0x1e')][_0x1161('0x27')]+'%'};return _0x273552;}})});}_0x464fb1=_[_0x1161('0x28')]({},_0x464fb1,_0x53d68a[_0x1161('0x29')]);var _0x25f0c3={'where':_0x464fb1[_0x1161('0x24')]};return db[_0x1161('0x17')][_0x1161('0xc')](_0x25f0c3)['then'](function(_0x307bd6){_0x25467a[_0x1161('0xc')]=_0x307bd6;if(_0x53d68a['query'][_0x1161('0x2a')]){_0x464fb1[_0x1161('0x2b')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x1161('0x2c')](_0x464fb1);})[_0x1161('0x10')](function(_0x7fcf1a){_0x25467a[_0x1161('0x2d')]=_0x7fcf1a;return _0x25467a;})['then'](respondWithFilteredResult(_0x43dd10,_0x464fb1))['catch'](handleError(_0x43dd10,null));};exports[_0x1161('0x2e')]=function(_0x10c36b,_0x17d4f6){var _0x2a15d6={'raw':![],'where':{'id':_0x10c36b['params']['id']}},_0x581f8b={};_0x581f8b[_0x1161('0x1a')]=_[_0x1161('0x1c')](db['Dynamics365Account'][_0x1161('0x18')]);_0x581f8b[_0x1161('0x1e')]=_[_0x1161('0x1c')](_0x10c36b[_0x1161('0x1e')]);_0x581f8b[_0x1161('0x25')]=_['intersection'](_0x581f8b['model'],_0x581f8b['query']);_0x2a15d6['attributes']=_[_0x1161('0x1d')](_0x581f8b['model'],qs[_0x1161('0x20')](_0x10c36b['query'][_0x1161('0x20')]));_0x2a15d6[_0x1161('0x1f')]=_0x2a15d6[_0x1161('0x1f')]['length']?_0x2a15d6[_0x1161('0x1f')]:_0x581f8b[_0x1161('0x1a')];if(_0x10c36b[_0x1161('0x1e')][_0x1161('0x2a')]){_0x2a15d6[_0x1161('0x2b')]=[{'all':!![]}];}_0x2a15d6=_[_0x1161('0x28')]({},_0x2a15d6,_0x10c36b[_0x1161('0x29')]);return db[_0x1161('0x17')][_0x1161('0x2f')](_0x2a15d6)[_0x1161('0x10')](handleEntityNotFound(_0x17d4f6,null))[_0x1161('0x10')](respondWithResult(_0x17d4f6,null))[_0x1161('0x30')](handleError(_0x17d4f6,null));};exports['create']=function(_0x414914,_0x361af7){return db[_0x1161('0x17')][_0x1161('0x31')](_0x414914[_0x1161('0x32')],{})[_0x1161('0x10')](respondWithResult(_0x361af7,0xc9))[_0x1161('0x30')](handleError(_0x361af7,null));};exports['update']=function(_0x550056,_0x58d249){if(_0x550056[_0x1161('0x32')]['id']){delete _0x550056[_0x1161('0x32')]['id'];}return db[_0x1161('0x17')][_0x1161('0x2f')]({'where':{'id':_0x550056[_0x1161('0x33')]['id']}})[_0x1161('0x10')](handleEntityNotFound(_0x58d249,null))['then'](saveUpdates(_0x550056[_0x1161('0x32')],null))[_0x1161('0x10')](respondWithResult(_0x58d249,null))[_0x1161('0x30')](handleError(_0x58d249,null));};exports[_0x1161('0x11')]=function(_0xb27b24,_0xd775dd){return db[_0x1161('0x17')]['find']({'where':{'id':_0xb27b24['params']['id']}})[_0x1161('0x10')](handleEntityNotFound(_0xd775dd,null))[_0x1161('0x10')](removeEntity(_0xd775dd,null))[_0x1161('0x30')](handleError(_0xd775dd,null));};exports[_0x1161('0x34')]=function(_0x2878d2,_0x153948){var _0x90f21e={};var _0xa3ca63={};var _0x399c04;var _0x2e1460;return db[_0x1161('0x17')][_0x1161('0x35')]({'where':{'id':_0x2878d2['params']['id']}})[_0x1161('0x10')](handleEntityNotFound(_0x153948,null))[_0x1161('0x10')](function(_0x42dd94){if(_0x42dd94){_0x399c04=_0x42dd94;_0xa3ca63[_0x1161('0x1a')]=_[_0x1161('0x1c')](db[_0x1161('0x36')][_0x1161('0x18')]);_0xa3ca63[_0x1161('0x1e')]=_['keys'](_0x2878d2[_0x1161('0x1e')]);_0xa3ca63[_0x1161('0x25')]=_[_0x1161('0x1d')](_0xa3ca63['model'],_0xa3ca63[_0x1161('0x1e')]);_0x90f21e[_0x1161('0x1f')]=_[_0x1161('0x1d')](_0xa3ca63[_0x1161('0x1a')],qs[_0x1161('0x20')](_0x2878d2['query'][_0x1161('0x20')]));_0x90f21e[_0x1161('0x1f')]=_0x90f21e[_0x1161('0x1f')]['length']?_0x90f21e['attributes']:_0xa3ca63[_0x1161('0x1a')];_0x90f21e[_0x1161('0x22')]=qs[_0x1161('0x23')](_0x2878d2[_0x1161('0x1e')]['sort']);_0x90f21e[_0x1161('0x24')]=qs[_0x1161('0x25')](_[_0x1161('0x26')](_0x2878d2['query'],_0xa3ca63['filters']));if(_0x2878d2['query'][_0x1161('0x27')]){_0x90f21e[_0x1161('0x24')]=_[_0x1161('0x28')](_0x90f21e['where'],{'$or':_[_0x1161('0x1b')](_0x90f21e['attributes'],function(_0x560a9d){var _0x2cdd9d={};_0x2cdd9d[_0x560a9d]={'$like':'%'+_0x2878d2[_0x1161('0x1e')][_0x1161('0x27')]+'%'};return _0x2cdd9d;})});}_0x90f21e=_[_0x1161('0x28')]({},_0x90f21e,_0x2878d2['options']);return _0x399c04[_0x1161('0x34')](_0x90f21e);}})['then'](function(_0x35df8f){if(_0x35df8f){_0x2e1460=_0x35df8f[_0x1161('0x21')];if(!_0x2878d2[_0x1161('0x1e')]['hasOwnProperty'](_0x1161('0x37'))){_0x90f21e[_0x1161('0xb')]=qs[_0x1161('0xb')](_0x2878d2[_0x1161('0x1e')][_0x1161('0xb')]);_0x90f21e[_0x1161('0x9')]=qs[_0x1161('0x9')](_0x2878d2[_0x1161('0x1e')][_0x1161('0x9')]);}return _0x399c04[_0x1161('0x34')](_0x90f21e);}})[_0x1161('0x10')](function(_0x539e62){if(_0x539e62){return _0x539e62?{'count':_0x2e1460,'rows':_0x539e62}:null;}})[_0x1161('0x10')](respondWithResult(_0x153948,null))[_0x1161('0x30')](handleError(_0x153948,null));};exports['addConfiguration']=function(_0x51dcf9,_0x1069e6){if(_0x51dcf9['body']['id']){delete _0x51dcf9['body']['id'];}return db[_0x1161('0x17')][_0x1161('0x35')]({'where':{'id':_0x51dcf9[_0x1161('0x33')]['id']}})[_0x1161('0x10')](handleEntityNotFound(_0x1069e6,null))['then'](function(_0x17c398){if(_0x17c398){_0x51dcf9[_0x1161('0x32')][_0x1161('0x38')]=_0x17c398['id'];_0x51dcf9[_0x1161('0x32')]['Subjects']=integrations[_0x1161('0x39')](_0x51dcf9[_0x1161('0x32')]['channel'],_0x51dcf9[_0x1161('0x32')][_0x1161('0x19')]);_0x51dcf9[_0x1161('0x32')][_0x1161('0x3a')]=integrations['getDescriptions'](_0x51dcf9[_0x1161('0x32')][_0x1161('0x3b')],_0x51dcf9[_0x1161('0x32')]['type']);return db['Dynamics365Configuration'][_0x1161('0x31')](_0x51dcf9['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0x1161('0x3c')},{'model':db[_0x1161('0x3d')],'as':'Descriptions'}]});}return null;})[_0x1161('0x10')](respondWithResult(_0x1069e6,null))['catch'](handleError(_0x1069e6,null));};function sanitizeRemoteUri(_0x36dbf7){var _0x58c850=_0x36dbf7[_0x1161('0x3e')](-0x1);if(_0x58c850==='/')return _0x36dbf7[_0x1161('0x3f')](0x0,_0x36dbf7[_0x1161('0x40')](_0x58c850));return _0x36dbf7;}function getWebApiUrl(_0x2b0ec3){return util['format'](_0x1161('0x41'),_0x2b0ec3);}exports[_0x1161('0x42')]=function(_0x5ab9ff,_0x48fd82){var _0x2ef9a4=_0x5ab9ff['query'][_0x1161('0x43')];var _0x1e4bf0=_0x2ef9a4===_0x1161('0x44')?'Incident':_0x1161('0x45');var _0x45b806='';var _0x14a1e7='';var _0x10865d='';var _0x2eec0='';var _0x54b60f='';var _0x499dab='';var _0x4636a7='';var _0x7b58e6='';var _0x3ef8db=[_0x1161('0x46'),'description',_0x1161('0x47'),_0x1161('0x48'),_0x1161('0x49'),_0x1161('0x4a'),_0x1161('0x4b'),_0x1161('0x4c'),'directioncode',_0x1161('0x4d')];var _0x4eebbf=[_0x1161('0x4e'),_0x1161('0x4f'),_0x1161('0x50'),_0x1161('0x51'),'contactidname',_0x1161('0x52'),'contractdetailidname',_0x1161('0x53'),_0x1161('0x54'),_0x1161('0x55'),_0x1161('0x56'),_0x1161('0x57'),'createdon',_0x1161('0x58'),_0x1161('0x59'),_0x1161('0x5a'),'customeridtype','customeridyominame',_0x1161('0x5b'),_0x1161('0x5c'),'entityimage_timestamp',_0x1161('0x5d'),'escalatedon',_0x1161('0x5e'),_0x1161('0x5f'),_0x1161('0x60'),_0x1161('0x61'),_0x1161('0x62'),_0x1161('0x63'),'lastonholdtime',_0x1161('0x64'),_0x1161('0x65'),_0x1161('0x66'),'modifiedbyname',_0x1161('0x67'),_0x1161('0x68'),_0x1161('0x69'),_0x1161('0x6a'),_0x1161('0x6b'),'msdyn_iotalertname',_0x1161('0x6c'),_0x1161('0x6d'),_0x1161('0x6e'),_0x1161('0x6f'),_0x1161('0x70'),_0x1161('0x71'),_0x1161('0x72'),_0x1161('0x73'),_0x1161('0x74'),'prioritycodename','productidname',_0x1161('0x75'),_0x1161('0x76'),'resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue',_0x1161('0x77'),_0x1161('0x78'),_0x1161('0x79'),_0x1161('0x7a'),_0x1161('0x7b'),_0x1161('0x7c'),_0x1161('0x7d'),_0x1161('0x7e'),_0x1161('0x7f'),'traversedpath',_0x1161('0x80'),_0x1161('0x81')];var _0x529317=_0x3ef8db[_0x1161('0x82')](_0x4eebbf);return db['Dynamics365Account'][_0x1161('0x35')]({'where':{'id':_0x5ab9ff[_0x1161('0x33')]['id']},'attributes':['id',_0x1161('0x83'),'password',_0x1161('0x84'),_0x1161('0x85'),_0x1161('0x86'),_0x1161('0x87'),_0x1161('0x88')],'include':[{'model':db[_0x1161('0x89')],'as':_0x1161('0x89'),'attributes':['id','data5','data7']}]})[_0x1161('0x10')](handleEntityNotFound(_0x48fd82,null))[_0x1161('0x10')](function(_0x5c4512){if(_0x5c4512){if(_0x5c4512[_0x1161('0x88')]){_0x5c4512[_0x1161('0x8a')]=_0x5c4512[_0x1161('0x89')][_0x1161('0x8b')];_0x7b58e6=sanitizeRemoteUri(_0x5c4512[_0x1161('0x89')]['data7']);_0x4636a7=getWebApiUrl(_0x7b58e6);return _0x5c4512;}_0x7b58e6=sanitizeRemoteUri(_0x5c4512[_0x1161('0x84')]);_0x4636a7=getWebApiUrl(_0x7b58e6);var _0x2e90aa={'method':'POST','uri':'https://login.microsoftonline.com/'+_0x5c4512[_0x1161('0x85')]+_0x1161('0x8c'),'form':{'client_id':_0x5c4512[_0x1161('0x86')],'resource':_0x7b58e6,'username':_0x5c4512[_0x1161('0x83')],'password':_0x5c4512[_0x1161('0x8d')],'grant_type':_0x1161('0x8d'),'client_secret':_0x5c4512[_0x1161('0x87')]},'json':!![]};return rp(_0x2e90aa);}})[_0x1161('0x10')](function(_0x24c927){_0x499dab=_0x24c927[_0x1161('0x8a')];var _0x489a56={'method':_0x1161('0x8e'),'uri':encodeURI(_0x4636a7+_0x1161('0x8f')+_0x1e4bf0+'\x27'),'headers':{'Authorization':_0x1161('0x90')+_0x499dab,'If-None-Match':null,'OData-Version':_0x1161('0x91')},'json':!![]};return rp(_0x489a56);})[_0x1161('0x10')](function(_0x5921bf){var _0x2531e1=_0x5921bf[_0x1161('0x92')][0x0];var _0x1174fa=_0x2531e1[_0x1161('0x93')];var _0x34c6ea={'method':_0x1161('0x8e'),'uri':_0x4636a7+'EntityDefinitions('+_0x1174fa+_0x1161('0x94'),'headers':{'Authorization':_0x1161('0x90')+_0x499dab,'If-None-Match':null,'OData-Version':_0x1161('0x91')},'json':!![]};return rp(_0x34c6ea);})[_0x1161('0x10')](function(_0x24c0b8){_0x45b806=_0x24c0b8;_0x14a1e7=_0x45b806['Attributes'];_0x14a1e7=_[_0x1161('0x95')](_0x14a1e7,function(_0x5d5661){return!_0x529317[_0x1161('0x96')](_0x5d5661[_0x1161('0x97')]);});var _0x5292ec=[];var _0x25b21c=[];_0x14a1e7[_0x1161('0x98')](function(_0x27c79d){if(_0x27c79d[_0x1161('0x99')]){var _0x5cefb7=_0x27c79d[_0x1161('0x99')][_0x1161('0x3f')](_0x27c79d['@odata.type'][_0x1161('0x40')]('.')+0x1);if(_0x5cefb7===_0x1161('0x9a')){_0x5292ec['push'](getSelectList(_0x4636a7,_0x2ef9a4,_0x25b21c,_0x45b806[_0x1161('0x93')],_0x27c79d['MetadataId'],_0x499dab));}}});return Promise[_0x1161('0x9b')](_0x5292ec);})[_0x1161('0x10')](function(_0x1317f0){_0x10865d=_0x1317f0[0x0];var _0x2a8776=[];var _0x250c65=[];_0x14a1e7[_0x1161('0x98')](function(_0x466955){if(!_[_0x1161('0x9c')](_0x466955[_0x1161('0x99')])){var _0x540c42=_0x466955[_0x1161('0x99')][_0x1161('0x3f')](_0x466955[_0x1161('0x99')][_0x1161('0x40')]('.')+0x1);if(_0x540c42===_0x1161('0x9d')){_0x2a8776[_0x1161('0x9e')](getBooleanList(_0x4636a7,_0x2ef9a4,_0x250c65,_0x45b806[_0x1161('0x93')],_0x466955[_0x1161('0x93')],_0x499dab));}}});return Promise[_0x1161('0x9b')](_0x2a8776);})['then'](function(_0x283c77){_0x2eec0=_0x283c77[0x0];var _0xc427ff=[];var _0x27c6e5=[];_0x14a1e7[_0x1161('0x98')](function(_0x324173){if(_0x324173['@odata.type']){var _0x3167d4=_0x324173[_0x1161('0x99')]['substring'](_0x324173['@odata.type'][_0x1161('0x40')]('.')+0x1);if(_0x3167d4===_0x1161('0x9f')||_0x3167d4===_0x1161('0xa0')||_0x3167d4===_0x1161('0xa1')||_0x3167d4===_0x1161('0xa2')||_0x3167d4===_0x1161('0xa3')||_0x3167d4===_0x1161('0xa4')||_0x3167d4==='StatusAttributeMetadata'||_0x3167d4==='EntityNameAttributeMetadata'||_0x3167d4==='StateAttributeMetadata'||_0x3167d4===_0x1161('0xa5')){_0xc427ff[_0x1161('0x9e')](getInputList(_0x4636a7,_0x2ef9a4,_0x3167d4,_0x27c6e5,_0x45b806[_0x1161('0x93')],_0x324173[_0x1161('0x93')],_0x499dab));}}});return Promise[_0x1161('0x9b')](_0xc427ff);})[_0x1161('0x10')](function(_0x3c53ed){_0x54b60f=_0x3c53ed[0x0];var _0x1d9889=_0x10865d[_0x1161('0x82')](_0x2eec0)[_0x1161('0x82')](_0x54b60f);var _0x4dfbd1={'count':_0x1d9889[_0x1161('0x21')],'rows':_0x1d9889};return _0x4dfbd1;})[_0x1161('0x10')](respondWithResult(_0x48fd82,null))[_0x1161('0x30')](function(_0x32a58f){var _0x1fe62c=_0x5ab9ff[_0x1161('0x1e')][_0x1161('0xa6')]?0x1f4:_0x32a58f['statusCode']||0x1f4;logger[_0x1161('0x12')](_0x32a58f['stack']);delete _0x32a58f[_0x1161('0x14')];if(_0x1fe62c===0x191){_0x1fe62c=0x190;}_0x48fd82[_0x1161('0x8')](_0x1fe62c)['send'](_0x5ab9ff[_0x1161('0x1e')][_0x1161('0xa6')]?{'message':_0x1161('0xa7'),'statusCode':_0x32a58f[_0x1161('0xa8')]}:_0x32a58f);});};function getSelectList(_0x1d47ec,_0x8c4e86,_0x381dc6,_0x2a1740,_0x485f2b,_0x3b4e7a){var _0x42102a={'method':_0x1161('0x8e'),'uri':_0x1d47ec+_0x1161('0xa9')+_0x2a1740+_0x1161('0xaa')+_0x485f2b+_0x1161('0xab')+_0x1161('0xac'),'headers':{'Authorization':_0x1161('0x90')+_0x3b4e7a,'If-None-Match':null,'OData-Version':_0x1161('0x91')},'json':!![]};return rp(_0x42102a)[_0x1161('0x10')](function(_0x14d1f8){var _0xd1e4c0=[];var _0x2023a5=_0x14d1f8[_0x1161('0xad')][_0x1161('0xae')];_0x2023a5[_0x1161('0x98')](function(_0x5ad680){_0xd1e4c0[_0x1161('0x9e')]({'name':_0x5ad680['Label'][_0x1161('0xaf')]['Label'],'value':String(_0x5ad680[_0x1161('0xb0')])});});var _0x54c2f6={'id':_0x8c4e86+'_'+_0x14d1f8[_0x1161('0x97')],'name':_0x14d1f8[_0x1161('0xb1')][_0x1161('0xaf')][_0x1161('0xb2')],'custom':![],'options':_0xd1e4c0};_0x381dc6['push'](_0x54c2f6);return _0x381dc6;});}function getBooleanList(_0x3af30e,_0x1c7316,_0x4993d2,_0x2ba5db,_0xc213ce,_0x3b5ab9){var _0x5641d2={'method':'GET','uri':_0x3af30e+_0x1161('0xa9')+_0x2ba5db+_0x1161('0xaa')+_0xc213ce+_0x1161('0xb3'),'headers':{'Authorization':_0x1161('0x90')+_0x3b5ab9,'If-None-Match':null,'OData-Version':_0x1161('0x91')},'json':!![]};return rp(_0x5641d2)[_0x1161('0x10')](function(_0x17fcdd){var _0x433fba=[];_0x433fba[_0x1161('0x9e')]({'name':_0x17fcdd[_0x1161('0xad')][_0x1161('0xb4')][_0x1161('0xb2')][_0x1161('0xaf')][_0x1161('0xb2')],'value':_0x1161('0xb5')},{'name':_0x17fcdd[_0x1161('0xad')][_0x1161('0xb6')][_0x1161('0xb2')][_0x1161('0xaf')][_0x1161('0xb2')],'value':_0x1161('0xb7')});var _0x175d03={'id':_0x1c7316+'_'+_0x17fcdd[_0x1161('0x97')],'name':_0x17fcdd[_0x1161('0xb1')][_0x1161('0xaf')][_0x1161('0xb2')],'custom':![],'options':_0x433fba};_0x4993d2[_0x1161('0x9e')](_0x175d03);return _0x4993d2;});}function getInputList(_0x4d4e81,_0x6c3d6d,_0x2d4d23,_0x469c82,_0x172f30,_0x3fb3f0,_0x1c1ecd){var _0x36f3d5={'method':_0x1161('0x8e'),'uri':_0x4d4e81+_0x1161('0xa9')+_0x172f30+_0x1161('0xaa')+_0x3fb3f0+_0x1161('0xb8')+_0x2d4d23+_0x1161('0xb9'),'headers':{'Authorization':_0x1161('0x90')+_0x1c1ecd,'If-None-Match':null,'OData-Version':_0x1161('0x91')},'json':!![]};return rp(_0x36f3d5)[_0x1161('0x10')](function(_0x2d55da){var _0x33d0a4={'id':_0x6c3d6d+'_'+_0x2d55da['LogicalName'],'name':_0x2d55da[_0x1161('0xb1')][_0x1161('0xaf')]?_0x2d55da[_0x1161('0xb1')][_0x1161('0xaf')][_0x1161('0xb2')]:_0x2d55da[_0x1161('0x97')],'custom':![],'options':[]};_0x469c82[_0x1161('0x9e')](_0x33d0a4);return _0x469c82;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 1694111..c3c384a 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(_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 +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x58e1d5,_0x3ce57d){var _0x328329=function(_0x279c3f){while(--_0x279c3f){_0x58e1d5['push'](_0x58e1d5['shift']());}};_0x328329(++_0x3ce57d);}(_0x757a,0xde));var _0xa757=function(_0xd438c8,_0x55622c){_0xd438c8=_0xd438c8-0x0;var _0x5d6033=_0x757a[_0xd438c8];return _0x5d6033;};'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 06df742..c9e8946 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 _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 +var _0xdfa4=['error','code','message','catch','GetDynamics365Account','Dynamics365Account','options','raw','where','attributes','include','map','model','ShowDynamics365Account','find','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x41492e,_0x371c30){var _0x57ad15=function(_0x1a1fbc){while(--_0x1a1fbc){_0x41492e['push'](_0x41492e['shift']());}};_0x57ad15(++_0x371c30);}(_0xdfa4,0x139));var _0x4dfa=function(_0x294295,_0x406b15){_0x294295=_0x294295-0x0;var _0x4bb05b=_0xdfa4[_0x294295];return _0x4bb05b;};'use strict';var _=require(_0x4dfa('0x0'));var util=require(_0x4dfa('0x1'));var moment=require(_0x4dfa('0x2'));var BPromise=require('bluebird');var rs=require(_0x4dfa('0x3'));var fs=require('fs');var Redis=require(_0x4dfa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4dfa('0x5'));var logger=require('../../config/logger')(_0x4dfa('0x6'));var config=require(_0x4dfa('0x7'));var jayson=require(_0x4dfa('0x8'));var client=jayson[_0x4dfa('0x9')][_0x4dfa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42019f,_0x210988,_0x4968d2){return new BPromise(function(_0x561f3b,_0x955f38){return client[_0x4dfa('0xb')](_0x42019f,_0x4968d2)[_0x4dfa('0xc')](function(_0x25bc2b){logger[_0x4dfa('0xd')](_0x4dfa('0xe'),_0x210988,_0x4dfa('0xf'));logger[_0x4dfa('0x10')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x210988,_0x4dfa('0xf'),JSON['stringify'](_0x25bc2b));if(_0x25bc2b[_0x4dfa('0x11')]){if(_0x25bc2b[_0x4dfa('0x11')][_0x4dfa('0x12')]===0x1f4){logger[_0x4dfa('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x210988,_0x25bc2b[_0x4dfa('0x11')][_0x4dfa('0x13')]);return _0x955f38(_0x25bc2b['error'][_0x4dfa('0x13')]);}logger[_0x4dfa('0x11')](_0x4dfa('0xe'),_0x210988,_0x25bc2b[_0x4dfa('0x11')][_0x4dfa('0x13')]);return _0x561f3b(_0x25bc2b['error'][_0x4dfa('0x13')]);}else{logger[_0x4dfa('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x210988,_0x4dfa('0xf'));_0x561f3b(_0x25bc2b['result']['message']);}})[_0x4dfa('0x14')](function(_0x15394c){logger[_0x4dfa('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x210988,_0x15394c);_0x955f38(_0x15394c);});});}exports[_0x4dfa('0x15')]=function(_0xae9ec9){var _0x46dff2=this;return new Promise(function(_0xdd0700,_0x2431a7){return db[_0x4dfa('0x16')]['findAll']({'raw':_0xae9ec9['options']?_0xae9ec9[_0x4dfa('0x17')][_0x4dfa('0x18')]===undefined?!![]:![]:!![],'where':_0xae9ec9[_0x4dfa('0x17')]?_0xae9ec9[_0x4dfa('0x17')][_0x4dfa('0x19')]||null:null,'attributes':_0xae9ec9[_0x4dfa('0x17')]?_0xae9ec9[_0x4dfa('0x17')][_0x4dfa('0x1a')]||null:null,'limit':_0xae9ec9[_0x4dfa('0x17')]?_0xae9ec9['options']['limit']||null:null,'include':_0xae9ec9[_0x4dfa('0x17')]?_0xae9ec9[_0x4dfa('0x17')][_0x4dfa('0x1b')]?_[_0x4dfa('0x1c')](_0xae9ec9[_0x4dfa('0x17')][_0x4dfa('0x1b')],function(_0xb652a6){return{'model':db[_0xb652a6[_0x4dfa('0x1d')]],'as':_0xb652a6['as'],'attributes':_0xb652a6[_0x4dfa('0x1a')],'include':_0xb652a6[_0x4dfa('0x1b')]?_[_0x4dfa('0x1c')](_0xb652a6[_0x4dfa('0x1b')],function(_0x2fa5fd){return{'model':db[_0x2fa5fd[_0x4dfa('0x1d')]],'as':_0x2fa5fd['as'],'attributes':_0x2fa5fd[_0x4dfa('0x1a')],'include':_0x2fa5fd[_0x4dfa('0x1b')]?_[_0x4dfa('0x1c')](_0x2fa5fd[_0x4dfa('0x1b')],function(_0x50847b){return{'model':db[_0x50847b[_0x4dfa('0x1d')]],'as':_0x50847b['as'],'attributes':_0x50847b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x371118){logger[_0x4dfa('0xd')](_0x4dfa('0x15'),_0xae9ec9);logger[_0x4dfa('0x10')](_0x4dfa('0x15'),_0xae9ec9,JSON['stringify'](_0x371118));_0xdd0700(_0x371118);})['catch'](function(_0x377fe2){logger[_0x4dfa('0x11')](_0x4dfa('0x15'),_0x377fe2[_0x4dfa('0x13')],_0xae9ec9);_0x2431a7(_0x46dff2['error'](0x1f4,_0x377fe2[_0x4dfa('0x13')]));});});};exports[_0x4dfa('0x1e')]=function(_0x2311ba){var _0xbd5f0a=this;return new Promise(function(_0x4a7f5f,_0x34924d){return db['Dynamics365Account'][_0x4dfa('0x1f')]({'raw':_0x2311ba[_0x4dfa('0x17')]?_0x2311ba[_0x4dfa('0x17')][_0x4dfa('0x18')]===undefined?!![]:![]:!![],'where':_0x2311ba[_0x4dfa('0x17')]?_0x2311ba[_0x4dfa('0x17')][_0x4dfa('0x19')]||null:null,'attributes':_0x2311ba[_0x4dfa('0x17')]?_0x2311ba[_0x4dfa('0x17')]['attributes']||null:null,'include':_0x2311ba[_0x4dfa('0x17')]?_0x2311ba[_0x4dfa('0x17')][_0x4dfa('0x1b')]?_[_0x4dfa('0x1c')](_0x2311ba['options'][_0x4dfa('0x1b')],function(_0x100965){return{'model':db[_0x100965['model']],'as':_0x100965['as'],'attributes':_0x100965[_0x4dfa('0x1a')],'include':_0x100965[_0x4dfa('0x1b')]?_['map'](_0x100965[_0x4dfa('0x1b')],function(_0x319184){return{'model':db[_0x319184[_0x4dfa('0x1d')]],'as':_0x319184['as'],'attributes':_0x319184[_0x4dfa('0x1a')],'include':_0x319184[_0x4dfa('0x1b')]?_['map'](_0x319184[_0x4dfa('0x1b')],function(_0x2ff660){return{'model':db[_0x2ff660[_0x4dfa('0x1d')]],'as':_0x2ff660['as'],'attributes':_0x2ff660[_0x4dfa('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4dfa('0xc')](function(_0x1a3b30){logger['info'](_0x4dfa('0x1e'),_0x2311ba);logger[_0x4dfa('0x10')](_0x4dfa('0x1e'),_0x2311ba,JSON[_0x4dfa('0x20')](_0x1a3b30));_0x4a7f5f(_0x1a3b30);})[_0x4dfa('0x14')](function(_0x5e252c){logger['error'](_0x4dfa('0x1e'),_0x5e252c['message'],_0x2311ba);_0x34924d(_0xbd5f0a[_0x4dfa('0x11')](0x1f4,_0x5e252c[_0x4dfa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 4ba2ba8..bca04f6 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 _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 +var _0x6dad=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x6dad,0x77));var _0xd6da=function(_0x5c8ecd,_0xc640e0){_0x5c8ecd=_0x5c8ecd-0x0;var _0x5b8cdd=_0x6dad[_0x5c8ecd];return _0x5b8cdd;};'use strict';var multer=require(_0xd6da('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd6da('0x1'));var router=express[_0xd6da('0x2')]();var fs_extra=require(_0xd6da('0x3'));var auth=require(_0xd6da('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd6da('0x5'));var controller=require(_0xd6da('0x6'));router[_0xd6da('0x7')]('/',auth[_0xd6da('0x8')](),controller[_0xd6da('0x9')]);router[_0xd6da('0x7')](_0xd6da('0xa'),auth[_0xd6da('0x8')](),controller[_0xd6da('0xb')]);router[_0xd6da('0x7')](_0xd6da('0xc'),auth[_0xd6da('0x8')](),controller[_0xd6da('0xd')]);router['get'](_0xd6da('0xe'),auth[_0xd6da('0x8')](),controller[_0xd6da('0xf')]);router[_0xd6da('0x7')](_0xd6da('0x10'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x11')]);router[_0xd6da('0x12')]('/',auth['isAuthenticated'](),controller[_0xd6da('0x13')]);router['put'](_0xd6da('0xa'),auth[_0xd6da('0x8')](),controller[_0xd6da('0x14')]);router[_0xd6da('0x15')](_0xd6da('0xa'),auth[_0xd6da('0x8')](),controller['destroy']);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 aeda75f..c6fe1ef 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 _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 +var _0xf70f=['phonecall','nothing','BOOLEAN','sequelize','STRING','ENUM','incident'];(function(_0x4d4bfd,_0x304258){var _0x5e443b=function(_0x38ae0c){while(--_0x38ae0c){_0x4d4bfd['push'](_0x4d4bfd['shift']());}};_0x5e443b(++_0x304258);}(_0xf70f,0xb2));var _0xff70=function(_0xf48244,_0x115cad){_0xf48244=_0xf48244-0x0;var _0x37d890=_0xf70f[_0xf48244];return _0x37d890;};'use strict';var Sequelize=require(_0xff70('0x0'));module['exports']={'name':{'type':Sequelize[_0xff70('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xff70('0x2')](_0xff70('0x3'),_0xff70('0x4')),'defaultValue':_0xff70('0x3')},'moduleCreate':{'type':Sequelize[_0xff70('0x2')]('contact',_0xff70('0x5')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xff70('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xff70('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 4359785..2f77b47 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 _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 +var _0x0af1=['squel','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','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','Dynamics365Configuration','includeAll','include','findAll','rows','params','keys','rawAttributes','find','catch','create','body','getFields','Dynamics365Field','order','getSubjects','getDescriptions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x113c1e,_0x57f6d1){var _0x2439fb=function(_0x250068){while(--_0x250068){_0x113c1e['push'](_0x113c1e['shift']());}};_0x2439fb(++_0x57f6d1);}(_0x0af1,0x1de));var _0x10af=function(_0xb2ff69,_0x4ae631){_0xb2ff69=_0xb2ff69-0x0;var _0x3f1533=_0x0af1[_0xb2ff69];return _0x3f1533;};'use strict';var emlformat=require(_0x10af('0x0'));var rimraf=require(_0x10af('0x1'));var zipdir=require(_0x10af('0x2'));var jsonpatch=require(_0x10af('0x3'));var rp=require(_0x10af('0x4'));var moment=require(_0x10af('0x5'));var BPromise=require(_0x10af('0x6'));var Mustache=require(_0x10af('0x7'));var util=require(_0x10af('0x8'));var path=require(_0x10af('0x9'));var sox=require(_0x10af('0xa'));var csv=require(_0x10af('0xb'));var ejs=require(_0x10af('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x10af('0xd'));var squel=require(_0x10af('0xe'));var crypto=require(_0x10af('0xf'));var jsforce=require(_0x10af('0x10'));var deskjs=require(_0x10af('0x11'));var toCsv=require(_0x10af('0xb'));var querystring=require(_0x10af('0x12'));var Papa=require(_0x10af('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x10af('0x14'));var as=require(_0x10af('0x15'));var hardwareService=require(_0x10af('0x16'));var logger=require(_0x10af('0x17'))(_0x10af('0x18'));var utils=require(_0x10af('0x19'));var config=require(_0x10af('0x1a'));var licenseUtil=require(_0x10af('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9ce778,_0x4cc988){_0x4cc988=_0x4cc988||0xcc;return function(_0x1e6ebb){if(_0x1e6ebb){return _0x9ce778[_0x10af('0x1c')](_0x4cc988);}return _0x9ce778['status'](_0x4cc988)['end']();};}function respondWithResult(_0x3ae7ff,_0x889862){_0x889862=_0x889862||0xc8;return function(_0x54d176){if(_0x54d176){return _0x3ae7ff[_0x10af('0x1d')](_0x889862)[_0x10af('0x1e')](_0x54d176);}};}function respondWithFilteredResult(_0x3947c9,_0x16dd17){return function(_0x355443){if(_0x355443){var _0x235776=typeof _0x16dd17[_0x10af('0x1f')]===_0x10af('0x20')&&typeof _0x16dd17[_0x10af('0x21')]==='undefined';var _0x3b7e16=_0x355443[_0x10af('0x22')];var _0x2e7b4b=_0x235776?0x0:_0x16dd17[_0x10af('0x1f')];var _0xd0bd21=_0x235776?_0x355443[_0x10af('0x22')]:_0x16dd17['offset']+_0x16dd17['limit'];var _0xc85d14;if(_0xd0bd21>=_0x3b7e16){_0xd0bd21=_0x3b7e16;_0xc85d14=0xc8;}else{_0xc85d14=0xce;}_0x3947c9[_0x10af('0x1d')](_0xc85d14);return _0x3947c9[_0x10af('0x23')]('Content-Range',_0x2e7b4b+'-'+_0xd0bd21+'/'+_0x3b7e16)[_0x10af('0x1e')](_0x355443);}return null;};}function patchUpdates(_0x1931f2){return function(_0x4c26e7){try{jsonpatch[_0x10af('0x24')](_0x4c26e7,_0x1931f2,!![]);}catch(_0x5a8048){return BPromise['reject'](_0x5a8048);}return _0x4c26e7[_0x10af('0x25')]();};}function saveUpdates(_0x379082,_0x4c5129){return function(_0x1863be){if(_0x1863be){return _0x1863be['update'](_0x379082)[_0x10af('0x26')](function(_0x25f0fb){return _0x25f0fb;});}return null;};}function removeEntity(_0x281291,_0x34f472){return function(_0x5252a4){if(_0x5252a4){return _0x5252a4[_0x10af('0x27')]()[_0x10af('0x26')](function(){_0x281291[_0x10af('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cbf47,_0x533f32){return function(_0x5ee117){if(!_0x5ee117){_0x4cbf47[_0x10af('0x1c')](0x194);}return _0x5ee117;};}function handleError(_0x1063a3,_0x1b3c38){_0x1b3c38=_0x1b3c38||0x1f4;return function(_0x46dd3a){logger[_0x10af('0x28')](_0x46dd3a[_0x10af('0x29')]);if(_0x46dd3a[_0x10af('0x2a')]){delete _0x46dd3a[_0x10af('0x2a')];}_0x1063a3[_0x10af('0x1d')](_0x1b3c38)[_0x10af('0x2b')](_0x46dd3a);};}exports[_0x10af('0x2c')]=function(_0x20c9ad,_0x2a2b36){var _0x3124e8={},_0x3f1488={},_0x35dcb7={'count':0x0,'rows':[]};var _0x1604e2=_[_0x10af('0x2d')](db['Dynamics365Configuration']['rawAttributes'],function(_0x145db4){return{'name':_0x145db4[_0x10af('0x2e')],'type':_0x145db4[_0x10af('0x2f')][_0x10af('0x30')]};});_0x3f1488[_0x10af('0x31')]=_[_0x10af('0x2d')](_0x1604e2,'name');_0x3f1488['query']=_['keys'](_0x20c9ad[_0x10af('0x32')]);_0x3f1488['filters']=_[_0x10af('0x33')](_0x3f1488[_0x10af('0x31')],_0x3f1488[_0x10af('0x32')]);_0x3124e8[_0x10af('0x34')]=_[_0x10af('0x33')](_0x3f1488[_0x10af('0x31')],qs['fields'](_0x20c9ad['query'][_0x10af('0x35')]));_0x3124e8[_0x10af('0x34')]=_0x3124e8['attributes'][_0x10af('0x36')]?_0x3124e8[_0x10af('0x34')]:_0x3f1488[_0x10af('0x31')];if(!_0x20c9ad[_0x10af('0x32')]['hasOwnProperty'](_0x10af('0x37'))){_0x3124e8[_0x10af('0x21')]=qs[_0x10af('0x21')](_0x20c9ad[_0x10af('0x32')][_0x10af('0x21')]);_0x3124e8[_0x10af('0x1f')]=qs[_0x10af('0x1f')](_0x20c9ad[_0x10af('0x32')][_0x10af('0x1f')]);}_0x3124e8['order']=qs['sort'](_0x20c9ad[_0x10af('0x32')][_0x10af('0x38')]);_0x3124e8[_0x10af('0x39')]=qs[_0x10af('0x3a')](_[_0x10af('0x3b')](_0x20c9ad['query'],_0x3f1488[_0x10af('0x3a')]),_0x1604e2);if(_0x20c9ad[_0x10af('0x32')][_0x10af('0x3c')]){_0x3124e8[_0x10af('0x39')]=_['merge'](_0x3124e8['where'],{'$or':_[_0x10af('0x2d')](_0x1604e2,function(_0x5723d2){if(_0x5723d2[_0x10af('0x2f')]!==_0x10af('0x3d')){var _0x35bb27={};_0x35bb27[_0x5723d2[_0x10af('0x2a')]]={'$like':'%'+_0x20c9ad[_0x10af('0x32')][_0x10af('0x3c')]+'%'};return _0x35bb27;}})});}_0x3124e8=_[_0x10af('0x3e')]({},_0x3124e8,_0x20c9ad[_0x10af('0x3f')]);var _0x2fdc47={'where':_0x3124e8['where']};return db[_0x10af('0x40')][_0x10af('0x22')](_0x2fdc47)['then'](function(_0x1324ad){_0x35dcb7[_0x10af('0x22')]=_0x1324ad;if(_0x20c9ad['query'][_0x10af('0x41')]){_0x3124e8[_0x10af('0x42')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x10af('0x43')](_0x3124e8);})[_0x10af('0x26')](function(_0x10fd30){_0x35dcb7[_0x10af('0x44')]=_0x10fd30;return _0x35dcb7;})[_0x10af('0x26')](respondWithFilteredResult(_0x2a2b36,_0x3124e8))['catch'](handleError(_0x2a2b36,null));};exports['show']=function(_0xc7087a,_0x46d8c8){var _0x95bf06={'raw':![],'where':{'id':_0xc7087a[_0x10af('0x45')]['id']}},_0x65554f={};_0x65554f[_0x10af('0x31')]=_[_0x10af('0x46')](db[_0x10af('0x40')][_0x10af('0x47')]);_0x65554f[_0x10af('0x32')]=_[_0x10af('0x46')](_0xc7087a[_0x10af('0x32')]);_0x65554f[_0x10af('0x3a')]=_['intersection'](_0x65554f[_0x10af('0x31')],_0x65554f[_0x10af('0x32')]);_0x95bf06['attributes']=_['intersection'](_0x65554f['model'],qs[_0x10af('0x35')](_0xc7087a[_0x10af('0x32')][_0x10af('0x35')]));_0x95bf06[_0x10af('0x34')]=_0x95bf06[_0x10af('0x34')]['length']?_0x95bf06['attributes']:_0x65554f[_0x10af('0x31')];if(_0xc7087a[_0x10af('0x32')]['includeAll']){_0x95bf06['include']=[{'all':!![]}];}_0x95bf06=_[_0x10af('0x3e')]({},_0x95bf06,_0xc7087a[_0x10af('0x3f')]);return db['Dynamics365Configuration'][_0x10af('0x48')](_0x95bf06)[_0x10af('0x26')](handleEntityNotFound(_0x46d8c8,null))[_0x10af('0x26')](respondWithResult(_0x46d8c8,null))[_0x10af('0x49')](handleError(_0x46d8c8,null));};exports[_0x10af('0x4a')]=function(_0x3af8f8,_0x2f7f3d){return db['Dynamics365Configuration'][_0x10af('0x4a')](_0x3af8f8[_0x10af('0x4b')],{})[_0x10af('0x26')](respondWithResult(_0x2f7f3d,0xc9))['catch'](handleError(_0x2f7f3d,null));};exports['update']=function(_0x56a23b,_0x3656e0){if(_0x56a23b[_0x10af('0x4b')]['id']){delete _0x56a23b[_0x10af('0x4b')]['id'];}return db[_0x10af('0x40')][_0x10af('0x48')]({'where':{'id':_0x56a23b[_0x10af('0x45')]['id']}})[_0x10af('0x26')](handleEntityNotFound(_0x3656e0,null))[_0x10af('0x26')](saveUpdates(_0x56a23b['body'],null))[_0x10af('0x26')](respondWithResult(_0x3656e0,null))['catch'](handleError(_0x3656e0,null));};exports[_0x10af('0x27')]=function(_0x14e5b9,_0x49e489){return db[_0x10af('0x40')][_0x10af('0x48')]({'where':{'id':_0x14e5b9[_0x10af('0x45')]['id']}})[_0x10af('0x26')](handleEntityNotFound(_0x49e489,null))[_0x10af('0x26')](removeEntity(_0x49e489,null))['catch'](handleError(_0x49e489,null));};exports[_0x10af('0x4c')]=function(_0x3b22e0,_0xda1121,_0x271592){var _0x37dd14={};var _0x4b55e2={};var _0x315beb;var _0x112622;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x3b22e0[_0x10af('0x45')]['id']}})[_0x10af('0x26')](handleEntityNotFound(_0xda1121,null))[_0x10af('0x26')](function(_0x37c267){if(_0x37c267){_0x315beb=_0x37c267;_0x4b55e2[_0x10af('0x31')]=_[_0x10af('0x46')](db[_0x10af('0x4d')][_0x10af('0x47')]);_0x4b55e2[_0x10af('0x32')]=_['keys'](_0x3b22e0[_0x10af('0x32')]);_0x4b55e2[_0x10af('0x3a')]=_[_0x10af('0x33')](_0x4b55e2[_0x10af('0x31')],_0x4b55e2['query']);_0x37dd14[_0x10af('0x34')]=_['intersection'](_0x4b55e2[_0x10af('0x31')],qs['fields'](_0x3b22e0[_0x10af('0x32')][_0x10af('0x35')]));_0x37dd14[_0x10af('0x34')]=_0x37dd14['attributes'][_0x10af('0x36')]?_0x37dd14['attributes']:_0x4b55e2['model'];_0x37dd14[_0x10af('0x4e')]=qs[_0x10af('0x38')](_0x3b22e0[_0x10af('0x32')]['sort']);_0x37dd14[_0x10af('0x39')]=qs['filters'](_['pick'](_0x3b22e0[_0x10af('0x32')],_0x4b55e2[_0x10af('0x3a')]));if(_0x3b22e0[_0x10af('0x32')][_0x10af('0x3c')]){_0x37dd14[_0x10af('0x39')]=_['merge'](_0x37dd14['where'],{'$or':_[_0x10af('0x2d')](_0x37dd14[_0x10af('0x34')],function(_0x367470){var _0x498596={};_0x498596[_0x367470]={'$like':'%'+_0x3b22e0[_0x10af('0x32')][_0x10af('0x3c')]+'%'};return _0x498596;})});}_0x37dd14=_['merge']({},_0x37dd14,_0x3b22e0['options']);return _0x315beb[_0x10af('0x4c')](_0x37dd14);}})['then'](function(_0x159600){if(_0x159600){_0x112622=_0x159600[_0x10af('0x36')];if(!_0x3b22e0['query']['hasOwnProperty'](_0x10af('0x37'))){_0x37dd14[_0x10af('0x21')]=qs[_0x10af('0x21')](_0x3b22e0[_0x10af('0x32')][_0x10af('0x21')]);_0x37dd14['offset']=qs['offset'](_0x3b22e0[_0x10af('0x32')][_0x10af('0x1f')]);}return _0x315beb[_0x10af('0x4c')](_0x37dd14);}})['then'](function(_0xb58100){if(_0xb58100){return _0xb58100?{'count':_0x112622,'rows':_0xb58100}:null;}})[_0x10af('0x26')](respondWithResult(_0xda1121,null))[_0x10af('0x49')](handleError(_0xda1121,null));};exports['getSubjects']=function(_0x5480ed,_0x5864e5,_0x27e38f){var _0x39d860={};var _0x32e9d2={};var _0x467bf8;var _0x1d9bf6;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x5480ed[_0x10af('0x45')]['id']}})[_0x10af('0x26')](handleEntityNotFound(_0x5864e5,null))['then'](function(_0x521c1d){if(_0x521c1d){_0x467bf8=_0x521c1d;_0x32e9d2[_0x10af('0x31')]=_[_0x10af('0x46')](db[_0x10af('0x4d')][_0x10af('0x47')]);_0x32e9d2[_0x10af('0x32')]=_[_0x10af('0x46')](_0x5480ed['query']);_0x32e9d2[_0x10af('0x3a')]=_[_0x10af('0x33')](_0x32e9d2['model'],_0x32e9d2[_0x10af('0x32')]);_0x39d860['attributes']=_[_0x10af('0x33')](_0x32e9d2['model'],qs[_0x10af('0x35')](_0x5480ed[_0x10af('0x32')][_0x10af('0x35')]));_0x39d860[_0x10af('0x34')]=_0x39d860['attributes'][_0x10af('0x36')]?_0x39d860[_0x10af('0x34')]:_0x32e9d2[_0x10af('0x31')];_0x39d860[_0x10af('0x4e')]=qs['sort'](_0x5480ed['query'][_0x10af('0x38')]);_0x39d860[_0x10af('0x39')]=qs[_0x10af('0x3a')](_['pick'](_0x5480ed[_0x10af('0x32')],_0x32e9d2[_0x10af('0x3a')]));if(_0x5480ed[_0x10af('0x32')][_0x10af('0x3c')]){_0x39d860[_0x10af('0x39')]=_[_0x10af('0x3e')](_0x39d860[_0x10af('0x39')],{'$or':_[_0x10af('0x2d')](_0x39d860['attributes'],function(_0x2c40b2){var _0x59eed1={};_0x59eed1[_0x2c40b2]={'$like':'%'+_0x5480ed[_0x10af('0x32')][_0x10af('0x3c')]+'%'};return _0x59eed1;})});}_0x39d860=_['merge']({},_0x39d860,_0x5480ed[_0x10af('0x3f')]);return _0x467bf8[_0x10af('0x4f')](_0x39d860);}})[_0x10af('0x26')](function(_0x4667fc){if(_0x4667fc){_0x1d9bf6=_0x4667fc['length'];if(!_0x5480ed['query']['hasOwnProperty'](_0x10af('0x37'))){_0x39d860['limit']=qs['limit'](_0x5480ed['query'][_0x10af('0x21')]);_0x39d860[_0x10af('0x1f')]=qs[_0x10af('0x1f')](_0x5480ed[_0x10af('0x32')][_0x10af('0x1f')]);}return _0x467bf8[_0x10af('0x4f')](_0x39d860);}})[_0x10af('0x26')](function(_0x2f7320){if(_0x2f7320){return _0x2f7320?{'count':_0x1d9bf6,'rows':_0x2f7320}:null;}})['then'](respondWithResult(_0x5864e5,null))[_0x10af('0x49')](handleError(_0x5864e5,null));};exports[_0x10af('0x50')]=function(_0xacb09,_0x4b0227,_0x6d29c2){var _0x350fcc={};var _0xc1a825={};var _0x3d1281;var _0x2be78c;return db[_0x10af('0x40')][_0x10af('0x51')]({'where':{'id':_0xacb09[_0x10af('0x45')]['id']}})[_0x10af('0x26')](handleEntityNotFound(_0x4b0227,null))['then'](function(_0x447605){if(_0x447605){_0x3d1281=_0x447605;_0xc1a825[_0x10af('0x31')]=_[_0x10af('0x46')](db[_0x10af('0x4d')][_0x10af('0x47')]);_0xc1a825[_0x10af('0x32')]=_[_0x10af('0x46')](_0xacb09['query']);_0xc1a825[_0x10af('0x3a')]=_['intersection'](_0xc1a825[_0x10af('0x31')],_0xc1a825[_0x10af('0x32')]);_0x350fcc[_0x10af('0x34')]=_[_0x10af('0x33')](_0xc1a825[_0x10af('0x31')],qs[_0x10af('0x35')](_0xacb09['query'][_0x10af('0x35')]));_0x350fcc[_0x10af('0x34')]=_0x350fcc[_0x10af('0x34')][_0x10af('0x36')]?_0x350fcc[_0x10af('0x34')]:_0xc1a825[_0x10af('0x31')];_0x350fcc['order']=qs['sort'](_0xacb09[_0x10af('0x32')][_0x10af('0x38')]);_0x350fcc['where']=qs[_0x10af('0x3a')](_['pick'](_0xacb09[_0x10af('0x32')],_0xc1a825['filters']));if(_0xacb09[_0x10af('0x32')][_0x10af('0x3c')]){_0x350fcc[_0x10af('0x39')]=_['merge'](_0x350fcc[_0x10af('0x39')],{'$or':_[_0x10af('0x2d')](_0x350fcc[_0x10af('0x34')],function(_0x4b6cce){var _0x30d52f={};_0x30d52f[_0x4b6cce]={'$like':'%'+_0xacb09['query'][_0x10af('0x3c')]+'%'};return _0x30d52f;})});}_0x350fcc=_[_0x10af('0x3e')]({},_0x350fcc,_0xacb09[_0x10af('0x3f')]);return _0x3d1281[_0x10af('0x50')](_0x350fcc);}})[_0x10af('0x26')](function(_0x35c6ea){if(_0x35c6ea){_0x2be78c=_0x35c6ea[_0x10af('0x36')];if(!_0xacb09[_0x10af('0x32')]['hasOwnProperty']('nolimit')){_0x350fcc[_0x10af('0x21')]=qs[_0x10af('0x21')](_0xacb09[_0x10af('0x32')][_0x10af('0x21')]);_0x350fcc[_0x10af('0x1f')]=qs['offset'](_0xacb09[_0x10af('0x32')]['offset']);}return _0x3d1281[_0x10af('0x50')](_0x350fcc);}})[_0x10af('0x26')](function(_0x42ff85){if(_0x42ff85){return _0x42ff85?{'count':_0x2be78c,'rows':_0x42ff85}:null;}})['then'](respondWithResult(_0x4b0227,null))['catch'](handleError(_0x4b0227,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 490e7de..0ee0ed9 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 _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 +var _0x84ab=['request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','lodash','util','../../config/logger','api','moment'];(function(_0x442c60,_0x27c0fb){var _0x2242f3=function(_0x409aaa){while(--_0x409aaa){_0x442c60['push'](_0x442c60['shift']());}};_0x2242f3(++_0x27c0fb);}(_0x84ab,0x12f));var _0xb84a=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x84ab[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var logger=require(_0xb84a('0x2'))(_0xb84a('0x3'));var moment=require(_0xb84a('0x4'));var BPromise=require('bluebird');var rp=require(_0xb84a('0x5'));var fs=require('fs');var path=require(_0xb84a('0x6'));var rimraf=require('rimraf');var config=require(_0xb84a('0x7'));var attributes=require(_0xb84a('0x8'));module[_0xb84a('0x9')]=function(_0x5b9def,_0x521a64){return _0x5b9def['define'](_0xb84a('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index d66895b..5fb3af5 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 _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 +var _0x1104=['jayson/promise','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x55d022,_0x215de7){var _0x382771=function(_0x400487){while(--_0x400487){_0x55d022['push'](_0x55d022['shift']());}};_0x382771(++_0x215de7);}(_0x1104,0xbd));var _0x4110=function(_0x241469,_0x48dc40){_0x241469=_0x241469-0x0;var _0x436491=_0x1104[_0x241469];return _0x436491;};'use strict';var _=require(_0x4110('0x0'));var util=require(_0x4110('0x1'));var moment=require(_0x4110('0x2'));var BPromise=require(_0x4110('0x3'));var rs=require(_0x4110('0x4'));var fs=require('fs');var Redis=require(_0x4110('0x5'));var db=require(_0x4110('0x6'))['db'];var utils=require(_0x4110('0x7'));var logger=require(_0x4110('0x8'))(_0x4110('0x9'));var config=require(_0x4110('0xa'));var jayson=require(_0x4110('0xb'));var client=jayson[_0x4110('0xc')][_0x4110('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5b4233,_0x425236,_0x183fd9){return new BPromise(function(_0x389357,_0xc8c2a0){return client[_0x4110('0xe')](_0x5b4233,_0x183fd9)['then'](function(_0x1d306b){logger[_0x4110('0xf')](_0x4110('0x10'),_0x425236,_0x4110('0x11'));logger[_0x4110('0x12')](_0x4110('0x13'),_0x425236,_0x4110('0x11'),JSON['stringify'](_0x1d306b));if(_0x1d306b[_0x4110('0x14')]){if(_0x1d306b[_0x4110('0x14')][_0x4110('0x15')]===0x1f4){logger[_0x4110('0x14')](_0x4110('0x10'),_0x425236,_0x1d306b[_0x4110('0x14')][_0x4110('0x16')]);return _0xc8c2a0(_0x1d306b[_0x4110('0x14')][_0x4110('0x16')]);}logger[_0x4110('0x14')](_0x4110('0x10'),_0x425236,_0x1d306b[_0x4110('0x14')][_0x4110('0x16')]);return _0x389357(_0x1d306b['error']['message']);}else{logger[_0x4110('0xf')](_0x4110('0x10'),_0x425236,_0x4110('0x11'));_0x389357(_0x1d306b[_0x4110('0x17')]['message']);}})[_0x4110('0x18')](function(_0x13002d){logger[_0x4110('0x14')](_0x4110('0x10'),_0x425236,_0x13002d);_0xc8c2a0(_0x13002d);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 746b7af..648efdc 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 _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 +var _0x0b31=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','create','put','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x0b31,0x7b));var _0x10b3=function(_0x42802f,_0x34c93e){_0x42802f=_0x42802f-0x0;var _0x4c2dd4=_0x0b31[_0x42802f];return _0x4c2dd4;};'use strict';var multer=require('multer');var util=require(_0x10b3('0x0'));var path=require(_0x10b3('0x1'));var timeout=require(_0x10b3('0x2'));var express=require(_0x10b3('0x3'));var router=express[_0x10b3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x10b3('0x5'));var interaction=require(_0x10b3('0x6'));var config=require(_0x10b3('0x7'));var controller=require('./intDynamics365Field.controller');router[_0x10b3('0x8')]('/',auth[_0x10b3('0x9')](),controller[_0x10b3('0xa')]);router[_0x10b3('0x8')](_0x10b3('0xb'),auth[_0x10b3('0x9')](),controller['show']);router['post']('/',auth[_0x10b3('0x9')](),controller[_0x10b3('0xc')]);router[_0x10b3('0xd')]('/:id',auth[_0x10b3('0x9')](),controller['update']);router[_0x10b3('0xe')](_0x10b3('0xb'),auth[_0x10b3('0x9')](),controller['destroy']);module[_0x10b3('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 1c0be27..8ed17ad 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 _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 +var _0x2789=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x5ddc87,_0x1e5cbf){var _0x1530a2=function(_0x281507){while(--_0x281507){_0x5ddc87['push'](_0x5ddc87['shift']());}};_0x1530a2(++_0x1e5cbf);}(_0x2789,0x8b));var _0x9278=function(_0x96123e,_0x3cbb04){_0x96123e=_0x96123e-0x0;var _0x5bf305=_0x2789[_0x96123e];return _0x5bf305;};'use strict';var Sequelize=require(_0x9278('0x0'));module[_0x9278('0x1')]={'type':{'type':Sequelize[_0x9278('0x2')](_0x9278('0x3'),_0x9278('0x4'),_0x9278('0x5'),_0x9278('0x6'),_0x9278('0x7')),'defaultValue':_0x9278('0x3')},'content':{'type':Sequelize[_0x9278('0x8')]},'key':{'type':Sequelize[_0x9278('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x9278('0x3'),'variable',_0x9278('0x5'))},'keyContent':{'type':Sequelize[_0x9278('0x8')]},'idField':{'type':Sequelize[_0x9278('0x8')]},'nameField':{'type':Sequelize[_0x9278('0x8')]},'customField':{'type':Sequelize[_0x9278('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9278('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 14b8d76..da5dec6 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 _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 +var _0x8d64=['merge','where','VIRTUAL','includeAll','include','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','map','Dynamics365Field','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter'];(function(_0x72cd43,_0x8ccc2b){var _0x3976af=function(_0x5b6701){while(--_0x5b6701){_0x72cd43['push'](_0x72cd43['shift']());}};_0x3976af(++_0x8ccc2b);}(_0x8d64,0xea));var _0x48d6=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0x8d64[_0xd7b0a4];return _0x184e9e;};'use strict';var emlformat=require(_0x48d6('0x0'));var rimraf=require(_0x48d6('0x1'));var zipdir=require(_0x48d6('0x2'));var jsonpatch=require(_0x48d6('0x3'));var rp=require(_0x48d6('0x4'));var moment=require(_0x48d6('0x5'));var BPromise=require(_0x48d6('0x6'));var Mustache=require(_0x48d6('0x7'));var util=require('util');var path=require(_0x48d6('0x8'));var sox=require(_0x48d6('0x9'));var csv=require('to-csv');var ejs=require(_0x48d6('0xa'));var fs=require('fs');var fs_extra=require(_0x48d6('0xb'));var _=require(_0x48d6('0xc'));var squel=require(_0x48d6('0xd'));var crypto=require(_0x48d6('0xe'));var jsforce=require(_0x48d6('0xf'));var deskjs=require(_0x48d6('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x48d6('0x11'));var Redis=require(_0x48d6('0x12'));var authService=require(_0x48d6('0x13'));var qs=require(_0x48d6('0x14'));var as=require(_0x48d6('0x15'));var hardwareService=require(_0x48d6('0x16'));var logger=require(_0x48d6('0x17'))('api');var utils=require(_0x48d6('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x48d6('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14b84f,_0x4b2c7d){_0x4b2c7d=_0x4b2c7d||0xcc;return function(_0x474373){if(_0x474373){return _0x14b84f[_0x48d6('0x1a')](_0x4b2c7d);}return _0x14b84f[_0x48d6('0x1b')](_0x4b2c7d)[_0x48d6('0x1c')]();};}function respondWithResult(_0x44865f,_0x42e570){_0x42e570=_0x42e570||0xc8;return function(_0x16754d){if(_0x16754d){return _0x44865f[_0x48d6('0x1b')](_0x42e570)[_0x48d6('0x1d')](_0x16754d);}};}function respondWithFilteredResult(_0x4058fd,_0x276fa1){return function(_0x14660b){if(_0x14660b){var _0x436c23=typeof _0x276fa1[_0x48d6('0x1e')]==='undefined'&&typeof _0x276fa1['limit']==='undefined';var _0x13f009=_0x14660b[_0x48d6('0x1f')];var _0x218902=_0x436c23?0x0:_0x276fa1[_0x48d6('0x1e')];var _0x355737=_0x436c23?_0x14660b[_0x48d6('0x1f')]:_0x276fa1[_0x48d6('0x1e')]+_0x276fa1[_0x48d6('0x20')];var _0x421ee4;if(_0x355737>=_0x13f009){_0x355737=_0x13f009;_0x421ee4=0xc8;}else{_0x421ee4=0xce;}_0x4058fd[_0x48d6('0x1b')](_0x421ee4);return _0x4058fd[_0x48d6('0x21')](_0x48d6('0x22'),_0x218902+'-'+_0x355737+'/'+_0x13f009)[_0x48d6('0x1d')](_0x14660b);}return null;};}function patchUpdates(_0x25dae1){return function(_0x2e6bd4){try{jsonpatch[_0x48d6('0x23')](_0x2e6bd4,_0x25dae1,!![]);}catch(_0x158468){return BPromise[_0x48d6('0x24')](_0x158468);}return _0x2e6bd4[_0x48d6('0x25')]();};}function saveUpdates(_0x5766fa,_0x523bda){return function(_0x49170c){if(_0x49170c){return _0x49170c[_0x48d6('0x26')](_0x5766fa)['then'](function(_0x4063b8){return _0x4063b8;});}return null;};}function removeEntity(_0x51a71a,_0x69318c){return function(_0x3a2b93){if(_0x3a2b93){return _0x3a2b93[_0x48d6('0x27')]()[_0x48d6('0x28')](function(){_0x51a71a[_0x48d6('0x1b')](0xcc)[_0x48d6('0x1c')]();});}};}function handleEntityNotFound(_0x24cd3e,_0x2e32af){return function(_0x5f2fe7){if(!_0x5f2fe7){_0x24cd3e[_0x48d6('0x1a')](0x194);}return _0x5f2fe7;};}function handleError(_0x134c6d,_0x101f6c){_0x101f6c=_0x101f6c||0x1f4;return function(_0x5cbccf){logger[_0x48d6('0x29')](_0x5cbccf[_0x48d6('0x2a')]);if(_0x5cbccf[_0x48d6('0x2b')]){delete _0x5cbccf[_0x48d6('0x2b')];}_0x134c6d['status'](_0x101f6c)['send'](_0x5cbccf);};}exports['index']=function(_0x553a47,_0x4cd0f1){var _0x181ca5={},_0x3cf5e0={},_0x4de603={'count':0x0,'rows':[]};var _0x435913=_[_0x48d6('0x2c')](db[_0x48d6('0x2d')]['rawAttributes'],function(_0x2e00ae){return{'name':_0x2e00ae[_0x48d6('0x2e')],'type':_0x2e00ae['type'][_0x48d6('0x2f')]};});_0x3cf5e0[_0x48d6('0x30')]=_[_0x48d6('0x2c')](_0x435913,'name');_0x3cf5e0[_0x48d6('0x31')]=_[_0x48d6('0x32')](_0x553a47[_0x48d6('0x31')]);_0x3cf5e0[_0x48d6('0x33')]=_[_0x48d6('0x34')](_0x3cf5e0[_0x48d6('0x30')],_0x3cf5e0[_0x48d6('0x31')]);_0x181ca5[_0x48d6('0x35')]=_[_0x48d6('0x34')](_0x3cf5e0['model'],qs[_0x48d6('0x36')](_0x553a47[_0x48d6('0x31')][_0x48d6('0x36')]));_0x181ca5[_0x48d6('0x35')]=_0x181ca5[_0x48d6('0x35')][_0x48d6('0x37')]?_0x181ca5[_0x48d6('0x35')]:_0x3cf5e0['model'];if(!_0x553a47[_0x48d6('0x31')][_0x48d6('0x38')](_0x48d6('0x39'))){_0x181ca5[_0x48d6('0x20')]=qs[_0x48d6('0x20')](_0x553a47[_0x48d6('0x31')]['limit']);_0x181ca5[_0x48d6('0x1e')]=qs['offset'](_0x553a47[_0x48d6('0x31')][_0x48d6('0x1e')]);}_0x181ca5[_0x48d6('0x3a')]=qs[_0x48d6('0x3b')](_0x553a47[_0x48d6('0x31')][_0x48d6('0x3b')]);_0x181ca5['where']=qs[_0x48d6('0x33')](_[_0x48d6('0x3c')](_0x553a47[_0x48d6('0x31')],_0x3cf5e0[_0x48d6('0x33')]),_0x435913);if(_0x553a47['query'][_0x48d6('0x3d')]){_0x181ca5['where']=_[_0x48d6('0x3e')](_0x181ca5[_0x48d6('0x3f')],{'$or':_[_0x48d6('0x2c')](_0x435913,function(_0x50770d){if(_0x50770d['type']!==_0x48d6('0x40')){var _0x446f4b={};_0x446f4b[_0x50770d[_0x48d6('0x2b')]]={'$like':'%'+_0x553a47[_0x48d6('0x31')]['filter']+'%'};return _0x446f4b;}})});}_0x181ca5=_[_0x48d6('0x3e')]({},_0x181ca5,_0x553a47['options']);var _0x47390d={'where':_0x181ca5[_0x48d6('0x3f')]};return db['Dynamics365Field'][_0x48d6('0x1f')](_0x47390d)[_0x48d6('0x28')](function(_0xfe1564){_0x4de603[_0x48d6('0x1f')]=_0xfe1564;if(_0x553a47[_0x48d6('0x31')][_0x48d6('0x41')]){_0x181ca5[_0x48d6('0x42')]=[{'all':!![]}];}return db[_0x48d6('0x2d')]['findAll'](_0x181ca5);})[_0x48d6('0x28')](function(_0x30df5b){_0x4de603['rows']=_0x30df5b;return _0x4de603;})[_0x48d6('0x28')](respondWithFilteredResult(_0x4cd0f1,_0x181ca5))[_0x48d6('0x43')](handleError(_0x4cd0f1,null));};exports[_0x48d6('0x44')]=function(_0x2cd434,_0x4ef230){var _0x630375={'raw':!![],'where':{'id':_0x2cd434[_0x48d6('0x45')]['id']}},_0x250411={};_0x250411[_0x48d6('0x30')]=_[_0x48d6('0x32')](db[_0x48d6('0x2d')]['rawAttributes']);_0x250411[_0x48d6('0x31')]=_[_0x48d6('0x32')](_0x2cd434[_0x48d6('0x31')]);_0x250411[_0x48d6('0x33')]=_['intersection'](_0x250411['model'],_0x250411[_0x48d6('0x31')]);_0x630375[_0x48d6('0x35')]=_[_0x48d6('0x34')](_0x250411['model'],qs['fields'](_0x2cd434[_0x48d6('0x31')][_0x48d6('0x36')]));_0x630375['attributes']=_0x630375[_0x48d6('0x35')]['length']?_0x630375[_0x48d6('0x35')]:_0x250411[_0x48d6('0x30')];if(_0x2cd434[_0x48d6('0x31')]['includeAll']){_0x630375[_0x48d6('0x42')]=[{'all':!![]}];}_0x630375=_[_0x48d6('0x3e')]({},_0x630375,_0x2cd434[_0x48d6('0x46')]);return db[_0x48d6('0x2d')][_0x48d6('0x47')](_0x630375)[_0x48d6('0x28')](handleEntityNotFound(_0x4ef230,null))[_0x48d6('0x28')](respondWithResult(_0x4ef230,null))[_0x48d6('0x43')](handleError(_0x4ef230,null));};exports['create']=function(_0x3af0d0,_0x12a028){return db[_0x48d6('0x2d')][_0x48d6('0x48')](_0x3af0d0['body'],{})[_0x48d6('0x28')](respondWithResult(_0x12a028,0xc9))[_0x48d6('0x43')](handleError(_0x12a028,null));};exports[_0x48d6('0x26')]=function(_0x1474c8,_0x18c531){if(_0x1474c8[_0x48d6('0x49')]['id']){delete _0x1474c8[_0x48d6('0x49')]['id'];}return db[_0x48d6('0x2d')][_0x48d6('0x47')]({'where':{'id':_0x1474c8[_0x48d6('0x45')]['id']}})[_0x48d6('0x28')](handleEntityNotFound(_0x18c531,null))['then'](saveUpdates(_0x1474c8[_0x48d6('0x49')],null))[_0x48d6('0x28')](respondWithResult(_0x18c531,null))['catch'](handleError(_0x18c531,null));};exports['destroy']=function(_0x12e505,_0x550b3a){return db[_0x48d6('0x2d')][_0x48d6('0x47')]({'where':{'id':_0x12e505[_0x48d6('0x45')]['id']}})[_0x48d6('0x28')](handleEntityNotFound(_0x550b3a,null))[_0x48d6('0x28')](removeEntity(_0x550b3a,null))[_0x48d6('0x43')](handleError(_0x550b3a,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 9d3bb89..d9c6b02 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 _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 +var _0xee4b=['./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xfd166a,_0x2b982b){var _0x37d4d1=function(_0x90c6ca){while(--_0x90c6ca){_0xfd166a['push'](_0xfd166a['shift']());}};_0x37d4d1(++_0x2b982b);}(_0xee4b,0xe8));var _0xbee4=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0xee4b[_0x119280];return _0x481797;};'use strict';var _=require(_0xbee4('0x0'));var util=require('util');var logger=require(_0xbee4('0x1'))(_0xbee4('0x2'));var moment=require(_0xbee4('0x3'));var BPromise=require(_0xbee4('0x4'));var rp=require(_0xbee4('0x5'));var fs=require('fs');var path=require(_0xbee4('0x6'));var rimraf=require('rimraf');var config=require(_0xbee4('0x7'));var attributes=require(_0xbee4('0x8'));module[_0xbee4('0x9')]=function(_0x147d01,_0x5c508b){return _0x147d01['define'](_0xbee4('0xa'),attributes,{'tableName':_0xbee4('0xb'),'paranoid':![],'indexes':[{'name':_0xbee4('0xc'),'fields':[_0xbee4('0xd'),_0xbee4('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 605642c..f9fe6bb 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 _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 +var _0xc5bb=['debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s'];(function(_0x22fcf2,_0x1f9240){var _0x4e6c42=function(_0x23a928){while(--_0x23a928){_0x22fcf2['push'](_0x22fcf2['shift']());}};_0x4e6c42(++_0x1f9240);}(_0xc5bb,0x68));var _0xbc5b=function(_0x44755c,_0x162ddd){_0x44755c=_0x44755c-0x0;var _0x3a4a88=_0xc5bb[_0x44755c];return _0x3a4a88;};'use strict';var _=require(_0xbc5b('0x0'));var util=require(_0xbc5b('0x1'));var moment=require('moment');var BPromise=require(_0xbc5b('0x2'));var rs=require(_0xbc5b('0x3'));var fs=require('fs');var Redis=require(_0xbc5b('0x4'));var db=require(_0xbc5b('0x5'))['db'];var utils=require(_0xbc5b('0x6'));var logger=require(_0xbc5b('0x7'))(_0xbc5b('0x8'));var config=require(_0xbc5b('0x9'));var jayson=require(_0xbc5b('0xa'));var client=jayson[_0xbc5b('0xb')][_0xbc5b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x6f9189,_0x2c5e37,_0x3acb7a){return new BPromise(function(_0x5b0762,_0x49accd){return client[_0xbc5b('0xd')](_0x6f9189,_0x3acb7a)['then'](function(_0xc38b8b){logger[_0xbc5b('0xe')](_0xbc5b('0xf'),_0x2c5e37,'request\x20sent');logger[_0xbc5b('0x10')](_0xbc5b('0x11'),_0x2c5e37,_0xbc5b('0x12'),JSON[_0xbc5b('0x13')](_0xc38b8b));if(_0xc38b8b[_0xbc5b('0x14')]){if(_0xc38b8b[_0xbc5b('0x14')][_0xbc5b('0x15')]===0x1f4){logger[_0xbc5b('0x14')](_0xbc5b('0xf'),_0x2c5e37,_0xc38b8b[_0xbc5b('0x14')]['message']);return _0x49accd(_0xc38b8b[_0xbc5b('0x14')]['message']);}logger[_0xbc5b('0x14')](_0xbc5b('0xf'),_0x2c5e37,_0xc38b8b[_0xbc5b('0x14')][_0xbc5b('0x16')]);return _0x5b0762(_0xc38b8b[_0xbc5b('0x14')][_0xbc5b('0x16')]);}else{logger[_0xbc5b('0xe')](_0xbc5b('0xf'),_0x2c5e37,'request\x20sent');_0x5b0762(_0xc38b8b['result'][_0xbc5b('0x16')]);}})[_0xbc5b('0x17')](function(_0x4cc7c5){logger['error'](_0xbc5b('0xf'),_0x2c5e37,_0x4cc7c5);_0x49accd(_0x4cc7c5);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index e356a95..5cf7437 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 _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 +var _0x8a35=['isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x531049,_0x369227){var _0x18151b=function(_0x17d4ef){while(--_0x17d4ef){_0x531049['push'](_0x531049['shift']());}};_0x18151b(++_0x369227);}(_0x8a35,0x10a));var _0x58a3=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8a35[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x58a3('0x0'));var util=require('util');var path=require(_0x58a3('0x1'));var timeout=require(_0x58a3('0x2'));var express=require(_0x58a3('0x3'));var router=express[_0x58a3('0x4')]();var fs_extra=require(_0x58a3('0x5'));var auth=require(_0x58a3('0x6'));var interaction=require(_0x58a3('0x7'));var config=require(_0x58a3('0x8'));var controller=require('./intFreshdeskAccount.controller');router[_0x58a3('0x9')]('/',auth[_0x58a3('0xa')](),controller[_0x58a3('0xb')]);router[_0x58a3('0x9')](_0x58a3('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x58a3('0xd'),auth[_0x58a3('0xa')](),controller[_0x58a3('0xe')]);router[_0x58a3('0x9')](_0x58a3('0xf'),auth[_0x58a3('0xa')](),controller[_0x58a3('0x10')]);router[_0x58a3('0x11')]('/',auth[_0x58a3('0xa')](),controller['create']);router[_0x58a3('0x11')](_0x58a3('0xd'),auth[_0x58a3('0xa')](),controller[_0x58a3('0x12')]);router[_0x58a3('0x13')](_0x58a3('0xc'),auth[_0x58a3('0xa')](),controller['update']);router[_0x58a3('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x58a3('0x15')]);module[_0x58a3('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index be53395..ea02277 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 _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 +var _0xe2cf=['remoteUri','exports','STRING','username'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x151f00,_0x4ca3a1){_0x151f00=_0x151f00-0x0;var _0x418d9b=_0xe2cf[_0x151f00];return _0x418d9b;};'use strict';var Sequelize=require('sequelize');module[_0xfe2c('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfe2c('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xfe2c('0x2')},'apiKey':{'type':Sequelize[_0xfe2c('0x1')]},'remoteUri':{'type':Sequelize[_0xfe2c('0x1')],'unique':_0xfe2c('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 9ef2f35..26d389d 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 _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 +var _0x4e81=['eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','options','where','includeAll','include','findAll','show','params','find','catch','create','body','findOne','FreshdeskConfiguration','getConfigurations','nolimit','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','FreshdeskField','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','apiKey','toString','base64','agent','description','group','ticket_type','company','remove','includes','default','label','choices','capitalize','test','statusCode','getFields','Wrong\x20credentials'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x4e81,0x1bc));var _0x14e8=function(_0xf26d40,_0x2f4f46){_0xf26d40=_0xf26d40-0x0;var _0x50b68c=_0x4e81[_0xf26d40];return _0x50b68c;};'use strict';var emlformat=require(_0x14e8('0x0'));var rimraf=require(_0x14e8('0x1'));var zipdir=require(_0x14e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x14e8('0x3'));var Mustache=require(_0x14e8('0x4'));var util=require(_0x14e8('0x5'));var path=require(_0x14e8('0x6'));var sox=require(_0x14e8('0x7'));var csv=require(_0x14e8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14e8('0x9'));var squel=require(_0x14e8('0xa'));var crypto=require(_0x14e8('0xb'));var jsforce=require(_0x14e8('0xc'));var deskjs=require(_0x14e8('0xd'));var toCsv=require(_0x14e8('0x8'));var querystring=require(_0x14e8('0xe'));var Papa=require(_0x14e8('0xf'));var Redis=require(_0x14e8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x14e8('0x11'));var as=require(_0x14e8('0x12'));var hardwareService=require(_0x14e8('0x13'));var logger=require(_0x14e8('0x14'))(_0x14e8('0x15'));var utils=require(_0x14e8('0x16'));var config=require(_0x14e8('0x17'));var licenseUtil=require(_0x14e8('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x14e8('0x19'));function respondWithStatusCode(_0x59c6c9,_0x2607ef){_0x2607ef=_0x2607ef||0xcc;return function(_0x341d40){if(_0x341d40){return _0x59c6c9[_0x14e8('0x1a')](_0x2607ef);}return _0x59c6c9['status'](_0x2607ef)[_0x14e8('0x1b')]();};}function respondWithResult(_0x4e1064,_0x458e4a){_0x458e4a=_0x458e4a||0xc8;return function(_0x58d26e){if(_0x58d26e){return _0x4e1064[_0x14e8('0x1c')](_0x458e4a)[_0x14e8('0x1d')](_0x58d26e);}};}function respondWithFilteredResult(_0xc6101f,_0x135996){return function(_0x52e64f){if(_0x52e64f){var _0x10c4a9=typeof _0x135996[_0x14e8('0x1e')]===_0x14e8('0x1f')&&typeof _0x135996[_0x14e8('0x20')]===_0x14e8('0x1f');var _0x1f1a0d=_0x52e64f[_0x14e8('0x21')];var _0x462259=_0x10c4a9?0x0:_0x135996['offset'];var _0x328c5a=_0x10c4a9?_0x52e64f[_0x14e8('0x21')]:_0x135996[_0x14e8('0x1e')]+_0x135996[_0x14e8('0x20')];var _0x246c5d;if(_0x328c5a>=_0x1f1a0d){_0x328c5a=_0x1f1a0d;_0x246c5d=0xc8;}else{_0x246c5d=0xce;}_0xc6101f['status'](_0x246c5d);return _0xc6101f[_0x14e8('0x22')](_0x14e8('0x23'),_0x462259+'-'+_0x328c5a+'/'+_0x1f1a0d)[_0x14e8('0x1d')](_0x52e64f);}return null;};}function patchUpdates(_0x48e30a){return function(_0x2c3f45){try{jsonpatch['apply'](_0x2c3f45,_0x48e30a,!![]);}catch(_0x4cca43){return BPromise[_0x14e8('0x24')](_0x4cca43);}return _0x2c3f45[_0x14e8('0x25')]();};}function saveUpdates(_0x117b00,_0xcf673){return function(_0x4ad25d){if(_0x4ad25d){return _0x4ad25d[_0x14e8('0x26')](_0x117b00)['then'](function(_0x31bdd3){return _0x31bdd3;});}return null;};}function removeEntity(_0x185a0e,_0x4ffc8b){return function(_0x58a3a1){if(_0x58a3a1){return _0x58a3a1['destroy']()[_0x14e8('0x27')](function(){_0x185a0e[_0x14e8('0x1c')](0xcc)[_0x14e8('0x1b')]();});}};}function handleEntityNotFound(_0x20bfe8,_0x333d44){return function(_0x57eb46){if(!_0x57eb46){_0x20bfe8[_0x14e8('0x1a')](0x194);}return _0x57eb46;};}function handleError(_0x3fd96d,_0x3c09cb){_0x3c09cb=_0x3c09cb||0x1f4;return function(_0x2f5818){logger[_0x14e8('0x28')](_0x2f5818[_0x14e8('0x29')]);if(_0x2f5818[_0x14e8('0x2a')]){delete _0x2f5818['name'];}_0x3fd96d[_0x14e8('0x1c')](_0x3c09cb)[_0x14e8('0x2b')](_0x2f5818);};}exports[_0x14e8('0x2c')]=function(_0x5f5abb,_0x48eed0){var _0x5cacd7={},_0x8fe0e2={},_0x2a408d={'count':0x0,'rows':[]};var _0x567385=_[_0x14e8('0x2d')](db[_0x14e8('0x2e')][_0x14e8('0x2f')],function(_0xa83433){return{'name':_0xa83433['fieldName'],'type':_0xa83433[_0x14e8('0x30')][_0x14e8('0x31')]};});_0x8fe0e2[_0x14e8('0x32')]=_[_0x14e8('0x2d')](_0x567385,_0x14e8('0x2a'));_0x8fe0e2['query']=_[_0x14e8('0x33')](_0x5f5abb[_0x14e8('0x34')]);_0x8fe0e2[_0x14e8('0x35')]=_[_0x14e8('0x36')](_0x8fe0e2['model'],_0x8fe0e2[_0x14e8('0x34')]);_0x5cacd7['attributes']=_[_0x14e8('0x36')](_0x8fe0e2[_0x14e8('0x32')],qs[_0x14e8('0x37')](_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x37')]));_0x5cacd7[_0x14e8('0x38')]=_0x5cacd7[_0x14e8('0x38')][_0x14e8('0x39')]?_0x5cacd7[_0x14e8('0x38')]:_0x8fe0e2[_0x14e8('0x32')];if(!_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x3a')]('nolimit')){_0x5cacd7['limit']=qs['limit'](_0x5f5abb[_0x14e8('0x34')]['limit']);_0x5cacd7[_0x14e8('0x1e')]=qs['offset'](_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x1e')]);}_0x5cacd7[_0x14e8('0x3b')]=qs[_0x14e8('0x3c')](_0x5f5abb['query'][_0x14e8('0x3c')]);_0x5cacd7['where']=qs[_0x14e8('0x35')](_[_0x14e8('0x3d')](_0x5f5abb[_0x14e8('0x34')],_0x8fe0e2[_0x14e8('0x35')]),_0x567385);if(_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x3e')]){_0x5cacd7['where']=_[_0x14e8('0x3f')](_0x5cacd7['where'],{'$or':_[_0x14e8('0x2d')](_0x567385,function(_0x20f69d){if(_0x20f69d[_0x14e8('0x30')]!=='VIRTUAL'){var _0x27d51b={};_0x27d51b[_0x20f69d[_0x14e8('0x2a')]]={'$like':'%'+_0x5f5abb['query'][_0x14e8('0x3e')]+'%'};return _0x27d51b;}})});}_0x5cacd7=_[_0x14e8('0x3f')]({},_0x5cacd7,_0x5f5abb[_0x14e8('0x40')]);var _0x3a7aa7={'where':_0x5cacd7[_0x14e8('0x41')]};return db[_0x14e8('0x2e')][_0x14e8('0x21')](_0x3a7aa7)[_0x14e8('0x27')](function(_0x33743a){_0x2a408d[_0x14e8('0x21')]=_0x33743a;if(_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x42')]){_0x5cacd7[_0x14e8('0x43')]=[{'all':!![]}];}return db[_0x14e8('0x2e')][_0x14e8('0x44')](_0x5cacd7);})['then'](function(_0x24c9e6){_0x2a408d['rows']=_0x24c9e6;return _0x2a408d;})['then'](respondWithFilteredResult(_0x48eed0,_0x5cacd7))['catch'](handleError(_0x48eed0,null));};exports[_0x14e8('0x45')]=function(_0x5ed821,_0x46a3c4){var _0x45bff0={'raw':![],'where':{'id':_0x5ed821[_0x14e8('0x46')]['id']}},_0x7907e8={};_0x7907e8[_0x14e8('0x32')]=_[_0x14e8('0x33')](db[_0x14e8('0x2e')][_0x14e8('0x2f')]);_0x7907e8[_0x14e8('0x34')]=_[_0x14e8('0x33')](_0x5ed821[_0x14e8('0x34')]);_0x7907e8['filters']=_[_0x14e8('0x36')](_0x7907e8[_0x14e8('0x32')],_0x7907e8[_0x14e8('0x34')]);_0x45bff0[_0x14e8('0x38')]=_['intersection'](_0x7907e8[_0x14e8('0x32')],qs[_0x14e8('0x37')](_0x5ed821['query']['fields']));_0x45bff0[_0x14e8('0x38')]=_0x45bff0['attributes']['length']?_0x45bff0[_0x14e8('0x38')]:_0x7907e8[_0x14e8('0x32')];if(_0x5ed821['query'][_0x14e8('0x42')]){_0x45bff0[_0x14e8('0x43')]=[{'all':!![]}];}_0x45bff0=_['merge']({},_0x45bff0,_0x5ed821[_0x14e8('0x40')]);return db[_0x14e8('0x2e')][_0x14e8('0x47')](_0x45bff0)[_0x14e8('0x27')](handleEntityNotFound(_0x46a3c4,null))[_0x14e8('0x27')](respondWithResult(_0x46a3c4,null))[_0x14e8('0x48')](handleError(_0x46a3c4,null));};exports[_0x14e8('0x49')]=function(_0x2541ad,_0x146e2c){return db[_0x14e8('0x2e')][_0x14e8('0x49')](_0x2541ad[_0x14e8('0x4a')],{})[_0x14e8('0x27')](respondWithResult(_0x146e2c,0xc9))[_0x14e8('0x48')](handleError(_0x146e2c,null));};exports[_0x14e8('0x26')]=function(_0x1f50bc,_0x59820f){if(_0x1f50bc[_0x14e8('0x4a')]['id']){delete _0x1f50bc['body']['id'];}return db[_0x14e8('0x2e')][_0x14e8('0x47')]({'where':{'id':_0x1f50bc[_0x14e8('0x46')]['id']}})[_0x14e8('0x27')](handleEntityNotFound(_0x59820f,null))['then'](saveUpdates(_0x1f50bc['body'],null))['then'](respondWithResult(_0x59820f,null))[_0x14e8('0x48')](handleError(_0x59820f,null));};exports['destroy']=function(_0x55f9b0,_0xd2b281){return db[_0x14e8('0x2e')]['find']({'where':{'id':_0x55f9b0[_0x14e8('0x46')]['id']}})[_0x14e8('0x27')](handleEntityNotFound(_0xd2b281,null))[_0x14e8('0x27')](removeEntity(_0xd2b281,null))[_0x14e8('0x48')](handleError(_0xd2b281,null));};exports['getConfigurations']=function(_0x519c9c,_0x1cdcca,_0xc602b1){var _0x15464a={};var _0x3a09b7={};var _0x41b5ab;var _0x2fbac7;return db['FreshdeskAccount'][_0x14e8('0x4b')]({'where':{'id':_0x519c9c[_0x14e8('0x46')]['id']}})[_0x14e8('0x27')](handleEntityNotFound(_0x1cdcca,null))[_0x14e8('0x27')](function(_0x5e6083){if(_0x5e6083){_0x41b5ab=_0x5e6083;_0x3a09b7[_0x14e8('0x32')]=_[_0x14e8('0x33')](db[_0x14e8('0x4c')][_0x14e8('0x2f')]);_0x3a09b7['query']=_[_0x14e8('0x33')](_0x519c9c[_0x14e8('0x34')]);_0x3a09b7[_0x14e8('0x35')]=_[_0x14e8('0x36')](_0x3a09b7[_0x14e8('0x32')],_0x3a09b7[_0x14e8('0x34')]);_0x15464a[_0x14e8('0x38')]=_[_0x14e8('0x36')](_0x3a09b7['model'],qs['fields'](_0x519c9c[_0x14e8('0x34')][_0x14e8('0x37')]));_0x15464a[_0x14e8('0x38')]=_0x15464a[_0x14e8('0x38')][_0x14e8('0x39')]?_0x15464a['attributes']:_0x3a09b7['model'];_0x15464a['order']=qs[_0x14e8('0x3c')](_0x519c9c[_0x14e8('0x34')][_0x14e8('0x3c')]);_0x15464a['where']=qs[_0x14e8('0x35')](_[_0x14e8('0x3d')](_0x519c9c[_0x14e8('0x34')],_0x3a09b7['filters']));if(_0x519c9c[_0x14e8('0x34')][_0x14e8('0x3e')]){_0x15464a[_0x14e8('0x41')]=_[_0x14e8('0x3f')](_0x15464a[_0x14e8('0x41')],{'$or':_[_0x14e8('0x2d')](_0x15464a[_0x14e8('0x38')],function(_0x12a2b3){var _0x2da07b={};_0x2da07b[_0x12a2b3]={'$like':'%'+_0x519c9c[_0x14e8('0x34')][_0x14e8('0x3e')]+'%'};return _0x2da07b;})});}_0x15464a=_['merge']({},_0x15464a,_0x519c9c[_0x14e8('0x40')]);return _0x41b5ab[_0x14e8('0x4d')](_0x15464a);}})[_0x14e8('0x27')](function(_0x38e79a){if(_0x38e79a){_0x2fbac7=_0x38e79a[_0x14e8('0x39')];if(!_0x519c9c[_0x14e8('0x34')][_0x14e8('0x3a')](_0x14e8('0x4e'))){_0x15464a[_0x14e8('0x20')]=qs[_0x14e8('0x20')](_0x519c9c[_0x14e8('0x34')][_0x14e8('0x20')]);_0x15464a['offset']=qs[_0x14e8('0x1e')](_0x519c9c[_0x14e8('0x34')]['offset']);}return _0x41b5ab[_0x14e8('0x4d')](_0x15464a);}})[_0x14e8('0x27')](function(_0x31e785){if(_0x31e785){return _0x31e785?{'count':_0x2fbac7,'rows':_0x31e785}:null;}})[_0x14e8('0x27')](respondWithResult(_0x1cdcca,null))[_0x14e8('0x48')](handleError(_0x1cdcca,null));};exports[_0x14e8('0x4f')]=function(_0x139405,_0x5b6e28,_0x4c30dd){if(_0x139405['body']['id']){delete _0x139405[_0x14e8('0x4a')]['id'];}return db[_0x14e8('0x2e')][_0x14e8('0x4b')]({'where':{'id':_0x139405[_0x14e8('0x46')]['id']}})[_0x14e8('0x27')](handleEntityNotFound(_0x5b6e28,null))[_0x14e8('0x27')](function(_0x402956){if(_0x402956){_0x139405['body'][_0x14e8('0x50')]=_0x402956['id'];_0x139405[_0x14e8('0x4a')]['Subjects']=integrations[_0x14e8('0x51')](_0x139405[_0x14e8('0x4a')]['channel'],_0x139405['body']['type']);_0x139405[_0x14e8('0x4a')][_0x14e8('0x52')]=integrations[_0x14e8('0x53')](_0x139405[_0x14e8('0x4a')]['channel'],_0x139405[_0x14e8('0x4a')][_0x14e8('0x30')]);return db[_0x14e8('0x4c')][_0x14e8('0x49')](_0x139405[_0x14e8('0x4a')],{'include':[{'model':db[_0x14e8('0x54')],'as':'Subjects'},{'model':db[_0x14e8('0x54')],'as':_0x14e8('0x52')}]});}return null;})[_0x14e8('0x27')](respondWithResult(_0x5b6e28,null))['catch'](handleError(_0x5b6e28,null));};exports['getFields']=function(_0x20a598,_0x53d0c8,_0x25f63c){var _0x5cbce8='';return db[_0x14e8('0x2e')]['findOne']({'where':{'id':_0x20a598[_0x14e8('0x46')]['id']},'attributes':['id',_0x14e8('0x55'),'apiKey']})[_0x14e8('0x27')](handleEntityNotFound(_0x53d0c8,null))[_0x14e8('0x27')](function(_0x3c4679){if(_0x3c4679){_0x5cbce8=_0x3c4679[_0x14e8('0x55')];var _0x2fb11f=_0x5cbce8[_0x14e8('0x56')](-0x1);if(_0x2fb11f==='/'){_0x5cbce8=_0x5cbce8[_0x14e8('0x57')](0x0,_0x5cbce8[_0x14e8('0x58')](_0x2fb11f));}return rp({'method':_0x14e8('0x59'),'uri':util[_0x14e8('0x5a')](_0x14e8('0x5b'),_0x5cbce8,_0x14e8('0x5c')),'headers':{'Authorization':util[_0x14e8('0x5a')]('Basic\x20%s',new Buffer(util['format']('%s:X',_0x3c4679[_0x14e8('0x5d')]))[_0x14e8('0x5e')](_0x14e8('0x5f')))},'json':!![]});}})['then'](function(_0x19d6ae){if(_0x19d6ae){var _0x557a0f=['requester','subject',_0x14e8('0x60'),_0x14e8('0x61'),_0x14e8('0x1c'),'priority',_0x14e8('0x62'),'source',_0x14e8('0x63'),_0x14e8('0x62'),_0x14e8('0x64')];_[_0x14e8('0x65')](_0x19d6ae,function(_0x3ab99d){return _0x557a0f[_0x14e8('0x66')](_0x3ab99d[_0x14e8('0x2a')])||!_0x3ab99d[_0x14e8('0x67')]&&_0x3ab99d[_0x14e8('0x30')]!=='custom_text'&&_0x3ab99d[_0x14e8('0x30')]!=='custom_dropdown';});return{'count':_0x19d6ae[_0x14e8('0x39')],'rows':_[_0x14e8('0x2d')](_0x19d6ae,function(_0x53b143){return{'id':_0x53b143[_0x14e8('0x2a')],'name':_0x53b143[_0x14e8('0x68')],'custom':!_0x53b143[_0x14e8('0x67')],'options':_0x53b143[_0x14e8('0x69')]?_[_0x14e8('0x2d')](_0x53b143[_0x14e8('0x69')],function(_0x4f06e1){return{'name':_[_0x14e8('0x6a')](_0x4f06e1),'value':_0x4f06e1};}):[]};})};}})[_0x14e8('0x27')](respondWithResult(_0x53d0c8,null))[_0x14e8('0x48')](function(_0x15bd4a){var _0x492757=_0x20a598[_0x14e8('0x34')][_0x14e8('0x6b')]?0x1f4:_0x15bd4a[_0x14e8('0x6c')]||0x1f4;logger[_0x14e8('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x14e8('0x6d'),_0x492757,JSON['stringify'](_0x15bd4a));delete _0x15bd4a[_0x14e8('0x2a')];if(_0x492757===0x191){_0x492757=0x190;}_0x53d0c8['status'](_0x492757)['send'](_0x20a598[_0x14e8('0x34')][_0x14e8('0x6b')]?{'message':_0x14e8('0x6e'),'statusCode':_0x15bd4a[_0x14e8('0x6c')]}:_0x15bd4a);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 3f9ce83..4a67d0c 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 _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 +var _0xe953=['./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x45781b,_0x16ca5a){var _0x1c1672=function(_0x1f9537){while(--_0x1f9537){_0x45781b['push'](_0x45781b['shift']());}};_0x1c1672(++_0x16ca5a);}(_0xe953,0x94));var _0x3e95=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0xe953[_0x2d89ce];return _0x3fad10;};'use strict';var _=require(_0x3e95('0x0'));var util=require(_0x3e95('0x1'));var logger=require(_0x3e95('0x2'))('api');var moment=require(_0x3e95('0x3'));var BPromise=require(_0x3e95('0x4'));var rp=require(_0x3e95('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3e95('0x6'));var integrations=require(_0x3e95('0x7'));module['exports']=function(_0x429945,_0x513501){return _0x429945[_0x3e95('0x8')](_0x3e95('0x9'),attributes,{'tableName':_0x3e95('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index e32d551..f7d7bc9 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 _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 +var _0xe84a=['debug','request\x20sent','stringify','code','error','message','catch','options','raw','attributes','limit','include','model','map','then','GetFreshdeskAccount','ShowFreshdeskAccount','find','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshdeskAccount,\x20%s,\x20%s'];(function(_0x3005b9,_0x5f009f){var _0xef310c=function(_0x8b599a){while(--_0x8b599a){_0x3005b9['push'](_0x3005b9['shift']());}};_0xef310c(++_0x5f009f);}(_0xe84a,0x97));var _0xae84=function(_0xcf7764,_0x4dc7c8){_0xcf7764=_0xcf7764-0x0;var _0x454db4=_0xe84a[_0xcf7764];return _0x454db4;};'use strict';var _=require(_0xae84('0x0'));var util=require(_0xae84('0x1'));var moment=require(_0xae84('0x2'));var BPromise=require(_0xae84('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae84('0x4'));var db=require(_0xae84('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xae84('0x6'))(_0xae84('0x7'));var config=require(_0xae84('0x8'));var jayson=require(_0xae84('0x9'));var client=jayson['client'][_0xae84('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21ebf2,_0x1d3028,_0x402701){return new BPromise(function(_0x36bd5f,_0xf6d2c2){return client[_0xae84('0xb')](_0x21ebf2,_0x402701)['then'](function(_0x5261b8){logger[_0xae84('0xc')](_0xae84('0xd'),_0x1d3028,'request\x20sent');logger[_0xae84('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x1d3028,_0xae84('0xf'),JSON[_0xae84('0x10')](_0x5261b8));if(_0x5261b8['error']){if(_0x5261b8['error'][_0xae84('0x11')]===0x1f4){logger[_0xae84('0x12')](_0xae84('0xd'),_0x1d3028,_0x5261b8[_0xae84('0x12')][_0xae84('0x13')]);return _0xf6d2c2(_0x5261b8[_0xae84('0x12')][_0xae84('0x13')]);}logger[_0xae84('0x12')](_0xae84('0xd'),_0x1d3028,_0x5261b8[_0xae84('0x12')]['message']);return _0x36bd5f(_0x5261b8['error'][_0xae84('0x13')]);}else{logger[_0xae84('0xc')](_0xae84('0xd'),_0x1d3028,_0xae84('0xf'));_0x36bd5f(_0x5261b8['result']['message']);}})[_0xae84('0x14')](function(_0x11329b){logger[_0xae84('0x12')](_0xae84('0xd'),_0x1d3028,_0x11329b);_0xf6d2c2(_0x11329b);});});}exports['GetFreshdeskAccount']=function(_0x32eb37){var _0x52ec2b=this;return new Promise(function(_0x52803a,_0x1050e5){return db['FreshdeskAccount']['findAll']({'raw':_0x32eb37[_0xae84('0x15')]?_0x32eb37[_0xae84('0x15')][_0xae84('0x16')]===undefined?!![]:![]:!![],'where':_0x32eb37[_0xae84('0x15')]?_0x32eb37[_0xae84('0x15')]['where']||null:null,'attributes':_0x32eb37[_0xae84('0x15')]?_0x32eb37[_0xae84('0x15')][_0xae84('0x17')]||null:null,'limit':_0x32eb37['options']?_0x32eb37[_0xae84('0x15')][_0xae84('0x18')]||null:null,'include':_0x32eb37[_0xae84('0x15')]?_0x32eb37[_0xae84('0x15')]['include']?_['map'](_0x32eb37[_0xae84('0x15')][_0xae84('0x19')],function(_0x1133ef){return{'model':db[_0x1133ef[_0xae84('0x1a')]],'as':_0x1133ef['as'],'attributes':_0x1133ef[_0xae84('0x17')],'include':_0x1133ef[_0xae84('0x19')]?_[_0xae84('0x1b')](_0x1133ef['include'],function(_0x4a86ff){return{'model':db[_0x4a86ff[_0xae84('0x1a')]],'as':_0x4a86ff['as'],'attributes':_0x4a86ff['attributes'],'include':_0x4a86ff[_0xae84('0x19')]?_[_0xae84('0x1b')](_0x4a86ff[_0xae84('0x19')],function(_0x38ca10){return{'model':db[_0x38ca10['model']],'as':_0x38ca10['as'],'attributes':_0x38ca10[_0xae84('0x17')]};}):[]};}):[]};}):[]:[]})[_0xae84('0x1c')](function(_0x145d42){logger[_0xae84('0xc')](_0xae84('0x1d'),_0x32eb37);logger['debug']('GetFreshdeskAccount',_0x32eb37,JSON[_0xae84('0x10')](_0x145d42));_0x52803a(_0x145d42);})[_0xae84('0x14')](function(_0x764df4){logger[_0xae84('0x12')]('GetFreshdeskAccount',_0x764df4[_0xae84('0x13')],_0x32eb37);_0x1050e5(_0x52ec2b['error'](0x1f4,_0x764df4['message']));});});};exports[_0xae84('0x1e')]=function(_0x501e17){var _0x1f99b0=this;return new Promise(function(_0x119456,_0x4db975){return db['FreshdeskAccount'][_0xae84('0x1f')]({'raw':_0x501e17[_0xae84('0x15')]?_0x501e17[_0xae84('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x501e17[_0xae84('0x15')]?_0x501e17[_0xae84('0x15')][_0xae84('0x20')]||null:null,'attributes':_0x501e17[_0xae84('0x15')]?_0x501e17[_0xae84('0x15')]['attributes']||null:null,'include':_0x501e17[_0xae84('0x15')]?_0x501e17[_0xae84('0x15')][_0xae84('0x19')]?_[_0xae84('0x1b')](_0x501e17[_0xae84('0x15')][_0xae84('0x19')],function(_0x56cbac){return{'model':db[_0x56cbac[_0xae84('0x1a')]],'as':_0x56cbac['as'],'attributes':_0x56cbac[_0xae84('0x17')],'include':_0x56cbac[_0xae84('0x19')]?_[_0xae84('0x1b')](_0x56cbac[_0xae84('0x19')],function(_0x56d25d){return{'model':db[_0x56d25d[_0xae84('0x1a')]],'as':_0x56d25d['as'],'attributes':_0x56d25d[_0xae84('0x17')],'include':_0x56d25d[_0xae84('0x19')]?_[_0xae84('0x1b')](_0x56d25d[_0xae84('0x19')],function(_0x2d7355){return{'model':db[_0x2d7355[_0xae84('0x1a')]],'as':_0x2d7355['as'],'attributes':_0x2d7355[_0xae84('0x17')]};}):[]};}):[]};}):[]:[]})[_0xae84('0x1c')](function(_0x50ca6e){logger['info'](_0xae84('0x1e'),_0x501e17);logger[_0xae84('0xe')]('ShowFreshdeskAccount',_0x501e17,JSON[_0xae84('0x10')](_0x50ca6e));_0x119456(_0x50ca6e);})[_0xae84('0x14')](function(_0x58f362){logger[_0xae84('0x12')](_0xae84('0x1e'),_0x58f362[_0xae84('0x13')],_0x501e17);_0x4db975(_0x1f99b0[_0xae84('0x12')](0x1f4,_0x58f362['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 4db1b92..1a8714c 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 _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 +var _0x9cf1=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','put','update'];(function(_0x3b592d,_0x2f52b3){var _0x2ca83f=function(_0x442fd9){while(--_0x442fd9){_0x3b592d['push'](_0x3b592d['shift']());}};_0x2ca83f(++_0x2f52b3);}(_0x9cf1,0x1d6));var _0x19cf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9cf1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x19cf('0x0'));var util=require(_0x19cf('0x1'));var path=require(_0x19cf('0x2'));var timeout=require(_0x19cf('0x3'));var express=require(_0x19cf('0x4'));var router=express[_0x19cf('0x5')]();var fs_extra=require(_0x19cf('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x19cf('0x7'));var config=require(_0x19cf('0x8'));var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0x19cf('0x9')](),controller[_0x19cf('0xa')]);router[_0x19cf('0xb')](_0x19cf('0xc'),auth[_0x19cf('0x9')](),controller['show']);router[_0x19cf('0xb')](_0x19cf('0xd'),auth[_0x19cf('0x9')](),controller[_0x19cf('0xe')]);router[_0x19cf('0xb')](_0x19cf('0xf'),auth[_0x19cf('0x9')](),controller[_0x19cf('0x10')]);router['get']('/:id/descriptions',auth[_0x19cf('0x9')](),controller[_0x19cf('0x11')]);router[_0x19cf('0xb')](_0x19cf('0x12'),auth[_0x19cf('0x9')](),controller[_0x19cf('0x13')]);router[_0x19cf('0x14')]('/',auth['isAuthenticated'](),controller[_0x19cf('0x15')]);router[_0x19cf('0x14')](_0x19cf('0x12'),auth[_0x19cf('0x9')](),controller['setTags']);router[_0x19cf('0x16')]('/:id',auth[_0x19cf('0x9')](),controller[_0x19cf('0x17')]);router[_0x19cf('0x18')]('/:id',auth[_0x19cf('0x9')](),controller['destroy']);module[_0x19cf('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 6c9b816..724c25f 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 _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 +var _0x461d=['STRING'];(function(_0x5b6ca9,_0x40ce48){var _0x11ca9a=function(_0x18e5ab){while(--_0x18e5ab){_0x5b6ca9['push'](_0x5b6ca9['shift']());}};_0x11ca9a(++_0x40ce48);}(_0x461d,0x195));var _0xd461=function(_0x40797c,_0x26aff6){_0x40797c=_0x40797c-0x0;var _0x55c603=_0x461d[_0x40797c];return _0x55c603;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd461('0x0')]},'description':{'type':Sequelize[_0xd461('0x0')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 97ae145..8d279e8 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 _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 +var _0xf874=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','map','FreshdeskConfiguration','fieldName','key','query','keys','filters','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','fields','include','find','create','body','findOne','getFields','getSubjects','FreshdeskField','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x1fc5f6,_0x3734ea){var _0x34f1ee=function(_0x56af71){while(--_0x56af71){_0x1fc5f6['push'](_0x1fc5f6['shift']());}};_0x34f1ee(++_0x3734ea);}(_0xf874,0x1a7));var _0x4f87=function(_0x59e779,_0x35fb6b){_0x59e779=_0x59e779-0x0;var _0x13177b=_0xf874[_0x59e779];return _0x13177b;};'use strict';var emlformat=require(_0x4f87('0x0'));var rimraf=require(_0x4f87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f87('0x2'));var rp=require(_0x4f87('0x3'));var moment=require(_0x4f87('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4f87('0x5'));var util=require(_0x4f87('0x6'));var path=require('path');var sox=require(_0x4f87('0x7'));var csv=require(_0x4f87('0x8'));var ejs=require(_0x4f87('0x9'));var fs=require('fs');var fs_extra=require(_0x4f87('0xa'));var _=require(_0x4f87('0xb'));var squel=require(_0x4f87('0xc'));var crypto=require(_0x4f87('0xd'));var jsforce=require(_0x4f87('0xe'));var deskjs=require(_0x4f87('0xf'));var toCsv=require(_0x4f87('0x8'));var querystring=require(_0x4f87('0x10'));var Papa=require('papaparse');var Redis=require(_0x4f87('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4f87('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f87('0x13'));var logger=require(_0x4f87('0x14'))(_0x4f87('0x15'));var utils=require(_0x4f87('0x16'));var config=require(_0x4f87('0x17'));var licenseUtil=require(_0x4f87('0x18'));var db=require(_0x4f87('0x19'))['db'];function respondWithStatusCode(_0x18edab,_0x2af3aa){_0x2af3aa=_0x2af3aa||0xcc;return function(_0xa5e54a){if(_0xa5e54a){return _0x18edab[_0x4f87('0x1a')](_0x2af3aa);}return _0x18edab[_0x4f87('0x1b')](_0x2af3aa)['end']();};}function respondWithResult(_0x5e9d6c,_0x567ed9){_0x567ed9=_0x567ed9||0xc8;return function(_0x2d9f5f){if(_0x2d9f5f){return _0x5e9d6c[_0x4f87('0x1b')](_0x567ed9)[_0x4f87('0x1c')](_0x2d9f5f);}};}function respondWithFilteredResult(_0x5db757,_0x2be974){return function(_0x472f59){if(_0x472f59){var _0x422f1b=typeof _0x2be974['offset']===_0x4f87('0x1d')&&typeof _0x2be974[_0x4f87('0x1e')]==='undefined';var _0x5d77e8=_0x472f59[_0x4f87('0x1f')];var _0xdfc1ab=_0x422f1b?0x0:_0x2be974[_0x4f87('0x20')];var _0x86dc66=_0x422f1b?_0x472f59[_0x4f87('0x1f')]:_0x2be974['offset']+_0x2be974['limit'];var _0x19b934;if(_0x86dc66>=_0x5d77e8){_0x86dc66=_0x5d77e8;_0x19b934=0xc8;}else{_0x19b934=0xce;}_0x5db757['status'](_0x19b934);return _0x5db757[_0x4f87('0x21')](_0x4f87('0x22'),_0xdfc1ab+'-'+_0x86dc66+'/'+_0x5d77e8)['json'](_0x472f59);}return null;};}function patchUpdates(_0x2ec6){return function(_0x3f8b75){try{jsonpatch[_0x4f87('0x23')](_0x3f8b75,_0x2ec6,!![]);}catch(_0x4939f3){return BPromise[_0x4f87('0x24')](_0x4939f3);}return _0x3f8b75['save']();};}function saveUpdates(_0x2c619b,_0x583789){return function(_0x546f70){if(_0x546f70){return _0x546f70[_0x4f87('0x25')](_0x2c619b)[_0x4f87('0x26')](function(_0x3531d8){return _0x3531d8;});}return null;};}function removeEntity(_0x1ff104,_0x4c1b0c){return function(_0x56b9ec){if(_0x56b9ec){return _0x56b9ec[_0x4f87('0x27')]()[_0x4f87('0x26')](function(){_0x1ff104[_0x4f87('0x1b')](0xcc)[_0x4f87('0x28')]();});}};}function handleEntityNotFound(_0x361847,_0x17601b){return function(_0x14bfef){if(!_0x14bfef){_0x361847[_0x4f87('0x1a')](0x194);}return _0x14bfef;};}function handleError(_0x52b302,_0x4fd082){_0x4fd082=_0x4fd082||0x1f4;return function(_0x10c6a0){logger[_0x4f87('0x29')](_0x10c6a0[_0x4f87('0x2a')]);if(_0x10c6a0[_0x4f87('0x2b')]){delete _0x10c6a0['name'];}_0x52b302[_0x4f87('0x1b')](_0x4fd082)[_0x4f87('0x2c')](_0x10c6a0);};}exports['index']=function(_0x164f17,_0x2a8c89){var _0x4c9e81={},_0x22be74={},_0x58f9cd={'count':0x0,'rows':[]};var _0x3dc2e0=_[_0x4f87('0x2d')](db[_0x4f87('0x2e')]['rawAttributes'],function(_0x41ddf6){return{'name':_0x41ddf6[_0x4f87('0x2f')],'type':_0x41ddf6['type'][_0x4f87('0x30')]};});_0x22be74['model']=_['map'](_0x3dc2e0,_0x4f87('0x2b'));_0x22be74[_0x4f87('0x31')]=_[_0x4f87('0x32')](_0x164f17['query']);_0x22be74[_0x4f87('0x33')]=_['intersection'](_0x22be74[_0x4f87('0x34')],_0x22be74[_0x4f87('0x31')]);_0x4c9e81[_0x4f87('0x35')]=_['intersection'](_0x22be74[_0x4f87('0x34')],qs['fields'](_0x164f17[_0x4f87('0x31')]['fields']));_0x4c9e81[_0x4f87('0x35')]=_0x4c9e81[_0x4f87('0x35')][_0x4f87('0x36')]?_0x4c9e81[_0x4f87('0x35')]:_0x22be74[_0x4f87('0x34')];if(!_0x164f17[_0x4f87('0x31')][_0x4f87('0x37')](_0x4f87('0x38'))){_0x4c9e81['limit']=qs[_0x4f87('0x1e')](_0x164f17[_0x4f87('0x31')][_0x4f87('0x1e')]);_0x4c9e81['offset']=qs[_0x4f87('0x20')](_0x164f17[_0x4f87('0x31')]['offset']);}_0x4c9e81[_0x4f87('0x39')]=qs[_0x4f87('0x3a')](_0x164f17['query'][_0x4f87('0x3a')]);_0x4c9e81[_0x4f87('0x3b')]=qs[_0x4f87('0x33')](_[_0x4f87('0x3c')](_0x164f17[_0x4f87('0x31')],_0x22be74[_0x4f87('0x33')]),_0x3dc2e0);if(_0x164f17['query'][_0x4f87('0x3d')]){_0x4c9e81[_0x4f87('0x3b')]=_[_0x4f87('0x3e')](_0x4c9e81['where'],{'$or':_['map'](_0x3dc2e0,function(_0xa65325){if(_0xa65325['type']!==_0x4f87('0x3f')){var _0x3e5d9={};_0x3e5d9[_0xa65325[_0x4f87('0x2b')]]={'$like':'%'+_0x164f17[_0x4f87('0x31')][_0x4f87('0x3d')]+'%'};return _0x3e5d9;}})});}_0x4c9e81=_[_0x4f87('0x3e')]({},_0x4c9e81,_0x164f17[_0x4f87('0x40')]);var _0x432877={'where':_0x4c9e81['where']};return db[_0x4f87('0x2e')]['count'](_0x432877)[_0x4f87('0x26')](function(_0x584251){_0x58f9cd[_0x4f87('0x1f')]=_0x584251;if(_0x164f17[_0x4f87('0x31')][_0x4f87('0x41')]){_0x4c9e81['include']=[{'all':!![]}];}return db[_0x4f87('0x2e')][_0x4f87('0x42')](_0x4c9e81);})[_0x4f87('0x26')](function(_0x69099a){_0x58f9cd[_0x4f87('0x43')]=_0x69099a;return _0x58f9cd;})[_0x4f87('0x26')](respondWithFilteredResult(_0x2a8c89,_0x4c9e81))[_0x4f87('0x44')](handleError(_0x2a8c89,null));};exports[_0x4f87('0x45')]=function(_0x3acba6,_0x2bb6e9){var _0x1df4ac={'raw':![],'where':{'id':_0x3acba6[_0x4f87('0x46')]['id']}},_0x156995={};_0x156995['model']=_['keys'](db[_0x4f87('0x2e')][_0x4f87('0x47')]);_0x156995[_0x4f87('0x31')]=_[_0x4f87('0x32')](_0x3acba6[_0x4f87('0x31')]);_0x156995[_0x4f87('0x33')]=_[_0x4f87('0x48')](_0x156995['model'],_0x156995[_0x4f87('0x31')]);_0x1df4ac['attributes']=_[_0x4f87('0x48')](_0x156995[_0x4f87('0x34')],qs[_0x4f87('0x49')](_0x3acba6['query'][_0x4f87('0x49')]));_0x1df4ac[_0x4f87('0x35')]=_0x1df4ac[_0x4f87('0x35')][_0x4f87('0x36')]?_0x1df4ac[_0x4f87('0x35')]:_0x156995['model'];if(_0x3acba6[_0x4f87('0x31')][_0x4f87('0x41')]){_0x1df4ac[_0x4f87('0x4a')]=[{'all':!![]}];}_0x1df4ac=_[_0x4f87('0x3e')]({},_0x1df4ac,_0x3acba6[_0x4f87('0x40')]);return db[_0x4f87('0x2e')][_0x4f87('0x4b')](_0x1df4ac)[_0x4f87('0x26')](handleEntityNotFound(_0x2bb6e9,null))[_0x4f87('0x26')](respondWithResult(_0x2bb6e9,null))[_0x4f87('0x44')](handleError(_0x2bb6e9,null));};exports['create']=function(_0x3ed6f8,_0x1b1873){return db['FreshdeskConfiguration'][_0x4f87('0x4c')](_0x3ed6f8[_0x4f87('0x4d')],{})['then'](respondWithResult(_0x1b1873,0xc9))[_0x4f87('0x44')](handleError(_0x1b1873,null));};exports[_0x4f87('0x25')]=function(_0x244bca,_0x298fbc){if(_0x244bca['body']['id']){delete _0x244bca[_0x4f87('0x4d')]['id'];}return db[_0x4f87('0x2e')]['find']({'where':{'id':_0x244bca[_0x4f87('0x46')]['id']}})['then'](handleEntityNotFound(_0x298fbc,null))[_0x4f87('0x26')](saveUpdates(_0x244bca[_0x4f87('0x4d')],null))[_0x4f87('0x26')](respondWithResult(_0x298fbc,null))[_0x4f87('0x44')](handleError(_0x298fbc,null));};exports[_0x4f87('0x27')]=function(_0x56bb4c,_0x2a3042){return db[_0x4f87('0x2e')][_0x4f87('0x4b')]({'where':{'id':_0x56bb4c[_0x4f87('0x46')]['id']}})[_0x4f87('0x26')](handleEntityNotFound(_0x2a3042,null))[_0x4f87('0x26')](removeEntity(_0x2a3042,null))[_0x4f87('0x44')](handleError(_0x2a3042,null));};exports['getFields']=function(_0x5db4fd,_0x33c466,_0x131e4b){var _0x22ca30={};var _0x29acba={};var _0x10ea5f;var _0x592c64;return db[_0x4f87('0x2e')][_0x4f87('0x4e')]({'where':{'id':_0x5db4fd[_0x4f87('0x46')]['id']}})['then'](handleEntityNotFound(_0x33c466,null))[_0x4f87('0x26')](function(_0x2a058c){if(_0x2a058c){_0x10ea5f=_0x2a058c;_0x29acba[_0x4f87('0x34')]=_['keys'](db['FreshdeskField'][_0x4f87('0x47')]);_0x29acba[_0x4f87('0x31')]=_[_0x4f87('0x32')](_0x5db4fd['query']);_0x29acba[_0x4f87('0x33')]=_[_0x4f87('0x48')](_0x29acba[_0x4f87('0x34')],_0x29acba[_0x4f87('0x31')]);_0x22ca30[_0x4f87('0x35')]=_[_0x4f87('0x48')](_0x29acba[_0x4f87('0x34')],qs[_0x4f87('0x49')](_0x5db4fd[_0x4f87('0x31')]['fields']));_0x22ca30['attributes']=_0x22ca30[_0x4f87('0x35')][_0x4f87('0x36')]?_0x22ca30[_0x4f87('0x35')]:_0x29acba['model'];_0x22ca30['order']=qs[_0x4f87('0x3a')](_0x5db4fd[_0x4f87('0x31')][_0x4f87('0x3a')]);_0x22ca30[_0x4f87('0x3b')]=qs['filters'](_[_0x4f87('0x3c')](_0x5db4fd[_0x4f87('0x31')],_0x29acba[_0x4f87('0x33')]));if(_0x5db4fd['query'][_0x4f87('0x3d')]){_0x22ca30[_0x4f87('0x3b')]=_['merge'](_0x22ca30[_0x4f87('0x3b')],{'$or':_[_0x4f87('0x2d')](_0x22ca30['attributes'],function(_0x2e1c74){var _0x3d4273={};_0x3d4273[_0x2e1c74]={'$like':'%'+_0x5db4fd[_0x4f87('0x31')][_0x4f87('0x3d')]+'%'};return _0x3d4273;})});}_0x22ca30=_[_0x4f87('0x3e')]({},_0x22ca30,_0x5db4fd[_0x4f87('0x40')]);return _0x10ea5f[_0x4f87('0x4f')](_0x22ca30);}})[_0x4f87('0x26')](function(_0x9d9b52){if(_0x9d9b52){_0x592c64=_0x9d9b52[_0x4f87('0x36')];if(!_0x5db4fd[_0x4f87('0x31')]['hasOwnProperty'](_0x4f87('0x38'))){_0x22ca30[_0x4f87('0x1e')]=qs['limit'](_0x5db4fd['query'][_0x4f87('0x1e')]);_0x22ca30[_0x4f87('0x20')]=qs[_0x4f87('0x20')](_0x5db4fd[_0x4f87('0x31')][_0x4f87('0x20')]);}return _0x10ea5f[_0x4f87('0x4f')](_0x22ca30);}})[_0x4f87('0x26')](function(_0x1a0cb6){if(_0x1a0cb6){return _0x1a0cb6?{'count':_0x592c64,'rows':_0x1a0cb6}:null;}})[_0x4f87('0x26')](respondWithResult(_0x33c466,null))[_0x4f87('0x44')](handleError(_0x33c466,null));};exports[_0x4f87('0x50')]=function(_0x58899a,_0x3b3839,_0x32a0e9){var _0x18c109={};var _0x14a019={};var _0x19c270;var _0x4a8ffd;return db[_0x4f87('0x2e')][_0x4f87('0x4e')]({'where':{'id':_0x58899a[_0x4f87('0x46')]['id']}})[_0x4f87('0x26')](handleEntityNotFound(_0x3b3839,null))[_0x4f87('0x26')](function(_0x4f1a9d){if(_0x4f1a9d){_0x19c270=_0x4f1a9d;_0x14a019[_0x4f87('0x34')]=_[_0x4f87('0x32')](db[_0x4f87('0x51')][_0x4f87('0x47')]);_0x14a019['query']=_[_0x4f87('0x32')](_0x58899a['query']);_0x14a019[_0x4f87('0x33')]=_[_0x4f87('0x48')](_0x14a019[_0x4f87('0x34')],_0x14a019[_0x4f87('0x31')]);_0x18c109[_0x4f87('0x35')]=_[_0x4f87('0x48')](_0x14a019[_0x4f87('0x34')],qs[_0x4f87('0x49')](_0x58899a[_0x4f87('0x31')][_0x4f87('0x49')]));_0x18c109[_0x4f87('0x35')]=_0x18c109[_0x4f87('0x35')]['length']?_0x18c109[_0x4f87('0x35')]:_0x14a019['model'];_0x18c109['order']=qs[_0x4f87('0x3a')](_0x58899a[_0x4f87('0x31')][_0x4f87('0x3a')]);_0x18c109[_0x4f87('0x3b')]=qs[_0x4f87('0x33')](_[_0x4f87('0x3c')](_0x58899a[_0x4f87('0x31')],_0x14a019[_0x4f87('0x33')]));if(_0x58899a[_0x4f87('0x31')][_0x4f87('0x3d')]){_0x18c109[_0x4f87('0x3b')]=_[_0x4f87('0x3e')](_0x18c109[_0x4f87('0x3b')],{'$or':_[_0x4f87('0x2d')](_0x18c109[_0x4f87('0x35')],function(_0x18e50b){var _0x14a3f7={};_0x14a3f7[_0x18e50b]={'$like':'%'+_0x58899a[_0x4f87('0x31')][_0x4f87('0x3d')]+'%'};return _0x14a3f7;})});}_0x18c109=_[_0x4f87('0x3e')]({},_0x18c109,_0x58899a[_0x4f87('0x40')]);return _0x19c270[_0x4f87('0x50')](_0x18c109);}})[_0x4f87('0x26')](function(_0x4fc50b){if(_0x4fc50b){_0x4a8ffd=_0x4fc50b['length'];if(!_0x58899a['query'][_0x4f87('0x37')]('nolimit')){_0x18c109[_0x4f87('0x1e')]=qs['limit'](_0x58899a[_0x4f87('0x31')][_0x4f87('0x1e')]);_0x18c109[_0x4f87('0x20')]=qs[_0x4f87('0x20')](_0x58899a[_0x4f87('0x31')][_0x4f87('0x20')]);}return _0x19c270[_0x4f87('0x50')](_0x18c109);}})[_0x4f87('0x26')](function(_0x2872e6){if(_0x2872e6){return _0x2872e6?{'count':_0x4a8ffd,'rows':_0x2872e6}:null;}})[_0x4f87('0x26')](respondWithResult(_0x3b3839,null))[_0x4f87('0x44')](handleError(_0x3b3839,null));};exports[_0x4f87('0x52')]=function(_0x4dd125,_0x142b11,_0x539012){var _0x266077={};var _0x2d54e8={};var _0x553d48;var _0x24c1a6;return db[_0x4f87('0x2e')][_0x4f87('0x4e')]({'where':{'id':_0x4dd125[_0x4f87('0x46')]['id']}})[_0x4f87('0x26')](handleEntityNotFound(_0x142b11,null))['then'](function(_0x250b1b){if(_0x250b1b){_0x553d48=_0x250b1b;_0x2d54e8[_0x4f87('0x34')]=_['keys'](db[_0x4f87('0x51')]['rawAttributes']);_0x2d54e8['query']=_[_0x4f87('0x32')](_0x4dd125['query']);_0x2d54e8[_0x4f87('0x33')]=_['intersection'](_0x2d54e8[_0x4f87('0x34')],_0x2d54e8[_0x4f87('0x31')]);_0x266077['attributes']=_[_0x4f87('0x48')](_0x2d54e8['model'],qs[_0x4f87('0x49')](_0x4dd125[_0x4f87('0x31')][_0x4f87('0x49')]));_0x266077[_0x4f87('0x35')]=_0x266077[_0x4f87('0x35')]['length']?_0x266077[_0x4f87('0x35')]:_0x2d54e8[_0x4f87('0x34')];_0x266077[_0x4f87('0x39')]=qs['sort'](_0x4dd125['query'][_0x4f87('0x3a')]);_0x266077[_0x4f87('0x3b')]=qs[_0x4f87('0x33')](_[_0x4f87('0x3c')](_0x4dd125['query'],_0x2d54e8[_0x4f87('0x33')]));if(_0x4dd125[_0x4f87('0x31')][_0x4f87('0x3d')]){_0x266077['where']=_[_0x4f87('0x3e')](_0x266077['where'],{'$or':_[_0x4f87('0x2d')](_0x266077[_0x4f87('0x35')],function(_0x4936e3){var _0x18c2e4={};_0x18c2e4[_0x4936e3]={'$like':'%'+_0x4dd125[_0x4f87('0x31')][_0x4f87('0x3d')]+'%'};return _0x18c2e4;})});}_0x266077=_[_0x4f87('0x3e')]({},_0x266077,_0x4dd125[_0x4f87('0x40')]);return _0x553d48[_0x4f87('0x52')](_0x266077);}})[_0x4f87('0x26')](function(_0x56fb03){if(_0x56fb03){_0x24c1a6=_0x56fb03[_0x4f87('0x36')];if(!_0x4dd125['query'][_0x4f87('0x37')](_0x4f87('0x38'))){_0x266077[_0x4f87('0x1e')]=qs[_0x4f87('0x1e')](_0x4dd125[_0x4f87('0x31')]['limit']);_0x266077[_0x4f87('0x20')]=qs[_0x4f87('0x20')](_0x4dd125[_0x4f87('0x31')][_0x4f87('0x20')]);}return _0x553d48[_0x4f87('0x52')](_0x266077);}})[_0x4f87('0x26')](function(_0x16ad19){if(_0x16ad19){return _0x16ad19?{'count':_0x24c1a6,'rows':_0x16ad19}:null;}})[_0x4f87('0x26')](respondWithResult(_0x142b11,null))[_0x4f87('0x44')](handleError(_0x142b11,null));};exports[_0x4f87('0x53')]=function(_0x336e56,_0x11b211,_0x38d13e){var _0x52478e={};var _0x584073={};var _0x3684c5;var _0x32187c;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x336e56[_0x4f87('0x46')]['id']}})[_0x4f87('0x26')](handleEntityNotFound(_0x11b211,null))[_0x4f87('0x26')](function(_0x2bbf17){if(_0x2bbf17){_0x3684c5=_0x2bbf17;_0x584073['model']=_['keys'](db[_0x4f87('0x54')]['rawAttributes']);_0x584073['query']=_['keys'](_0x336e56['query']);_0x584073[_0x4f87('0x33')]=_['intersection'](_0x584073['model'],_0x584073[_0x4f87('0x31')]);_0x52478e[_0x4f87('0x35')]=_[_0x4f87('0x48')](_0x584073['model'],qs[_0x4f87('0x49')](_0x336e56[_0x4f87('0x31')]['fields']));_0x52478e[_0x4f87('0x35')]=_0x52478e[_0x4f87('0x35')][_0x4f87('0x36')]?_0x52478e['attributes']:_0x584073[_0x4f87('0x34')];_0x52478e['order']=qs[_0x4f87('0x3a')](_0x336e56['query']['sort']);_0x52478e['where']=qs['filters'](_[_0x4f87('0x3c')](_0x336e56[_0x4f87('0x31')],_0x584073[_0x4f87('0x33')]));if(_0x336e56[_0x4f87('0x31')]['filter']){_0x52478e[_0x4f87('0x3b')]=_['merge'](_0x52478e[_0x4f87('0x3b')],{'$or':_[_0x4f87('0x2d')](_0x52478e['attributes'],function(_0x315dc7){var _0x2027c2={};_0x2027c2[_0x315dc7]={'$like':'%'+_0x336e56[_0x4f87('0x31')][_0x4f87('0x3d')]+'%'};return _0x2027c2;})});}_0x52478e=_[_0x4f87('0x3e')]({},_0x52478e,_0x336e56[_0x4f87('0x40')]);return _0x3684c5[_0x4f87('0x53')](_0x52478e);}})['then'](function(_0x53e7ed){if(_0x53e7ed){_0x32187c=_0x53e7ed[_0x4f87('0x36')];if(!_0x336e56[_0x4f87('0x31')][_0x4f87('0x37')](_0x4f87('0x38'))){_0x52478e[_0x4f87('0x1e')]=qs['limit'](_0x336e56[_0x4f87('0x31')][_0x4f87('0x1e')]);_0x52478e[_0x4f87('0x20')]=qs[_0x4f87('0x20')](_0x336e56['query'][_0x4f87('0x20')]);}return _0x3684c5[_0x4f87('0x53')](_0x52478e);}})[_0x4f87('0x26')](function(_0x3a1e20){if(_0x3a1e20){return _0x3a1e20?{'count':_0x32187c,'rows':_0x3a1e20}:null;}})[_0x4f87('0x26')](respondWithResult(_0x11b211,null))['catch'](handleError(_0x11b211,null));};exports[_0x4f87('0x55')]=function(_0x332977,_0x335f2b,_0x11cdb4){if(_0x332977[_0x4f87('0x4d')]['id']){delete _0x332977['body']['id'];}return db['FreshdeskConfiguration'][_0x4f87('0x4e')]({'where':{'id':_0x332977[_0x4f87('0x46')]['id']}})[_0x4f87('0x26')](handleEntityNotFound(_0x335f2b,null))['then'](function(_0x2c4087){if(_0x2c4087){return _0x2c4087[_0x4f87('0x55')](_0x332977['body']['ids']||[]);}return null;})[_0x4f87('0x26')](respondWithResult(_0x335f2b,null))[_0x4f87('0x44')](handleError(_0x335f2b,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 2f4ff00..6f04ae8 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 _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 +var _0xac5d=['FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define'];(function(_0x42c6f1,_0x338d7b){var _0x3c7398=function(_0x151494){while(--_0x151494){_0x42c6f1['push'](_0x42c6f1['shift']());}};_0x3c7398(++_0x338d7b);}(_0xac5d,0xd2));var _0xdac5=function(_0x8d3262,_0x439e73){_0x8d3262=_0x8d3262-0x0;var _0x45561c=_0xac5d[_0x8d3262];return _0x45561c;};'use strict';var _=require(_0xdac5('0x0'));var util=require(_0xdac5('0x1'));var logger=require(_0xdac5('0x2'))(_0xdac5('0x3'));var moment=require(_0xdac5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdac5('0x5'));var rimraf=require(_0xdac5('0x6'));var config=require(_0xdac5('0x7'));var attributes=require(_0xdac5('0x8'));module[_0xdac5('0x9')]=function(_0x2ebb77,_0x4e127b){return _0x2ebb77[_0xdac5('0xa')](_0xdac5('0xb'),attributes,{'tableName':_0xdac5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 5384c41..6178124 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 _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 +var _0xebd3=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird'];(function(_0x3c2fb2,_0x3907fc){var _0x384eba=function(_0x459da4){while(--_0x459da4){_0x3c2fb2['push'](_0x3c2fb2['shift']());}};_0x384eba(++_0x3907fc);}(_0xebd3,0xc4));var _0x3ebd=function(_0x4fc80b,_0xfe1b3d){_0x4fc80b=_0x4fc80b-0x0;var _0x119dba=_0xebd3[_0x4fc80b];return _0x119dba;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3ebd('0x0'));var BPromise=require(_0x3ebd('0x1'));var rs=require(_0x3ebd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ebd('0x3'))['db'];var utils=require(_0x3ebd('0x4'));var logger=require(_0x3ebd('0x5'))(_0x3ebd('0x6'));var config=require(_0x3ebd('0x7'));var jayson=require(_0x3ebd('0x8'));var client=jayson[_0x3ebd('0x9')][_0x3ebd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe26fb0,_0x5ab284,_0xd7844b){return new BPromise(function(_0x47d70e,_0x54e00c){return client['request'](_0xe26fb0,_0xd7844b)[_0x3ebd('0xb')](function(_0x152a3e){logger[_0x3ebd('0xc')](_0x3ebd('0xd'),_0x5ab284,_0x3ebd('0xe'));logger[_0x3ebd('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5ab284,_0x3ebd('0xe'),JSON[_0x3ebd('0x10')](_0x152a3e));if(_0x152a3e[_0x3ebd('0x11')]){if(_0x152a3e[_0x3ebd('0x11')][_0x3ebd('0x12')]===0x1f4){logger[_0x3ebd('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5ab284,_0x152a3e[_0x3ebd('0x11')][_0x3ebd('0x13')]);return _0x54e00c(_0x152a3e[_0x3ebd('0x11')][_0x3ebd('0x13')]);}logger[_0x3ebd('0x11')](_0x3ebd('0xd'),_0x5ab284,_0x152a3e['error'][_0x3ebd('0x13')]);return _0x47d70e(_0x152a3e[_0x3ebd('0x11')][_0x3ebd('0x13')]);}else{logger[_0x3ebd('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5ab284,'request\x20sent');_0x47d70e(_0x152a3e[_0x3ebd('0x14')][_0x3ebd('0x13')]);}})[_0x3ebd('0x15')](function(_0x2235d7){logger['error'](_0x3ebd('0xd'),_0x5ab284,_0x2235d7);_0x54e00c(_0x2235d7);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 39e1d53..8ef1f87 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 _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 +var _0xaf69=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x2c90cb,_0x3a0747){var _0x23e1b4=function(_0x5e8e4b){while(--_0x5e8e4b){_0x2c90cb['push'](_0x2c90cb['shift']());}};_0x23e1b4(++_0x3a0747);}(_0xaf69,0x17f));var _0x9af6=function(_0x45a7cf,_0x18fb0b){_0x45a7cf=_0x45a7cf-0x0;var _0x5a7bc6=_0xaf69[_0x45a7cf];return _0x5a7bc6;};'use strict';var multer=require(_0x9af6('0x0'));var util=require(_0x9af6('0x1'));var path=require(_0x9af6('0x2'));var timeout=require(_0x9af6('0x3'));var express=require(_0x9af6('0x4'));var router=express[_0x9af6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9af6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9af6('0x7'));var controller=require(_0x9af6('0x8'));router[_0x9af6('0x9')]('/',auth[_0x9af6('0xa')](),controller[_0x9af6('0xb')]);router[_0x9af6('0x9')](_0x9af6('0xc'),auth['isAuthenticated'](),controller[_0x9af6('0xd')]);router[_0x9af6('0xe')]('/',auth[_0x9af6('0xa')](),controller[_0x9af6('0xf')]);router[_0x9af6('0x10')](_0x9af6('0xc'),auth[_0x9af6('0xa')](),controller[_0x9af6('0x11')]);router[_0x9af6('0x12')]('/:id',auth[_0x9af6('0xa')](),controller[_0x9af6('0x13')]);module[_0x9af6('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 9d0a85e..d19b219 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 _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 +var _0xbe23=['variable','picklist','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports','string'];(function(_0x1502fb,_0x5f29e6){var _0xc155c5=function(_0x4c8a1d){while(--_0x4c8a1d){_0x1502fb['push'](_0x1502fb['shift']());}};_0xc155c5(++_0x5f29e6);}(_0xbe23,0x9f));var _0x3be2=function(_0x3ba200,_0x1c4d38){_0x3ba200=_0x3ba200-0x0;var _0x5dd4b8=_0xbe23[_0x3ba200];return _0x5dd4b8;};'use strict';var Sequelize=require(_0x3be2('0x0'));module[_0x3be2('0x1')]={'type':{'type':Sequelize['ENUM'](_0x3be2('0x2'),_0x3be2('0x3'),'customVariable','keyValue',_0x3be2('0x4')),'defaultValue':_0x3be2('0x2')},'content':{'type':Sequelize[_0x3be2('0x5')]},'key':{'type':Sequelize[_0x3be2('0x5')]},'keyType':{'type':Sequelize[_0x3be2('0x6')]('string',_0x3be2('0x3'),_0x3be2('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3be2('0x5')]},'nameField':{'type':Sequelize[_0x3be2('0x5')]},'customField':{'type':Sequelize[_0x3be2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3be2('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 7f1da46..f0cb1d9 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 _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 +var _0x6ae2=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','error','name','index','map','FreshdeskField','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','show','params','find','catch','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x1b25c2,_0x41458e){var _0x4bb2be=function(_0x42fda6){while(--_0x42fda6){_0x1b25c2['push'](_0x1b25c2['shift']());}};_0x4bb2be(++_0x41458e);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x1b246e,_0x664f50){_0x1b246e=_0x1b246e-0x0;var _0x9801dc=_0x6ae2[_0x1b246e];return _0x9801dc;};'use strict';var emlformat=require(_0x26ae('0x0'));var rimraf=require(_0x26ae('0x1'));var zipdir=require(_0x26ae('0x2'));var jsonpatch=require(_0x26ae('0x3'));var rp=require(_0x26ae('0x4'));var moment=require(_0x26ae('0x5'));var BPromise=require(_0x26ae('0x6'));var Mustache=require(_0x26ae('0x7'));var util=require(_0x26ae('0x8'));var path=require('path');var sox=require(_0x26ae('0x9'));var csv=require(_0x26ae('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x26ae('0xb'));var squel=require(_0x26ae('0xc'));var crypto=require(_0x26ae('0xd'));var jsforce=require(_0x26ae('0xe'));var deskjs=require(_0x26ae('0xf'));var toCsv=require(_0x26ae('0xa'));var querystring=require(_0x26ae('0x10'));var Papa=require(_0x26ae('0x11'));var Redis=require(_0x26ae('0x12'));var authService=require(_0x26ae('0x13'));var qs=require(_0x26ae('0x14'));var as=require(_0x26ae('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26ae('0x16'))('api');var utils=require(_0x26ae('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x26ae('0x18'))['db'];function respondWithStatusCode(_0x46bc2,_0x21811d){_0x21811d=_0x21811d||0xcc;return function(_0x17f9a6){if(_0x17f9a6){return _0x46bc2[_0x26ae('0x19')](_0x21811d);}return _0x46bc2[_0x26ae('0x1a')](_0x21811d)[_0x26ae('0x1b')]();};}function respondWithResult(_0x1c66b8,_0x2390a7){_0x2390a7=_0x2390a7||0xc8;return function(_0x52d611){if(_0x52d611){return _0x1c66b8[_0x26ae('0x1a')](_0x2390a7)[_0x26ae('0x1c')](_0x52d611);}};}function respondWithFilteredResult(_0x4e5c4e,_0x15d055){return function(_0x32cd9e){if(_0x32cd9e){var _0x497974=typeof _0x15d055[_0x26ae('0x1d')]===_0x26ae('0x1e')&&typeof _0x15d055[_0x26ae('0x1f')]===_0x26ae('0x1e');var _0x13ad43=_0x32cd9e[_0x26ae('0x20')];var _0x250dc0=_0x497974?0x0:_0x15d055[_0x26ae('0x1d')];var _0x28584c=_0x497974?_0x32cd9e[_0x26ae('0x20')]:_0x15d055[_0x26ae('0x1d')]+_0x15d055[_0x26ae('0x1f')];var _0x38102c;if(_0x28584c>=_0x13ad43){_0x28584c=_0x13ad43;_0x38102c=0xc8;}else{_0x38102c=0xce;}_0x4e5c4e[_0x26ae('0x1a')](_0x38102c);return _0x4e5c4e[_0x26ae('0x21')](_0x26ae('0x22'),_0x250dc0+'-'+_0x28584c+'/'+_0x13ad43)[_0x26ae('0x1c')](_0x32cd9e);}return null;};}function patchUpdates(_0xdfcd69){return function(_0x22d535){try{jsonpatch[_0x26ae('0x23')](_0x22d535,_0xdfcd69,!![]);}catch(_0x334153){return BPromise['reject'](_0x334153);}return _0x22d535['save']();};}function saveUpdates(_0x2a2ba5,_0x5d72dc){return function(_0x22c47b){if(_0x22c47b){return _0x22c47b['update'](_0x2a2ba5)[_0x26ae('0x24')](function(_0x2e34d1){return _0x2e34d1;});}return null;};}function removeEntity(_0x19f641,_0x57062e){return function(_0x4ab3f1){if(_0x4ab3f1){return _0x4ab3f1[_0x26ae('0x25')]()[_0x26ae('0x24')](function(){_0x19f641[_0x26ae('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2caf20,_0x295cc2){return function(_0x53e0da){if(!_0x53e0da){_0x2caf20[_0x26ae('0x19')](0x194);}return _0x53e0da;};}function handleError(_0x2658ed,_0x19eacc){_0x19eacc=_0x19eacc||0x1f4;return function(_0x4a0045){logger[_0x26ae('0x26')](_0x4a0045['stack']);if(_0x4a0045[_0x26ae('0x27')]){delete _0x4a0045[_0x26ae('0x27')];}_0x2658ed[_0x26ae('0x1a')](_0x19eacc)['send'](_0x4a0045);};}exports[_0x26ae('0x28')]=function(_0x5a8301,_0x4cddc4){var _0x2f2e9d={},_0x2fcc89={},_0x5979ec={'count':0x0,'rows':[]};var _0x5308c=_[_0x26ae('0x29')](db[_0x26ae('0x2a')][_0x26ae('0x2b')],function(_0x2d8cac){return{'name':_0x2d8cac['fieldName'],'type':_0x2d8cac[_0x26ae('0x2c')][_0x26ae('0x2d')]};});_0x2fcc89[_0x26ae('0x2e')]=_[_0x26ae('0x29')](_0x5308c,_0x26ae('0x27'));_0x2fcc89['query']=_[_0x26ae('0x2f')](_0x5a8301[_0x26ae('0x30')]);_0x2fcc89[_0x26ae('0x31')]=_[_0x26ae('0x32')](_0x2fcc89[_0x26ae('0x2e')],_0x2fcc89[_0x26ae('0x30')]);_0x2f2e9d[_0x26ae('0x33')]=_[_0x26ae('0x32')](_0x2fcc89['model'],qs[_0x26ae('0x34')](_0x5a8301['query']['fields']));_0x2f2e9d[_0x26ae('0x33')]=_0x2f2e9d[_0x26ae('0x33')][_0x26ae('0x35')]?_0x2f2e9d['attributes']:_0x2fcc89[_0x26ae('0x2e')];if(!_0x5a8301[_0x26ae('0x30')][_0x26ae('0x36')](_0x26ae('0x37'))){_0x2f2e9d[_0x26ae('0x1f')]=qs[_0x26ae('0x1f')](_0x5a8301[_0x26ae('0x30')][_0x26ae('0x1f')]);_0x2f2e9d[_0x26ae('0x1d')]=qs[_0x26ae('0x1d')](_0x5a8301[_0x26ae('0x30')][_0x26ae('0x1d')]);}_0x2f2e9d[_0x26ae('0x38')]=qs[_0x26ae('0x39')](_0x5a8301['query'][_0x26ae('0x39')]);_0x2f2e9d[_0x26ae('0x3a')]=qs[_0x26ae('0x31')](_['pick'](_0x5a8301[_0x26ae('0x30')],_0x2fcc89[_0x26ae('0x31')]),_0x5308c);if(_0x5a8301[_0x26ae('0x30')][_0x26ae('0x3b')]){_0x2f2e9d[_0x26ae('0x3a')]=_['merge'](_0x2f2e9d[_0x26ae('0x3a')],{'$or':_[_0x26ae('0x29')](_0x5308c,function(_0x49eb68){if(_0x49eb68[_0x26ae('0x2c')]!==_0x26ae('0x3c')){var _0x11586b={};_0x11586b[_0x49eb68['name']]={'$like':'%'+_0x5a8301['query']['filter']+'%'};return _0x11586b;}})});}_0x2f2e9d=_[_0x26ae('0x3d')]({},_0x2f2e9d,_0x5a8301[_0x26ae('0x3e')]);var _0x607968={'where':_0x2f2e9d[_0x26ae('0x3a')]};return db[_0x26ae('0x2a')]['count'](_0x607968)[_0x26ae('0x24')](function(_0x3fd0ef){_0x5979ec[_0x26ae('0x20')]=_0x3fd0ef;if(_0x5a8301[_0x26ae('0x30')][_0x26ae('0x3f')]){_0x2f2e9d[_0x26ae('0x40')]=[{'all':!![]}];}return db[_0x26ae('0x2a')]['findAll'](_0x2f2e9d);})[_0x26ae('0x24')](function(_0x7d041f){_0x5979ec['rows']=_0x7d041f;return _0x5979ec;})[_0x26ae('0x24')](respondWithFilteredResult(_0x4cddc4,_0x2f2e9d))['catch'](handleError(_0x4cddc4,null));};exports[_0x26ae('0x41')]=function(_0x150bf1,_0x92a7d8){var _0x5e0369={'raw':!![],'where':{'id':_0x150bf1[_0x26ae('0x42')]['id']}},_0x2a0797={};_0x2a0797[_0x26ae('0x2e')]=_[_0x26ae('0x2f')](db[_0x26ae('0x2a')][_0x26ae('0x2b')]);_0x2a0797['query']=_['keys'](_0x150bf1['query']);_0x2a0797[_0x26ae('0x31')]=_[_0x26ae('0x32')](_0x2a0797[_0x26ae('0x2e')],_0x2a0797[_0x26ae('0x30')]);_0x5e0369[_0x26ae('0x33')]=_['intersection'](_0x2a0797['model'],qs[_0x26ae('0x34')](_0x150bf1[_0x26ae('0x30')][_0x26ae('0x34')]));_0x5e0369['attributes']=_0x5e0369[_0x26ae('0x33')]['length']?_0x5e0369[_0x26ae('0x33')]:_0x2a0797[_0x26ae('0x2e')];if(_0x150bf1['query']['includeAll']){_0x5e0369[_0x26ae('0x40')]=[{'all':!![]}];}_0x5e0369=_['merge']({},_0x5e0369,_0x150bf1[_0x26ae('0x3e')]);return db[_0x26ae('0x2a')][_0x26ae('0x43')](_0x5e0369)[_0x26ae('0x24')](handleEntityNotFound(_0x92a7d8,null))[_0x26ae('0x24')](respondWithResult(_0x92a7d8,null))[_0x26ae('0x44')](handleError(_0x92a7d8,null));};exports[_0x26ae('0x45')]=function(_0x3484cb,_0x21a623){return db[_0x26ae('0x2a')][_0x26ae('0x45')](_0x3484cb['body'],{})[_0x26ae('0x24')](respondWithResult(_0x21a623,0xc9))[_0x26ae('0x44')](handleError(_0x21a623,null));};exports[_0x26ae('0x46')]=function(_0x1fe641,_0x3e56bb){if(_0x1fe641[_0x26ae('0x47')]['id']){delete _0x1fe641[_0x26ae('0x47')]['id'];}return db[_0x26ae('0x2a')][_0x26ae('0x43')]({'where':{'id':_0x1fe641[_0x26ae('0x42')]['id']}})[_0x26ae('0x24')](handleEntityNotFound(_0x3e56bb,null))[_0x26ae('0x24')](saveUpdates(_0x1fe641[_0x26ae('0x47')],null))['then'](respondWithResult(_0x3e56bb,null))[_0x26ae('0x44')](handleError(_0x3e56bb,null));};exports['destroy']=function(_0x3dd581,_0x23e6be){return db[_0x26ae('0x2a')][_0x26ae('0x43')]({'where':{'id':_0x3dd581[_0x26ae('0x42')]['id']}})[_0x26ae('0x24')](handleEntityNotFound(_0x23e6be,null))['then'](removeEntity(_0x23e6be,null))[_0x26ae('0x44')](handleError(_0x23e6be,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index d8ca36f..bd343bc 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 _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 +var _0xc47c=['../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','moment','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc47c,0xe0));var _0xcc47=function(_0x2b778d,_0x5dd9e4){_0x2b778d=_0x2b778d-0x0;var _0x46a581=_0xc47c[_0x2b778d];return _0x46a581;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcc47('0x0'));var BPromise=require('bluebird');var rp=require(_0xcc47('0x1'));var fs=require('fs');var path=require(_0xcc47('0x2'));var rimraf=require(_0xcc47('0x3'));var config=require(_0xcc47('0x4'));var attributes=require(_0xcc47('0x5'));module[_0xcc47('0x6')]=function(_0x462acf,_0x5e52b0){return _0x462acf[_0xcc47('0x7')](_0xcc47('0x8'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xcc47('0x9'),'fields':[_0xcc47('0xa'),_0xcc47('0xb')],'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 eed18ca..6b37514 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 _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 +var _0x66ac=['debug','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x3c9f6a,_0x2f62d6){var _0x461a80=function(_0x4f0005){while(--_0x4f0005){_0x3c9f6a['push'](_0x3c9f6a['shift']());}};_0x461a80(++_0x2f62d6);}(_0x66ac,0xd8));var _0xc66a=function(_0xd29520,_0x3e7c02){_0xd29520=_0xd29520-0x0;var _0x2b15b5=_0x66ac[_0xd29520];return _0x2b15b5;};'use strict';var _=require(_0xc66a('0x0'));var util=require(_0xc66a('0x1'));var moment=require(_0xc66a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc66a('0x3'));var db=require(_0xc66a('0x4'))['db'];var utils=require(_0xc66a('0x5'));var logger=require(_0xc66a('0x6'))(_0xc66a('0x7'));var config=require(_0xc66a('0x8'));var jayson=require(_0xc66a('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d9392,_0x3c267f,_0x4421fc){return new BPromise(function(_0x41270a,_0x5948a7){return client[_0xc66a('0xa')](_0x1d9392,_0x4421fc)[_0xc66a('0xb')](function(_0x50e343){logger[_0xc66a('0xc')](_0xc66a('0xd'),_0x3c267f,_0xc66a('0xe'));logger[_0xc66a('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x3c267f,_0xc66a('0xe'),JSON[_0xc66a('0x10')](_0x50e343));if(_0x50e343['error']){if(_0x50e343[_0xc66a('0x11')]['code']===0x1f4){logger[_0xc66a('0x11')](_0xc66a('0xd'),_0x3c267f,_0x50e343['error'][_0xc66a('0x12')]);return _0x5948a7(_0x50e343[_0xc66a('0x11')][_0xc66a('0x12')]);}logger[_0xc66a('0x11')](_0xc66a('0xd'),_0x3c267f,_0x50e343[_0xc66a('0x11')][_0xc66a('0x12')]);return _0x41270a(_0x50e343[_0xc66a('0x11')][_0xc66a('0x12')]);}else{logger[_0xc66a('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x3c267f,_0xc66a('0xe'));_0x41270a(_0x50e343[_0xc66a('0x13')][_0xc66a('0x12')]);}})[_0xc66a('0x14')](function(_0x6fa1cc){logger[_0xc66a('0x11')](_0xc66a('0xd'),_0x3c267f,_0x6fa1cc);_0x5948a7(_0x6fa1cc);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index c2aafab..84ee482 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 _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 +var _0xf290=['destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update'];(function(_0x502b81,_0x62df38){var _0x2dbe5b=function(_0x1b1f11){while(--_0x1b1f11){_0x502b81['push'](_0x502b81['shift']());}};_0x2dbe5b(++_0x62df38);}(_0xf290,0xde));var _0x0f29=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xf290[_0xfae23b];return _0x200640;};'use strict';var multer=require('multer');var util=require(_0x0f29('0x0'));var path=require('path');var timeout=require(_0x0f29('0x1'));var express=require('express');var router=express[_0x0f29('0x2')]();var fs_extra=require(_0x0f29('0x3'));var auth=require(_0x0f29('0x4'));var interaction=require(_0x0f29('0x5'));var config=require(_0x0f29('0x6'));var controller=require('./intFreshsalesAccount.controller');router[_0x0f29('0x7')]('/',auth['isAuthenticated'](),controller[_0x0f29('0x8')]);router[_0x0f29('0x7')](_0x0f29('0x9'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xb')]);router[_0x0f29('0x7')](_0x0f29('0xc'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xd')]);router[_0x0f29('0x7')](_0x0f29('0xe'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xf')]);router[_0x0f29('0x10')]('/',auth[_0x0f29('0xa')](),controller['create']);router[_0x0f29('0x10')]('/:id/configurations',auth[_0x0f29('0xa')](),controller[_0x0f29('0x11')]);router[_0x0f29('0x12')](_0x0f29('0x9'),auth[_0x0f29('0xa')](),controller[_0x0f29('0x13')]);router['delete'](_0x0f29('0x9'),auth[_0x0f29('0xa')](),controller[_0x0f29('0x14')]);module[_0x0f29('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 5bac878..8b08bac 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 _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 +var _0x0424=['username','STRING'];(function(_0x190417,_0x54dc0d){var _0x110e9c=function(_0x517b86){while(--_0x517b86){_0x190417['push'](_0x190417['shift']());}};_0x110e9c(++_0x54dc0d);}(_0x0424,0x159));var _0x4042=function(_0x1304c6,_0x6bb485){_0x1304c6=_0x1304c6-0x0;var _0x2e6654=_0x0424[_0x1304c6];return _0x2e6654;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4042('0x0')]},'description':{'type':Sequelize[_0x4042('0x0')]},'username':{'type':Sequelize[_0x4042('0x0')],'unique':_0x4042('0x1')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x4042('0x0')],'unique':'remoteUri'},'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 ada36aa..2af7a93 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 _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 +var _0x83ae=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','length','includeAll','find','create','update','body','params','findOne','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','apiKey','slice','lastIndexOf','format','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','reject','then','destroy','error','stack','name','send','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x11ba83,_0xd5611a){var _0x3f3925=function(_0x3d7cb0){while(--_0x3d7cb0){_0x11ba83['push'](_0x11ba83['shift']());}};_0x3f3925(++_0xd5611a);}(_0x83ae,0x15b));var _0xe83a=function(_0x99ec6b,_0x2b4abd){_0x99ec6b=_0x99ec6b-0x0;var _0x196cfd=_0x83ae[_0x99ec6b];return _0x196cfd;};'use strict';var emlformat=require(_0xe83a('0x0'));var rimraf=require(_0xe83a('0x1'));var zipdir=require(_0xe83a('0x2'));var jsonpatch=require(_0xe83a('0x3'));var rp=require(_0xe83a('0x4'));var moment=require(_0xe83a('0x5'));var BPromise=require(_0xe83a('0x6'));var Mustache=require('mustache');var util=require(_0xe83a('0x7'));var path=require(_0xe83a('0x8'));var sox=require(_0xe83a('0x9'));var csv=require(_0xe83a('0xa'));var ejs=require(_0xe83a('0xb'));var fs=require('fs');var fs_extra=require(_0xe83a('0xc'));var _=require('lodash');var squel=require(_0xe83a('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe83a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe83a('0xf'));var Papa=require(_0xe83a('0x10'));var Redis=require(_0xe83a('0x11'));var authService=require(_0xe83a('0x12'));var qs=require(_0xe83a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe83a('0x14'))(_0xe83a('0x15'));var utils=require('../../config/utils');var config=require(_0xe83a('0x16'));var licenseUtil=require(_0xe83a('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xe83a('0x18'));function respondWithStatusCode(_0x3c6fad,_0x18cc2d){_0x18cc2d=_0x18cc2d||0xcc;return function(_0x396dbd){if(_0x396dbd){return _0x3c6fad[_0xe83a('0x19')](_0x18cc2d);}return _0x3c6fad['status'](_0x18cc2d)[_0xe83a('0x1a')]();};}function respondWithResult(_0x491029,_0x4f0c60){_0x4f0c60=_0x4f0c60||0xc8;return function(_0x4caf37){if(_0x4caf37){return _0x491029[_0xe83a('0x1b')](_0x4f0c60)[_0xe83a('0x1c')](_0x4caf37);}};}function respondWithFilteredResult(_0x22d6be,_0x401827){return function(_0x30bca6){if(_0x30bca6){var _0x3e2d2e=typeof _0x401827[_0xe83a('0x1d')]===_0xe83a('0x1e')&&typeof _0x401827[_0xe83a('0x1f')]==='undefined';var _0x48164f=_0x30bca6[_0xe83a('0x20')];var _0x4754a6=_0x3e2d2e?0x0:_0x401827['offset'];var _0x50a199=_0x3e2d2e?_0x30bca6[_0xe83a('0x20')]:_0x401827[_0xe83a('0x1d')]+_0x401827[_0xe83a('0x1f')];var _0x40a3ce;if(_0x50a199>=_0x48164f){_0x50a199=_0x48164f;_0x40a3ce=0xc8;}else{_0x40a3ce=0xce;}_0x22d6be['status'](_0x40a3ce);return _0x22d6be['set']('Content-Range',_0x4754a6+'-'+_0x50a199+'/'+_0x48164f)[_0xe83a('0x1c')](_0x30bca6);}return null;};}function patchUpdates(_0x131c4d){return function(_0x4ed73e){try{jsonpatch['apply'](_0x4ed73e,_0x131c4d,!![]);}catch(_0x557d2c){return BPromise[_0xe83a('0x21')](_0x557d2c);}return _0x4ed73e['save']();};}function saveUpdates(_0x2a10b4,_0x4363a3){return function(_0x1f8b19){if(_0x1f8b19){return _0x1f8b19['update'](_0x2a10b4)[_0xe83a('0x22')](function(_0x31d828){return _0x31d828;});}return null;};}function removeEntity(_0x16e7fd,_0x5233c3){return function(_0x356780){if(_0x356780){return _0x356780[_0xe83a('0x23')]()[_0xe83a('0x22')](function(){_0x16e7fd[_0xe83a('0x1b')](0xcc)[_0xe83a('0x1a')]();});}};}function handleEntityNotFound(_0x2a1748,_0x3bf50b){return function(_0x46e96d){if(!_0x46e96d){_0x2a1748['sendStatus'](0x194);}return _0x46e96d;};}function handleError(_0x1423c0,_0x21f246){_0x21f246=_0x21f246||0x1f4;return function(_0x101b92){logger[_0xe83a('0x24')](_0x101b92[_0xe83a('0x25')]);if(_0x101b92[_0xe83a('0x26')]){delete _0x101b92[_0xe83a('0x26')];}_0x1423c0[_0xe83a('0x1b')](_0x21f246)[_0xe83a('0x27')](_0x101b92);};}exports['index']=function(_0x21dace,_0x458c5e){var _0x393d72={},_0x11b5ba={},_0x5cc749={'count':0x0,'rows':[]};var _0x22c3fe=_[_0xe83a('0x28')](db[_0xe83a('0x29')][_0xe83a('0x2a')],function(_0x3d864e){return{'name':_0x3d864e[_0xe83a('0x2b')],'type':_0x3d864e[_0xe83a('0x2c')][_0xe83a('0x2d')]};});_0x11b5ba[_0xe83a('0x2e')]=_[_0xe83a('0x28')](_0x22c3fe,_0xe83a('0x26'));_0x11b5ba[_0xe83a('0x2f')]=_[_0xe83a('0x30')](_0x21dace[_0xe83a('0x2f')]);_0x11b5ba[_0xe83a('0x31')]=_[_0xe83a('0x32')](_0x11b5ba[_0xe83a('0x2e')],_0x11b5ba['query']);_0x393d72[_0xe83a('0x33')]=_['intersection'](_0x11b5ba[_0xe83a('0x2e')],qs[_0xe83a('0x34')](_0x21dace[_0xe83a('0x2f')][_0xe83a('0x34')]));_0x393d72['attributes']=_0x393d72[_0xe83a('0x33')]['length']?_0x393d72[_0xe83a('0x33')]:_0x11b5ba[_0xe83a('0x2e')];if(!_0x21dace[_0xe83a('0x2f')]['hasOwnProperty'](_0xe83a('0x35'))){_0x393d72[_0xe83a('0x1f')]=qs[_0xe83a('0x1f')](_0x21dace['query'][_0xe83a('0x1f')]);_0x393d72[_0xe83a('0x1d')]=qs['offset'](_0x21dace[_0xe83a('0x2f')][_0xe83a('0x1d')]);}_0x393d72[_0xe83a('0x36')]=qs[_0xe83a('0x37')](_0x21dace[_0xe83a('0x2f')]['sort']);_0x393d72[_0xe83a('0x38')]=qs[_0xe83a('0x31')](_[_0xe83a('0x39')](_0x21dace[_0xe83a('0x2f')],_0x11b5ba['filters']),_0x22c3fe);if(_0x21dace[_0xe83a('0x2f')][_0xe83a('0x3a')]){_0x393d72[_0xe83a('0x38')]=_[_0xe83a('0x3b')](_0x393d72[_0xe83a('0x38')],{'$or':_[_0xe83a('0x28')](_0x22c3fe,function(_0x3ac6ee){if(_0x3ac6ee['type']!==_0xe83a('0x3c')){var _0x39b44f={};_0x39b44f[_0x3ac6ee[_0xe83a('0x26')]]={'$like':'%'+_0x21dace[_0xe83a('0x2f')][_0xe83a('0x3a')]+'%'};return _0x39b44f;}})});}_0x393d72=_[_0xe83a('0x3b')]({},_0x393d72,_0x21dace[_0xe83a('0x3d')]);var _0xdf1e88={'where':_0x393d72[_0xe83a('0x38')]};return db[_0xe83a('0x29')]['count'](_0xdf1e88)[_0xe83a('0x22')](function(_0x39cfd1){_0x5cc749[_0xe83a('0x20')]=_0x39cfd1;if(_0x21dace[_0xe83a('0x2f')]['includeAll']){_0x393d72[_0xe83a('0x3e')]=[{'all':!![]}];}return db[_0xe83a('0x29')][_0xe83a('0x3f')](_0x393d72);})['then'](function(_0xd53328){_0x5cc749[_0xe83a('0x40')]=_0xd53328;return _0x5cc749;})[_0xe83a('0x22')](respondWithFilteredResult(_0x458c5e,_0x393d72))[_0xe83a('0x41')](handleError(_0x458c5e,null));};exports['show']=function(_0x145369,_0x25d17e){var _0x397582={'raw':![],'where':{'id':_0x145369['params']['id']}},_0x34825f={};_0x34825f[_0xe83a('0x2e')]=_[_0xe83a('0x30')](db[_0xe83a('0x29')][_0xe83a('0x2a')]);_0x34825f[_0xe83a('0x2f')]=_['keys'](_0x145369['query']);_0x34825f[_0xe83a('0x31')]=_[_0xe83a('0x32')](_0x34825f[_0xe83a('0x2e')],_0x34825f['query']);_0x397582['attributes']=_[_0xe83a('0x32')](_0x34825f[_0xe83a('0x2e')],qs[_0xe83a('0x34')](_0x145369[_0xe83a('0x2f')]['fields']));_0x397582[_0xe83a('0x33')]=_0x397582[_0xe83a('0x33')][_0xe83a('0x42')]?_0x397582[_0xe83a('0x33')]:_0x34825f[_0xe83a('0x2e')];if(_0x145369[_0xe83a('0x2f')][_0xe83a('0x43')]){_0x397582[_0xe83a('0x3e')]=[{'all':!![]}];}_0x397582=_[_0xe83a('0x3b')]({},_0x397582,_0x145369[_0xe83a('0x3d')]);return db[_0xe83a('0x29')][_0xe83a('0x44')](_0x397582)['then'](handleEntityNotFound(_0x25d17e,null))[_0xe83a('0x22')](respondWithResult(_0x25d17e,null))[_0xe83a('0x41')](handleError(_0x25d17e,null));};exports[_0xe83a('0x45')]=function(_0x5d16ca,_0x538970){return db[_0xe83a('0x29')][_0xe83a('0x45')](_0x5d16ca['body'],{})[_0xe83a('0x22')](respondWithResult(_0x538970,0xc9))[_0xe83a('0x41')](handleError(_0x538970,null));};exports[_0xe83a('0x46')]=function(_0x1468f7,_0x583ef3){if(_0x1468f7['body']['id']){delete _0x1468f7[_0xe83a('0x47')]['id'];}return db[_0xe83a('0x29')][_0xe83a('0x44')]({'where':{'id':_0x1468f7[_0xe83a('0x48')]['id']}})[_0xe83a('0x22')](handleEntityNotFound(_0x583ef3,null))[_0xe83a('0x22')](saveUpdates(_0x1468f7[_0xe83a('0x47')],null))['then'](respondWithResult(_0x583ef3,null))[_0xe83a('0x41')](handleError(_0x583ef3,null));};exports['destroy']=function(_0x589f0d,_0x260f9e){return db['FreshsalesAccount'][_0xe83a('0x44')]({'where':{'id':_0x589f0d[_0xe83a('0x48')]['id']}})[_0xe83a('0x22')](handleEntityNotFound(_0x260f9e,null))[_0xe83a('0x22')](removeEntity(_0x260f9e,null))[_0xe83a('0x41')](handleError(_0x260f9e,null));};exports['getConfigurations']=function(_0x904a90,_0x56c917,_0x54e4b3){var _0x4b5d0b={};var _0xae5694={};var _0x293952;var _0x19d5d3;return db[_0xe83a('0x29')][_0xe83a('0x49')]({'where':{'id':_0x904a90[_0xe83a('0x48')]['id']}})['then'](handleEntityNotFound(_0x56c917,null))[_0xe83a('0x22')](function(_0x29dfd0){if(_0x29dfd0){_0x293952=_0x29dfd0;_0xae5694['model']=_['keys'](db['FreshsalesConfiguration']['rawAttributes']);_0xae5694[_0xe83a('0x2f')]=_['keys'](_0x904a90['query']);_0xae5694[_0xe83a('0x31')]=_[_0xe83a('0x32')](_0xae5694['model'],_0xae5694[_0xe83a('0x2f')]);_0x4b5d0b[_0xe83a('0x33')]=_['intersection'](_0xae5694[_0xe83a('0x2e')],qs[_0xe83a('0x34')](_0x904a90[_0xe83a('0x2f')][_0xe83a('0x34')]));_0x4b5d0b['attributes']=_0x4b5d0b[_0xe83a('0x33')][_0xe83a('0x42')]?_0x4b5d0b[_0xe83a('0x33')]:_0xae5694[_0xe83a('0x2e')];_0x4b5d0b['order']=qs[_0xe83a('0x37')](_0x904a90['query'][_0xe83a('0x37')]);_0x4b5d0b['where']=qs[_0xe83a('0x31')](_['pick'](_0x904a90[_0xe83a('0x2f')],_0xae5694['filters']));if(_0x904a90['query']['filter']){_0x4b5d0b[_0xe83a('0x38')]=_[_0xe83a('0x3b')](_0x4b5d0b[_0xe83a('0x38')],{'$or':_['map'](_0x4b5d0b[_0xe83a('0x33')],function(_0x1b95d1){var _0x162753={};_0x162753[_0x1b95d1]={'$like':'%'+_0x904a90[_0xe83a('0x2f')]['filter']+'%'};return _0x162753;})});}_0x4b5d0b=_[_0xe83a('0x3b')]({},_0x4b5d0b,_0x904a90[_0xe83a('0x3d')]);return _0x293952[_0xe83a('0x4a')](_0x4b5d0b);}})[_0xe83a('0x22')](function(_0x451526){if(_0x451526){_0x19d5d3=_0x451526[_0xe83a('0x42')];if(!_0x904a90[_0xe83a('0x2f')][_0xe83a('0x4b')](_0xe83a('0x35'))){_0x4b5d0b[_0xe83a('0x1f')]=qs['limit'](_0x904a90[_0xe83a('0x2f')]['limit']);_0x4b5d0b[_0xe83a('0x1d')]=qs['offset'](_0x904a90['query']['offset']);}return _0x293952['getConfigurations'](_0x4b5d0b);}})[_0xe83a('0x22')](function(_0x2d59d4){if(_0x2d59d4){return _0x2d59d4?{'count':_0x19d5d3,'rows':_0x2d59d4}:null;}})[_0xe83a('0x22')](respondWithResult(_0x56c917,null))[_0xe83a('0x41')](handleError(_0x56c917,null));};exports[_0xe83a('0x4c')]=function(_0xa7998a,_0x4fc225,_0x1802e4){if(_0xa7998a[_0xe83a('0x47')]['id']){delete _0xa7998a['body']['id'];}return db[_0xe83a('0x29')][_0xe83a('0x49')]({'where':{'id':_0xa7998a[_0xe83a('0x48')]['id']}})[_0xe83a('0x22')](handleEntityNotFound(_0x4fc225,null))['then'](function(_0x3d64fc){if(_0x3d64fc){_0xa7998a[_0xe83a('0x47')][_0xe83a('0x4d')]=_0x3d64fc['id'];_0xa7998a[_0xe83a('0x47')][_0xe83a('0x4e')]=integrations[_0xe83a('0x4f')](_0xa7998a[_0xe83a('0x47')]['channel'],_0xa7998a[_0xe83a('0x47')][_0xe83a('0x2c')]);_0xa7998a[_0xe83a('0x47')][_0xe83a('0x50')]=integrations[_0xe83a('0x51')](_0xa7998a[_0xe83a('0x47')][_0xe83a('0x52')],_0xa7998a[_0xe83a('0x47')][_0xe83a('0x2c')]);return db[_0xe83a('0x53')]['create'](_0xa7998a[_0xe83a('0x47')],{'include':[{'model':db[_0xe83a('0x54')],'as':_0xe83a('0x4e')},{'model':db[_0xe83a('0x54')],'as':_0xe83a('0x50')}]});}return null;})[_0xe83a('0x22')](respondWithResult(_0x4fc225,null))[_0xe83a('0x41')](handleError(_0x4fc225,null));};exports[_0xe83a('0x55')]=function(_0x9d5bf,_0x55da9f,_0x265f4f){var _0x3b7fd6='';var _0xb1decd='';return db[_0xe83a('0x29')][_0xe83a('0x49')]({'where':{'id':_0x9d5bf[_0xe83a('0x48')]['id']},'attributes':['id',_0xe83a('0x56'),_0xe83a('0x57'),_0xe83a('0x58')]})['then'](handleEntityNotFound(_0x55da9f,null))[_0xe83a('0x22')](function(_0x31c127){if(_0x31c127){_0xb1decd=_0x31c127[_0xe83a('0x56')];_0x3b7fd6=_0x31c127[_0xe83a('0x57')];var _0x5c9abe=_0x31c127[_0xe83a('0x57')][_0xe83a('0x59')](-0x1);if(_0x5c9abe==='/'){_0x3b7fd6=_0x3b7fd6['substring'](0x0,_0x3b7fd6[_0xe83a('0x5a')](_0x5c9abe));}return rp({'method':'GET','uri':util[_0xe83a('0x5b')]('%s%s',_0x3b7fd6,_0xe83a('0x5c')),'headers':{'Authorization':_0xe83a('0x5d')+_0x31c127['apiKey']},'json':!![]});}})[_0xe83a('0x22')](function(_0x50ccb4){if(_0x50ccb4){var _0x33ff3d=_0x50ccb4[_0xe83a('0x5e')];var _0x3fd689=![];var _0x1e92d4=null;for(_0x1e92d4=0x0;_0x1e92d4<_0x33ff3d[_0xe83a('0x42')];_0x1e92d4++){if(_0x33ff3d[_0x1e92d4][_0xe83a('0x5f')]===_0xb1decd){_0x3fd689=!![];}}if(_0x3fd689){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xe83a('0x60')});}}})['then'](respondWithResult(_0x55da9f,null))[_0xe83a('0x41')](function(_0x51f8cf){var _0x59d8ce=_0x9d5bf[_0xe83a('0x2f')][_0xe83a('0x61')]?0x1f4:_0x51f8cf['statusCode']||0x1f4;logger[_0xe83a('0x24')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x59d8ce,JSON['stringify'](_0x51f8cf));delete _0x51f8cf[_0xe83a('0x26')];if(_0x59d8ce===0x191){_0x59d8ce=0x190;}_0x55da9f[_0xe83a('0x1b')](_0x59d8ce)[_0xe83a('0x27')](_0x9d5bf[_0xe83a('0x2f')]['test']?{'message':_0xe83a('0x62'),'statusCode':_0x51f8cf[_0xe83a('0x63')]}:_0x51f8cf);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index c61777e..c227dcd 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 _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 +var _0x687b=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x118e76,_0x46115b){var _0x421169=function(_0x3c0976){while(--_0x3c0976){_0x118e76['push'](_0x118e76['shift']());}};_0x421169(++_0x46115b);}(_0x687b,0x14a));var _0xb687=function(_0x4a18f0,_0x903c50){_0x4a18f0=_0x4a18f0-0x0;var _0x158316=_0x687b[_0x4a18f0];return _0x158316;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));var integrations=require(_0xb687('0x9'));module[_0xb687('0xa')]=function(_0xf43a1f,_0x47ffea){return _0xf43a1f[_0xb687('0xb')]('FreshsalesAccount',attributes,{'tableName':_0xb687('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 4cd8ebb..6485e4e 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 _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 +var _0x1261=['FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFreshsalesAccount','options','raw','limit','include','map','model','attributes','stringify','ShowFreshsalesAccount','FreshsalesAccount','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x5e4740,_0x2e4ed7){var _0x314894=function(_0x35d383){while(--_0x35d383){_0x5e4740['push'](_0x5e4740['shift']());}};_0x314894(++_0x2e4ed7);}(_0x1261,0x144));var _0x1126=function(_0xabbd2f,_0x44d05a){_0xabbd2f=_0xabbd2f-0x0;var _0x34a040=_0x1261[_0xabbd2f];return _0x34a040;};'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')]('FreshsalesAccount,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['FreshsalesAccount']['findAll']({'raw':_0x4a7b49[_0x1126('0x16')]?_0x4a7b49['options'][_0x1126('0x17')]===undefined?!![]:![]:!![],'where':_0x4a7b49[_0x1126('0x16')]?_0x4a7b49[_0x1126('0x16')]['where']||null:null,'attributes':_0x4a7b49[_0x1126('0x16')]?_0x4a7b49['options']['attributes']||null:null,'limit':_0x4a7b49[_0x1126('0x16')]?_0x4a7b49[_0x1126('0x16')][_0x1126('0x18')]||null:null,'include':_0x4a7b49[_0x1126('0x16')]?_0x4a7b49['options'][_0x1126('0x19')]?_[_0x1126('0x1a')](_0x4a7b49['options'][_0x1126('0x19')],function(_0x59cd8e){return{'model':db[_0x59cd8e['model']],'as':_0x59cd8e['as'],'attributes':_0x59cd8e['attributes'],'include':_0x59cd8e[_0x1126('0x19')]?_[_0x1126('0x1a')](_0x59cd8e[_0x1126('0x19')],function(_0x34bcf1){return{'model':db[_0x34bcf1[_0x1126('0x1b')]],'as':_0x34bcf1['as'],'attributes':_0x34bcf1[_0x1126('0x1c')],'include':_0x34bcf1[_0x1126('0x19')]?_[_0x1126('0x1a')](_0x34bcf1['include'],function(_0x35eec3){return{'model':db[_0x35eec3[_0x1126('0x1b')]],'as':_0x35eec3['as'],'attributes':_0x35eec3[_0x1126('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x541bc9){logger[_0x1126('0xd')](_0x1126('0x15'),_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x1d')](_0x541bc9));_0x22ae0b(_0x541bc9);})['catch'](function(_0x3fa694){logger['error'](_0x1126('0x15'),_0x3fa694['message'],_0x4a7b49);_0x2b2487(_0x4d2b38[_0x1126('0x11')](0x1f4,_0x3fa694['message']));});});};exports[_0x1126('0x1e')]=function(_0x5f2611){var _0x5252e0=this;return new Promise(function(_0x4a53ab,_0x17646e){return db[_0x1126('0x1f')][_0x1126('0x20')]({'raw':_0x5f2611['options']?_0x5f2611[_0x1126('0x16')][_0x1126('0x17')]===undefined?!![]:![]:!![],'where':_0x5f2611['options']?_0x5f2611[_0x1126('0x16')][_0x1126('0x21')]||null:null,'attributes':_0x5f2611[_0x1126('0x16')]?_0x5f2611[_0x1126('0x16')]['attributes']||null:null,'include':_0x5f2611['options']?_0x5f2611[_0x1126('0x16')][_0x1126('0x19')]?_[_0x1126('0x1a')](_0x5f2611[_0x1126('0x16')]['include'],function(_0x145314){return{'model':db[_0x145314[_0x1126('0x1b')]],'as':_0x145314['as'],'attributes':_0x145314[_0x1126('0x1c')],'include':_0x145314[_0x1126('0x19')]?_[_0x1126('0x1a')](_0x145314['include'],function(_0x2a0dfe){return{'model':db[_0x2a0dfe[_0x1126('0x1b')]],'as':_0x2a0dfe['as'],'attributes':_0x2a0dfe[_0x1126('0x1c')],'include':_0x2a0dfe[_0x1126('0x19')]?_['map'](_0x2a0dfe['include'],function(_0x22827a){return{'model':db[_0x22827a[_0x1126('0x1b')]],'as':_0x22827a['as'],'attributes':_0x22827a['attributes']};}):[]};}):[]};}):[]:[]})[_0x1126('0xc')](function(_0xf3c21b){logger[_0x1126('0xd')]('ShowFreshsalesAccount',_0x5f2611);logger['debug'](_0x1126('0x1e'),_0x5f2611,JSON[_0x1126('0x1d')](_0xf3c21b));_0x4a53ab(_0xf3c21b);})[_0x1126('0x14')](function(_0x156554){logger['error'](_0x1126('0x1e'),_0x156554['message'],_0x5f2611);_0x17646e(_0x5252e0[_0x1126('0x11')](0x1f4,_0x156554[_0x1126('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 082cb7d..9eff362 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 _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 +var _0x9103=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','getSubjects','/:id/fields','post','create','put','delete','multer'];(function(_0x4d27a9,_0x590387){var _0x7930b7=function(_0x324676){while(--_0x324676){_0x4d27a9['push'](_0x4d27a9['shift']());}};_0x7930b7(++_0x590387);}(_0x9103,0x17b));var _0x3910=function(_0x1aa3fe,_0x27c5fa){_0x1aa3fe=_0x1aa3fe-0x0;var _0x163cee=_0x9103[_0x1aa3fe];return _0x163cee;};'use strict';var multer=require(_0x3910('0x0'));var util=require(_0x3910('0x1'));var path=require(_0x3910('0x2'));var timeout=require(_0x3910('0x3'));var express=require('express');var router=express[_0x3910('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3910('0x5'));var interaction=require(_0x3910('0x6'));var config=require(_0x3910('0x7'));var controller=require(_0x3910('0x8'));router[_0x3910('0x9')]('/',auth[_0x3910('0xa')](),controller[_0x3910('0xb')]);router[_0x3910('0x9')](_0x3910('0xc'),auth[_0x3910('0xa')](),controller['show']);router[_0x3910('0x9')](_0x3910('0xd'),auth[_0x3910('0xa')](),controller[_0x3910('0xe')]);router[_0x3910('0x9')]('/:id/descriptions',auth[_0x3910('0xa')](),controller['getDescriptions']);router[_0x3910('0x9')](_0x3910('0xf'),auth[_0x3910('0xa')](),controller['getFields']);router[_0x3910('0x10')]('/',auth[_0x3910('0xa')](),controller[_0x3910('0x11')]);router[_0x3910('0x12')](_0x3910('0xc'),auth[_0x3910('0xa')](),controller['update']);router[_0x3910('0x13')](_0x3910('0xc'),auth[_0x3910('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index ae4b25f..03f4f5c 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 _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 +var _0xa782=['sequelize','STRING'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xa782,0x72));var _0x2a78=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xa782[_0x32f7d7];return _0x133d09;};'use strict';var Sequelize=require(_0x2a78('0x0'));module['exports']={'name':{'type':Sequelize[_0x2a78('0x1')]},'description':{'type':Sequelize[_0x2a78('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index abf4ce8..0041c3c 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 _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 +var _0x6a9a=['VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','create','body','destroy','find','getSubjects','findOne','FreshsalesField','length','pick','getDescriptions','getFields','order','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','error','name','send','map','FreshsalesConfiguration','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','type'];(function(_0x27d10a,_0x35ff44){var _0x63302e=function(_0x302156){while(--_0x302156){_0x27d10a['push'](_0x27d10a['shift']());}};_0x63302e(++_0x35ff44);}(_0x6a9a,0x1de));var _0xa6a9=function(_0x5400b,_0x55943a){_0x5400b=_0x5400b-0x0;var _0x36a39b=_0x6a9a[_0x5400b];return _0x36a39b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa6a9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa6a9('0x1'));var rp=require(_0xa6a9('0x2'));var moment=require(_0xa6a9('0x3'));var BPromise=require(_0xa6a9('0x4'));var Mustache=require('mustache');var util=require(_0xa6a9('0x5'));var path=require(_0xa6a9('0x6'));var sox=require(_0xa6a9('0x7'));var csv=require(_0xa6a9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa6a9('0x9'));var squel=require('squel');var crypto=require(_0xa6a9('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa6a9('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa6a9('0xc'));var Redis=require(_0xa6a9('0xd'));var authService=require(_0xa6a9('0xe'));var qs=require(_0xa6a9('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa6a9('0x10'));var logger=require(_0xa6a9('0x11'))('api');var utils=require(_0xa6a9('0x12'));var config=require(_0xa6a9('0x13'));var licenseUtil=require(_0xa6a9('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5323ca,_0x1ba81c){_0x1ba81c=_0x1ba81c||0xcc;return function(_0xf7ff7a){if(_0xf7ff7a){return _0x5323ca[_0xa6a9('0x15')](_0x1ba81c);}return _0x5323ca[_0xa6a9('0x16')](_0x1ba81c)[_0xa6a9('0x17')]();};}function respondWithResult(_0x303c08,_0xf64b0a){_0xf64b0a=_0xf64b0a||0xc8;return function(_0x173dfe){if(_0x173dfe){return _0x303c08['status'](_0xf64b0a)[_0xa6a9('0x18')](_0x173dfe);}};}function respondWithFilteredResult(_0x5a772e,_0x15d70c){return function(_0x15ae7b){if(_0x15ae7b){var _0xb8fef5=typeof _0x15d70c['offset']===_0xa6a9('0x19')&&typeof _0x15d70c[_0xa6a9('0x1a')]===_0xa6a9('0x19');var _0x4d9585=_0x15ae7b[_0xa6a9('0x1b')];var _0x4732b5=_0xb8fef5?0x0:_0x15d70c['offset'];var _0x308f9a=_0xb8fef5?_0x15ae7b[_0xa6a9('0x1b')]:_0x15d70c[_0xa6a9('0x1c')]+_0x15d70c[_0xa6a9('0x1a')];var _0x196e8e;if(_0x308f9a>=_0x4d9585){_0x308f9a=_0x4d9585;_0x196e8e=0xc8;}else{_0x196e8e=0xce;}_0x5a772e[_0xa6a9('0x16')](_0x196e8e);return _0x5a772e['set'](_0xa6a9('0x1d'),_0x4732b5+'-'+_0x308f9a+'/'+_0x4d9585)[_0xa6a9('0x18')](_0x15ae7b);}return null;};}function patchUpdates(_0x2a93cd){return function(_0x27de99){try{jsonpatch[_0xa6a9('0x1e')](_0x27de99,_0x2a93cd,!![]);}catch(_0x34a0b1){return BPromise['reject'](_0x34a0b1);}return _0x27de99[_0xa6a9('0x1f')]();};}function saveUpdates(_0x393c23,_0x537f64){return function(_0x54158d){if(_0x54158d){return _0x54158d[_0xa6a9('0x20')](_0x393c23)['then'](function(_0x5d7e82){return _0x5d7e82;});}return null;};}function removeEntity(_0x317056,_0x5c9940){return function(_0x12dbee){if(_0x12dbee){return _0x12dbee['destroy']()[_0xa6a9('0x21')](function(){_0x317056[_0xa6a9('0x16')](0xcc)[_0xa6a9('0x17')]();});}};}function handleEntityNotFound(_0xf319ad,_0x4d0871){return function(_0x277d00){if(!_0x277d00){_0xf319ad[_0xa6a9('0x15')](0x194);}return _0x277d00;};}function handleError(_0x208156,_0x54400d){_0x54400d=_0x54400d||0x1f4;return function(_0xa0a94){logger[_0xa6a9('0x22')](_0xa0a94['stack']);if(_0xa0a94['name']){delete _0xa0a94[_0xa6a9('0x23')];}_0x208156[_0xa6a9('0x16')](_0x54400d)[_0xa6a9('0x24')](_0xa0a94);};}exports['index']=function(_0xb19947,_0x3685c3){var _0x5247ba={},_0xc9f7a1={},_0x41381e={'count':0x0,'rows':[]};var _0x2ee69a=_[_0xa6a9('0x25')](db[_0xa6a9('0x26')][_0xa6a9('0x27')],function(_0x367db6){return{'name':_0x367db6[_0xa6a9('0x28')],'type':_0x367db6['type']['key']};});_0xc9f7a1[_0xa6a9('0x29')]=_[_0xa6a9('0x25')](_0x2ee69a,_0xa6a9('0x23'));_0xc9f7a1[_0xa6a9('0x2a')]=_[_0xa6a9('0x2b')](_0xb19947[_0xa6a9('0x2a')]);_0xc9f7a1[_0xa6a9('0x2c')]=_[_0xa6a9('0x2d')](_0xc9f7a1[_0xa6a9('0x29')],_0xc9f7a1[_0xa6a9('0x2a')]);_0x5247ba[_0xa6a9('0x2e')]=_[_0xa6a9('0x2d')](_0xc9f7a1[_0xa6a9('0x29')],qs[_0xa6a9('0x2f')](_0xb19947[_0xa6a9('0x2a')]['fields']));_0x5247ba[_0xa6a9('0x2e')]=_0x5247ba[_0xa6a9('0x2e')]['length']?_0x5247ba[_0xa6a9('0x2e')]:_0xc9f7a1['model'];if(!_0xb19947[_0xa6a9('0x2a')][_0xa6a9('0x30')](_0xa6a9('0x31'))){_0x5247ba[_0xa6a9('0x1a')]=qs[_0xa6a9('0x1a')](_0xb19947[_0xa6a9('0x2a')][_0xa6a9('0x1a')]);_0x5247ba[_0xa6a9('0x1c')]=qs['offset'](_0xb19947[_0xa6a9('0x2a')]['offset']);}_0x5247ba['order']=qs[_0xa6a9('0x32')](_0xb19947['query']['sort']);_0x5247ba[_0xa6a9('0x33')]=qs[_0xa6a9('0x2c')](_['pick'](_0xb19947['query'],_0xc9f7a1[_0xa6a9('0x2c')]),_0x2ee69a);if(_0xb19947[_0xa6a9('0x2a')][_0xa6a9('0x34')]){_0x5247ba[_0xa6a9('0x33')]=_['merge'](_0x5247ba['where'],{'$or':_[_0xa6a9('0x25')](_0x2ee69a,function(_0xd8d9ab){if(_0xd8d9ab[_0xa6a9('0x35')]!==_0xa6a9('0x36')){var _0x440212={};_0x440212[_0xd8d9ab[_0xa6a9('0x23')]]={'$like':'%'+_0xb19947[_0xa6a9('0x2a')][_0xa6a9('0x34')]+'%'};return _0x440212;}})});}_0x5247ba=_[_0xa6a9('0x37')]({},_0x5247ba,_0xb19947[_0xa6a9('0x38')]);var _0x26b2e5={'where':_0x5247ba[_0xa6a9('0x33')]};return db[_0xa6a9('0x26')]['count'](_0x26b2e5)[_0xa6a9('0x21')](function(_0x36d2a3){_0x41381e[_0xa6a9('0x1b')]=_0x36d2a3;if(_0xb19947[_0xa6a9('0x2a')][_0xa6a9('0x39')]){_0x5247ba['include']=[{'all':!![]}];}return db[_0xa6a9('0x26')][_0xa6a9('0x3a')](_0x5247ba);})['then'](function(_0x78352e){_0x41381e[_0xa6a9('0x3b')]=_0x78352e;return _0x41381e;})[_0xa6a9('0x21')](respondWithFilteredResult(_0x3685c3,_0x5247ba))[_0xa6a9('0x3c')](handleError(_0x3685c3,null));};exports[_0xa6a9('0x3d')]=function(_0x19af84,_0x3c0a51){var _0x2e5282={'raw':![],'where':{'id':_0x19af84[_0xa6a9('0x3e')]['id']}},_0x5b3996={};_0x5b3996[_0xa6a9('0x29')]=_['keys'](db[_0xa6a9('0x26')][_0xa6a9('0x27')]);_0x5b3996[_0xa6a9('0x2a')]=_[_0xa6a9('0x2b')](_0x19af84[_0xa6a9('0x2a')]);_0x5b3996[_0xa6a9('0x2c')]=_[_0xa6a9('0x2d')](_0x5b3996[_0xa6a9('0x29')],_0x5b3996[_0xa6a9('0x2a')]);_0x2e5282[_0xa6a9('0x2e')]=_[_0xa6a9('0x2d')](_0x5b3996[_0xa6a9('0x29')],qs[_0xa6a9('0x2f')](_0x19af84[_0xa6a9('0x2a')][_0xa6a9('0x2f')]));_0x2e5282['attributes']=_0x2e5282['attributes']['length']?_0x2e5282[_0xa6a9('0x2e')]:_0x5b3996[_0xa6a9('0x29')];if(_0x19af84[_0xa6a9('0x2a')][_0xa6a9('0x39')]){_0x2e5282[_0xa6a9('0x3f')]=[{'all':!![]}];}_0x2e5282=_[_0xa6a9('0x37')]({},_0x2e5282,_0x19af84['options']);return db['FreshsalesConfiguration']['find'](_0x2e5282)['then'](handleEntityNotFound(_0x3c0a51,null))[_0xa6a9('0x21')](respondWithResult(_0x3c0a51,null))[_0xa6a9('0x3c')](handleError(_0x3c0a51,null));};exports[_0xa6a9('0x40')]=function(_0x352fc1,_0x542c28){return db[_0xa6a9('0x26')][_0xa6a9('0x40')](_0x352fc1[_0xa6a9('0x41')],{})[_0xa6a9('0x21')](respondWithResult(_0x542c28,0xc9))[_0xa6a9('0x3c')](handleError(_0x542c28,null));};exports[_0xa6a9('0x20')]=function(_0x525092,_0x382c3a){if(_0x525092[_0xa6a9('0x41')]['id']){delete _0x525092[_0xa6a9('0x41')]['id'];}return db[_0xa6a9('0x26')]['find']({'where':{'id':_0x525092['params']['id']}})['then'](handleEntityNotFound(_0x382c3a,null))[_0xa6a9('0x21')](saveUpdates(_0x525092[_0xa6a9('0x41')],null))['then'](respondWithResult(_0x382c3a,null))[_0xa6a9('0x3c')](handleError(_0x382c3a,null));};exports[_0xa6a9('0x42')]=function(_0x51260b,_0x36def6){return db['FreshsalesConfiguration'][_0xa6a9('0x43')]({'where':{'id':_0x51260b[_0xa6a9('0x3e')]['id']}})['then'](handleEntityNotFound(_0x36def6,null))['then'](removeEntity(_0x36def6,null))[_0xa6a9('0x3c')](handleError(_0x36def6,null));};exports[_0xa6a9('0x44')]=function(_0x33028f,_0x52e94b,_0x5ce848){var _0x4b2b2e={};var _0x404db9={};var _0x448fa7;var _0xbc0d06;return db[_0xa6a9('0x26')][_0xa6a9('0x45')]({'where':{'id':_0x33028f[_0xa6a9('0x3e')]['id']}})['then'](handleEntityNotFound(_0x52e94b,null))[_0xa6a9('0x21')](function(_0x3aa637){if(_0x3aa637){_0x448fa7=_0x3aa637;_0x404db9['model']=_[_0xa6a9('0x2b')](db[_0xa6a9('0x46')][_0xa6a9('0x27')]);_0x404db9[_0xa6a9('0x2a')]=_[_0xa6a9('0x2b')](_0x33028f[_0xa6a9('0x2a')]);_0x404db9[_0xa6a9('0x2c')]=_[_0xa6a9('0x2d')](_0x404db9[_0xa6a9('0x29')],_0x404db9[_0xa6a9('0x2a')]);_0x4b2b2e[_0xa6a9('0x2e')]=_[_0xa6a9('0x2d')](_0x404db9[_0xa6a9('0x29')],qs['fields'](_0x33028f['query'][_0xa6a9('0x2f')]));_0x4b2b2e['attributes']=_0x4b2b2e[_0xa6a9('0x2e')][_0xa6a9('0x47')]?_0x4b2b2e[_0xa6a9('0x2e')]:_0x404db9[_0xa6a9('0x29')];_0x4b2b2e['order']=qs[_0xa6a9('0x32')](_0x33028f['query'][_0xa6a9('0x32')]);_0x4b2b2e[_0xa6a9('0x33')]=qs['filters'](_[_0xa6a9('0x48')](_0x33028f[_0xa6a9('0x2a')],_0x404db9[_0xa6a9('0x2c')]));if(_0x33028f[_0xa6a9('0x2a')][_0xa6a9('0x34')]){_0x4b2b2e[_0xa6a9('0x33')]=_[_0xa6a9('0x37')](_0x4b2b2e[_0xa6a9('0x33')],{'$or':_['map'](_0x4b2b2e[_0xa6a9('0x2e')],function(_0x19e27e){var _0x494ca7={};_0x494ca7[_0x19e27e]={'$like':'%'+_0x33028f[_0xa6a9('0x2a')][_0xa6a9('0x34')]+'%'};return _0x494ca7;})});}_0x4b2b2e=_[_0xa6a9('0x37')]({},_0x4b2b2e,_0x33028f[_0xa6a9('0x38')]);return _0x448fa7[_0xa6a9('0x44')](_0x4b2b2e);}})[_0xa6a9('0x21')](function(_0x9cb88){if(_0x9cb88){_0xbc0d06=_0x9cb88[_0xa6a9('0x47')];if(!_0x33028f[_0xa6a9('0x2a')][_0xa6a9('0x30')]('nolimit')){_0x4b2b2e[_0xa6a9('0x1a')]=qs[_0xa6a9('0x1a')](_0x33028f[_0xa6a9('0x2a')][_0xa6a9('0x1a')]);_0x4b2b2e[_0xa6a9('0x1c')]=qs[_0xa6a9('0x1c')](_0x33028f[_0xa6a9('0x2a')][_0xa6a9('0x1c')]);}return _0x448fa7['getSubjects'](_0x4b2b2e);}})[_0xa6a9('0x21')](function(_0x45861d){if(_0x45861d){return _0x45861d?{'count':_0xbc0d06,'rows':_0x45861d}:null;}})[_0xa6a9('0x21')](respondWithResult(_0x52e94b,null))[_0xa6a9('0x3c')](handleError(_0x52e94b,null));};exports[_0xa6a9('0x49')]=function(_0x9f373c,_0x51c8b2,_0x515246){var _0x49e005={};var _0x538fff={};var _0x4875c6;var _0x30a9b4;return db[_0xa6a9('0x26')][_0xa6a9('0x45')]({'where':{'id':_0x9f373c[_0xa6a9('0x3e')]['id']}})[_0xa6a9('0x21')](handleEntityNotFound(_0x51c8b2,null))['then'](function(_0x433fef){if(_0x433fef){_0x4875c6=_0x433fef;_0x538fff[_0xa6a9('0x29')]=_[_0xa6a9('0x2b')](db[_0xa6a9('0x46')][_0xa6a9('0x27')]);_0x538fff[_0xa6a9('0x2a')]=_[_0xa6a9('0x2b')](_0x9f373c[_0xa6a9('0x2a')]);_0x538fff[_0xa6a9('0x2c')]=_[_0xa6a9('0x2d')](_0x538fff[_0xa6a9('0x29')],_0x538fff[_0xa6a9('0x2a')]);_0x49e005[_0xa6a9('0x2e')]=_['intersection'](_0x538fff[_0xa6a9('0x29')],qs[_0xa6a9('0x2f')](_0x9f373c[_0xa6a9('0x2a')][_0xa6a9('0x2f')]));_0x49e005[_0xa6a9('0x2e')]=_0x49e005[_0xa6a9('0x2e')]['length']?_0x49e005[_0xa6a9('0x2e')]:_0x538fff[_0xa6a9('0x29')];_0x49e005['order']=qs['sort'](_0x9f373c[_0xa6a9('0x2a')][_0xa6a9('0x32')]);_0x49e005['where']=qs[_0xa6a9('0x2c')](_[_0xa6a9('0x48')](_0x9f373c[_0xa6a9('0x2a')],_0x538fff[_0xa6a9('0x2c')]));if(_0x9f373c['query'][_0xa6a9('0x34')]){_0x49e005[_0xa6a9('0x33')]=_[_0xa6a9('0x37')](_0x49e005['where'],{'$or':_[_0xa6a9('0x25')](_0x49e005['attributes'],function(_0x562eda){var _0x4233cf={};_0x4233cf[_0x562eda]={'$like':'%'+_0x9f373c[_0xa6a9('0x2a')][_0xa6a9('0x34')]+'%'};return _0x4233cf;})});}_0x49e005=_['merge']({},_0x49e005,_0x9f373c[_0xa6a9('0x38')]);return _0x4875c6[_0xa6a9('0x49')](_0x49e005);}})[_0xa6a9('0x21')](function(_0x4bb273){if(_0x4bb273){_0x30a9b4=_0x4bb273['length'];if(!_0x9f373c[_0xa6a9('0x2a')][_0xa6a9('0x30')]('nolimit')){_0x49e005[_0xa6a9('0x1a')]=qs[_0xa6a9('0x1a')](_0x9f373c[_0xa6a9('0x2a')][_0xa6a9('0x1a')]);_0x49e005[_0xa6a9('0x1c')]=qs['offset'](_0x9f373c[_0xa6a9('0x2a')]['offset']);}return _0x4875c6[_0xa6a9('0x49')](_0x49e005);}})['then'](function(_0x1a5635){if(_0x1a5635){return _0x1a5635?{'count':_0x30a9b4,'rows':_0x1a5635}:null;}})['then'](respondWithResult(_0x51c8b2,null))[_0xa6a9('0x3c')](handleError(_0x51c8b2,null));};exports[_0xa6a9('0x4a')]=function(_0xb65e7d,_0x7d0ecd,_0x3f6cee){var _0x5e135f={};var _0x5a248d={};var _0x19df26;var _0xd4a390;return db[_0xa6a9('0x26')]['findOne']({'where':{'id':_0xb65e7d[_0xa6a9('0x3e')]['id']}})[_0xa6a9('0x21')](handleEntityNotFound(_0x7d0ecd,null))[_0xa6a9('0x21')](function(_0x4405d4){if(_0x4405d4){_0x19df26=_0x4405d4;_0x5a248d['model']=_[_0xa6a9('0x2b')](db['FreshsalesField'][_0xa6a9('0x27')]);_0x5a248d['query']=_[_0xa6a9('0x2b')](_0xb65e7d[_0xa6a9('0x2a')]);_0x5a248d[_0xa6a9('0x2c')]=_['intersection'](_0x5a248d[_0xa6a9('0x29')],_0x5a248d[_0xa6a9('0x2a')]);_0x5e135f['attributes']=_[_0xa6a9('0x2d')](_0x5a248d['model'],qs[_0xa6a9('0x2f')](_0xb65e7d[_0xa6a9('0x2a')][_0xa6a9('0x2f')]));_0x5e135f['attributes']=_0x5e135f[_0xa6a9('0x2e')]['length']?_0x5e135f[_0xa6a9('0x2e')]:_0x5a248d['model'];_0x5e135f[_0xa6a9('0x4b')]=qs[_0xa6a9('0x32')](_0xb65e7d[_0xa6a9('0x2a')]['sort']);_0x5e135f[_0xa6a9('0x33')]=qs[_0xa6a9('0x2c')](_[_0xa6a9('0x48')](_0xb65e7d[_0xa6a9('0x2a')],_0x5a248d['filters']));if(_0xb65e7d[_0xa6a9('0x2a')][_0xa6a9('0x34')]){_0x5e135f[_0xa6a9('0x33')]=_[_0xa6a9('0x37')](_0x5e135f[_0xa6a9('0x33')],{'$or':_['map'](_0x5e135f['attributes'],function(_0x258db3){var _0x3bb862={};_0x3bb862[_0x258db3]={'$like':'%'+_0xb65e7d[_0xa6a9('0x2a')][_0xa6a9('0x34')]+'%'};return _0x3bb862;})});}_0x5e135f=_['merge']({},_0x5e135f,_0xb65e7d[_0xa6a9('0x38')]);return _0x19df26['getFields'](_0x5e135f);}})[_0xa6a9('0x21')](function(_0x2ae6ef){if(_0x2ae6ef){_0xd4a390=_0x2ae6ef[_0xa6a9('0x47')];if(!_0xb65e7d[_0xa6a9('0x2a')][_0xa6a9('0x30')](_0xa6a9('0x31'))){_0x5e135f['limit']=qs[_0xa6a9('0x1a')](_0xb65e7d[_0xa6a9('0x2a')]['limit']);_0x5e135f[_0xa6a9('0x1c')]=qs[_0xa6a9('0x1c')](_0xb65e7d[_0xa6a9('0x2a')]['offset']);}return _0x19df26[_0xa6a9('0x4a')](_0x5e135f);}})[_0xa6a9('0x21')](function(_0x564791){if(_0x564791){return _0x564791?{'count':_0xd4a390,'rows':_0x564791}:null;}})[_0xa6a9('0x21')](respondWithResult(_0x7d0ecd,null))[_0xa6a9('0x3c')](handleError(_0x7d0ecd,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 82e229b..c9bb21e 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 _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 +var _0x5151=['request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','int_freshsales_configurations','lodash','../../config/logger','moment','bluebird'];(function(_0x15f19f,_0xd9027a){var _0x2ed294=function(_0x2e0b6c){while(--_0x2e0b6c){_0x15f19f['push'](_0x15f19f['shift']());}};_0x2ed294(++_0xd9027a);}(_0x5151,0x1b8));var _0x1515=function(_0x3f86e1,_0x54058b){_0x3f86e1=_0x3f86e1-0x0;var _0x374229=_0x5151[_0x3f86e1];return _0x374229;};'use strict';var _=require(_0x1515('0x0'));var util=require('util');var logger=require(_0x1515('0x1'))('api');var moment=require(_0x1515('0x2'));var BPromise=require(_0x1515('0x3'));var rp=require(_0x1515('0x4'));var fs=require('fs');var path=require(_0x1515('0x5'));var rimraf=require(_0x1515('0x6'));var config=require(_0x1515('0x7'));var attributes=require(_0x1515('0x8'));module[_0x1515('0x9')]=function(_0x45e1a7,_0x4e09ea){return _0x45e1a7[_0x1515('0xa')]('FreshsalesConfiguration',attributes,{'tableName':_0x1515('0xb'),'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 e377a80..172d25b 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 _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 +var _0x10d6=['request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x190725,_0x4c879f){var _0x4fe2de=function(_0x1d7d72){while(--_0x1d7d72){_0x190725['push'](_0x190725['shift']());}};_0x4fe2de(++_0x4c879f);}(_0x10d6,0x109));var _0x610d=function(_0x276215,_0x38e321){_0x276215=_0x276215-0x0;var _0x51b13b=_0x10d6[_0x276215];return _0x51b13b;};'use strict';var _=require(_0x610d('0x0'));var util=require(_0x610d('0x1'));var moment=require('moment');var BPromise=require(_0x610d('0x2'));var rs=require(_0x610d('0x3'));var fs=require('fs');var Redis=require(_0x610d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x610d('0x5'));var logger=require(_0x610d('0x6'))(_0x610d('0x7'));var config=require(_0x610d('0x8'));var jayson=require(_0x610d('0x9'));var client=jayson[_0x610d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3da5c3,_0x4397af,_0x3a3f28){return new BPromise(function(_0x17fd1c,_0x15bc3c){return client[_0x610d('0xb')](_0x3da5c3,_0x3a3f28)[_0x610d('0xc')](function(_0xa37f02){logger['info'](_0x610d('0xd'),_0x4397af,_0x610d('0xe'));logger[_0x610d('0xf')](_0x610d('0x10'),_0x4397af,_0x610d('0xe'),JSON[_0x610d('0x11')](_0xa37f02));if(_0xa37f02['error']){if(_0xa37f02['error'][_0x610d('0x12')]===0x1f4){logger[_0x610d('0x13')](_0x610d('0xd'),_0x4397af,_0xa37f02[_0x610d('0x13')][_0x610d('0x14')]);return _0x15bc3c(_0xa37f02['error'][_0x610d('0x14')]);}logger[_0x610d('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4397af,_0xa37f02[_0x610d('0x13')][_0x610d('0x14')]);return _0x17fd1c(_0xa37f02[_0x610d('0x13')][_0x610d('0x14')]);}else{logger['info'](_0x610d('0xd'),_0x4397af,_0x610d('0xe'));_0x17fd1c(_0xa37f02[_0x610d('0x15')]['message']);}})[_0x610d('0x16')](function(_0x5c5c86){logger[_0x610d('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4397af,_0x5c5c86);_0x15bc3c(_0x5c5c86);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index ec358c7..3436fce 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 _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 +var _0x867f=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x62726d,_0x287c60){var _0x16513d=function(_0x5b56fb){while(--_0x5b56fb){_0x62726d['push'](_0x62726d['shift']());}};_0x16513d(++_0x287c60);}(_0x867f,0xe6));var _0xf867=function(_0x4fcbbe,_0x55a068){_0x4fcbbe=_0x4fcbbe-0x0;var _0x2ac729=_0x867f[_0x4fcbbe];return _0x2ac729;};'use strict';var multer=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var path=require(_0xf867('0x2'));var timeout=require(_0xf867('0x3'));var express=require(_0xf867('0x4'));var router=express[_0xf867('0x5')]();var fs_extra=require(_0xf867('0x6'));var auth=require(_0xf867('0x7'));var interaction=require(_0xf867('0x8'));var config=require('../../config/environment');var controller=require('./intFreshsalesField.controller');router[_0xf867('0x9')]('/',auth[_0xf867('0xa')](),controller[_0xf867('0xb')]);router[_0xf867('0x9')](_0xf867('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf867('0xd')]('/',auth['isAuthenticated'](),controller[_0xf867('0xe')]);router[_0xf867('0xf')](_0xf867('0xc'),auth[_0xf867('0xa')](),controller[_0xf867('0x10')]);router[_0xf867('0x11')](_0xf867('0xc'),auth[_0xf867('0xa')](),controller['destroy']);module[_0xf867('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index b05038b..f2823d4 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 _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 +var _0x0e5c=['string','variable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x229ec7,_0x545b80){var _0x2dc48e=function(_0x4b4c16){while(--_0x4b4c16){_0x229ec7['push'](_0x229ec7['shift']());}};_0x2dc48e(++_0x545b80);}(_0x0e5c,0xde));var _0xc0e5=function(_0x164760,_0x5874b0){_0x164760=_0x164760-0x0;var _0x8b91b2=_0x0e5c[_0x164760];return _0x8b91b2;};'use strict';var Sequelize=require(_0xc0e5('0x0'));module[_0xc0e5('0x1')]={'type':{'type':Sequelize[_0xc0e5('0x2')](_0xc0e5('0x3'),_0xc0e5('0x4'),'customVariable',_0xc0e5('0x5'),_0xc0e5('0x6')),'defaultValue':_0xc0e5('0x3')},'content':{'type':Sequelize[_0xc0e5('0x7')]},'key':{'type':Sequelize[_0xc0e5('0x7')]},'keyType':{'type':Sequelize[_0xc0e5('0x2')](_0xc0e5('0x3'),_0xc0e5('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xc0e5('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc0e5('0x7')]},'customField':{'type':Sequelize[_0xc0e5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc0e5('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 1876867..3ec8df3 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 _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 +var _0x850d=['../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','FreshsalesField','findAll','rows','catch','show','params','options','create','body','find','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x699d95,_0xcb4fa0){var _0x29ab27=function(_0x36497e){while(--_0x36497e){_0x699d95['push'](_0x699d95['shift']());}};_0x29ab27(++_0xcb4fa0);}(_0x850d,0x1e3));var _0xd850=function(_0xd307d9,_0x50e8e0){_0xd307d9=_0xd307d9-0x0;var _0x209bf8=_0x850d[_0xd307d9];return _0x209bf8;};'use strict';var emlformat=require(_0xd850('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd850('0x1'));var rp=require(_0xd850('0x2'));var moment=require(_0xd850('0x3'));var BPromise=require(_0xd850('0x4'));var Mustache=require(_0xd850('0x5'));var util=require(_0xd850('0x6'));var path=require(_0xd850('0x7'));var sox=require(_0xd850('0x8'));var csv=require(_0xd850('0x9'));var ejs=require(_0xd850('0xa'));var fs=require('fs');var fs_extra=require(_0xd850('0xb'));var _=require('lodash');var squel=require(_0xd850('0xc'));var crypto=require(_0xd850('0xd'));var jsforce=require(_0xd850('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd850('0x9'));var querystring=require(_0xd850('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd850('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd850('0x11'))(_0xd850('0x12'));var utils=require(_0xd850('0x13'));var config=require(_0xd850('0x14'));var licenseUtil=require(_0xd850('0x15'));var db=require(_0xd850('0x16'))['db'];function respondWithStatusCode(_0x25e099,_0x34c6e4){_0x34c6e4=_0x34c6e4||0xcc;return function(_0xb19ddf){if(_0xb19ddf){return _0x25e099['sendStatus'](_0x34c6e4);}return _0x25e099[_0xd850('0x17')](_0x34c6e4)[_0xd850('0x18')]();};}function respondWithResult(_0x5de252,_0x59eca5){_0x59eca5=_0x59eca5||0xc8;return function(_0xc5d4d7){if(_0xc5d4d7){return _0x5de252[_0xd850('0x17')](_0x59eca5)[_0xd850('0x19')](_0xc5d4d7);}};}function respondWithFilteredResult(_0x29ec1f,_0x4dde44){return function(_0x14bcad){if(_0x14bcad){var _0x1f5f85=typeof _0x4dde44[_0xd850('0x1a')]===_0xd850('0x1b')&&typeof _0x4dde44[_0xd850('0x1c')]===_0xd850('0x1b');var _0x24cf31=_0x14bcad['count'];var _0x1cb83d=_0x1f5f85?0x0:_0x4dde44[_0xd850('0x1a')];var _0x145399=_0x1f5f85?_0x14bcad[_0xd850('0x1d')]:_0x4dde44[_0xd850('0x1a')]+_0x4dde44[_0xd850('0x1c')];var _0x3c8902;if(_0x145399>=_0x24cf31){_0x145399=_0x24cf31;_0x3c8902=0xc8;}else{_0x3c8902=0xce;}_0x29ec1f[_0xd850('0x17')](_0x3c8902);return _0x29ec1f[_0xd850('0x1e')](_0xd850('0x1f'),_0x1cb83d+'-'+_0x145399+'/'+_0x24cf31)[_0xd850('0x19')](_0x14bcad);}return null;};}function patchUpdates(_0x18c402){return function(_0x34f751){try{jsonpatch[_0xd850('0x20')](_0x34f751,_0x18c402,!![]);}catch(_0x516830){return BPromise[_0xd850('0x21')](_0x516830);}return _0x34f751['save']();};}function saveUpdates(_0x3af5db,_0x4efcf5){return function(_0x69de17){if(_0x69de17){return _0x69de17['update'](_0x3af5db)[_0xd850('0x22')](function(_0x5f2393){return _0x5f2393;});}return null;};}function removeEntity(_0x521143,_0x38ee45){return function(_0x58e1a9){if(_0x58e1a9){return _0x58e1a9[_0xd850('0x23')]()[_0xd850('0x22')](function(){_0x521143[_0xd850('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x768e54,_0x35a857){return function(_0x132187){if(!_0x132187){_0x768e54[_0xd850('0x24')](0x194);}return _0x132187;};}function handleError(_0xa0048f,_0x599f00){_0x599f00=_0x599f00||0x1f4;return function(_0x251d98){logger['error'](_0x251d98[_0xd850('0x25')]);if(_0x251d98[_0xd850('0x26')]){delete _0x251d98[_0xd850('0x26')];}_0xa0048f['status'](_0x599f00)[_0xd850('0x27')](_0x251d98);};}exports['index']=function(_0x57f685,_0x2eddd1){var _0x25bd68={},_0xee3914={},_0x4e0e9f={'count':0x0,'rows':[]};var _0x4d31bc=_[_0xd850('0x28')](db['FreshsalesField'][_0xd850('0x29')],function(_0x1ff843){return{'name':_0x1ff843[_0xd850('0x2a')],'type':_0x1ff843[_0xd850('0x2b')]['key']};});_0xee3914[_0xd850('0x2c')]=_[_0xd850('0x28')](_0x4d31bc,_0xd850('0x26'));_0xee3914[_0xd850('0x2d')]=_[_0xd850('0x2e')](_0x57f685[_0xd850('0x2d')]);_0xee3914[_0xd850('0x2f')]=_[_0xd850('0x30')](_0xee3914[_0xd850('0x2c')],_0xee3914[_0xd850('0x2d')]);_0x25bd68[_0xd850('0x31')]=_[_0xd850('0x30')](_0xee3914[_0xd850('0x2c')],qs[_0xd850('0x32')](_0x57f685[_0xd850('0x2d')][_0xd850('0x32')]));_0x25bd68[_0xd850('0x31')]=_0x25bd68['attributes'][_0xd850('0x33')]?_0x25bd68['attributes']:_0xee3914[_0xd850('0x2c')];if(!_0x57f685['query'][_0xd850('0x34')](_0xd850('0x35'))){_0x25bd68['limit']=qs['limit'](_0x57f685[_0xd850('0x2d')][_0xd850('0x1c')]);_0x25bd68[_0xd850('0x1a')]=qs[_0xd850('0x1a')](_0x57f685['query']['offset']);}_0x25bd68[_0xd850('0x36')]=qs[_0xd850('0x37')](_0x57f685[_0xd850('0x2d')][_0xd850('0x37')]);_0x25bd68['where']=qs[_0xd850('0x2f')](_[_0xd850('0x38')](_0x57f685[_0xd850('0x2d')],_0xee3914['filters']),_0x4d31bc);if(_0x57f685[_0xd850('0x2d')][_0xd850('0x39')]){_0x25bd68[_0xd850('0x3a')]=_[_0xd850('0x3b')](_0x25bd68[_0xd850('0x3a')],{'$or':_[_0xd850('0x28')](_0x4d31bc,function(_0x38f538){if(_0x38f538[_0xd850('0x2b')]!=='VIRTUAL'){var _0x42e4b9={};_0x42e4b9[_0x38f538['name']]={'$like':'%'+_0x57f685[_0xd850('0x2d')][_0xd850('0x39')]+'%'};return _0x42e4b9;}})});}_0x25bd68=_[_0xd850('0x3b')]({},_0x25bd68,_0x57f685['options']);var _0x3503ea={'where':_0x25bd68[_0xd850('0x3a')]};return db['FreshsalesField'][_0xd850('0x1d')](_0x3503ea)[_0xd850('0x22')](function(_0x512346){_0x4e0e9f[_0xd850('0x1d')]=_0x512346;if(_0x57f685[_0xd850('0x2d')][_0xd850('0x3c')]){_0x25bd68[_0xd850('0x3d')]=[{'all':!![]}];}return db[_0xd850('0x3e')][_0xd850('0x3f')](_0x25bd68);})[_0xd850('0x22')](function(_0x485ae4){_0x4e0e9f[_0xd850('0x40')]=_0x485ae4;return _0x4e0e9f;})[_0xd850('0x22')](respondWithFilteredResult(_0x2eddd1,_0x25bd68))[_0xd850('0x41')](handleError(_0x2eddd1,null));};exports[_0xd850('0x42')]=function(_0x36b4f7,_0x2c6dd0){var _0x347aa5={'raw':!![],'where':{'id':_0x36b4f7[_0xd850('0x43')]['id']}},_0x5f1522={};_0x5f1522[_0xd850('0x2c')]=_[_0xd850('0x2e')](db[_0xd850('0x3e')][_0xd850('0x29')]);_0x5f1522[_0xd850('0x2d')]=_['keys'](_0x36b4f7[_0xd850('0x2d')]);_0x5f1522[_0xd850('0x2f')]=_[_0xd850('0x30')](_0x5f1522[_0xd850('0x2c')],_0x5f1522[_0xd850('0x2d')]);_0x347aa5[_0xd850('0x31')]=_[_0xd850('0x30')](_0x5f1522[_0xd850('0x2c')],qs[_0xd850('0x32')](_0x36b4f7[_0xd850('0x2d')][_0xd850('0x32')]));_0x347aa5[_0xd850('0x31')]=_0x347aa5[_0xd850('0x31')][_0xd850('0x33')]?_0x347aa5[_0xd850('0x31')]:_0x5f1522['model'];if(_0x36b4f7['query'][_0xd850('0x3c')]){_0x347aa5['include']=[{'all':!![]}];}_0x347aa5=_[_0xd850('0x3b')]({},_0x347aa5,_0x36b4f7[_0xd850('0x44')]);return db[_0xd850('0x3e')]['find'](_0x347aa5)[_0xd850('0x22')](handleEntityNotFound(_0x2c6dd0,null))['then'](respondWithResult(_0x2c6dd0,null))['catch'](handleError(_0x2c6dd0,null));};exports[_0xd850('0x45')]=function(_0x15c707,_0x18e2d9){return db['FreshsalesField'][_0xd850('0x45')](_0x15c707[_0xd850('0x46')],{})[_0xd850('0x22')](respondWithResult(_0x18e2d9,0xc9))[_0xd850('0x41')](handleError(_0x18e2d9,null));};exports['update']=function(_0x4a3253,_0x1efa46){if(_0x4a3253[_0xd850('0x46')]['id']){delete _0x4a3253['body']['id'];}return db[_0xd850('0x3e')][_0xd850('0x47')]({'where':{'id':_0x4a3253[_0xd850('0x43')]['id']}})[_0xd850('0x22')](handleEntityNotFound(_0x1efa46,null))['then'](saveUpdates(_0x4a3253[_0xd850('0x46')],null))['then'](respondWithResult(_0x1efa46,null))['catch'](handleError(_0x1efa46,null));};exports[_0xd850('0x23')]=function(_0xfdd782,_0x1ad803){return db['FreshsalesField']['find']({'where':{'id':_0xfdd782['params']['id']}})[_0xd850('0x22')](handleEntityNotFound(_0x1ad803,null))[_0xd850('0x22')](removeEntity(_0x1ad803,null))[_0xd850('0x41')](handleError(_0x1ad803,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 1d114f7..1849d83 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 _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 +var _0x7d25=['request-promise','path','define','FreshsalesField','int_freshsales_fields','FieldId','util','../../config/logger','api','moment','bluebird'];(function(_0x1012ab,_0xfb2018){var _0x4ebbe3=function(_0x32cb49){while(--_0x32cb49){_0x1012ab['push'](_0x1012ab['shift']());}};_0x4ebbe3(++_0xfb2018);}(_0x7d25,0x8a));var _0x57d2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x7d25[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var logger=require(_0x57d2('0x1'))(_0x57d2('0x2'));var moment=require(_0x57d2('0x3'));var BPromise=require(_0x57d2('0x4'));var rp=require(_0x57d2('0x5'));var fs=require('fs');var path=require(_0x57d2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x3c5511,_0x49cc5f){return _0x3c5511[_0x57d2('0x7')](_0x57d2('0x8'),attributes,{'tableName':_0x57d2('0x9'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':['idField',_0x57d2('0xa')],'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 780e491..e5c4ab9 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 _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 +var _0xc1c6=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch'];(function(_0x302496,_0x32e579){var _0x53059d=function(_0x263ab9){while(--_0x263ab9){_0x302496['push'](_0x302496['shift']());}};_0x53059d(++_0x32e579);}(_0xc1c6,0xf7));var _0x6c1c=function(_0xebff8b,_0x3192fd){_0xebff8b=_0xebff8b-0x0;var _0x29f43a=_0xc1c6[_0xebff8b];return _0x29f43a;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x582bec,_0xe510ca,_0x2eb1ba){return new BPromise(function(_0x38369d,_0x2cec58){return client['request'](_0x582bec,_0x2eb1ba)[_0x6c1c('0x9')](function(_0x3ca985){logger['info'](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));logger[_0x6c1c('0xc')](_0x6c1c('0xd'),_0xe510ca,'request\x20sent',JSON[_0x6c1c('0xe')](_0x3ca985));if(_0x3ca985[_0x6c1c('0xf')]){if(_0x3ca985[_0x6c1c('0xf')]['code']===0x1f4){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')]['message']);return _0x2cec58(_0x3ca985[_0x6c1c('0xf')]['message']);}logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);return _0x38369d(_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);}else{logger[_0x6c1c('0x11')](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));_0x38369d(_0x3ca985['result'][_0x6c1c('0x10')]);}})[_0x6c1c('0x12')](function(_0x5214ee){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x5214ee);_0x2cec58(_0x5214ee);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 78c3640..66ed720 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_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 +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(_0x15d2c2,_0x14b62d){var _0x108303=function(_0xbc7458){while(--_0xbc7458){_0x15d2c2['push'](_0x15d2c2['shift']());}};_0x108303(++_0x14b62d);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index aed122a..5c3fc6b 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 _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 +var _0x77e6=['ENUM','newTab','sequelize','exports','STRING','username'];(function(_0x315aa3,_0x245fce){var _0xa902ac=function(_0x23cac9){while(--_0x23cac9){_0x315aa3['push'](_0x315aa3['shift']());}};_0xa902ac(++_0x245fce);}(_0x77e6,0x1a6));var _0x677e=function(_0x413c6d,_0x2386c4){_0x413c6d=_0x413c6d-0x0;var _0x30ff52=_0x77e6[_0x413c6d];return _0x30ff52;};'use strict';var Sequelize=require(_0x677e('0x0'));module[_0x677e('0x1')]={'name':{'type':Sequelize[_0x677e('0x2')]},'description':{'type':Sequelize[_0x677e('0x2')]},'username':{'type':Sequelize[_0x677e('0x2')],'unique':_0x677e('0x3')},'remoteUri':{'type':Sequelize[_0x677e('0x2')]},'password':{'type':Sequelize[_0x677e('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x677e('0x2')]},'securityToken':{'type':Sequelize[_0x677e('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x677e('0x4')]('integrationTab',_0x677e('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 0297642..fa47ddd 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 _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 +var _0xf3a5=['sort','AccountId','Subjects','channel','getDescriptions','SalesforceField','Descriptions','Task','remoteUri','clientSecret','securityToken','slice','Connection','clientId','login','password','concat','isNil','ticketType','sobject','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','picklist','textarea','phone','remove','includes','custom','picklistValues','label','value','boolean','True','False','false','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','end','error','send','index','SalesforceAccount','fieldName','type','key','model','map','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','create','body','catch','getConfigurations','findOne','SalesforceConfiguration','order'];(function(_0x1fae19,_0x222b47){var _0x5086ab=function(_0x5a2d67){while(--_0x5a2d67){_0x1fae19['push'](_0x1fae19['shift']());}};_0x5086ab(++_0x222b47);}(_0xf3a5,0xac));var _0x5f3a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3a5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5f3a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f3a('0x1'));var jsonpatch=require(_0x5f3a('0x2'));var rp=require(_0x5f3a('0x3'));var moment=require(_0x5f3a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5f3a('0x5'));var util=require(_0x5f3a('0x6'));var path=require(_0x5f3a('0x7'));var sox=require(_0x5f3a('0x8'));var csv=require(_0x5f3a('0x9'));var ejs=require(_0x5f3a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f3a('0xb'));var squel=require(_0x5f3a('0xc'));var crypto=require(_0x5f3a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5f3a('0xe'));var toCsv=require(_0x5f3a('0x9'));var querystring=require(_0x5f3a('0xf'));var Papa=require(_0x5f3a('0x10'));var Redis=require(_0x5f3a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5f3a('0x12'));var as=require(_0x5f3a('0x13'));var hardwareService=require(_0x5f3a('0x14'));var logger=require(_0x5f3a('0x15'))(_0x5f3a('0x16'));var utils=require(_0x5f3a('0x17'));var config=require(_0x5f3a('0x18'));var licenseUtil=require(_0x5f3a('0x19'));var db=require(_0x5f3a('0x1a'))['db'];var integrations=require(_0x5f3a('0x1b'));function respondWithStatusCode(_0xfa9eab,_0x57eefa){_0x57eefa=_0x57eefa||0xcc;return function(_0x3f00c7){if(_0x3f00c7){return _0xfa9eab[_0x5f3a('0x1c')](_0x57eefa);}return _0xfa9eab[_0x5f3a('0x1d')](_0x57eefa)['end']();};}function respondWithResult(_0x1bc422,_0x51cd16){_0x51cd16=_0x51cd16||0xc8;return function(_0x3b81b7){if(_0x3b81b7){return _0x1bc422['status'](_0x51cd16)[_0x5f3a('0x1e')](_0x3b81b7);}};}function respondWithFilteredResult(_0x41ae6c,_0x2cc2b8){return function(_0x1ecb66){if(_0x1ecb66){var _0x42d021=typeof _0x2cc2b8[_0x5f3a('0x1f')]===_0x5f3a('0x20')&&typeof _0x2cc2b8[_0x5f3a('0x21')]===_0x5f3a('0x20');var _0x5007f4=_0x1ecb66[_0x5f3a('0x22')];var _0x30083e=_0x42d021?0x0:_0x2cc2b8[_0x5f3a('0x1f')];var _0x2cf8ef=_0x42d021?_0x1ecb66[_0x5f3a('0x22')]:_0x2cc2b8[_0x5f3a('0x1f')]+_0x2cc2b8[_0x5f3a('0x21')];var _0x3ff6f6;if(_0x2cf8ef>=_0x5007f4){_0x2cf8ef=_0x5007f4;_0x3ff6f6=0xc8;}else{_0x3ff6f6=0xce;}_0x41ae6c[_0x5f3a('0x1d')](_0x3ff6f6);return _0x41ae6c[_0x5f3a('0x23')](_0x5f3a('0x24'),_0x30083e+'-'+_0x2cf8ef+'/'+_0x5007f4)['json'](_0x1ecb66);}return null;};}function patchUpdates(_0x2ad5a6){return function(_0x25213f){try{jsonpatch[_0x5f3a('0x25')](_0x25213f,_0x2ad5a6,!![]);}catch(_0x1478cc){return BPromise['reject'](_0x1478cc);}return _0x25213f['save']();};}function saveUpdates(_0x5e7cb6,_0x30b89a){return function(_0x4eb37b){if(_0x4eb37b){return _0x4eb37b[_0x5f3a('0x26')](_0x5e7cb6)['then'](function(_0x428b44){return _0x428b44;});}return null;};}function removeEntity(_0x525bfa,_0x598f1a){return function(_0x47911d){if(_0x47911d){return _0x47911d[_0x5f3a('0x27')]()[_0x5f3a('0x28')](function(){_0x525bfa[_0x5f3a('0x1d')](0xcc)[_0x5f3a('0x29')]();});}};}function handleEntityNotFound(_0x4842cf,_0x516f10){return function(_0x49e430){if(!_0x49e430){_0x4842cf[_0x5f3a('0x1c')](0x194);}return _0x49e430;};}function handleError(_0xf35b1a,_0x1c18ab){_0x1c18ab=_0x1c18ab||0x1f4;return function(_0x28902d){logger[_0x5f3a('0x2a')](_0x28902d['stack']);if(_0x28902d['name']){delete _0x28902d['name'];}_0xf35b1a[_0x5f3a('0x1d')](_0x1c18ab)[_0x5f3a('0x2b')](_0x28902d);};}exports[_0x5f3a('0x2c')]=function(_0x328659,_0x38e636){var _0x42e358={},_0x263fa9={},_0x8404b1={'count':0x0,'rows':[]};var _0x12fe76=_['map'](db[_0x5f3a('0x2d')]['rawAttributes'],function(_0x44fe43){return{'name':_0x44fe43[_0x5f3a('0x2e')],'type':_0x44fe43[_0x5f3a('0x2f')][_0x5f3a('0x30')]};});_0x263fa9[_0x5f3a('0x31')]=_[_0x5f3a('0x32')](_0x12fe76,_0x5f3a('0x33'));_0x263fa9['query']=_['keys'](_0x328659[_0x5f3a('0x34')]);_0x263fa9[_0x5f3a('0x35')]=_[_0x5f3a('0x36')](_0x263fa9[_0x5f3a('0x31')],_0x263fa9['query']);_0x42e358[_0x5f3a('0x37')]=_['intersection'](_0x263fa9[_0x5f3a('0x31')],qs[_0x5f3a('0x38')](_0x328659[_0x5f3a('0x34')][_0x5f3a('0x38')]));_0x42e358[_0x5f3a('0x37')]=_0x42e358[_0x5f3a('0x37')][_0x5f3a('0x39')]?_0x42e358[_0x5f3a('0x37')]:_0x263fa9[_0x5f3a('0x31')];if(!_0x328659[_0x5f3a('0x34')][_0x5f3a('0x3a')](_0x5f3a('0x3b'))){_0x42e358[_0x5f3a('0x21')]=qs[_0x5f3a('0x21')](_0x328659[_0x5f3a('0x34')]['limit']);_0x42e358[_0x5f3a('0x1f')]=qs['offset'](_0x328659[_0x5f3a('0x34')][_0x5f3a('0x1f')]);}_0x42e358['order']=qs['sort'](_0x328659[_0x5f3a('0x34')]['sort']);_0x42e358[_0x5f3a('0x3c')]=qs['filters'](_[_0x5f3a('0x3d')](_0x328659[_0x5f3a('0x34')],_0x263fa9['filters']),_0x12fe76);if(_0x328659[_0x5f3a('0x34')][_0x5f3a('0x3e')]){_0x42e358[_0x5f3a('0x3c')]=_[_0x5f3a('0x3f')](_0x42e358['where'],{'$or':_['map'](_0x12fe76,function(_0x1302bc){if(_0x1302bc[_0x5f3a('0x2f')]!==_0x5f3a('0x40')){var _0x50219b={};_0x50219b[_0x1302bc['name']]={'$like':'%'+_0x328659[_0x5f3a('0x34')][_0x5f3a('0x3e')]+'%'};return _0x50219b;}})});}_0x42e358=_[_0x5f3a('0x3f')]({},_0x42e358,_0x328659[_0x5f3a('0x41')]);var _0x487592={'where':_0x42e358['where']};return db['SalesforceAccount'][_0x5f3a('0x22')](_0x487592)[_0x5f3a('0x28')](function(_0x5ce5ab){_0x8404b1['count']=_0x5ce5ab;if(_0x328659[_0x5f3a('0x34')][_0x5f3a('0x42')]){_0x42e358[_0x5f3a('0x43')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x5f3a('0x44')](_0x42e358);})[_0x5f3a('0x28')](function(_0x27f6a7){_0x8404b1[_0x5f3a('0x45')]=_0x27f6a7;return _0x8404b1;})[_0x5f3a('0x28')](respondWithFilteredResult(_0x38e636,_0x42e358))['catch'](handleError(_0x38e636,null));};exports[_0x5f3a('0x46')]=function(_0x60bb16,_0x313c6c){var _0x9f13bc={'raw':![],'where':{'id':_0x60bb16[_0x5f3a('0x47')]['id']}},_0xcfca0a={};_0xcfca0a[_0x5f3a('0x31')]=_[_0x5f3a('0x48')](db[_0x5f3a('0x2d')][_0x5f3a('0x49')]);_0xcfca0a[_0x5f3a('0x34')]=_[_0x5f3a('0x48')](_0x60bb16[_0x5f3a('0x34')]);_0xcfca0a['filters']=_['intersection'](_0xcfca0a[_0x5f3a('0x31')],_0xcfca0a[_0x5f3a('0x34')]);_0x9f13bc['attributes']=_[_0x5f3a('0x36')](_0xcfca0a[_0x5f3a('0x31')],qs[_0x5f3a('0x38')](_0x60bb16['query'][_0x5f3a('0x38')]));_0x9f13bc[_0x5f3a('0x37')]=_0x9f13bc[_0x5f3a('0x37')][_0x5f3a('0x39')]?_0x9f13bc['attributes']:_0xcfca0a[_0x5f3a('0x31')];if(_0x60bb16[_0x5f3a('0x34')][_0x5f3a('0x42')]){_0x9f13bc[_0x5f3a('0x43')]=[{'all':!![]}];}_0x9f13bc=_[_0x5f3a('0x3f')]({},_0x9f13bc,_0x60bb16[_0x5f3a('0x41')]);return db['SalesforceAccount'][_0x5f3a('0x4a')](_0x9f13bc)['then'](handleEntityNotFound(_0x313c6c,null))[_0x5f3a('0x28')](respondWithResult(_0x313c6c,null))['catch'](handleError(_0x313c6c,null));};exports[_0x5f3a('0x4b')]=function(_0x3aa3c0,_0x4d9ad5){return db['SalesforceAccount']['create'](_0x3aa3c0[_0x5f3a('0x4c')],{})[_0x5f3a('0x28')](respondWithResult(_0x4d9ad5,0xc9))[_0x5f3a('0x4d')](handleError(_0x4d9ad5,null));};exports['update']=function(_0x2ff45c,_0x1d0c74){if(_0x2ff45c[_0x5f3a('0x4c')]['id']){delete _0x2ff45c[_0x5f3a('0x4c')]['id'];}return db[_0x5f3a('0x2d')]['find']({'where':{'id':_0x2ff45c[_0x5f3a('0x47')]['id']}})[_0x5f3a('0x28')](handleEntityNotFound(_0x1d0c74,null))[_0x5f3a('0x28')](saveUpdates(_0x2ff45c[_0x5f3a('0x4c')],null))[_0x5f3a('0x28')](respondWithResult(_0x1d0c74,null))[_0x5f3a('0x4d')](handleError(_0x1d0c74,null));};exports['destroy']=function(_0x251f0f,_0x451d3e){return db[_0x5f3a('0x2d')][_0x5f3a('0x4a')]({'where':{'id':_0x251f0f[_0x5f3a('0x47')]['id']}})[_0x5f3a('0x28')](handleEntityNotFound(_0x451d3e,null))[_0x5f3a('0x28')](removeEntity(_0x451d3e,null))[_0x5f3a('0x4d')](handleError(_0x451d3e,null));};exports[_0x5f3a('0x4e')]=function(_0x4421cc,_0xb7e289,_0x515ae6){var _0x4c50f7={};var _0x21df42={};var _0x35ca61;var _0x5f321c;return db[_0x5f3a('0x2d')][_0x5f3a('0x4f')]({'where':{'id':_0x4421cc[_0x5f3a('0x47')]['id']}})['then'](handleEntityNotFound(_0xb7e289,null))[_0x5f3a('0x28')](function(_0x2ed88d){if(_0x2ed88d){_0x35ca61=_0x2ed88d;_0x21df42[_0x5f3a('0x31')]=_[_0x5f3a('0x48')](db[_0x5f3a('0x50')][_0x5f3a('0x49')]);_0x21df42[_0x5f3a('0x34')]=_[_0x5f3a('0x48')](_0x4421cc['query']);_0x21df42[_0x5f3a('0x35')]=_[_0x5f3a('0x36')](_0x21df42[_0x5f3a('0x31')],_0x21df42['query']);_0x4c50f7[_0x5f3a('0x37')]=_[_0x5f3a('0x36')](_0x21df42['model'],qs[_0x5f3a('0x38')](_0x4421cc['query'][_0x5f3a('0x38')]));_0x4c50f7[_0x5f3a('0x37')]=_0x4c50f7[_0x5f3a('0x37')][_0x5f3a('0x39')]?_0x4c50f7[_0x5f3a('0x37')]:_0x21df42[_0x5f3a('0x31')];_0x4c50f7[_0x5f3a('0x51')]=qs[_0x5f3a('0x52')](_0x4421cc[_0x5f3a('0x34')]['sort']);_0x4c50f7[_0x5f3a('0x3c')]=qs[_0x5f3a('0x35')](_[_0x5f3a('0x3d')](_0x4421cc[_0x5f3a('0x34')],_0x21df42[_0x5f3a('0x35')]));if(_0x4421cc[_0x5f3a('0x34')][_0x5f3a('0x3e')]){_0x4c50f7[_0x5f3a('0x3c')]=_[_0x5f3a('0x3f')](_0x4c50f7['where'],{'$or':_[_0x5f3a('0x32')](_0x4c50f7[_0x5f3a('0x37')],function(_0x1e717b){var _0x442f20={};_0x442f20[_0x1e717b]={'$like':'%'+_0x4421cc[_0x5f3a('0x34')][_0x5f3a('0x3e')]+'%'};return _0x442f20;})});}_0x4c50f7=_['merge']({},_0x4c50f7,_0x4421cc[_0x5f3a('0x41')]);return _0x35ca61['getConfigurations'](_0x4c50f7);}})['then'](function(_0x1ebca3){if(_0x1ebca3){_0x5f321c=_0x1ebca3[_0x5f3a('0x39')];if(!_0x4421cc[_0x5f3a('0x34')][_0x5f3a('0x3a')](_0x5f3a('0x3b'))){_0x4c50f7[_0x5f3a('0x21')]=qs['limit'](_0x4421cc[_0x5f3a('0x34')]['limit']);_0x4c50f7[_0x5f3a('0x1f')]=qs['offset'](_0x4421cc[_0x5f3a('0x34')][_0x5f3a('0x1f')]);}return _0x35ca61[_0x5f3a('0x4e')](_0x4c50f7);}})[_0x5f3a('0x28')](function(_0x5c2950){if(_0x5c2950){return _0x5c2950?{'count':_0x5f321c,'rows':_0x5c2950}:null;}})[_0x5f3a('0x28')](respondWithResult(_0xb7e289,null))['catch'](handleError(_0xb7e289,null));};exports['addConfiguration']=function(_0x58a65c,_0x2d0b41,_0x6c7ddd){if(_0x58a65c[_0x5f3a('0x4c')]['id']){delete _0x58a65c[_0x5f3a('0x4c')]['id'];}return db[_0x5f3a('0x2d')][_0x5f3a('0x4f')]({'where':{'id':_0x58a65c['params']['id']}})['then'](handleEntityNotFound(_0x2d0b41,null))[_0x5f3a('0x28')](function(_0xe7e3cf){if(_0xe7e3cf){_0x58a65c[_0x5f3a('0x4c')][_0x5f3a('0x53')]=_0xe7e3cf['id'];_0x58a65c['body'][_0x5f3a('0x54')]=integrations['getSubjects'](_0x58a65c['body'][_0x5f3a('0x55')],_0x58a65c[_0x5f3a('0x4c')][_0x5f3a('0x2f')]);_0x58a65c[_0x5f3a('0x4c')]['Descriptions']=integrations[_0x5f3a('0x56')](_0x58a65c[_0x5f3a('0x4c')]['channel'],_0x58a65c[_0x5f3a('0x4c')][_0x5f3a('0x2f')]);return db['SalesforceConfiguration']['create'](_0x58a65c[_0x5f3a('0x4c')],{'include':[{'model':db[_0x5f3a('0x57')],'as':_0x5f3a('0x54')},{'model':db[_0x5f3a('0x57')],'as':_0x5f3a('0x58')}]});}return null;})['then'](respondWithResult(_0x2d0b41,null))[_0x5f3a('0x4d')](handleError(_0x2d0b41,null));};exports['getFields']=function(_0x581099,_0x30c1dc,_0xcab938){var _0x2e8385;var _0x45447d='';var _0x1cb9e9=_0x5f3a('0x59');return db[_0x5f3a('0x2d')][_0x5f3a('0x4f')]({'where':{'id':_0x581099[_0x5f3a('0x47')]['id']},'attributes':['id',_0x5f3a('0x5a'),'clientId',_0x5f3a('0x5b'),'username','password',_0x5f3a('0x5c')]})[_0x5f3a('0x28')](handleEntityNotFound(_0x30c1dc,null))[_0x5f3a('0x28')](function(_0x2bc496){if(_0x2bc496){_0x45447d=_0x2bc496[_0x5f3a('0x5a')];var _0x1772da=_0x45447d[_0x5f3a('0x5d')](-0x1);if(_0x1772da==='/'){_0x45447d=_0x45447d['substring'](0x0,_0x45447d['lastIndexOf'](_0x1772da));}_0x2e8385=new jsforce[(_0x5f3a('0x5e'))]({'oauth2':{'loginUrl':_0x45447d,'clientId':_0x2bc496[_0x5f3a('0x5f')],'clientSecret':_0x2bc496[_0x5f3a('0x5b')]}});return _0x2e8385[_0x5f3a('0x60')](_0x2bc496['username'],_0x2bc496[_0x5f3a('0x61')][_0x5f3a('0x62')](_0x2bc496[_0x5f3a('0x5c')]));}})['then'](function(_0x5271f5){if(_0x5271f5){if(!_[_0x5f3a('0x63')](_0x581099['query'][_0x5f3a('0x64')])){_0x1cb9e9=_0x581099['query'][_0x5f3a('0x64')];}return _0x2e8385[_0x5f3a('0x65')](_0x1cb9e9)['describe']();}})['then'](function(_0x5974c2){var _0x4d340c=['OwnerId',_0x5f3a('0x66'),_0x5f3a('0x67'),_0x5f3a('0x68'),_0x5f3a('0x69'),_0x5f3a('0x6a')];var _0x59f164=[_0x5f3a('0x6b'),'int',_0x5f3a('0x6c'),'boolean','email',_0x5f3a('0x6d'),_0x5f3a('0x6e')];if(_0x5974c2){_[_0x5f3a('0x6f')](_0x5974c2[_0x5f3a('0x38')],function(_0x10583d){return _0x4d340c[_0x5f3a('0x70')](_0x10583d[_0x5f3a('0x33')])||!_0x59f164[_0x5f3a('0x70')](_0x10583d[_0x5f3a('0x2f')]);});return{'count':_0x5974c2[_0x5f3a('0x38')][_0x5f3a('0x39')],'rows':_[_0x5f3a('0x32')](_0x5974c2['fields'],function(_0x2d139d){return{'id':_0x2d139d['name'],'name':_0x2d139d['label'],'custom':_0x2d139d[_0x5f3a('0x71')],'options':_0x2d139d['picklistValues'][_0x5f3a('0x39')]>0x0?_['map'](_0x2d139d[_0x5f3a('0x72')],function(_0x58f6c2){return{'name':_0x58f6c2[_0x5f3a('0x73')],'value':_0x58f6c2[_0x5f3a('0x74')]};}):_0x2d139d[_0x5f3a('0x2f')]==_0x5f3a('0x75')?[{'name':_0x5f3a('0x76'),'value':'true'},{'name':_0x5f3a('0x77'),'value':_0x5f3a('0x78')}]:[]};})};}})[_0x5f3a('0x28')](respondWithResult(_0x30c1dc,null))[_0x5f3a('0x4d')](function(_0x2c392b){var _0x197def=_0x581099[_0x5f3a('0x34')][_0x5f3a('0x79')]?0x1f4:_0x2c392b['statusCode']||0x1f4;logger[_0x5f3a('0x2a')](_0x5f3a('0x7a'),_0x5f3a('0x7b'),_0x197def,JSON[_0x5f3a('0x7c')](_0x2c392b));delete _0x2c392b[_0x5f3a('0x33')];if(_0x197def===0x191){_0x197def=0x190;}_0x30c1dc['status'](_0x197def)['send'](_0x581099['query'][_0x5f3a('0x79')]?{'message':_0x5f3a('0x7d'),'statusCode':_0x2c392b[_0x5f3a('0x7e')]}:_0x2c392b);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index ba972f0..d0e6b19 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 _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 +var _0x1cc7=['path','rimraf','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','request-promise'];(function(_0x503d8e,_0x2b6af2){var _0x576ef5=function(_0x52b004){while(--_0x52b004){_0x503d8e['push'](_0x503d8e['shift']());}};_0x576ef5(++_0x2b6af2);}(_0x1cc7,0x15a));var _0x71cc=function(_0x3a2213,_0x301b1c){_0x3a2213=_0x3a2213-0x0;var _0xd30e19=_0x1cc7[_0x3a2213];return _0xd30e19;};'use strict';var _=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var logger=require(_0x71cc('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x71cc('0x3'));var fs=require('fs');var path=require(_0x71cc('0x4'));var rimraf=require(_0x71cc('0x5'));var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x71cc('0x6')]=function(_0x4ecf81,_0xc0444e){return _0x4ecf81[_0x71cc('0x7')](_0x71cc('0x8'),attributes,{'tableName':_0x71cc('0x9'),'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 4ef5f25..5d02aea 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 _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 +var _0x733f=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceAccount,\x20%s,\x20%s','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','attributes','limit','include','map','model','ShowSalesforceAccount','where'];(function(_0x49fd58,_0xc0f75f){var _0xe6a45d=function(_0x44fc23){while(--_0x44fc23){_0x49fd58['push'](_0x49fd58['shift']());}};_0xe6a45d(++_0xc0f75f);}(_0x733f,0x120));var _0xf733=function(_0x47a371,_0x892e6a){_0x47a371=_0x47a371-0x0;var _0x50f139=_0x733f[_0x47a371];return _0x50f139;};'use strict';var _=require(_0xf733('0x0'));var util=require('util');var moment=require(_0xf733('0x1'));var BPromise=require(_0xf733('0x2'));var rs=require(_0xf733('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf733('0x4'))['db'];var utils=require(_0xf733('0x5'));var logger=require(_0xf733('0x6'))(_0xf733('0x7'));var config=require(_0xf733('0x8'));var jayson=require(_0xf733('0x9'));var client=jayson[_0xf733('0xa')][_0xf733('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2390fc,_0x5b10a7,_0xba5aba){return new BPromise(function(_0x10abc6,_0x48fb67){return client[_0xf733('0xc')](_0x2390fc,_0xba5aba)[_0xf733('0xd')](function(_0x269e83){logger[_0xf733('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x5b10a7,_0xf733('0xf'));logger[_0xf733('0x10')](_0xf733('0x11'),_0x5b10a7,_0xf733('0xf'),JSON[_0xf733('0x12')](_0x269e83));if(_0x269e83[_0xf733('0x13')]){if(_0x269e83[_0xf733('0x13')]['code']===0x1f4){logger[_0xf733('0x13')](_0xf733('0x14'),_0x5b10a7,_0x269e83[_0xf733('0x13')][_0xf733('0x15')]);return _0x48fb67(_0x269e83['error'][_0xf733('0x15')]);}logger[_0xf733('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x5b10a7,_0x269e83[_0xf733('0x13')]['message']);return _0x10abc6(_0x269e83['error'][_0xf733('0x15')]);}else{logger['info'](_0xf733('0x14'),_0x5b10a7,'request\x20sent');_0x10abc6(_0x269e83[_0xf733('0x16')][_0xf733('0x15')]);}})[_0xf733('0x17')](function(_0x156f87){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x5b10a7,_0x156f87);_0x48fb67(_0x156f87);});});}exports[_0xf733('0x18')]=function(_0x52476f){var _0x55a6ee=this;return new Promise(function(_0xdb04bb,_0x22b8cd){return db[_0xf733('0x19')][_0xf733('0x1a')]({'raw':_0x52476f[_0xf733('0x1b')]?_0x52476f[_0xf733('0x1b')][_0xf733('0x1c')]===undefined?!![]:![]:!![],'where':_0x52476f[_0xf733('0x1b')]?_0x52476f[_0xf733('0x1b')]['where']||null:null,'attributes':_0x52476f[_0xf733('0x1b')]?_0x52476f[_0xf733('0x1b')][_0xf733('0x1d')]||null:null,'limit':_0x52476f[_0xf733('0x1b')]?_0x52476f[_0xf733('0x1b')][_0xf733('0x1e')]||null:null,'include':_0x52476f[_0xf733('0x1b')]?_0x52476f[_0xf733('0x1b')][_0xf733('0x1f')]?_[_0xf733('0x20')](_0x52476f[_0xf733('0x1b')][_0xf733('0x1f')],function(_0x343737){return{'model':db[_0x343737[_0xf733('0x21')]],'as':_0x343737['as'],'attributes':_0x343737[_0xf733('0x1d')],'include':_0x343737['include']?_[_0xf733('0x20')](_0x343737['include'],function(_0x50adef){return{'model':db[_0x50adef['model']],'as':_0x50adef['as'],'attributes':_0x50adef[_0xf733('0x1d')],'include':_0x50adef['include']?_[_0xf733('0x20')](_0x50adef[_0xf733('0x1f')],function(_0x2980f2){return{'model':db[_0x2980f2[_0xf733('0x21')]],'as':_0x2980f2['as'],'attributes':_0x2980f2['attributes']};}):[]};}):[]};}):[]:[]})[_0xf733('0xd')](function(_0x3e0722){logger[_0xf733('0xe')](_0xf733('0x18'),_0x52476f);logger[_0xf733('0x10')](_0xf733('0x18'),_0x52476f,JSON[_0xf733('0x12')](_0x3e0722));_0xdb04bb(_0x3e0722);})[_0xf733('0x17')](function(_0x9d3e0c){logger[_0xf733('0x13')](_0xf733('0x18'),_0x9d3e0c[_0xf733('0x15')],_0x52476f);_0x22b8cd(_0x55a6ee[_0xf733('0x13')](0x1f4,_0x9d3e0c[_0xf733('0x15')]));});});};exports[_0xf733('0x22')]=function(_0x128166){var _0x3e3916=this;return new Promise(function(_0x42af28,_0x52b91f){return db[_0xf733('0x19')]['find']({'raw':_0x128166[_0xf733('0x1b')]?_0x128166[_0xf733('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x128166[_0xf733('0x1b')]?_0x128166[_0xf733('0x1b')][_0xf733('0x23')]||null:null,'attributes':_0x128166[_0xf733('0x1b')]?_0x128166[_0xf733('0x1b')]['attributes']||null:null,'include':_0x128166[_0xf733('0x1b')]?_0x128166[_0xf733('0x1b')][_0xf733('0x1f')]?_[_0xf733('0x20')](_0x128166[_0xf733('0x1b')][_0xf733('0x1f')],function(_0x88be5f){return{'model':db[_0x88be5f[_0xf733('0x21')]],'as':_0x88be5f['as'],'attributes':_0x88be5f['attributes'],'include':_0x88be5f['include']?_[_0xf733('0x20')](_0x88be5f[_0xf733('0x1f')],function(_0x27324b){return{'model':db[_0x27324b[_0xf733('0x21')]],'as':_0x27324b['as'],'attributes':_0x27324b[_0xf733('0x1d')],'include':_0x27324b[_0xf733('0x1f')]?_['map'](_0x27324b[_0xf733('0x1f')],function(_0x1dab46){return{'model':db[_0x1dab46[_0xf733('0x21')]],'as':_0x1dab46['as'],'attributes':_0x1dab46[_0xf733('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf733('0xd')](function(_0x5bfa13){logger[_0xf733('0xe')](_0xf733('0x22'),_0x128166);logger[_0xf733('0x10')](_0xf733('0x22'),_0x128166,JSON[_0xf733('0x12')](_0x5bfa13));_0x42af28(_0x5bfa13);})['catch'](function(_0x49325f){logger[_0xf733('0x13')](_0xf733('0x22'),_0x49325f[_0xf733('0x15')],_0x128166);_0x52b91f(_0x3e3916[_0xf733('0x13')](0x1f4,_0x49325f['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 9425480..44efb5d 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_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 +var _0x2032=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','exports','util','path','connect-timeout'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2032,0xd9));var _0x2203=function(_0x6edc84,_0x2588a2){_0x6edc84=_0x6edc84-0x0;var _0x43be78=_0x2032[_0x6edc84];return _0x43be78;};'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/fields',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2203('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2203('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 6dd9ad7..317baa0 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 _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 +var _0x55c6=['Case','contact','lead','account_contact_lead','contact_lead','nothing','sequelize','STRING','ENUM','Task'];(function(_0x41bba7,_0x1e04b2){var _0x21236f=function(_0x40132a){while(--_0x40132a){_0x41bba7['push'](_0x41bba7['shift']());}};_0x21236f(++_0x1e04b2);}(_0x55c6,0x7e));var _0x655c=function(_0x3e798f,_0x483cfe){_0x3e798f=_0x3e798f-0x0;var _0x5be707=_0x55c6[_0x3e798f];return _0x5be707;};'use strict';var Sequelize=require(_0x655c('0x0'));module['exports']={'name':{'type':Sequelize[_0x655c('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x655c('0x2')](_0x655c('0x3'),_0x655c('0x4')),'defaultValue':_0x655c('0x3')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x655c('0x5'),_0x655c('0x6'),_0x655c('0x7'),'account'),'defaultValue':_0x655c('0x8')},'moduleCreate':{'type':Sequelize['ENUM'](_0x655c('0x9'),_0x655c('0x5'),'lead','account'),'defaultValue':_0x655c('0x6')},'leadId':{'type':Sequelize[_0x655c('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x655c('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x655c('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x655c('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index d701639..0e99bb6 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 _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 +var _0xdd12=['eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','then','error','stack','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','intersection','find','create','catch','update','body','destroy','getFields','findOne','options','getSubjects','order','getDescriptions','SalesforceField'];(function(_0x49dd90,_0x47e0ef){var _0x28dab4=function(_0x326e42){while(--_0x326e42){_0x49dd90['push'](_0x49dd90['shift']());}};_0x28dab4(++_0x47e0ef);}(_0xdd12,0xf6));var _0x2dd1=function(_0x4ab553,_0x2de53c){_0x4ab553=_0x4ab553-0x0;var _0x14467e=_0xdd12[_0x4ab553];return _0x14467e;};'use strict';var emlformat=require(_0x2dd1('0x0'));var rimraf=require(_0x2dd1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2dd1('0x2'));var rp=require(_0x2dd1('0x3'));var moment=require('moment');var BPromise=require(_0x2dd1('0x4'));var Mustache=require(_0x2dd1('0x5'));var util=require('util');var path=require(_0x2dd1('0x6'));var sox=require(_0x2dd1('0x7'));var csv=require(_0x2dd1('0x8'));var ejs=require(_0x2dd1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2dd1('0xa'));var squel=require(_0x2dd1('0xb'));var crypto=require(_0x2dd1('0xc'));var jsforce=require(_0x2dd1('0xd'));var deskjs=require(_0x2dd1('0xe'));var toCsv=require(_0x2dd1('0x8'));var querystring=require(_0x2dd1('0xf'));var Papa=require(_0x2dd1('0x10'));var Redis=require(_0x2dd1('0x11'));var authService=require(_0x2dd1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2dd1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2dd1('0x14'))('api');var utils=require(_0x2dd1('0x15'));var config=require(_0x2dd1('0x16'));var licenseUtil=require(_0x2dd1('0x17'));var db=require(_0x2dd1('0x18'))['db'];function respondWithStatusCode(_0x346daa,_0x4b7b1d){_0x4b7b1d=_0x4b7b1d||0xcc;return function(_0x1e16fe){if(_0x1e16fe){return _0x346daa[_0x2dd1('0x19')](_0x4b7b1d);}return _0x346daa[_0x2dd1('0x1a')](_0x4b7b1d)[_0x2dd1('0x1b')]();};}function respondWithResult(_0x52edc8,_0x54106f){_0x54106f=_0x54106f||0xc8;return function(_0x5981a5){if(_0x5981a5){return _0x52edc8[_0x2dd1('0x1a')](_0x54106f)[_0x2dd1('0x1c')](_0x5981a5);}};}function respondWithFilteredResult(_0x31fbf4,_0xb3cd58){return function(_0x1c5b7e){if(_0x1c5b7e){var _0x122ec6=typeof _0xb3cd58[_0x2dd1('0x1d')]===_0x2dd1('0x1e')&&typeof _0xb3cd58['limit']===_0x2dd1('0x1e');var _0x350f15=_0x1c5b7e['count'];var _0x3d70df=_0x122ec6?0x0:_0xb3cd58[_0x2dd1('0x1d')];var _0x4c3a8a=_0x122ec6?_0x1c5b7e[_0x2dd1('0x1f')]:_0xb3cd58['offset']+_0xb3cd58[_0x2dd1('0x20')];var _0x5bfd92;if(_0x4c3a8a>=_0x350f15){_0x4c3a8a=_0x350f15;_0x5bfd92=0xc8;}else{_0x5bfd92=0xce;}_0x31fbf4['status'](_0x5bfd92);return _0x31fbf4[_0x2dd1('0x21')]('Content-Range',_0x3d70df+'-'+_0x4c3a8a+'/'+_0x350f15)[_0x2dd1('0x1c')](_0x1c5b7e);}return null;};}function patchUpdates(_0x4f8fd7){return function(_0x1d5122){try{jsonpatch['apply'](_0x1d5122,_0x4f8fd7,!![]);}catch(_0x1a8e61){return BPromise[_0x2dd1('0x22')](_0x1a8e61);}return _0x1d5122[_0x2dd1('0x23')]();};}function saveUpdates(_0x4db5e7,_0x3dd4b1){return function(_0x13bd2d){if(_0x13bd2d){return _0x13bd2d['update'](_0x4db5e7)[_0x2dd1('0x24')](function(_0x839952){return _0x839952;});}return null;};}function removeEntity(_0x4935c1,_0x21f12d){return function(_0x1f0c29){if(_0x1f0c29){return _0x1f0c29['destroy']()[_0x2dd1('0x24')](function(){_0x4935c1[_0x2dd1('0x1a')](0xcc)[_0x2dd1('0x1b')]();});}};}function handleEntityNotFound(_0x3cf45c,_0xd3ce9b){return function(_0x5d11a1){if(!_0x5d11a1){_0x3cf45c[_0x2dd1('0x19')](0x194);}return _0x5d11a1;};}function handleError(_0x24a122,_0x3cbf86){_0x3cbf86=_0x3cbf86||0x1f4;return function(_0x263b81){logger[_0x2dd1('0x25')](_0x263b81[_0x2dd1('0x26')]);if(_0x263b81['name']){delete _0x263b81[_0x2dd1('0x27')];}_0x24a122[_0x2dd1('0x1a')](_0x3cbf86)['send'](_0x263b81);};}exports[_0x2dd1('0x28')]=function(_0x478813,_0x2fa618){var _0x434461={},_0x2f6c21={},_0x2a984a={'count':0x0,'rows':[]};var _0x49d1f1=_[_0x2dd1('0x29')](db[_0x2dd1('0x2a')][_0x2dd1('0x2b')],function(_0x5a3f3a){return{'name':_0x5a3f3a[_0x2dd1('0x2c')],'type':_0x5a3f3a[_0x2dd1('0x2d')][_0x2dd1('0x2e')]};});_0x2f6c21['model']=_['map'](_0x49d1f1,_0x2dd1('0x27'));_0x2f6c21[_0x2dd1('0x2f')]=_[_0x2dd1('0x30')](_0x478813[_0x2dd1('0x2f')]);_0x2f6c21['filters']=_['intersection'](_0x2f6c21[_0x2dd1('0x31')],_0x2f6c21[_0x2dd1('0x2f')]);_0x434461[_0x2dd1('0x32')]=_['intersection'](_0x2f6c21[_0x2dd1('0x31')],qs['fields'](_0x478813[_0x2dd1('0x2f')][_0x2dd1('0x33')]));_0x434461[_0x2dd1('0x32')]=_0x434461[_0x2dd1('0x32')][_0x2dd1('0x34')]?_0x434461[_0x2dd1('0x32')]:_0x2f6c21[_0x2dd1('0x31')];if(!_0x478813[_0x2dd1('0x2f')][_0x2dd1('0x35')](_0x2dd1('0x36'))){_0x434461[_0x2dd1('0x20')]=qs[_0x2dd1('0x20')](_0x478813[_0x2dd1('0x2f')][_0x2dd1('0x20')]);_0x434461[_0x2dd1('0x1d')]=qs[_0x2dd1('0x1d')](_0x478813[_0x2dd1('0x2f')]['offset']);}_0x434461['order']=qs[_0x2dd1('0x37')](_0x478813['query'][_0x2dd1('0x37')]);_0x434461[_0x2dd1('0x38')]=qs[_0x2dd1('0x39')](_[_0x2dd1('0x3a')](_0x478813['query'],_0x2f6c21[_0x2dd1('0x39')]),_0x49d1f1);if(_0x478813[_0x2dd1('0x2f')]['filter']){_0x434461[_0x2dd1('0x38')]=_[_0x2dd1('0x3b')](_0x434461[_0x2dd1('0x38')],{'$or':_[_0x2dd1('0x29')](_0x49d1f1,function(_0x337636){if(_0x337636[_0x2dd1('0x2d')]!==_0x2dd1('0x3c')){var _0x25247b={};_0x25247b[_0x337636[_0x2dd1('0x27')]]={'$like':'%'+_0x478813['query'][_0x2dd1('0x3d')]+'%'};return _0x25247b;}})});}_0x434461=_['merge']({},_0x434461,_0x478813['options']);var _0xd68037={'where':_0x434461[_0x2dd1('0x38')]};return db['SalesforceConfiguration'][_0x2dd1('0x1f')](_0xd68037)[_0x2dd1('0x24')](function(_0x794903){_0x2a984a[_0x2dd1('0x1f')]=_0x794903;if(_0x478813[_0x2dd1('0x2f')][_0x2dd1('0x3e')]){_0x434461[_0x2dd1('0x3f')]=[{'all':!![]}];}return db[_0x2dd1('0x2a')][_0x2dd1('0x40')](_0x434461);})['then'](function(_0xf35b51){_0x2a984a[_0x2dd1('0x41')]=_0xf35b51;return _0x2a984a;})[_0x2dd1('0x24')](respondWithFilteredResult(_0x2fa618,_0x434461))['catch'](handleError(_0x2fa618,null));};exports[_0x2dd1('0x42')]=function(_0x2f0112,_0x598c74){var _0x3cddb4={'raw':![],'where':{'id':_0x2f0112[_0x2dd1('0x43')]['id']}},_0x55ff8f={};_0x55ff8f['model']=_[_0x2dd1('0x30')](db[_0x2dd1('0x2a')][_0x2dd1('0x2b')]);_0x55ff8f['query']=_['keys'](_0x2f0112['query']);_0x55ff8f[_0x2dd1('0x39')]=_[_0x2dd1('0x44')](_0x55ff8f[_0x2dd1('0x31')],_0x55ff8f[_0x2dd1('0x2f')]);_0x3cddb4[_0x2dd1('0x32')]=_[_0x2dd1('0x44')](_0x55ff8f['model'],qs[_0x2dd1('0x33')](_0x2f0112['query'][_0x2dd1('0x33')]));_0x3cddb4[_0x2dd1('0x32')]=_0x3cddb4[_0x2dd1('0x32')][_0x2dd1('0x34')]?_0x3cddb4['attributes']:_0x55ff8f[_0x2dd1('0x31')];if(_0x2f0112[_0x2dd1('0x2f')][_0x2dd1('0x3e')]){_0x3cddb4[_0x2dd1('0x3f')]=[{'all':!![]}];}_0x3cddb4=_[_0x2dd1('0x3b')]({},_0x3cddb4,_0x2f0112['options']);return db[_0x2dd1('0x2a')][_0x2dd1('0x45')](_0x3cddb4)[_0x2dd1('0x24')](handleEntityNotFound(_0x598c74,null))[_0x2dd1('0x24')](respondWithResult(_0x598c74,null))['catch'](handleError(_0x598c74,null));};exports[_0x2dd1('0x46')]=function(_0x5e57fc,_0x513c26){return db['SalesforceConfiguration'][_0x2dd1('0x46')](_0x5e57fc['body'],{})['then'](respondWithResult(_0x513c26,0xc9))[_0x2dd1('0x47')](handleError(_0x513c26,null));};exports[_0x2dd1('0x48')]=function(_0xfda23c,_0x226fc1){if(_0xfda23c[_0x2dd1('0x49')]['id']){delete _0xfda23c['body']['id'];}return db['SalesforceConfiguration'][_0x2dd1('0x45')]({'where':{'id':_0xfda23c['params']['id']}})[_0x2dd1('0x24')](handleEntityNotFound(_0x226fc1,null))[_0x2dd1('0x24')](saveUpdates(_0xfda23c['body'],null))[_0x2dd1('0x24')](respondWithResult(_0x226fc1,null))['catch'](handleError(_0x226fc1,null));};exports[_0x2dd1('0x4a')]=function(_0xbce5bb,_0x114f05){return db[_0x2dd1('0x2a')][_0x2dd1('0x45')]({'where':{'id':_0xbce5bb[_0x2dd1('0x43')]['id']}})[_0x2dd1('0x24')](handleEntityNotFound(_0x114f05,null))[_0x2dd1('0x24')](removeEntity(_0x114f05,null))[_0x2dd1('0x47')](handleError(_0x114f05,null));};exports[_0x2dd1('0x4b')]=function(_0x8f20b0,_0x599e5c,_0x1a34af){var _0x1a4b3a={};var _0x2f869e={};var _0x1801c6;var _0xe3a8f2;return db['SalesforceConfiguration'][_0x2dd1('0x4c')]({'where':{'id':_0x8f20b0[_0x2dd1('0x43')]['id']}})[_0x2dd1('0x24')](handleEntityNotFound(_0x599e5c,null))['then'](function(_0x3f3847){if(_0x3f3847){_0x1801c6=_0x3f3847;_0x2f869e[_0x2dd1('0x31')]=_['keys'](db['SalesforceField'][_0x2dd1('0x2b')]);_0x2f869e[_0x2dd1('0x2f')]=_[_0x2dd1('0x30')](_0x8f20b0[_0x2dd1('0x2f')]);_0x2f869e['filters']=_[_0x2dd1('0x44')](_0x2f869e[_0x2dd1('0x31')],_0x2f869e['query']);_0x1a4b3a[_0x2dd1('0x32')]=_['intersection'](_0x2f869e[_0x2dd1('0x31')],qs[_0x2dd1('0x33')](_0x8f20b0[_0x2dd1('0x2f')][_0x2dd1('0x33')]));_0x1a4b3a[_0x2dd1('0x32')]=_0x1a4b3a['attributes'][_0x2dd1('0x34')]?_0x1a4b3a['attributes']:_0x2f869e[_0x2dd1('0x31')];_0x1a4b3a['order']=qs[_0x2dd1('0x37')](_0x8f20b0[_0x2dd1('0x2f')]['sort']);_0x1a4b3a['where']=qs['filters'](_[_0x2dd1('0x3a')](_0x8f20b0[_0x2dd1('0x2f')],_0x2f869e[_0x2dd1('0x39')]));if(_0x8f20b0['query']['filter']){_0x1a4b3a['where']=_['merge'](_0x1a4b3a[_0x2dd1('0x38')],{'$or':_[_0x2dd1('0x29')](_0x1a4b3a['attributes'],function(_0xe8e9a3){var _0x4dad56={};_0x4dad56[_0xe8e9a3]={'$like':'%'+_0x8f20b0['query'][_0x2dd1('0x3d')]+'%'};return _0x4dad56;})});}_0x1a4b3a=_[_0x2dd1('0x3b')]({},_0x1a4b3a,_0x8f20b0[_0x2dd1('0x4d')]);return _0x1801c6['getFields'](_0x1a4b3a);}})[_0x2dd1('0x24')](function(_0x4a1368){if(_0x4a1368){_0xe3a8f2=_0x4a1368[_0x2dd1('0x34')];if(!_0x8f20b0[_0x2dd1('0x2f')][_0x2dd1('0x35')](_0x2dd1('0x36'))){_0x1a4b3a[_0x2dd1('0x20')]=qs['limit'](_0x8f20b0[_0x2dd1('0x2f')]['limit']);_0x1a4b3a['offset']=qs[_0x2dd1('0x1d')](_0x8f20b0[_0x2dd1('0x2f')][_0x2dd1('0x1d')]);}return _0x1801c6[_0x2dd1('0x4b')](_0x1a4b3a);}})[_0x2dd1('0x24')](function(_0x2aecdc){if(_0x2aecdc){return _0x2aecdc?{'count':_0xe3a8f2,'rows':_0x2aecdc}:null;}})[_0x2dd1('0x24')](respondWithResult(_0x599e5c,null))['catch'](handleError(_0x599e5c,null));};exports[_0x2dd1('0x4e')]=function(_0xe69f7d,_0x3249a5,_0x39e299){var _0x3f6076={};var _0x5415c9={};var _0x56f2a7;var _0x3c2088;return db['SalesforceConfiguration'][_0x2dd1('0x4c')]({'where':{'id':_0xe69f7d['params']['id']}})[_0x2dd1('0x24')](handleEntityNotFound(_0x3249a5,null))[_0x2dd1('0x24')](function(_0x3a4c76){if(_0x3a4c76){_0x56f2a7=_0x3a4c76;_0x5415c9[_0x2dd1('0x31')]=_[_0x2dd1('0x30')](db['SalesforceField'][_0x2dd1('0x2b')]);_0x5415c9[_0x2dd1('0x2f')]=_[_0x2dd1('0x30')](_0xe69f7d[_0x2dd1('0x2f')]);_0x5415c9[_0x2dd1('0x39')]=_[_0x2dd1('0x44')](_0x5415c9[_0x2dd1('0x31')],_0x5415c9['query']);_0x3f6076[_0x2dd1('0x32')]=_[_0x2dd1('0x44')](_0x5415c9[_0x2dd1('0x31')],qs[_0x2dd1('0x33')](_0xe69f7d[_0x2dd1('0x2f')]['fields']));_0x3f6076[_0x2dd1('0x32')]=_0x3f6076[_0x2dd1('0x32')][_0x2dd1('0x34')]?_0x3f6076['attributes']:_0x5415c9['model'];_0x3f6076[_0x2dd1('0x4f')]=qs[_0x2dd1('0x37')](_0xe69f7d[_0x2dd1('0x2f')][_0x2dd1('0x37')]);_0x3f6076[_0x2dd1('0x38')]=qs['filters'](_[_0x2dd1('0x3a')](_0xe69f7d['query'],_0x5415c9['filters']));if(_0xe69f7d['query'][_0x2dd1('0x3d')]){_0x3f6076[_0x2dd1('0x38')]=_[_0x2dd1('0x3b')](_0x3f6076[_0x2dd1('0x38')],{'$or':_['map'](_0x3f6076['attributes'],function(_0x1e57fd){var _0x305a12={};_0x305a12[_0x1e57fd]={'$like':'%'+_0xe69f7d[_0x2dd1('0x2f')][_0x2dd1('0x3d')]+'%'};return _0x305a12;})});}_0x3f6076=_[_0x2dd1('0x3b')]({},_0x3f6076,_0xe69f7d[_0x2dd1('0x4d')]);return _0x56f2a7[_0x2dd1('0x4e')](_0x3f6076);}})[_0x2dd1('0x24')](function(_0x5c0b33){if(_0x5c0b33){_0x3c2088=_0x5c0b33[_0x2dd1('0x34')];if(!_0xe69f7d[_0x2dd1('0x2f')][_0x2dd1('0x35')](_0x2dd1('0x36'))){_0x3f6076['limit']=qs[_0x2dd1('0x20')](_0xe69f7d[_0x2dd1('0x2f')][_0x2dd1('0x20')]);_0x3f6076[_0x2dd1('0x1d')]=qs[_0x2dd1('0x1d')](_0xe69f7d['query'][_0x2dd1('0x1d')]);}return _0x56f2a7['getSubjects'](_0x3f6076);}})[_0x2dd1('0x24')](function(_0x2f5876){if(_0x2f5876){return _0x2f5876?{'count':_0x3c2088,'rows':_0x2f5876}:null;}})[_0x2dd1('0x24')](respondWithResult(_0x3249a5,null))[_0x2dd1('0x47')](handleError(_0x3249a5,null));};exports[_0x2dd1('0x50')]=function(_0xc3ae5b,_0x5b1046,_0x4c3877){var _0x58c76a={};var _0x13685d={};var _0x2b2512;var _0x5c93ca;return db[_0x2dd1('0x2a')][_0x2dd1('0x4c')]({'where':{'id':_0xc3ae5b[_0x2dd1('0x43')]['id']}})[_0x2dd1('0x24')](handleEntityNotFound(_0x5b1046,null))[_0x2dd1('0x24')](function(_0xc49470){if(_0xc49470){_0x2b2512=_0xc49470;_0x13685d[_0x2dd1('0x31')]=_[_0x2dd1('0x30')](db[_0x2dd1('0x51')]['rawAttributes']);_0x13685d['query']=_[_0x2dd1('0x30')](_0xc3ae5b[_0x2dd1('0x2f')]);_0x13685d[_0x2dd1('0x39')]=_[_0x2dd1('0x44')](_0x13685d['model'],_0x13685d[_0x2dd1('0x2f')]);_0x58c76a['attributes']=_[_0x2dd1('0x44')](_0x13685d[_0x2dd1('0x31')],qs[_0x2dd1('0x33')](_0xc3ae5b[_0x2dd1('0x2f')][_0x2dd1('0x33')]));_0x58c76a[_0x2dd1('0x32')]=_0x58c76a[_0x2dd1('0x32')][_0x2dd1('0x34')]?_0x58c76a[_0x2dd1('0x32')]:_0x13685d[_0x2dd1('0x31')];_0x58c76a['order']=qs[_0x2dd1('0x37')](_0xc3ae5b[_0x2dd1('0x2f')][_0x2dd1('0x37')]);_0x58c76a[_0x2dd1('0x38')]=qs[_0x2dd1('0x39')](_['pick'](_0xc3ae5b[_0x2dd1('0x2f')],_0x13685d['filters']));if(_0xc3ae5b['query'][_0x2dd1('0x3d')]){_0x58c76a[_0x2dd1('0x38')]=_[_0x2dd1('0x3b')](_0x58c76a[_0x2dd1('0x38')],{'$or':_['map'](_0x58c76a[_0x2dd1('0x32')],function(_0x3f9a40){var _0x541230={};_0x541230[_0x3f9a40]={'$like':'%'+_0xc3ae5b['query'][_0x2dd1('0x3d')]+'%'};return _0x541230;})});}_0x58c76a=_[_0x2dd1('0x3b')]({},_0x58c76a,_0xc3ae5b[_0x2dd1('0x4d')]);return _0x2b2512[_0x2dd1('0x50')](_0x58c76a);}})[_0x2dd1('0x24')](function(_0xb4e2fd){if(_0xb4e2fd){_0x5c93ca=_0xb4e2fd[_0x2dd1('0x34')];if(!_0xc3ae5b[_0x2dd1('0x2f')][_0x2dd1('0x35')]('nolimit')){_0x58c76a['limit']=qs[_0x2dd1('0x20')](_0xc3ae5b[_0x2dd1('0x2f')]['limit']);_0x58c76a[_0x2dd1('0x1d')]=qs[_0x2dd1('0x1d')](_0xc3ae5b[_0x2dd1('0x2f')][_0x2dd1('0x1d')]);}return _0x2b2512[_0x2dd1('0x50')](_0x58c76a);}})[_0x2dd1('0x24')](function(_0x46bc0e){if(_0x46bc0e){return _0x46bc0e?{'count':_0x5c93ca,'rows':_0x46bc0e}:null;}})[_0x2dd1('0x24')](respondWithResult(_0x5b1046,null))['catch'](handleError(_0x5b1046,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 8e40711..b0fe845 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 _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 +var _0x3442=['../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1d62a9,_0x3b7aee){var _0x3d60f4=function(_0x3bc168){while(--_0x3bc168){_0x1d62a9['push'](_0x1d62a9['shift']());}};_0x3d60f4(++_0x3b7aee);}(_0x3442,0x118));var _0x2344=function(_0x51fc0d,_0x2bac03){_0x51fc0d=_0x51fc0d-0x0;var _0xf805ec=_0x3442[_0x51fc0d];return _0xf805ec;};'use strict';var _=require(_0x2344('0x0'));var util=require(_0x2344('0x1'));var logger=require('../../config/logger')(_0x2344('0x2'));var moment=require(_0x2344('0x3'));var BPromise=require(_0x2344('0x4'));var rp=require(_0x2344('0x5'));var fs=require('fs');var path=require(_0x2344('0x6'));var rimraf=require(_0x2344('0x7'));var config=require(_0x2344('0x8'));var attributes=require(_0x2344('0x9'));module[_0x2344('0xa')]=function(_0x4f1b1d,_0x3dadde){return _0x4f1b1d['define'](_0x2344('0xb'),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 c3d1e1f..3b2524f 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 _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 +var _0x746f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','SalesforceConfiguration,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring'];(function(_0x37f0dd,_0x422eb1){var _0x167af9=function(_0x1f8862){while(--_0x1f8862){_0x37f0dd['push'](_0x37f0dd['shift']());}};_0x167af9(++_0x422eb1);}(_0x746f,0x18c));var _0xf746=function(_0x39bfcb,_0x58f63c){_0x39bfcb=_0x39bfcb-0x0;var _0x14d478=_0x746f[_0x39bfcb];return _0x14d478;};'use strict';var _=require('lodash');var util=require(_0xf746('0x0'));var moment=require(_0xf746('0x1'));var BPromise=require(_0xf746('0x2'));var rs=require(_0xf746('0x3'));var fs=require('fs');var Redis=require(_0xf746('0x4'));var db=require(_0xf746('0x5'))['db'];var utils=require(_0xf746('0x6'));var logger=require(_0xf746('0x7'))(_0xf746('0x8'));var config=require(_0xf746('0x9'));var jayson=require(_0xf746('0xa'));var client=jayson[_0xf746('0xb')][_0xf746('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2135ab,_0x28e42a,_0x2c6634){return new BPromise(function(_0x88c067,_0x1e8f9b){return client[_0xf746('0xd')](_0x2135ab,_0x2c6634)[_0xf746('0xe')](function(_0x3b573f){logger[_0xf746('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x28e42a,_0xf746('0x10'));logger[_0xf746('0x11')](_0xf746('0x12'),_0x28e42a,'request\x20sent',JSON[_0xf746('0x13')](_0x3b573f));if(_0x3b573f['error']){if(_0x3b573f[_0xf746('0x14')]['code']===0x1f4){logger[_0xf746('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x28e42a,_0x3b573f[_0xf746('0x14')]['message']);return _0x1e8f9b(_0x3b573f['error'][_0xf746('0x15')]);}logger[_0xf746('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x28e42a,_0x3b573f[_0xf746('0x14')][_0xf746('0x15')]);return _0x88c067(_0x3b573f[_0xf746('0x14')]['message']);}else{logger['info'](_0xf746('0x16'),_0x28e42a,'request\x20sent');_0x88c067(_0x3b573f[_0xf746('0x17')][_0xf746('0x15')]);}})[_0xf746('0x18')](function(_0xcd0586){logger[_0xf746('0x14')](_0xf746('0x16'),_0x28e42a,_0xcd0586);_0x1e8f9b(_0xcd0586);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index f381e71..de04c76 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 _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 +var _0xeeb6=['get','/:id','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./intSalesforceField.controller','isAuthenticated','index'];(function(_0x55d2ea,_0x1b84a2){var _0x339611=function(_0x21cc50){while(--_0x21cc50){_0x55d2ea['push'](_0x55d2ea['shift']());}};_0x339611(++_0x1b84a2);}(_0xeeb6,0x1d3));var _0x6eeb=function(_0x334b4f,_0x481f85){_0x334b4f=_0x334b4f-0x0;var _0x266ecd=_0xeeb6[_0x334b4f];return _0x266ecd;};'use strict';var multer=require(_0x6eeb('0x0'));var util=require('util');var path=require(_0x6eeb('0x1'));var timeout=require(_0x6eeb('0x2'));var express=require(_0x6eeb('0x3'));var router=express[_0x6eeb('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6eeb('0x5'));var config=require('../../config/environment');var controller=require(_0x6eeb('0x6'));router['get']('/',auth[_0x6eeb('0x7')](),controller[_0x6eeb('0x8')]);router[_0x6eeb('0x9')](_0x6eeb('0xa'),auth[_0x6eeb('0x7')](),controller['show']);router[_0x6eeb('0xb')]('/',auth[_0x6eeb('0x7')](),controller[_0x6eeb('0xc')]);router[_0x6eeb('0xd')](_0x6eeb('0xa'),auth[_0x6eeb('0x7')](),controller[_0x6eeb('0xe')]);router['delete'](_0x6eeb('0xa'),auth[_0x6eeb('0x7')](),controller[_0x6eeb('0xf')]);module[_0x6eeb('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 264ae1f..a2309f9 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 _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 +var _0x3ed0=['string','variable','customVariable','keyValue','STRING','sequelize','exports','ENUM'];(function(_0x188250,_0x53ac99){var _0x3430bd=function(_0x447cd2){while(--_0x447cd2){_0x188250['push'](_0x188250['shift']());}};_0x3430bd(++_0x53ac99);}(_0x3ed0,0x15d));var _0x03ed=function(_0x4450b1,_0x214ace){_0x4450b1=_0x4450b1-0x0;var _0x399b0b=_0x3ed0[_0x4450b1];return _0x399b0b;};'use strict';var Sequelize=require(_0x03ed('0x0'));module[_0x03ed('0x1')]={'type':{'type':Sequelize[_0x03ed('0x2')](_0x03ed('0x3'),_0x03ed('0x4'),_0x03ed('0x5'),_0x03ed('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x03ed('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x03ed('0x2')](_0x03ed('0x3'),'variable',_0x03ed('0x5'))},'keyContent':{'type':Sequelize[_0x03ed('0x7')]},'idField':{'type':Sequelize[_0x03ed('0x7')]},'variableName':{'type':Sequelize[_0x03ed('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 4d502d4..767893a 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 _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 +var _0xba6a=['limit','count','offset','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','SalesforceField','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','keys','rawAttributes','includeAll','create','body','params','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined'];(function(_0x1e220c,_0x1cc718){var _0x3b53cd=function(_0x34de16){while(--_0x34de16){_0x1e220c['push'](_0x1e220c['shift']());}};_0x3b53cd(++_0x1cc718);}(_0xba6a,0x117));var _0xaba6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xba6a[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xaba6('0x0'));var rimraf=require(_0xaba6('0x1'));var zipdir=require(_0xaba6('0x2'));var jsonpatch=require(_0xaba6('0x3'));var rp=require(_0xaba6('0x4'));var moment=require(_0xaba6('0x5'));var BPromise=require(_0xaba6('0x6'));var Mustache=require('mustache');var util=require(_0xaba6('0x7'));var path=require(_0xaba6('0x8'));var sox=require(_0xaba6('0x9'));var csv=require(_0xaba6('0xa'));var ejs=require(_0xaba6('0xb'));var fs=require('fs');var fs_extra=require(_0xaba6('0xc'));var _=require(_0xaba6('0xd'));var squel=require(_0xaba6('0xe'));var crypto=require(_0xaba6('0xf'));var jsforce=require(_0xaba6('0x10'));var deskjs=require(_0xaba6('0x11'));var toCsv=require(_0xaba6('0xa'));var querystring=require(_0xaba6('0x12'));var Papa=require('papaparse');var Redis=require(_0xaba6('0x13'));var authService=require(_0xaba6('0x14'));var qs=require(_0xaba6('0x15'));var as=require(_0xaba6('0x16'));var hardwareService=require(_0xaba6('0x17'));var logger=require(_0xaba6('0x18'))(_0xaba6('0x19'));var utils=require(_0xaba6('0x1a'));var config=require(_0xaba6('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xaba6('0x1c'))['db'];function respondWithStatusCode(_0x2971c5,_0x45bdbc){_0x45bdbc=_0x45bdbc||0xcc;return function(_0x3f6217){if(_0x3f6217){return _0x2971c5['sendStatus'](_0x45bdbc);}return _0x2971c5[_0xaba6('0x1d')](_0x45bdbc)[_0xaba6('0x1e')]();};}function respondWithResult(_0xc246dd,_0x4ae789){_0x4ae789=_0x4ae789||0xc8;return function(_0x50efa3){if(_0x50efa3){return _0xc246dd['status'](_0x4ae789)[_0xaba6('0x1f')](_0x50efa3);}};}function respondWithFilteredResult(_0x5403c4,_0x49c7f0){return function(_0x26d5c7){if(_0x26d5c7){var _0x12d1b1=typeof _0x49c7f0['offset']===_0xaba6('0x20')&&typeof _0x49c7f0[_0xaba6('0x21')]===_0xaba6('0x20');var _0x5f01f6=_0x26d5c7[_0xaba6('0x22')];var _0x829be6=_0x12d1b1?0x0:_0x49c7f0[_0xaba6('0x23')];var _0x417d6d=_0x12d1b1?_0x26d5c7[_0xaba6('0x22')]:_0x49c7f0['offset']+_0x49c7f0[_0xaba6('0x21')];var _0x5484d0;if(_0x417d6d>=_0x5f01f6){_0x417d6d=_0x5f01f6;_0x5484d0=0xc8;}else{_0x5484d0=0xce;}_0x5403c4[_0xaba6('0x1d')](_0x5484d0);return _0x5403c4['set'](_0xaba6('0x24'),_0x829be6+'-'+_0x417d6d+'/'+_0x5f01f6)[_0xaba6('0x1f')](_0x26d5c7);}return null;};}function patchUpdates(_0x2865ae){return function(_0x27fc60){try{jsonpatch[_0xaba6('0x25')](_0x27fc60,_0x2865ae,!![]);}catch(_0x38b81f){return BPromise['reject'](_0x38b81f);}return _0x27fc60[_0xaba6('0x26')]();};}function saveUpdates(_0x103def,_0x441acf){return function(_0x303fea){if(_0x303fea){return _0x303fea[_0xaba6('0x27')](_0x103def)[_0xaba6('0x28')](function(_0x317e43){return _0x317e43;});}return null;};}function removeEntity(_0x5616ff,_0xce4d9a){return function(_0x1f03ab){if(_0x1f03ab){return _0x1f03ab[_0xaba6('0x29')]()[_0xaba6('0x28')](function(){_0x5616ff[_0xaba6('0x1d')](0xcc)[_0xaba6('0x1e')]();});}};}function handleEntityNotFound(_0x11c69c,_0x256022){return function(_0x468c3f){if(!_0x468c3f){_0x11c69c[_0xaba6('0x2a')](0x194);}return _0x468c3f;};}function handleError(_0x3b0079,_0x53806f){_0x53806f=_0x53806f||0x1f4;return function(_0x332c16){logger[_0xaba6('0x2b')](_0x332c16['stack']);if(_0x332c16[_0xaba6('0x2c')]){delete _0x332c16[_0xaba6('0x2c')];}_0x3b0079[_0xaba6('0x1d')](_0x53806f)[_0xaba6('0x2d')](_0x332c16);};}exports[_0xaba6('0x2e')]=function(_0x1be4e0,_0x4e2283){var _0x4f308d={},_0x2b7a35={},_0x58e240={'count':0x0,'rows':[]};var _0x30f090=_[_0xaba6('0x2f')](db[_0xaba6('0x30')]['rawAttributes'],function(_0x3edb6b){return{'name':_0x3edb6b[_0xaba6('0x31')],'type':_0x3edb6b[_0xaba6('0x32')][_0xaba6('0x33')]};});_0x2b7a35['model']=_[_0xaba6('0x2f')](_0x30f090,_0xaba6('0x2c'));_0x2b7a35[_0xaba6('0x34')]=_['keys'](_0x1be4e0[_0xaba6('0x34')]);_0x2b7a35[_0xaba6('0x35')]=_[_0xaba6('0x36')](_0x2b7a35['model'],_0x2b7a35[_0xaba6('0x34')]);_0x4f308d[_0xaba6('0x37')]=_['intersection'](_0x2b7a35[_0xaba6('0x38')],qs[_0xaba6('0x39')](_0x1be4e0['query'][_0xaba6('0x39')]));_0x4f308d[_0xaba6('0x37')]=_0x4f308d[_0xaba6('0x37')][_0xaba6('0x3a')]?_0x4f308d[_0xaba6('0x37')]:_0x2b7a35[_0xaba6('0x38')];if(!_0x1be4e0[_0xaba6('0x34')][_0xaba6('0x3b')](_0xaba6('0x3c'))){_0x4f308d['limit']=qs[_0xaba6('0x21')](_0x1be4e0[_0xaba6('0x34')][_0xaba6('0x21')]);_0x4f308d[_0xaba6('0x23')]=qs[_0xaba6('0x23')](_0x1be4e0['query'][_0xaba6('0x23')]);}_0x4f308d['order']=qs['sort'](_0x1be4e0[_0xaba6('0x34')][_0xaba6('0x3d')]);_0x4f308d[_0xaba6('0x3e')]=qs['filters'](_['pick'](_0x1be4e0[_0xaba6('0x34')],_0x2b7a35[_0xaba6('0x35')]),_0x30f090);if(_0x1be4e0['query'][_0xaba6('0x3f')]){_0x4f308d['where']=_[_0xaba6('0x40')](_0x4f308d[_0xaba6('0x3e')],{'$or':_[_0xaba6('0x2f')](_0x30f090,function(_0x244539){if(_0x244539[_0xaba6('0x32')]!==_0xaba6('0x41')){var _0x10d335={};_0x10d335[_0x244539[_0xaba6('0x2c')]]={'$like':'%'+_0x1be4e0['query'][_0xaba6('0x3f')]+'%'};return _0x10d335;}})});}_0x4f308d=_[_0xaba6('0x40')]({},_0x4f308d,_0x1be4e0[_0xaba6('0x42')]);var _0x7ae90b={'where':_0x4f308d['where']};return db[_0xaba6('0x30')][_0xaba6('0x22')](_0x7ae90b)[_0xaba6('0x28')](function(_0xd6b992){_0x58e240[_0xaba6('0x22')]=_0xd6b992;if(_0x1be4e0[_0xaba6('0x34')]['includeAll']){_0x4f308d[_0xaba6('0x43')]=[{'all':!![]}];}return db[_0xaba6('0x30')][_0xaba6('0x44')](_0x4f308d);})[_0xaba6('0x28')](function(_0x3b777c){_0x58e240['rows']=_0x3b777c;return _0x58e240;})['then'](respondWithFilteredResult(_0x4e2283,_0x4f308d))[_0xaba6('0x45')](handleError(_0x4e2283,null));};exports[_0xaba6('0x46')]=function(_0x21dcf5,_0x4053c1){var _0x2a1f1a={'raw':!![],'where':{'id':_0x21dcf5['params']['id']}},_0x40a29d={};_0x40a29d['model']=_[_0xaba6('0x47')](db[_0xaba6('0x30')][_0xaba6('0x48')]);_0x40a29d[_0xaba6('0x34')]=_[_0xaba6('0x47')](_0x21dcf5[_0xaba6('0x34')]);_0x40a29d[_0xaba6('0x35')]=_[_0xaba6('0x36')](_0x40a29d['model'],_0x40a29d[_0xaba6('0x34')]);_0x2a1f1a['attributes']=_[_0xaba6('0x36')](_0x40a29d['model'],qs[_0xaba6('0x39')](_0x21dcf5['query'][_0xaba6('0x39')]));_0x2a1f1a[_0xaba6('0x37')]=_0x2a1f1a[_0xaba6('0x37')][_0xaba6('0x3a')]?_0x2a1f1a['attributes']:_0x40a29d['model'];if(_0x21dcf5[_0xaba6('0x34')][_0xaba6('0x49')]){_0x2a1f1a[_0xaba6('0x43')]=[{'all':!![]}];}_0x2a1f1a=_['merge']({},_0x2a1f1a,_0x21dcf5['options']);return db[_0xaba6('0x30')]['find'](_0x2a1f1a)[_0xaba6('0x28')](handleEntityNotFound(_0x4053c1,null))['then'](respondWithResult(_0x4053c1,null))['catch'](handleError(_0x4053c1,null));};exports[_0xaba6('0x4a')]=function(_0x1f054f,_0x5064df){return db[_0xaba6('0x30')][_0xaba6('0x4a')](_0x1f054f[_0xaba6('0x4b')],{})[_0xaba6('0x28')](respondWithResult(_0x5064df,0xc9))['catch'](handleError(_0x5064df,null));};exports['update']=function(_0x15fe02,_0x3c9b6c){if(_0x15fe02[_0xaba6('0x4b')]['id']){delete _0x15fe02[_0xaba6('0x4b')]['id'];}return db[_0xaba6('0x30')]['find']({'where':{'id':_0x15fe02[_0xaba6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3c9b6c,null))[_0xaba6('0x28')](saveUpdates(_0x15fe02['body'],null))['then'](respondWithResult(_0x3c9b6c,null))[_0xaba6('0x45')](handleError(_0x3c9b6c,null));};exports[_0xaba6('0x29')]=function(_0x1fcc70,_0x2ba13e){return db[_0xaba6('0x30')][_0xaba6('0x4d')]({'where':{'id':_0x1fcc70['params']['id']}})[_0xaba6('0x28')](handleEntityNotFound(_0x2ba13e,null))[_0xaba6('0x28')](removeEntity(_0x2ba13e,null))[_0xaba6('0x45')](handleError(_0x2ba13e,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 6a14da2..3367771 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 _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 +var _0xd09e=['rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','moment','bluebird','request-promise'];(function(_0x4c86fa,_0x2ad8ad){var _0x3b13bd=function(_0x23fb7c){while(--_0x23fb7c){_0x4c86fa['push'](_0x4c86fa['shift']());}};_0x3b13bd(++_0x2ad8ad);}(_0xd09e,0x122));var _0xed09=function(_0x241927,_0x3209ad){_0x241927=_0x241927-0x0;var _0x3ffc4e=_0xd09e[_0x241927];return _0x3ffc4e;};'use strict';var _=require('lodash');var util=require(_0xed09('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xed09('0x1'));var BPromise=require(_0xed09('0x2'));var rp=require(_0xed09('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed09('0x4'));var config=require(_0xed09('0x5'));var attributes=require(_0xed09('0x6'));module[_0xed09('0x7')]=function(_0x4766b1,_0x5a3bb9){return _0x4766b1[_0xed09('0x8')](_0xed09('0x9'),attributes,{'tableName':_0xed09('0xa'),'paranoid':![],'indexes':[{'name':_0xed09('0xb'),'fields':[_0xed09('0xc'),_0xed09('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 1c6adf7..5c93835 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 _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 +var _0x280a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x2b196c,_0x269864){var _0x32e7e6=function(_0x4197ff){while(--_0x4197ff){_0x2b196c['push'](_0x2b196c['shift']());}};_0x32e7e6(++_0x269864);}(_0x280a,0x1c0));var _0xa280=function(_0x48b00c,_0x16690b){_0x48b00c=_0x48b00c-0x0;var _0x55d181=_0x280a[_0x48b00c];return _0x55d181;};'use strict';var _=require(_0xa280('0x0'));var util=require(_0xa280('0x1'));var moment=require(_0xa280('0x2'));var BPromise=require(_0xa280('0x3'));var rs=require(_0xa280('0x4'));var fs=require('fs');var Redis=require(_0xa280('0x5'));var db=require(_0xa280('0x6'))['db'];var utils=require(_0xa280('0x7'));var logger=require(_0xa280('0x8'))('rpc');var config=require(_0xa280('0x9'));var jayson=require(_0xa280('0xa'));var client=jayson[_0xa280('0xb')][_0xa280('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14314c,_0x52ebf8,_0x3bee52){return new BPromise(function(_0x4d3530,_0x171891){return client[_0xa280('0xd')](_0x14314c,_0x3bee52)['then'](function(_0x1ad6b9){logger[_0xa280('0xe')](_0xa280('0xf'),_0x52ebf8,_0xa280('0x10'));logger[_0xa280('0x11')](_0xa280('0x12'),_0x52ebf8,_0xa280('0x10'),JSON[_0xa280('0x13')](_0x1ad6b9));if(_0x1ad6b9[_0xa280('0x14')]){if(_0x1ad6b9[_0xa280('0x14')][_0xa280('0x15')]===0x1f4){logger[_0xa280('0x14')](_0xa280('0xf'),_0x52ebf8,_0x1ad6b9[_0xa280('0x14')][_0xa280('0x16')]);return _0x171891(_0x1ad6b9[_0xa280('0x14')]['message']);}logger[_0xa280('0x14')](_0xa280('0xf'),_0x52ebf8,_0x1ad6b9[_0xa280('0x14')][_0xa280('0x16')]);return _0x4d3530(_0x1ad6b9[_0xa280('0x14')]['message']);}else{logger[_0xa280('0xe')](_0xa280('0xf'),_0x52ebf8,_0xa280('0x10'));_0x4d3530(_0x1ad6b9[_0xa280('0x17')][_0xa280('0x16')]);}})[_0xa280('0x18')](function(_0x529153){logger[_0xa280('0x14')](_0xa280('0xf'),_0x52ebf8,_0x529153);_0x171891(_0x529153);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index ded4966..cdb6d0b 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 _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 +var _0xaad1=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','path','Router','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','show'];(function(_0x45aa1c,_0x4a54e9){var _0x5086dc=function(_0x4f0172){while(--_0x4f0172){_0x45aa1c['push'](_0x45aa1c['shift']());}};_0x5086dc(++_0x4a54e9);}(_0xaad1,0x148));var _0x1aad=function(_0x2d3840,_0x5c0c20){_0x2d3840=_0x2d3840-0x0;var _0x36614e=_0xaad1[_0x2d3840];return _0x36614e;};'use strict';var multer=require(_0x1aad('0x0'));var util=require('util');var path=require(_0x1aad('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1aad('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1aad('0x3'));var config=require('../../config/environment');var controller=require(_0x1aad('0x4'));router[_0x1aad('0x5')]('/',auth[_0x1aad('0x6')](),controller['index']);router[_0x1aad('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x1aad('0x7')]);router['get'](_0x1aad('0x8'),auth[_0x1aad('0x6')](),controller[_0x1aad('0x9')]);router[_0x1aad('0x5')](_0x1aad('0xa'),auth[_0x1aad('0x6')](),controller[_0x1aad('0xb')]);router[_0x1aad('0xc')]('/',auth['isAuthenticated'](),controller[_0x1aad('0xd')]);router[_0x1aad('0xc')]('/:id/configurations',auth[_0x1aad('0x6')](),controller[_0x1aad('0xe')]);router[_0x1aad('0xf')](_0x1aad('0x10'),auth['isAuthenticated'](),controller[_0x1aad('0x11')]);router[_0x1aad('0x12')](_0x1aad('0x10'),auth['isAuthenticated'](),controller[_0x1aad('0x13')]);module[_0x1aad('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index e9bca74..8273f89 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 _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 +var _0x0897=['sequelize','exports','STRING'];(function(_0x103bde,_0x40f335){var _0x4b8306=function(_0x193cca){while(--_0x193cca){_0x103bde['push'](_0x103bde['shift']());}};_0x4b8306(++_0x40f335);}(_0x0897,0xa8));var _0x7089=function(_0x39a0fd,_0x5699a5){_0x39a0fd=_0x39a0fd-0x0;var _0x9ca525=_0x0897[_0x39a0fd];return _0x9ca525;};'use strict';var Sequelize=require(_0x7089('0x0'));module[_0x7089('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7089('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x7089('0x2')]},'email':{'type':Sequelize[_0x7089('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x7089('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 917b208..f719785 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 _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 +var _0xa5e4=['approval_set','work_notes','short_description','correlation_display','work_start','assignment_group','description','calendar_duration','sys_class_name','follow_up','parent_incident','contact_type','urgency','company','activity_due','assigned_to','comments','sla_due','approval','due_date','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','label','push','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','True','true','false','sys_choice?sysparm_query=name=incident^element=','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','count','Content-Range','apply','save','update','then','sendStatus','error','name','send','index','map','ServicenowAccount','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','params','rawAttributes','find','catch','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','sys_updated_on','child_incidents','hold_reason','number','opened_by','user_input','sys_created_on','sys_domain','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','caller_id'];(function(_0x46bb96,_0x334e05){var _0x198885=function(_0x5052fc){while(--_0x5052fc){_0x46bb96['push'](_0x46bb96['shift']());}};_0x198885(++_0x334e05);}(_0xa5e4,0xe5));var _0x4a5e=function(_0x286343,_0x482b7e){_0x286343=_0x286343-0x0;var _0x6a5e20=_0xa5e4[_0x286343];return _0x6a5e20;};'use strict';var emlformat=require(_0x4a5e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4a5e('0x1'));var rp=require(_0x4a5e('0x2'));var moment=require('moment');var BPromise=require(_0x4a5e('0x3'));var Mustache=require(_0x4a5e('0x4'));var util=require('util');var path=require(_0x4a5e('0x5'));var sox=require(_0x4a5e('0x6'));var csv=require(_0x4a5e('0x7'));var ejs=require(_0x4a5e('0x8'));var fs=require('fs');var fs_extra=require(_0x4a5e('0x9'));var _=require(_0x4a5e('0xa'));var squel=require(_0x4a5e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4a5e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4a5e('0xd'));var authService=require(_0x4a5e('0xe'));var qs=require(_0x4a5e('0xf'));var as=require(_0x4a5e('0x10'));var hardwareService=require(_0x4a5e('0x11'));var logger=require(_0x4a5e('0x12'))(_0x4a5e('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4a5e('0x14'));var db=require(_0x4a5e('0x15'))['db'];var integrations=require(_0x4a5e('0x16'));function respondWithStatusCode(_0x20b839,_0x42cb21){_0x42cb21=_0x42cb21||0xcc;return function(_0x1722ea){if(_0x1722ea){return _0x20b839['sendStatus'](_0x42cb21);}return _0x20b839[_0x4a5e('0x17')](_0x42cb21)[_0x4a5e('0x18')]();};}function respondWithResult(_0x395016,_0x2bb04f){_0x2bb04f=_0x2bb04f||0xc8;return function(_0x21d4ef){if(_0x21d4ef){return _0x395016[_0x4a5e('0x17')](_0x2bb04f)[_0x4a5e('0x19')](_0x21d4ef);}};}function respondWithFilteredResult(_0x27b129,_0x1a37d6){return function(_0x2a0c38){if(_0x2a0c38){var _0x1f840f=typeof _0x1a37d6[_0x4a5e('0x1a')]===_0x4a5e('0x1b')&&typeof _0x1a37d6['limit']===_0x4a5e('0x1b');var _0x356b6a=_0x2a0c38[_0x4a5e('0x1c')];var _0x46c54e=_0x1f840f?0x0:_0x1a37d6[_0x4a5e('0x1a')];var _0x13e2f3=_0x1f840f?_0x2a0c38[_0x4a5e('0x1c')]:_0x1a37d6['offset']+_0x1a37d6['limit'];var _0x1f27c3;if(_0x13e2f3>=_0x356b6a){_0x13e2f3=_0x356b6a;_0x1f27c3=0xc8;}else{_0x1f27c3=0xce;}_0x27b129[_0x4a5e('0x17')](_0x1f27c3);return _0x27b129['set'](_0x4a5e('0x1d'),_0x46c54e+'-'+_0x13e2f3+'/'+_0x356b6a)[_0x4a5e('0x19')](_0x2a0c38);}return null;};}function patchUpdates(_0x19e0b4){return function(_0x17f8e9){try{jsonpatch[_0x4a5e('0x1e')](_0x17f8e9,_0x19e0b4,!![]);}catch(_0x87d632){return BPromise['reject'](_0x87d632);}return _0x17f8e9[_0x4a5e('0x1f')]();};}function saveUpdates(_0x45146c,_0x2d4147){return function(_0xf70154){if(_0xf70154){return _0xf70154[_0x4a5e('0x20')](_0x45146c)['then'](function(_0x76175b){return _0x76175b;});}return null;};}function removeEntity(_0x57a219,_0x1a4cd3){return function(_0x30c115){if(_0x30c115){return _0x30c115['destroy']()[_0x4a5e('0x21')](function(){_0x57a219[_0x4a5e('0x17')](0xcc)[_0x4a5e('0x18')]();});}};}function handleEntityNotFound(_0x372742,_0x39eda8){return function(_0x2392a9){if(!_0x2392a9){_0x372742[_0x4a5e('0x22')](0x194);}return _0x2392a9;};}function handleError(_0x673d4,_0x4eef0e){_0x4eef0e=_0x4eef0e||0x1f4;return function(_0xc9bafd){logger[_0x4a5e('0x23')](_0xc9bafd['stack']);if(_0xc9bafd[_0x4a5e('0x24')]){delete _0xc9bafd[_0x4a5e('0x24')];}_0x673d4[_0x4a5e('0x17')](_0x4eef0e)[_0x4a5e('0x25')](_0xc9bafd);};}exports[_0x4a5e('0x26')]=function(_0x3de611,_0x5ae356){var _0x2f64f2={},_0x384586={},_0x44783c={'count':0x0,'rows':[]};var _0x27170a=_[_0x4a5e('0x27')](db[_0x4a5e('0x28')]['rawAttributes'],function(_0x2a81e9){return{'name':_0x2a81e9[_0x4a5e('0x29')],'type':_0x2a81e9[_0x4a5e('0x2a')][_0x4a5e('0x2b')]};});_0x384586[_0x4a5e('0x2c')]=_['map'](_0x27170a,_0x4a5e('0x24'));_0x384586['query']=_[_0x4a5e('0x2d')](_0x3de611[_0x4a5e('0x2e')]);_0x384586['filters']=_[_0x4a5e('0x2f')](_0x384586[_0x4a5e('0x2c')],_0x384586[_0x4a5e('0x2e')]);_0x2f64f2[_0x4a5e('0x30')]=_[_0x4a5e('0x2f')](_0x384586[_0x4a5e('0x2c')],qs[_0x4a5e('0x31')](_0x3de611[_0x4a5e('0x2e')][_0x4a5e('0x31')]));_0x2f64f2[_0x4a5e('0x30')]=_0x2f64f2[_0x4a5e('0x30')][_0x4a5e('0x32')]?_0x2f64f2['attributes']:_0x384586[_0x4a5e('0x2c')];if(!_0x3de611['query'][_0x4a5e('0x33')](_0x4a5e('0x34'))){_0x2f64f2[_0x4a5e('0x35')]=qs[_0x4a5e('0x35')](_0x3de611['query'][_0x4a5e('0x35')]);_0x2f64f2[_0x4a5e('0x1a')]=qs[_0x4a5e('0x1a')](_0x3de611['query'][_0x4a5e('0x1a')]);}_0x2f64f2[_0x4a5e('0x36')]=qs[_0x4a5e('0x37')](_0x3de611[_0x4a5e('0x2e')][_0x4a5e('0x37')]);_0x2f64f2[_0x4a5e('0x38')]=qs[_0x4a5e('0x39')](_[_0x4a5e('0x3a')](_0x3de611[_0x4a5e('0x2e')],_0x384586[_0x4a5e('0x39')]),_0x27170a);if(_0x3de611[_0x4a5e('0x2e')][_0x4a5e('0x3b')]){_0x2f64f2[_0x4a5e('0x38')]=_[_0x4a5e('0x3c')](_0x2f64f2[_0x4a5e('0x38')],{'$or':_['map'](_0x27170a,function(_0x4e95ff){if(_0x4e95ff['type']!=='VIRTUAL'){var _0x54c5ba={};_0x54c5ba[_0x4e95ff[_0x4a5e('0x24')]]={'$like':'%'+_0x3de611[_0x4a5e('0x2e')][_0x4a5e('0x3b')]+'%'};return _0x54c5ba;}})});}_0x2f64f2=_['merge']({},_0x2f64f2,_0x3de611[_0x4a5e('0x3d')]);var _0x10ac58={'where':_0x2f64f2[_0x4a5e('0x38')]};return db[_0x4a5e('0x28')]['count'](_0x10ac58)[_0x4a5e('0x21')](function(_0x40d9fb){_0x44783c[_0x4a5e('0x1c')]=_0x40d9fb;if(_0x3de611[_0x4a5e('0x2e')][_0x4a5e('0x3e')]){_0x2f64f2['include']=[{'all':!![]}];}return db[_0x4a5e('0x28')][_0x4a5e('0x3f')](_0x2f64f2);})[_0x4a5e('0x21')](function(_0x2a97d6){_0x44783c['rows']=_0x2a97d6;return _0x44783c;})[_0x4a5e('0x21')](respondWithFilteredResult(_0x5ae356,_0x2f64f2))['catch'](handleError(_0x5ae356,null));};exports['show']=function(_0x7daeb3,_0x3b4901){var _0x8158bf={'raw':![],'where':{'id':_0x7daeb3[_0x4a5e('0x40')]['id']}},_0x145c32={};_0x145c32[_0x4a5e('0x2c')]=_[_0x4a5e('0x2d')](db[_0x4a5e('0x28')][_0x4a5e('0x41')]);_0x145c32[_0x4a5e('0x2e')]=_[_0x4a5e('0x2d')](_0x7daeb3[_0x4a5e('0x2e')]);_0x145c32[_0x4a5e('0x39')]=_['intersection'](_0x145c32[_0x4a5e('0x2c')],_0x145c32[_0x4a5e('0x2e')]);_0x8158bf[_0x4a5e('0x30')]=_['intersection'](_0x145c32[_0x4a5e('0x2c')],qs[_0x4a5e('0x31')](_0x7daeb3[_0x4a5e('0x2e')][_0x4a5e('0x31')]));_0x8158bf[_0x4a5e('0x30')]=_0x8158bf[_0x4a5e('0x30')][_0x4a5e('0x32')]?_0x8158bf[_0x4a5e('0x30')]:_0x145c32[_0x4a5e('0x2c')];if(_0x7daeb3[_0x4a5e('0x2e')]['includeAll']){_0x8158bf['include']=[{'all':!![]}];}_0x8158bf=_[_0x4a5e('0x3c')]({},_0x8158bf,_0x7daeb3['options']);return db[_0x4a5e('0x28')][_0x4a5e('0x42')](_0x8158bf)[_0x4a5e('0x21')](handleEntityNotFound(_0x3b4901,null))[_0x4a5e('0x21')](respondWithResult(_0x3b4901,null))[_0x4a5e('0x43')](handleError(_0x3b4901,null));};exports[_0x4a5e('0x44')]=function(_0x3f1b28,_0x44c119){return db[_0x4a5e('0x28')]['create'](_0x3f1b28['body'],{})['then'](respondWithResult(_0x44c119,0xc9))[_0x4a5e('0x43')](handleError(_0x44c119,null));};exports['update']=function(_0x1df6d5,_0x2fe03){if(_0x1df6d5[_0x4a5e('0x45')]['id']){delete _0x1df6d5[_0x4a5e('0x45')]['id'];}return db['ServicenowAccount'][_0x4a5e('0x42')]({'where':{'id':_0x1df6d5[_0x4a5e('0x40')]['id']}})['then'](handleEntityNotFound(_0x2fe03,null))[_0x4a5e('0x21')](saveUpdates(_0x1df6d5['body'],null))[_0x4a5e('0x21')](respondWithResult(_0x2fe03,null))[_0x4a5e('0x43')](handleError(_0x2fe03,null));};exports[_0x4a5e('0x46')]=function(_0x318019,_0x388550){return db[_0x4a5e('0x28')][_0x4a5e('0x42')]({'where':{'id':_0x318019[_0x4a5e('0x40')]['id']}})[_0x4a5e('0x21')](handleEntityNotFound(_0x388550,null))['then'](removeEntity(_0x388550,null))['catch'](handleError(_0x388550,null));};exports[_0x4a5e('0x47')]=function(_0x2842b5,_0x25bc2c,_0x309443){var _0x3eebf2={};var _0x100347={};var _0x2c7691;var _0x7c1449;return db[_0x4a5e('0x28')][_0x4a5e('0x48')]({'where':{'id':_0x2842b5[_0x4a5e('0x40')]['id']}})[_0x4a5e('0x21')](handleEntityNotFound(_0x25bc2c,null))[_0x4a5e('0x21')](function(_0x26d8d0){if(_0x26d8d0){_0x2c7691=_0x26d8d0;_0x100347[_0x4a5e('0x2c')]=_[_0x4a5e('0x2d')](db[_0x4a5e('0x49')]['rawAttributes']);_0x100347[_0x4a5e('0x2e')]=_['keys'](_0x2842b5['query']);_0x100347[_0x4a5e('0x39')]=_['intersection'](_0x100347[_0x4a5e('0x2c')],_0x100347['query']);_0x3eebf2['attributes']=_[_0x4a5e('0x2f')](_0x100347['model'],qs[_0x4a5e('0x31')](_0x2842b5[_0x4a5e('0x2e')]['fields']));_0x3eebf2[_0x4a5e('0x30')]=_0x3eebf2['attributes']['length']?_0x3eebf2[_0x4a5e('0x30')]:_0x100347[_0x4a5e('0x2c')];_0x3eebf2[_0x4a5e('0x36')]=qs['sort'](_0x2842b5['query'][_0x4a5e('0x37')]);_0x3eebf2[_0x4a5e('0x38')]=qs[_0x4a5e('0x39')](_[_0x4a5e('0x3a')](_0x2842b5['query'],_0x100347[_0x4a5e('0x39')]));if(_0x2842b5['query']['filter']){_0x3eebf2['where']=_[_0x4a5e('0x3c')](_0x3eebf2[_0x4a5e('0x38')],{'$or':_[_0x4a5e('0x27')](_0x3eebf2[_0x4a5e('0x30')],function(_0x3a267b){var _0x4f9885={};_0x4f9885[_0x3a267b]={'$like':'%'+_0x2842b5[_0x4a5e('0x2e')][_0x4a5e('0x3b')]+'%'};return _0x4f9885;})});}_0x3eebf2=_[_0x4a5e('0x3c')]({},_0x3eebf2,_0x2842b5[_0x4a5e('0x3d')]);return _0x2c7691[_0x4a5e('0x47')](_0x3eebf2);}})['then'](function(_0x24c70d){if(_0x24c70d){_0x7c1449=_0x24c70d[_0x4a5e('0x32')];if(!_0x2842b5[_0x4a5e('0x2e')][_0x4a5e('0x33')](_0x4a5e('0x34'))){_0x3eebf2[_0x4a5e('0x35')]=qs[_0x4a5e('0x35')](_0x2842b5[_0x4a5e('0x2e')][_0x4a5e('0x35')]);_0x3eebf2[_0x4a5e('0x1a')]=qs[_0x4a5e('0x1a')](_0x2842b5['query'][_0x4a5e('0x1a')]);}return _0x2c7691[_0x4a5e('0x47')](_0x3eebf2);}})[_0x4a5e('0x21')](function(_0x14ba68){if(_0x14ba68){return _0x14ba68?{'count':_0x7c1449,'rows':_0x14ba68}:null;}})[_0x4a5e('0x21')](respondWithResult(_0x25bc2c,null))[_0x4a5e('0x43')](handleError(_0x25bc2c,null));};exports['addConfiguration']=function(_0x108af6,_0x1df50d,_0x1ce768){if(_0x108af6[_0x4a5e('0x45')]['id']){delete _0x108af6[_0x4a5e('0x45')]['id'];}return db[_0x4a5e('0x28')]['findOne']({'where':{'id':_0x108af6['params']['id']}})[_0x4a5e('0x21')](handleEntityNotFound(_0x1df50d,null))['then'](function(_0x1e9c22){if(_0x1e9c22){_0x108af6[_0x4a5e('0x45')]['AccountId']=_0x1e9c22['id'];_0x108af6[_0x4a5e('0x45')][_0x4a5e('0x4a')]=integrations[_0x4a5e('0x4b')](_0x108af6[_0x4a5e('0x45')][_0x4a5e('0x4c')],_0x108af6['body']['type']);_0x108af6['body'][_0x4a5e('0x4d')]=integrations[_0x4a5e('0x4e')](_0x108af6[_0x4a5e('0x45')][_0x4a5e('0x4c')],_0x108af6[_0x4a5e('0x45')][_0x4a5e('0x2a')]);return db['ServicenowConfiguration']['create'](_0x108af6['body'],{'include':[{'model':db[_0x4a5e('0x4f')],'as':'Subjects'},{'model':db[_0x4a5e('0x4f')],'as':_0x4a5e('0x4d')}]});}return null;})[_0x4a5e('0x21')](respondWithResult(_0x1df50d,null))[_0x4a5e('0x43')](handleError(_0x1df50d,null));};exports['getFields']=function(_0x4dcd14,_0x280a7a,_0xbfdac7){var _0x3c8831=['made_sla','hold_reason',_0x4a5e('0x50'),_0x4a5e('0x51'),_0x4a5e('0x52'),_0x4a5e('0x53'),_0x4a5e('0x54'),_0x4a5e('0x55'),_0x4a5e('0x56')];var _0x126986=[_0x4a5e('0x57'),'made_sla',_0x4a5e('0x58'),'watch_list','upon_reject',_0x4a5e('0x59'),_0x4a5e('0x5a'),_0x4a5e('0x5b'),'approval_history',_0x4a5e('0x5c'),'resolved_by','sys_updated_by',_0x4a5e('0x5d'),_0x4a5e('0x5e'),_0x4a5e('0x5f'),_0x4a5e('0x60'),'state','sys_created_by',_0x4a5e('0x50'),'order',_0x4a5e('0x61'),_0x4a5e('0x62'),_0x4a5e('0x63'),_0x4a5e('0x64'),_0x4a5e('0x65'),'active',_0x4a5e('0x66'),_0x4a5e('0x67'),'priority',_0x4a5e('0x68'),_0x4a5e('0x69'),_0x4a5e('0x6a'),_0x4a5e('0x6b'),'opened_at',_0x4a5e('0x6c'),_0x4a5e('0x6d'),_0x4a5e('0x6e'),_0x4a5e('0x6f'),'resolved_at',_0x4a5e('0x70'),_0x4a5e('0x71'),_0x4a5e('0x51'),_0x4a5e('0x72'),_0x4a5e('0x73'),'close_code',_0x4a5e('0x74'),'delivery_task',_0x4a5e('0x75'),_0x4a5e('0x76'),'business_stc','additional_assignee_list',_0x4a5e('0x77'),_0x4a5e('0x78'),_0x4a5e('0x53'),_0x4a5e('0x79'),'close_notes','closed_by',_0x4a5e('0x7a'),_0x4a5e('0x7b'),'sys_id',_0x4a5e('0x7c'),'reopened_by',_0x4a5e('0x54'),_0x4a5e('0x7d'),'problem_id',_0x4a5e('0x7e'),'reassignment_count',_0x4a5e('0x7f'),_0x4a5e('0x80'),_0x4a5e('0x55'),_0x4a5e('0x81'),_0x4a5e('0x82'),_0x4a5e('0x83'),'comments_and_work_notes',_0x4a5e('0x84'),_0x4a5e('0x85'),'reopen_count',_0x4a5e('0x86'),_0x4a5e('0x87'),_0x4a5e('0x88'),_0x4a5e('0x89'),_0x4a5e('0x8a'),'category'];var _0x26a09c='';var _0x441b8d='';var _0x18648b=[];var _0x4aa25d='';var _0x3f368a='';var _0x217027=[];var _0x556fef='';var _0xec571='';var _0x277eea={};var _0xe0287c='';return db[_0x4a5e('0x28')][_0x4a5e('0x48')]({'where':{'id':_0x4dcd14['params']['id']},'attributes':['id',_0x4a5e('0x8b'),_0x4a5e('0x8c'),'email',_0x4a5e('0x8d'),_0x4a5e('0x8e')]})[_0x4a5e('0x21')](handleEntityNotFound(_0x280a7a,null))[_0x4a5e('0x21')](function(_0x4ad17c){if(_0x4ad17c){_0xe0287c=_0x4ad17c[_0x4a5e('0x8d')];var _0x320929=_0xe0287c[_0x4a5e('0x8f')](-0x1);if(_0x320929==='/'){_0xe0287c=_0xe0287c[_0x4a5e('0x90')](0x0,_0xe0287c['lastIndexOf'](_0x320929));}_0xec571=util[_0x4a5e('0x91')](_0x4a5e('0x92'),_0xe0287c);_0x556fef=util['format'](_0x4a5e('0x93'),_0xe0287c);_0x277eea={'user':_0x4ad17c[_0x4a5e('0x8b')],'pass':_0x4ad17c[_0x4a5e('0x8c')]};var _0x5e8287={'method':_0x4a5e('0x94'),'uri':_0xec571+_0x4a5e('0x95'),'auth':_0x277eea,'json':!![]};return rp(_0x5e8287);}})[_0x4a5e('0x21')](function(_0x5e3e0e){if(_0x5e3e0e[_0x4a5e('0x96')][_0x4a5e('0x32')]>0x0){_0x26a09c=_0x5e3e0e[_0x4a5e('0x96')];}console[_0x4a5e('0x97')](_0x4a5e('0x98'),_0x26a09c);_0x217027=[];_0x441b8d=Object[_0x4a5e('0x99')]([],_0x26a09c);_[_0x4a5e('0x9a')](_0x441b8d,function(_0x589e96){return!_0x3c8831['includes'](_0x589e96[_0x4a5e('0x24')]);});_0x441b8d['forEach'](function(_0x136888){var _0x52e472=createFieldObject(_0x556fef,_0x277eea,_0x136888['internalType'],_0x136888[_0x4a5e('0x24')],_0x136888[_0x4a5e('0x9b')],![]);_0x217027[_0x4a5e('0x9c')](_0x52e472);});return Promise[_0x4a5e('0x9d')](_0x217027);})['then'](function(_0x3bc0b7){_0x18648b=_0x3bc0b7;_0x4aa25d=Object[_0x4a5e('0x99')]([],_0x26a09c);console[_0x4a5e('0x97')](_0x4a5e('0x9e'),_0x26a09c);_[_0x4a5e('0x9a')](_0x4aa25d,function(_0xdfa89f){return _0x126986[_0x4a5e('0x9f')](_0xdfa89f[_0x4a5e('0x24')]);});console[_0x4a5e('0x97')](_0x4a5e('0xa0'),_0x4aa25d);_0x217027=[];_0x4aa25d[_0x4a5e('0xa1')](function(_0x5e74de){var _0x267725=createFieldObject(_0x556fef,_0x277eea,_0x5e74de['internalType'],_0x5e74de['name'],_0x5e74de[_0x4a5e('0x9b')],!![]);_0x217027[_0x4a5e('0x9c')](_0x267725);});return Promise['all'](_0x217027);})['then'](function(_0x580c60){_0x3f368a=_0x580c60;var _0x45ad1a=_0x18648b[_0x4a5e('0xa2')](_0x3f368a);return{'count':_0x45ad1a[_0x4a5e('0x32')],'rows':_0x45ad1a};})[_0x4a5e('0x21')](respondWithResult(_0x280a7a,null))[_0x4a5e('0x43')](function(_0x42c0ce){console[_0x4a5e('0x97')](_0x4a5e('0xa3')+_0x42c0ce);var _0x2e9c98=_0x4dcd14[_0x4a5e('0x2e')][_0x4a5e('0xa4')]?0x1f4:_0x42c0ce[_0x4a5e('0xa5')]||0x1f4;logger[_0x4a5e('0x23')](_0x42c0ce['stack']);delete _0x42c0ce[_0x4a5e('0x24')];if(_0x2e9c98===0x191){_0x2e9c98=0x190;}_0x280a7a[_0x4a5e('0x17')](_0x2e9c98)[_0x4a5e('0x25')](_0x4dcd14[_0x4a5e('0x2e')]['test']?{'message':_0x4a5e('0xa6'),'statusCode':_0x42c0ce[_0x4a5e('0xa5')]}:_0x42c0ce);});};function createFieldObject(_0x56e949,_0x1de9d4,_0x4b4858,_0x243c42,_0x10a3bc,_0x550122){return new Promise(function(_0xd6478f,_0x132c1){var _0x5b89ea={'id':_0x243c42,'name':_0x10a3bc,'custom':_0x550122};if(_0x4b4858==='boolean'){_0x5b89ea[_0x4a5e('0x3d')]=[{'name':_0x4a5e('0xa7'),'value':_0x4a5e('0xa8')},{'name':'False','value':_0x4a5e('0xa9')}];_0xd6478f(_0x5b89ea);}else{var _0x2b2176={'method':'GET','uri':_0x56e949+_0x4a5e('0xaa')+_0x243c42,'auth':_0x1de9d4,'json':!![]};return rp(_0x2b2176)[_0x4a5e('0x21')](function(_0x277f2d){var _0x4cd8e=[];if(_0x277f2d[_0x4a5e('0x96')][_0x4a5e('0x32')]>0x0){_0x277f2d['result']['forEach'](function(_0x601523){if(_0x601523['inactive']===_0x4a5e('0xa9')){var _0x114b2a={'name':_0x601523['label'],'value':_0x601523['value']};_0x4cd8e[_0x4a5e('0x9c')](_0x114b2a);}});}_0x5b89ea[_0x4a5e('0x3d')]=_0x4cd8e;if(_0x5b89ea[_0x4a5e('0x3d')][_0x4a5e('0x32')]>0x0){_0xd6478f(_0x5b89ea);}else{if(_0x550122==![]){_0xd6478f();}else{_0xd6478f(_0x5b89ea);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index a164b0b..88eae3b 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 _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 +var _0xb138=['int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','ServicenowAccount'];(function(_0x2c6eb8,_0x58ea05){var _0xec20c1=function(_0x56546f){while(--_0x56546f){_0x2c6eb8['push'](_0x2c6eb8['shift']());}};_0xec20c1(++_0x58ea05);}(_0xb138,0x1dd));var _0x8b13=function(_0x512aa7,_0x2be0d9){_0x512aa7=_0x512aa7-0x0;var _0x952539=_0xb138[_0x512aa7];return _0x952539;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var BPromise=require(_0x8b13('0x5'));var rp=require(_0x8b13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var attributes=require(_0x8b13('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x8b13('0xa')]=function(_0x13f7bd,_0x5d51b1){return _0x13f7bd[_0x8b13('0xb')](_0x8b13('0xc'),attributes,{'tableName':_0x8b13('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index c239e93..deae783 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 _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 +var _0x6395=['error','code','message','result','catch','GetServicenowAccount','findAll','options','raw','where','attributes','limit','include','model','map','debug','stringify','ShowServicenowAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x33cd72,_0x17f036){var _0x58fe05=function(_0x4396f8){while(--_0x4396f8){_0x33cd72['push'](_0x33cd72['shift']());}};_0x58fe05(++_0x17f036);}(_0x6395,0x1cd));var _0x5639=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6395[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x5639('0x0'));var util=require(_0x5639('0x1'));var moment=require('moment');var BPromise=require(_0x5639('0x2'));var rs=require(_0x5639('0x3'));var fs=require('fs');var Redis=require(_0x5639('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5639('0x5'));var logger=require(_0x5639('0x6'))('rpc');var config=require(_0x5639('0x7'));var jayson=require(_0x5639('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x86710c,_0x44de42,_0x17e548){return new BPromise(function(_0x452f1c,_0x250323){return client[_0x5639('0x9')](_0x86710c,_0x17e548)[_0x5639('0xa')](function(_0x35549f){logger[_0x5639('0xb')](_0x5639('0xc'),_0x44de42,'request\x20sent');logger['debug'](_0x5639('0xd'),_0x44de42,_0x5639('0xe'),JSON['stringify'](_0x35549f));if(_0x35549f['error']){if(_0x35549f[_0x5639('0xf')][_0x5639('0x10')]===0x1f4){logger[_0x5639('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x44de42,_0x35549f['error'][_0x5639('0x11')]);return _0x250323(_0x35549f['error'][_0x5639('0x11')]);}logger[_0x5639('0xf')](_0x5639('0xc'),_0x44de42,_0x35549f[_0x5639('0xf')][_0x5639('0x11')]);return _0x452f1c(_0x35549f[_0x5639('0xf')]['message']);}else{logger[_0x5639('0xb')](_0x5639('0xc'),_0x44de42,_0x5639('0xe'));_0x452f1c(_0x35549f[_0x5639('0x12')][_0x5639('0x11')]);}})[_0x5639('0x13')](function(_0x5822d0){logger[_0x5639('0xf')](_0x5639('0xc'),_0x44de42,_0x5822d0);_0x250323(_0x5822d0);});});}exports[_0x5639('0x14')]=function(_0x15a0cd){var _0x23af72=this;return new Promise(function(_0x557e1e,_0x42a211){return db['ServicenowAccount'][_0x5639('0x15')]({'raw':_0x15a0cd['options']?_0x15a0cd[_0x5639('0x16')][_0x5639('0x17')]===undefined?!![]:![]:!![],'where':_0x15a0cd[_0x5639('0x16')]?_0x15a0cd['options'][_0x5639('0x18')]||null:null,'attributes':_0x15a0cd[_0x5639('0x16')]?_0x15a0cd[_0x5639('0x16')][_0x5639('0x19')]||null:null,'limit':_0x15a0cd[_0x5639('0x16')]?_0x15a0cd['options'][_0x5639('0x1a')]||null:null,'include':_0x15a0cd[_0x5639('0x16')]?_0x15a0cd[_0x5639('0x16')][_0x5639('0x1b')]?_['map'](_0x15a0cd['options']['include'],function(_0x230552){return{'model':db[_0x230552[_0x5639('0x1c')]],'as':_0x230552['as'],'attributes':_0x230552[_0x5639('0x19')],'include':_0x230552[_0x5639('0x1b')]?_[_0x5639('0x1d')](_0x230552[_0x5639('0x1b')],function(_0x2964cc){return{'model':db[_0x2964cc[_0x5639('0x1c')]],'as':_0x2964cc['as'],'attributes':_0x2964cc[_0x5639('0x19')],'include':_0x2964cc[_0x5639('0x1b')]?_[_0x5639('0x1d')](_0x2964cc[_0x5639('0x1b')],function(_0x14dd32){return{'model':db[_0x14dd32[_0x5639('0x1c')]],'as':_0x14dd32['as'],'attributes':_0x14dd32['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x504ec1){logger[_0x5639('0xb')]('GetServicenowAccount',_0x15a0cd);logger[_0x5639('0x1e')](_0x5639('0x14'),_0x15a0cd,JSON[_0x5639('0x1f')](_0x504ec1));_0x557e1e(_0x504ec1);})[_0x5639('0x13')](function(_0x523394){logger[_0x5639('0xf')]('GetServicenowAccount',_0x523394[_0x5639('0x11')],_0x15a0cd);_0x42a211(_0x23af72[_0x5639('0xf')](0x1f4,_0x523394[_0x5639('0x11')]));});});};exports[_0x5639('0x20')]=function(_0x2f395d){var _0x3a0fde=this;return new Promise(function(_0x436851,_0x3d0923){return db['ServicenowAccount'][_0x5639('0x21')]({'raw':_0x2f395d[_0x5639('0x16')]?_0x2f395d['options']['raw']===undefined?!![]:![]:!![],'where':_0x2f395d[_0x5639('0x16')]?_0x2f395d[_0x5639('0x16')][_0x5639('0x18')]||null:null,'attributes':_0x2f395d['options']?_0x2f395d[_0x5639('0x16')][_0x5639('0x19')]||null:null,'include':_0x2f395d[_0x5639('0x16')]?_0x2f395d[_0x5639('0x16')][_0x5639('0x1b')]?_[_0x5639('0x1d')](_0x2f395d[_0x5639('0x16')][_0x5639('0x1b')],function(_0x311109){return{'model':db[_0x311109[_0x5639('0x1c')]],'as':_0x311109['as'],'attributes':_0x311109[_0x5639('0x19')],'include':_0x311109[_0x5639('0x1b')]?_[_0x5639('0x1d')](_0x311109['include'],function(_0x333145){return{'model':db[_0x333145[_0x5639('0x1c')]],'as':_0x333145['as'],'attributes':_0x333145['attributes'],'include':_0x333145[_0x5639('0x1b')]?_[_0x5639('0x1d')](_0x333145[_0x5639('0x1b')],function(_0x177eaa){return{'model':db[_0x177eaa[_0x5639('0x1c')]],'as':_0x177eaa['as'],'attributes':_0x177eaa[_0x5639('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5639('0xa')](function(_0x1a831d){logger[_0x5639('0xb')]('ShowServicenowAccount',_0x2f395d);logger[_0x5639('0x1e')](_0x5639('0x20'),_0x2f395d,JSON[_0x5639('0x1f')](_0x1a831d));_0x436851(_0x1a831d);})[_0x5639('0x13')](function(_0x11f97a){logger['error'](_0x5639('0x20'),_0x11f97a[_0x5639('0x11')],_0x2f395d);_0x3d0923(_0x3a0fde[_0x5639('0xf')](0x1f4,_0x11f97a[_0x5639('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 9861b03..7468918 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 _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 +var _0xd396=['update','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','isAuthenticated','get','show','/:id/subjects','/:id/descriptions','post','create'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0xd396,0x81));var _0x6d39=function(_0x53b93b,_0x1bfab1){_0x53b93b=_0x53b93b-0x0;var _0x485761=_0xd396[_0x53b93b];return _0x485761;};'use strict';var multer=require(_0x6d39('0x0'));var util=require(_0x6d39('0x1'));var path=require('path');var timeout=require(_0x6d39('0x2'));var express=require(_0x6d39('0x3'));var router=express[_0x6d39('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6d39('0x5'));var interaction=require(_0x6d39('0x6'));var config=require('../../config/environment');var controller=require(_0x6d39('0x7'));router['get']('/',auth[_0x6d39('0x8')](),controller['index']);router[_0x6d39('0x9')]('/:id',auth[_0x6d39('0x8')](),controller[_0x6d39('0xa')]);router[_0x6d39('0x9')]('/:id/fields',auth[_0x6d39('0x8')](),controller['getFields']);router[_0x6d39('0x9')](_0x6d39('0xb'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x6d39('0x9')](_0x6d39('0xc'),auth[_0x6d39('0x8')](),controller['getDescriptions']);router[_0x6d39('0xd')]('/',auth[_0x6d39('0x8')](),controller[_0x6d39('0xe')]);router['put']('/:id',auth[_0x6d39('0x8')](),controller[_0x6d39('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index c1554fe..be6f5aa 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 _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 +var _0x5c2a=['exports','STRING'];(function(_0x5d98f1,_0x5e6890){var _0x7dd486=function(_0x477052){while(--_0x477052){_0x5d98f1['push'](_0x5d98f1['shift']());}};_0x7dd486(++_0x5e6890);}(_0x5c2a,0xec));var _0xa5c2=function(_0x326e79,_0x33dc91){_0x326e79=_0x326e79-0x0;var _0x37eb89=_0x5c2a[_0x326e79];return _0x37eb89;};'use strict';var Sequelize=require('sequelize');module[_0xa5c2('0x0')]={'name':{'type':Sequelize[_0xa5c2('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 9bf28f1..6a97929 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 _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 +var _0x8263=['type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys','rawAttributes','includeAll','create','body','find','getFields','ServicenowField','filter','nolimit','getSubjects','findOne','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','then','destroy','error','name','send','index','map','ServicenowConfiguration','fieldName'];(function(_0x20ae51,_0x13848b){var _0x350b3c=function(_0x4688cc){while(--_0x4688cc){_0x20ae51['push'](_0x20ae51['shift']());}};_0x350b3c(++_0x13848b);}(_0x8263,0x16f));var _0x3826=function(_0x5c3de9,_0x41a145){_0x5c3de9=_0x5c3de9-0x0;var _0x2d79a3=_0x8263[_0x5c3de9];return _0x2d79a3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3826('0x0'));var zipdir=require(_0x3826('0x1'));var jsonpatch=require(_0x3826('0x2'));var rp=require(_0x3826('0x3'));var moment=require(_0x3826('0x4'));var BPromise=require(_0x3826('0x5'));var Mustache=require(_0x3826('0x6'));var util=require(_0x3826('0x7'));var path=require(_0x3826('0x8'));var sox=require(_0x3826('0x9'));var csv=require(_0x3826('0xa'));var ejs=require(_0x3826('0xb'));var fs=require('fs');var fs_extra=require(_0x3826('0xc'));var _=require(_0x3826('0xd'));var squel=require(_0x3826('0xe'));var crypto=require(_0x3826('0xf'));var jsforce=require(_0x3826('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x3826('0xa'));var querystring=require(_0x3826('0x11'));var Papa=require(_0x3826('0x12'));var Redis=require('ioredis');var authService=require(_0x3826('0x13'));var qs=require(_0x3826('0x14'));var as=require(_0x3826('0x15'));var hardwareService=require(_0x3826('0x16'));var logger=require(_0x3826('0x17'))(_0x3826('0x18'));var utils=require(_0x3826('0x19'));var config=require(_0x3826('0x1a'));var licenseUtil=require(_0x3826('0x1b'));var db=require(_0x3826('0x1c'))['db'];function respondWithStatusCode(_0x4bf7c6,_0x814d82){_0x814d82=_0x814d82||0xcc;return function(_0x2b36dc){if(_0x2b36dc){return _0x4bf7c6[_0x3826('0x1d')](_0x814d82);}return _0x4bf7c6[_0x3826('0x1e')](_0x814d82)['end']();};}function respondWithResult(_0x2a7297,_0x56e7bd){_0x56e7bd=_0x56e7bd||0xc8;return function(_0x3a02c5){if(_0x3a02c5){return _0x2a7297[_0x3826('0x1e')](_0x56e7bd)[_0x3826('0x1f')](_0x3a02c5);}};}function respondWithFilteredResult(_0x5d1b1,_0x2bd2eb){return function(_0x5a66ec){if(_0x5a66ec){var _0x55b249=typeof _0x2bd2eb[_0x3826('0x20')]===_0x3826('0x21')&&typeof _0x2bd2eb[_0x3826('0x22')]==='undefined';var _0x58f402=_0x5a66ec[_0x3826('0x23')];var _0x5b7443=_0x55b249?0x0:_0x2bd2eb[_0x3826('0x20')];var _0x25502e=_0x55b249?_0x5a66ec[_0x3826('0x23')]:_0x2bd2eb[_0x3826('0x20')]+_0x2bd2eb[_0x3826('0x22')];var _0x3866d8;if(_0x25502e>=_0x58f402){_0x25502e=_0x58f402;_0x3866d8=0xc8;}else{_0x3866d8=0xce;}_0x5d1b1[_0x3826('0x1e')](_0x3866d8);return _0x5d1b1[_0x3826('0x24')]('Content-Range',_0x5b7443+'-'+_0x25502e+'/'+_0x58f402)[_0x3826('0x1f')](_0x5a66ec);}return null;};}function patchUpdates(_0xaf84aa){return function(_0x767225){try{jsonpatch['apply'](_0x767225,_0xaf84aa,!![]);}catch(_0x91c282){return BPromise[_0x3826('0x25')](_0x91c282);}return _0x767225[_0x3826('0x26')]();};}function saveUpdates(_0x34c5ca,_0x146243){return function(_0x2221d6){if(_0x2221d6){return _0x2221d6['update'](_0x34c5ca)[_0x3826('0x27')](function(_0x23ff19){return _0x23ff19;});}return null;};}function removeEntity(_0x4c6d3f,_0x5ad974){return function(_0x5594aa){if(_0x5594aa){return _0x5594aa[_0x3826('0x28')]()[_0x3826('0x27')](function(){_0x4c6d3f[_0x3826('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a4489,_0x46a123){return function(_0x2e53e7){if(!_0x2e53e7){_0x1a4489[_0x3826('0x1d')](0x194);}return _0x2e53e7;};}function handleError(_0x27457f,_0x527ae5){_0x527ae5=_0x527ae5||0x1f4;return function(_0x3e017e){logger[_0x3826('0x29')](_0x3e017e['stack']);if(_0x3e017e[_0x3826('0x2a')]){delete _0x3e017e[_0x3826('0x2a')];}_0x27457f[_0x3826('0x1e')](_0x527ae5)[_0x3826('0x2b')](_0x3e017e);};}exports[_0x3826('0x2c')]=function(_0x16638c,_0x471e80){var _0x392826={},_0x230332={},_0x2ed3fd={'count':0x0,'rows':[]};var _0x3d42ea=_[_0x3826('0x2d')](db[_0x3826('0x2e')]['rawAttributes'],function(_0x70df63){return{'name':_0x70df63[_0x3826('0x2f')],'type':_0x70df63[_0x3826('0x30')][_0x3826('0x31')]};});_0x230332[_0x3826('0x32')]=_[_0x3826('0x2d')](_0x3d42ea,'name');_0x230332[_0x3826('0x33')]=_['keys'](_0x16638c[_0x3826('0x33')]);_0x230332[_0x3826('0x34')]=_[_0x3826('0x35')](_0x230332[_0x3826('0x32')],_0x230332['query']);_0x392826[_0x3826('0x36')]=_[_0x3826('0x35')](_0x230332['model'],qs[_0x3826('0x37')](_0x16638c[_0x3826('0x33')][_0x3826('0x37')]));_0x392826[_0x3826('0x36')]=_0x392826[_0x3826('0x36')][_0x3826('0x38')]?_0x392826['attributes']:_0x230332[_0x3826('0x32')];if(!_0x16638c['query'][_0x3826('0x39')]('nolimit')){_0x392826[_0x3826('0x22')]=qs[_0x3826('0x22')](_0x16638c[_0x3826('0x33')]['limit']);_0x392826[_0x3826('0x20')]=qs[_0x3826('0x20')](_0x16638c['query']['offset']);}_0x392826[_0x3826('0x3a')]=qs[_0x3826('0x3b')](_0x16638c[_0x3826('0x33')][_0x3826('0x3b')]);_0x392826[_0x3826('0x3c')]=qs[_0x3826('0x34')](_[_0x3826('0x3d')](_0x16638c[_0x3826('0x33')],_0x230332['filters']),_0x3d42ea);if(_0x16638c[_0x3826('0x33')]['filter']){_0x392826['where']=_[_0x3826('0x3e')](_0x392826[_0x3826('0x3c')],{'$or':_[_0x3826('0x2d')](_0x3d42ea,function(_0xe8d77e){if(_0xe8d77e['type']!==_0x3826('0x3f')){var _0x338595={};_0x338595[_0xe8d77e[_0x3826('0x2a')]]={'$like':'%'+_0x16638c['query']['filter']+'%'};return _0x338595;}})});}_0x392826=_['merge']({},_0x392826,_0x16638c[_0x3826('0x40')]);var _0x16d10d={'where':_0x392826['where']};return db[_0x3826('0x2e')][_0x3826('0x23')](_0x16d10d)[_0x3826('0x27')](function(_0x43fb4a){_0x2ed3fd[_0x3826('0x23')]=_0x43fb4a;if(_0x16638c[_0x3826('0x33')]['includeAll']){_0x392826[_0x3826('0x41')]=[{'all':!![]}];}return db[_0x3826('0x2e')][_0x3826('0x42')](_0x392826);})['then'](function(_0x37398f){_0x2ed3fd[_0x3826('0x43')]=_0x37398f;return _0x2ed3fd;})[_0x3826('0x27')](respondWithFilteredResult(_0x471e80,_0x392826))[_0x3826('0x44')](handleError(_0x471e80,null));};exports['show']=function(_0x407057,_0xc5da4){var _0x102590={'raw':![],'where':{'id':_0x407057[_0x3826('0x45')]['id']}},_0x1455f1={};_0x1455f1[_0x3826('0x32')]=_[_0x3826('0x46')](db['ServicenowConfiguration'][_0x3826('0x47')]);_0x1455f1[_0x3826('0x33')]=_[_0x3826('0x46')](_0x407057[_0x3826('0x33')]);_0x1455f1[_0x3826('0x34')]=_['intersection'](_0x1455f1[_0x3826('0x32')],_0x1455f1[_0x3826('0x33')]);_0x102590[_0x3826('0x36')]=_['intersection'](_0x1455f1[_0x3826('0x32')],qs[_0x3826('0x37')](_0x407057['query'][_0x3826('0x37')]));_0x102590[_0x3826('0x36')]=_0x102590[_0x3826('0x36')]['length']?_0x102590[_0x3826('0x36')]:_0x1455f1['model'];if(_0x407057[_0x3826('0x33')][_0x3826('0x48')]){_0x102590[_0x3826('0x41')]=[{'all':!![]}];}_0x102590=_[_0x3826('0x3e')]({},_0x102590,_0x407057[_0x3826('0x40')]);return db[_0x3826('0x2e')]['find'](_0x102590)[_0x3826('0x27')](handleEntityNotFound(_0xc5da4,null))[_0x3826('0x27')](respondWithResult(_0xc5da4,null))[_0x3826('0x44')](handleError(_0xc5da4,null));};exports[_0x3826('0x49')]=function(_0x19e09b,_0x17e88b){return db[_0x3826('0x2e')][_0x3826('0x49')](_0x19e09b[_0x3826('0x4a')],{})[_0x3826('0x27')](respondWithResult(_0x17e88b,0xc9))[_0x3826('0x44')](handleError(_0x17e88b,null));};exports['update']=function(_0x3c79c1,_0x67a9a7){if(_0x3c79c1[_0x3826('0x4a')]['id']){delete _0x3c79c1[_0x3826('0x4a')]['id'];}return db[_0x3826('0x2e')][_0x3826('0x4b')]({'where':{'id':_0x3c79c1[_0x3826('0x45')]['id']}})[_0x3826('0x27')](handleEntityNotFound(_0x67a9a7,null))[_0x3826('0x27')](saveUpdates(_0x3c79c1[_0x3826('0x4a')],null))['then'](respondWithResult(_0x67a9a7,null))['catch'](handleError(_0x67a9a7,null));};exports[_0x3826('0x28')]=function(_0x59934d,_0x599c3d){return db['ServicenowConfiguration'][_0x3826('0x4b')]({'where':{'id':_0x59934d['params']['id']}})['then'](handleEntityNotFound(_0x599c3d,null))['then'](removeEntity(_0x599c3d,null))[_0x3826('0x44')](handleError(_0x599c3d,null));};exports[_0x3826('0x4c')]=function(_0x2da309,_0x3ceba9,_0x1635ea){var _0x21aded={};var _0x4d5538={};var _0x20a6f1;var _0x95973c;return db[_0x3826('0x2e')]['findOne']({'where':{'id':_0x2da309[_0x3826('0x45')]['id']}})[_0x3826('0x27')](handleEntityNotFound(_0x3ceba9,null))[_0x3826('0x27')](function(_0x211435){if(_0x211435){_0x20a6f1=_0x211435;_0x4d5538['model']=_[_0x3826('0x46')](db[_0x3826('0x4d')][_0x3826('0x47')]);_0x4d5538['query']=_[_0x3826('0x46')](_0x2da309[_0x3826('0x33')]);_0x4d5538[_0x3826('0x34')]=_['intersection'](_0x4d5538[_0x3826('0x32')],_0x4d5538['query']);_0x21aded[_0x3826('0x36')]=_[_0x3826('0x35')](_0x4d5538[_0x3826('0x32')],qs[_0x3826('0x37')](_0x2da309[_0x3826('0x33')][_0x3826('0x37')]));_0x21aded[_0x3826('0x36')]=_0x21aded[_0x3826('0x36')][_0x3826('0x38')]?_0x21aded['attributes']:_0x4d5538[_0x3826('0x32')];_0x21aded['order']=qs[_0x3826('0x3b')](_0x2da309[_0x3826('0x33')]['sort']);_0x21aded[_0x3826('0x3c')]=qs[_0x3826('0x34')](_[_0x3826('0x3d')](_0x2da309[_0x3826('0x33')],_0x4d5538['filters']));if(_0x2da309[_0x3826('0x33')]['filter']){_0x21aded['where']=_[_0x3826('0x3e')](_0x21aded['where'],{'$or':_[_0x3826('0x2d')](_0x21aded[_0x3826('0x36')],function(_0x51dca8){var _0x3158eb={};_0x3158eb[_0x51dca8]={'$like':'%'+_0x2da309[_0x3826('0x33')][_0x3826('0x4e')]+'%'};return _0x3158eb;})});}_0x21aded=_['merge']({},_0x21aded,_0x2da309[_0x3826('0x40')]);return _0x20a6f1[_0x3826('0x4c')](_0x21aded);}})[_0x3826('0x27')](function(_0x1118a5){if(_0x1118a5){_0x95973c=_0x1118a5['length'];if(!_0x2da309[_0x3826('0x33')][_0x3826('0x39')](_0x3826('0x4f'))){_0x21aded['limit']=qs['limit'](_0x2da309[_0x3826('0x33')][_0x3826('0x22')]);_0x21aded[_0x3826('0x20')]=qs['offset'](_0x2da309[_0x3826('0x33')][_0x3826('0x20')]);}return _0x20a6f1[_0x3826('0x4c')](_0x21aded);}})[_0x3826('0x27')](function(_0x308564){if(_0x308564){return _0x308564?{'count':_0x95973c,'rows':_0x308564}:null;}})['then'](respondWithResult(_0x3ceba9,null))[_0x3826('0x44')](handleError(_0x3ceba9,null));};exports[_0x3826('0x50')]=function(_0x3b0ac1,_0x3bdab5,_0x2df24f){var _0x1965af={};var _0x1ecfc3={};var _0x52c06d;var _0x4d21d7;return db[_0x3826('0x2e')][_0x3826('0x51')]({'where':{'id':_0x3b0ac1[_0x3826('0x45')]['id']}})[_0x3826('0x27')](handleEntityNotFound(_0x3bdab5,null))[_0x3826('0x27')](function(_0x4197a8){if(_0x4197a8){_0x52c06d=_0x4197a8;_0x1ecfc3[_0x3826('0x32')]=_[_0x3826('0x46')](db[_0x3826('0x4d')][_0x3826('0x47')]);_0x1ecfc3[_0x3826('0x33')]=_[_0x3826('0x46')](_0x3b0ac1['query']);_0x1ecfc3[_0x3826('0x34')]=_[_0x3826('0x35')](_0x1ecfc3[_0x3826('0x32')],_0x1ecfc3['query']);_0x1965af[_0x3826('0x36')]=_[_0x3826('0x35')](_0x1ecfc3[_0x3826('0x32')],qs[_0x3826('0x37')](_0x3b0ac1['query']['fields']));_0x1965af[_0x3826('0x36')]=_0x1965af[_0x3826('0x36')][_0x3826('0x38')]?_0x1965af[_0x3826('0x36')]:_0x1ecfc3['model'];_0x1965af[_0x3826('0x3a')]=qs['sort'](_0x3b0ac1[_0x3826('0x33')][_0x3826('0x3b')]);_0x1965af[_0x3826('0x3c')]=qs['filters'](_['pick'](_0x3b0ac1[_0x3826('0x33')],_0x1ecfc3[_0x3826('0x34')]));if(_0x3b0ac1['query'][_0x3826('0x4e')]){_0x1965af[_0x3826('0x3c')]=_[_0x3826('0x3e')](_0x1965af['where'],{'$or':_['map'](_0x1965af[_0x3826('0x36')],function(_0x1b1f71){var _0x74c7f9={};_0x74c7f9[_0x1b1f71]={'$like':'%'+_0x3b0ac1[_0x3826('0x33')]['filter']+'%'};return _0x74c7f9;})});}_0x1965af=_[_0x3826('0x3e')]({},_0x1965af,_0x3b0ac1[_0x3826('0x40')]);return _0x52c06d[_0x3826('0x50')](_0x1965af);}})[_0x3826('0x27')](function(_0x5abb11){if(_0x5abb11){_0x4d21d7=_0x5abb11[_0x3826('0x38')];if(!_0x3b0ac1[_0x3826('0x33')]['hasOwnProperty'](_0x3826('0x4f'))){_0x1965af[_0x3826('0x22')]=qs[_0x3826('0x22')](_0x3b0ac1[_0x3826('0x33')]['limit']);_0x1965af['offset']=qs['offset'](_0x3b0ac1[_0x3826('0x33')][_0x3826('0x20')]);}return _0x52c06d[_0x3826('0x50')](_0x1965af);}})[_0x3826('0x27')](function(_0x18638a){if(_0x18638a){return _0x18638a?{'count':_0x4d21d7,'rows':_0x18638a}:null;}})['then'](respondWithResult(_0x3bdab5,null))['catch'](handleError(_0x3bdab5,null));};exports['getDescriptions']=function(_0x3e37fd,_0x20971f,_0x2f70da){var _0x10c1a8={};var _0x21f801={};var _0xed1d8e;var _0x2d48a8;return db['ServicenowConfiguration'][_0x3826('0x51')]({'where':{'id':_0x3e37fd[_0x3826('0x45')]['id']}})[_0x3826('0x27')](handleEntityNotFound(_0x20971f,null))['then'](function(_0x44d8a6){if(_0x44d8a6){_0xed1d8e=_0x44d8a6;_0x21f801['model']=_[_0x3826('0x46')](db[_0x3826('0x4d')]['rawAttributes']);_0x21f801[_0x3826('0x33')]=_[_0x3826('0x46')](_0x3e37fd['query']);_0x21f801[_0x3826('0x34')]=_[_0x3826('0x35')](_0x21f801[_0x3826('0x32')],_0x21f801[_0x3826('0x33')]);_0x10c1a8[_0x3826('0x36')]=_[_0x3826('0x35')](_0x21f801[_0x3826('0x32')],qs[_0x3826('0x37')](_0x3e37fd[_0x3826('0x33')]['fields']));_0x10c1a8[_0x3826('0x36')]=_0x10c1a8[_0x3826('0x36')][_0x3826('0x38')]?_0x10c1a8[_0x3826('0x36')]:_0x21f801[_0x3826('0x32')];_0x10c1a8[_0x3826('0x3a')]=qs[_0x3826('0x3b')](_0x3e37fd[_0x3826('0x33')][_0x3826('0x3b')]);_0x10c1a8[_0x3826('0x3c')]=qs[_0x3826('0x34')](_['pick'](_0x3e37fd['query'],_0x21f801[_0x3826('0x34')]));if(_0x3e37fd[_0x3826('0x33')]['filter']){_0x10c1a8[_0x3826('0x3c')]=_[_0x3826('0x3e')](_0x10c1a8[_0x3826('0x3c')],{'$or':_['map'](_0x10c1a8[_0x3826('0x36')],function(_0xcb9665){var _0x42173e={};_0x42173e[_0xcb9665]={'$like':'%'+_0x3e37fd[_0x3826('0x33')][_0x3826('0x4e')]+'%'};return _0x42173e;})});}_0x10c1a8=_[_0x3826('0x3e')]({},_0x10c1a8,_0x3e37fd[_0x3826('0x40')]);return _0xed1d8e[_0x3826('0x52')](_0x10c1a8);}})[_0x3826('0x27')](function(_0x689ec3){if(_0x689ec3){_0x2d48a8=_0x689ec3[_0x3826('0x38')];if(!_0x3e37fd[_0x3826('0x33')][_0x3826('0x39')](_0x3826('0x4f'))){_0x10c1a8[_0x3826('0x22')]=qs[_0x3826('0x22')](_0x3e37fd['query'][_0x3826('0x22')]);_0x10c1a8[_0x3826('0x20')]=qs[_0x3826('0x20')](_0x3e37fd[_0x3826('0x33')][_0x3826('0x20')]);}return _0xed1d8e[_0x3826('0x52')](_0x10c1a8);}})[_0x3826('0x27')](function(_0xab111f){if(_0xab111f){return _0xab111f?{'count':_0x2d48a8,'rows':_0xab111f}:null;}})[_0x3826('0x27')](respondWithResult(_0x20971f,null))[_0x3826('0x44')](handleError(_0x20971f,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 1ebc612..b9c2745 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 _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 +var _0x7229=['api','moment','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','lodash','util','../../config/logger'];(function(_0xf83b3b,_0x529690){var _0x24377b=function(_0x486951){while(--_0x486951){_0xf83b3b['push'](_0xf83b3b['shift']());}};_0x24377b(++_0x529690);}(_0x7229,0x76));var _0x9722=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x7229[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x9722('0x0'));var util=require(_0x9722('0x1'));var logger=require(_0x9722('0x2'))(_0x9722('0x3'));var moment=require(_0x9722('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9722('0x5'));var rimraf=require(_0x9722('0x6'));var config=require(_0x9722('0x7'));var attributes=require(_0x9722('0x8'));module[_0x9722('0x9')]=function(_0x43e0ed,_0x2689b3){return _0x43e0ed['define'](_0x9722('0xa'),attributes,{'tableName':'int_servicenow_configurations','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 c439c3d..f5533d3 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 _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 +var _0xd68c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','ServicenowConfiguration,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1e500e,_0x2c9d74){var _0x10dc5e=function(_0x354423){while(--_0x354423){_0x1e500e['push'](_0x1e500e['shift']());}};_0x10dc5e(++_0x2c9d74);}(_0xd68c,0x113));var _0xcd68=function(_0x310dc2,_0x2299c4){_0x310dc2=_0x310dc2-0x0;var _0x24980f=_0xd68c[_0x310dc2];return _0x24980f;};'use strict';var _=require(_0xcd68('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcd68('0x1'));var rs=require(_0xcd68('0x2'));var fs=require('fs');var Redis=require(_0xcd68('0x3'));var db=require(_0xcd68('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcd68('0x5'))(_0xcd68('0x6'));var config=require(_0xcd68('0x7'));var jayson=require(_0xcd68('0x8'));var client=jayson[_0xcd68('0x9')][_0xcd68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42ca81,_0x15a7d1,_0x276e73){return new BPromise(function(_0x5e9ed5,_0x8a592e){return client[_0xcd68('0xb')](_0x42ca81,_0x276e73)[_0xcd68('0xc')](function(_0x8402e7){logger[_0xcd68('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x15a7d1,_0xcd68('0xe'));logger[_0xcd68('0xf')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x15a7d1,_0xcd68('0xe'),JSON['stringify'](_0x8402e7));if(_0x8402e7[_0xcd68('0x10')]){if(_0x8402e7[_0xcd68('0x10')]['code']===0x1f4){logger[_0xcd68('0x10')](_0xcd68('0x11'),_0x15a7d1,_0x8402e7['error']['message']);return _0x8a592e(_0x8402e7[_0xcd68('0x10')][_0xcd68('0x12')]);}logger[_0xcd68('0x10')](_0xcd68('0x11'),_0x15a7d1,_0x8402e7['error'][_0xcd68('0x12')]);return _0x5e9ed5(_0x8402e7['error'][_0xcd68('0x12')]);}else{logger[_0xcd68('0xd')](_0xcd68('0x11'),_0x15a7d1,_0xcd68('0xe'));_0x5e9ed5(_0x8402e7[_0xcd68('0x13')][_0xcd68('0x12')]);}})['catch'](function(_0x23bac4){logger[_0xcd68('0x10')](_0xcd68('0x11'),_0x15a7d1,_0x23bac4);_0x8a592e(_0x23bac4);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index afb8e41..9664b9d 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 _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 +var _0xc4af=['delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','index','/:id','post','create'];(function(_0x4422d4,_0x33c198){var _0x2e63aa=function(_0x3adee7){while(--_0x3adee7){_0x4422d4['push'](_0x4422d4['shift']());}};_0x2e63aa(++_0x33c198);}(_0xc4af,0x178));var _0xfc4a=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xc4af[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0xfc4a('0x0'));var util=require(_0xfc4a('0x1'));var path=require(_0xfc4a('0x2'));var timeout=require('connect-timeout');var express=require(_0xfc4a('0x3'));var router=express[_0xfc4a('0x4')]();var fs_extra=require(_0xfc4a('0x5'));var auth=require(_0xfc4a('0x6'));var interaction=require(_0xfc4a('0x7'));var config=require('../../config/environment');var controller=require(_0xfc4a('0x8'));router[_0xfc4a('0x9')]('/',auth[_0xfc4a('0xa')](),controller[_0xfc4a('0xb')]);router[_0xfc4a('0x9')](_0xfc4a('0xc'),auth[_0xfc4a('0xa')](),controller['show']);router[_0xfc4a('0xd')]('/',auth[_0xfc4a('0xa')](),controller[_0xfc4a('0xe')]);router['put'](_0xfc4a('0xc'),auth[_0xfc4a('0xa')](),controller['update']);router[_0xfc4a('0xf')](_0xfc4a('0xc'),auth[_0xfc4a('0xa')](),controller[_0xfc4a('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index d1510cd..51175cc 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 _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 +var _0x651b=['customVariable','BOOLEAN','sequelize','exports','ENUM','variable','picklist','string','STRING'];(function(_0x3a7fe7,_0x21158e){var _0x5c9724=function(_0x24a9b6){while(--_0x24a9b6){_0x3a7fe7['push'](_0x3a7fe7['shift']());}};_0x5c9724(++_0x21158e);}(_0x651b,0x65));var _0xb651=function(_0x30771c,_0x5142c8){_0x30771c=_0x30771c-0x0;var _0x22530a=_0x651b[_0x30771c];return _0x22530a;};'use strict';var Sequelize=require(_0xb651('0x0'));module[_0xb651('0x1')]={'type':{'type':Sequelize[_0xb651('0x2')]('string',_0xb651('0x3'),'customVariable','keyValue',_0xb651('0x4')),'defaultValue':_0xb651('0x5')},'content':{'type':Sequelize[_0xb651('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb651('0x2')](_0xb651('0x5'),_0xb651('0x3'),_0xb651('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb651('0x6')]},'nameField':{'type':Sequelize[_0xb651('0x6')]},'customField':{'type':Sequelize[_0xb651('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb651('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index c7dc250..7e9a43e 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 _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 +var _0x8632=['../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','sendStatus','error','stack','name','send','index','ServicenowField','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','includeAll','include','catch','show','params','rawAttributes','keys','options','find','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1479fa,_0x315d83){var _0x2c13d5=function(_0x17b2d6){while(--_0x17b2d6){_0x1479fa['push'](_0x1479fa['shift']());}};_0x2c13d5(++_0x315d83);}(_0x8632,0x110));var _0x2863=function(_0x413aac,_0x5e2430){_0x413aac=_0x413aac-0x0;var _0x569b11=_0x8632[_0x413aac];return _0x569b11;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2863('0x0'));var zipdir=require(_0x2863('0x1'));var jsonpatch=require(_0x2863('0x2'));var rp=require(_0x2863('0x3'));var moment=require(_0x2863('0x4'));var BPromise=require(_0x2863('0x5'));var Mustache=require(_0x2863('0x6'));var util=require(_0x2863('0x7'));var path=require(_0x2863('0x8'));var sox=require(_0x2863('0x9'));var csv=require(_0x2863('0xa'));var ejs=require(_0x2863('0xb'));var fs=require('fs');var fs_extra=require(_0x2863('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2863('0xd'));var jsforce=require(_0x2863('0xe'));var deskjs=require(_0x2863('0xf'));var toCsv=require(_0x2863('0xa'));var querystring=require(_0x2863('0x10'));var Papa=require(_0x2863('0x11'));var Redis=require(_0x2863('0x12'));var authService=require(_0x2863('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2863('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2863('0x15'));var config=require(_0x2863('0x16'));var licenseUtil=require(_0x2863('0x17'));var db=require(_0x2863('0x18'))['db'];function respondWithStatusCode(_0x4e75d8,_0x4847e9){_0x4847e9=_0x4847e9||0xcc;return function(_0x598625){if(_0x598625){return _0x4e75d8['sendStatus'](_0x4847e9);}return _0x4e75d8[_0x2863('0x19')](_0x4847e9)[_0x2863('0x1a')]();};}function respondWithResult(_0x3bd0c0,_0x1cfae1){_0x1cfae1=_0x1cfae1||0xc8;return function(_0x39c66f){if(_0x39c66f){return _0x3bd0c0[_0x2863('0x19')](_0x1cfae1)[_0x2863('0x1b')](_0x39c66f);}};}function respondWithFilteredResult(_0x2ad073,_0x3cab30){return function(_0x7ad770){if(_0x7ad770){var _0x3451d4=typeof _0x3cab30[_0x2863('0x1c')]===_0x2863('0x1d')&&typeof _0x3cab30[_0x2863('0x1e')]===_0x2863('0x1d');var _0x916369=_0x7ad770[_0x2863('0x1f')];var _0x1f9c41=_0x3451d4?0x0:_0x3cab30['offset'];var _0x2740f5=_0x3451d4?_0x7ad770[_0x2863('0x1f')]:_0x3cab30['offset']+_0x3cab30[_0x2863('0x1e')];var _0x16d50c;if(_0x2740f5>=_0x916369){_0x2740f5=_0x916369;_0x16d50c=0xc8;}else{_0x16d50c=0xce;}_0x2ad073[_0x2863('0x19')](_0x16d50c);return _0x2ad073[_0x2863('0x20')]('Content-Range',_0x1f9c41+'-'+_0x2740f5+'/'+_0x916369)[_0x2863('0x1b')](_0x7ad770);}return null;};}function patchUpdates(_0x1dd9d3){return function(_0x20a26f){try{jsonpatch[_0x2863('0x21')](_0x20a26f,_0x1dd9d3,!![]);}catch(_0x388f18){return BPromise[_0x2863('0x22')](_0x388f18);}return _0x20a26f['save']();};}function saveUpdates(_0x50a3fe,_0x437048){return function(_0x4f6a37){if(_0x4f6a37){return _0x4f6a37['update'](_0x50a3fe)[_0x2863('0x23')](function(_0x37e4a5){return _0x37e4a5;});}return null;};}function removeEntity(_0x36931a,_0x305ebd){return function(_0x334ccf){if(_0x334ccf){return _0x334ccf[_0x2863('0x24')]()['then'](function(){_0x36931a[_0x2863('0x19')](0xcc)[_0x2863('0x1a')]();});}};}function handleEntityNotFound(_0x1f2c56,_0x593fc2){return function(_0x3f0829){if(!_0x3f0829){_0x1f2c56[_0x2863('0x25')](0x194);}return _0x3f0829;};}function handleError(_0x17ba06,_0x16cd08){_0x16cd08=_0x16cd08||0x1f4;return function(_0x583f80){logger[_0x2863('0x26')](_0x583f80[_0x2863('0x27')]);if(_0x583f80[_0x2863('0x28')]){delete _0x583f80[_0x2863('0x28')];}_0x17ba06[_0x2863('0x19')](_0x16cd08)[_0x2863('0x29')](_0x583f80);};}exports[_0x2863('0x2a')]=function(_0x1300e0,_0x271082){var _0x13690d={},_0x1e82cf={},_0x25e1ab={'count':0x0,'rows':[]};var _0x25484d=_['map'](db[_0x2863('0x2b')]['rawAttributes'],function(_0x294842){return{'name':_0x294842[_0x2863('0x2c')],'type':_0x294842[_0x2863('0x2d')][_0x2863('0x2e')]};});_0x1e82cf[_0x2863('0x2f')]=_[_0x2863('0x30')](_0x25484d,_0x2863('0x28'));_0x1e82cf[_0x2863('0x31')]=_['keys'](_0x1300e0[_0x2863('0x31')]);_0x1e82cf[_0x2863('0x32')]=_[_0x2863('0x33')](_0x1e82cf[_0x2863('0x2f')],_0x1e82cf[_0x2863('0x31')]);_0x13690d[_0x2863('0x34')]=_[_0x2863('0x33')](_0x1e82cf[_0x2863('0x2f')],qs[_0x2863('0x35')](_0x1300e0[_0x2863('0x31')][_0x2863('0x35')]));_0x13690d['attributes']=_0x13690d['attributes'][_0x2863('0x36')]?_0x13690d['attributes']:_0x1e82cf[_0x2863('0x2f')];if(!_0x1300e0[_0x2863('0x31')][_0x2863('0x37')](_0x2863('0x38'))){_0x13690d['limit']=qs[_0x2863('0x1e')](_0x1300e0['query'][_0x2863('0x1e')]);_0x13690d[_0x2863('0x1c')]=qs[_0x2863('0x1c')](_0x1300e0[_0x2863('0x31')][_0x2863('0x1c')]);}_0x13690d['order']=qs['sort'](_0x1300e0[_0x2863('0x31')][_0x2863('0x39')]);_0x13690d[_0x2863('0x3a')]=qs[_0x2863('0x32')](_[_0x2863('0x3b')](_0x1300e0[_0x2863('0x31')],_0x1e82cf[_0x2863('0x32')]),_0x25484d);if(_0x1300e0[_0x2863('0x31')]['filter']){_0x13690d[_0x2863('0x3a')]=_[_0x2863('0x3c')](_0x13690d['where'],{'$or':_[_0x2863('0x30')](_0x25484d,function(_0x3bd04d){if(_0x3bd04d[_0x2863('0x2d')]!==_0x2863('0x3d')){var _0x425b53={};_0x425b53[_0x3bd04d[_0x2863('0x28')]]={'$like':'%'+_0x1300e0[_0x2863('0x31')]['filter']+'%'};return _0x425b53;}})});}_0x13690d=_[_0x2863('0x3c')]({},_0x13690d,_0x1300e0['options']);var _0x227b98={'where':_0x13690d[_0x2863('0x3a')]};return db[_0x2863('0x2b')][_0x2863('0x1f')](_0x227b98)[_0x2863('0x23')](function(_0x599445){_0x25e1ab[_0x2863('0x1f')]=_0x599445;if(_0x1300e0['query'][_0x2863('0x3e')]){_0x13690d[_0x2863('0x3f')]=[{'all':!![]}];}return db[_0x2863('0x2b')]['findAll'](_0x13690d);})[_0x2863('0x23')](function(_0x47809e){_0x25e1ab['rows']=_0x47809e;return _0x25e1ab;})[_0x2863('0x23')](respondWithFilteredResult(_0x271082,_0x13690d))[_0x2863('0x40')](handleError(_0x271082,null));};exports[_0x2863('0x41')]=function(_0xf37649,_0x405405){var _0x1ad62b={'raw':!![],'where':{'id':_0xf37649[_0x2863('0x42')]['id']}},_0x543e78={};_0x543e78[_0x2863('0x2f')]=_['keys'](db['ServicenowField'][_0x2863('0x43')]);_0x543e78[_0x2863('0x31')]=_[_0x2863('0x44')](_0xf37649[_0x2863('0x31')]);_0x543e78['filters']=_[_0x2863('0x33')](_0x543e78[_0x2863('0x2f')],_0x543e78[_0x2863('0x31')]);_0x1ad62b[_0x2863('0x34')]=_['intersection'](_0x543e78['model'],qs[_0x2863('0x35')](_0xf37649[_0x2863('0x31')][_0x2863('0x35')]));_0x1ad62b[_0x2863('0x34')]=_0x1ad62b[_0x2863('0x34')]['length']?_0x1ad62b['attributes']:_0x543e78[_0x2863('0x2f')];if(_0xf37649[_0x2863('0x31')][_0x2863('0x3e')]){_0x1ad62b['include']=[{'all':!![]}];}_0x1ad62b=_[_0x2863('0x3c')]({},_0x1ad62b,_0xf37649[_0x2863('0x45')]);return db[_0x2863('0x2b')][_0x2863('0x46')](_0x1ad62b)[_0x2863('0x23')](handleEntityNotFound(_0x405405,null))['then'](respondWithResult(_0x405405,null))[_0x2863('0x40')](handleError(_0x405405,null));};exports['create']=function(_0x2976d3,_0x507a3b){return db[_0x2863('0x2b')]['create'](_0x2976d3[_0x2863('0x47')],{})[_0x2863('0x23')](respondWithResult(_0x507a3b,0xc9))[_0x2863('0x40')](handleError(_0x507a3b,null));};exports[_0x2863('0x48')]=function(_0x15903a,_0x2353e2){if(_0x15903a[_0x2863('0x47')]['id']){delete _0x15903a['body']['id'];}return db['ServicenowField'][_0x2863('0x46')]({'where':{'id':_0x15903a['params']['id']}})[_0x2863('0x23')](handleEntityNotFound(_0x2353e2,null))[_0x2863('0x23')](saveUpdates(_0x15903a[_0x2863('0x47')],null))[_0x2863('0x23')](respondWithResult(_0x2353e2,null))[_0x2863('0x40')](handleError(_0x2353e2,null));};exports[_0x2863('0x24')]=function(_0x25ac2d,_0x16d113){return db[_0x2863('0x2b')]['find']({'where':{'id':_0x25ac2d[_0x2863('0x42')]['id']}})['then'](handleEntityNotFound(_0x16d113,null))[_0x2863('0x23')](removeEntity(_0x16d113,null))[_0x2863('0x40')](handleError(_0x16d113,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 821fbd7..843149c 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 _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 +var _0x1c46=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField','servicenow_unique_index','FieldId','lodash','util'];(function(_0x29dfba,_0xec8431){var _0x33d425=function(_0x5da0af){while(--_0x5da0af){_0x29dfba['push'](_0x29dfba['shift']());}};_0x33d425(++_0xec8431);}(_0x1c46,0x132));var _0x61c4=function(_0x394681,_0x366928){_0x394681=_0x394681-0x0;var _0x24e3e1=_0x1c46[_0x394681];return _0x24e3e1;};'use strict';var _=require(_0x61c4('0x0'));var util=require(_0x61c4('0x1'));var logger=require(_0x61c4('0x2'))(_0x61c4('0x3'));var moment=require(_0x61c4('0x4'));var BPromise=require(_0x61c4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x61c4('0x6'));var rimraf=require(_0x61c4('0x7'));var config=require(_0x61c4('0x8'));var attributes=require(_0x61c4('0x9'));module[_0x61c4('0xa')]=function(_0x2ee98d,_0x2776a4){return _0x2ee98d['define'](_0x61c4('0xb'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x61c4('0xc'),'fields':['idField',_0x61c4('0xd')],'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 c4ef152..ddd0d3f 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(_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 +var _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2afc4c,_0x9e22c7){var _0x28ab34=function(_0x360995){while(--_0x360995){_0x2afc4c['push'](_0x2afc4c['shift']());}};_0x28ab34(++_0x9e22c7);}(_0xf4eb,0xec));var _0xbf4e=function(_0x37b3c7,_0x473e1d){_0x37b3c7=_0x37b3c7-0x0;var _0x58ab6c=_0xf4eb[_0x37b3c7];return _0x58ab6c;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index ca16ae6..c093c88 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_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 +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(_0x150033,_0x54b089){var _0x122b82=function(_0x4142cb){while(--_0x4142cb){_0x150033['push'](_0x150033['shift']());}};_0x122b82(++_0x54b089);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 91e0a5d..e68699f 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(_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 +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3496b9,_0x57b95f){var _0x2887dc=function(_0x2f83c5){while(--_0x2f83c5){_0x3496b9['push'](_0x3496b9['shift']());}};_0x2887dc(++_0x57b95f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 06154b0..f0ed511 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 _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 +var _0xcc2e=['../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','options','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_type','parent_name','direction','username','password','remoteUri','slice','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','get_module_fields','values','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x25bdc0,_0x32ffc4){var _0x4cec2d=function(_0x485929){while(--_0x485929){_0x25bdc0['push'](_0x25bdc0['shift']());}};_0x4cec2d(++_0x32ffc4);}(_0xcc2e,0xdd));var _0xecc2=function(_0x3c2352,_0x2205d3){_0x3c2352=_0x3c2352-0x0;var _0x15bb7d=_0xcc2e[_0x3c2352];return _0x15bb7d;};'use strict';var emlformat=require(_0xecc2('0x0'));var rimraf=require(_0xecc2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xecc2('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xecc2('0x3'));var Mustache=require(_0xecc2('0x4'));var util=require(_0xecc2('0x5'));var path=require(_0xecc2('0x6'));var sox=require(_0xecc2('0x7'));var csv=require(_0xecc2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xecc2('0x9'));var squel=require(_0xecc2('0xa'));var crypto=require(_0xecc2('0xb'));var jsforce=require(_0xecc2('0xc'));var deskjs=require(_0xecc2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xecc2('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xecc2('0xf'));var as=require(_0xecc2('0x10'));var hardwareService=require(_0xecc2('0x11'));var logger=require(_0xecc2('0x12'))(_0xecc2('0x13'));var utils=require(_0xecc2('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xecc2('0x15'));var db=require(_0xecc2('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x347ead,_0x35c90e){_0x35c90e=_0x35c90e||0xcc;return function(_0xb29a50){if(_0xb29a50){return _0x347ead['sendStatus'](_0x35c90e);}return _0x347ead[_0xecc2('0x17')](_0x35c90e)[_0xecc2('0x18')]();};}function respondWithResult(_0xc3e430,_0x16867c){_0x16867c=_0x16867c||0xc8;return function(_0x4657b5){if(_0x4657b5){return _0xc3e430['status'](_0x16867c)[_0xecc2('0x19')](_0x4657b5);}};}function respondWithFilteredResult(_0x3e96ec,_0x286869){return function(_0x117a94){if(_0x117a94){var _0x28ff74=typeof _0x286869[_0xecc2('0x1a')]==='undefined'&&typeof _0x286869[_0xecc2('0x1b')]===_0xecc2('0x1c');var _0x5c5bb0=_0x117a94['count'];var _0x5bc598=_0x28ff74?0x0:_0x286869[_0xecc2('0x1a')];var _0x36ac06=_0x28ff74?_0x117a94[_0xecc2('0x1d')]:_0x286869[_0xecc2('0x1a')]+_0x286869[_0xecc2('0x1b')];var _0x2a569c;if(_0x36ac06>=_0x5c5bb0){_0x36ac06=_0x5c5bb0;_0x2a569c=0xc8;}else{_0x2a569c=0xce;}_0x3e96ec['status'](_0x2a569c);return _0x3e96ec[_0xecc2('0x1e')](_0xecc2('0x1f'),_0x5bc598+'-'+_0x36ac06+'/'+_0x5c5bb0)[_0xecc2('0x19')](_0x117a94);}return null;};}function patchUpdates(_0x9d0068){return function(_0xc61661){try{jsonpatch[_0xecc2('0x20')](_0xc61661,_0x9d0068,!![]);}catch(_0x49f19c){return BPromise[_0xecc2('0x21')](_0x49f19c);}return _0xc61661[_0xecc2('0x22')]();};}function saveUpdates(_0x563a7b,_0x4f01d0){return function(_0x333a60){if(_0x333a60){return _0x333a60[_0xecc2('0x23')](_0x563a7b)[_0xecc2('0x24')](function(_0x3a23c3){return _0x3a23c3;});}return null;};}function removeEntity(_0x285d4f,_0x1d18fe){return function(_0x2a60aa){if(_0x2a60aa){return _0x2a60aa[_0xecc2('0x25')]()[_0xecc2('0x24')](function(){_0x285d4f[_0xecc2('0x17')](0xcc)[_0xecc2('0x18')]();});}};}function handleEntityNotFound(_0x5054f4,_0x277413){return function(_0x5e0501){if(!_0x5e0501){_0x5054f4[_0xecc2('0x26')](0x194);}return _0x5e0501;};}function handleError(_0x5e422a,_0x33eb11){_0x33eb11=_0x33eb11||0x1f4;return function(_0x1870e2){logger[_0xecc2('0x27')](_0x1870e2[_0xecc2('0x28')]);if(_0x1870e2[_0xecc2('0x29')]){delete _0x1870e2['name'];}_0x5e422a[_0xecc2('0x17')](_0x33eb11)[_0xecc2('0x2a')](_0x1870e2);};}exports[_0xecc2('0x2b')]=function(_0x2873ed,_0x29b6a3){var _0x2b8d71={},_0x2a9b46={},_0xa831da={'count':0x0,'rows':[]};var _0x5ba4ee=_[_0xecc2('0x2c')](db[_0xecc2('0x2d')][_0xecc2('0x2e')],function(_0x285824){return{'name':_0x285824[_0xecc2('0x2f')],'type':_0x285824[_0xecc2('0x30')][_0xecc2('0x31')]};});_0x2a9b46[_0xecc2('0x32')]=_['map'](_0x5ba4ee,'name');_0x2a9b46[_0xecc2('0x33')]=_['keys'](_0x2873ed[_0xecc2('0x33')]);_0x2a9b46['filters']=_[_0xecc2('0x34')](_0x2a9b46[_0xecc2('0x32')],_0x2a9b46[_0xecc2('0x33')]);_0x2b8d71[_0xecc2('0x35')]=_['intersection'](_0x2a9b46['model'],qs[_0xecc2('0x36')](_0x2873ed[_0xecc2('0x33')][_0xecc2('0x36')]));_0x2b8d71['attributes']=_0x2b8d71[_0xecc2('0x35')][_0xecc2('0x37')]?_0x2b8d71['attributes']:_0x2a9b46['model'];if(!_0x2873ed['query'][_0xecc2('0x38')](_0xecc2('0x39'))){_0x2b8d71[_0xecc2('0x1b')]=qs[_0xecc2('0x1b')](_0x2873ed['query']['limit']);_0x2b8d71['offset']=qs[_0xecc2('0x1a')](_0x2873ed[_0xecc2('0x33')]['offset']);}_0x2b8d71['order']=qs['sort'](_0x2873ed[_0xecc2('0x33')][_0xecc2('0x3a')]);_0x2b8d71[_0xecc2('0x3b')]=qs[_0xecc2('0x3c')](_[_0xecc2('0x3d')](_0x2873ed['query'],_0x2a9b46[_0xecc2('0x3c')]),_0x5ba4ee);if(_0x2873ed[_0xecc2('0x33')]['filter']){_0x2b8d71[_0xecc2('0x3b')]=_[_0xecc2('0x3e')](_0x2b8d71['where'],{'$or':_[_0xecc2('0x2c')](_0x5ba4ee,function(_0x408569){if(_0x408569[_0xecc2('0x30')]!=='VIRTUAL'){var _0x42f858={};_0x42f858[_0x408569[_0xecc2('0x29')]]={'$like':'%'+_0x2873ed[_0xecc2('0x33')][_0xecc2('0x3f')]+'%'};return _0x42f858;}})});}_0x2b8d71=_['merge']({},_0x2b8d71,_0x2873ed['options']);var _0x87f1dd={'where':_0x2b8d71['where']};return db[_0xecc2('0x2d')][_0xecc2('0x1d')](_0x87f1dd)['then'](function(_0x5e7870){_0xa831da['count']=_0x5e7870;if(_0x2873ed[_0xecc2('0x33')][_0xecc2('0x40')]){_0x2b8d71[_0xecc2('0x41')]=[{'all':!![]}];}return db[_0xecc2('0x2d')][_0xecc2('0x42')](_0x2b8d71);})[_0xecc2('0x24')](function(_0x2d87bb){_0xa831da[_0xecc2('0x43')]=_0x2d87bb;return _0xa831da;})['then'](respondWithFilteredResult(_0x29b6a3,_0x2b8d71))['catch'](handleError(_0x29b6a3,null));};exports[_0xecc2('0x44')]=function(_0x5dd17b,_0x563204){var _0x5ba489={'raw':![],'where':{'id':_0x5dd17b[_0xecc2('0x45')]['id']}},_0x37c704={};_0x37c704['model']=_['keys'](db[_0xecc2('0x2d')][_0xecc2('0x2e')]);_0x37c704[_0xecc2('0x33')]=_[_0xecc2('0x46')](_0x5dd17b[_0xecc2('0x33')]);_0x37c704[_0xecc2('0x3c')]=_['intersection'](_0x37c704[_0xecc2('0x32')],_0x37c704['query']);_0x5ba489['attributes']=_['intersection'](_0x37c704[_0xecc2('0x32')],qs['fields'](_0x5dd17b[_0xecc2('0x33')]['fields']));_0x5ba489[_0xecc2('0x35')]=_0x5ba489[_0xecc2('0x35')][_0xecc2('0x37')]?_0x5ba489['attributes']:_0x37c704[_0xecc2('0x32')];if(_0x5dd17b[_0xecc2('0x33')][_0xecc2('0x40')]){_0x5ba489['include']=[{'all':!![]}];}_0x5ba489=_[_0xecc2('0x3e')]({},_0x5ba489,_0x5dd17b['options']);return db[_0xecc2('0x2d')][_0xecc2('0x47')](_0x5ba489)[_0xecc2('0x24')](handleEntityNotFound(_0x563204,null))['then'](respondWithResult(_0x563204,null))[_0xecc2('0x48')](handleError(_0x563204,null));};exports[_0xecc2('0x49')]=function(_0xe54fff,_0x173f2a){return db[_0xecc2('0x2d')][_0xecc2('0x49')](_0xe54fff[_0xecc2('0x4a')],{})['then'](respondWithResult(_0x173f2a,0xc9))[_0xecc2('0x48')](handleError(_0x173f2a,null));};exports['update']=function(_0x3251e3,_0xfa6d8f){if(_0x3251e3[_0xecc2('0x4a')]['id']){delete _0x3251e3[_0xecc2('0x4a')]['id'];}return db[_0xecc2('0x2d')][_0xecc2('0x47')]({'where':{'id':_0x3251e3[_0xecc2('0x45')]['id']}})['then'](handleEntityNotFound(_0xfa6d8f,null))[_0xecc2('0x24')](saveUpdates(_0x3251e3[_0xecc2('0x4a')],null))['then'](respondWithResult(_0xfa6d8f,null))[_0xecc2('0x48')](handleError(_0xfa6d8f,null));};exports[_0xecc2('0x25')]=function(_0x41141d,_0x29c09b){return db[_0xecc2('0x2d')]['find']({'where':{'id':_0x41141d[_0xecc2('0x45')]['id']}})[_0xecc2('0x24')](handleEntityNotFound(_0x29c09b,null))[_0xecc2('0x24')](removeEntity(_0x29c09b,null))[_0xecc2('0x48')](handleError(_0x29c09b,null));};exports[_0xecc2('0x4b')]=function(_0x53d709,_0x2052ab,_0x55711f){var _0xead6e3={};var _0x42a1c4={};var _0x2bf746;var _0x4a9cf4;return db[_0xecc2('0x2d')][_0xecc2('0x4c')]({'where':{'id':_0x53d709[_0xecc2('0x45')]['id']}})[_0xecc2('0x24')](handleEntityNotFound(_0x2052ab,null))[_0xecc2('0x24')](function(_0x36ce15){if(_0x36ce15){_0x2bf746=_0x36ce15;_0x42a1c4[_0xecc2('0x32')]=_[_0xecc2('0x46')](db[_0xecc2('0x4d')][_0xecc2('0x2e')]);_0x42a1c4['query']=_[_0xecc2('0x46')](_0x53d709[_0xecc2('0x33')]);_0x42a1c4[_0xecc2('0x3c')]=_[_0xecc2('0x34')](_0x42a1c4[_0xecc2('0x32')],_0x42a1c4[_0xecc2('0x33')]);_0xead6e3[_0xecc2('0x35')]=_['intersection'](_0x42a1c4['model'],qs[_0xecc2('0x36')](_0x53d709[_0xecc2('0x33')][_0xecc2('0x36')]));_0xead6e3[_0xecc2('0x35')]=_0xead6e3[_0xecc2('0x35')][_0xecc2('0x37')]?_0xead6e3['attributes']:_0x42a1c4[_0xecc2('0x32')];_0xead6e3[_0xecc2('0x4e')]=qs['sort'](_0x53d709[_0xecc2('0x33')][_0xecc2('0x3a')]);_0xead6e3['where']=qs[_0xecc2('0x3c')](_['pick'](_0x53d709[_0xecc2('0x33')],_0x42a1c4[_0xecc2('0x3c')]));if(_0x53d709[_0xecc2('0x33')]['filter']){_0xead6e3[_0xecc2('0x3b')]=_[_0xecc2('0x3e')](_0xead6e3[_0xecc2('0x3b')],{'$or':_[_0xecc2('0x2c')](_0xead6e3[_0xecc2('0x35')],function(_0x4fc3c0){var _0x48eaad={};_0x48eaad[_0x4fc3c0]={'$like':'%'+_0x53d709[_0xecc2('0x33')][_0xecc2('0x3f')]+'%'};return _0x48eaad;})});}_0xead6e3=_[_0xecc2('0x3e')]({},_0xead6e3,_0x53d709[_0xecc2('0x4f')]);return _0x2bf746[_0xecc2('0x4b')](_0xead6e3);}})[_0xecc2('0x24')](function(_0x4d01ce){if(_0x4d01ce){_0x4a9cf4=_0x4d01ce[_0xecc2('0x37')];if(!_0x53d709[_0xecc2('0x33')]['hasOwnProperty'](_0xecc2('0x39'))){_0xead6e3[_0xecc2('0x1b')]=qs['limit'](_0x53d709[_0xecc2('0x33')][_0xecc2('0x1b')]);_0xead6e3[_0xecc2('0x1a')]=qs['offset'](_0x53d709[_0xecc2('0x33')][_0xecc2('0x1a')]);}return _0x2bf746[_0xecc2('0x4b')](_0xead6e3);}})[_0xecc2('0x24')](function(_0x419e61){if(_0x419e61){return _0x419e61?{'count':_0x4a9cf4,'rows':_0x419e61}:null;}})['then'](respondWithResult(_0x2052ab,null))[_0xecc2('0x48')](handleError(_0x2052ab,null));};exports[_0xecc2('0x50')]=function(_0x184f6a,_0x54cd20,_0x2fb341){if(_0x184f6a[_0xecc2('0x4a')]['id']){delete _0x184f6a[_0xecc2('0x4a')]['id'];}return db[_0xecc2('0x2d')][_0xecc2('0x4c')]({'where':{'id':_0x184f6a[_0xecc2('0x45')]['id']}})['then'](handleEntityNotFound(_0x54cd20,null))['then'](function(_0x4db416){if(_0x4db416){_0x184f6a['body'][_0xecc2('0x51')]=_0x4db416['id'];_0x184f6a[_0xecc2('0x4a')]['Subjects']=integrations[_0xecc2('0x52')](_0x184f6a[_0xecc2('0x4a')][_0xecc2('0x53')],_0x184f6a[_0xecc2('0x4a')][_0xecc2('0x30')]);_0x184f6a[_0xecc2('0x4a')][_0xecc2('0x54')]=integrations[_0xecc2('0x55')](_0x184f6a['body']['channel'],_0x184f6a['body']['type']);return db[_0xecc2('0x4d')][_0xecc2('0x49')](_0x184f6a[_0xecc2('0x4a')],{'include':[{'model':db[_0xecc2('0x56')],'as':'Subjects'},{'model':db[_0xecc2('0x56')],'as':_0xecc2('0x54')}]});}return null;})[_0xecc2('0x24')](respondWithResult(_0x54cd20,null))[_0xecc2('0x48')](handleError(_0x54cd20,null));};exports[_0xecc2('0x57')]=function(_0x2f5339,_0x4abde4,_0x545970){var _0x5a843d='';var _0x297124=['id',_0xecc2('0x29'),_0xecc2('0x58'),_0xecc2('0x59'),_0xecc2('0x5a'),_0xecc2('0x5b'),_0xecc2('0x5c'),_0xecc2('0x5d'),'parent_id',_0xecc2('0x5e'),_0xecc2('0x5f'),_0xecc2('0x60')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x2f5339[_0xecc2('0x45')]['id']},'attributes':['id',_0xecc2('0x61'),_0xecc2('0x62'),_0xecc2('0x63')]})[_0xecc2('0x24')](handleEntityNotFound(_0x4abde4,null))['then'](function(_0x3a00eb){if(_0x3a00eb){_0x5a843d=_0x3a00eb[_0xecc2('0x63')];var _0x5e52bf=_0x5a843d[_0xecc2('0x64')](-0x1);if(_0x5e52bf==='/'){_0x5a843d=_0x5a843d['substring'](0x0,_0x5a843d[_0xecc2('0x65')](_0x5e52bf));}return rp({'method':_0xecc2('0x66'),'uri':util['format'](_0xecc2('0x67'),_0x5a843d,_0xecc2('0x68')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0xecc2('0x69'),'rest_data':JSON[_0xecc2('0x6a')]({'user_auth':{'user_name':_0x3a00eb[_0xecc2('0x61')],'password':_0x3a00eb[_0xecc2('0x62')],'encryption':'PLAIN'},'application':_0xecc2('0x6b')})}});}})[_0xecc2('0x24')](function(_0x34d7e4){if(_0x34d7e4&&_0x34d7e4[_0xecc2('0x29')]!==_0xecc2('0x6c')&&_0x34d7e4[_0xecc2('0x29')]!==_0xecc2('0x6d')){return rp({'method':'POST','uri':util[_0xecc2('0x6e')](_0xecc2('0x67'),_0x5a843d,_0xecc2('0x68')),'json':!![],'form':{'method':_0xecc2('0x6f'),'input_type':_0xecc2('0x69'),'response_type':_0xecc2('0x69'),'rest_data':JSON[_0xecc2('0x6a')]({'session':_0x34d7e4['id'],'module_name':'Calls'})}})['then'](function(_0x556ebf){if(_0x556ebf){var _0x2a82bf=_[_0xecc2('0x70')](_0x556ebf['module_fields']);_['remove'](_0x2a82bf,function(_0x21220a){return _0x297124[_0xecc2('0x71')](_0x21220a[_0xecc2('0x29')]);});return{'count':_0x2a82bf[_0xecc2('0x37')],'rows':_[_0xecc2('0x2c')](_0x2a82bf,function(_0x2f3ef5){return{'id':_0x2f3ef5[_0xecc2('0x29')],'name':_0x2f3ef5[_0xecc2('0x72')],'custom':_[_0xecc2('0x73')](_0x2f3ef5[_0xecc2('0x29')],'_c')?!![]:![],'options':_0x2f3ef5[_0xecc2('0x4f')]?_[_0xecc2('0x2c')](_[_0xecc2('0x70')](_0x2f3ef5[_0xecc2('0x4f')]),function(_0xdaf00c){return{'name':_0xdaf00c[_0xecc2('0x74')],'value':_0xdaf00c['name']};}):[]};})};}})['then'](respondWithResult(_0x4abde4,null))[_0xecc2('0x48')](function(_0x45ae36){var _0x4c9519=_0x2f5339['query'][_0xecc2('0x75')]?0x1f4:_0x45ae36[_0xecc2('0x76')]||0x1f4;logger[_0xecc2('0x27')](_0xecc2('0x77'),_0xecc2('0x57'),_0x4c9519,JSON[_0xecc2('0x6a')](_0x45ae36));delete _0x45ae36[_0xecc2('0x29')];if(_0x4c9519===0x191){_0x4c9519=0x190;}_0x4abde4[_0xecc2('0x17')](_0x4c9519)[_0xecc2('0x2a')](_0x2f5339[_0xecc2('0x33')]['test']?{'message':_0xecc2('0x78'),'statusCode':_0x45ae36['statusCode']}:_0x45ae36);});}else{var _0x1c548e=0x1f4;_0x4abde4['status'](_0x1c548e)[_0xecc2('0x2a')]({'message':_0xecc2('0x78'),'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 7425f7c..d0f0d2b 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 _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 +var _0xa923=['../../components/integrations/configuration','exports','SugarcrmAccount','lodash','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x55490b,_0x25997d){var _0x4010ef=function(_0x387420){while(--_0x387420){_0x55490b['push'](_0x55490b['shift']());}};_0x4010ef(++_0x25997d);}(_0xa923,0xcb));var _0x3a92=function(_0x5355df,_0x438346){_0x5355df=_0x5355df-0x0;var _0x563a5c=_0xa923[_0x5355df];return _0x563a5c;};'use strict';var _=require(_0x3a92('0x0'));var util=require(_0x3a92('0x1'));var logger=require('../../config/logger')(_0x3a92('0x2'));var moment=require(_0x3a92('0x3'));var BPromise=require('bluebird');var rp=require(_0x3a92('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3a92('0x5'));var config=require(_0x3a92('0x6'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x3a92('0x7'));module[_0x3a92('0x8')]=function(_0xc76af2,_0x439138){return _0xc76af2['define'](_0x3a92('0x9'),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 aa8d336..a4099c6 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 _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 +var _0xd2e2=['request\x20sent','debug','error','SugarcrmAccount,\x20%s,\x20%s','message','info','result','GetSugarcrmAccount','findAll','options','raw','attributes','limit','include','map','model','stringify','catch','ShowSugarcrmAccount','SugarcrmAccount','find','where','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd2e2,0x76));var _0x2d2e=function(_0x4d218f,_0x280bf7){_0x4d218f=_0x4d218f-0x0;var _0x291fee=_0xd2e2[_0x4d218f];return _0x291fee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2d2e('0x0'));var BPromise=require(_0x2d2e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d2e('0x2'))['db'];var utils=require(_0x2d2e('0x3'));var logger=require('../../config/logger')(_0x2d2e('0x4'));var config=require(_0x2d2e('0x5'));var jayson=require(_0x2d2e('0x6'));var client=jayson['client'][_0x2d2e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2631c8,_0x4718be,_0x34f490){return new BPromise(function(_0x1e91f7,_0x2dbb3b){return client[_0x2d2e('0x8')](_0x2631c8,_0x34f490)[_0x2d2e('0x9')](function(_0x1a16e6){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x4718be,_0x2d2e('0xa'));logger[_0x2d2e('0xb')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x4718be,'request\x20sent',JSON['stringify'](_0x1a16e6));if(_0x1a16e6['error']){if(_0x1a16e6[_0x2d2e('0xc')]['code']===0x1f4){logger['error'](_0x2d2e('0xd'),_0x4718be,_0x1a16e6[_0x2d2e('0xc')][_0x2d2e('0xe')]);return _0x2dbb3b(_0x1a16e6['error'][_0x2d2e('0xe')]);}logger['error'](_0x2d2e('0xd'),_0x4718be,_0x1a16e6[_0x2d2e('0xc')][_0x2d2e('0xe')]);return _0x1e91f7(_0x1a16e6[_0x2d2e('0xc')][_0x2d2e('0xe')]);}else{logger[_0x2d2e('0xf')](_0x2d2e('0xd'),_0x4718be,_0x2d2e('0xa'));_0x1e91f7(_0x1a16e6[_0x2d2e('0x10')][_0x2d2e('0xe')]);}})['catch'](function(_0x263150){logger[_0x2d2e('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x4718be,_0x263150);_0x2dbb3b(_0x263150);});});}exports[_0x2d2e('0x11')]=function(_0x303347){var _0x3b52c6=this;return new Promise(function(_0x351f43,_0xe9e250){return db['SugarcrmAccount'][_0x2d2e('0x12')]({'raw':_0x303347[_0x2d2e('0x13')]?_0x303347['options'][_0x2d2e('0x14')]===undefined?!![]:![]:!![],'where':_0x303347[_0x2d2e('0x13')]?_0x303347[_0x2d2e('0x13')]['where']||null:null,'attributes':_0x303347['options']?_0x303347[_0x2d2e('0x13')][_0x2d2e('0x15')]||null:null,'limit':_0x303347[_0x2d2e('0x13')]?_0x303347[_0x2d2e('0x13')][_0x2d2e('0x16')]||null:null,'include':_0x303347[_0x2d2e('0x13')]?_0x303347[_0x2d2e('0x13')][_0x2d2e('0x17')]?_[_0x2d2e('0x18')](_0x303347[_0x2d2e('0x13')][_0x2d2e('0x17')],function(_0x2efbfd){return{'model':db[_0x2efbfd[_0x2d2e('0x19')]],'as':_0x2efbfd['as'],'attributes':_0x2efbfd[_0x2d2e('0x15')],'include':_0x2efbfd['include']?_[_0x2d2e('0x18')](_0x2efbfd['include'],function(_0x5c8d87){return{'model':db[_0x5c8d87[_0x2d2e('0x19')]],'as':_0x5c8d87['as'],'attributes':_0x5c8d87[_0x2d2e('0x15')],'include':_0x5c8d87[_0x2d2e('0x17')]?_[_0x2d2e('0x18')](_0x5c8d87[_0x2d2e('0x17')],function(_0x1ffe52){return{'model':db[_0x1ffe52[_0x2d2e('0x19')]],'as':_0x1ffe52['as'],'attributes':_0x1ffe52[_0x2d2e('0x15')]};}):[]};}):[]};}):[]:[]})[_0x2d2e('0x9')](function(_0x203cdc){logger[_0x2d2e('0xf')](_0x2d2e('0x11'),_0x303347);logger['debug'](_0x2d2e('0x11'),_0x303347,JSON[_0x2d2e('0x1a')](_0x203cdc));_0x351f43(_0x203cdc);})[_0x2d2e('0x1b')](function(_0x3dc133){logger['error'](_0x2d2e('0x11'),_0x3dc133['message'],_0x303347);_0xe9e250(_0x3b52c6[_0x2d2e('0xc')](0x1f4,_0x3dc133['message']));});});};exports[_0x2d2e('0x1c')]=function(_0x5e69ba){var _0x7a821e=this;return new Promise(function(_0x1dbb73,_0x2f64c2){return db[_0x2d2e('0x1d')][_0x2d2e('0x1e')]({'raw':_0x5e69ba[_0x2d2e('0x13')]?_0x5e69ba[_0x2d2e('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x5e69ba[_0x2d2e('0x13')]?_0x5e69ba[_0x2d2e('0x13')][_0x2d2e('0x1f')]||null:null,'attributes':_0x5e69ba[_0x2d2e('0x13')]?_0x5e69ba[_0x2d2e('0x13')][_0x2d2e('0x15')]||null:null,'include':_0x5e69ba[_0x2d2e('0x13')]?_0x5e69ba[_0x2d2e('0x13')][_0x2d2e('0x17')]?_['map'](_0x5e69ba['options'][_0x2d2e('0x17')],function(_0x591861){return{'model':db[_0x591861[_0x2d2e('0x19')]],'as':_0x591861['as'],'attributes':_0x591861['attributes'],'include':_0x591861['include']?_[_0x2d2e('0x18')](_0x591861[_0x2d2e('0x17')],function(_0x23e46a){return{'model':db[_0x23e46a[_0x2d2e('0x19')]],'as':_0x23e46a['as'],'attributes':_0x23e46a['attributes'],'include':_0x23e46a[_0x2d2e('0x17')]?_[_0x2d2e('0x18')](_0x23e46a['include'],function(_0x28a8ac){return{'model':db[_0x28a8ac[_0x2d2e('0x19')]],'as':_0x28a8ac['as'],'attributes':_0x28a8ac[_0x2d2e('0x15')]};}):[]};}):[]};}):[]:[]})[_0x2d2e('0x9')](function(_0x238486){logger[_0x2d2e('0xf')](_0x2d2e('0x1c'),_0x5e69ba);logger[_0x2d2e('0xb')](_0x2d2e('0x1c'),_0x5e69ba,JSON['stringify'](_0x238486));_0x1dbb73(_0x238486);})[_0x2d2e('0x1b')](function(_0x5ea026){logger[_0x2d2e('0xc')](_0x2d2e('0x1c'),_0x5ea026[_0x2d2e('0xe')],_0x5e69ba);_0x2f64c2(_0x7a821e['error'](0x1f4,_0x5ea026[_0x2d2e('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 459d5de..fa5aa9a 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 _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 +var _0x0e66=['update','delete','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e66,0x10b));var _0x60e6=function(_0x34aec4,_0x3801da){_0x34aec4=_0x34aec4-0x0;var _0x51e1a7=_0x0e66[_0x34aec4];return _0x51e1a7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x60e6('0x0'));var timeout=require(_0x60e6('0x1'));var express=require('express');var router=express[_0x60e6('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x60e6('0x3'));var interaction=require(_0x60e6('0x4'));var config=require(_0x60e6('0x5'));var controller=require(_0x60e6('0x6'));router['get']('/',auth[_0x60e6('0x7')](),controller[_0x60e6('0x8')]);router[_0x60e6('0x9')](_0x60e6('0xa'),auth['isAuthenticated'](),controller[_0x60e6('0xb')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x60e6('0xc')]);router['get']('/:id/subjects',auth[_0x60e6('0x7')](),controller[_0x60e6('0xd')]);router['get'](_0x60e6('0xe'),auth[_0x60e6('0x7')](),controller[_0x60e6('0xf')]);router[_0x60e6('0x10')]('/',auth[_0x60e6('0x7')](),controller[_0x60e6('0x11')]);router[_0x60e6('0x12')](_0x60e6('0xa'),auth[_0x60e6('0x7')](),controller[_0x60e6('0x13')]);router[_0x60e6('0x14')](_0x60e6('0xa'),auth[_0x60e6('0x7')](),controller['destroy']);module[_0x60e6('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 be1fa8e..332c1ea 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 _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 +var _0x2046=['STRING','sequelize','exports'];(function(_0x1f8c57,_0x52d1ab){var _0x11cf18=function(_0x47b4ff){while(--_0x47b4ff){_0x1f8c57['push'](_0x1f8c57['shift']());}};_0x11cf18(++_0x52d1ab);}(_0x2046,0x6a));var _0x6204=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2046[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x6204('0x0'));module[_0x6204('0x1')]={'name':{'type':Sequelize[_0x6204('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 3f50e96..f398dfa 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 _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 +var _0x49f7=['../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','status','end','offset','limit','undefined','count','set','json','apply','save','update','then','destroy','sendStatus','error','map','SugarcrmConfiguration','key','model','name','keys','intersection','attributes','fields','query','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','rawAttributes','catch','create','body','find','findOne','SugarcrmField','options','hasOwnProperty','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis'];(function(_0x3fd2f3,_0x417377){var _0x83f492=function(_0xb6b0b5){while(--_0xb6b0b5){_0x3fd2f3['push'](_0x3fd2f3['shift']());}};_0x83f492(++_0x417377);}(_0x49f7,0xcd));var _0x749f=function(_0x7b7e1,_0x482844){_0x7b7e1=_0x7b7e1-0x0;var _0x55075c=_0x49f7[_0x7b7e1];return _0x55075c;};'use strict';var emlformat=require(_0x749f('0x0'));var rimraf=require(_0x749f('0x1'));var zipdir=require(_0x749f('0x2'));var jsonpatch=require(_0x749f('0x3'));var rp=require(_0x749f('0x4'));var moment=require(_0x749f('0x5'));var BPromise=require(_0x749f('0x6'));var Mustache=require(_0x749f('0x7'));var util=require('util');var path=require(_0x749f('0x8'));var sox=require(_0x749f('0x9'));var csv=require(_0x749f('0xa'));var ejs=require(_0x749f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x749f('0xc'));var squel=require(_0x749f('0xd'));var crypto=require(_0x749f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x749f('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x749f('0x10'));var authService=require(_0x749f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x749f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x749f('0x13'));var utils=require(_0x749f('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x749f('0x15'))['db'];function respondWithStatusCode(_0x7f74db,_0xac4c8d){_0xac4c8d=_0xac4c8d||0xcc;return function(_0x34b5c5){if(_0x34b5c5){return _0x7f74db['sendStatus'](_0xac4c8d);}return _0x7f74db[_0x749f('0x16')](_0xac4c8d)[_0x749f('0x17')]();};}function respondWithResult(_0x15a963,_0x67d608){_0x67d608=_0x67d608||0xc8;return function(_0x58c063){if(_0x58c063){return _0x15a963['status'](_0x67d608)['json'](_0x58c063);}};}function respondWithFilteredResult(_0x5e9aab,_0x16076e){return function(_0xabb872){if(_0xabb872){var _0xc57aa8=typeof _0x16076e[_0x749f('0x18')]==='undefined'&&typeof _0x16076e[_0x749f('0x19')]===_0x749f('0x1a');var _0x2d792f=_0xabb872['count'];var _0xe6bff5=_0xc57aa8?0x0:_0x16076e[_0x749f('0x18')];var _0x19ec1e=_0xc57aa8?_0xabb872[_0x749f('0x1b')]:_0x16076e['offset']+_0x16076e[_0x749f('0x19')];var _0x1b9ff9;if(_0x19ec1e>=_0x2d792f){_0x19ec1e=_0x2d792f;_0x1b9ff9=0xc8;}else{_0x1b9ff9=0xce;}_0x5e9aab['status'](_0x1b9ff9);return _0x5e9aab[_0x749f('0x1c')]('Content-Range',_0xe6bff5+'-'+_0x19ec1e+'/'+_0x2d792f)[_0x749f('0x1d')](_0xabb872);}return null;};}function patchUpdates(_0x8b023){return function(_0x112afd){try{jsonpatch[_0x749f('0x1e')](_0x112afd,_0x8b023,!![]);}catch(_0x185756){return BPromise['reject'](_0x185756);}return _0x112afd[_0x749f('0x1f')]();};}function saveUpdates(_0x3d6db8,_0x5c44b1){return function(_0x28586b){if(_0x28586b){return _0x28586b[_0x749f('0x20')](_0x3d6db8)[_0x749f('0x21')](function(_0x227a3e){return _0x227a3e;});}return null;};}function removeEntity(_0x36fbcc,_0x43f3ad){return function(_0x4c413f){if(_0x4c413f){return _0x4c413f[_0x749f('0x22')]()['then'](function(){_0x36fbcc[_0x749f('0x16')](0xcc)[_0x749f('0x17')]();});}};}function handleEntityNotFound(_0x26674f,_0x2f4896){return function(_0x3a4e27){if(!_0x3a4e27){_0x26674f[_0x749f('0x23')](0x194);}return _0x3a4e27;};}function handleError(_0x520f7b,_0xac38b1){_0xac38b1=_0xac38b1||0x1f4;return function(_0x59fba6){logger[_0x749f('0x24')](_0x59fba6['stack']);if(_0x59fba6['name']){delete _0x59fba6['name'];}_0x520f7b[_0x749f('0x16')](_0xac38b1)['send'](_0x59fba6);};}exports['index']=function(_0x5259ed,_0x612479){var _0x46d894={},_0x5e1c08={},_0x6bacf4={'count':0x0,'rows':[]};var _0x467061=_[_0x749f('0x25')](db[_0x749f('0x26')]['rawAttributes'],function(_0x1a3eef){return{'name':_0x1a3eef['fieldName'],'type':_0x1a3eef['type'][_0x749f('0x27')]};});_0x5e1c08[_0x749f('0x28')]=_[_0x749f('0x25')](_0x467061,_0x749f('0x29'));_0x5e1c08['query']=_[_0x749f('0x2a')](_0x5259ed['query']);_0x5e1c08['filters']=_[_0x749f('0x2b')](_0x5e1c08[_0x749f('0x28')],_0x5e1c08['query']);_0x46d894[_0x749f('0x2c')]=_[_0x749f('0x2b')](_0x5e1c08[_0x749f('0x28')],qs[_0x749f('0x2d')](_0x5259ed[_0x749f('0x2e')]['fields']));_0x46d894['attributes']=_0x46d894[_0x749f('0x2c')][_0x749f('0x2f')]?_0x46d894['attributes']:_0x5e1c08[_0x749f('0x28')];if(!_0x5259ed[_0x749f('0x2e')]['hasOwnProperty'](_0x749f('0x30'))){_0x46d894['limit']=qs[_0x749f('0x19')](_0x5259ed[_0x749f('0x2e')]['limit']);_0x46d894[_0x749f('0x18')]=qs[_0x749f('0x18')](_0x5259ed[_0x749f('0x2e')][_0x749f('0x18')]);}_0x46d894[_0x749f('0x31')]=qs[_0x749f('0x32')](_0x5259ed['query']['sort']);_0x46d894[_0x749f('0x33')]=qs[_0x749f('0x34')](_[_0x749f('0x35')](_0x5259ed[_0x749f('0x2e')],_0x5e1c08[_0x749f('0x34')]),_0x467061);if(_0x5259ed['query'][_0x749f('0x36')]){_0x46d894[_0x749f('0x33')]=_[_0x749f('0x37')](_0x46d894['where'],{'$or':_[_0x749f('0x25')](_0x467061,function(_0x496080){if(_0x496080['type']!==_0x749f('0x38')){var _0x7173eb={};_0x7173eb[_0x496080[_0x749f('0x29')]]={'$like':'%'+_0x5259ed[_0x749f('0x2e')][_0x749f('0x36')]+'%'};return _0x7173eb;}})});}_0x46d894=_[_0x749f('0x37')]({},_0x46d894,_0x5259ed['options']);var _0x39d009={'where':_0x46d894[_0x749f('0x33')]};return db[_0x749f('0x26')]['count'](_0x39d009)[_0x749f('0x21')](function(_0x3155c2){_0x6bacf4['count']=_0x3155c2;if(_0x5259ed['query'][_0x749f('0x39')]){_0x46d894[_0x749f('0x3a')]=[{'all':!![]}];}return db[_0x749f('0x26')]['findAll'](_0x46d894);})[_0x749f('0x21')](function(_0x2ae5db){_0x6bacf4[_0x749f('0x3b')]=_0x2ae5db;return _0x6bacf4;})[_0x749f('0x21')](respondWithFilteredResult(_0x612479,_0x46d894))['catch'](handleError(_0x612479,null));};exports[_0x749f('0x3c')]=function(_0x2d1d1a,_0x4493e2){var _0x29a676={'raw':![],'where':{'id':_0x2d1d1a[_0x749f('0x3d')]['id']}},_0xd99a08={};_0xd99a08[_0x749f('0x28')]=_[_0x749f('0x2a')](db[_0x749f('0x26')][_0x749f('0x3e')]);_0xd99a08[_0x749f('0x2e')]=_[_0x749f('0x2a')](_0x2d1d1a[_0x749f('0x2e')]);_0xd99a08[_0x749f('0x34')]=_[_0x749f('0x2b')](_0xd99a08[_0x749f('0x28')],_0xd99a08[_0x749f('0x2e')]);_0x29a676[_0x749f('0x2c')]=_['intersection'](_0xd99a08['model'],qs[_0x749f('0x2d')](_0x2d1d1a[_0x749f('0x2e')][_0x749f('0x2d')]));_0x29a676['attributes']=_0x29a676[_0x749f('0x2c')][_0x749f('0x2f')]?_0x29a676[_0x749f('0x2c')]:_0xd99a08[_0x749f('0x28')];if(_0x2d1d1a[_0x749f('0x2e')][_0x749f('0x39')]){_0x29a676['include']=[{'all':!![]}];}_0x29a676=_[_0x749f('0x37')]({},_0x29a676,_0x2d1d1a['options']);return db[_0x749f('0x26')]['find'](_0x29a676)[_0x749f('0x21')](handleEntityNotFound(_0x4493e2,null))[_0x749f('0x21')](respondWithResult(_0x4493e2,null))[_0x749f('0x3f')](handleError(_0x4493e2,null));};exports['create']=function(_0xc50d12,_0x160c38){return db[_0x749f('0x26')][_0x749f('0x40')](_0xc50d12[_0x749f('0x41')],{})[_0x749f('0x21')](respondWithResult(_0x160c38,0xc9))[_0x749f('0x3f')](handleError(_0x160c38,null));};exports[_0x749f('0x20')]=function(_0x2b86c7,_0x5b504b){if(_0x2b86c7['body']['id']){delete _0x2b86c7[_0x749f('0x41')]['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x2b86c7['params']['id']}})[_0x749f('0x21')](handleEntityNotFound(_0x5b504b,null))[_0x749f('0x21')](saveUpdates(_0x2b86c7['body'],null))[_0x749f('0x21')](respondWithResult(_0x5b504b,null))[_0x749f('0x3f')](handleError(_0x5b504b,null));};exports[_0x749f('0x22')]=function(_0x532728,_0x3c2a23){return db[_0x749f('0x26')][_0x749f('0x42')]({'where':{'id':_0x532728[_0x749f('0x3d')]['id']}})[_0x749f('0x21')](handleEntityNotFound(_0x3c2a23,null))[_0x749f('0x21')](removeEntity(_0x3c2a23,null))[_0x749f('0x3f')](handleError(_0x3c2a23,null));};exports['getFields']=function(_0x20776a,_0x3ec8c1,_0x595478){var _0x406fc8={};var _0x5c0b2b={};var _0x1c8bcc;var _0x39d5f1;return db[_0x749f('0x26')][_0x749f('0x43')]({'where':{'id':_0x20776a[_0x749f('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3ec8c1,null))[_0x749f('0x21')](function(_0x17441f){if(_0x17441f){_0x1c8bcc=_0x17441f;_0x5c0b2b[_0x749f('0x28')]=_[_0x749f('0x2a')](db[_0x749f('0x44')][_0x749f('0x3e')]);_0x5c0b2b[_0x749f('0x2e')]=_[_0x749f('0x2a')](_0x20776a[_0x749f('0x2e')]);_0x5c0b2b['filters']=_['intersection'](_0x5c0b2b[_0x749f('0x28')],_0x5c0b2b[_0x749f('0x2e')]);_0x406fc8[_0x749f('0x2c')]=_['intersection'](_0x5c0b2b[_0x749f('0x28')],qs[_0x749f('0x2d')](_0x20776a['query']['fields']));_0x406fc8[_0x749f('0x2c')]=_0x406fc8[_0x749f('0x2c')][_0x749f('0x2f')]?_0x406fc8[_0x749f('0x2c')]:_0x5c0b2b[_0x749f('0x28')];_0x406fc8[_0x749f('0x31')]=qs['sort'](_0x20776a[_0x749f('0x2e')]['sort']);_0x406fc8[_0x749f('0x33')]=qs[_0x749f('0x34')](_[_0x749f('0x35')](_0x20776a[_0x749f('0x2e')],_0x5c0b2b[_0x749f('0x34')]));if(_0x20776a[_0x749f('0x2e')]['filter']){_0x406fc8[_0x749f('0x33')]=_[_0x749f('0x37')](_0x406fc8[_0x749f('0x33')],{'$or':_[_0x749f('0x25')](_0x406fc8[_0x749f('0x2c')],function(_0x182da0){var _0x3504b9={};_0x3504b9[_0x182da0]={'$like':'%'+_0x20776a[_0x749f('0x2e')]['filter']+'%'};return _0x3504b9;})});}_0x406fc8=_[_0x749f('0x37')]({},_0x406fc8,_0x20776a[_0x749f('0x45')]);return _0x1c8bcc['getFields'](_0x406fc8);}})['then'](function(_0x35954b){if(_0x35954b){_0x39d5f1=_0x35954b[_0x749f('0x2f')];if(!_0x20776a[_0x749f('0x2e')][_0x749f('0x46')]('nolimit')){_0x406fc8['limit']=qs[_0x749f('0x19')](_0x20776a[_0x749f('0x2e')][_0x749f('0x19')]);_0x406fc8[_0x749f('0x18')]=qs[_0x749f('0x18')](_0x20776a['query'][_0x749f('0x18')]);}return _0x1c8bcc[_0x749f('0x47')](_0x406fc8);}})['then'](function(_0x929be6){if(_0x929be6){return _0x929be6?{'count':_0x39d5f1,'rows':_0x929be6}:null;}})[_0x749f('0x21')](respondWithResult(_0x3ec8c1,null))[_0x749f('0x3f')](handleError(_0x3ec8c1,null));};exports['getSubjects']=function(_0x7527d5,_0x15780b,_0x5c6e4b){var _0x36487b={};var _0x5f47d1={};var _0x2c88e0;var _0x1142f2;return db[_0x749f('0x26')][_0x749f('0x43')]({'where':{'id':_0x7527d5[_0x749f('0x3d')]['id']}})[_0x749f('0x21')](handleEntityNotFound(_0x15780b,null))['then'](function(_0x35701a){if(_0x35701a){_0x2c88e0=_0x35701a;_0x5f47d1[_0x749f('0x28')]=_[_0x749f('0x2a')](db[_0x749f('0x44')][_0x749f('0x3e')]);_0x5f47d1['query']=_['keys'](_0x7527d5[_0x749f('0x2e')]);_0x5f47d1[_0x749f('0x34')]=_['intersection'](_0x5f47d1[_0x749f('0x28')],_0x5f47d1[_0x749f('0x2e')]);_0x36487b['attributes']=_['intersection'](_0x5f47d1[_0x749f('0x28')],qs[_0x749f('0x2d')](_0x7527d5[_0x749f('0x2e')][_0x749f('0x2d')]));_0x36487b[_0x749f('0x2c')]=_0x36487b[_0x749f('0x2c')][_0x749f('0x2f')]?_0x36487b[_0x749f('0x2c')]:_0x5f47d1[_0x749f('0x28')];_0x36487b[_0x749f('0x31')]=qs[_0x749f('0x32')](_0x7527d5[_0x749f('0x2e')][_0x749f('0x32')]);_0x36487b[_0x749f('0x33')]=qs['filters'](_[_0x749f('0x35')](_0x7527d5[_0x749f('0x2e')],_0x5f47d1[_0x749f('0x34')]));if(_0x7527d5[_0x749f('0x2e')]['filter']){_0x36487b[_0x749f('0x33')]=_['merge'](_0x36487b[_0x749f('0x33')],{'$or':_[_0x749f('0x25')](_0x36487b['attributes'],function(_0x47e473){var _0x42a67e={};_0x42a67e[_0x47e473]={'$like':'%'+_0x7527d5[_0x749f('0x2e')][_0x749f('0x36')]+'%'};return _0x42a67e;})});}_0x36487b=_[_0x749f('0x37')]({},_0x36487b,_0x7527d5[_0x749f('0x45')]);return _0x2c88e0[_0x749f('0x48')](_0x36487b);}})[_0x749f('0x21')](function(_0x43bfb2){if(_0x43bfb2){_0x1142f2=_0x43bfb2[_0x749f('0x2f')];if(!_0x7527d5[_0x749f('0x2e')][_0x749f('0x46')](_0x749f('0x30'))){_0x36487b[_0x749f('0x19')]=qs[_0x749f('0x19')](_0x7527d5['query']['limit']);_0x36487b[_0x749f('0x18')]=qs[_0x749f('0x18')](_0x7527d5[_0x749f('0x2e')][_0x749f('0x18')]);}return _0x2c88e0[_0x749f('0x48')](_0x36487b);}})['then'](function(_0x5375aa){if(_0x5375aa){return _0x5375aa?{'count':_0x1142f2,'rows':_0x5375aa}:null;}})[_0x749f('0x21')](respondWithResult(_0x15780b,null))[_0x749f('0x3f')](handleError(_0x15780b,null));};exports[_0x749f('0x49')]=function(_0x1a3491,_0x408df4,_0x807b77){var _0x1c9aa7={};var _0x1d7bc4={};var _0x8f329a;var _0x47eb85;return db[_0x749f('0x26')][_0x749f('0x43')]({'where':{'id':_0x1a3491[_0x749f('0x3d')]['id']}})['then'](handleEntityNotFound(_0x408df4,null))[_0x749f('0x21')](function(_0x39c9e7){if(_0x39c9e7){_0x8f329a=_0x39c9e7;_0x1d7bc4['model']=_[_0x749f('0x2a')](db[_0x749f('0x44')][_0x749f('0x3e')]);_0x1d7bc4[_0x749f('0x2e')]=_['keys'](_0x1a3491['query']);_0x1d7bc4[_0x749f('0x34')]=_['intersection'](_0x1d7bc4[_0x749f('0x28')],_0x1d7bc4[_0x749f('0x2e')]);_0x1c9aa7['attributes']=_[_0x749f('0x2b')](_0x1d7bc4[_0x749f('0x28')],qs[_0x749f('0x2d')](_0x1a3491['query'][_0x749f('0x2d')]));_0x1c9aa7[_0x749f('0x2c')]=_0x1c9aa7['attributes'][_0x749f('0x2f')]?_0x1c9aa7['attributes']:_0x1d7bc4[_0x749f('0x28')];_0x1c9aa7[_0x749f('0x31')]=qs[_0x749f('0x32')](_0x1a3491[_0x749f('0x2e')][_0x749f('0x32')]);_0x1c9aa7[_0x749f('0x33')]=qs['filters'](_[_0x749f('0x35')](_0x1a3491['query'],_0x1d7bc4['filters']));if(_0x1a3491[_0x749f('0x2e')][_0x749f('0x36')]){_0x1c9aa7[_0x749f('0x33')]=_['merge'](_0x1c9aa7[_0x749f('0x33')],{'$or':_[_0x749f('0x25')](_0x1c9aa7[_0x749f('0x2c')],function(_0x4a398b){var _0x4c455a={};_0x4c455a[_0x4a398b]={'$like':'%'+_0x1a3491[_0x749f('0x2e')]['filter']+'%'};return _0x4c455a;})});}_0x1c9aa7=_['merge']({},_0x1c9aa7,_0x1a3491[_0x749f('0x45')]);return _0x8f329a['getDescriptions'](_0x1c9aa7);}})['then'](function(_0x2b8d61){if(_0x2b8d61){_0x47eb85=_0x2b8d61[_0x749f('0x2f')];if(!_0x1a3491['query'][_0x749f('0x46')](_0x749f('0x30'))){_0x1c9aa7['limit']=qs['limit'](_0x1a3491[_0x749f('0x2e')]['limit']);_0x1c9aa7[_0x749f('0x18')]=qs[_0x749f('0x18')](_0x1a3491[_0x749f('0x2e')][_0x749f('0x18')]);}return _0x8f329a[_0x749f('0x49')](_0x1c9aa7);}})[_0x749f('0x21')](function(_0x40ac9f){if(_0x40ac9f){return _0x40ac9f?{'count':_0x47eb85,'rows':_0x40ac9f}:null;}})[_0x749f('0x21')](respondWithResult(_0x408df4,null))[_0x749f('0x3f')](handleError(_0x408df4,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index fb6c2e5..3929144 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 _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 +var _0x5de0=['int_sugarcrm_configurations','lodash','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration'];(function(_0x1f7fb2,_0x116309){var _0x61fc27=function(_0x4b981c){while(--_0x4b981c){_0x1f7fb2['push'](_0x1f7fb2['shift']());}};_0x61fc27(++_0x116309);}(_0x5de0,0x131));var _0x05de=function(_0x3ab42f,_0x3a6be1){_0x3ab42f=_0x3ab42f-0x0;var _0x1f9d6=_0x5de0[_0x3ab42f];return _0x1f9d6;};'use strict';var _=require(_0x05de('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x05de('0x1'));var fs=require('fs');var path=require(_0x05de('0x2'));var rimraf=require(_0x05de('0x3'));var config=require('../../config/environment');var attributes=require(_0x05de('0x4'));module[_0x05de('0x5')]=function(_0x1817c7,_0x41da5d){return _0x1817c7['define'](_0x05de('0x6'),attributes,{'tableName':_0x05de('0x7'),'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 484d1c6..40467d8 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 _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 +var _0x952d=['catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x58e025,_0xbeb690){var _0x1b9541=function(_0x130dca){while(--_0x130dca){_0x58e025['push'](_0x58e025['shift']());}};_0x1b9541(++_0xbeb690);}(_0x952d,0x1cf));var _0xd952=function(_0xabefa7,_0x13adf7){_0xabefa7=_0xabefa7-0x0;var _0x2df7b8=_0x952d[_0xabefa7];return _0x2df7b8;};'use strict';var _=require(_0xd952('0x0'));var util=require(_0xd952('0x1'));var moment=require('moment');var BPromise=require(_0xd952('0x2'));var rs=require(_0xd952('0x3'));var fs=require('fs');var Redis=require(_0xd952('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd952('0x5'));var logger=require(_0xd952('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd952('0x7'));var client=jayson[_0xd952('0x8')][_0xd952('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d15f8,_0x1b560e,_0x5ad7cc){return new BPromise(function(_0x503660,_0x53fbe8){return client[_0xd952('0xa')](_0x5d15f8,_0x5ad7cc)[_0xd952('0xb')](function(_0x1e9ad5){logger[_0xd952('0xc')](_0xd952('0xd'),_0x1b560e,_0xd952('0xe'));logger[_0xd952('0xf')](_0xd952('0x10'),_0x1b560e,_0xd952('0xe'),JSON['stringify'](_0x1e9ad5));if(_0x1e9ad5[_0xd952('0x11')]){if(_0x1e9ad5['error']['code']===0x1f4){logger['error'](_0xd952('0xd'),_0x1b560e,_0x1e9ad5['error'][_0xd952('0x12')]);return _0x53fbe8(_0x1e9ad5[_0xd952('0x11')]['message']);}logger[_0xd952('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1b560e,_0x1e9ad5['error'][_0xd952('0x12')]);return _0x503660(_0x1e9ad5[_0xd952('0x11')]['message']);}else{logger[_0xd952('0xc')](_0xd952('0xd'),_0x1b560e,_0xd952('0xe'));_0x503660(_0x1e9ad5[_0xd952('0x13')]['message']);}})[_0xd952('0x14')](function(_0x5792eb){logger[_0xd952('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1b560e,_0x5792eb);_0x53fbe8(_0x5792eb);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 154bcc2..2269123 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 _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 +var _0xacd8=['destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','post','isAuthenticated','create','update','delete'];(function(_0x5799d6,_0x332e3b){var _0x3e901e=function(_0x4ac24e){while(--_0x4ac24e){_0x5799d6['push'](_0x5799d6['shift']());}};_0x3e901e(++_0x332e3b);}(_0xacd8,0xd2));var _0x8acd=function(_0xd80bee,_0x6c993b){_0xd80bee=_0xd80bee-0x0;var _0x276a88=_0xacd8[_0xd80bee];return _0x276a88;};'use strict';var multer=require(_0x8acd('0x0'));var util=require(_0x8acd('0x1'));var path=require(_0x8acd('0x2'));var timeout=require('connect-timeout');var express=require(_0x8acd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8acd('0x4'));var interaction=require(_0x8acd('0x5'));var config=require(_0x8acd('0x6'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8acd('0x7')]);router['get'](_0x8acd('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x8acd('0x9')]('/',auth[_0x8acd('0xa')](),controller[_0x8acd('0xb')]);router['put'](_0x8acd('0x8'),auth[_0x8acd('0xa')](),controller[_0x8acd('0xc')]);router[_0x8acd('0xd')](_0x8acd('0x8'),auth[_0x8acd('0xa')](),controller[_0x8acd('0xe')]);module[_0x8acd('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index a459ee9..ce231ec 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 _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 +var _0x13a5=['STRING','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0x5a8aae,_0x97e1e){var _0x2c3368=function(_0x10bc2f){while(--_0x10bc2f){_0x5a8aae['push'](_0x5a8aae['shift']());}};_0x2c3368(++_0x97e1e);}(_0x13a5,0x9b));var _0x513a=function(_0x30fa9e,_0x4da10e){_0x30fa9e=_0x30fa9e-0x0;var _0x1aecd3=_0x13a5[_0x30fa9e];return _0x1aecd3;};'use strict';var Sequelize=require('sequelize');module[_0x513a('0x0')]={'type':{'type':Sequelize[_0x513a('0x1')](_0x513a('0x2'),'variable',_0x513a('0x3'),_0x513a('0x4'),_0x513a('0x5')),'defaultValue':_0x513a('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x513a('0x1')]('string','variable',_0x513a('0x3'))},'keyContent':{'type':Sequelize[_0x513a('0x6')]},'idField':{'type':Sequelize[_0x513a('0x6')]},'nameField':{'type':Sequelize[_0x513a('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x513a('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index f400919..cad4ef2 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 _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 +var _0xa99b=['to-csv','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','Content-Range','apply','reject','save','update','then','stack','name','send','map','SugarcrmField','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','include','rows','catch','params','rawAttributes','includeAll','create','find','body','rimraf','fast-json-patch','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa99b,0x7e));var _0xba99=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xa99b[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba99('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba99('0x1'));var rp=require('request-promise');var moment=require(_0xba99('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xba99('0x3'));var util=require(_0xba99('0x4'));var path=require('path');var sox=require(_0xba99('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba99('0x6'));var _=require(_0xba99('0x7'));var squel=require(_0xba99('0x8'));var crypto=require(_0xba99('0x9'));var jsforce=require(_0xba99('0xa'));var deskjs=require(_0xba99('0xb'));var toCsv=require(_0xba99('0xc'));var querystring=require('querystring');var Papa=require(_0xba99('0xd'));var Redis=require(_0xba99('0xe'));var authService=require(_0xba99('0xf'));var qs=require(_0xba99('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xba99('0x11'));var logger=require(_0xba99('0x12'))(_0xba99('0x13'));var utils=require(_0xba99('0x14'));var config=require(_0xba99('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xba99('0x16'))['db'];function respondWithStatusCode(_0x3070b7,_0x221551){_0x221551=_0x221551||0xcc;return function(_0x43edaf){if(_0x43edaf){return _0x3070b7[_0xba99('0x17')](_0x221551);}return _0x3070b7[_0xba99('0x18')](_0x221551)[_0xba99('0x19')]();};}function respondWithResult(_0x2e05db,_0x2001ff){_0x2001ff=_0x2001ff||0xc8;return function(_0x314bbe){if(_0x314bbe){return _0x2e05db[_0xba99('0x18')](_0x2001ff)[_0xba99('0x1a')](_0x314bbe);}};}function respondWithFilteredResult(_0x3eaf10,_0x23f6e4){return function(_0x5c1985){if(_0x5c1985){var _0x2aac9b=typeof _0x23f6e4[_0xba99('0x1b')]===_0xba99('0x1c')&&typeof _0x23f6e4[_0xba99('0x1d')]===_0xba99('0x1c');var _0x1fcbe8=_0x5c1985[_0xba99('0x1e')];var _0x20c313=_0x2aac9b?0x0:_0x23f6e4[_0xba99('0x1b')];var _0x50a617=_0x2aac9b?_0x5c1985[_0xba99('0x1e')]:_0x23f6e4[_0xba99('0x1b')]+_0x23f6e4[_0xba99('0x1d')];var _0x2c7d45;if(_0x50a617>=_0x1fcbe8){_0x50a617=_0x1fcbe8;_0x2c7d45=0xc8;}else{_0x2c7d45=0xce;}_0x3eaf10[_0xba99('0x18')](_0x2c7d45);return _0x3eaf10['set'](_0xba99('0x1f'),_0x20c313+'-'+_0x50a617+'/'+_0x1fcbe8)['json'](_0x5c1985);}return null;};}function patchUpdates(_0x5939a0){return function(_0x5b23f7){try{jsonpatch[_0xba99('0x20')](_0x5b23f7,_0x5939a0,!![]);}catch(_0x3fd09e){return BPromise[_0xba99('0x21')](_0x3fd09e);}return _0x5b23f7[_0xba99('0x22')]();};}function saveUpdates(_0x2cc26e,_0x164633){return function(_0xf6f308){if(_0xf6f308){return _0xf6f308[_0xba99('0x23')](_0x2cc26e)[_0xba99('0x24')](function(_0x42639c){return _0x42639c;});}return null;};}function removeEntity(_0x30dc59,_0x1fc9a2){return function(_0x435e4b){if(_0x435e4b){return _0x435e4b['destroy']()[_0xba99('0x24')](function(){_0x30dc59[_0xba99('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b4a9b,_0xb6e329){return function(_0x178f1a){if(!_0x178f1a){_0x1b4a9b[_0xba99('0x17')](0x194);}return _0x178f1a;};}function handleError(_0x1ff829,_0x196b5a){_0x196b5a=_0x196b5a||0x1f4;return function(_0x3963a7){logger['error'](_0x3963a7[_0xba99('0x25')]);if(_0x3963a7[_0xba99('0x26')]){delete _0x3963a7[_0xba99('0x26')];}_0x1ff829[_0xba99('0x18')](_0x196b5a)[_0xba99('0x27')](_0x3963a7);};}exports['index']=function(_0x570124,_0x4e6484){var _0x3c5692={},_0x27241a={},_0x314676={'count':0x0,'rows':[]};var _0x5cde41=_[_0xba99('0x28')](db[_0xba99('0x29')]['rawAttributes'],function(_0x18ff1f){return{'name':_0x18ff1f[_0xba99('0x2a')],'type':_0x18ff1f[_0xba99('0x2b')][_0xba99('0x2c')]};});_0x27241a['model']=_[_0xba99('0x28')](_0x5cde41,_0xba99('0x26'));_0x27241a[_0xba99('0x2d')]=_[_0xba99('0x2e')](_0x570124[_0xba99('0x2d')]);_0x27241a[_0xba99('0x2f')]=_[_0xba99('0x30')](_0x27241a[_0xba99('0x31')],_0x27241a['query']);_0x3c5692['attributes']=_[_0xba99('0x30')](_0x27241a['model'],qs[_0xba99('0x32')](_0x570124[_0xba99('0x2d')]['fields']));_0x3c5692[_0xba99('0x33')]=_0x3c5692[_0xba99('0x33')][_0xba99('0x34')]?_0x3c5692['attributes']:_0x27241a[_0xba99('0x31')];if(!_0x570124[_0xba99('0x2d')][_0xba99('0x35')]('nolimit')){_0x3c5692[_0xba99('0x1d')]=qs[_0xba99('0x1d')](_0x570124[_0xba99('0x2d')][_0xba99('0x1d')]);_0x3c5692[_0xba99('0x1b')]=qs['offset'](_0x570124[_0xba99('0x2d')][_0xba99('0x1b')]);}_0x3c5692[_0xba99('0x36')]=qs['sort'](_0x570124['query'][_0xba99('0x37')]);_0x3c5692[_0xba99('0x38')]=qs[_0xba99('0x2f')](_['pick'](_0x570124[_0xba99('0x2d')],_0x27241a[_0xba99('0x2f')]),_0x5cde41);if(_0x570124['query']['filter']){_0x3c5692[_0xba99('0x38')]=_[_0xba99('0x39')](_0x3c5692[_0xba99('0x38')],{'$or':_[_0xba99('0x28')](_0x5cde41,function(_0x589604){if(_0x589604['type']!==_0xba99('0x3a')){var _0x17fa2c={};_0x17fa2c[_0x589604[_0xba99('0x26')]]={'$like':'%'+_0x570124[_0xba99('0x2d')]['filter']+'%'};return _0x17fa2c;}})});}_0x3c5692=_[_0xba99('0x39')]({},_0x3c5692,_0x570124[_0xba99('0x3b')]);var _0x49ab5c={'where':_0x3c5692['where']};return db[_0xba99('0x29')]['count'](_0x49ab5c)[_0xba99('0x24')](function(_0x3b8ab4){_0x314676[_0xba99('0x1e')]=_0x3b8ab4;if(_0x570124[_0xba99('0x2d')]['includeAll']){_0x3c5692[_0xba99('0x3c')]=[{'all':!![]}];}return db[_0xba99('0x29')]['findAll'](_0x3c5692);})['then'](function(_0x50b610){_0x314676[_0xba99('0x3d')]=_0x50b610;return _0x314676;})[_0xba99('0x24')](respondWithFilteredResult(_0x4e6484,_0x3c5692))[_0xba99('0x3e')](handleError(_0x4e6484,null));};exports['show']=function(_0x3d4464,_0x53b504){var _0x3daf4a={'raw':!![],'where':{'id':_0x3d4464[_0xba99('0x3f')]['id']}},_0x2d5607={};_0x2d5607[_0xba99('0x31')]=_[_0xba99('0x2e')](db['SugarcrmField'][_0xba99('0x40')]);_0x2d5607[_0xba99('0x2d')]=_[_0xba99('0x2e')](_0x3d4464[_0xba99('0x2d')]);_0x2d5607[_0xba99('0x2f')]=_['intersection'](_0x2d5607[_0xba99('0x31')],_0x2d5607[_0xba99('0x2d')]);_0x3daf4a[_0xba99('0x33')]=_[_0xba99('0x30')](_0x2d5607[_0xba99('0x31')],qs['fields'](_0x3d4464[_0xba99('0x2d')][_0xba99('0x32')]));_0x3daf4a[_0xba99('0x33')]=_0x3daf4a[_0xba99('0x33')][_0xba99('0x34')]?_0x3daf4a['attributes']:_0x2d5607[_0xba99('0x31')];if(_0x3d4464[_0xba99('0x2d')][_0xba99('0x41')]){_0x3daf4a[_0xba99('0x3c')]=[{'all':!![]}];}_0x3daf4a=_[_0xba99('0x39')]({},_0x3daf4a,_0x3d4464['options']);return db['SugarcrmField']['find'](_0x3daf4a)[_0xba99('0x24')](handleEntityNotFound(_0x53b504,null))['then'](respondWithResult(_0x53b504,null))['catch'](handleError(_0x53b504,null));};exports['create']=function(_0x3c640f,_0x502f7b){return db[_0xba99('0x29')][_0xba99('0x42')](_0x3c640f['body'],{})['then'](respondWithResult(_0x502f7b,0xc9))['catch'](handleError(_0x502f7b,null));};exports['update']=function(_0x512e30,_0x49e639){if(_0x512e30['body']['id']){delete _0x512e30['body']['id'];}return db[_0xba99('0x29')][_0xba99('0x43')]({'where':{'id':_0x512e30[_0xba99('0x3f')]['id']}})['then'](handleEntityNotFound(_0x49e639,null))[_0xba99('0x24')](saveUpdates(_0x512e30[_0xba99('0x44')],null))[_0xba99('0x24')](respondWithResult(_0x49e639,null))[_0xba99('0x3e')](handleError(_0x49e639,null));};exports['destroy']=function(_0x1820e6,_0x4e46f8){return db[_0xba99('0x29')][_0xba99('0x43')]({'where':{'id':_0x1820e6['params']['id']}})[_0xba99('0x24')](handleEntityNotFound(_0x4e46f8,null))[_0xba99('0x24')](removeEntity(_0x4e46f8,null))['catch'](handleError(_0x4e46f8,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 160ae26..868d1b6 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 _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 +var _0x6f7e=['define','SugarcrmField','int_sugarcrm_fields','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes','exports'];(function(_0x40fb56,_0x44c1eb){var _0x143149=function(_0x549c1f){while(--_0x549c1f){_0x40fb56['push'](_0x40fb56['shift']());}};_0x143149(++_0x44c1eb);}(_0x6f7e,0xc7));var _0xe6f7=function(_0x51ea2e,_0x445b96){_0x51ea2e=_0x51ea2e-0x0;var _0x4f106d=_0x6f7e[_0x51ea2e];return _0x4f106d;};'use strict';var _=require(_0xe6f7('0x0'));var util=require(_0xe6f7('0x1'));var logger=require(_0xe6f7('0x2'))(_0xe6f7('0x3'));var moment=require(_0xe6f7('0x4'));var BPromise=require(_0xe6f7('0x5'));var rp=require(_0xe6f7('0x6'));var fs=require('fs');var path=require(_0xe6f7('0x7'));var rimraf=require('rimraf');var config=require(_0xe6f7('0x8'));var attributes=require(_0xe6f7('0x9'));module[_0xe6f7('0xa')]=function(_0x1edfe3,_0x25be7f){return _0x1edfe3[_0xe6f7('0xb')](_0xe6f7('0xc'),attributes,{'tableName':_0xe6f7('0xd'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0xe6f7('0xe')],'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 6b5897a..ab29860 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 _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 +var _0xaede=['message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x35c584,_0x5c3a8d){var _0x234b3b=function(_0x5961dd){while(--_0x5961dd){_0x35c584['push'](_0x35c584['shift']());}};_0x234b3b(++_0x5c3a8d);}(_0xaede,0x1dc));var _0xeaed=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xaede[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xeaed('0x0'));var util=require(_0xeaed('0x1'));var moment=require(_0xeaed('0x2'));var BPromise=require(_0xeaed('0x3'));var rs=require(_0xeaed('0x4'));var fs=require('fs');var Redis=require(_0xeaed('0x5'));var db=require(_0xeaed('0x6'))['db'];var utils=require(_0xeaed('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xeaed('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xeaed('0x9')][_0xeaed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xeefc0a,_0xf7ff6e,_0x2a2a09){return new BPromise(function(_0x148161,_0x23ffc6){return client[_0xeaed('0xb')](_0xeefc0a,_0x2a2a09)['then'](function(_0x4a5ae7){logger[_0xeaed('0xc')](_0xeaed('0xd'),_0xf7ff6e,_0xeaed('0xe'));logger[_0xeaed('0xf')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0xf7ff6e,_0xeaed('0xe'),JSON[_0xeaed('0x10')](_0x4a5ae7));if(_0x4a5ae7[_0xeaed('0x11')]){if(_0x4a5ae7[_0xeaed('0x11')]['code']===0x1f4){logger[_0xeaed('0x11')](_0xeaed('0xd'),_0xf7ff6e,_0x4a5ae7[_0xeaed('0x11')][_0xeaed('0x12')]);return _0x23ffc6(_0x4a5ae7['error'][_0xeaed('0x12')]);}logger['error'](_0xeaed('0xd'),_0xf7ff6e,_0x4a5ae7[_0xeaed('0x11')]['message']);return _0x148161(_0x4a5ae7['error']['message']);}else{logger[_0xeaed('0xc')]('SugarcrmField,\x20%s,\x20%s',_0xf7ff6e,_0xeaed('0xe'));_0x148161(_0x4a5ae7['result']['message']);}})['catch'](function(_0x353c48){logger[_0xeaed('0x11')](_0xeaed('0xd'),_0xf7ff6e,_0x353c48);_0x23ffc6(_0x353c48);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index cfe3941..bc3cf1b 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 _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 +var _0x579c=['delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id'];(function(_0x5535ae,_0x195d28){var _0x5f478c=function(_0x43e7b9){while(--_0x43e7b9){_0x5535ae['push'](_0x5535ae['shift']());}};_0x5f478c(++_0x195d28);}(_0x579c,0xda));var _0xc579=function(_0x22d694,_0x33bb96){_0x22d694=_0x22d694-0x0;var _0x58dc27=_0x579c[_0x22d694];return _0x58dc27;};'use strict';var multer=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var path=require(_0xc579('0x2'));var timeout=require(_0xc579('0x3'));var express=require(_0xc579('0x4'));var router=express['Router']();var fs_extra=require(_0xc579('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc579('0x6'));var config=require(_0xc579('0x7'));var controller=require(_0xc579('0x8'));router[_0xc579('0x9')]('/',auth[_0xc579('0xa')](),controller[_0xc579('0xb')]);router[_0xc579('0x9')]('/:id',auth[_0xc579('0xa')](),controller[_0xc579('0xc')]);router[_0xc579('0x9')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0xe')]);router[_0xc579('0x9')](_0xc579('0xf'),auth['isAuthenticated'](),controller[_0xc579('0x10')]);router[_0xc579('0x11')]('/',auth[_0xc579('0xa')](),controller[_0xc579('0x12')]);router[_0xc579('0x11')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0x13')]);router[_0xc579('0x14')](_0xc579('0x15'),auth[_0xc579('0xa')](),controller['update']);router[_0xc579('0x16')]('/:id',auth[_0xc579('0xa')](),controller['destroy']);module[_0xc579('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 9748f73..e8bc452 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 _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 +var _0xcdc0=['STRING','HelpDesk','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xcdc0,0xaa));var _0x0cdc=function(_0x472833,_0x1c092f){_0x472833=_0x472833-0x0;var _0x342b1a=_0xcdc0[_0x472833];return _0x342b1a;};'use strict';var Sequelize=require('sequelize');module[_0x0cdc('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x0cdc('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0cdc('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x0cdc('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index e9d3e2e..a8581db 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 _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 +var _0xf796=['destroy','end','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','length','find','create','body','getConfigurations','findOne','nolimit','limit','addConfiguration','AccountId','Subjects','channel','type','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','format','%s/webservice.php','getchallenge','success','login','describe','result','sessionName','autogenerated','owner','remove','includes','editable','false','label','startsWith','cf_','picklistValues','value','log','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','save','then'];(function(_0x5a1a26,_0x2060ca){var _0x13ec41=function(_0x33b1e4){while(--_0x33b1e4){_0x5a1a26['push'](_0x5a1a26['shift']());}};_0x13ec41(++_0x2060ca);}(_0xf796,0x13e));var _0x6f79=function(_0x5ed237,_0x11f79b){_0x5ed237=_0x5ed237-0x0;var _0x6d29c=_0xf796[_0x5ed237];return _0x6d29c;};'use strict';var emlformat=require(_0x6f79('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6f79('0x1'));var jsonpatch=require(_0x6f79('0x2'));var rp=require(_0x6f79('0x3'));var moment=require(_0x6f79('0x4'));var BPromise=require(_0x6f79('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6f79('0x6'));var sox=require(_0x6f79('0x7'));var csv=require(_0x6f79('0x8'));var ejs=require(_0x6f79('0x9'));var fs=require('fs');var fs_extra=require(_0x6f79('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6f79('0xb'));var jsforce=require(_0x6f79('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6f79('0x8'));var querystring=require(_0x6f79('0xd'));var Papa=require(_0x6f79('0xe'));var Redis=require(_0x6f79('0xf'));var authService=require(_0x6f79('0x10'));var qs=require(_0x6f79('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f79('0x12'))(_0x6f79('0x13'));var utils=require(_0x6f79('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x6f79('0x15'));function respondWithStatusCode(_0x8f8259,_0x53be9f){_0x53be9f=_0x53be9f||0xcc;return function(_0x4d3dcf){if(_0x4d3dcf){return _0x8f8259[_0x6f79('0x16')](_0x53be9f);}return _0x8f8259[_0x6f79('0x17')](_0x53be9f)['end']();};}function respondWithResult(_0x580e80,_0x80bec6){_0x80bec6=_0x80bec6||0xc8;return function(_0x5f1f1a){if(_0x5f1f1a){return _0x580e80['status'](_0x80bec6)[_0x6f79('0x18')](_0x5f1f1a);}};}function respondWithFilteredResult(_0x1456a6,_0x1b2c14){return function(_0x509521){if(_0x509521){var _0x4f9188=typeof _0x1b2c14[_0x6f79('0x19')]===_0x6f79('0x1a')&&typeof _0x1b2c14['limit']===_0x6f79('0x1a');var _0x19746e=_0x509521['count'];var _0x5c7fe6=_0x4f9188?0x0:_0x1b2c14[_0x6f79('0x19')];var _0x470e5c=_0x4f9188?_0x509521[_0x6f79('0x1b')]:_0x1b2c14[_0x6f79('0x19')]+_0x1b2c14['limit'];var _0x2f7422;if(_0x470e5c>=_0x19746e){_0x470e5c=_0x19746e;_0x2f7422=0xc8;}else{_0x2f7422=0xce;}_0x1456a6[_0x6f79('0x17')](_0x2f7422);return _0x1456a6[_0x6f79('0x1c')](_0x6f79('0x1d'),_0x5c7fe6+'-'+_0x470e5c+'/'+_0x19746e)['json'](_0x509521);}return null;};}function patchUpdates(_0x3cafcf){return function(_0x5a69be){try{jsonpatch[_0x6f79('0x1e')](_0x5a69be,_0x3cafcf,!![]);}catch(_0x386e7e){return BPromise['reject'](_0x386e7e);}return _0x5a69be[_0x6f79('0x1f')]();};}function saveUpdates(_0x1ed345,_0x583e53){return function(_0x3df68a){if(_0x3df68a){return _0x3df68a['update'](_0x1ed345)[_0x6f79('0x20')](function(_0x329a40){return _0x329a40;});}return null;};}function removeEntity(_0x50c56f,_0x22cc7d){return function(_0x5ee898){if(_0x5ee898){return _0x5ee898[_0x6f79('0x21')]()[_0x6f79('0x20')](function(){_0x50c56f[_0x6f79('0x17')](0xcc)[_0x6f79('0x22')]();});}};}function handleEntityNotFound(_0x143cb8,_0x1354fa){return function(_0x2a3ac9){if(!_0x2a3ac9){_0x143cb8[_0x6f79('0x16')](0x194);}return _0x2a3ac9;};}function handleError(_0x345342,_0x443a95){_0x443a95=_0x443a95||0x1f4;return function(_0x2033ba){logger[_0x6f79('0x23')](_0x2033ba[_0x6f79('0x24')]);if(_0x2033ba[_0x6f79('0x25')]){delete _0x2033ba[_0x6f79('0x25')];}_0x345342['status'](_0x443a95)[_0x6f79('0x26')](_0x2033ba);};}exports[_0x6f79('0x27')]=function(_0x4e03f3,_0x5c2aef){var _0xa724d8={},_0x3301b5={},_0x1526d7={'count':0x0,'rows':[]};var _0xfdc41a=_[_0x6f79('0x28')](db[_0x6f79('0x29')][_0x6f79('0x2a')],function(_0x2132a4){return{'name':_0x2132a4[_0x6f79('0x2b')],'type':_0x2132a4['type']['key']};});_0x3301b5['model']=_[_0x6f79('0x28')](_0xfdc41a,_0x6f79('0x25'));_0x3301b5[_0x6f79('0x2c')]=_[_0x6f79('0x2d')](_0x4e03f3[_0x6f79('0x2c')]);_0x3301b5[_0x6f79('0x2e')]=_['intersection'](_0x3301b5[_0x6f79('0x2f')],_0x3301b5['query']);_0xa724d8[_0x6f79('0x30')]=_[_0x6f79('0x31')](_0x3301b5[_0x6f79('0x2f')],qs[_0x6f79('0x32')](_0x4e03f3['query'][_0x6f79('0x32')]));_0xa724d8[_0x6f79('0x30')]=_0xa724d8[_0x6f79('0x30')]['length']?_0xa724d8[_0x6f79('0x30')]:_0x3301b5[_0x6f79('0x2f')];if(!_0x4e03f3[_0x6f79('0x2c')][_0x6f79('0x33')]('nolimit')){_0xa724d8['limit']=qs['limit'](_0x4e03f3[_0x6f79('0x2c')]['limit']);_0xa724d8[_0x6f79('0x19')]=qs[_0x6f79('0x19')](_0x4e03f3[_0x6f79('0x2c')][_0x6f79('0x19')]);}_0xa724d8[_0x6f79('0x34')]=qs[_0x6f79('0x35')](_0x4e03f3[_0x6f79('0x2c')]['sort']);_0xa724d8[_0x6f79('0x36')]=qs['filters'](_[_0x6f79('0x37')](_0x4e03f3[_0x6f79('0x2c')],_0x3301b5[_0x6f79('0x2e')]),_0xfdc41a);if(_0x4e03f3[_0x6f79('0x2c')]['filter']){_0xa724d8[_0x6f79('0x36')]=_[_0x6f79('0x38')](_0xa724d8['where'],{'$or':_[_0x6f79('0x28')](_0xfdc41a,function(_0x1225bb){if(_0x1225bb['type']!==_0x6f79('0x39')){var _0xd64e7c={};_0xd64e7c[_0x1225bb[_0x6f79('0x25')]]={'$like':'%'+_0x4e03f3[_0x6f79('0x2c')][_0x6f79('0x3a')]+'%'};return _0xd64e7c;}})});}_0xa724d8=_[_0x6f79('0x38')]({},_0xa724d8,_0x4e03f3[_0x6f79('0x3b')]);var _0x37b22a={'where':_0xa724d8[_0x6f79('0x36')]};return db['VtigerAccount'][_0x6f79('0x1b')](_0x37b22a)['then'](function(_0x5d4b17){_0x1526d7[_0x6f79('0x1b')]=_0x5d4b17;if(_0x4e03f3[_0x6f79('0x2c')][_0x6f79('0x3c')]){_0xa724d8[_0x6f79('0x3d')]=[{'all':!![]}];}return db[_0x6f79('0x29')]['findAll'](_0xa724d8);})['then'](function(_0x2c720d){_0x1526d7[_0x6f79('0x3e')]=_0x2c720d;return _0x1526d7;})[_0x6f79('0x20')](respondWithFilteredResult(_0x5c2aef,_0xa724d8))[_0x6f79('0x3f')](handleError(_0x5c2aef,null));};exports[_0x6f79('0x40')]=function(_0x2d1d00,_0x564653){var _0x43211a={'raw':![],'where':{'id':_0x2d1d00[_0x6f79('0x41')]['id']}},_0x5f5275={};_0x5f5275[_0x6f79('0x2f')]=_[_0x6f79('0x2d')](db['VtigerAccount'][_0x6f79('0x2a')]);_0x5f5275[_0x6f79('0x2c')]=_[_0x6f79('0x2d')](_0x2d1d00[_0x6f79('0x2c')]);_0x5f5275[_0x6f79('0x2e')]=_['intersection'](_0x5f5275[_0x6f79('0x2f')],_0x5f5275[_0x6f79('0x2c')]);_0x43211a[_0x6f79('0x30')]=_[_0x6f79('0x31')](_0x5f5275[_0x6f79('0x2f')],qs[_0x6f79('0x32')](_0x2d1d00['query'][_0x6f79('0x32')]));_0x43211a[_0x6f79('0x30')]=_0x43211a[_0x6f79('0x30')][_0x6f79('0x42')]?_0x43211a[_0x6f79('0x30')]:_0x5f5275[_0x6f79('0x2f')];if(_0x2d1d00[_0x6f79('0x2c')]['includeAll']){_0x43211a[_0x6f79('0x3d')]=[{'all':!![]}];}_0x43211a=_[_0x6f79('0x38')]({},_0x43211a,_0x2d1d00[_0x6f79('0x3b')]);return db[_0x6f79('0x29')][_0x6f79('0x43')](_0x43211a)['then'](handleEntityNotFound(_0x564653,null))[_0x6f79('0x20')](respondWithResult(_0x564653,null))[_0x6f79('0x3f')](handleError(_0x564653,null));};exports['create']=function(_0x280fda,_0x1d1409){return db[_0x6f79('0x29')][_0x6f79('0x44')](_0x280fda[_0x6f79('0x45')],{})[_0x6f79('0x20')](respondWithResult(_0x1d1409,0xc9))[_0x6f79('0x3f')](handleError(_0x1d1409,null));};exports['update']=function(_0x1dd83f,_0x3c6f5b){if(_0x1dd83f['body']['id']){delete _0x1dd83f[_0x6f79('0x45')]['id'];}return db[_0x6f79('0x29')][_0x6f79('0x43')]({'where':{'id':_0x1dd83f['params']['id']}})['then'](handleEntityNotFound(_0x3c6f5b,null))[_0x6f79('0x20')](saveUpdates(_0x1dd83f['body'],null))['then'](respondWithResult(_0x3c6f5b,null))[_0x6f79('0x3f')](handleError(_0x3c6f5b,null));};exports[_0x6f79('0x21')]=function(_0x1f9f54,_0x573b2d){return db[_0x6f79('0x29')][_0x6f79('0x43')]({'where':{'id':_0x1f9f54[_0x6f79('0x41')]['id']}})['then'](handleEntityNotFound(_0x573b2d,null))[_0x6f79('0x20')](removeEntity(_0x573b2d,null))[_0x6f79('0x3f')](handleError(_0x573b2d,null));};exports[_0x6f79('0x46')]=function(_0xdbb1f,_0x14bd73,_0x567202){var _0x1c05bc={};var _0x498952={};var _0x128f87;var _0x232d2d;return db[_0x6f79('0x29')][_0x6f79('0x47')]({'where':{'id':_0xdbb1f[_0x6f79('0x41')]['id']}})[_0x6f79('0x20')](handleEntityNotFound(_0x14bd73,null))[_0x6f79('0x20')](function(_0x27da21){if(_0x27da21){_0x128f87=_0x27da21;_0x498952[_0x6f79('0x2f')]=_[_0x6f79('0x2d')](db['VtigerConfiguration'][_0x6f79('0x2a')]);_0x498952['query']=_[_0x6f79('0x2d')](_0xdbb1f['query']);_0x498952[_0x6f79('0x2e')]=_[_0x6f79('0x31')](_0x498952[_0x6f79('0x2f')],_0x498952[_0x6f79('0x2c')]);_0x1c05bc[_0x6f79('0x30')]=_[_0x6f79('0x31')](_0x498952[_0x6f79('0x2f')],qs['fields'](_0xdbb1f[_0x6f79('0x2c')][_0x6f79('0x32')]));_0x1c05bc[_0x6f79('0x30')]=_0x1c05bc[_0x6f79('0x30')][_0x6f79('0x42')]?_0x1c05bc[_0x6f79('0x30')]:_0x498952[_0x6f79('0x2f')];_0x1c05bc[_0x6f79('0x34')]=qs[_0x6f79('0x35')](_0xdbb1f['query'][_0x6f79('0x35')]);_0x1c05bc['where']=qs[_0x6f79('0x2e')](_[_0x6f79('0x37')](_0xdbb1f[_0x6f79('0x2c')],_0x498952[_0x6f79('0x2e')]));if(_0xdbb1f[_0x6f79('0x2c')][_0x6f79('0x3a')]){_0x1c05bc[_0x6f79('0x36')]=_[_0x6f79('0x38')](_0x1c05bc['where'],{'$or':_['map'](_0x1c05bc[_0x6f79('0x30')],function(_0x4b3d09){var _0xb385b9={};_0xb385b9[_0x4b3d09]={'$like':'%'+_0xdbb1f[_0x6f79('0x2c')][_0x6f79('0x3a')]+'%'};return _0xb385b9;})});}_0x1c05bc=_['merge']({},_0x1c05bc,_0xdbb1f[_0x6f79('0x3b')]);return _0x128f87[_0x6f79('0x46')](_0x1c05bc);}})[_0x6f79('0x20')](function(_0xb339c2){if(_0xb339c2){_0x232d2d=_0xb339c2[_0x6f79('0x42')];if(!_0xdbb1f[_0x6f79('0x2c')]['hasOwnProperty'](_0x6f79('0x48'))){_0x1c05bc[_0x6f79('0x49')]=qs[_0x6f79('0x49')](_0xdbb1f['query'][_0x6f79('0x49')]);_0x1c05bc[_0x6f79('0x19')]=qs[_0x6f79('0x19')](_0xdbb1f[_0x6f79('0x2c')]['offset']);}return _0x128f87[_0x6f79('0x46')](_0x1c05bc);}})[_0x6f79('0x20')](function(_0xd876f7){if(_0xd876f7){return _0xd876f7?{'count':_0x232d2d,'rows':_0xd876f7}:null;}})[_0x6f79('0x20')](respondWithResult(_0x14bd73,null))[_0x6f79('0x3f')](handleError(_0x14bd73,null));};exports[_0x6f79('0x4a')]=function(_0x1797bb,_0x4c355a,_0x5405e6){if(_0x1797bb[_0x6f79('0x45')]['id']){delete _0x1797bb[_0x6f79('0x45')]['id'];}return db['VtigerAccount'][_0x6f79('0x47')]({'where':{'id':_0x1797bb[_0x6f79('0x41')]['id']}})[_0x6f79('0x20')](handleEntityNotFound(_0x4c355a,null))['then'](function(_0x5c369c){if(_0x5c369c){_0x1797bb['body'][_0x6f79('0x4b')]=_0x5c369c['id'];_0x1797bb[_0x6f79('0x45')][_0x6f79('0x4c')]=integrations['getSubjects'](_0x1797bb['body'][_0x6f79('0x4d')],_0x1797bb['body'][_0x6f79('0x4e')]);_0x1797bb[_0x6f79('0x45')][_0x6f79('0x4f')]=integrations[_0x6f79('0x50')](_0x1797bb['body'][_0x6f79('0x4d')],_0x1797bb[_0x6f79('0x45')]['type']);return db[_0x6f79('0x51')]['create'](_0x1797bb[_0x6f79('0x45')],{'include':[{'model':db['VtigerField'],'as':_0x6f79('0x4c')},{'model':db[_0x6f79('0x52')],'as':'Descriptions'}]});}return null;})[_0x6f79('0x20')](respondWithResult(_0x4c355a,null))[_0x6f79('0x3f')](handleError(_0x4c355a,null));};var md5=require(_0x6f79('0x53'));exports[_0x6f79('0x54')]=function(_0x4a25ba,_0xe43b9b,_0x53cc03){var _0x1b39e5=null;var _0x33050b=null;var _0x5f24bc=null;var _0x4aeb7a=null;var _0x3c2a36='';return db[_0x6f79('0x29')]['findOne']({'where':{'id':_0x4a25ba[_0x6f79('0x41')]['id']},'attributes':['id',_0x6f79('0x25'),_0x6f79('0x55'),_0x6f79('0x56'),_0x6f79('0x57'),_0x6f79('0x58'),_0x6f79('0x59'),_0x6f79('0x5a')]})[_0x6f79('0x20')](handleEntityNotFound(_0xe43b9b,null))[_0x6f79('0x20')](function(_0x5edc0a){if(_0x5edc0a){_0x1b39e5=_0x5edc0a[_0x6f79('0x55')];_0x33050b=_0x5edc0a[_0x6f79('0x5a')];_0x5f24bc=_0x5edc0a[_0x6f79('0x57')];_0x3c2a36=_0x5edc0a[_0x6f79('0x58')];var _0xdd6ce=_0x3c2a36[_0x6f79('0x5b')](-0x1);if(_0xdd6ce==='/'){_0x3c2a36=_0x3c2a36['substring'](0x0,_0x3c2a36['lastIndexOf'](_0xdd6ce));}_0x4aeb7a=util[_0x6f79('0x5c')](_0x6f79('0x5d'),_0x3c2a36);var _0x6624f8={'method':'GET','uri':_0x4aeb7a,'qs':{'operation':_0x6f79('0x5e'),'username':_0x5edc0a[_0x6f79('0x55')]},'json':!![]};return rp(_0x6624f8);}})[_0x6f79('0x20')](function(_0x5d730b){if(_0x5d730b[_0x6f79('0x5f')]){var _0x47f50d={'method':'POST','uri':_0x4aeb7a,'form':{'operation':_0x6f79('0x60'),'username':_0x1b39e5,'accessKey':md5(_0x5d730b['result']['token']+_0x33050b)},'json':!![]};return rp(_0x47f50d);}})[_0x6f79('0x20')](function(_0x3d39f3){if(_0x3d39f3['success']){var _0x5f1c2e={'method':'GET','uri':_0x4aeb7a,'qs':{'operation':_0x6f79('0x61'),'username':_0x1b39e5,'sessionName':_0x3d39f3[_0x6f79('0x62')][_0x6f79('0x63')],'elementType':_0x5f24bc},'json':!![]};return rp(_0x5f1c2e);}})[_0x6f79('0x20')](function(_0x1bf3f){if(_0x1bf3f['success']){var _0x179a03=[_0x6f79('0x64'),'reference',_0x6f79('0x65')];_[_0x6f79('0x66')](_0x1bf3f[_0x6f79('0x62')][_0x6f79('0x32')],function(_0x2e6da3){return _0x179a03[_0x6f79('0x67')](_0x2e6da3[_0x6f79('0x4e')][_0x6f79('0x25')]);});_[_0x6f79('0x66')](_0x1bf3f[_0x6f79('0x62')][_0x6f79('0x32')],function(_0x39e165){return _0x39e165[_0x6f79('0x68')]===_0x6f79('0x69');});return{'count':_0x1bf3f[_0x6f79('0x62')]['fields'][_0x6f79('0x42')],'rows':_[_0x6f79('0x28')](_0x1bf3f[_0x6f79('0x62')][_0x6f79('0x32')],function(_0x52b420){return{'id':_0x52b420[_0x6f79('0x25')],'name':_0x52b420[_0x6f79('0x6a')],'custom':_[_0x6f79('0x6b')](_0x52b420[_0x6f79('0x25')],_0x6f79('0x6c'))?!![]:![],'options':_0x52b420['type'][_0x6f79('0x25')]==='picklist'&&_0x52b420[_0x6f79('0x4e')][_0x6f79('0x6d')][_0x6f79('0x42')]>0x0?_[_0x6f79('0x28')](_0x52b420['type'][_0x6f79('0x6d')],function(_0x4d5ee6){return{'name':_0x4d5ee6[_0x6f79('0x6a')],'value':_0x4d5ee6[_0x6f79('0x6e')]};}):[]};})};}})['then'](respondWithResult(_0xe43b9b,null))[_0x6f79('0x3f')](function(_0x2a50e8){console[_0x6f79('0x6f')]('vTiger\x20error:\x20'+_0x2a50e8);var _0x245930=_0x4a25ba['query']['test']?0x1f4:_0x2a50e8[_0x6f79('0x70')]||0x1f4;logger[_0x6f79('0x23')](_0x6f79('0x71'),_0x6f79('0x54'),_0x245930,JSON[_0x6f79('0x72')](_0x2a50e8));delete _0x2a50e8[_0x6f79('0x25')];if(_0x245930===0x191){_0x245930=0x190;}_0xe43b9b[_0x6f79('0x17')](_0x245930)[_0x6f79('0x26')](_0x4a25ba[_0x6f79('0x2c')][_0x6f79('0x73')]?{'message':_0x6f79('0x74'),'statusCode':_0x2a50e8['statusCode']}:_0x2a50e8);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 9be24d2..c5e58f6 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 _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 +var _0x22ec=['../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x12b004,_0x5e4c58){var _0x2ec7f8=function(_0x80f9ed){while(--_0x80f9ed){_0x12b004['push'](_0x12b004['shift']());}};_0x2ec7f8(++_0x5e4c58);}(_0x22ec,0x13c));var _0xc22e=function(_0x21d43a,_0x5a3b74){_0x21d43a=_0x21d43a-0x0;var _0x503474=_0x22ec[_0x21d43a];return _0x503474;};'use strict';var _=require(_0xc22e('0x0'));var util=require(_0xc22e('0x1'));var logger=require(_0xc22e('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc22e('0x3'));var rp=require(_0xc22e('0x4'));var fs=require('fs');var path=require(_0xc22e('0x5'));var rimraf=require(_0xc22e('0x6'));var config=require(_0xc22e('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0xc22e('0x8'));module['exports']=function(_0x167b38,_0x45329e){return _0x167b38[_0xc22e('0x9')](_0xc22e('0xa'),attributes,{'tableName':_0xc22e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 9f8c96c..e144fbf 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 _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 +var _0xa571=['http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','limit','include','map','model','attributes','ShowVtigerAccount','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client'];(function(_0x573add,_0x5afb8d){var _0x5eee17=function(_0x3f6ce6){while(--_0x3f6ce6){_0x573add['push'](_0x573add['shift']());}};_0x5eee17(++_0x5afb8d);}(_0xa571,0x107));var _0x1a57=function(_0x5abd75,_0x240b60){_0x5abd75=_0x5abd75-0x0;var _0x3aabb2=_0xa571[_0x5abd75];return _0x3aabb2;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var moment=require(_0x1a57('0x2'));var BPromise=require(_0x1a57('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a57('0x4'));var db=require(_0x1a57('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1a57('0x6'));var config=require('../../config/environment');var jayson=require(_0x1a57('0x7'));var client=jayson[_0x1a57('0x8')][_0x1a57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c5352,_0x2492f5,_0x924873){return new BPromise(function(_0x5d9f45,_0x3edb40){return client[_0x1a57('0xa')](_0x3c5352,_0x924873)[_0x1a57('0xb')](function(_0x58e266){logger[_0x1a57('0xc')](_0x1a57('0xd'),_0x2492f5,_0x1a57('0xe'));logger[_0x1a57('0xf')](_0x1a57('0x10'),_0x2492f5,_0x1a57('0xe'),JSON[_0x1a57('0x11')](_0x58e266));if(_0x58e266[_0x1a57('0x12')]){if(_0x58e266['error']['code']===0x1f4){logger[_0x1a57('0x12')](_0x1a57('0xd'),_0x2492f5,_0x58e266[_0x1a57('0x12')]['message']);return _0x3edb40(_0x58e266[_0x1a57('0x12')][_0x1a57('0x13')]);}logger['error'](_0x1a57('0xd'),_0x2492f5,_0x58e266['error'][_0x1a57('0x13')]);return _0x5d9f45(_0x58e266[_0x1a57('0x12')][_0x1a57('0x13')]);}else{logger[_0x1a57('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x2492f5,_0x1a57('0xe'));_0x5d9f45(_0x58e266['result']['message']);}})[_0x1a57('0x14')](function(_0x1c537f){logger[_0x1a57('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x2492f5,_0x1c537f);_0x3edb40(_0x1c537f);});});}exports[_0x1a57('0x15')]=function(_0x1662a3){var _0x80f8c1=this;return new Promise(function(_0x53bb20,_0x3daa66){return db[_0x1a57('0x16')][_0x1a57('0x17')]({'raw':_0x1662a3[_0x1a57('0x18')]?_0x1662a3[_0x1a57('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1662a3['options']?_0x1662a3[_0x1a57('0x18')][_0x1a57('0x19')]||null:null,'attributes':_0x1662a3[_0x1a57('0x18')]?_0x1662a3['options']['attributes']||null:null,'limit':_0x1662a3['options']?_0x1662a3[_0x1a57('0x18')][_0x1a57('0x1a')]||null:null,'include':_0x1662a3[_0x1a57('0x18')]?_0x1662a3[_0x1a57('0x18')][_0x1a57('0x1b')]?_[_0x1a57('0x1c')](_0x1662a3[_0x1a57('0x18')][_0x1a57('0x1b')],function(_0x183ca3){return{'model':db[_0x183ca3[_0x1a57('0x1d')]],'as':_0x183ca3['as'],'attributes':_0x183ca3[_0x1a57('0x1e')],'include':_0x183ca3[_0x1a57('0x1b')]?_[_0x1a57('0x1c')](_0x183ca3[_0x1a57('0x1b')],function(_0x2f9454){return{'model':db[_0x2f9454[_0x1a57('0x1d')]],'as':_0x2f9454['as'],'attributes':_0x2f9454[_0x1a57('0x1e')],'include':_0x2f9454[_0x1a57('0x1b')]?_[_0x1a57('0x1c')](_0x2f9454[_0x1a57('0x1b')],function(_0x26584b){return{'model':db[_0x26584b[_0x1a57('0x1d')]],'as':_0x26584b['as'],'attributes':_0x26584b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x139d8c){logger[_0x1a57('0xc')]('GetVtigerAccount',_0x1662a3);logger[_0x1a57('0xf')]('GetVtigerAccount',_0x1662a3,JSON[_0x1a57('0x11')](_0x139d8c));_0x53bb20(_0x139d8c);})[_0x1a57('0x14')](function(_0x53bf6e){logger[_0x1a57('0x12')](_0x1a57('0x15'),_0x53bf6e[_0x1a57('0x13')],_0x1662a3);_0x3daa66(_0x80f8c1[_0x1a57('0x12')](0x1f4,_0x53bf6e['message']));});});};exports[_0x1a57('0x1f')]=function(_0x396832){var _0x4374f0=this;return new Promise(function(_0x160536,_0x5763ba){return db[_0x1a57('0x16')][_0x1a57('0x20')]({'raw':_0x396832[_0x1a57('0x18')]?_0x396832[_0x1a57('0x18')][_0x1a57('0x21')]===undefined?!![]:![]:!![],'where':_0x396832[_0x1a57('0x18')]?_0x396832[_0x1a57('0x18')][_0x1a57('0x19')]||null:null,'attributes':_0x396832[_0x1a57('0x18')]?_0x396832['options'][_0x1a57('0x1e')]||null:null,'include':_0x396832[_0x1a57('0x18')]?_0x396832['options']['include']?_[_0x1a57('0x1c')](_0x396832[_0x1a57('0x18')][_0x1a57('0x1b')],function(_0x170bf7){return{'model':db[_0x170bf7[_0x1a57('0x1d')]],'as':_0x170bf7['as'],'attributes':_0x170bf7[_0x1a57('0x1e')],'include':_0x170bf7[_0x1a57('0x1b')]?_[_0x1a57('0x1c')](_0x170bf7[_0x1a57('0x1b')],function(_0x2a6feb){return{'model':db[_0x2a6feb[_0x1a57('0x1d')]],'as':_0x2a6feb['as'],'attributes':_0x2a6feb[_0x1a57('0x1e')],'include':_0x2a6feb[_0x1a57('0x1b')]?_[_0x1a57('0x1c')](_0x2a6feb[_0x1a57('0x1b')],function(_0x12102f){return{'model':db[_0x12102f[_0x1a57('0x1d')]],'as':_0x12102f['as'],'attributes':_0x12102f[_0x1a57('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3cd160){logger[_0x1a57('0xc')](_0x1a57('0x1f'),_0x396832);logger[_0x1a57('0xf')](_0x1a57('0x1f'),_0x396832,JSON[_0x1a57('0x11')](_0x3cd160));_0x160536(_0x3cd160);})[_0x1a57('0x14')](function(_0x23d087){logger[_0x1a57('0x12')]('ShowVtigerAccount',_0x23d087['message'],_0x396832);_0x5763ba(_0x4374f0['error'](0x1f4,_0x23d087['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index c94fc24..6867d24 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 _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 +var _0x8dff=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','put','update','delete','destroy','exports','multer','util'];(function(_0x318256,_0xa773f3){var _0xb1e352=function(_0x4bb14e){while(--_0x4bb14e){_0x318256['push'](_0x318256['shift']());}};_0xb1e352(++_0xa773f3);}(_0x8dff,0x196));var _0xf8df=function(_0x4d740e,_0x4582e7){_0x4d740e=_0x4d740e-0x0;var _0x16f508=_0x8dff[_0x4d740e];return _0x16f508;};'use strict';var multer=require(_0xf8df('0x0'));var util=require(_0xf8df('0x1'));var path=require(_0xf8df('0x2'));var timeout=require(_0xf8df('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf8df('0x4'));var auth=require(_0xf8df('0x5'));var interaction=require(_0xf8df('0x6'));var config=require(_0xf8df('0x7'));var controller=require(_0xf8df('0x8'));router[_0xf8df('0x9')]('/',auth[_0xf8df('0xa')](),controller[_0xf8df('0xb')]);router[_0xf8df('0x9')](_0xf8df('0xc'),auth['isAuthenticated'](),controller[_0xf8df('0xd')]);router[_0xf8df('0x9')](_0xf8df('0xe'),auth[_0xf8df('0xa')](),controller['getFields']);router[_0xf8df('0x9')](_0xf8df('0xf'),auth['isAuthenticated'](),controller[_0xf8df('0x10')]);router[_0xf8df('0x9')]('/:id/descriptions',auth[_0xf8df('0xa')](),controller[_0xf8df('0x11')]);router[_0xf8df('0x12')]('/',auth[_0xf8df('0xa')](),controller['create']);router[_0xf8df('0x13')](_0xf8df('0xc'),auth[_0xf8df('0xa')](),controller[_0xf8df('0x14')]);router[_0xf8df('0x15')](_0xf8df('0xc'),auth[_0xf8df('0xa')](),controller[_0xf8df('0x16')]);module[_0xf8df('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 73d0ec6..897793f 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 _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 +var _0x986d=['STRING'];(function(_0x56681c,_0x5d77c7){var _0x5c0c44=function(_0xe38ca0){while(--_0xe38ca0){_0x56681c['push'](_0x56681c['shift']());}};_0x5c0c44(++_0x5d77c7);}(_0x986d,0x77));var _0xd986=function(_0x53356a,_0x51fe4a){_0x53356a=_0x53356a-0x0;var _0x36fcef=_0x986d[_0x53356a];return _0x36fcef;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd986('0x0')]},'description':{'type':Sequelize[_0xd986('0x0')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index a81ad06..e17137f 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 _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 +var _0xda79=['sort','pick','filter','where','VIRTUAL','name','merge','includeAll','findAll','rows','show','include','options','find','catch','create','body','params','getFields','findOne','keys','VtigerField','length','order','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','send','index','map','VtigerConfiguration','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','nolimit'];(function(_0x50a9f3,_0x55d56e){var _0x451d74=function(_0x4b4c34){while(--_0x4b4c34){_0x50a9f3['push'](_0x50a9f3['shift']());}};_0x451d74(++_0x55d56e);}(_0xda79,0x6f));var _0x9da7=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xda79[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x9da7('0x0'));var rimraf=require(_0x9da7('0x1'));var zipdir=require(_0x9da7('0x2'));var jsonpatch=require(_0x9da7('0x3'));var rp=require(_0x9da7('0x4'));var moment=require(_0x9da7('0x5'));var BPromise=require(_0x9da7('0x6'));var Mustache=require('mustache');var util=require(_0x9da7('0x7'));var path=require(_0x9da7('0x8'));var sox=require(_0x9da7('0x9'));var csv=require(_0x9da7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9da7('0xb'));var _=require(_0x9da7('0xc'));var squel=require(_0x9da7('0xd'));var crypto=require(_0x9da7('0xe'));var jsforce=require(_0x9da7('0xf'));var deskjs=require(_0x9da7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9da7('0x11'));var Papa=require(_0x9da7('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9da7('0x13'));var as=require(_0x9da7('0x14'));var hardwareService=require(_0x9da7('0x15'));var logger=require(_0x9da7('0x16'))('api');var utils=require(_0x9da7('0x17'));var config=require(_0x9da7('0x18'));var licenseUtil=require(_0x9da7('0x19'));var db=require(_0x9da7('0x1a'))['db'];function respondWithStatusCode(_0x200bba,_0x1b3017){_0x1b3017=_0x1b3017||0xcc;return function(_0x5caa8c){if(_0x5caa8c){return _0x200bba[_0x9da7('0x1b')](_0x1b3017);}return _0x200bba[_0x9da7('0x1c')](_0x1b3017)[_0x9da7('0x1d')]();};}function respondWithResult(_0x4d2809,_0x30789e){_0x30789e=_0x30789e||0xc8;return function(_0x1654b6){if(_0x1654b6){return _0x4d2809['status'](_0x30789e)['json'](_0x1654b6);}};}function respondWithFilteredResult(_0x29bb70,_0x1616e5){return function(_0x3d58ef){if(_0x3d58ef){var _0x337e64=typeof _0x1616e5['offset']===_0x9da7('0x1e')&&typeof _0x1616e5[_0x9da7('0x1f')]===_0x9da7('0x1e');var _0x5db62f=_0x3d58ef[_0x9da7('0x20')];var _0x20dc20=_0x337e64?0x0:_0x1616e5[_0x9da7('0x21')];var _0x389a22=_0x337e64?_0x3d58ef[_0x9da7('0x20')]:_0x1616e5['offset']+_0x1616e5['limit'];var _0x2705c8;if(_0x389a22>=_0x5db62f){_0x389a22=_0x5db62f;_0x2705c8=0xc8;}else{_0x2705c8=0xce;}_0x29bb70['status'](_0x2705c8);return _0x29bb70[_0x9da7('0x22')](_0x9da7('0x23'),_0x20dc20+'-'+_0x389a22+'/'+_0x5db62f)[_0x9da7('0x24')](_0x3d58ef);}return null;};}function patchUpdates(_0x168d4d){return function(_0x1bb4c6){try{jsonpatch[_0x9da7('0x25')](_0x1bb4c6,_0x168d4d,!![]);}catch(_0x57a88b){return BPromise[_0x9da7('0x26')](_0x57a88b);}return _0x1bb4c6[_0x9da7('0x27')]();};}function saveUpdates(_0x5d2bbc,_0x532840){return function(_0x3989a7){if(_0x3989a7){return _0x3989a7[_0x9da7('0x28')](_0x5d2bbc)[_0x9da7('0x29')](function(_0x3770cc){return _0x3770cc;});}return null;};}function removeEntity(_0x5818dc,_0xf4188d){return function(_0x40a1c9){if(_0x40a1c9){return _0x40a1c9['destroy']()[_0x9da7('0x29')](function(){_0x5818dc['status'](0xcc)[_0x9da7('0x1d')]();});}};}function handleEntityNotFound(_0x1fc619,_0x199891){return function(_0x4eacef){if(!_0x4eacef){_0x1fc619[_0x9da7('0x1b')](0x194);}return _0x4eacef;};}function handleError(_0x86e38a,_0x408b64){_0x408b64=_0x408b64||0x1f4;return function(_0x1d37ee){logger[_0x9da7('0x2a')](_0x1d37ee['stack']);if(_0x1d37ee['name']){delete _0x1d37ee['name'];}_0x86e38a[_0x9da7('0x1c')](_0x408b64)[_0x9da7('0x2b')](_0x1d37ee);};}exports[_0x9da7('0x2c')]=function(_0x78f36,_0x6f67b1){var _0x311d71={},_0x150d18={},_0x4b39de={'count':0x0,'rows':[]};var _0x533dcb=_[_0x9da7('0x2d')](db[_0x9da7('0x2e')][_0x9da7('0x2f')],function(_0xe57c4c){return{'name':_0xe57c4c['fieldName'],'type':_0xe57c4c[_0x9da7('0x30')][_0x9da7('0x31')]};});_0x150d18[_0x9da7('0x32')]=_[_0x9da7('0x2d')](_0x533dcb,'name');_0x150d18[_0x9da7('0x33')]=_['keys'](_0x78f36[_0x9da7('0x33')]);_0x150d18[_0x9da7('0x34')]=_[_0x9da7('0x35')](_0x150d18[_0x9da7('0x32')],_0x150d18[_0x9da7('0x33')]);_0x311d71[_0x9da7('0x36')]=_[_0x9da7('0x35')](_0x150d18[_0x9da7('0x32')],qs[_0x9da7('0x37')](_0x78f36['query'][_0x9da7('0x37')]));_0x311d71[_0x9da7('0x36')]=_0x311d71['attributes']['length']?_0x311d71[_0x9da7('0x36')]:_0x150d18['model'];if(!_0x78f36[_0x9da7('0x33')]['hasOwnProperty'](_0x9da7('0x38'))){_0x311d71['limit']=qs['limit'](_0x78f36[_0x9da7('0x33')][_0x9da7('0x1f')]);_0x311d71[_0x9da7('0x21')]=qs[_0x9da7('0x21')](_0x78f36['query']['offset']);}_0x311d71['order']=qs[_0x9da7('0x39')](_0x78f36[_0x9da7('0x33')][_0x9da7('0x39')]);_0x311d71['where']=qs['filters'](_[_0x9da7('0x3a')](_0x78f36[_0x9da7('0x33')],_0x150d18[_0x9da7('0x34')]),_0x533dcb);if(_0x78f36[_0x9da7('0x33')][_0x9da7('0x3b')]){_0x311d71[_0x9da7('0x3c')]=_['merge'](_0x311d71[_0x9da7('0x3c')],{'$or':_[_0x9da7('0x2d')](_0x533dcb,function(_0xa44814){if(_0xa44814['type']!==_0x9da7('0x3d')){var _0x5b1c6a={};_0x5b1c6a[_0xa44814[_0x9da7('0x3e')]]={'$like':'%'+_0x78f36[_0x9da7('0x33')]['filter']+'%'};return _0x5b1c6a;}})});}_0x311d71=_[_0x9da7('0x3f')]({},_0x311d71,_0x78f36['options']);var _0x3f1620={'where':_0x311d71[_0x9da7('0x3c')]};return db['VtigerConfiguration'][_0x9da7('0x20')](_0x3f1620)[_0x9da7('0x29')](function(_0x2fefb6){_0x4b39de['count']=_0x2fefb6;if(_0x78f36[_0x9da7('0x33')][_0x9da7('0x40')]){_0x311d71['include']=[{'all':!![]}];}return db[_0x9da7('0x2e')][_0x9da7('0x41')](_0x311d71);})[_0x9da7('0x29')](function(_0x156857){_0x4b39de[_0x9da7('0x42')]=_0x156857;return _0x4b39de;})['then'](respondWithFilteredResult(_0x6f67b1,_0x311d71))['catch'](handleError(_0x6f67b1,null));};exports[_0x9da7('0x43')]=function(_0xf12aa6,_0x5e3a87){var _0x527a12={'raw':![],'where':{'id':_0xf12aa6['params']['id']}},_0x1289a3={};_0x1289a3[_0x9da7('0x32')]=_['keys'](db[_0x9da7('0x2e')][_0x9da7('0x2f')]);_0x1289a3['query']=_['keys'](_0xf12aa6[_0x9da7('0x33')]);_0x1289a3['filters']=_[_0x9da7('0x35')](_0x1289a3[_0x9da7('0x32')],_0x1289a3[_0x9da7('0x33')]);_0x527a12[_0x9da7('0x36')]=_[_0x9da7('0x35')](_0x1289a3[_0x9da7('0x32')],qs[_0x9da7('0x37')](_0xf12aa6[_0x9da7('0x33')]['fields']));_0x527a12[_0x9da7('0x36')]=_0x527a12['attributes']['length']?_0x527a12[_0x9da7('0x36')]:_0x1289a3[_0x9da7('0x32')];if(_0xf12aa6[_0x9da7('0x33')][_0x9da7('0x40')]){_0x527a12[_0x9da7('0x44')]=[{'all':!![]}];}_0x527a12=_[_0x9da7('0x3f')]({},_0x527a12,_0xf12aa6[_0x9da7('0x45')]);return db['VtigerConfiguration'][_0x9da7('0x46')](_0x527a12)[_0x9da7('0x29')](handleEntityNotFound(_0x5e3a87,null))[_0x9da7('0x29')](respondWithResult(_0x5e3a87,null))[_0x9da7('0x47')](handleError(_0x5e3a87,null));};exports[_0x9da7('0x48')]=function(_0x91e4ae,_0x413286){return db[_0x9da7('0x2e')]['create'](_0x91e4ae['body'],{})[_0x9da7('0x29')](respondWithResult(_0x413286,0xc9))[_0x9da7('0x47')](handleError(_0x413286,null));};exports[_0x9da7('0x28')]=function(_0x19f8e8,_0x1a5745){if(_0x19f8e8[_0x9da7('0x49')]['id']){delete _0x19f8e8['body']['id'];}return db[_0x9da7('0x2e')][_0x9da7('0x46')]({'where':{'id':_0x19f8e8[_0x9da7('0x4a')]['id']}})[_0x9da7('0x29')](handleEntityNotFound(_0x1a5745,null))[_0x9da7('0x29')](saveUpdates(_0x19f8e8[_0x9da7('0x49')],null))[_0x9da7('0x29')](respondWithResult(_0x1a5745,null))[_0x9da7('0x47')](handleError(_0x1a5745,null));};exports['destroy']=function(_0x5ca6f5,_0x1e089d){return db[_0x9da7('0x2e')][_0x9da7('0x46')]({'where':{'id':_0x5ca6f5[_0x9da7('0x4a')]['id']}})[_0x9da7('0x29')](handleEntityNotFound(_0x1e089d,null))[_0x9da7('0x29')](removeEntity(_0x1e089d,null))[_0x9da7('0x47')](handleError(_0x1e089d,null));};exports[_0x9da7('0x4b')]=function(_0x2cbf7b,_0xbe71ce,_0x1b06db){var _0x262003={};var _0x1c9f9c={};var _0x3b6ee8;var _0x4ec47a;return db[_0x9da7('0x2e')][_0x9da7('0x4c')]({'where':{'id':_0x2cbf7b[_0x9da7('0x4a')]['id']}})[_0x9da7('0x29')](handleEntityNotFound(_0xbe71ce,null))['then'](function(_0x35205c){if(_0x35205c){_0x3b6ee8=_0x35205c;_0x1c9f9c[_0x9da7('0x32')]=_[_0x9da7('0x4d')](db[_0x9da7('0x4e')]['rawAttributes']);_0x1c9f9c[_0x9da7('0x33')]=_[_0x9da7('0x4d')](_0x2cbf7b['query']);_0x1c9f9c['filters']=_[_0x9da7('0x35')](_0x1c9f9c['model'],_0x1c9f9c[_0x9da7('0x33')]);_0x262003[_0x9da7('0x36')]=_[_0x9da7('0x35')](_0x1c9f9c['model'],qs[_0x9da7('0x37')](_0x2cbf7b[_0x9da7('0x33')]['fields']));_0x262003[_0x9da7('0x36')]=_0x262003[_0x9da7('0x36')][_0x9da7('0x4f')]?_0x262003['attributes']:_0x1c9f9c['model'];_0x262003[_0x9da7('0x50')]=qs[_0x9da7('0x39')](_0x2cbf7b['query'][_0x9da7('0x39')]);_0x262003['where']=qs['filters'](_[_0x9da7('0x3a')](_0x2cbf7b['query'],_0x1c9f9c[_0x9da7('0x34')]));if(_0x2cbf7b[_0x9da7('0x33')][_0x9da7('0x3b')]){_0x262003[_0x9da7('0x3c')]=_[_0x9da7('0x3f')](_0x262003[_0x9da7('0x3c')],{'$or':_[_0x9da7('0x2d')](_0x262003[_0x9da7('0x36')],function(_0x33387d){var _0x16a5df={};_0x16a5df[_0x33387d]={'$like':'%'+_0x2cbf7b['query'][_0x9da7('0x3b')]+'%'};return _0x16a5df;})});}_0x262003=_[_0x9da7('0x3f')]({},_0x262003,_0x2cbf7b[_0x9da7('0x45')]);return _0x3b6ee8[_0x9da7('0x4b')](_0x262003);}})['then'](function(_0x61fd87){if(_0x61fd87){_0x4ec47a=_0x61fd87[_0x9da7('0x4f')];if(!_0x2cbf7b[_0x9da7('0x33')][_0x9da7('0x51')](_0x9da7('0x38'))){_0x262003[_0x9da7('0x1f')]=qs['limit'](_0x2cbf7b[_0x9da7('0x33')]['limit']);_0x262003[_0x9da7('0x21')]=qs[_0x9da7('0x21')](_0x2cbf7b[_0x9da7('0x33')][_0x9da7('0x21')]);}return _0x3b6ee8[_0x9da7('0x4b')](_0x262003);}})['then'](function(_0x3eda91){if(_0x3eda91){return _0x3eda91?{'count':_0x4ec47a,'rows':_0x3eda91}:null;}})[_0x9da7('0x29')](respondWithResult(_0xbe71ce,null))[_0x9da7('0x47')](handleError(_0xbe71ce,null));};exports[_0x9da7('0x52')]=function(_0x46ad81,_0x4c0399,_0x308504){var _0x12885a={};var _0xe01e0e={};var _0x419c76;var _0x322670;return db[_0x9da7('0x2e')][_0x9da7('0x4c')]({'where':{'id':_0x46ad81['params']['id']}})[_0x9da7('0x29')](handleEntityNotFound(_0x4c0399,null))[_0x9da7('0x29')](function(_0x246a7a){if(_0x246a7a){_0x419c76=_0x246a7a;_0xe01e0e['model']=_[_0x9da7('0x4d')](db['VtigerField'][_0x9da7('0x2f')]);_0xe01e0e[_0x9da7('0x33')]=_[_0x9da7('0x4d')](_0x46ad81[_0x9da7('0x33')]);_0xe01e0e['filters']=_[_0x9da7('0x35')](_0xe01e0e['model'],_0xe01e0e[_0x9da7('0x33')]);_0x12885a['attributes']=_['intersection'](_0xe01e0e[_0x9da7('0x32')],qs[_0x9da7('0x37')](_0x46ad81[_0x9da7('0x33')]['fields']));_0x12885a[_0x9da7('0x36')]=_0x12885a['attributes'][_0x9da7('0x4f')]?_0x12885a[_0x9da7('0x36')]:_0xe01e0e[_0x9da7('0x32')];_0x12885a[_0x9da7('0x50')]=qs[_0x9da7('0x39')](_0x46ad81[_0x9da7('0x33')][_0x9da7('0x39')]);_0x12885a[_0x9da7('0x3c')]=qs[_0x9da7('0x34')](_['pick'](_0x46ad81[_0x9da7('0x33')],_0xe01e0e['filters']));if(_0x46ad81[_0x9da7('0x33')][_0x9da7('0x3b')]){_0x12885a[_0x9da7('0x3c')]=_[_0x9da7('0x3f')](_0x12885a['where'],{'$or':_['map'](_0x12885a[_0x9da7('0x36')],function(_0x33b26f){var _0x4f625a={};_0x4f625a[_0x33b26f]={'$like':'%'+_0x46ad81['query'][_0x9da7('0x3b')]+'%'};return _0x4f625a;})});}_0x12885a=_[_0x9da7('0x3f')]({},_0x12885a,_0x46ad81[_0x9da7('0x45')]);return _0x419c76[_0x9da7('0x52')](_0x12885a);}})[_0x9da7('0x29')](function(_0x319af3){if(_0x319af3){_0x322670=_0x319af3[_0x9da7('0x4f')];if(!_0x46ad81['query'][_0x9da7('0x51')](_0x9da7('0x38'))){_0x12885a[_0x9da7('0x1f')]=qs[_0x9da7('0x1f')](_0x46ad81[_0x9da7('0x33')][_0x9da7('0x1f')]);_0x12885a[_0x9da7('0x21')]=qs[_0x9da7('0x21')](_0x46ad81['query']['offset']);}return _0x419c76[_0x9da7('0x52')](_0x12885a);}})['then'](function(_0x7da341){if(_0x7da341){return _0x7da341?{'count':_0x322670,'rows':_0x7da341}:null;}})[_0x9da7('0x29')](respondWithResult(_0x4c0399,null))[_0x9da7('0x47')](handleError(_0x4c0399,null));};exports[_0x9da7('0x53')]=function(_0x5ed47c,_0x1059e5,_0x58e71b){var _0x5173cf={};var _0x22355b={};var _0x3d17e3;var _0x5e173b;return db[_0x9da7('0x2e')]['findOne']({'where':{'id':_0x5ed47c[_0x9da7('0x4a')]['id']}})[_0x9da7('0x29')](handleEntityNotFound(_0x1059e5,null))[_0x9da7('0x29')](function(_0x739e85){if(_0x739e85){_0x3d17e3=_0x739e85;_0x22355b['model']=_[_0x9da7('0x4d')](db[_0x9da7('0x4e')][_0x9da7('0x2f')]);_0x22355b[_0x9da7('0x33')]=_[_0x9da7('0x4d')](_0x5ed47c[_0x9da7('0x33')]);_0x22355b[_0x9da7('0x34')]=_['intersection'](_0x22355b['model'],_0x22355b[_0x9da7('0x33')]);_0x5173cf[_0x9da7('0x36')]=_[_0x9da7('0x35')](_0x22355b[_0x9da7('0x32')],qs['fields'](_0x5ed47c[_0x9da7('0x33')][_0x9da7('0x37')]));_0x5173cf[_0x9da7('0x36')]=_0x5173cf[_0x9da7('0x36')]['length']?_0x5173cf['attributes']:_0x22355b['model'];_0x5173cf[_0x9da7('0x50')]=qs[_0x9da7('0x39')](_0x5ed47c[_0x9da7('0x33')][_0x9da7('0x39')]);_0x5173cf[_0x9da7('0x3c')]=qs[_0x9da7('0x34')](_[_0x9da7('0x3a')](_0x5ed47c[_0x9da7('0x33')],_0x22355b[_0x9da7('0x34')]));if(_0x5ed47c['query'][_0x9da7('0x3b')]){_0x5173cf['where']=_[_0x9da7('0x3f')](_0x5173cf[_0x9da7('0x3c')],{'$or':_['map'](_0x5173cf[_0x9da7('0x36')],function(_0x38d4df){var _0x52d77a={};_0x52d77a[_0x38d4df]={'$like':'%'+_0x5ed47c[_0x9da7('0x33')][_0x9da7('0x3b')]+'%'};return _0x52d77a;})});}_0x5173cf=_[_0x9da7('0x3f')]({},_0x5173cf,_0x5ed47c[_0x9da7('0x45')]);return _0x3d17e3[_0x9da7('0x53')](_0x5173cf);}})[_0x9da7('0x29')](function(_0x18454d){if(_0x18454d){_0x5e173b=_0x18454d[_0x9da7('0x4f')];if(!_0x5ed47c[_0x9da7('0x33')][_0x9da7('0x51')]('nolimit')){_0x5173cf[_0x9da7('0x1f')]=qs[_0x9da7('0x1f')](_0x5ed47c[_0x9da7('0x33')][_0x9da7('0x1f')]);_0x5173cf[_0x9da7('0x21')]=qs[_0x9da7('0x21')](_0x5ed47c[_0x9da7('0x33')][_0x9da7('0x21')]);}return _0x3d17e3[_0x9da7('0x53')](_0x5173cf);}})['then'](function(_0x46f63e){if(_0x46f63e){return _0x46f63e?{'count':_0x5e173b,'rows':_0x46f63e}:null;}})['then'](respondWithResult(_0x1059e5,null))[_0x9da7('0x47')](handleError(_0x1059e5,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index bd3f83f..d07906b 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 _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 +var _0xee92=['moment','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations','../../config/logger','api'];(function(_0x4fa227,_0x1a93d4){var _0x30a825=function(_0x13f2e0){while(--_0x13f2e0){_0x4fa227['push'](_0x4fa227['shift']());}};_0x30a825(++_0x1a93d4);}(_0xee92,0xfb));var _0x2ee9=function(_0x426541,_0x4648d6){_0x426541=_0x426541-0x0;var _0x3631e4=_0xee92[_0x426541];return _0x3631e4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2ee9('0x0'))(_0x2ee9('0x1'));var moment=require(_0x2ee9('0x2'));var BPromise=require('bluebird');var rp=require(_0x2ee9('0x3'));var fs=require('fs');var path=require(_0x2ee9('0x4'));var rimraf=require(_0x2ee9('0x5'));var config=require(_0x2ee9('0x6'));var attributes=require(_0x2ee9('0x7'));module['exports']=function(_0x198968,_0x34e67c){return _0x198968[_0x2ee9('0x8')](_0x2ee9('0x9'),attributes,{'tableName':_0x2ee9('0xa'),'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 ad493f1..6ab30f5 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 _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 +var _0x63be=['error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2c5757,_0x4ce6a5){var _0x318984=function(_0xb75413){while(--_0xb75413){_0x2c5757['push'](_0x2c5757['shift']());}};_0x318984(++_0x4ce6a5);}(_0x63be,0x180));var _0xe63b=function(_0x108fbf,_0x2a46d0){_0x108fbf=_0x108fbf-0x0;var _0x5c249f=_0x63be[_0x108fbf];return _0x5c249f;};'use strict';var _=require(_0xe63b('0x0'));var util=require(_0xe63b('0x1'));var moment=require(_0xe63b('0x2'));var BPromise=require('bluebird');var rs=require(_0xe63b('0x3'));var fs=require('fs');var Redis=require(_0xe63b('0x4'));var db=require(_0xe63b('0x5'))['db'];var utils=require(_0xe63b('0x6'));var logger=require('../../config/logger')(_0xe63b('0x7'));var config=require(_0xe63b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe63b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40c594,_0x11db13,_0x1c87de){return new BPromise(function(_0x67fc94,_0x5188e2){return client['request'](_0x40c594,_0x1c87de)[_0xe63b('0xa')](function(_0x436d68){logger[_0xe63b('0xb')](_0xe63b('0xc'),_0x11db13,_0xe63b('0xd'));logger['debug'](_0xe63b('0xe'),_0x11db13,_0xe63b('0xd'),JSON[_0xe63b('0xf')](_0x436d68));if(_0x436d68[_0xe63b('0x10')]){if(_0x436d68[_0xe63b('0x10')][_0xe63b('0x11')]===0x1f4){logger['error'](_0xe63b('0xc'),_0x11db13,_0x436d68[_0xe63b('0x10')]['message']);return _0x5188e2(_0x436d68['error'][_0xe63b('0x12')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x11db13,_0x436d68[_0xe63b('0x10')][_0xe63b('0x12')]);return _0x67fc94(_0x436d68['error'][_0xe63b('0x12')]);}else{logger[_0xe63b('0xb')](_0xe63b('0xc'),_0x11db13,'request\x20sent');_0x67fc94(_0x436d68[_0xe63b('0x13')][_0xe63b('0x12')]);}})['catch'](function(_0x226cf3){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x11db13,_0x226cf3);_0x5188e2(_0x226cf3);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 177c0bf..577b480 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 _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 +var _0xc9af=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x2ea7e8,_0x14f447){var _0x283810=function(_0x584224){while(--_0x584224){_0x2ea7e8['push'](_0x2ea7e8['shift']());}};_0x283810(++_0x14f447);}(_0xc9af,0x129));var _0xfc9a=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xc9af[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0xfc9a('0x0'));var util=require(_0xfc9a('0x1'));var path=require(_0xfc9a('0x2'));var timeout=require(_0xfc9a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfc9a('0x4'));var interaction=require(_0xfc9a('0x5'));var config=require(_0xfc9a('0x6'));var controller=require('./intVtigerField.controller');router['get']('/',auth[_0xfc9a('0x7')](),controller['index']);router[_0xfc9a('0x8')](_0xfc9a('0x9'),auth[_0xfc9a('0x7')](),controller[_0xfc9a('0xa')]);router[_0xfc9a('0xb')]('/',auth['isAuthenticated'](),controller[_0xfc9a('0xc')]);router[_0xfc9a('0xd')](_0xfc9a('0x9'),auth['isAuthenticated'](),controller[_0xfc9a('0xe')]);router[_0xfc9a('0xf')]('/:id',auth[_0xfc9a('0x7')](),controller[_0xfc9a('0x10')]);module[_0xfc9a('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index b46722b..10b3c3f 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 _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 +var _0x4b6d=['BOOLEAN','exports','variable','customVariable','keyValue','string','STRING','ENUM'];(function(_0x25cc54,_0x201fe1){var _0x24f2e7=function(_0x21292e){while(--_0x21292e){_0x25cc54['push'](_0x25cc54['shift']());}};_0x24f2e7(++_0x201fe1);}(_0x4b6d,0x1b1));var _0xd4b6=function(_0x1a56bf,_0x2664cd){_0x1a56bf=_0x1a56bf-0x0;var _0x14ca08=_0x4b6d[_0x1a56bf];return _0x14ca08;};'use strict';var Sequelize=require('sequelize');module[_0xd4b6('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0xd4b6('0x1'),_0xd4b6('0x2'),_0xd4b6('0x3'),'picklist'),'defaultValue':_0xd4b6('0x4')},'content':{'type':Sequelize[_0xd4b6('0x5')]},'key':{'type':Sequelize[_0xd4b6('0x5')]},'keyType':{'type':Sequelize[_0xd4b6('0x6')](_0xd4b6('0x4'),_0xd4b6('0x1'),_0xd4b6('0x2'))},'keyContent':{'type':Sequelize[_0xd4b6('0x5')]},'idField':{'type':Sequelize[_0xd4b6('0x5')]},'nameField':{'type':Sequelize[_0xd4b6('0x5')]},'customField':{'type':Sequelize[_0xd4b6('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd4b6('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index ef24492..4fd8ced 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 _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 +var _0x6efb=['destroy','error','stack','name','send','VtigerField','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','then','show','keys','includeAll','options','find','catch','create','body','params','eml-format','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','../../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','count','set','Content-Range','apply','update'];(function(_0x5885e4,_0x23d7b7){var _0x154bab=function(_0x41ffcf){while(--_0x41ffcf){_0x5885e4['push'](_0x5885e4['shift']());}};_0x154bab(++_0x23d7b7);}(_0x6efb,0x15a));var _0xb6ef=function(_0x426fea,_0x2b7e59){_0x426fea=_0x426fea-0x0;var _0x30d21a=_0x6efb[_0x426fea];return _0x30d21a;};'use strict';var emlformat=require(_0xb6ef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb6ef('0x1'));var jsonpatch=require(_0xb6ef('0x2'));var rp=require(_0xb6ef('0x3'));var moment=require(_0xb6ef('0x4'));var BPromise=require(_0xb6ef('0x5'));var Mustache=require(_0xb6ef('0x6'));var util=require(_0xb6ef('0x7'));var path=require(_0xb6ef('0x8'));var sox=require(_0xb6ef('0x9'));var csv=require(_0xb6ef('0xa'));var ejs=require(_0xb6ef('0xb'));var fs=require('fs');var fs_extra=require(_0xb6ef('0xc'));var _=require(_0xb6ef('0xd'));var squel=require(_0xb6ef('0xe'));var crypto=require('crypto');var jsforce=require(_0xb6ef('0xf'));var deskjs=require(_0xb6ef('0x10'));var toCsv=require(_0xb6ef('0xa'));var querystring=require(_0xb6ef('0x11'));var Papa=require(_0xb6ef('0x12'));var Redis=require('ioredis');var authService=require(_0xb6ef('0x13'));var qs=require(_0xb6ef('0x14'));var as=require(_0xb6ef('0x15'));var hardwareService=require(_0xb6ef('0x16'));var logger=require(_0xb6ef('0x17'))(_0xb6ef('0x18'));var utils=require('../../config/utils');var config=require(_0xb6ef('0x19'));var licenseUtil=require(_0xb6ef('0x1a'));var db=require(_0xb6ef('0x1b'))['db'];function respondWithStatusCode(_0x1c378f,_0x9ab0bc){_0x9ab0bc=_0x9ab0bc||0xcc;return function(_0x100695){if(_0x100695){return _0x1c378f[_0xb6ef('0x1c')](_0x9ab0bc);}return _0x1c378f[_0xb6ef('0x1d')](_0x9ab0bc)[_0xb6ef('0x1e')]();};}function respondWithResult(_0x59f24d,_0x42e64c){_0x42e64c=_0x42e64c||0xc8;return function(_0x596163){if(_0x596163){return _0x59f24d[_0xb6ef('0x1d')](_0x42e64c)[_0xb6ef('0x1f')](_0x596163);}};}function respondWithFilteredResult(_0x2e5d46,_0x59c667){return function(_0x34190c){if(_0x34190c){var _0x1eea5c=typeof _0x59c667[_0xb6ef('0x20')]===_0xb6ef('0x21')&&typeof _0x59c667['limit']===_0xb6ef('0x21');var _0x25b58d=_0x34190c[_0xb6ef('0x22')];var _0x2b37d8=_0x1eea5c?0x0:_0x59c667[_0xb6ef('0x20')];var _0x39c85d=_0x1eea5c?_0x34190c[_0xb6ef('0x22')]:_0x59c667[_0xb6ef('0x20')]+_0x59c667['limit'];var _0x24605b;if(_0x39c85d>=_0x25b58d){_0x39c85d=_0x25b58d;_0x24605b=0xc8;}else{_0x24605b=0xce;}_0x2e5d46[_0xb6ef('0x1d')](_0x24605b);return _0x2e5d46[_0xb6ef('0x23')](_0xb6ef('0x24'),_0x2b37d8+'-'+_0x39c85d+'/'+_0x25b58d)[_0xb6ef('0x1f')](_0x34190c);}return null;};}function patchUpdates(_0x5741d0){return function(_0x17fcbd){try{jsonpatch[_0xb6ef('0x25')](_0x17fcbd,_0x5741d0,!![]);}catch(_0x170cc9){return BPromise['reject'](_0x170cc9);}return _0x17fcbd['save']();};}function saveUpdates(_0x2be4f1,_0x4203cc){return function(_0x4d0396){if(_0x4d0396){return _0x4d0396[_0xb6ef('0x26')](_0x2be4f1)['then'](function(_0x18dddb){return _0x18dddb;});}return null;};}function removeEntity(_0x39b564,_0xf01c1a){return function(_0x35332e){if(_0x35332e){return _0x35332e[_0xb6ef('0x27')]()['then'](function(){_0x39b564['status'](0xcc)[_0xb6ef('0x1e')]();});}};}function handleEntityNotFound(_0x35a98,_0x30271a){return function(_0x5e5261){if(!_0x5e5261){_0x35a98[_0xb6ef('0x1c')](0x194);}return _0x5e5261;};}function handleError(_0x3c5c44,_0x39d9d7){_0x39d9d7=_0x39d9d7||0x1f4;return function(_0xaf8fe3){logger[_0xb6ef('0x28')](_0xaf8fe3[_0xb6ef('0x29')]);if(_0xaf8fe3[_0xb6ef('0x2a')]){delete _0xaf8fe3[_0xb6ef('0x2a')];}_0x3c5c44[_0xb6ef('0x1d')](_0x39d9d7)[_0xb6ef('0x2b')](_0xaf8fe3);};}exports['index']=function(_0x4fa632,_0x175b10){var _0x1c1bd5={},_0x3b4be9={},_0x155348={'count':0x0,'rows':[]};var _0x4e2c3f=_['map'](db[_0xb6ef('0x2c')][_0xb6ef('0x2d')],function(_0x52ec3a){return{'name':_0x52ec3a[_0xb6ef('0x2e')],'type':_0x52ec3a[_0xb6ef('0x2f')][_0xb6ef('0x30')]};});_0x3b4be9[_0xb6ef('0x31')]=_[_0xb6ef('0x32')](_0x4e2c3f,_0xb6ef('0x2a'));_0x3b4be9[_0xb6ef('0x33')]=_['keys'](_0x4fa632[_0xb6ef('0x33')]);_0x3b4be9['filters']=_[_0xb6ef('0x34')](_0x3b4be9[_0xb6ef('0x31')],_0x3b4be9[_0xb6ef('0x33')]);_0x1c1bd5[_0xb6ef('0x35')]=_[_0xb6ef('0x34')](_0x3b4be9[_0xb6ef('0x31')],qs[_0xb6ef('0x36')](_0x4fa632['query']['fields']));_0x1c1bd5[_0xb6ef('0x35')]=_0x1c1bd5[_0xb6ef('0x35')][_0xb6ef('0x37')]?_0x1c1bd5['attributes']:_0x3b4be9['model'];if(!_0x4fa632[_0xb6ef('0x33')][_0xb6ef('0x38')](_0xb6ef('0x39'))){_0x1c1bd5[_0xb6ef('0x3a')]=qs[_0xb6ef('0x3a')](_0x4fa632[_0xb6ef('0x33')]['limit']);_0x1c1bd5[_0xb6ef('0x20')]=qs[_0xb6ef('0x20')](_0x4fa632[_0xb6ef('0x33')][_0xb6ef('0x20')]);}_0x1c1bd5['order']=qs[_0xb6ef('0x3b')](_0x4fa632['query'][_0xb6ef('0x3b')]);_0x1c1bd5[_0xb6ef('0x3c')]=qs['filters'](_[_0xb6ef('0x3d')](_0x4fa632['query'],_0x3b4be9['filters']),_0x4e2c3f);if(_0x4fa632[_0xb6ef('0x33')][_0xb6ef('0x3e')]){_0x1c1bd5[_0xb6ef('0x3c')]=_[_0xb6ef('0x3f')](_0x1c1bd5[_0xb6ef('0x3c')],{'$or':_[_0xb6ef('0x32')](_0x4e2c3f,function(_0x162d22){if(_0x162d22['type']!==_0xb6ef('0x40')){var _0x1319b9={};_0x1319b9[_0x162d22[_0xb6ef('0x2a')]]={'$like':'%'+_0x4fa632[_0xb6ef('0x33')][_0xb6ef('0x3e')]+'%'};return _0x1319b9;}})});}_0x1c1bd5=_[_0xb6ef('0x3f')]({},_0x1c1bd5,_0x4fa632['options']);var _0x50b61f={'where':_0x1c1bd5[_0xb6ef('0x3c')]};return db[_0xb6ef('0x2c')][_0xb6ef('0x22')](_0x50b61f)['then'](function(_0xbb485f){_0x155348[_0xb6ef('0x22')]=_0xbb485f;if(_0x4fa632[_0xb6ef('0x33')]['includeAll']){_0x1c1bd5[_0xb6ef('0x41')]=[{'all':!![]}];}return db[_0xb6ef('0x2c')][_0xb6ef('0x42')](_0x1c1bd5);})['then'](function(_0x20c60e){_0x155348['rows']=_0x20c60e;return _0x155348;})[_0xb6ef('0x43')](respondWithFilteredResult(_0x175b10,_0x1c1bd5))['catch'](handleError(_0x175b10,null));};exports[_0xb6ef('0x44')]=function(_0xcd8f57,_0x393f7b){var _0x4302aa={'raw':!![],'where':{'id':_0xcd8f57['params']['id']}},_0x30e0d8={};_0x30e0d8[_0xb6ef('0x31')]=_[_0xb6ef('0x45')](db[_0xb6ef('0x2c')][_0xb6ef('0x2d')]);_0x30e0d8[_0xb6ef('0x33')]=_[_0xb6ef('0x45')](_0xcd8f57['query']);_0x30e0d8['filters']=_[_0xb6ef('0x34')](_0x30e0d8[_0xb6ef('0x31')],_0x30e0d8[_0xb6ef('0x33')]);_0x4302aa['attributes']=_[_0xb6ef('0x34')](_0x30e0d8[_0xb6ef('0x31')],qs[_0xb6ef('0x36')](_0xcd8f57[_0xb6ef('0x33')][_0xb6ef('0x36')]));_0x4302aa[_0xb6ef('0x35')]=_0x4302aa[_0xb6ef('0x35')]['length']?_0x4302aa['attributes']:_0x30e0d8[_0xb6ef('0x31')];if(_0xcd8f57[_0xb6ef('0x33')][_0xb6ef('0x46')]){_0x4302aa[_0xb6ef('0x41')]=[{'all':!![]}];}_0x4302aa=_[_0xb6ef('0x3f')]({},_0x4302aa,_0xcd8f57[_0xb6ef('0x47')]);return db[_0xb6ef('0x2c')][_0xb6ef('0x48')](_0x4302aa)[_0xb6ef('0x43')](handleEntityNotFound(_0x393f7b,null))[_0xb6ef('0x43')](respondWithResult(_0x393f7b,null))[_0xb6ef('0x49')](handleError(_0x393f7b,null));};exports['create']=function(_0x2ca1e6,_0x3b0350){return db[_0xb6ef('0x2c')][_0xb6ef('0x4a')](_0x2ca1e6[_0xb6ef('0x4b')],{})[_0xb6ef('0x43')](respondWithResult(_0x3b0350,0xc9))[_0xb6ef('0x49')](handleError(_0x3b0350,null));};exports[_0xb6ef('0x26')]=function(_0x4fc2d1,_0xeead34){if(_0x4fc2d1['body']['id']){delete _0x4fc2d1[_0xb6ef('0x4b')]['id'];}return db[_0xb6ef('0x2c')]['find']({'where':{'id':_0x4fc2d1[_0xb6ef('0x4c')]['id']}})[_0xb6ef('0x43')](handleEntityNotFound(_0xeead34,null))[_0xb6ef('0x43')](saveUpdates(_0x4fc2d1[_0xb6ef('0x4b')],null))[_0xb6ef('0x43')](respondWithResult(_0xeead34,null))[_0xb6ef('0x49')](handleError(_0xeead34,null));};exports['destroy']=function(_0x3888b6,_0x1883f6){return db[_0xb6ef('0x2c')][_0xb6ef('0x48')]({'where':{'id':_0x3888b6[_0xb6ef('0x4c')]['id']}})[_0xb6ef('0x43')](handleEntityNotFound(_0x1883f6,null))['then'](removeEntity(_0x1883f6,null))['catch'](handleError(_0x1883f6,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 40b307f..26c8d23 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 _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 +var _0x2056=['bluebird','request-promise','path','rimraf','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','lodash','util','../../config/logger','api','moment'];(function(_0x259183,_0x2a5a01){var _0x31deed=function(_0x85a192){while(--_0x85a192){_0x259183['push'](_0x259183['shift']());}};_0x31deed(++_0x2a5a01);}(_0x2056,0x64));var _0x6205=function(_0x1817b0,_0x3aaaa1){_0x1817b0=_0x1817b0-0x0;var _0x5c10e6=_0x2056[_0x1817b0];return _0x5c10e6;};'use strict';var _=require(_0x6205('0x0'));var util=require(_0x6205('0x1'));var logger=require(_0x6205('0x2'))(_0x6205('0x3'));var moment=require(_0x6205('0x4'));var BPromise=require(_0x6205('0x5'));var rp=require(_0x6205('0x6'));var fs=require('fs');var path=require(_0x6205('0x7'));var rimraf=require(_0x6205('0x8'));var config=require('../../config/environment');var attributes=require(_0x6205('0x9'));module[_0x6205('0xa')]=function(_0x3aad37,_0xe983fb){return _0x3aad37['define'](_0x6205('0xb'),attributes,{'tableName':_0x6205('0xc'),'paranoid':![],'indexes':[{'name':_0x6205('0xd'),'fields':[_0x6205('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index c49a61b..053f21f 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 _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 +var _0xea19=['util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xea19,0x14f));var _0x9ea1=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xea19[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x9ea1('0x0'));var util=require(_0x9ea1('0x1'));var moment=require('moment');var BPromise=require(_0x9ea1('0x2'));var rs=require(_0x9ea1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ea1('0x4'))['db'];var utils=require(_0x9ea1('0x5'));var logger=require('../../config/logger')(_0x9ea1('0x6'));var config=require(_0x9ea1('0x7'));var jayson=require(_0x9ea1('0x8'));var client=jayson[_0x9ea1('0x9')][_0x9ea1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa438dd,_0x23e336,_0x4b31ed){return new BPromise(function(_0x3a573d,_0x18364d){return client[_0x9ea1('0xb')](_0xa438dd,_0x4b31ed)[_0x9ea1('0xc')](function(_0x1f1266){logger[_0x9ea1('0xd')]('VtigerField,\x20%s,\x20%s',_0x23e336,_0x9ea1('0xe'));logger['debug'](_0x9ea1('0xf'),_0x23e336,'request\x20sent',JSON[_0x9ea1('0x10')](_0x1f1266));if(_0x1f1266['error']){if(_0x1f1266[_0x9ea1('0x11')][_0x9ea1('0x12')]===0x1f4){logger[_0x9ea1('0x11')](_0x9ea1('0x13'),_0x23e336,_0x1f1266[_0x9ea1('0x11')][_0x9ea1('0x14')]);return _0x18364d(_0x1f1266[_0x9ea1('0x11')][_0x9ea1('0x14')]);}logger['error'](_0x9ea1('0x13'),_0x23e336,_0x1f1266['error'][_0x9ea1('0x14')]);return _0x3a573d(_0x1f1266[_0x9ea1('0x11')][_0x9ea1('0x14')]);}else{logger[_0x9ea1('0xd')](_0x9ea1('0x13'),_0x23e336,'request\x20sent');_0x3a573d(_0x1f1266['result'][_0x9ea1('0x14')]);}})['catch'](function(_0x5eb7f4){logger[_0x9ea1('0x11')](_0x9ea1('0x13'),_0x23e336,_0x5eb7f4);_0x18364d(_0x5eb7f4);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 9059799..f2d4a2c 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 _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 +var _0x95e3=['./intZendeskAccount.controller','isAuthenticated','get','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x475232,_0x55ca03){var _0x8eb306=function(_0x35e9d5){while(--_0x35e9d5){_0x475232['push'](_0x475232['shift']());}};_0x8eb306(++_0x55ca03);}(_0x95e3,0x15f));var _0x395e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x95e3[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x395e('0x0'));var util=require(_0x395e('0x1'));var path=require('path');var timeout=require(_0x395e('0x2'));var express=require(_0x395e('0x3'));var router=express[_0x395e('0x4')]();var fs_extra=require(_0x395e('0x5'));var auth=require(_0x395e('0x6'));var interaction=require(_0x395e('0x7'));var config=require(_0x395e('0x8'));var controller=require(_0x395e('0x9'));router['get']('/',auth[_0x395e('0xa')](),controller['index']);router[_0x395e('0xb')](_0x395e('0xc'),auth[_0x395e('0xa')](),controller[_0x395e('0xd')]);router[_0x395e('0xb')]('/:id/configurations',auth[_0x395e('0xa')](),controller[_0x395e('0xe')]);router[_0x395e('0xb')](_0x395e('0xf'),auth['isAuthenticated'](),controller[_0x395e('0x10')]);router[_0x395e('0x11')]('/',auth['isAuthenticated'](),controller[_0x395e('0x12')]);router[_0x395e('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x395e('0x13')]);router['put'](_0x395e('0xc'),auth[_0x395e('0xa')](),controller[_0x395e('0x14')]);router[_0x395e('0x15')](_0x395e('0xc'),auth[_0x395e('0xa')](),controller[_0x395e('0x16')]);module[_0x395e('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 287a3a7..9bc05e5 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 _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 +var _0xa6ce=['STRING','username','remoteUri','ENUM','password','token','integrationTab','newTab','sequelize'];(function(_0x1d2f30,_0x4d6f31){var _0x2f0202=function(_0x529271){while(--_0x529271){_0x1d2f30['push'](_0x1d2f30['shift']());}};_0x2f0202(++_0x4d6f31);}(_0xa6ce,0x15e));var _0xea6c=function(_0x2e0443,_0x7e5974){_0x2e0443=_0x2e0443-0x0;var _0x52d450=_0xa6ce[_0x2e0443];return _0x52d450;};'use strict';var Sequelize=require(_0xea6c('0x0'));module['exports']={'name':{'type':Sequelize[_0xea6c('0x1')]},'description':{'type':Sequelize[_0xea6c('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xea6c('0x2')},'password':{'type':Sequelize[_0xea6c('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xea6c('0x3')},'authType':{'type':Sequelize[_0xea6c('0x4')](_0xea6c('0x5'),_0xea6c('0x6')),'defaultValue':_0xea6c('0x5')},'serverUrl':{'type':Sequelize[_0xea6c('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xea6c('0x7'),_0xea6c('0x8')),'defaultValue':_0xea6c('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 2cd262f..532b71e 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 _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 +var _0xd64b=['undefined','count','Content-Range','apply','update','then','stack','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','name','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','rows','catch','show','params','keys','includeAll','include','merge','options','find','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','getFields','username','password','token','remoteUri','substring','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','ValidationError','subject','description','assignee','remove','position','title','system_field_options','custom_field_options','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit'];(function(_0x1a07ef,_0x57325f){var _0x5b4edb=function(_0x1eee30){while(--_0x1eee30){_0x1a07ef['push'](_0x1a07ef['shift']());}};_0x5b4edb(++_0x57325f);}(_0xd64b,0xc1));var _0xbd64=function(_0x4c3ffe,_0x457374){_0x4c3ffe=_0x4c3ffe-0x0;var _0x28d3eb=_0xd64b[_0x4c3ffe];return _0x28d3eb;};'use strict';var emlformat=require(_0xbd64('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd64('0x2'));var moment=require(_0xbd64('0x3'));var BPromise=require(_0xbd64('0x4'));var Mustache=require(_0xbd64('0x5'));var util=require(_0xbd64('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd64('0x7'));var _=require(_0xbd64('0x8'));var squel=require(_0xbd64('0x9'));var crypto=require(_0xbd64('0xa'));var jsforce=require(_0xbd64('0xb'));var deskjs=require(_0xbd64('0xc'));var toCsv=require(_0xbd64('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd64('0xe'));var authService=require(_0xbd64('0xf'));var qs=require(_0xbd64('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd64('0x11'));var logger=require(_0xbd64('0x12'))(_0xbd64('0x13'));var utils=require(_0xbd64('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbd64('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbd64('0x16'));function respondWithStatusCode(_0x2729d8,_0x3a941c){_0x3a941c=_0x3a941c||0xcc;return function(_0x2183e2){if(_0x2183e2){return _0x2729d8[_0xbd64('0x17')](_0x3a941c);}return _0x2729d8[_0xbd64('0x18')](_0x3a941c)[_0xbd64('0x19')]();};}function respondWithResult(_0x269e2f,_0x2b5808){_0x2b5808=_0x2b5808||0xc8;return function(_0x4ae471){if(_0x4ae471){return _0x269e2f[_0xbd64('0x18')](_0x2b5808)[_0xbd64('0x1a')](_0x4ae471);}};}function respondWithFilteredResult(_0x3ff550,_0x32fd34){return function(_0x29fc16){if(_0x29fc16){var _0x49a914=typeof _0x32fd34[_0xbd64('0x1b')]==='undefined'&&typeof _0x32fd34[_0xbd64('0x1c')]===_0xbd64('0x1d');var _0x3aef70=_0x29fc16[_0xbd64('0x1e')];var _0x17d015=_0x49a914?0x0:_0x32fd34[_0xbd64('0x1b')];var _0xa5491d=_0x49a914?_0x29fc16[_0xbd64('0x1e')]:_0x32fd34['offset']+_0x32fd34[_0xbd64('0x1c')];var _0x1f618b;if(_0xa5491d>=_0x3aef70){_0xa5491d=_0x3aef70;_0x1f618b=0xc8;}else{_0x1f618b=0xce;}_0x3ff550['status'](_0x1f618b);return _0x3ff550['set'](_0xbd64('0x1f'),_0x17d015+'-'+_0xa5491d+'/'+_0x3aef70)[_0xbd64('0x1a')](_0x29fc16);}return null;};}function patchUpdates(_0x196d21){return function(_0x39e2eb){try{jsonpatch[_0xbd64('0x20')](_0x39e2eb,_0x196d21,!![]);}catch(_0x816e00){return BPromise['reject'](_0x816e00);}return _0x39e2eb['save']();};}function saveUpdates(_0x6038f,_0x41f2f){return function(_0x12f67b){if(_0x12f67b){return _0x12f67b[_0xbd64('0x21')](_0x6038f)['then'](function(_0x51d118){return _0x51d118;});}return null;};}function removeEntity(_0x28497c,_0x4afaff){return function(_0x46ab38){if(_0x46ab38){return _0x46ab38['destroy']()[_0xbd64('0x22')](function(){_0x28497c[_0xbd64('0x18')](0xcc)[_0xbd64('0x19')]();});}};}function handleEntityNotFound(_0x2d0993,_0x5ae417){return function(_0x9d0fb8){if(!_0x9d0fb8){_0x2d0993[_0xbd64('0x17')](0x194);}return _0x9d0fb8;};}function handleError(_0x13f527,_0x2a44d0){_0x2a44d0=_0x2a44d0||0x1f4;return function(_0x4d1563){logger['error'](_0x4d1563[_0xbd64('0x23')]);if(_0x4d1563['name']){delete _0x4d1563['name'];}_0x13f527[_0xbd64('0x18')](_0x2a44d0)['send'](_0x4d1563);};}exports[_0xbd64('0x24')]=function(_0x5300e8,_0x28199c){var _0x5d8c35={},_0x1db9f3={},_0x3c0eaf={'count':0x0,'rows':[]};var _0x3be63a=_[_0xbd64('0x25')](db[_0xbd64('0x26')][_0xbd64('0x27')],function(_0x4ed44a){return{'name':_0x4ed44a[_0xbd64('0x28')],'type':_0x4ed44a[_0xbd64('0x29')][_0xbd64('0x2a')]};});_0x1db9f3[_0xbd64('0x2b')]=_[_0xbd64('0x25')](_0x3be63a,_0xbd64('0x2c'));_0x1db9f3['query']=_['keys'](_0x5300e8[_0xbd64('0x2d')]);_0x1db9f3['filters']=_[_0xbd64('0x2e')](_0x1db9f3[_0xbd64('0x2b')],_0x1db9f3['query']);_0x5d8c35['attributes']=_[_0xbd64('0x2e')](_0x1db9f3['model'],qs['fields'](_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x5d8c35[_0xbd64('0x30')]=_0x5d8c35['attributes'][_0xbd64('0x31')]?_0x5d8c35['attributes']:_0x1db9f3[_0xbd64('0x2b')];if(!_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x32')](_0xbd64('0x33'))){_0x5d8c35[_0xbd64('0x1c')]=qs[_0xbd64('0x1c')](_0x5300e8['query']['limit']);_0x5d8c35[_0xbd64('0x1b')]=qs[_0xbd64('0x1b')](_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x1b')]);}_0x5d8c35[_0xbd64('0x34')]=qs[_0xbd64('0x35')](_0x5300e8['query']['sort']);_0x5d8c35[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_[_0xbd64('0x38')](_0x5300e8['query'],_0x1db9f3['filters']),_0x3be63a);if(_0x5300e8[_0xbd64('0x2d')]['filter']){_0x5d8c35[_0xbd64('0x36')]=_['merge'](_0x5d8c35[_0xbd64('0x36')],{'$or':_[_0xbd64('0x25')](_0x3be63a,function(_0x550221){if(_0x550221[_0xbd64('0x29')]!=='VIRTUAL'){var _0x534091={};_0x534091[_0x550221[_0xbd64('0x2c')]]={'$like':'%'+_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x39')]+'%'};return _0x534091;}})});}_0x5d8c35=_['merge']({},_0x5d8c35,_0x5300e8['options']);var _0x5d6bcf={'where':_0x5d8c35[_0xbd64('0x36')]};return db[_0xbd64('0x26')]['count'](_0x5d6bcf)[_0xbd64('0x22')](function(_0x34b19a){_0x3c0eaf[_0xbd64('0x1e')]=_0x34b19a;if(_0x5300e8[_0xbd64('0x2d')]['includeAll']){_0x5d8c35['include']=[{'all':!![]}];}return db[_0xbd64('0x26')]['findAll'](_0x5d8c35);})['then'](function(_0x231fa6){_0x3c0eaf[_0xbd64('0x3a')]=_0x231fa6;return _0x3c0eaf;})[_0xbd64('0x22')](respondWithFilteredResult(_0x28199c,_0x5d8c35))[_0xbd64('0x3b')](handleError(_0x28199c,null));};exports[_0xbd64('0x3c')]=function(_0x3155b3,_0x247775){var _0x762380={'raw':![],'where':{'id':_0x3155b3[_0xbd64('0x3d')]['id']}},_0x4870fd={};_0x4870fd[_0xbd64('0x2b')]=_['keys'](db[_0xbd64('0x26')][_0xbd64('0x27')]);_0x4870fd[_0xbd64('0x2d')]=_[_0xbd64('0x3e')](_0x3155b3[_0xbd64('0x2d')]);_0x4870fd[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0x4870fd['model'],_0x4870fd[_0xbd64('0x2d')]);_0x762380['attributes']=_[_0xbd64('0x2e')](_0x4870fd['model'],qs[_0xbd64('0x2f')](_0x3155b3[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x762380['attributes']=_0x762380[_0xbd64('0x30')]['length']?_0x762380['attributes']:_0x4870fd['model'];if(_0x3155b3[_0xbd64('0x2d')][_0xbd64('0x3f')]){_0x762380[_0xbd64('0x40')]=[{'all':!![]}];}_0x762380=_[_0xbd64('0x41')]({},_0x762380,_0x3155b3[_0xbd64('0x42')]);return db[_0xbd64('0x26')][_0xbd64('0x43')](_0x762380)['then'](handleEntityNotFound(_0x247775,null))[_0xbd64('0x22')](respondWithResult(_0x247775,null))[_0xbd64('0x3b')](handleError(_0x247775,null));};exports[_0xbd64('0x44')]=function(_0x4e5efe,_0x105bee){return db[_0xbd64('0x26')][_0xbd64('0x44')](_0x4e5efe[_0xbd64('0x45')],{})[_0xbd64('0x22')](respondWithResult(_0x105bee,0xc9))['catch'](handleError(_0x105bee,null));};exports[_0xbd64('0x21')]=function(_0x1a9ec8,_0x2a8011){if(_0x1a9ec8[_0xbd64('0x45')]['id']){delete _0x1a9ec8['body']['id'];}return db['ZendeskAccount'][_0xbd64('0x43')]({'where':{'id':_0x1a9ec8[_0xbd64('0x3d')]['id']}})[_0xbd64('0x22')](handleEntityNotFound(_0x2a8011,null))[_0xbd64('0x22')](saveUpdates(_0x1a9ec8[_0xbd64('0x45')],null))[_0xbd64('0x22')](respondWithResult(_0x2a8011,null))[_0xbd64('0x3b')](handleError(_0x2a8011,null));};exports[_0xbd64('0x46')]=function(_0x460158,_0x2709b2){return db[_0xbd64('0x26')][_0xbd64('0x43')]({'where':{'id':_0x460158[_0xbd64('0x3d')]['id']}})[_0xbd64('0x22')](handleEntityNotFound(_0x2709b2,null))[_0xbd64('0x22')](removeEntity(_0x2709b2,null))['catch'](handleError(_0x2709b2,null));};exports[_0xbd64('0x47')]=function(_0x4952db,_0x5ede67,_0x552c95){var _0x4aa662={};var _0xced0ca={};var _0x2f56df;var _0x5480f5;return db[_0xbd64('0x26')][_0xbd64('0x48')]({'where':{'id':_0x4952db[_0xbd64('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5ede67,null))[_0xbd64('0x22')](function(_0x371bad){if(_0x371bad){_0x2f56df=_0x371bad;_0xced0ca[_0xbd64('0x2b')]=_[_0xbd64('0x3e')](db[_0xbd64('0x49')][_0xbd64('0x27')]);_0xced0ca['query']=_['keys'](_0x4952db['query']);_0xced0ca[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0xced0ca[_0xbd64('0x2b')],_0xced0ca[_0xbd64('0x2d')]);_0x4aa662['attributes']=_[_0xbd64('0x2e')](_0xced0ca[_0xbd64('0x2b')],qs[_0xbd64('0x2f')](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x4aa662[_0xbd64('0x30')]=_0x4aa662['attributes'][_0xbd64('0x31')]?_0x4aa662[_0xbd64('0x30')]:_0xced0ca[_0xbd64('0x2b')];_0x4aa662[_0xbd64('0x34')]=qs[_0xbd64('0x35')](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x35')]);_0x4aa662[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_[_0xbd64('0x38')](_0x4952db[_0xbd64('0x2d')],_0xced0ca[_0xbd64('0x37')]));if(_0x4952db['query']['filter']){_0x4aa662[_0xbd64('0x36')]=_[_0xbd64('0x41')](_0x4aa662['where'],{'$or':_['map'](_0x4aa662[_0xbd64('0x30')],function(_0x12bc56){var _0x49051a={};_0x49051a[_0x12bc56]={'$like':'%'+_0x4952db[_0xbd64('0x2d')][_0xbd64('0x39')]+'%'};return _0x49051a;})});}_0x4aa662=_[_0xbd64('0x41')]({},_0x4aa662,_0x4952db[_0xbd64('0x42')]);return _0x2f56df[_0xbd64('0x47')](_0x4aa662);}})[_0xbd64('0x22')](function(_0x2d788){if(_0x2d788){_0x5480f5=_0x2d788[_0xbd64('0x31')];if(!_0x4952db[_0xbd64('0x2d')]['hasOwnProperty'](_0xbd64('0x33'))){_0x4aa662[_0xbd64('0x1c')]=qs[_0xbd64('0x1c')](_0x4952db['query'][_0xbd64('0x1c')]);_0x4aa662[_0xbd64('0x1b')]=qs['offset'](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x1b')]);}return _0x2f56df[_0xbd64('0x47')](_0x4aa662);}})[_0xbd64('0x22')](function(_0x3615bc){if(_0x3615bc){return _0x3615bc?{'count':_0x5480f5,'rows':_0x3615bc}:null;}})[_0xbd64('0x22')](respondWithResult(_0x5ede67,null))['catch'](handleError(_0x5ede67,null));};exports[_0xbd64('0x4a')]=function(_0x1f3bd0,_0xc57eb1,_0x28d899){if(_0x1f3bd0['body']['id']){delete _0x1f3bd0[_0xbd64('0x45')]['id'];}return db[_0xbd64('0x26')]['findOne']({'where':{'id':_0x1f3bd0[_0xbd64('0x3d')]['id']}})['then'](handleEntityNotFound(_0xc57eb1,null))[_0xbd64('0x22')](function(_0x10e269){if(_0x10e269){_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4b')]=_0x10e269['id'];_0x1f3bd0['body'][_0xbd64('0x4c')]=integrations[_0xbd64('0x4d')](_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4e')],_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x29')]);_0x1f3bd0['body']['Descriptions']=integrations['getDescriptions'](_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4e')],_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x29')]);return db[_0xbd64('0x49')][_0xbd64('0x44')](_0x1f3bd0['body'],{'include':[{'model':db[_0xbd64('0x4f')],'as':_0xbd64('0x4c')},{'model':db[_0xbd64('0x4f')],'as':_0xbd64('0x50')}]});}return null;})[_0xbd64('0x22')](respondWithResult(_0xc57eb1,null))[_0xbd64('0x3b')](handleError(_0xc57eb1,null));};exports[_0xbd64('0x51')]=function(_0x3d7e47,_0x301f42,_0x18e724){var _0x32e611='';return db[_0xbd64('0x26')]['findOne']({'where':{'id':_0x3d7e47['params']['id']},'attributes':['id',_0xbd64('0x52'),_0xbd64('0x53'),_0xbd64('0x54'),'authType',_0xbd64('0x55')]})['then'](handleEntityNotFound(_0x301f42,null))[_0xbd64('0x22')](function(_0x36ebb5){if(_0x36ebb5){_0x32e611=_0x36ebb5[_0xbd64('0x55')];var _0x819774=_0x32e611['slice'](-0x1);if(_0x819774==='/'){_0x32e611=_0x32e611[_0xbd64('0x56')](0x0,_0x32e611['lastIndexOf'](_0x819774));}var _0x14f79e={'method':_0xbd64('0x57'),'uri':util[_0xbd64('0x58')](_0xbd64('0x59'),_0x32e611,_0xbd64('0x5a')),'json':!![]};switch(_0x36ebb5['authType']){case _0xbd64('0x53'):_0x14f79e[_0xbd64('0x5b')]={'Authorization':util['format'](_0xbd64('0x5c'),new Buffer(util[_0xbd64('0x58')](_0xbd64('0x5d'),_0x36ebb5[_0xbd64('0x52')],_0x36ebb5['password']))[_0xbd64('0x5e')]('base64'))};break;case _0xbd64('0x54'):_0x14f79e[_0xbd64('0x5b')]={'Authorization':util[_0xbd64('0x58')]('Basic\x20%s',new Buffer(util['format']('%s/token:%s',_0x36ebb5['username'],_0x36ebb5[_0xbd64('0x54')]))[_0xbd64('0x5e')](_0xbd64('0x5f')))};break;default:throw new db[(_0xbd64('0x60'))][(_0xbd64('0x61'))]('Unknown\x20authentication\x20type');}return rp(_0x14f79e);}})[_0xbd64('0x22')](function(_0x23de71){if(_0x23de71){var _0xac13e6=[_0xbd64('0x62'),_0xbd64('0x63'),'group',_0xbd64('0x64')];_[_0xbd64('0x65')](_0x23de71[_0xbd64('0x5a')],function(_0x808467){return _0xac13e6['includes'](_0x808467['type']);});return{'count':_0x23de71[_0xbd64('0x5a')][_0xbd64('0x31')],'rows':_[_0xbd64('0x25')](_0x23de71[_0xbd64('0x5a')],function(_0x18b0f0){return{'id':_0x18b0f0['id'],'name':_0x18b0f0[_0xbd64('0x66')]>0x7?_0x18b0f0[_0xbd64('0x67')]:_0x18b0f0[_0xbd64('0x29')],'custom':_0x18b0f0['position']>0x7?!![]:![],'options':_0x18b0f0[_0xbd64('0x68')]?_0x18b0f0['system_field_options']:_0x18b0f0[_0xbd64('0x69')]?_0x18b0f0[_0xbd64('0x69')]:[]};})};}})[_0xbd64('0x22')](respondWithResult(_0x301f42,null))['catch'](function(_0x15b625){var _0x5c30f9=_0x3d7e47['query'][_0xbd64('0x6a')]?0x1f4:_0x15b625[_0xbd64('0x6b')]||0x1f4;logger[_0xbd64('0x6c')]('getFields,\x20%s,\x20%s,\x20%s',_0xbd64('0x51'),_0x5c30f9,JSON[_0xbd64('0x6d')](_0x15b625));delete _0x15b625[_0xbd64('0x2c')];if(_0x5c30f9===0x191){_0x5c30f9=0x190;}_0x301f42[_0xbd64('0x18')](_0x5c30f9)['send'](_0x3d7e47[_0xbd64('0x2d')][_0xbd64('0x6a')]?{'message':_0xbd64('0x6e'),'statusCode':_0x15b625[_0xbd64('0x6b')]}:_0x15b625);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index b19dae9..7f84ef9 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 _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 +var _0x030f=['bluebird','request-promise','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x148ee4,_0x505eb3){var _0x3c20b6=function(_0x5265c6){while(--_0x5265c6){_0x148ee4['push'](_0x148ee4['shift']());}};_0x3c20b6(++_0x505eb3);}(_0x030f,0xa3));var _0xf030=function(_0x36e041,_0x72b33a){_0x36e041=_0x36e041-0x0;var _0x1255e4=_0x030f[_0x36e041];return _0x1255e4;};'use strict';var _=require(_0xf030('0x0'));var util=require(_0xf030('0x1'));var logger=require(_0xf030('0x2'))(_0xf030('0x3'));var moment=require(_0xf030('0x4'));var BPromise=require(_0xf030('0x5'));var rp=require(_0xf030('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf030('0x7'));var config=require('../../config/environment');var attributes=require(_0xf030('0x8'));var integrations=require(_0xf030('0x9'));module[_0xf030('0xa')]=function(_0x236832,_0xbe9081){return _0x236832[_0xf030('0xb')](_0xf030('0xc'),attributes,{'tableName':_0xf030('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 06bff03..af105a3 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 _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 +var _0xd68e=['findAll','options','raw','attributes','model','include','map','find','where','ShowZendeskAccount','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount'];(function(_0x3b60a3,_0x323374){var _0xc625e7=function(_0x2f03ea){while(--_0x2f03ea){_0x3b60a3['push'](_0x3b60a3['shift']());}};_0xc625e7(++_0x323374);}(_0xd68e,0x1d3));var _0xed68=function(_0xbaeba7,_0x578dfa){_0xbaeba7=_0xbaeba7-0x0;var _0x4b42e7=_0xd68e[_0xbaeba7];return _0x4b42e7;};'use strict';var _=require(_0xed68('0x0'));var util=require(_0xed68('0x1'));var moment=require(_0xed68('0x2'));var BPromise=require(_0xed68('0x3'));var rs=require(_0xed68('0x4'));var fs=require('fs');var Redis=require(_0xed68('0x5'));var db=require(_0xed68('0x6'))['db'];var utils=require(_0xed68('0x7'));var logger=require(_0xed68('0x8'))(_0xed68('0x9'));var config=require(_0xed68('0xa'));var jayson=require(_0xed68('0xb'));var client=jayson[_0xed68('0xc')][_0xed68('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x59ba46,_0x3a0d4c,_0x5c0c68){return new BPromise(function(_0x370631,_0x2fc69e){return client[_0xed68('0xe')](_0x59ba46,_0x5c0c68)[_0xed68('0xf')](function(_0xb024e0){logger[_0xed68('0x10')](_0xed68('0x11'),_0x3a0d4c,_0xed68('0x12'));logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x3a0d4c,_0xed68('0x12'),JSON[_0xed68('0x13')](_0xb024e0));if(_0xb024e0[_0xed68('0x14')]){if(_0xb024e0[_0xed68('0x14')][_0xed68('0x15')]===0x1f4){logger[_0xed68('0x14')](_0xed68('0x11'),_0x3a0d4c,_0xb024e0[_0xed68('0x14')][_0xed68('0x16')]);return _0x2fc69e(_0xb024e0['error']['message']);}logger[_0xed68('0x14')](_0xed68('0x11'),_0x3a0d4c,_0xb024e0[_0xed68('0x14')][_0xed68('0x16')]);return _0x370631(_0xb024e0[_0xed68('0x14')][_0xed68('0x16')]);}else{logger[_0xed68('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x3a0d4c,_0xed68('0x12'));_0x370631(_0xb024e0[_0xed68('0x17')][_0xed68('0x16')]);}})[_0xed68('0x18')](function(_0xfe7727){logger[_0xed68('0x14')]('ZendeskAccount,\x20%s,\x20%s',_0x3a0d4c,_0xfe7727);_0x2fc69e(_0xfe7727);});});}exports[_0xed68('0x19')]=function(_0x2fed48){var _0xdde938=this;return new Promise(function(_0x1b4f66,_0x30f266){return db[_0xed68('0x1a')][_0xed68('0x1b')]({'raw':_0x2fed48[_0xed68('0x1c')]?_0x2fed48[_0xed68('0x1c')][_0xed68('0x1d')]===undefined?!![]:![]:!![],'where':_0x2fed48[_0xed68('0x1c')]?_0x2fed48['options']['where']||null:null,'attributes':_0x2fed48[_0xed68('0x1c')]?_0x2fed48[_0xed68('0x1c')][_0xed68('0x1e')]||null:null,'limit':_0x2fed48['options']?_0x2fed48[_0xed68('0x1c')]['limit']||null:null,'include':_0x2fed48[_0xed68('0x1c')]?_0x2fed48[_0xed68('0x1c')]['include']?_['map'](_0x2fed48[_0xed68('0x1c')]['include'],function(_0x5e9c0f){return{'model':db[_0x5e9c0f[_0xed68('0x1f')]],'as':_0x5e9c0f['as'],'attributes':_0x5e9c0f[_0xed68('0x1e')],'include':_0x5e9c0f[_0xed68('0x20')]?_[_0xed68('0x21')](_0x5e9c0f['include'],function(_0x71fb9d){return{'model':db[_0x71fb9d['model']],'as':_0x71fb9d['as'],'attributes':_0x71fb9d[_0xed68('0x1e')],'include':_0x71fb9d[_0xed68('0x20')]?_[_0xed68('0x21')](_0x71fb9d[_0xed68('0x20')],function(_0x49941a){return{'model':db[_0x49941a[_0xed68('0x1f')]],'as':_0x49941a['as'],'attributes':_0x49941a[_0xed68('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xed68('0xf')](function(_0x198d9e){logger[_0xed68('0x10')](_0xed68('0x19'),_0x2fed48);logger['debug'](_0xed68('0x19'),_0x2fed48,JSON[_0xed68('0x13')](_0x198d9e));_0x1b4f66(_0x198d9e);})[_0xed68('0x18')](function(_0x4b0730){logger[_0xed68('0x14')]('GetZendeskAccount',_0x4b0730['message'],_0x2fed48);_0x30f266(_0xdde938[_0xed68('0x14')](0x1f4,_0x4b0730['message']));});});};exports['ShowZendeskAccount']=function(_0xd66dc1){var _0x961be2=this;return new Promise(function(_0x273edc,_0x54e1cf){return db[_0xed68('0x1a')][_0xed68('0x22')]({'raw':_0xd66dc1['options']?_0xd66dc1[_0xed68('0x1c')][_0xed68('0x1d')]===undefined?!![]:![]:!![],'where':_0xd66dc1[_0xed68('0x1c')]?_0xd66dc1['options'][_0xed68('0x23')]||null:null,'attributes':_0xd66dc1['options']?_0xd66dc1[_0xed68('0x1c')][_0xed68('0x1e')]||null:null,'include':_0xd66dc1[_0xed68('0x1c')]?_0xd66dc1[_0xed68('0x1c')][_0xed68('0x20')]?_[_0xed68('0x21')](_0xd66dc1['options'][_0xed68('0x20')],function(_0x42c72b){return{'model':db[_0x42c72b[_0xed68('0x1f')]],'as':_0x42c72b['as'],'attributes':_0x42c72b[_0xed68('0x1e')],'include':_0x42c72b['include']?_[_0xed68('0x21')](_0x42c72b[_0xed68('0x20')],function(_0x5e55dc){return{'model':db[_0x5e55dc[_0xed68('0x1f')]],'as':_0x5e55dc['as'],'attributes':_0x5e55dc[_0xed68('0x1e')],'include':_0x5e55dc[_0xed68('0x20')]?_[_0xed68('0x21')](_0x5e55dc[_0xed68('0x20')],function(_0x365665){return{'model':db[_0x365665[_0xed68('0x1f')]],'as':_0x365665['as'],'attributes':_0x365665[_0xed68('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xed68('0xf')](function(_0x5821dd){logger[_0xed68('0x10')](_0xed68('0x24'),_0xd66dc1);logger[_0xed68('0x25')]('ShowZendeskAccount',_0xd66dc1,JSON[_0xed68('0x13')](_0x5821dd));_0x273edc(_0x5821dd);})['catch'](function(_0x2b3224){logger['error'](_0xed68('0x24'),_0x2b3224[_0xed68('0x16')],_0xd66dc1);_0x54e1cf(_0x961be2['error'](0x1f4,_0x2b3224[_0xed68('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 7baf177..463257c 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 _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 +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x35c6ba,_0x3b14c2){var _0x536ae7=function(_0xa042f0){while(--_0xa042f0){_0x35c6ba['push'](_0x35c6ba['shift']());}};_0x536ae7(++_0x3b14c2);}(_0xe706,0xa3));var _0x6e70=function(_0x3a41a8,_0x1e25b9){_0x3a41a8=_0x3a41a8-0x0;var _0x19dfeb=_0xe706[_0x3a41a8];return _0x19dfeb;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0xa')](_0x6e70('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6e70('0xa')](_0x6e70('0x14'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x6e70('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6e70('0x19')]);router[_0x6e70('0x1a')]('/:id',auth[_0x6e70('0xb')](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 9d235bd..a4ee20c 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 _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 +var _0x3ba6=['exports','STRING','sequelize'];(function(_0x301efe,_0x338d14){var _0x5d44c3=function(_0x10a315){while(--_0x10a315){_0x301efe['push'](_0x301efe['shift']());}};_0x5d44c3(++_0x338d14);}(_0x3ba6,0x149));var _0x63ba=function(_0x5cc8,_0x1faa02){_0x5cc8=_0x5cc8-0x0;var _0x450661=_0x3ba6[_0x5cc8];return _0x450661;};'use strict';var Sequelize=require(_0x63ba('0x0'));module[_0x63ba('0x1')]={'name':{'type':Sequelize[_0x63ba('0x2')]},'description':{'type':Sequelize[_0x63ba('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 98a0b79..3e90a0f 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 _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 +var _0xc935=['then','destroy','error','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','getFields','findOne','pick','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update'];(function(_0xc6063,_0x19a7a4){var _0x7e8d5c=function(_0x1d0d77){while(--_0x1d0d77){_0xc6063['push'](_0xc6063['shift']());}};_0x7e8d5c(++_0x19a7a4);}(_0xc935,0x86));var _0x5c93=function(_0x38642c,_0x45a9b6){_0x38642c=_0x38642c-0x0;var _0x1d7856=_0xc935[_0x38642c];return _0x1d7856;};'use strict';var emlformat=require(_0x5c93('0x0'));var rimraf=require(_0x5c93('0x1'));var zipdir=require(_0x5c93('0x2'));var jsonpatch=require(_0x5c93('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5c93('0x4'));var Mustache=require(_0x5c93('0x5'));var util=require(_0x5c93('0x6'));var path=require(_0x5c93('0x7'));var sox=require(_0x5c93('0x8'));var csv=require('to-csv');var ejs=require(_0x5c93('0x9'));var fs=require('fs');var fs_extra=require(_0x5c93('0xa'));var _=require(_0x5c93('0xb'));var squel=require(_0x5c93('0xc'));var crypto=require(_0x5c93('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5c93('0xe'));var toCsv=require(_0x5c93('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5c93('0x10'));var authService=require(_0x5c93('0x11'));var qs=require(_0x5c93('0x12'));var as=require(_0x5c93('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5c93('0x14'));var config=require(_0x5c93('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c93('0x16'))['db'];function respondWithStatusCode(_0x23cd74,_0x5a5cea){_0x5a5cea=_0x5a5cea||0xcc;return function(_0x1cad2e){if(_0x1cad2e){return _0x23cd74[_0x5c93('0x17')](_0x5a5cea);}return _0x23cd74[_0x5c93('0x18')](_0x5a5cea)[_0x5c93('0x19')]();};}function respondWithResult(_0x347e63,_0x8e6005){_0x8e6005=_0x8e6005||0xc8;return function(_0x1b8eb3){if(_0x1b8eb3){return _0x347e63[_0x5c93('0x18')](_0x8e6005)['json'](_0x1b8eb3);}};}function respondWithFilteredResult(_0x1c9a2a,_0x2e4317){return function(_0x2ed860){if(_0x2ed860){var _0x366934=typeof _0x2e4317[_0x5c93('0x1a')]===_0x5c93('0x1b')&&typeof _0x2e4317[_0x5c93('0x1c')]===_0x5c93('0x1b');var _0x201101=_0x2ed860[_0x5c93('0x1d')];var _0x1868c1=_0x366934?0x0:_0x2e4317[_0x5c93('0x1a')];var _0x5aaef1=_0x366934?_0x2ed860['count']:_0x2e4317[_0x5c93('0x1a')]+_0x2e4317[_0x5c93('0x1c')];var _0x4c7ba8;if(_0x5aaef1>=_0x201101){_0x5aaef1=_0x201101;_0x4c7ba8=0xc8;}else{_0x4c7ba8=0xce;}_0x1c9a2a[_0x5c93('0x18')](_0x4c7ba8);return _0x1c9a2a[_0x5c93('0x1e')]('Content-Range',_0x1868c1+'-'+_0x5aaef1+'/'+_0x201101)[_0x5c93('0x1f')](_0x2ed860);}return null;};}function patchUpdates(_0xd121b1){return function(_0x2bcd83){try{jsonpatch[_0x5c93('0x20')](_0x2bcd83,_0xd121b1,!![]);}catch(_0x3fe630){return BPromise[_0x5c93('0x21')](_0x3fe630);}return _0x2bcd83[_0x5c93('0x22')]();};}function saveUpdates(_0x1e2891,_0xbe60c6){return function(_0x4fcff9){if(_0x4fcff9){return _0x4fcff9[_0x5c93('0x23')](_0x1e2891)[_0x5c93('0x24')](function(_0x4f6323){return _0x4f6323;});}return null;};}function removeEntity(_0x34e460,_0x3a971c){return function(_0x4b5a8f){if(_0x4b5a8f){return _0x4b5a8f[_0x5c93('0x25')]()['then'](function(){_0x34e460[_0x5c93('0x18')](0xcc)[_0x5c93('0x19')]();});}};}function handleEntityNotFound(_0x4d53c1,_0x1e2b97){return function(_0x1b57c9){if(!_0x1b57c9){_0x4d53c1[_0x5c93('0x17')](0x194);}return _0x1b57c9;};}function handleError(_0x3d3dda,_0x1cfeef){_0x1cfeef=_0x1cfeef||0x1f4;return function(_0xf76523){logger[_0x5c93('0x26')](_0xf76523['stack']);if(_0xf76523[_0x5c93('0x27')]){delete _0xf76523[_0x5c93('0x27')];}_0x3d3dda[_0x5c93('0x18')](_0x1cfeef)[_0x5c93('0x28')](_0xf76523);};}exports[_0x5c93('0x29')]=function(_0x2a4cef,_0x1df726){var _0x4b6aef={},_0x25ee90={},_0xe11de9={'count':0x0,'rows':[]};var _0xbc966f=_[_0x5c93('0x2a')](db[_0x5c93('0x2b')][_0x5c93('0x2c')],function(_0x5ba338){return{'name':_0x5ba338[_0x5c93('0x2d')],'type':_0x5ba338[_0x5c93('0x2e')][_0x5c93('0x2f')]};});_0x25ee90[_0x5c93('0x30')]=_[_0x5c93('0x2a')](_0xbc966f,_0x5c93('0x27'));_0x25ee90[_0x5c93('0x31')]=_[_0x5c93('0x32')](_0x2a4cef['query']);_0x25ee90['filters']=_[_0x5c93('0x33')](_0x25ee90[_0x5c93('0x30')],_0x25ee90[_0x5c93('0x31')]);_0x4b6aef[_0x5c93('0x34')]=_[_0x5c93('0x33')](_0x25ee90[_0x5c93('0x30')],qs[_0x5c93('0x35')](_0x2a4cef['query']['fields']));_0x4b6aef[_0x5c93('0x34')]=_0x4b6aef[_0x5c93('0x34')][_0x5c93('0x36')]?_0x4b6aef[_0x5c93('0x34')]:_0x25ee90[_0x5c93('0x30')];if(!_0x2a4cef[_0x5c93('0x31')][_0x5c93('0x37')](_0x5c93('0x38'))){_0x4b6aef[_0x5c93('0x1c')]=qs[_0x5c93('0x1c')](_0x2a4cef['query'][_0x5c93('0x1c')]);_0x4b6aef['offset']=qs[_0x5c93('0x1a')](_0x2a4cef[_0x5c93('0x31')]['offset']);}_0x4b6aef[_0x5c93('0x39')]=qs['sort'](_0x2a4cef[_0x5c93('0x31')][_0x5c93('0x3a')]);_0x4b6aef['where']=qs[_0x5c93('0x3b')](_['pick'](_0x2a4cef[_0x5c93('0x31')],_0x25ee90[_0x5c93('0x3b')]),_0xbc966f);if(_0x2a4cef['query'][_0x5c93('0x3c')]){_0x4b6aef[_0x5c93('0x3d')]=_['merge'](_0x4b6aef[_0x5c93('0x3d')],{'$or':_[_0x5c93('0x2a')](_0xbc966f,function(_0x4b0df4){if(_0x4b0df4['type']!==_0x5c93('0x3e')){var _0x266ce4={};_0x266ce4[_0x4b0df4[_0x5c93('0x27')]]={'$like':'%'+_0x2a4cef[_0x5c93('0x31')][_0x5c93('0x3c')]+'%'};return _0x266ce4;}})});}_0x4b6aef=_[_0x5c93('0x3f')]({},_0x4b6aef,_0x2a4cef[_0x5c93('0x40')]);var _0x17423b={'where':_0x4b6aef[_0x5c93('0x3d')]};return db[_0x5c93('0x2b')][_0x5c93('0x1d')](_0x17423b)[_0x5c93('0x24')](function(_0x53603e){_0xe11de9[_0x5c93('0x1d')]=_0x53603e;if(_0x2a4cef['query'][_0x5c93('0x41')]){_0x4b6aef[_0x5c93('0x42')]=[{'all':!![]}];}return db[_0x5c93('0x2b')][_0x5c93('0x43')](_0x4b6aef);})['then'](function(_0x3ff3b1){_0xe11de9[_0x5c93('0x44')]=_0x3ff3b1;return _0xe11de9;})[_0x5c93('0x24')](respondWithFilteredResult(_0x1df726,_0x4b6aef))['catch'](handleError(_0x1df726,null));};exports[_0x5c93('0x45')]=function(_0x7ac9e0,_0x3c61c6){var _0x456103={'raw':![],'where':{'id':_0x7ac9e0['params']['id']}},_0x391f9a={};_0x391f9a[_0x5c93('0x30')]=_['keys'](db['ZendeskConfiguration'][_0x5c93('0x2c')]);_0x391f9a[_0x5c93('0x31')]=_[_0x5c93('0x32')](_0x7ac9e0[_0x5c93('0x31')]);_0x391f9a[_0x5c93('0x3b')]=_[_0x5c93('0x33')](_0x391f9a[_0x5c93('0x30')],_0x391f9a[_0x5c93('0x31')]);_0x456103['attributes']=_[_0x5c93('0x33')](_0x391f9a['model'],qs[_0x5c93('0x35')](_0x7ac9e0[_0x5c93('0x31')]['fields']));_0x456103[_0x5c93('0x34')]=_0x456103['attributes'][_0x5c93('0x36')]?_0x456103[_0x5c93('0x34')]:_0x391f9a['model'];if(_0x7ac9e0[_0x5c93('0x31')]['includeAll']){_0x456103[_0x5c93('0x42')]=[{'all':!![]}];}_0x456103=_['merge']({},_0x456103,_0x7ac9e0['options']);return db[_0x5c93('0x2b')]['find'](_0x456103)[_0x5c93('0x24')](handleEntityNotFound(_0x3c61c6,null))[_0x5c93('0x24')](respondWithResult(_0x3c61c6,null))[_0x5c93('0x46')](handleError(_0x3c61c6,null));};exports['create']=function(_0x50a196,_0x2b82d8){return db[_0x5c93('0x2b')][_0x5c93('0x47')](_0x50a196['body'],{})[_0x5c93('0x24')](respondWithResult(_0x2b82d8,0xc9))[_0x5c93('0x46')](handleError(_0x2b82d8,null));};exports[_0x5c93('0x23')]=function(_0x2f466c,_0x1de6fa){if(_0x2f466c[_0x5c93('0x48')]['id']){delete _0x2f466c['body']['id'];}return db[_0x5c93('0x2b')][_0x5c93('0x49')]({'where':{'id':_0x2f466c[_0x5c93('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1de6fa,null))['then'](saveUpdates(_0x2f466c[_0x5c93('0x48')],null))[_0x5c93('0x24')](respondWithResult(_0x1de6fa,null))[_0x5c93('0x46')](handleError(_0x1de6fa,null));};exports[_0x5c93('0x25')]=function(_0x5dee4e,_0x100c95){return db[_0x5c93('0x2b')]['find']({'where':{'id':_0x5dee4e['params']['id']}})[_0x5c93('0x24')](handleEntityNotFound(_0x100c95,null))[_0x5c93('0x24')](removeEntity(_0x100c95,null))[_0x5c93('0x46')](handleError(_0x100c95,null));};exports[_0x5c93('0x4b')]=function(_0x4c08a0,_0x2b67de,_0x50e9a2){var _0x306b1c={};var _0x8199a1={};var _0xeb880d;var _0x15478f;return db[_0x5c93('0x2b')][_0x5c93('0x4c')]({'where':{'id':_0x4c08a0[_0x5c93('0x4a')]['id']}})[_0x5c93('0x24')](handleEntityNotFound(_0x2b67de,null))[_0x5c93('0x24')](function(_0x3fc3d0){if(_0x3fc3d0){_0xeb880d=_0x3fc3d0;_0x8199a1[_0x5c93('0x30')]=_[_0x5c93('0x32')](db['ZendeskField'][_0x5c93('0x2c')]);_0x8199a1[_0x5c93('0x31')]=_[_0x5c93('0x32')](_0x4c08a0[_0x5c93('0x31')]);_0x8199a1[_0x5c93('0x3b')]=_[_0x5c93('0x33')](_0x8199a1['model'],_0x8199a1['query']);_0x306b1c['attributes']=_[_0x5c93('0x33')](_0x8199a1[_0x5c93('0x30')],qs[_0x5c93('0x35')](_0x4c08a0[_0x5c93('0x31')][_0x5c93('0x35')]));_0x306b1c[_0x5c93('0x34')]=_0x306b1c['attributes'][_0x5c93('0x36')]?_0x306b1c[_0x5c93('0x34')]:_0x8199a1[_0x5c93('0x30')];_0x306b1c['order']=qs[_0x5c93('0x3a')](_0x4c08a0['query'][_0x5c93('0x3a')]);_0x306b1c[_0x5c93('0x3d')]=qs[_0x5c93('0x3b')](_[_0x5c93('0x4d')](_0x4c08a0[_0x5c93('0x31')],_0x8199a1[_0x5c93('0x3b')]));if(_0x4c08a0[_0x5c93('0x31')][_0x5c93('0x3c')]){_0x306b1c[_0x5c93('0x3d')]=_[_0x5c93('0x3f')](_0x306b1c[_0x5c93('0x3d')],{'$or':_[_0x5c93('0x2a')](_0x306b1c['attributes'],function(_0x5ae3b2){var _0x340a99={};_0x340a99[_0x5ae3b2]={'$like':'%'+_0x4c08a0[_0x5c93('0x31')][_0x5c93('0x3c')]+'%'};return _0x340a99;})});}_0x306b1c=_[_0x5c93('0x3f')]({},_0x306b1c,_0x4c08a0[_0x5c93('0x40')]);return _0xeb880d[_0x5c93('0x4b')](_0x306b1c);}})[_0x5c93('0x24')](function(_0x555cf0){if(_0x555cf0){_0x15478f=_0x555cf0['length'];if(!_0x4c08a0[_0x5c93('0x31')][_0x5c93('0x37')](_0x5c93('0x38'))){_0x306b1c[_0x5c93('0x1c')]=qs['limit'](_0x4c08a0['query']['limit']);_0x306b1c[_0x5c93('0x1a')]=qs[_0x5c93('0x1a')](_0x4c08a0[_0x5c93('0x31')][_0x5c93('0x1a')]);}return _0xeb880d[_0x5c93('0x4b')](_0x306b1c);}})['then'](function(_0x26a081){if(_0x26a081){return _0x26a081?{'count':_0x15478f,'rows':_0x26a081}:null;}})[_0x5c93('0x24')](respondWithResult(_0x2b67de,null))['catch'](handleError(_0x2b67de,null));};exports['getSubjects']=function(_0x45e47f,_0x5e6b05,_0x5ec80c){var _0xe16aab={};var _0x191c59={};var _0x21c85a;var _0x50eda0;return db[_0x5c93('0x2b')][_0x5c93('0x4c')]({'where':{'id':_0x45e47f[_0x5c93('0x4a')]['id']}})[_0x5c93('0x24')](handleEntityNotFound(_0x5e6b05,null))[_0x5c93('0x24')](function(_0x58a54e){if(_0x58a54e){_0x21c85a=_0x58a54e;_0x191c59['model']=_['keys'](db[_0x5c93('0x4e')][_0x5c93('0x2c')]);_0x191c59[_0x5c93('0x31')]=_[_0x5c93('0x32')](_0x45e47f[_0x5c93('0x31')]);_0x191c59[_0x5c93('0x3b')]=_[_0x5c93('0x33')](_0x191c59['model'],_0x191c59[_0x5c93('0x31')]);_0xe16aab[_0x5c93('0x34')]=_[_0x5c93('0x33')](_0x191c59[_0x5c93('0x30')],qs[_0x5c93('0x35')](_0x45e47f[_0x5c93('0x31')]['fields']));_0xe16aab[_0x5c93('0x34')]=_0xe16aab[_0x5c93('0x34')]['length']?_0xe16aab[_0x5c93('0x34')]:_0x191c59['model'];_0xe16aab['order']=qs['sort'](_0x45e47f[_0x5c93('0x31')]['sort']);_0xe16aab[_0x5c93('0x3d')]=qs[_0x5c93('0x3b')](_[_0x5c93('0x4d')](_0x45e47f['query'],_0x191c59[_0x5c93('0x3b')]));if(_0x45e47f['query']['filter']){_0xe16aab[_0x5c93('0x3d')]=_[_0x5c93('0x3f')](_0xe16aab[_0x5c93('0x3d')],{'$or':_[_0x5c93('0x2a')](_0xe16aab['attributes'],function(_0x25b102){var _0x50cb8c={};_0x50cb8c[_0x25b102]={'$like':'%'+_0x45e47f[_0x5c93('0x31')][_0x5c93('0x3c')]+'%'};return _0x50cb8c;})});}_0xe16aab=_['merge']({},_0xe16aab,_0x45e47f[_0x5c93('0x40')]);return _0x21c85a[_0x5c93('0x4f')](_0xe16aab);}})[_0x5c93('0x24')](function(_0x5673d9){if(_0x5673d9){_0x50eda0=_0x5673d9['length'];if(!_0x45e47f['query'][_0x5c93('0x37')](_0x5c93('0x38'))){_0xe16aab['limit']=qs['limit'](_0x45e47f['query'][_0x5c93('0x1c')]);_0xe16aab[_0x5c93('0x1a')]=qs['offset'](_0x45e47f['query'][_0x5c93('0x1a')]);}return _0x21c85a[_0x5c93('0x4f')](_0xe16aab);}})['then'](function(_0x6ecc36){if(_0x6ecc36){return _0x6ecc36?{'count':_0x50eda0,'rows':_0x6ecc36}:null;}})[_0x5c93('0x24')](respondWithResult(_0x5e6b05,null))['catch'](handleError(_0x5e6b05,null));};exports['getDescriptions']=function(_0x2115c4,_0x16cc18,_0x726207){var _0x224181={};var _0x181b2b={};var _0x3db44c;var _0x1c5f42;return db[_0x5c93('0x2b')][_0x5c93('0x4c')]({'where':{'id':_0x2115c4[_0x5c93('0x4a')]['id']}})['then'](handleEntityNotFound(_0x16cc18,null))[_0x5c93('0x24')](function(_0x3376a1){if(_0x3376a1){_0x3db44c=_0x3376a1;_0x181b2b[_0x5c93('0x30')]=_['keys'](db[_0x5c93('0x4e')][_0x5c93('0x2c')]);_0x181b2b['query']=_[_0x5c93('0x32')](_0x2115c4['query']);_0x181b2b['filters']=_[_0x5c93('0x33')](_0x181b2b[_0x5c93('0x30')],_0x181b2b[_0x5c93('0x31')]);_0x224181[_0x5c93('0x34')]=_['intersection'](_0x181b2b['model'],qs[_0x5c93('0x35')](_0x2115c4['query'][_0x5c93('0x35')]));_0x224181['attributes']=_0x224181[_0x5c93('0x34')][_0x5c93('0x36')]?_0x224181[_0x5c93('0x34')]:_0x181b2b[_0x5c93('0x30')];_0x224181[_0x5c93('0x39')]=qs['sort'](_0x2115c4[_0x5c93('0x31')][_0x5c93('0x3a')]);_0x224181['where']=qs[_0x5c93('0x3b')](_[_0x5c93('0x4d')](_0x2115c4['query'],_0x181b2b[_0x5c93('0x3b')]));if(_0x2115c4[_0x5c93('0x31')][_0x5c93('0x3c')]){_0x224181['where']=_[_0x5c93('0x3f')](_0x224181[_0x5c93('0x3d')],{'$or':_[_0x5c93('0x2a')](_0x224181[_0x5c93('0x34')],function(_0x5f45cc){var _0x3b5423={};_0x3b5423[_0x5f45cc]={'$like':'%'+_0x2115c4['query']['filter']+'%'};return _0x3b5423;})});}_0x224181=_['merge']({},_0x224181,_0x2115c4[_0x5c93('0x40')]);return _0x3db44c['getDescriptions'](_0x224181);}})[_0x5c93('0x24')](function(_0x2b4590){if(_0x2b4590){_0x1c5f42=_0x2b4590['length'];if(!_0x2115c4[_0x5c93('0x31')]['hasOwnProperty'](_0x5c93('0x38'))){_0x224181['limit']=qs[_0x5c93('0x1c')](_0x2115c4[_0x5c93('0x31')][_0x5c93('0x1c')]);_0x224181[_0x5c93('0x1a')]=qs[_0x5c93('0x1a')](_0x2115c4[_0x5c93('0x31')][_0x5c93('0x1a')]);}return _0x3db44c[_0x5c93('0x50')](_0x224181);}})[_0x5c93('0x24')](function(_0xa898aa){if(_0xa898aa){return _0xa898aa?{'count':_0x1c5f42,'rows':_0xa898aa}:null;}})[_0x5c93('0x24')](respondWithResult(_0x16cc18,null))[_0x5c93('0x46')](handleError(_0x16cc18,null));};exports[_0x5c93('0x51')]=function(_0xed4445,_0x50f6b7,_0x575dea){var _0x15c0d2={};var _0x575844={};var _0x3e9c36;var _0x325ad2;return db[_0x5c93('0x2b')][_0x5c93('0x4c')]({'where':{'id':_0xed4445[_0x5c93('0x4a')]['id']}})[_0x5c93('0x24')](handleEntityNotFound(_0x50f6b7,null))[_0x5c93('0x24')](function(_0x14e2e9){if(_0x14e2e9){_0x3e9c36=_0x14e2e9;_0x575844[_0x5c93('0x30')]=_['keys'](db[_0x5c93('0x52')][_0x5c93('0x2c')]);_0x575844[_0x5c93('0x31')]=_[_0x5c93('0x32')](_0xed4445['query']);_0x575844[_0x5c93('0x3b')]=_['intersection'](_0x575844[_0x5c93('0x30')],_0x575844[_0x5c93('0x31')]);_0x15c0d2[_0x5c93('0x34')]=_['intersection'](_0x575844[_0x5c93('0x30')],qs[_0x5c93('0x35')](_0xed4445[_0x5c93('0x31')][_0x5c93('0x35')]));_0x15c0d2[_0x5c93('0x34')]=_0x15c0d2[_0x5c93('0x34')]['length']?_0x15c0d2[_0x5c93('0x34')]:_0x575844[_0x5c93('0x30')];_0x15c0d2[_0x5c93('0x39')]=qs[_0x5c93('0x3a')](_0xed4445[_0x5c93('0x31')][_0x5c93('0x3a')]);_0x15c0d2[_0x5c93('0x3d')]=qs[_0x5c93('0x3b')](_[_0x5c93('0x4d')](_0xed4445['query'],_0x575844[_0x5c93('0x3b')]));if(_0xed4445[_0x5c93('0x31')]['filter']){_0x15c0d2[_0x5c93('0x3d')]=_['merge'](_0x15c0d2[_0x5c93('0x3d')],{'$or':_[_0x5c93('0x2a')](_0x15c0d2[_0x5c93('0x34')],function(_0x283073){var _0x17cf72={};_0x17cf72[_0x283073]={'$like':'%'+_0xed4445[_0x5c93('0x31')][_0x5c93('0x3c')]+'%'};return _0x17cf72;})});}_0x15c0d2=_['merge']({},_0x15c0d2,_0xed4445[_0x5c93('0x40')]);return _0x3e9c36[_0x5c93('0x51')](_0x15c0d2);}})[_0x5c93('0x24')](function(_0x399c4d){if(_0x399c4d){_0x325ad2=_0x399c4d[_0x5c93('0x36')];if(!_0xed4445['query']['hasOwnProperty'](_0x5c93('0x38'))){_0x15c0d2[_0x5c93('0x1c')]=qs[_0x5c93('0x1c')](_0xed4445[_0x5c93('0x31')][_0x5c93('0x1c')]);_0x15c0d2[_0x5c93('0x1a')]=qs['offset'](_0xed4445[_0x5c93('0x31')]['offset']);}return _0x3e9c36[_0x5c93('0x51')](_0x15c0d2);}})[_0x5c93('0x24')](function(_0x6f35a6){if(_0x6f35a6){return _0x6f35a6?{'count':_0x325ad2,'rows':_0x6f35a6}:null;}})[_0x5c93('0x24')](respondWithResult(_0x50f6b7,null))['catch'](handleError(_0x50f6b7,null));};exports['setTags']=function(_0x2ad357,_0x5ba459,_0x5e1728){if(_0x2ad357[_0x5c93('0x48')]['id']){delete _0x2ad357[_0x5c93('0x48')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x2ad357['params']['id']}})[_0x5c93('0x24')](handleEntityNotFound(_0x5ba459,null))[_0x5c93('0x24')](function(_0x4ee3d2){if(_0x4ee3d2){return _0x4ee3d2[_0x5c93('0x53')](_0x2ad357[_0x5c93('0x48')][_0x5c93('0x54')]||[]);}return null;})['then'](respondWithResult(_0x5ba459,null))[_0x5c93('0x46')](handleError(_0x5ba459,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 3462394..1c982b7 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 _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 +var _0xcf66=['exports','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment'];(function(_0x41b84d,_0x27eae4){var _0x11a430=function(_0x530db9){while(--_0x530db9){_0x41b84d['push'](_0x41b84d['shift']());}};_0x11a430(++_0x27eae4);}(_0xcf66,0x71));var _0x6cf6=function(_0x33c4e0,_0x1a2316){_0x33c4e0=_0x33c4e0-0x0;var _0x538f7f=_0xcf66[_0x33c4e0];return _0x538f7f;};'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('./intZendeskConfiguration.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 diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index cb5d298..cd7eb00 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 _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 +var _0x3e1c=['request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x3d54fa,_0x2233ab){var _0x558c68=function(_0x3f8298){while(--_0x3f8298){_0x3d54fa['push'](_0x3d54fa['shift']());}};_0x558c68(++_0x2233ab);}(_0x3e1c,0x109));var _0xc3e1=function(_0x277837,_0x507214){_0x277837=_0x277837-0x0;var _0x1839aa=_0x3e1c[_0x277837];return _0x1839aa;};'use strict';var _=require(_0xc3e1('0x0'));var util=require('util');var moment=require(_0xc3e1('0x1'));var BPromise=require(_0xc3e1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3e1('0x3'));var db=require(_0xc3e1('0x4'))['db'];var utils=require(_0xc3e1('0x5'));var logger=require(_0xc3e1('0x6'))(_0xc3e1('0x7'));var config=require('../../config/environment');var jayson=require(_0xc3e1('0x8'));var client=jayson[_0xc3e1('0x9')][_0xc3e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32517f,_0x2a4e9a,_0x275bf6){return new BPromise(function(_0x392152,_0x3870c6){return client[_0xc3e1('0xb')](_0x32517f,_0x275bf6)[_0xc3e1('0xc')](function(_0x35bccb){logger[_0xc3e1('0xd')](_0xc3e1('0xe'),_0x2a4e9a,_0xc3e1('0xf'));logger['debug'](_0xc3e1('0x10'),_0x2a4e9a,_0xc3e1('0xf'),JSON[_0xc3e1('0x11')](_0x35bccb));if(_0x35bccb[_0xc3e1('0x12')]){if(_0x35bccb[_0xc3e1('0x12')][_0xc3e1('0x13')]===0x1f4){logger[_0xc3e1('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2a4e9a,_0x35bccb[_0xc3e1('0x12')][_0xc3e1('0x14')]);return _0x3870c6(_0x35bccb['error']['message']);}logger[_0xc3e1('0x12')](_0xc3e1('0xe'),_0x2a4e9a,_0x35bccb[_0xc3e1('0x12')][_0xc3e1('0x14')]);return _0x392152(_0x35bccb[_0xc3e1('0x12')][_0xc3e1('0x14')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x2a4e9a,_0xc3e1('0xf'));_0x392152(_0x35bccb[_0xc3e1('0x15')][_0xc3e1('0x14')]);}})[_0xc3e1('0x16')](function(_0x5f52f9){logger[_0xc3e1('0x12')](_0xc3e1('0xe'),_0x2a4e9a,_0x5f52f9);_0x3870c6(_0x5f52f9);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index c778cb8..0deffff 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 _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 +var _0x297f=['./intZendeskField.controller','get','isAuthenticated','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x9fc5a2,_0x46c38f){var _0x10a4a8=function(_0x2aeef2){while(--_0x2aeef2){_0x9fc5a2['push'](_0x9fc5a2['shift']());}};_0x10a4a8(++_0x46c38f);}(_0x297f,0x109));var _0xf297=function(_0x3bab99,_0x1f9d50){_0x3bab99=_0x3bab99-0x0;var _0x4ed763=_0x297f[_0x3bab99];return _0x4ed763;};'use strict';var multer=require(_0xf297('0x0'));var util=require(_0xf297('0x1'));var path=require(_0xf297('0x2'));var timeout=require(_0xf297('0x3'));var express=require('express');var router=express[_0xf297('0x4')]();var fs_extra=require(_0xf297('0x5'));var auth=require(_0xf297('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf297('0x7'));router[_0xf297('0x8')]('/',auth[_0xf297('0x9')](),controller['index']);router['get'](_0xf297('0xa'),auth[_0xf297('0x9')](),controller['show']);router[_0xf297('0xb')]('/',auth['isAuthenticated'](),controller[_0xf297('0xc')]);router[_0xf297('0xd')](_0xf297('0xa'),auth[_0xf297('0x9')](),controller['update']);router[_0xf297('0xe')](_0xf297('0xa'),auth[_0xf297('0x9')](),controller[_0xf297('0xf')]);module[_0xf297('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 66c1001..fd5ab72 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 _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 +var _0x08cb=['STRING','ENUM','customVariable','sequelize','string','variable','keyValue','picklist'];(function(_0x3d5faf,_0x3ea010){var _0x267cb2=function(_0x424e31){while(--_0x424e31){_0x3d5faf['push'](_0x3d5faf['shift']());}};_0x267cb2(++_0x3ea010);}(_0x08cb,0xb3));var _0xb08c=function(_0x3725cd,_0x362c4c){_0x3725cd=_0x3725cd-0x0;var _0x1bd753=_0x08cb[_0x3725cd];return _0x1bd753;};'use strict';var Sequelize=require(_0xb08c('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xb08c('0x1'),_0xb08c('0x2'),'customVariable',_0xb08c('0x3'),_0xb08c('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xb08c('0x5')]},'key':{'type':Sequelize[_0xb08c('0x5')]},'keyType':{'type':Sequelize[_0xb08c('0x6')]('string',_0xb08c('0x2'),_0xb08c('0x7'))},'keyContent':{'type':Sequelize[_0xb08c('0x5')]},'idField':{'type':Sequelize[_0xb08c('0x5')]},'nameField':{'type':Sequelize[_0xb08c('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'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 fee1a5d..066f83e 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 _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 +var _0x5293=['apply','reject','save','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ZendeskField','rows','catch','show','params','length','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit'];(function(_0x2bb9b3,_0x1d2c25){var _0x601b6=function(_0x4f8d09){while(--_0x4f8d09){_0x2bb9b3['push'](_0x2bb9b3['shift']());}};_0x601b6(++_0x1d2c25);}(_0x5293,0xb7));var _0x3529=function(_0xa2b098,_0x461a08){_0xa2b098=_0xa2b098-0x0;var _0x29502e=_0x5293[_0xa2b098];return _0x29502e;};'use strict';var emlformat=require(_0x3529('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3529('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3529('0x2'));var moment=require(_0x3529('0x3'));var BPromise=require(_0x3529('0x4'));var Mustache=require(_0x3529('0x5'));var util=require(_0x3529('0x6'));var path=require(_0x3529('0x7'));var sox=require('sox');var csv=require(_0x3529('0x8'));var ejs=require(_0x3529('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3529('0xa'));var squel=require(_0x3529('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3529('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3529('0xd'));var Papa=require('papaparse');var Redis=require(_0x3529('0xe'));var authService=require(_0x3529('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3529('0x10'));var hardwareService=require(_0x3529('0x11'));var logger=require('../../config/logger')(_0x3529('0x12'));var utils=require(_0x3529('0x13'));var config=require(_0x3529('0x14'));var licenseUtil=require(_0x3529('0x15'));var db=require(_0x3529('0x16'))['db'];function respondWithStatusCode(_0x2b8fc4,_0x11b1f0){_0x11b1f0=_0x11b1f0||0xcc;return function(_0x3c01cd){if(_0x3c01cd){return _0x2b8fc4[_0x3529('0x17')](_0x11b1f0);}return _0x2b8fc4[_0x3529('0x18')](_0x11b1f0)[_0x3529('0x19')]();};}function respondWithResult(_0x4d58e1,_0x22b7e3){_0x22b7e3=_0x22b7e3||0xc8;return function(_0x2c4fb7){if(_0x2c4fb7){return _0x4d58e1[_0x3529('0x18')](_0x22b7e3)[_0x3529('0x1a')](_0x2c4fb7);}};}function respondWithFilteredResult(_0x2af29d,_0x5d2ea4){return function(_0x5c55ef){if(_0x5c55ef){var _0x35caed=typeof _0x5d2ea4[_0x3529('0x1b')]==='undefined'&&typeof _0x5d2ea4['limit']==='undefined';var _0x30be7f=_0x5c55ef['count'];var _0x449e64=_0x35caed?0x0:_0x5d2ea4[_0x3529('0x1b')];var _0x2d4c44=_0x35caed?_0x5c55ef[_0x3529('0x1c')]:_0x5d2ea4[_0x3529('0x1b')]+_0x5d2ea4[_0x3529('0x1d')];var _0x147977;if(_0x2d4c44>=_0x30be7f){_0x2d4c44=_0x30be7f;_0x147977=0xc8;}else{_0x147977=0xce;}_0x2af29d[_0x3529('0x18')](_0x147977);return _0x2af29d['set']('Content-Range',_0x449e64+'-'+_0x2d4c44+'/'+_0x30be7f)['json'](_0x5c55ef);}return null;};}function patchUpdates(_0x1c42d9){return function(_0x3e1ecb){try{jsonpatch[_0x3529('0x1e')](_0x3e1ecb,_0x1c42d9,!![]);}catch(_0x3f72f8){return BPromise[_0x3529('0x1f')](_0x3f72f8);}return _0x3e1ecb[_0x3529('0x20')]();};}function saveUpdates(_0x3ac68a,_0x2514fa){return function(_0x327782){if(_0x327782){return _0x327782['update'](_0x3ac68a)[_0x3529('0x21')](function(_0x473ead){return _0x473ead;});}return null;};}function removeEntity(_0x536880,_0x165eea){return function(_0x5ba979){if(_0x5ba979){return _0x5ba979[_0x3529('0x22')]()['then'](function(){_0x536880[_0x3529('0x18')](0xcc)[_0x3529('0x19')]();});}};}function handleEntityNotFound(_0x5b35b1,_0x35db44){return function(_0x554db8){if(!_0x554db8){_0x5b35b1[_0x3529('0x17')](0x194);}return _0x554db8;};}function handleError(_0x1069bf,_0x28436d){_0x28436d=_0x28436d||0x1f4;return function(_0x3764c5){logger[_0x3529('0x23')](_0x3764c5[_0x3529('0x24')]);if(_0x3764c5[_0x3529('0x25')]){delete _0x3764c5['name'];}_0x1069bf[_0x3529('0x18')](_0x28436d)['send'](_0x3764c5);};}exports[_0x3529('0x26')]=function(_0x8311c0,_0x163ed6){var _0xb15c91={},_0x1d2422={},_0x2ce13e={'count':0x0,'rows':[]};var _0x2f972f=_[_0x3529('0x27')](db['ZendeskField'][_0x3529('0x28')],function(_0x336be0){return{'name':_0x336be0[_0x3529('0x29')],'type':_0x336be0[_0x3529('0x2a')][_0x3529('0x2b')]};});_0x1d2422[_0x3529('0x2c')]=_[_0x3529('0x27')](_0x2f972f,_0x3529('0x25'));_0x1d2422['query']=_[_0x3529('0x2d')](_0x8311c0[_0x3529('0x2e')]);_0x1d2422[_0x3529('0x2f')]=_['intersection'](_0x1d2422[_0x3529('0x2c')],_0x1d2422[_0x3529('0x2e')]);_0xb15c91[_0x3529('0x30')]=_[_0x3529('0x31')](_0x1d2422[_0x3529('0x2c')],qs['fields'](_0x8311c0[_0x3529('0x2e')][_0x3529('0x32')]));_0xb15c91['attributes']=_0xb15c91[_0x3529('0x30')]['length']?_0xb15c91[_0x3529('0x30')]:_0x1d2422[_0x3529('0x2c')];if(!_0x8311c0[_0x3529('0x2e')][_0x3529('0x33')]('nolimit')){_0xb15c91['limit']=qs[_0x3529('0x1d')](_0x8311c0['query'][_0x3529('0x1d')]);_0xb15c91[_0x3529('0x1b')]=qs['offset'](_0x8311c0[_0x3529('0x2e')][_0x3529('0x1b')]);}_0xb15c91[_0x3529('0x34')]=qs[_0x3529('0x35')](_0x8311c0[_0x3529('0x2e')][_0x3529('0x35')]);_0xb15c91[_0x3529('0x36')]=qs[_0x3529('0x2f')](_[_0x3529('0x37')](_0x8311c0[_0x3529('0x2e')],_0x1d2422[_0x3529('0x2f')]),_0x2f972f);if(_0x8311c0[_0x3529('0x2e')][_0x3529('0x38')]){_0xb15c91[_0x3529('0x36')]=_[_0x3529('0x39')](_0xb15c91['where'],{'$or':_[_0x3529('0x27')](_0x2f972f,function(_0x7c929b){if(_0x7c929b[_0x3529('0x2a')]!==_0x3529('0x3a')){var _0x3c59e3={};_0x3c59e3[_0x7c929b[_0x3529('0x25')]]={'$like':'%'+_0x8311c0[_0x3529('0x2e')][_0x3529('0x38')]+'%'};return _0x3c59e3;}})});}_0xb15c91=_['merge']({},_0xb15c91,_0x8311c0[_0x3529('0x3b')]);var _0x116c1e={'where':_0xb15c91[_0x3529('0x36')]};return db['ZendeskField'][_0x3529('0x1c')](_0x116c1e)[_0x3529('0x21')](function(_0x4794d8){_0x2ce13e[_0x3529('0x1c')]=_0x4794d8;if(_0x8311c0['query'][_0x3529('0x3c')]){_0xb15c91[_0x3529('0x3d')]=[{'all':!![]}];}return db[_0x3529('0x3e')]['findAll'](_0xb15c91);})['then'](function(_0x363e5c){_0x2ce13e[_0x3529('0x3f')]=_0x363e5c;return _0x2ce13e;})[_0x3529('0x21')](respondWithFilteredResult(_0x163ed6,_0xb15c91))[_0x3529('0x40')](handleError(_0x163ed6,null));};exports[_0x3529('0x41')]=function(_0x274423,_0x4af4ff){var _0x274c05={'raw':!![],'where':{'id':_0x274423[_0x3529('0x42')]['id']}},_0x58550b={};_0x58550b[_0x3529('0x2c')]=_[_0x3529('0x2d')](db[_0x3529('0x3e')][_0x3529('0x28')]);_0x58550b['query']=_['keys'](_0x274423[_0x3529('0x2e')]);_0x58550b[_0x3529('0x2f')]=_['intersection'](_0x58550b[_0x3529('0x2c')],_0x58550b[_0x3529('0x2e')]);_0x274c05[_0x3529('0x30')]=_[_0x3529('0x31')](_0x58550b[_0x3529('0x2c')],qs['fields'](_0x274423[_0x3529('0x2e')][_0x3529('0x32')]));_0x274c05['attributes']=_0x274c05[_0x3529('0x30')][_0x3529('0x43')]?_0x274c05['attributes']:_0x58550b[_0x3529('0x2c')];if(_0x274423['query'][_0x3529('0x3c')]){_0x274c05[_0x3529('0x3d')]=[{'all':!![]}];}_0x274c05=_[_0x3529('0x39')]({},_0x274c05,_0x274423[_0x3529('0x3b')]);return db[_0x3529('0x3e')][_0x3529('0x44')](_0x274c05)[_0x3529('0x21')](handleEntityNotFound(_0x4af4ff,null))[_0x3529('0x21')](respondWithResult(_0x4af4ff,null))['catch'](handleError(_0x4af4ff,null));};exports[_0x3529('0x45')]=function(_0x5c64ff,_0x522ba9){return db[_0x3529('0x3e')]['create'](_0x5c64ff[_0x3529('0x46')],{})['then'](respondWithResult(_0x522ba9,0xc9))[_0x3529('0x40')](handleError(_0x522ba9,null));};exports['update']=function(_0x2fe509,_0x567409){if(_0x2fe509[_0x3529('0x46')]['id']){delete _0x2fe509['body']['id'];}return db['ZendeskField'][_0x3529('0x44')]({'where':{'id':_0x2fe509['params']['id']}})[_0x3529('0x21')](handleEntityNotFound(_0x567409,null))['then'](saveUpdates(_0x2fe509['body'],null))[_0x3529('0x21')](respondWithResult(_0x567409,null))[_0x3529('0x40')](handleError(_0x567409,null));};exports[_0x3529('0x22')]=function(_0x5c1523,_0x389977){return db[_0x3529('0x3e')][_0x3529('0x44')]({'where':{'id':_0x5c1523[_0x3529('0x42')]['id']}})[_0x3529('0x21')](handleEntityNotFound(_0x389977,null))[_0x3529('0x21')](removeEntity(_0x389977,null))[_0x3529('0x40')](handleError(_0x389977,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 9ace6ce..fd78497 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 _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 +var _0x4743=['api','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash'];(function(_0x188fcc,_0x47c0e5){var _0x21fdd5=function(_0x4f0630){while(--_0x4f0630){_0x188fcc['push'](_0x188fcc['shift']());}};_0x21fdd5(++_0x47c0e5);}(_0x4743,0x9b));var _0x3474=function(_0x5d0b60,_0x40a2fa){_0x5d0b60=_0x5d0b60-0x0;var _0x2263dc=_0x4743[_0x5d0b60];return _0x2263dc;};'use strict';var _=require(_0x3474('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3474('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3474('0x2'));var fs=require('fs');var path=require(_0x3474('0x3'));var rimraf=require(_0x3474('0x4'));var config=require(_0x3474('0x5'));var attributes=require(_0x3474('0x6'));module['exports']=function(_0x2eac4b,_0x455d86){return _0x2eac4b[_0x3474('0x7')](_0x3474('0x8'),attributes,{'tableName':_0x3474('0x9'),'paranoid':![],'indexes':[{'name':_0x3474('0xa'),'fields':[_0x3474('0xb'),_0x3474('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 5eb5be0..9966330 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 _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 +var _0x35b9=['ioredis','../../config/logger','jayson/promise','http','request','info','request\x20sent','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0xcfe8cc,_0xb83aeb){var _0x55ac53=function(_0x4067d4){while(--_0x4067d4){_0xcfe8cc['push'](_0xcfe8cc['shift']());}};_0x55ac53(++_0xb83aeb);}(_0x35b9,0xe6));var _0x935b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x35b9[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x935b('0x0'));var util=require(_0x935b('0x1'));var moment=require('moment');var BPromise=require(_0x935b('0x2'));var rs=require(_0x935b('0x3'));var fs=require('fs');var Redis=require(_0x935b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x935b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x935b('0x6'));var client=jayson['client'][_0x935b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x313d35,_0x4b8f45,_0x54e95e){return new BPromise(function(_0x46fcc4,_0x1dfda3){return client[_0x935b('0x8')](_0x313d35,_0x54e95e)['then'](function(_0x48db0f){logger[_0x935b('0x9')]('ZendeskField,\x20%s,\x20%s',_0x4b8f45,'request\x20sent');logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x4b8f45,_0x935b('0xa'),JSON[_0x935b('0xb')](_0x48db0f));if(_0x48db0f[_0x935b('0xc')]){if(_0x48db0f['error'][_0x935b('0xd')]===0x1f4){logger[_0x935b('0xc')](_0x935b('0xe'),_0x4b8f45,_0x48db0f[_0x935b('0xc')][_0x935b('0xf')]);return _0x1dfda3(_0x48db0f[_0x935b('0xc')][_0x935b('0xf')]);}logger[_0x935b('0xc')](_0x935b('0xe'),_0x4b8f45,_0x48db0f[_0x935b('0xc')]['message']);return _0x46fcc4(_0x48db0f[_0x935b('0xc')]['message']);}else{logger[_0x935b('0x9')](_0x935b('0xe'),_0x4b8f45,_0x935b('0xa'));_0x46fcc4(_0x48db0f[_0x935b('0x10')][_0x935b('0xf')]);}})[_0x935b('0x11')](function(_0x1a26ae){logger[_0x935b('0xc')]('ZendeskField,\x20%s,\x20%s',_0x4b8f45,_0x1a26ae);_0x1dfda3(_0x1a26ae);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 4536b86..841e35f 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 _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 +var _0xf333=['put','/:id','update','delete','destroy','multer','path','express','Router','../../components/auth/service','./intZohoAccount.controller','get','isAuthenticated','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xf333,0x1cd));var _0x3f33=function(_0x30d72c,_0x22cf93){_0x30d72c=_0x30d72c-0x0;var _0x18ecc2=_0xf333[_0x30d72c];return _0x18ecc2;};'use strict';var multer=require(_0x3f33('0x0'));var util=require('util');var path=require(_0x3f33('0x1'));var timeout=require('connect-timeout');var express=require(_0x3f33('0x2'));var router=express[_0x3f33('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3f33('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3f33('0x5'));router[_0x3f33('0x6')]('/',auth[_0x3f33('0x7')](),controller['index']);router[_0x3f33('0x6')]('/:id',auth[_0x3f33('0x7')](),controller['show']);router['get']('/:id/configurations',auth[_0x3f33('0x7')](),controller['getConfigurations']);router['get'](_0x3f33('0x8'),auth['isAuthenticated'](),controller[_0x3f33('0x9')]);router[_0x3f33('0xa')]('/',auth['isAuthenticated'](),controller[_0x3f33('0xb')]);router[_0x3f33('0xa')](_0x3f33('0xc'),auth['isAuthenticated'](),controller[_0x3f33('0xd')]);router[_0x3f33('0xe')](_0x3f33('0xf'),auth['isAuthenticated'](),controller[_0x3f33('0x10')]);router[_0x3f33('0x11')](_0x3f33('0xf'),auth[_0x3f33('0x7')](),controller[_0x3f33('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 15c4b00..d9a6303 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 _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 +var _0x153f=['exports','STRING','sequelize'];(function(_0x2e3107,_0x25f970){var _0x833d69=function(_0x420e78){while(--_0x420e78){_0x2e3107['push'](_0x2e3107['shift']());}};_0x833d69(++_0x25f970);}(_0x153f,0x15b));var _0xf153=function(_0x3174b1,_0x3d1013){_0x3174b1=_0x3174b1-0x0;var _0x3b5f8a=_0x153f[_0x3174b1];return _0x3b5f8a;};'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 d5ac3de..5ae63ba 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 _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 +var _0x82a0=['test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','then','destroy','error','name','index','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','ZohoAccount','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','getConfigurations','ZohoConfiguration','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','includes','api_name','push','display_label','data_type','picklist','pick_list_values'];(function(_0x4e72ed,_0x570dcd){var _0x313825=function(_0x13ce42){while(--_0x13ce42){_0x4e72ed['push'](_0x4e72ed['shift']());}};_0x313825(++_0x570dcd);}(_0x82a0,0x10a));var _0x082a=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0x82a0[_0x1fa759];return _0x2da9f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x082a('0x0'));var zipdir=require(_0x082a('0x1'));var jsonpatch=require(_0x082a('0x2'));var rp=require(_0x082a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x082a('0x4'));var sox=require(_0x082a('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x082a('0x6'));var _=require(_0x082a('0x7'));var squel=require(_0x082a('0x8'));var crypto=require(_0x082a('0x9'));var jsforce=require(_0x082a('0xa'));var deskjs=require(_0x082a('0xb'));var toCsv=require(_0x082a('0xc'));var querystring=require(_0x082a('0xd'));var Papa=require(_0x082a('0xe'));var Redis=require(_0x082a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x082a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x082a('0x11'));var logger=require(_0x082a('0x12'))(_0x082a('0x13'));var utils=require(_0x082a('0x14'));var config=require(_0x082a('0x15'));var licenseUtil=require(_0x082a('0x16'));var db=require(_0x082a('0x17'))['db'];var integrations=require(_0x082a('0x18'));function respondWithStatusCode(_0x1ecbee,_0x1c1aa2){_0x1c1aa2=_0x1c1aa2||0xcc;return function(_0x3fdce7){if(_0x3fdce7){return _0x1ecbee[_0x082a('0x19')](_0x1c1aa2);}return _0x1ecbee['status'](_0x1c1aa2)['end']();};}function respondWithResult(_0x513680,_0xf69435){_0xf69435=_0xf69435||0xc8;return function(_0x12ff96){if(_0x12ff96){return _0x513680[_0x082a('0x1a')](_0xf69435)[_0x082a('0x1b')](_0x12ff96);}};}function respondWithFilteredResult(_0x38c14d,_0x428272){return function(_0x221f0c){if(_0x221f0c){var _0x39fec8=typeof _0x428272['offset']===_0x082a('0x1c')&&typeof _0x428272[_0x082a('0x1d')]===_0x082a('0x1c');var _0x586b41=_0x221f0c[_0x082a('0x1e')];var _0xf20b71=_0x39fec8?0x0:_0x428272[_0x082a('0x1f')];var _0x62e26b=_0x39fec8?_0x221f0c[_0x082a('0x1e')]:_0x428272[_0x082a('0x1f')]+_0x428272[_0x082a('0x1d')];var _0x2d465d;if(_0x62e26b>=_0x586b41){_0x62e26b=_0x586b41;_0x2d465d=0xc8;}else{_0x2d465d=0xce;}_0x38c14d[_0x082a('0x1a')](_0x2d465d);return _0x38c14d['set']('Content-Range',_0xf20b71+'-'+_0x62e26b+'/'+_0x586b41)[_0x082a('0x1b')](_0x221f0c);}return null;};}function patchUpdates(_0x505a1c){return function(_0x4838d5){try{jsonpatch[_0x082a('0x20')](_0x4838d5,_0x505a1c,!![]);}catch(_0x4070f6){return BPromise[_0x082a('0x21')](_0x4070f6);}return _0x4838d5[_0x082a('0x22')]();};}function saveUpdates(_0x35ec76,_0x5e57d5){return function(_0x4e3902){if(_0x4e3902){return _0x4e3902['update'](_0x35ec76)[_0x082a('0x23')](function(_0x387261){return _0x387261;});}return null;};}function removeEntity(_0xf09c89,_0x1560ed){return function(_0x3a8b3d){if(_0x3a8b3d){return _0x3a8b3d[_0x082a('0x24')]()[_0x082a('0x23')](function(){_0xf09c89[_0x082a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12181e,_0x24027c){return function(_0x476665){if(!_0x476665){_0x12181e[_0x082a('0x19')](0x194);}return _0x476665;};}function handleError(_0x3307d0,_0x5c5ea1){_0x5c5ea1=_0x5c5ea1||0x1f4;return function(_0x5a9974){logger[_0x082a('0x25')](_0x5a9974['stack']);if(_0x5a9974[_0x082a('0x26')]){delete _0x5a9974[_0x082a('0x26')];}_0x3307d0['status'](_0x5c5ea1)['send'](_0x5a9974);};}exports[_0x082a('0x27')]=function(_0x11257d,_0x4b50ff){var _0x441eac={},_0x4875fe={},_0x50e2df={'count':0x0,'rows':[]};var _0x566342=_['map'](db['ZohoAccount'][_0x082a('0x28')],function(_0x555fb8){return{'name':_0x555fb8[_0x082a('0x29')],'type':_0x555fb8[_0x082a('0x2a')]['key']};});_0x4875fe[_0x082a('0x2b')]=_[_0x082a('0x2c')](_0x566342,_0x082a('0x26'));_0x4875fe[_0x082a('0x2d')]=_[_0x082a('0x2e')](_0x11257d[_0x082a('0x2d')]);_0x4875fe[_0x082a('0x2f')]=_['intersection'](_0x4875fe[_0x082a('0x2b')],_0x4875fe[_0x082a('0x2d')]);_0x441eac[_0x082a('0x30')]=_['intersection'](_0x4875fe[_0x082a('0x2b')],qs[_0x082a('0x31')](_0x11257d[_0x082a('0x2d')][_0x082a('0x31')]));_0x441eac['attributes']=_0x441eac['attributes'][_0x082a('0x32')]?_0x441eac[_0x082a('0x30')]:_0x4875fe[_0x082a('0x2b')];if(!_0x11257d[_0x082a('0x2d')][_0x082a('0x33')](_0x082a('0x34'))){_0x441eac[_0x082a('0x1d')]=qs[_0x082a('0x1d')](_0x11257d['query'][_0x082a('0x1d')]);_0x441eac['offset']=qs[_0x082a('0x1f')](_0x11257d[_0x082a('0x2d')][_0x082a('0x1f')]);}_0x441eac[_0x082a('0x35')]=qs[_0x082a('0x36')](_0x11257d[_0x082a('0x2d')][_0x082a('0x36')]);_0x441eac['where']=qs[_0x082a('0x2f')](_[_0x082a('0x37')](_0x11257d[_0x082a('0x2d')],_0x4875fe['filters']),_0x566342);if(_0x11257d[_0x082a('0x2d')]['filter']){_0x441eac[_0x082a('0x38')]=_[_0x082a('0x39')](_0x441eac[_0x082a('0x38')],{'$or':_['map'](_0x566342,function(_0x3e0a2f){if(_0x3e0a2f[_0x082a('0x2a')]!==_0x082a('0x3a')){var _0x2bb9ec={};_0x2bb9ec[_0x3e0a2f[_0x082a('0x26')]]={'$like':'%'+_0x11257d[_0x082a('0x2d')][_0x082a('0x3b')]+'%'};return _0x2bb9ec;}})});}_0x441eac=_[_0x082a('0x39')]({},_0x441eac,_0x11257d[_0x082a('0x3c')]);var _0x46e5ed={'where':_0x441eac[_0x082a('0x38')]};return db[_0x082a('0x3d')]['count'](_0x46e5ed)[_0x082a('0x23')](function(_0x215a5f){_0x50e2df[_0x082a('0x1e')]=_0x215a5f;if(_0x11257d[_0x082a('0x2d')][_0x082a('0x3e')]){_0x441eac[_0x082a('0x3f')]=[{'all':!![]}];}return db[_0x082a('0x3d')][_0x082a('0x40')](_0x441eac);})[_0x082a('0x23')](function(_0x25a4ad){_0x50e2df[_0x082a('0x41')]=_0x25a4ad;return _0x50e2df;})[_0x082a('0x23')](respondWithFilteredResult(_0x4b50ff,_0x441eac))[_0x082a('0x42')](handleError(_0x4b50ff,null));};exports[_0x082a('0x43')]=function(_0x2de743,_0x544867){var _0x1a8fc1={'raw':![],'where':{'id':_0x2de743[_0x082a('0x44')]['id']}},_0xd27510={};_0xd27510[_0x082a('0x2b')]=_[_0x082a('0x2e')](db[_0x082a('0x3d')]['rawAttributes']);_0xd27510[_0x082a('0x2d')]=_['keys'](_0x2de743[_0x082a('0x2d')]);_0xd27510[_0x082a('0x2f')]=_['intersection'](_0xd27510[_0x082a('0x2b')],_0xd27510[_0x082a('0x2d')]);_0x1a8fc1[_0x082a('0x30')]=_['intersection'](_0xd27510['model'],qs['fields'](_0x2de743[_0x082a('0x2d')][_0x082a('0x31')]));_0x1a8fc1['attributes']=_0x1a8fc1[_0x082a('0x30')]['length']?_0x1a8fc1[_0x082a('0x30')]:_0xd27510[_0x082a('0x2b')];if(_0x2de743[_0x082a('0x2d')][_0x082a('0x3e')]){_0x1a8fc1[_0x082a('0x3f')]=[{'all':!![]}];}_0x1a8fc1=_[_0x082a('0x39')]({},_0x1a8fc1,_0x2de743[_0x082a('0x3c')]);return db['ZohoAccount'][_0x082a('0x45')](_0x1a8fc1)[_0x082a('0x23')](handleEntityNotFound(_0x544867,null))['then'](respondWithResult(_0x544867,null))['catch'](handleError(_0x544867,null));};exports[_0x082a('0x46')]=function(_0x56ae61,_0xf959f){return db[_0x082a('0x3d')][_0x082a('0x46')](_0x56ae61[_0x082a('0x47')],{})['then'](respondWithResult(_0xf959f,0xc9))['catch'](handleError(_0xf959f,null));};exports[_0x082a('0x48')]=function(_0x5ae4db,_0x549a18){if(_0x5ae4db[_0x082a('0x47')]['id']){delete _0x5ae4db['body']['id'];}return db[_0x082a('0x3d')]['find']({'where':{'id':_0x5ae4db['params']['id']}})[_0x082a('0x23')](handleEntityNotFound(_0x549a18,null))['then'](saveUpdates(_0x5ae4db[_0x082a('0x47')],null))[_0x082a('0x23')](respondWithResult(_0x549a18,null))[_0x082a('0x42')](handleError(_0x549a18,null));};exports['destroy']=function(_0x4233f8,_0x441bf5){return db[_0x082a('0x3d')][_0x082a('0x45')]({'where':{'id':_0x4233f8[_0x082a('0x44')]['id']}})[_0x082a('0x23')](handleEntityNotFound(_0x441bf5,null))[_0x082a('0x23')](removeEntity(_0x441bf5,null))[_0x082a('0x42')](handleError(_0x441bf5,null));};exports[_0x082a('0x49')]=function(_0x381ff4,_0xff64cf,_0x85482c){var _0x5210b4={};var _0x18ca96={};var _0x269b41;var _0x35b51f;return db[_0x082a('0x3d')]['findOne']({'where':{'id':_0x381ff4['params']['id']}})[_0x082a('0x23')](handleEntityNotFound(_0xff64cf,null))[_0x082a('0x23')](function(_0x1ab537){if(_0x1ab537){_0x269b41=_0x1ab537;_0x18ca96['model']=_[_0x082a('0x2e')](db[_0x082a('0x4a')][_0x082a('0x28')]);_0x18ca96[_0x082a('0x2d')]=_[_0x082a('0x2e')](_0x381ff4['query']);_0x18ca96[_0x082a('0x2f')]=_['intersection'](_0x18ca96['model'],_0x18ca96[_0x082a('0x2d')]);_0x5210b4[_0x082a('0x30')]=_['intersection'](_0x18ca96[_0x082a('0x2b')],qs[_0x082a('0x31')](_0x381ff4['query']['fields']));_0x5210b4[_0x082a('0x30')]=_0x5210b4[_0x082a('0x30')]['length']?_0x5210b4['attributes']:_0x18ca96['model'];_0x5210b4['order']=qs[_0x082a('0x36')](_0x381ff4[_0x082a('0x2d')][_0x082a('0x36')]);_0x5210b4[_0x082a('0x38')]=qs[_0x082a('0x2f')](_[_0x082a('0x37')](_0x381ff4[_0x082a('0x2d')],_0x18ca96[_0x082a('0x2f')]));if(_0x381ff4[_0x082a('0x2d')][_0x082a('0x3b')]){_0x5210b4[_0x082a('0x38')]=_['merge'](_0x5210b4[_0x082a('0x38')],{'$or':_[_0x082a('0x2c')](_0x5210b4[_0x082a('0x30')],function(_0x1504d){var _0x1bde0c={};_0x1bde0c[_0x1504d]={'$like':'%'+_0x381ff4['query'][_0x082a('0x3b')]+'%'};return _0x1bde0c;})});}_0x5210b4=_[_0x082a('0x39')]({},_0x5210b4,_0x381ff4[_0x082a('0x3c')]);return _0x269b41['getConfigurations'](_0x5210b4);}})[_0x082a('0x23')](function(_0x1591f7){if(_0x1591f7){_0x35b51f=_0x1591f7['length'];if(!_0x381ff4[_0x082a('0x2d')][_0x082a('0x33')](_0x082a('0x34'))){_0x5210b4['limit']=qs['limit'](_0x381ff4[_0x082a('0x2d')][_0x082a('0x1d')]);_0x5210b4[_0x082a('0x1f')]=qs['offset'](_0x381ff4[_0x082a('0x2d')][_0x082a('0x1f')]);}return _0x269b41['getConfigurations'](_0x5210b4);}})['then'](function(_0x1da331){if(_0x1da331){return _0x1da331?{'count':_0x35b51f,'rows':_0x1da331}:null;}})['then'](respondWithResult(_0xff64cf,null))[_0x082a('0x42')](handleError(_0xff64cf,null));};exports[_0x082a('0x4b')]=function(_0x2efcd,_0x33c893,_0x32c332){if(_0x2efcd[_0x082a('0x47')]['id']){delete _0x2efcd[_0x082a('0x47')]['id'];}return db[_0x082a('0x3d')][_0x082a('0x4c')]({'where':{'id':_0x2efcd['params']['id']}})['then'](handleEntityNotFound(_0x33c893,null))['then'](function(_0x566d36){if(_0x566d36){_0x2efcd[_0x082a('0x47')]['AccountId']=_0x566d36['id'];_0x2efcd['body'][_0x082a('0x4d')]=integrations[_0x082a('0x4e')](_0x2efcd[_0x082a('0x47')][_0x082a('0x4f')],_0x2efcd['body'][_0x082a('0x2a')]);_0x2efcd[_0x082a('0x47')][_0x082a('0x50')]=integrations[_0x082a('0x51')](_0x2efcd[_0x082a('0x47')][_0x082a('0x4f')],_0x2efcd[_0x082a('0x47')][_0x082a('0x2a')]);return db[_0x082a('0x4a')]['create'](_0x2efcd[_0x082a('0x47')],{'include':[{'model':db[_0x082a('0x52')],'as':_0x082a('0x4d')},{'model':db[_0x082a('0x52')],'as':_0x082a('0x50')}]});}return null;})[_0x082a('0x23')](respondWithResult(_0x33c893,null))['catch'](handleError(_0x33c893,null));};function getAccessToken(_0x978b63){return new Promise(function(_0x546e5c,_0x11706a){var _0x547e86;switch(_0x978b63[_0x082a('0x53')]){case'US':_0x547e86=_0x082a('0x54');break;case'AU':_0x547e86=_0x082a('0x55');break;case'EU':_0x547e86=_0x082a('0x56');break;case'IN':_0x547e86=_0x082a('0x57');break;case'CN':_0x547e86=_0x082a('0x58');break;default:_0x547e86=_0x082a('0x56');break;}var _0x4c5e6c={'method':_0x082a('0x59'),'uri':_0x547e86+_0x082a('0x5a'),'qs':{'refresh_token':_0x978b63[_0x082a('0x5b')],'client_id':_0x978b63[_0x082a('0x5c')],'client_secret':_0x978b63[_0x082a('0x5d')],'grant_type':_0x082a('0x5e')},'json':!![]};return rp(_0x4c5e6c)[_0x082a('0x23')](function(_0x427336){if(_0x427336[_0x082a('0x5f')]){_0x546e5c(_0x427336[_0x082a('0x5f')]);}else{_0x11706a(_0x082a('0x60'));}})[_0x082a('0x42')](function(_0x335fb2){_0x11706a(_0x335fb2);});});}exports[_0x082a('0x61')]=function(_0x15a0ae,_0xa04029,_0x3a520f){var _0x50edd6,_0x1ca7f7,_0x8c014c,_0x241eb9,_0x44ee8c;return db[_0x082a('0x3d')]['findOne']({'where':{'id':_0x15a0ae['params']['id']},'attributes':['id',_0x082a('0x62'),_0x082a('0x53'),_0x082a('0x5c'),'clientSecret',_0x082a('0x63'),_0x082a('0x64'),_0x082a('0x5b')]})['then'](handleEntityNotFound(_0xa04029,null))['then'](function(_0x41ef92){_0x44ee8c=_0x41ef92;_0x50edd6=_0x44ee8c[_0x082a('0x62')];_0x1ca7f7=_0x50edd6==='zoho.eu'?'eu':'com';_0x8c014c=_0x44ee8c[_0x082a('0x63')];var _0x1e887a=_0x8c014c['slice'](-0x1);if(_0x1e887a==='/'||_0x1e887a==='\x5c'||_0x1e887a===':'){_0x8c014c=_0x8c014c[_0x082a('0x65')](0x0,_0x8c014c[_0x082a('0x66')](_0x1e887a));}if(!_0x44ee8c[_0x082a('0x5b')]){throw new Error(_0x082a('0x67'));}return getAccessToken(_0x44ee8c);})[_0x082a('0x23')](function(_0x3c2cbf){if(_0x3c2cbf){return rp({'method':_0x082a('0x68'),'uri':util[_0x082a('0x69')](_0x082a('0x6a'),_0x1ca7f7),'qs':{'module':_0x082a('0x6b')},'headers':{'Authorization':_0x082a('0x6c')+_0x3c2cbf},'json':!![]});}})[_0x082a('0x23')](function(_0x1f2738){if(_0x1f2738){if(_0x1f2738[_0x082a('0x6d')]&&_0x1f2738[_0x082a('0x6d')][_0x082a('0x25')]){throw new Error(_0x1f2738[_0x082a('0x6d')][_0x082a('0x25')][_0x082a('0x6e')]);}var _0x3fe07e=[];var _0x2e2db5=[];var _0x2ab256=[_0x082a('0x6f'),_0x082a('0x70'),'Description',_0x082a('0x71'),_0x082a('0x72'),_0x082a('0x73'),_0x082a('0x74'),'Call_Type'];_0x2e2db5=_['remove'](_0x1f2738[_0x082a('0x31')],function(_0xb07577){return _0x2ab256[_0x082a('0x75')](_0xb07577[_0x082a('0x76')]);});for(var _0x2902c2=0x0;_0x2902c2<_0x2e2db5[_0x082a('0x32')];_0x2902c2++){if(_0x2e2db5[_0x2902c2]['system_mandatory']===![]){_0x3fe07e[_0x082a('0x77')]({'id':_0x2e2db5[_0x2902c2]['id'],'name':_0x2e2db5[_0x2902c2][_0x082a('0x78')],'custom':_0x2e2db5[_0x2902c2]['custom_field'],'options':_0x2e2db5[_0x2902c2][_0x082a('0x79')]===_0x082a('0x7a')&&_0x2e2db5[_0x2902c2][_0x082a('0x7b')]['length']>-0x1?_['map'](_0x2e2db5[_0x2902c2]['pick_list_values'],function(_0x2eda15){return{'name':_0x2eda15,'value':_0x2eda15};}):[]});}}return{'count':_0x3fe07e['length'],'rows':_0x3fe07e};}else{return{'count':0x0,'rows':[]};}})[_0x082a('0x23')](respondWithResult(_0xa04029,null))['catch'](function(_0x28afc8){var _0x5bf35b=_0x15a0ae[_0x082a('0x2d')][_0x082a('0x7c')]?0x1f4:_0x28afc8[_0x082a('0x7d')]||0x1f4;logger[_0x082a('0x25')](_0x082a('0x7e'),_0x082a('0x61'),_0x5bf35b,JSON[_0x082a('0x7f')](_0x28afc8));delete _0x28afc8[_0x082a('0x26')];if(_0x5bf35b===0x191){_0x5bf35b=0x190;}_0xa04029['status'](_0x5bf35b)[_0x082a('0x80')](_0x15a0ae['query'][_0x082a('0x7c')]?{'message':_0x082a('0x81'),'statusCode':_0x28afc8['statusCode']}:_0x28afc8);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 5767eb0..aaac8de 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 _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 +var _0xc24a=['substring','https://accounts.zoho.com','https://accounts.zoho.com.au','clientId','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientSecret','code','host','slice','lastIndexOf','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refreshToken','refresh_token','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch'];(function(_0x5f0f68,_0x355e67){var _0x76d09e=function(_0x21395b){while(--_0x21395b){_0x5f0f68['push'](_0x5f0f68['shift']());}};_0x76d09e(++_0x355e67);}(_0xc24a,0xac));var _0xac24=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xc24a[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xac24('0x0'));var util=require(_0xac24('0x1'));var logger=require(_0xac24('0x2'))('api');var moment=require('moment');var BPromise=require(_0xac24('0x3'));var rp=require(_0xac24('0x4'));var fs=require('fs');var path=require(_0xac24('0x5'));var rimraf=require(_0xac24('0x6'));var config=require(_0xac24('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xac24('0x8')]=function(_0x4fafb7,_0x5a6c7d){return _0x4fafb7[_0xac24('0x9')](_0xac24('0xa'),attributes,{'tableName':_0xac24('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x116178,_0x42896b,_0x2143fd){if(_0x116178[_0xac24('0xc')](_0xac24('0xd'))||_0x116178['changed'](_0xac24('0xe'))||_0x116178[_0xac24('0xc')]('clientId')||_0x116178[_0xac24('0xc')](_0xac24('0xf'))||_0x116178['changed'](_0xac24('0x10'))||_0x116178[_0xac24('0xc')](_0xac24('0x11'))){var _0x23ffc9,_0x12b684;_0x23ffc9=_0x116178['serverUrl'];var _0x19611e=_0x23ffc9[_0xac24('0x12')](-0x1);if(_0x19611e==='/'||_0x19611e==='\x5c'||_0x19611e===':'){_0x23ffc9=_0x23ffc9['substring'](0x0,_0x23ffc9[_0xac24('0x13')](_0x19611e));}switch(_0x116178[_0xac24('0xd')]){case'US':_0x12b684='https://accounts.zoho.com';break;case'AU':_0x12b684='https://accounts.zoho.com.au';break;case'IN':_0x12b684=_0xac24('0x14');break;case'CN':_0x12b684=_0xac24('0x15');break;default:_0x12b684='https://accounts.zoho.eu';break;}var _0x46612d={'method':_0xac24('0x16'),'uri':_0x12b684+_0xac24('0x17'),'form':{'grant_type':_0xac24('0x18'),'client_id':_0x116178['clientId'],'client_secret':_0x116178[_0xac24('0xf')],'redirect_uri':_0x116178['serverUrl'],'code':_0x116178[_0xac24('0x10')]},'headers':{'Content-Type':_0xac24('0x19')}};return rp(_0x46612d)[_0xac24('0x1a')](function(_0x1b123c){var _0x5e564e=JSON[_0xac24('0x1b')](_0x1b123c);if(_0x5e564e['refresh_token']){_0x116178[_0xac24('0x1c')]=_0x5e564e[_0xac24('0x1d')];logger[_0xac24('0x1e')](util['format'](_0xac24('0x1f'),_0x116178[_0xac24('0x20')],_0x116178['id']));}else{logger[_0xac24('0x21')](util[_0xac24('0x22')](_0xac24('0x23'),_0x116178[_0xac24('0x20')],_0x116178['id']),util[_0xac24('0x24')](_0x5e564e,{'showHidden':![],'depth':null}));}return _0x2143fd(null,_0x42896b);})[_0xac24('0x25')](function(_0x24e66b){logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x116178[_0xac24('0x20')],_0x116178['id']),util[_0xac24('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x2143fd(_0x24e66b);});}else{return _0x2143fd(null,_0x42896b);}},'beforeUpdate':function(_0x31fdab,_0x2700ea,_0x43936e){if(_0x31fdab['changed'](_0xac24('0xd'))||_0x31fdab[_0xac24('0xc')](_0xac24('0xe'))||_0x31fdab[_0xac24('0xc')]('clientId')||_0x31fdab[_0xac24('0xc')]('clientSecret')||_0x31fdab[_0xac24('0xc')](_0xac24('0x10'))||_0x31fdab[_0xac24('0xc')]('host')){var _0x42bf5f,_0x51d79f;_0x42bf5f=_0x31fdab[_0xac24('0xe')];var _0x4566d3=_0x42bf5f[_0xac24('0x12')](-0x1);if(_0x4566d3==='/'||_0x4566d3==='\x5c'||_0x4566d3===':'){_0x42bf5f=_0x42bf5f[_0xac24('0x26')](0x0,_0x42bf5f[_0xac24('0x13')](_0x4566d3));}switch(_0x31fdab[_0xac24('0xd')]){case'US':_0x51d79f=_0xac24('0x27');break;case'AU':_0x51d79f=_0xac24('0x28');break;case'IN':_0x51d79f=_0xac24('0x14');break;case'CN':_0x51d79f=_0xac24('0x15');break;default:_0x51d79f='https://accounts.zoho.eu';break;}var _0x3f412e={'method':'POST','uri':_0x51d79f+_0xac24('0x17'),'form':{'grant_type':_0xac24('0x18'),'client_id':_0x31fdab[_0xac24('0x29')],'client_secret':_0x31fdab[_0xac24('0xf')],'redirect_uri':_0x31fdab['serverUrl'],'code':_0x31fdab[_0xac24('0x10')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x3f412e)[_0xac24('0x1a')](function(_0x4498bc){var _0x35d419=JSON[_0xac24('0x1b')](_0x4498bc);if(_0x35d419[_0xac24('0x1d')]){_0x31fdab[_0xac24('0x1c')]=_0x35d419['refresh_token'];logger['info'](util[_0xac24('0x22')](_0xac24('0x1f'),_0x31fdab[_0xac24('0x20')],_0x31fdab['id']));}else{logger[_0xac24('0x21')](util[_0xac24('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x31fdab[_0xac24('0x20')],_0x31fdab['id']),util[_0xac24('0x24')](_0x35d419,{'showHidden':![],'depth':null}));}return _0x43936e(null,_0x2700ea);})[_0xac24('0x25')](function(_0xda19de){logger[_0xac24('0x21')](util[_0xac24('0x22')](_0xac24('0x23'),_0x31fdab['name'],_0x31fdab['id']),util[_0xac24('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x43936e(_0xda19de);});}else{return _0x43936e(null,_0x2700ea);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index aa58067..b0f23b0 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 _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 +var _0xac35=['raw','where','attributes','limit','include','model','debug','ShowZohoAccount','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoAccount,\x20%s,\x20%s','result','catch','GetZohoAccount','ZohoAccount','findAll','options'];(function(_0x446dc8,_0x652260){var _0x4642bd=function(_0x37b88c){while(--_0x37b88c){_0x446dc8['push'](_0x446dc8['shift']());}};_0x4642bd(++_0x652260);}(_0xac35,0x141));var _0x5ac3=function(_0x2f1d2f,_0x527d85){_0x2f1d2f=_0x2f1d2f-0x0;var _0x2874cf=_0xac35[_0x2f1d2f];return _0x2874cf;};'use strict';var _=require(_0x5ac3('0x0'));var util=require(_0x5ac3('0x1'));var moment=require(_0x5ac3('0x2'));var BPromise=require(_0x5ac3('0x3'));var rs=require(_0x5ac3('0x4'));var fs=require('fs');var Redis=require(_0x5ac3('0x5'));var db=require(_0x5ac3('0x6'))['db'];var utils=require(_0x5ac3('0x7'));var logger=require(_0x5ac3('0x8'))(_0x5ac3('0x9'));var config=require(_0x5ac3('0xa'));var jayson=require(_0x5ac3('0xb'));var client=jayson[_0x5ac3('0xc')][_0x5ac3('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4c9a16,_0x77dc9f,_0x5e96cb){return new BPromise(function(_0x2a19b9,_0x1754d2){return client[_0x5ac3('0xe')](_0x4c9a16,_0x5e96cb)[_0x5ac3('0xf')](function(_0x378900){logger[_0x5ac3('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x77dc9f,_0x5ac3('0x11'));logger['debug'](_0x5ac3('0x12'),_0x77dc9f,_0x5ac3('0x11'),JSON[_0x5ac3('0x13')](_0x378900));if(_0x378900[_0x5ac3('0x14')]){if(_0x378900[_0x5ac3('0x14')][_0x5ac3('0x15')]===0x1f4){logger[_0x5ac3('0x14')]('ZohoAccount,\x20%s,\x20%s',_0x77dc9f,_0x378900[_0x5ac3('0x14')][_0x5ac3('0x16')]);return _0x1754d2(_0x378900[_0x5ac3('0x14')][_0x5ac3('0x16')]);}logger[_0x5ac3('0x14')](_0x5ac3('0x17'),_0x77dc9f,_0x378900[_0x5ac3('0x14')][_0x5ac3('0x16')]);return _0x2a19b9(_0x378900['error']['message']);}else{logger[_0x5ac3('0x10')](_0x5ac3('0x17'),_0x77dc9f,'request\x20sent');_0x2a19b9(_0x378900[_0x5ac3('0x18')]['message']);}})[_0x5ac3('0x19')](function(_0x18cad4){logger[_0x5ac3('0x14')]('ZohoAccount,\x20%s,\x20%s',_0x77dc9f,_0x18cad4);_0x1754d2(_0x18cad4);});});}exports[_0x5ac3('0x1a')]=function(_0x1c2566){var _0x200eca=this;return new Promise(function(_0x141128,_0x5aab00){return db[_0x5ac3('0x1b')][_0x5ac3('0x1c')]({'raw':_0x1c2566[_0x5ac3('0x1d')]?_0x1c2566[_0x5ac3('0x1d')][_0x5ac3('0x1e')]===undefined?!![]:![]:!![],'where':_0x1c2566[_0x5ac3('0x1d')]?_0x1c2566[_0x5ac3('0x1d')][_0x5ac3('0x1f')]||null:null,'attributes':_0x1c2566[_0x5ac3('0x1d')]?_0x1c2566[_0x5ac3('0x1d')][_0x5ac3('0x20')]||null:null,'limit':_0x1c2566[_0x5ac3('0x1d')]?_0x1c2566['options'][_0x5ac3('0x21')]||null:null,'include':_0x1c2566[_0x5ac3('0x1d')]?_0x1c2566[_0x5ac3('0x1d')][_0x5ac3('0x22')]?_['map'](_0x1c2566[_0x5ac3('0x1d')][_0x5ac3('0x22')],function(_0x2aa7c9){return{'model':db[_0x2aa7c9[_0x5ac3('0x23')]],'as':_0x2aa7c9['as'],'attributes':_0x2aa7c9['attributes'],'include':_0x2aa7c9[_0x5ac3('0x22')]?_['map'](_0x2aa7c9[_0x5ac3('0x22')],function(_0x481a72){return{'model':db[_0x481a72['model']],'as':_0x481a72['as'],'attributes':_0x481a72[_0x5ac3('0x20')],'include':_0x481a72[_0x5ac3('0x22')]?_['map'](_0x481a72[_0x5ac3('0x22')],function(_0x3912f6){return{'model':db[_0x3912f6[_0x5ac3('0x23')]],'as':_0x3912f6['as'],'attributes':_0x3912f6[_0x5ac3('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x452519){logger[_0x5ac3('0x10')](_0x5ac3('0x1a'),_0x1c2566);logger[_0x5ac3('0x24')](_0x5ac3('0x1a'),_0x1c2566,JSON[_0x5ac3('0x13')](_0x452519));_0x141128(_0x452519);})[_0x5ac3('0x19')](function(_0x5a1486){logger[_0x5ac3('0x14')](_0x5ac3('0x1a'),_0x5a1486[_0x5ac3('0x16')],_0x1c2566);_0x5aab00(_0x200eca['error'](0x1f4,_0x5a1486[_0x5ac3('0x16')]));});});};exports[_0x5ac3('0x25')]=function(_0x28c96e){var _0x5df562=this;return new Promise(function(_0x194c52,_0x484012){return db[_0x5ac3('0x1b')]['find']({'raw':_0x28c96e[_0x5ac3('0x1d')]?_0x28c96e[_0x5ac3('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x28c96e['options']?_0x28c96e['options'][_0x5ac3('0x1f')]||null:null,'attributes':_0x28c96e[_0x5ac3('0x1d')]?_0x28c96e['options'][_0x5ac3('0x20')]||null:null,'include':_0x28c96e[_0x5ac3('0x1d')]?_0x28c96e[_0x5ac3('0x1d')][_0x5ac3('0x22')]?_[_0x5ac3('0x26')](_0x28c96e[_0x5ac3('0x1d')]['include'],function(_0x4552ab){return{'model':db[_0x4552ab[_0x5ac3('0x23')]],'as':_0x4552ab['as'],'attributes':_0x4552ab[_0x5ac3('0x20')],'include':_0x4552ab[_0x5ac3('0x22')]?_['map'](_0x4552ab['include'],function(_0x3466ef){return{'model':db[_0x3466ef['model']],'as':_0x3466ef['as'],'attributes':_0x3466ef[_0x5ac3('0x20')],'include':_0x3466ef[_0x5ac3('0x22')]?_['map'](_0x3466ef[_0x5ac3('0x22')],function(_0x4e68ea){return{'model':db[_0x4e68ea[_0x5ac3('0x23')]],'as':_0x4e68ea['as'],'attributes':_0x4e68ea['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x21271a){logger[_0x5ac3('0x10')](_0x5ac3('0x25'),_0x28c96e);logger[_0x5ac3('0x24')]('ShowZohoAccount',_0x28c96e,JSON[_0x5ac3('0x13')](_0x21271a));_0x194c52(_0x21271a);})['catch'](function(_0xbefb42){logger[_0x5ac3('0x14')](_0x5ac3('0x25'),_0xbefb42[_0x5ac3('0x16')],_0x28c96e);_0x484012(_0x5df562[_0x5ac3('0x14')](0x1f4,_0xbefb42['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index b0bbc28..48ae651 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 _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 +var _0x6746=['isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./intZohoConfiguration.controller','get','index','/:id'];(function(_0x4e94e6,_0x374ae6){var _0x23c5ca=function(_0x3e7a2a){while(--_0x3e7a2a){_0x4e94e6['push'](_0x4e94e6['shift']());}};_0x23c5ca(++_0x374ae6);}(_0x6746,0x1c3));var _0x6674=function(_0x3ee55a,_0x19aeea){_0x3ee55a=_0x3ee55a-0x0;var _0x581800=_0x6746[_0x3ee55a];return _0x581800;};'use strict';var multer=require(_0x6674('0x0'));var util=require(_0x6674('0x1'));var path=require(_0x6674('0x2'));var timeout=require(_0x6674('0x3'));var express=require(_0x6674('0x4'));var router=express[_0x6674('0x5')]();var fs_extra=require(_0x6674('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6674('0x7'));router[_0x6674('0x8')]('/',auth['isAuthenticated'](),controller[_0x6674('0x9')]);router[_0x6674('0x8')](_0x6674('0xa'),auth[_0x6674('0xb')](),controller[_0x6674('0xc')]);router[_0x6674('0x8')](_0x6674('0xd'),auth[_0x6674('0xb')](),controller[_0x6674('0xe')]);router[_0x6674('0x8')](_0x6674('0xf'),auth['isAuthenticated'](),controller[_0x6674('0x10')]);router[_0x6674('0x8')](_0x6674('0x11'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0x6674('0x12')]);router[_0x6674('0x13')](_0x6674('0xa'),auth[_0x6674('0xb')](),controller[_0x6674('0x14')]);router['delete'](_0x6674('0xa'),auth[_0x6674('0xb')](),controller['destroy']);module[_0x6674('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 81b7ddc..8e6aada 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 _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 +var _0x1f11=['ENUM','lead','contact','sequelize','STRING'];(function(_0xbe44e1,_0x5812fc){var _0x5e6e5f=function(_0x12745f){while(--_0x12745f){_0xbe44e1['push'](_0xbe44e1['shift']());}};_0x5e6e5f(++_0x5812fc);}(_0x1f11,0x76));var _0x11f1=function(_0x26cdb8,_0x19bada){_0x26cdb8=_0x26cdb8-0x0;var _0x34e540=_0x1f11[_0x26cdb8];return _0x34e540;};'use strict';var Sequelize=require(_0x11f1('0x0'));module['exports']={'name':{'type':Sequelize[_0x11f1('0x1')]},'moduleCreate':{'type':Sequelize[_0x11f1('0x2')](_0x11f1('0x3'),_0x11f1('0x4'),'nothing'),'defaultValue':_0x11f1('0x3')},'moduleSearch':{'type':Sequelize[_0x11f1('0x2')]('contact_lead',_0x11f1('0x4'),_0x11f1('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x11f1('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 5d3b459..8e9e6a3 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 _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 +var _0x3a9d=['findOne','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','end','error','name','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','body','find','ZohoField','getFields'];(function(_0x2115e4,_0x412e30){var _0x37a713=function(_0x32985f){while(--_0x32985f){_0x2115e4['push'](_0x2115e4['shift']());}};_0x37a713(++_0x412e30);}(_0x3a9d,0x1ef));var _0xd3a9=function(_0x443468,_0x5c8c24){_0x443468=_0x443468-0x0;var _0xb723f=_0x3a9d[_0x443468];return _0xb723f;};'use strict';var emlformat=require(_0xd3a9('0x0'));var rimraf=require(_0xd3a9('0x1'));var zipdir=require(_0xd3a9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd3a9('0x3'));var moment=require(_0xd3a9('0x4'));var BPromise=require(_0xd3a9('0x5'));var Mustache=require(_0xd3a9('0x6'));var util=require('util');var path=require(_0xd3a9('0x7'));var sox=require(_0xd3a9('0x8'));var csv=require(_0xd3a9('0x9'));var ejs=require(_0xd3a9('0xa'));var fs=require('fs');var fs_extra=require(_0xd3a9('0xb'));var _=require(_0xd3a9('0xc'));var squel=require(_0xd3a9('0xd'));var crypto=require(_0xd3a9('0xe'));var jsforce=require(_0xd3a9('0xf'));var deskjs=require(_0xd3a9('0x10'));var toCsv=require(_0xd3a9('0x9'));var querystring=require(_0xd3a9('0x11'));var Papa=require(_0xd3a9('0x12'));var Redis=require(_0xd3a9('0x13'));var authService=require(_0xd3a9('0x14'));var qs=require(_0xd3a9('0x15'));var as=require(_0xd3a9('0x16'));var hardwareService=require(_0xd3a9('0x17'));var logger=require(_0xd3a9('0x18'))(_0xd3a9('0x19'));var utils=require(_0xd3a9('0x1a'));var config=require(_0xd3a9('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5158fe,_0x3724a0){_0x3724a0=_0x3724a0||0xcc;return function(_0x3dadd7){if(_0x3dadd7){return _0x5158fe[_0xd3a9('0x1c')](_0x3724a0);}return _0x5158fe[_0xd3a9('0x1d')](_0x3724a0)['end']();};}function respondWithResult(_0x28597d,_0x2152b4){_0x2152b4=_0x2152b4||0xc8;return function(_0x147da9){if(_0x147da9){return _0x28597d[_0xd3a9('0x1d')](_0x2152b4)[_0xd3a9('0x1e')](_0x147da9);}};}function respondWithFilteredResult(_0x520214,_0x376293){return function(_0x2893ae){if(_0x2893ae){var _0x4c0032=typeof _0x376293[_0xd3a9('0x1f')]===_0xd3a9('0x20')&&typeof _0x376293['limit']==='undefined';var _0x1eec14=_0x2893ae[_0xd3a9('0x21')];var _0xa417be=_0x4c0032?0x0:_0x376293[_0xd3a9('0x1f')];var _0x3eb844=_0x4c0032?_0x2893ae['count']:_0x376293[_0xd3a9('0x1f')]+_0x376293[_0xd3a9('0x22')];var _0x9aa4da;if(_0x3eb844>=_0x1eec14){_0x3eb844=_0x1eec14;_0x9aa4da=0xc8;}else{_0x9aa4da=0xce;}_0x520214['status'](_0x9aa4da);return _0x520214['set'](_0xd3a9('0x23'),_0xa417be+'-'+_0x3eb844+'/'+_0x1eec14)[_0xd3a9('0x1e')](_0x2893ae);}return null;};}function patchUpdates(_0x18f5ef){return function(_0x1bfcd0){try{jsonpatch[_0xd3a9('0x24')](_0x1bfcd0,_0x18f5ef,!![]);}catch(_0x2b5b5e){return BPromise['reject'](_0x2b5b5e);}return _0x1bfcd0[_0xd3a9('0x25')]();};}function saveUpdates(_0x380aeb,_0xf059c5){return function(_0x5abf45){if(_0x5abf45){return _0x5abf45[_0xd3a9('0x26')](_0x380aeb)[_0xd3a9('0x27')](function(_0x1cfe0e){return _0x1cfe0e;});}return null;};}function removeEntity(_0x23df9d,_0x27c61f){return function(_0x4bb6bb){if(_0x4bb6bb){return _0x4bb6bb[_0xd3a9('0x28')]()[_0xd3a9('0x27')](function(){_0x23df9d[_0xd3a9('0x1d')](0xcc)[_0xd3a9('0x29')]();});}};}function handleEntityNotFound(_0x3163fa,_0x1f7645){return function(_0x349c3a){if(!_0x349c3a){_0x3163fa[_0xd3a9('0x1c')](0x194);}return _0x349c3a;};}function handleError(_0x26fee5,_0x2ed111){_0x2ed111=_0x2ed111||0x1f4;return function(_0x490b8d){logger[_0xd3a9('0x2a')](_0x490b8d['stack']);if(_0x490b8d[_0xd3a9('0x2b')]){delete _0x490b8d[_0xd3a9('0x2b')];}_0x26fee5[_0xd3a9('0x1d')](_0x2ed111)['send'](_0x490b8d);};}exports['index']=function(_0x4c7fdf,_0x27a6d5){var _0x10b24e={},_0x58dec2={},_0x4915d5={'count':0x0,'rows':[]};var _0x5a030b=_[_0xd3a9('0x2c')](db[_0xd3a9('0x2d')][_0xd3a9('0x2e')],function(_0x40fb47){return{'name':_0x40fb47[_0xd3a9('0x2f')],'type':_0x40fb47[_0xd3a9('0x30')][_0xd3a9('0x31')]};});_0x58dec2[_0xd3a9('0x32')]=_['map'](_0x5a030b,_0xd3a9('0x2b'));_0x58dec2[_0xd3a9('0x33')]=_['keys'](_0x4c7fdf['query']);_0x58dec2[_0xd3a9('0x34')]=_[_0xd3a9('0x35')](_0x58dec2[_0xd3a9('0x32')],_0x58dec2[_0xd3a9('0x33')]);_0x10b24e['attributes']=_[_0xd3a9('0x35')](_0x58dec2[_0xd3a9('0x32')],qs[_0xd3a9('0x36')](_0x4c7fdf[_0xd3a9('0x33')][_0xd3a9('0x36')]));_0x10b24e[_0xd3a9('0x37')]=_0x10b24e[_0xd3a9('0x37')][_0xd3a9('0x38')]?_0x10b24e[_0xd3a9('0x37')]:_0x58dec2[_0xd3a9('0x32')];if(!_0x4c7fdf[_0xd3a9('0x33')][_0xd3a9('0x39')](_0xd3a9('0x3a'))){_0x10b24e[_0xd3a9('0x22')]=qs[_0xd3a9('0x22')](_0x4c7fdf[_0xd3a9('0x33')][_0xd3a9('0x22')]);_0x10b24e[_0xd3a9('0x1f')]=qs[_0xd3a9('0x1f')](_0x4c7fdf[_0xd3a9('0x33')][_0xd3a9('0x1f')]);}_0x10b24e[_0xd3a9('0x3b')]=qs[_0xd3a9('0x3c')](_0x4c7fdf[_0xd3a9('0x33')][_0xd3a9('0x3c')]);_0x10b24e[_0xd3a9('0x3d')]=qs[_0xd3a9('0x34')](_[_0xd3a9('0x3e')](_0x4c7fdf['query'],_0x58dec2[_0xd3a9('0x34')]),_0x5a030b);if(_0x4c7fdf[_0xd3a9('0x33')][_0xd3a9('0x3f')]){_0x10b24e[_0xd3a9('0x3d')]=_[_0xd3a9('0x40')](_0x10b24e['where'],{'$or':_[_0xd3a9('0x2c')](_0x5a030b,function(_0x179634){if(_0x179634['type']!==_0xd3a9('0x41')){var _0x30eedf={};_0x30eedf[_0x179634[_0xd3a9('0x2b')]]={'$like':'%'+_0x4c7fdf[_0xd3a9('0x33')][_0xd3a9('0x3f')]+'%'};return _0x30eedf;}})});}_0x10b24e=_['merge']({},_0x10b24e,_0x4c7fdf[_0xd3a9('0x42')]);var _0x31a603={'where':_0x10b24e[_0xd3a9('0x3d')]};return db[_0xd3a9('0x2d')][_0xd3a9('0x21')](_0x31a603)['then'](function(_0x18ffa1){_0x4915d5['count']=_0x18ffa1;if(_0x4c7fdf[_0xd3a9('0x33')][_0xd3a9('0x43')]){_0x10b24e[_0xd3a9('0x44')]=[{'all':!![]}];}return db[_0xd3a9('0x2d')][_0xd3a9('0x45')](_0x10b24e);})[_0xd3a9('0x27')](function(_0x563de0){_0x4915d5[_0xd3a9('0x46')]=_0x563de0;return _0x4915d5;})[_0xd3a9('0x27')](respondWithFilteredResult(_0x27a6d5,_0x10b24e))[_0xd3a9('0x47')](handleError(_0x27a6d5,null));};exports[_0xd3a9('0x48')]=function(_0xc91591,_0x3ba7c5){var _0x120762={'raw':![],'where':{'id':_0xc91591[_0xd3a9('0x49')]['id']}},_0x3a6fd2={};_0x3a6fd2['model']=_[_0xd3a9('0x4a')](db[_0xd3a9('0x2d')][_0xd3a9('0x2e')]);_0x3a6fd2[_0xd3a9('0x33')]=_[_0xd3a9('0x4a')](_0xc91591[_0xd3a9('0x33')]);_0x3a6fd2[_0xd3a9('0x34')]=_[_0xd3a9('0x35')](_0x3a6fd2['model'],_0x3a6fd2[_0xd3a9('0x33')]);_0x120762['attributes']=_['intersection'](_0x3a6fd2[_0xd3a9('0x32')],qs[_0xd3a9('0x36')](_0xc91591[_0xd3a9('0x33')][_0xd3a9('0x36')]));_0x120762[_0xd3a9('0x37')]=_0x120762[_0xd3a9('0x37')]['length']?_0x120762[_0xd3a9('0x37')]:_0x3a6fd2['model'];if(_0xc91591[_0xd3a9('0x33')][_0xd3a9('0x43')]){_0x120762[_0xd3a9('0x44')]=[{'all':!![]}];}_0x120762=_[_0xd3a9('0x40')]({},_0x120762,_0xc91591[_0xd3a9('0x42')]);return db['ZohoConfiguration']['find'](_0x120762)[_0xd3a9('0x27')](handleEntityNotFound(_0x3ba7c5,null))[_0xd3a9('0x27')](respondWithResult(_0x3ba7c5,null))[_0xd3a9('0x47')](handleError(_0x3ba7c5,null));};exports['create']=function(_0x32e3c1,_0x3a877a){return db[_0xd3a9('0x2d')]['create'](_0x32e3c1[_0xd3a9('0x4b')],{})['then'](respondWithResult(_0x3a877a,0xc9))[_0xd3a9('0x47')](handleError(_0x3a877a,null));};exports[_0xd3a9('0x26')]=function(_0x5e5225,_0xefef7c){if(_0x5e5225['body']['id']){delete _0x5e5225[_0xd3a9('0x4b')]['id'];}return db[_0xd3a9('0x2d')]['find']({'where':{'id':_0x5e5225[_0xd3a9('0x49')]['id']}})[_0xd3a9('0x27')](handleEntityNotFound(_0xefef7c,null))[_0xd3a9('0x27')](saveUpdates(_0x5e5225[_0xd3a9('0x4b')],null))[_0xd3a9('0x27')](respondWithResult(_0xefef7c,null))['catch'](handleError(_0xefef7c,null));};exports[_0xd3a9('0x28')]=function(_0x4c2d97,_0x57a8c4){return db[_0xd3a9('0x2d')][_0xd3a9('0x4c')]({'where':{'id':_0x4c2d97[_0xd3a9('0x49')]['id']}})[_0xd3a9('0x27')](handleEntityNotFound(_0x57a8c4,null))['then'](removeEntity(_0x57a8c4,null))['catch'](handleError(_0x57a8c4,null));};exports['getFields']=function(_0x51f06d,_0x4307c1,_0x439054){var _0x1cb186={};var _0x328885={};var _0x1cef12;var _0x4e49a0;return db[_0xd3a9('0x2d')]['findOne']({'where':{'id':_0x51f06d[_0xd3a9('0x49')]['id']}})['then'](handleEntityNotFound(_0x4307c1,null))[_0xd3a9('0x27')](function(_0x4b6dbd){if(_0x4b6dbd){_0x1cef12=_0x4b6dbd;_0x328885[_0xd3a9('0x32')]=_[_0xd3a9('0x4a')](db[_0xd3a9('0x4d')][_0xd3a9('0x2e')]);_0x328885[_0xd3a9('0x33')]=_[_0xd3a9('0x4a')](_0x51f06d[_0xd3a9('0x33')]);_0x328885[_0xd3a9('0x34')]=_['intersection'](_0x328885['model'],_0x328885[_0xd3a9('0x33')]);_0x1cb186['attributes']=_[_0xd3a9('0x35')](_0x328885[_0xd3a9('0x32')],qs[_0xd3a9('0x36')](_0x51f06d[_0xd3a9('0x33')][_0xd3a9('0x36')]));_0x1cb186[_0xd3a9('0x37')]=_0x1cb186[_0xd3a9('0x37')]['length']?_0x1cb186[_0xd3a9('0x37')]:_0x328885[_0xd3a9('0x32')];_0x1cb186[_0xd3a9('0x3b')]=qs['sort'](_0x51f06d[_0xd3a9('0x33')][_0xd3a9('0x3c')]);_0x1cb186[_0xd3a9('0x3d')]=qs[_0xd3a9('0x34')](_['pick'](_0x51f06d[_0xd3a9('0x33')],_0x328885[_0xd3a9('0x34')]));if(_0x51f06d[_0xd3a9('0x33')]['filter']){_0x1cb186[_0xd3a9('0x3d')]=_[_0xd3a9('0x40')](_0x1cb186['where'],{'$or':_[_0xd3a9('0x2c')](_0x1cb186['attributes'],function(_0x528446){var _0x5e792a={};_0x5e792a[_0x528446]={'$like':'%'+_0x51f06d[_0xd3a9('0x33')][_0xd3a9('0x3f')]+'%'};return _0x5e792a;})});}_0x1cb186=_['merge']({},_0x1cb186,_0x51f06d[_0xd3a9('0x42')]);return _0x1cef12['getFields'](_0x1cb186);}})[_0xd3a9('0x27')](function(_0x3e7024){if(_0x3e7024){_0x4e49a0=_0x3e7024['length'];if(!_0x51f06d['query'][_0xd3a9('0x39')]('nolimit')){_0x1cb186[_0xd3a9('0x22')]=qs[_0xd3a9('0x22')](_0x51f06d['query'][_0xd3a9('0x22')]);_0x1cb186[_0xd3a9('0x1f')]=qs[_0xd3a9('0x1f')](_0x51f06d[_0xd3a9('0x33')][_0xd3a9('0x1f')]);}return _0x1cef12[_0xd3a9('0x4e')](_0x1cb186);}})[_0xd3a9('0x27')](function(_0xc02392){if(_0xc02392){return _0xc02392?{'count':_0x4e49a0,'rows':_0xc02392}:null;}})[_0xd3a9('0x27')](respondWithResult(_0x4307c1,null))[_0xd3a9('0x47')](handleError(_0x4307c1,null));};exports['getSubjects']=function(_0x419326,_0x4fc408,_0x176745){var _0x47d155={};var _0x5ed665={};var _0x19e78e;var _0x2a5e24;return db[_0xd3a9('0x2d')][_0xd3a9('0x4f')]({'where':{'id':_0x419326[_0xd3a9('0x49')]['id']}})[_0xd3a9('0x27')](handleEntityNotFound(_0x4fc408,null))[_0xd3a9('0x27')](function(_0x4f2fa8){if(_0x4f2fa8){_0x19e78e=_0x4f2fa8;_0x5ed665[_0xd3a9('0x32')]=_[_0xd3a9('0x4a')](db[_0xd3a9('0x4d')][_0xd3a9('0x2e')]);_0x5ed665[_0xd3a9('0x33')]=_[_0xd3a9('0x4a')](_0x419326[_0xd3a9('0x33')]);_0x5ed665[_0xd3a9('0x34')]=_[_0xd3a9('0x35')](_0x5ed665[_0xd3a9('0x32')],_0x5ed665[_0xd3a9('0x33')]);_0x47d155[_0xd3a9('0x37')]=_[_0xd3a9('0x35')](_0x5ed665['model'],qs[_0xd3a9('0x36')](_0x419326['query']['fields']));_0x47d155[_0xd3a9('0x37')]=_0x47d155[_0xd3a9('0x37')]['length']?_0x47d155[_0xd3a9('0x37')]:_0x5ed665['model'];_0x47d155[_0xd3a9('0x3b')]=qs[_0xd3a9('0x3c')](_0x419326[_0xd3a9('0x33')][_0xd3a9('0x3c')]);_0x47d155[_0xd3a9('0x3d')]=qs[_0xd3a9('0x34')](_['pick'](_0x419326[_0xd3a9('0x33')],_0x5ed665[_0xd3a9('0x34')]));if(_0x419326[_0xd3a9('0x33')][_0xd3a9('0x3f')]){_0x47d155[_0xd3a9('0x3d')]=_['merge'](_0x47d155[_0xd3a9('0x3d')],{'$or':_['map'](_0x47d155[_0xd3a9('0x37')],function(_0x1d3b01){var _0x248168={};_0x248168[_0x1d3b01]={'$like':'%'+_0x419326[_0xd3a9('0x33')][_0xd3a9('0x3f')]+'%'};return _0x248168;})});}_0x47d155=_[_0xd3a9('0x40')]({},_0x47d155,_0x419326[_0xd3a9('0x42')]);return _0x19e78e[_0xd3a9('0x50')](_0x47d155);}})[_0xd3a9('0x27')](function(_0x32e8b4){if(_0x32e8b4){_0x2a5e24=_0x32e8b4[_0xd3a9('0x38')];if(!_0x419326[_0xd3a9('0x33')][_0xd3a9('0x39')]('nolimit')){_0x47d155[_0xd3a9('0x22')]=qs[_0xd3a9('0x22')](_0x419326[_0xd3a9('0x33')][_0xd3a9('0x22')]);_0x47d155[_0xd3a9('0x1f')]=qs['offset'](_0x419326[_0xd3a9('0x33')][_0xd3a9('0x1f')]);}return _0x19e78e[_0xd3a9('0x50')](_0x47d155);}})[_0xd3a9('0x27')](function(_0x5a2456){if(_0x5a2456){return _0x5a2456?{'count':_0x2a5e24,'rows':_0x5a2456}:null;}})[_0xd3a9('0x27')](respondWithResult(_0x4fc408,null))[_0xd3a9('0x47')](handleError(_0x4fc408,null));};exports[_0xd3a9('0x51')]=function(_0x348a3a,_0x310ae2,_0x521771){var _0x89cb6e={};var _0x16382a={};var _0x42b8da;var _0x5a03d4;return db[_0xd3a9('0x2d')][_0xd3a9('0x4f')]({'where':{'id':_0x348a3a['params']['id']}})[_0xd3a9('0x27')](handleEntityNotFound(_0x310ae2,null))[_0xd3a9('0x27')](function(_0x3da81d){if(_0x3da81d){_0x42b8da=_0x3da81d;_0x16382a['model']=_['keys'](db[_0xd3a9('0x4d')]['rawAttributes']);_0x16382a[_0xd3a9('0x33')]=_[_0xd3a9('0x4a')](_0x348a3a[_0xd3a9('0x33')]);_0x16382a[_0xd3a9('0x34')]=_['intersection'](_0x16382a['model'],_0x16382a['query']);_0x89cb6e[_0xd3a9('0x37')]=_[_0xd3a9('0x35')](_0x16382a[_0xd3a9('0x32')],qs[_0xd3a9('0x36')](_0x348a3a[_0xd3a9('0x33')][_0xd3a9('0x36')]));_0x89cb6e[_0xd3a9('0x37')]=_0x89cb6e[_0xd3a9('0x37')]['length']?_0x89cb6e['attributes']:_0x16382a[_0xd3a9('0x32')];_0x89cb6e['order']=qs[_0xd3a9('0x3c')](_0x348a3a[_0xd3a9('0x33')]['sort']);_0x89cb6e[_0xd3a9('0x3d')]=qs[_0xd3a9('0x34')](_[_0xd3a9('0x3e')](_0x348a3a[_0xd3a9('0x33')],_0x16382a[_0xd3a9('0x34')]));if(_0x348a3a[_0xd3a9('0x33')][_0xd3a9('0x3f')]){_0x89cb6e['where']=_[_0xd3a9('0x40')](_0x89cb6e[_0xd3a9('0x3d')],{'$or':_['map'](_0x89cb6e[_0xd3a9('0x37')],function(_0x7230b1){var _0x1e7143={};_0x1e7143[_0x7230b1]={'$like':'%'+_0x348a3a[_0xd3a9('0x33')][_0xd3a9('0x3f')]+'%'};return _0x1e7143;})});}_0x89cb6e=_[_0xd3a9('0x40')]({},_0x89cb6e,_0x348a3a[_0xd3a9('0x42')]);return _0x42b8da[_0xd3a9('0x51')](_0x89cb6e);}})[_0xd3a9('0x27')](function(_0xda3407){if(_0xda3407){_0x5a03d4=_0xda3407[_0xd3a9('0x38')];if(!_0x348a3a[_0xd3a9('0x33')][_0xd3a9('0x39')](_0xd3a9('0x3a'))){_0x89cb6e[_0xd3a9('0x22')]=qs[_0xd3a9('0x22')](_0x348a3a[_0xd3a9('0x33')][_0xd3a9('0x22')]);_0x89cb6e[_0xd3a9('0x1f')]=qs[_0xd3a9('0x1f')](_0x348a3a[_0xd3a9('0x33')][_0xd3a9('0x1f')]);}return _0x42b8da[_0xd3a9('0x51')](_0x89cb6e);}})[_0xd3a9('0x27')](function(_0x153b87){if(_0x153b87){return _0x153b87?{'count':_0x5a03d4,'rows':_0x153b87}:null;}})[_0xd3a9('0x27')](respondWithResult(_0x310ae2,null))[_0xd3a9('0x47')](handleError(_0x310ae2,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index d123e29..e9702e1 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 _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 +var _0x2860=['./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x18c860,_0x2455a3){var _0x4bf5ee=function(_0x5525f8){while(--_0x5525f8){_0x18c860['push'](_0x18c860['shift']());}};_0x4bf5ee(++_0x2455a3);}(_0x2860,0x163));var _0x0286=function(_0x53f275,_0x17c29e){_0x53f275=_0x53f275-0x0;var _0x1b6c12=_0x2860[_0x53f275];return _0x1b6c12;};'use strict';var _=require(_0x0286('0x0'));var util=require(_0x0286('0x1'));var logger=require(_0x0286('0x2'))(_0x0286('0x3'));var moment=require(_0x0286('0x4'));var BPromise=require(_0x0286('0x5'));var rp=require(_0x0286('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0286('0x7'));var config=require(_0x0286('0x8'));var attributes=require(_0x0286('0x9'));module[_0x0286('0xa')]=function(_0x3d7207,_0x16b85c){return _0x3d7207[_0x0286('0xb')](_0x0286('0xc'),attributes,{'tableName':_0x0286('0xd'),'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 6ec8abb..e1aacfc 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 _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 +var _0xcb6d=['then','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoConfiguration,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x13a440,_0x5b72ff){var _0x3ec420=function(_0x4d4c59){while(--_0x4d4c59){_0x13a440['push'](_0x13a440['shift']());}};_0x3ec420(++_0x5b72ff);}(_0xcb6d,0xd2));var _0xdcb6=function(_0x4939b9,_0x4e40ff){_0x4939b9=_0x4939b9-0x0;var _0x29f822=_0xcb6d[_0x4939b9];return _0x29f822;};'use strict';var _=require(_0xdcb6('0x0'));var util=require(_0xdcb6('0x1'));var moment=require(_0xdcb6('0x2'));var BPromise=require(_0xdcb6('0x3'));var rs=require(_0xdcb6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdcb6('0x5'))(_0xdcb6('0x6'));var config=require('../../config/environment');var jayson=require(_0xdcb6('0x7'));var client=jayson['client'][_0xdcb6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4646d4,_0x394aae,_0x32f05f){return new BPromise(function(_0x37099e,_0x3ac6a5){return client[_0xdcb6('0x9')](_0x4646d4,_0x32f05f)[_0xdcb6('0xa')](function(_0x308698){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x394aae,_0xdcb6('0xb'));logger[_0xdcb6('0xc')](_0xdcb6('0xd'),_0x394aae,_0xdcb6('0xb'),JSON[_0xdcb6('0xe')](_0x308698));if(_0x308698[_0xdcb6('0xf')]){if(_0x308698[_0xdcb6('0xf')][_0xdcb6('0x10')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x394aae,_0x308698['error'][_0xdcb6('0x11')]);return _0x3ac6a5(_0x308698[_0xdcb6('0xf')]['message']);}logger['error'](_0xdcb6('0x12'),_0x394aae,_0x308698[_0xdcb6('0xf')][_0xdcb6('0x11')]);return _0x37099e(_0x308698[_0xdcb6('0xf')][_0xdcb6('0x11')]);}else{logger[_0xdcb6('0x13')](_0xdcb6('0x12'),_0x394aae,_0xdcb6('0xb'));_0x37099e(_0x308698[_0xdcb6('0x14')][_0xdcb6('0x11')]);}})[_0xdcb6('0x15')](function(_0x4cb179){logger['error'](_0xdcb6('0x12'),_0x394aae,_0x4cb179);_0x3ac6a5(_0x4cb179);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 37d8de3..ba833c4 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 _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 +var _0x9626=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x59cebf,_0x43d67f){var _0xf6eb26=function(_0x7ecad){while(--_0x7ecad){_0x59cebf['push'](_0x59cebf['shift']());}};_0xf6eb26(++_0x43d67f);}(_0x9626,0x11a));var _0x6962=function(_0x2f77ee,_0x2bff02){_0x2f77ee=_0x2f77ee-0x0;var _0x38d29a=_0x9626[_0x2f77ee];return _0x38d29a;};'use strict';var multer=require(_0x6962('0x0'));var util=require(_0x6962('0x1'));var path=require(_0x6962('0x2'));var timeout=require(_0x6962('0x3'));var express=require(_0x6962('0x4'));var router=express[_0x6962('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6962('0x6'));var interaction=require(_0x6962('0x7'));var config=require('../../config/environment');var controller=require('./intZohoField.controller');router[_0x6962('0x8')]('/',auth[_0x6962('0x9')](),controller[_0x6962('0xa')]);router[_0x6962('0x8')](_0x6962('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x6962('0xc')]('/',auth[_0x6962('0x9')](),controller[_0x6962('0xd')]);router[_0x6962('0xe')]('/:id',auth[_0x6962('0x9')](),controller['update']);router[_0x6962('0xf')](_0x6962('0xb'),auth[_0x6962('0x9')](),controller[_0x6962('0x10')]);module[_0x6962('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 0b994b1..82d4bb9 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 _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 +var _0x5ea7=['customVariable','keyValue','picklist','STRING','exports','ENUM','string'];(function(_0x12a7cf,_0xe94490){var _0x25ede6=function(_0x3936cf){while(--_0x3936cf){_0x12a7cf['push'](_0x12a7cf['shift']());}};_0x25ede6(++_0xe94490);}(_0x5ea7,0x9e));var _0x75ea=function(_0x1bd323,_0x1c16ab){_0x1bd323=_0x1bd323-0x0;var _0x13097b=_0x5ea7[_0x1bd323];return _0x13097b;};'use strict';var Sequelize=require('sequelize');module[_0x75ea('0x0')]={'type':{'type':Sequelize[_0x75ea('0x1')](_0x75ea('0x2'),'variable',_0x75ea('0x3'),_0x75ea('0x4'),_0x75ea('0x5')),'defaultValue':_0x75ea('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x75ea('0x1')](_0x75ea('0x2'),'variable',_0x75ea('0x3'))},'keyContent':{'type':Sequelize[_0x75ea('0x6')]},'idField':{'type':Sequelize[_0x75ea('0x6')]},'nameField':{'type':Sequelize[_0x75ea('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x75ea('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 87dda20..03771df 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 _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 +var _0x568a=['desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','sendStatus','error','name','send','index','map','ZohoField','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x4074d5,_0xa57194){var _0x502cfe=function(_0x345efa){while(--_0x345efa){_0x4074d5['push'](_0x4074d5['shift']());}};_0x502cfe(++_0xa57194);}(_0x568a,0xcd));var _0xa568=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x568a[_0x50aa2e];return _0x5e07f0;};'use strict';var emlformat=require(_0xa568('0x0'));var rimraf=require(_0xa568('0x1'));var zipdir=require(_0xa568('0x2'));var jsonpatch=require(_0xa568('0x3'));var rp=require(_0xa568('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa568('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa568('0x6'));var fs=require('fs');var fs_extra=require(_0xa568('0x7'));var _=require(_0xa568('0x8'));var squel=require(_0xa568('0x9'));var crypto=require('crypto');var jsforce=require(_0xa568('0xa'));var deskjs=require(_0xa568('0xb'));var toCsv=require(_0xa568('0xc'));var querystring=require(_0xa568('0xd'));var Papa=require(_0xa568('0xe'));var Redis=require('ioredis');var authService=require(_0xa568('0xf'));var qs=require(_0xa568('0x10'));var as=require(_0xa568('0x11'));var hardwareService=require(_0xa568('0x12'));var logger=require('../../config/logger')(_0xa568('0x13'));var utils=require(_0xa568('0x14'));var config=require(_0xa568('0x15'));var licenseUtil=require(_0xa568('0x16'));var db=require(_0xa568('0x17'))['db'];function respondWithStatusCode(_0x1126a1,_0x214324){_0x214324=_0x214324||0xcc;return function(_0x5aa83b){if(_0x5aa83b){return _0x1126a1['sendStatus'](_0x214324);}return _0x1126a1[_0xa568('0x18')](_0x214324)[_0xa568('0x19')]();};}function respondWithResult(_0x21b122,_0x1f87a0){_0x1f87a0=_0x1f87a0||0xc8;return function(_0x38b111){if(_0x38b111){return _0x21b122[_0xa568('0x18')](_0x1f87a0)[_0xa568('0x1a')](_0x38b111);}};}function respondWithFilteredResult(_0x4a22bd,_0x4cc09e){return function(_0x2b1cff){if(_0x2b1cff){var _0x375730=typeof _0x4cc09e[_0xa568('0x1b')]===_0xa568('0x1c')&&typeof _0x4cc09e[_0xa568('0x1d')]==='undefined';var _0xdf0a0d=_0x2b1cff[_0xa568('0x1e')];var _0x4e661e=_0x375730?0x0:_0x4cc09e[_0xa568('0x1b')];var _0x1c9ce0=_0x375730?_0x2b1cff[_0xa568('0x1e')]:_0x4cc09e['offset']+_0x4cc09e[_0xa568('0x1d')];var _0x45b41f;if(_0x1c9ce0>=_0xdf0a0d){_0x1c9ce0=_0xdf0a0d;_0x45b41f=0xc8;}else{_0x45b41f=0xce;}_0x4a22bd[_0xa568('0x18')](_0x45b41f);return _0x4a22bd[_0xa568('0x1f')]('Content-Range',_0x4e661e+'-'+_0x1c9ce0+'/'+_0xdf0a0d)[_0xa568('0x1a')](_0x2b1cff);}return null;};}function patchUpdates(_0x56cc80){return function(_0x119c91){try{jsonpatch[_0xa568('0x20')](_0x119c91,_0x56cc80,!![]);}catch(_0x5e8476){return BPromise[_0xa568('0x21')](_0x5e8476);}return _0x119c91['save']();};}function saveUpdates(_0x22952b,_0x28f191){return function(_0x356d93){if(_0x356d93){return _0x356d93['update'](_0x22952b)[_0xa568('0x22')](function(_0x61cea4){return _0x61cea4;});}return null;};}function removeEntity(_0x4f082f,_0x5204f8){return function(_0x1cfc73){if(_0x1cfc73){return _0x1cfc73[_0xa568('0x23')]()[_0xa568('0x22')](function(){_0x4f082f[_0xa568('0x18')](0xcc)[_0xa568('0x19')]();});}};}function handleEntityNotFound(_0x5b30ee,_0x483844){return function(_0x4ba64e){if(!_0x4ba64e){_0x5b30ee[_0xa568('0x24')](0x194);}return _0x4ba64e;};}function handleError(_0x3ccbae,_0x3cd1ec){_0x3cd1ec=_0x3cd1ec||0x1f4;return function(_0x1c443d){logger[_0xa568('0x25')](_0x1c443d['stack']);if(_0x1c443d['name']){delete _0x1c443d[_0xa568('0x26')];}_0x3ccbae[_0xa568('0x18')](_0x3cd1ec)[_0xa568('0x27')](_0x1c443d);};}exports[_0xa568('0x28')]=function(_0x3fa7c3,_0x2838f7){var _0x1548d7={},_0x148211={},_0x37a3c5={'count':0x0,'rows':[]};var _0x52065a=_[_0xa568('0x29')](db[_0xa568('0x2a')][_0xa568('0x2b')],function(_0x38c92d){return{'name':_0x38c92d[_0xa568('0x2c')],'type':_0x38c92d[_0xa568('0x2d')]['key']};});_0x148211[_0xa568('0x2e')]=_[_0xa568('0x29')](_0x52065a,'name');_0x148211[_0xa568('0x2f')]=_['keys'](_0x3fa7c3[_0xa568('0x2f')]);_0x148211['filters']=_['intersection'](_0x148211[_0xa568('0x2e')],_0x148211[_0xa568('0x2f')]);_0x1548d7[_0xa568('0x30')]=_[_0xa568('0x31')](_0x148211[_0xa568('0x2e')],qs[_0xa568('0x32')](_0x3fa7c3[_0xa568('0x2f')]['fields']));_0x1548d7['attributes']=_0x1548d7[_0xa568('0x30')]['length']?_0x1548d7[_0xa568('0x30')]:_0x148211[_0xa568('0x2e')];if(!_0x3fa7c3[_0xa568('0x2f')][_0xa568('0x33')]('nolimit')){_0x1548d7['limit']=qs[_0xa568('0x1d')](_0x3fa7c3['query'][_0xa568('0x1d')]);_0x1548d7['offset']=qs[_0xa568('0x1b')](_0x3fa7c3['query']['offset']);}_0x1548d7[_0xa568('0x34')]=qs['sort'](_0x3fa7c3[_0xa568('0x2f')][_0xa568('0x35')]);_0x1548d7[_0xa568('0x36')]=qs[_0xa568('0x37')](_[_0xa568('0x38')](_0x3fa7c3[_0xa568('0x2f')],_0x148211[_0xa568('0x37')]),_0x52065a);if(_0x3fa7c3[_0xa568('0x2f')][_0xa568('0x39')]){_0x1548d7['where']=_[_0xa568('0x3a')](_0x1548d7[_0xa568('0x36')],{'$or':_[_0xa568('0x29')](_0x52065a,function(_0x517412){if(_0x517412[_0xa568('0x2d')]!=='VIRTUAL'){var _0x5297cc={};_0x5297cc[_0x517412[_0xa568('0x26')]]={'$like':'%'+_0x3fa7c3['query'][_0xa568('0x39')]+'%'};return _0x5297cc;}})});}_0x1548d7=_[_0xa568('0x3a')]({},_0x1548d7,_0x3fa7c3[_0xa568('0x3b')]);var _0x49ffea={'where':_0x1548d7['where']};return db[_0xa568('0x2a')][_0xa568('0x1e')](_0x49ffea)[_0xa568('0x22')](function(_0x5cade9){_0x37a3c5[_0xa568('0x1e')]=_0x5cade9;if(_0x3fa7c3['query'][_0xa568('0x3c')]){_0x1548d7[_0xa568('0x3d')]=[{'all':!![]}];}return db[_0xa568('0x2a')][_0xa568('0x3e')](_0x1548d7);})[_0xa568('0x22')](function(_0x42c5a3){_0x37a3c5[_0xa568('0x3f')]=_0x42c5a3;return _0x37a3c5;})[_0xa568('0x22')](respondWithFilteredResult(_0x2838f7,_0x1548d7))[_0xa568('0x40')](handleError(_0x2838f7,null));};exports[_0xa568('0x41')]=function(_0x2288e2,_0x1beb1f){var _0x5166cb={'raw':!![],'where':{'id':_0x2288e2[_0xa568('0x42')]['id']}},_0x254ac3={};_0x254ac3['model']=_[_0xa568('0x43')](db[_0xa568('0x2a')][_0xa568('0x2b')]);_0x254ac3['query']=_[_0xa568('0x43')](_0x2288e2[_0xa568('0x2f')]);_0x254ac3[_0xa568('0x37')]=_['intersection'](_0x254ac3[_0xa568('0x2e')],_0x254ac3['query']);_0x5166cb[_0xa568('0x30')]=_['intersection'](_0x254ac3[_0xa568('0x2e')],qs[_0xa568('0x32')](_0x2288e2[_0xa568('0x2f')][_0xa568('0x32')]));_0x5166cb[_0xa568('0x30')]=_0x5166cb['attributes']['length']?_0x5166cb[_0xa568('0x30')]:_0x254ac3[_0xa568('0x2e')];if(_0x2288e2['query'][_0xa568('0x3c')]){_0x5166cb[_0xa568('0x3d')]=[{'all':!![]}];}_0x5166cb=_['merge']({},_0x5166cb,_0x2288e2['options']);return db['ZohoField'][_0xa568('0x44')](_0x5166cb)[_0xa568('0x22')](handleEntityNotFound(_0x1beb1f,null))[_0xa568('0x22')](respondWithResult(_0x1beb1f,null))[_0xa568('0x40')](handleError(_0x1beb1f,null));};exports[_0xa568('0x45')]=function(_0x4c7c92,_0x49c32f){return db[_0xa568('0x2a')]['create'](_0x4c7c92[_0xa568('0x46')],{})['then'](respondWithResult(_0x49c32f,0xc9))[_0xa568('0x40')](handleError(_0x49c32f,null));};exports[_0xa568('0x47')]=function(_0x370cb2,_0x11ebf8){if(_0x370cb2['body']['id']){delete _0x370cb2[_0xa568('0x46')]['id'];}return db[_0xa568('0x2a')]['find']({'where':{'id':_0x370cb2[_0xa568('0x42')]['id']}})['then'](handleEntityNotFound(_0x11ebf8,null))['then'](saveUpdates(_0x370cb2[_0xa568('0x46')],null))[_0xa568('0x22')](respondWithResult(_0x11ebf8,null))['catch'](handleError(_0x11ebf8,null));};exports[_0xa568('0x23')]=function(_0x23ebac,_0x39884f){return db[_0xa568('0x2a')][_0xa568('0x44')]({'where':{'id':_0x23ebac[_0xa568('0x42')]['id']}})[_0xa568('0x22')](handleEntityNotFound(_0x39884f,null))[_0xa568('0x22')](removeEntity(_0x39884f,null))[_0xa568('0x40')](handleError(_0x39884f,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 0101683..be9feb3 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 _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 +var _0x82c4=['moment','bluebird','request-promise','rimraf','./intZohoField.attributes','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0xf97218,_0x4f4304){var _0x27f87a=function(_0x46202d){while(--_0x46202d){_0xf97218['push'](_0xf97218['shift']());}};_0x27f87a(++_0x4f4304);}(_0x82c4,0x1ca));var _0x482c=function(_0x5178fb,_0x121e19){_0x5178fb=_0x5178fb-0x0;var _0x348183=_0x82c4[_0x5178fb];return _0x348183;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var logger=require(_0x482c('0x2'))(_0x482c('0x3'));var moment=require(_0x482c('0x4'));var BPromise=require(_0x482c('0x5'));var rp=require(_0x482c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x482c('0x7'));var config=require('../../config/environment');var attributes=require(_0x482c('0x8'));module['exports']=function(_0x477cf4,_0x5d7c76){return _0x477cf4[_0x482c('0x9')](_0x482c('0xa'),attributes,{'tableName':_0x482c('0xb'),'paranoid':![],'indexes':[{'name':_0x482c('0xc'),'fields':[_0x482c('0xd'),'FieldId'],'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 8ed9f77..e3e0d0b 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 _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 +var _0x96ac=['info','request\x20sent','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then'];(function(_0x90a39a,_0x32020d){var _0x2b62f7=function(_0x6841cc){while(--_0x6841cc){_0x90a39a['push'](_0x90a39a['shift']());}};_0x2b62f7(++_0x32020d);}(_0x96ac,0x1ec));var _0xc96a=function(_0x5d3ff0,_0x4561a8){_0x5d3ff0=_0x5d3ff0-0x0;var _0x2aa4d1=_0x96ac[_0x5d3ff0];return _0x2aa4d1;};'use strict';var _=require(_0xc96a('0x0'));var util=require(_0xc96a('0x1'));var moment=require(_0xc96a('0x2'));var BPromise=require(_0xc96a('0x3'));var rs=require(_0xc96a('0x4'));var fs=require('fs');var Redis=require(_0xc96a('0x5'));var db=require(_0xc96a('0x6'))['db'];var utils=require(_0xc96a('0x7'));var logger=require(_0xc96a('0x8'))(_0xc96a('0x9'));var config=require('../../config/environment');var jayson=require(_0xc96a('0xa'));var client=jayson[_0xc96a('0xb')][_0xc96a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ba698,_0x5b26f8,_0x53f219){return new BPromise(function(_0x434089,_0x9923e3){return client['request'](_0x5ba698,_0x53f219)[_0xc96a('0xd')](function(_0x47fe4d){logger[_0xc96a('0xe')]('ZohoField,\x20%s,\x20%s',_0x5b26f8,_0xc96a('0xf'));logger['debug']('ZohoField,\x20%s,\x20%s,\x20%s',_0x5b26f8,_0xc96a('0xf'),JSON[_0xc96a('0x10')](_0x47fe4d));if(_0x47fe4d[_0xc96a('0x11')]){if(_0x47fe4d[_0xc96a('0x11')][_0xc96a('0x12')]===0x1f4){logger[_0xc96a('0x11')](_0xc96a('0x13'),_0x5b26f8,_0x47fe4d[_0xc96a('0x11')][_0xc96a('0x14')]);return _0x9923e3(_0x47fe4d[_0xc96a('0x11')][_0xc96a('0x14')]);}logger[_0xc96a('0x11')](_0xc96a('0x13'),_0x5b26f8,_0x47fe4d[_0xc96a('0x11')][_0xc96a('0x14')]);return _0x434089(_0x47fe4d[_0xc96a('0x11')][_0xc96a('0x14')]);}else{logger[_0xc96a('0xe')]('ZohoField,\x20%s,\x20%s',_0x5b26f8,'request\x20sent');_0x434089(_0x47fe4d[_0xc96a('0x15')][_0xc96a('0x14')]);}})[_0xc96a('0x16')](function(_0x2e3079){logger['error']('ZohoField,\x20%s,\x20%s',_0x5b26f8,_0x2e3079);_0x9923e3(_0x2e3079);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index f7a95c4..0ddd024 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_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 +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4ee5d3,_0x432589){var _0x3a0562=function(_0x442e4a){while(--_0x442e4a){_0x4ee5d3['push'](_0x4ee5d3['shift']());}};_0x3a0562(++_0x432589);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 52b9894..2683a70 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 _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 +var _0x98dc=['INTEGER','state','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0x4181af,_0x77f684){var _0x271137=function(_0x157ec3){while(--_0x157ec3){_0x4181af['push'](_0x4181af['shift']());}};_0x271137(++_0x77f684);}(_0x98dc,0x18a));var _0xc98d=function(_0x52e3f7,_0x3a0095){_0x52e3f7=_0x52e3f7-0x0;var _0x40d62a=_0x98dc[_0x52e3f7];return _0x40d62a;};'use strict';var Sequelize=require(_0xc98d('0x0'));module[_0xc98d('0x1')]={'name':{'type':Sequelize[_0xc98d('0x2')],'allowNull':![],'unique':_0xc98d('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xc98d('0x2')],'defaultValue':_0xc98d('0x4')},'filename':{'type':Sequelize[_0xc98d('0x2')]},'path':{'type':Sequelize[_0xc98d('0x2')]},'type':{'type':Sequelize[_0xc98d('0x2')]},'size':{'type':Sequelize[_0xc98d('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xc98d('0x2')]},'logo':{'type':Sequelize[_0xc98d('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0xc98d('0x6')},'description':{'type':Sequelize[_0xc98d('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index f446ab3..ce3d8a7 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 _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 +var _0xf61e=['intersection','fields','attributes','length','hasOwnProperty','order','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','then','status','error','stack','name','send','index','map','Integration','rawAttributes','key','model','query','keys','filters'];(function(_0x55c1f0,_0x4f574f){var _0x1530fa=function(_0x631542){while(--_0x631542){_0x55c1f0['push'](_0x55c1f0['shift']());}};_0x1530fa(++_0x4f574f);}(_0xf61e,0x191));var _0xef61=function(_0x3e3c5f,_0x12461a){_0x3e3c5f=_0x3e3c5f-0x0;var _0x6e4f3=_0xf61e[_0x3e3c5f];return _0x6e4f3;};'use strict';var emlformat=require(_0xef61('0x0'));var rimraf=require(_0xef61('0x1'));var zipdir=require(_0xef61('0x2'));var jsonpatch=require(_0xef61('0x3'));var rp=require(_0xef61('0x4'));var moment=require(_0xef61('0x5'));var BPromise=require(_0xef61('0x6'));var Mustache=require(_0xef61('0x7'));var util=require(_0xef61('0x8'));var path=require(_0xef61('0x9'));var sox=require(_0xef61('0xa'));var csv=require(_0xef61('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef61('0xc'));var _=require(_0xef61('0xd'));var squel=require('squel');var crypto=require(_0xef61('0xe'));var jsforce=require(_0xef61('0xf'));var deskjs=require(_0xef61('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef61('0x11'));var Redis=require(_0xef61('0x12'));var authService=require(_0xef61('0x13'));var qs=require(_0xef61('0x14'));var as=require(_0xef61('0x15'));var hardwareService=require(_0xef61('0x16'));var logger=require(_0xef61('0x17'))(_0xef61('0x18'));var utils=require(_0xef61('0x19'));var config=require(_0xef61('0x1a'));var licenseUtil=require(_0xef61('0x1b'));var db=require(_0xef61('0x1c'))['db'];function respondWithStatusCode(_0x114e1f,_0x318f1c){_0x318f1c=_0x318f1c||0xcc;return function(_0x5de159){if(_0x5de159){return _0x114e1f[_0xef61('0x1d')](_0x318f1c);}return _0x114e1f['status'](_0x318f1c)[_0xef61('0x1e')]();};}function respondWithResult(_0x1db2a9,_0x370ee0){_0x370ee0=_0x370ee0||0xc8;return function(_0x76ef9b){if(_0x76ef9b){return _0x1db2a9['status'](_0x370ee0)[_0xef61('0x1f')](_0x76ef9b);}};}function respondWithFilteredResult(_0x435beb,_0x1224c2){return function(_0x78ff22){if(_0x78ff22){var _0x588a61=typeof _0x1224c2[_0xef61('0x20')]===_0xef61('0x21')&&typeof _0x1224c2['limit']===_0xef61('0x21');var _0x408541=_0x78ff22[_0xef61('0x22')];var _0x22dc1b=_0x588a61?0x0:_0x1224c2[_0xef61('0x20')];var _0x28315a=_0x588a61?_0x78ff22[_0xef61('0x22')]:_0x1224c2['offset']+_0x1224c2[_0xef61('0x23')];var _0x2c8dad;if(_0x28315a>=_0x408541){_0x28315a=_0x408541;_0x2c8dad=0xc8;}else{_0x2c8dad=0xce;}_0x435beb['status'](_0x2c8dad);return _0x435beb[_0xef61('0x24')](_0xef61('0x25'),_0x22dc1b+'-'+_0x28315a+'/'+_0x408541)[_0xef61('0x1f')](_0x78ff22);}return null;};}function patchUpdates(_0x26cf42){return function(_0xb0d7a4){try{jsonpatch[_0xef61('0x26')](_0xb0d7a4,_0x26cf42,!![]);}catch(_0x92ea33){return BPromise['reject'](_0x92ea33);}return _0xb0d7a4['save']();};}function saveUpdates(_0x3d31c1,_0x58bd7d){return function(_0x389d6d){if(_0x389d6d){return _0x389d6d['update'](_0x3d31c1)['then'](function(_0x2f0569){return _0x2f0569;});}return null;};}function removeEntity(_0x5ce99d,_0x53181b){return function(_0xfbee94){if(_0xfbee94){return _0xfbee94[_0xef61('0x27')]()[_0xef61('0x28')](function(){_0x5ce99d[_0xef61('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b144,_0x4e738f){return function(_0x2a6832){if(!_0x2a6832){_0x16b144[_0xef61('0x1d')](0x194);}return _0x2a6832;};}function handleError(_0x2419a9,_0xf4c7c9){_0xf4c7c9=_0xf4c7c9||0x1f4;return function(_0x2155f1){logger[_0xef61('0x2a')](_0x2155f1[_0xef61('0x2b')]);if(_0x2155f1[_0xef61('0x2c')]){delete _0x2155f1[_0xef61('0x2c')];}_0x2419a9[_0xef61('0x29')](_0xf4c7c9)[_0xef61('0x2d')](_0x2155f1);};}exports[_0xef61('0x2e')]=function(_0xeb9a62,_0x63edd4){var _0x1f3572={},_0x85978={},_0x39c15e={'count':0x0,'rows':[]};var _0x393ea9=_[_0xef61('0x2f')](db[_0xef61('0x30')][_0xef61('0x31')],function(_0x53fa3b){return{'name':_0x53fa3b['fieldName'],'type':_0x53fa3b['type'][_0xef61('0x32')]};});_0x85978[_0xef61('0x33')]=_[_0xef61('0x2f')](_0x393ea9,'name');_0x85978[_0xef61('0x34')]=_[_0xef61('0x35')](_0xeb9a62['query']);_0x85978[_0xef61('0x36')]=_['intersection'](_0x85978['model'],_0x85978[_0xef61('0x34')]);_0x1f3572['attributes']=_[_0xef61('0x37')](_0x85978['model'],qs[_0xef61('0x38')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x38')]));_0x1f3572[_0xef61('0x39')]=_0x1f3572[_0xef61('0x39')][_0xef61('0x3a')]?_0x1f3572[_0xef61('0x39')]:_0x85978[_0xef61('0x33')];if(!_0xeb9a62[_0xef61('0x34')][_0xef61('0x3b')]('nolimit')){_0x1f3572[_0xef61('0x23')]=qs[_0xef61('0x23')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x23')]);_0x1f3572[_0xef61('0x20')]=qs['offset'](_0xeb9a62[_0xef61('0x34')][_0xef61('0x20')]);}_0x1f3572[_0xef61('0x3c')]=qs['sort'](_0xeb9a62['query']['sort']);_0x1f3572[_0xef61('0x3d')]=qs['filters'](_['pick'](_0xeb9a62['query'],_0x85978[_0xef61('0x36')]),_0x393ea9);if(_0xeb9a62[_0xef61('0x34')][_0xef61('0x3e')]){_0x1f3572['where']=_['merge'](_0x1f3572['where'],{'$or':_[_0xef61('0x2f')](_0x393ea9,function(_0x32ad44){if(_0x32ad44['type']!==_0xef61('0x3f')){var _0x12f442={};_0x12f442[_0x32ad44[_0xef61('0x2c')]]={'$like':'%'+_0xeb9a62[_0xef61('0x34')]['filter']+'%'};return _0x12f442;}})});}_0x1f3572=_[_0xef61('0x40')]({},_0x1f3572,_0xeb9a62[_0xef61('0x41')]);var _0x3103d4={'where':_0x1f3572[_0xef61('0x3d')]};return db['Integration']['count'](_0x3103d4)[_0xef61('0x28')](function(_0x462972){_0x39c15e[_0xef61('0x22')]=_0x462972;if(_0xeb9a62['query'][_0xef61('0x42')]){_0x1f3572[_0xef61('0x43')]=[{'all':!![]}];}return db[_0xef61('0x30')][_0xef61('0x44')](_0x1f3572);})['then'](function(_0x545597){_0x39c15e['rows']=_0x545597;return _0x39c15e;})[_0xef61('0x28')](respondWithFilteredResult(_0x63edd4,_0x1f3572))[_0xef61('0x45')](handleError(_0x63edd4,null));};exports[_0xef61('0x46')]=function(_0xe40d,_0x3f81a1){var _0x272143={'raw':![],'where':{'id':_0xe40d['params']['id']}},_0xc9b467={};_0xc9b467[_0xef61('0x33')]=_[_0xef61('0x35')](db[_0xef61('0x30')][_0xef61('0x31')]);_0xc9b467['query']=_[_0xef61('0x35')](_0xe40d[_0xef61('0x34')]);_0xc9b467[_0xef61('0x36')]=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],_0xc9b467[_0xef61('0x34')]);_0x272143['attributes']=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],qs[_0xef61('0x38')](_0xe40d['query'][_0xef61('0x38')]));_0x272143[_0xef61('0x39')]=_0x272143[_0xef61('0x39')][_0xef61('0x3a')]?_0x272143[_0xef61('0x39')]:_0xc9b467[_0xef61('0x33')];if(_0xe40d['query'][_0xef61('0x42')]){_0x272143[_0xef61('0x43')]=[{'all':!![]}];}_0x272143=_['merge']({},_0x272143,_0xe40d[_0xef61('0x41')]);return db[_0xef61('0x30')][_0xef61('0x47')](_0x272143)[_0xef61('0x28')](handleEntityNotFound(_0x3f81a1,null))['then'](respondWithResult(_0x3f81a1,null))[_0xef61('0x45')](handleError(_0x3f81a1,null));};exports[_0xef61('0x48')]=function(_0x5e614b,_0x47b09d){return db[_0xef61('0x30')][_0xef61('0x48')](_0x5e614b['body'],{})[_0xef61('0x28')](respondWithResult(_0x47b09d,0xc9))[_0xef61('0x45')](handleError(_0x47b09d,null));};exports[_0xef61('0x49')]=function(_0x2904e0,_0x13bb20){if(_0x2904e0[_0xef61('0x4a')]['id']){delete _0x2904e0[_0xef61('0x4a')]['id'];}return db['Integration'][_0xef61('0x47')]({'where':{'id':_0x2904e0['params']['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x13bb20,null))[_0xef61('0x28')](saveUpdates(_0x2904e0[_0xef61('0x4a')],null))[_0xef61('0x28')](respondWithResult(_0x13bb20,null))[_0xef61('0x45')](handleError(_0x13bb20,null));};exports[_0xef61('0x27')]=function(_0x3e23eb,_0x1565c7){return db[_0xef61('0x30')]['find']({'where':{'id':_0x3e23eb[_0xef61('0x4b')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x1565c7,null))['then'](removeEntity(_0x1565c7,null))['catch'](handleError(_0x1565c7,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index d240961..e2da82b 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 _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 +var _0xc34e=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./integration.attributes','define','Integration','integrations','lodash','util','../../config/logger'];(function(_0x2a4b81,_0x10ac81){var _0x4d4c18=function(_0x263a0c){while(--_0x263a0c){_0x2a4b81['push'](_0x2a4b81['shift']());}};_0x4d4c18(++_0x10ac81);}(_0xc34e,0x176));var _0xec34=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc34e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xec34('0x0'));var util=require(_0xec34('0x1'));var logger=require(_0xec34('0x2'))(_0xec34('0x3'));var moment=require(_0xec34('0x4'));var BPromise=require(_0xec34('0x5'));var rp=require(_0xec34('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec34('0x7'));var config=require(_0xec34('0x8'));var attributes=require(_0xec34('0x9'));module['exports']=function(_0x457855,_0x4cc089){return _0x457855[_0xec34('0xa')](_0xec34('0xb'),attributes,{'tableName':_0xec34('0xc'),'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 27ec953..44a398e 100644 --- a/server/api/integration/integration.rpc.js +++ b/server/api/integration/integration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_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 +var _0xe2fe=['then','info','Integration,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x1d76ce,_0x1808fc){var _0x38413d=function(_0x2f9bcc){while(--_0x2f9bcc){_0x1d76ce['push'](_0x1d76ce['shift']());}};_0x38413d(++_0x1808fc);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'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']('Integration,\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 diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 720e386..7424006 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 _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 +var _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','create','put','update','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./integrationReport.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['show']);router['post']('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router[_0x65f6('0xd')](_0x65f6('0xb'),auth['isAuthenticated'](),controller[_0x65f6('0xe')]);router['delete']('/:id',auth[_0x65f6('0x8')](),controller['destroy']);module[_0x65f6('0xf')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 8c0796a..54140f8 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 _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 +var _0x3401=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','RECEIVED','sequelize','STRING'];(function(_0x52e94f,_0x5285be){var _0x1bcad0=function(_0x2236ac){while(--_0x2236ac){_0x52e94f['push'](_0x52e94f['shift']());}};_0x1bcad0(++_0x5285be);}(_0x3401,0x154));var _0x1340=function(_0x281ca3,_0x1d4c2b){_0x281ca3=_0x281ca3-0x0;var _0x3c3125=_0x3401[_0x281ca3];return _0x3c3125;};'use strict';var Sequelize=require(_0x1340('0x0'));module['exports']={'integration':{'type':Sequelize[_0x1340('0x1')]},'eventChannel':{'type':Sequelize[_0x1340('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x1340('0x1')]},'integrationId':{'type':Sequelize[_0x1340('0x2')]},'contacts':{'type':Sequelize[_0x1340('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1340('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x1340('0x1')]},'interface':{'type':Sequelize[_0x1340('0x1')]},'membername':{'type':Sequelize[_0x1340('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x1340('0x3')]},'holdtime':{'type':Sequelize[_0x1340('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x1340('0x3')]},'talktime':{'type':Sequelize[_0x1340('0x2')]},'agentacw':{'type':Sequelize[_0x1340('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x1340('0x2')]},'reason':{'type':Sequelize[_0x1340('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x1340('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x1340('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x1340('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1340('0x1')]},'channelstate':{'type':Sequelize[_0x1340('0x2')]},'channelstatedesc':{'type':Sequelize[_0x1340('0x1')]},'connectedlinenum':{'type':Sequelize[_0x1340('0x1')]},'connectedlinename':{'type':Sequelize[_0x1340('0x1')]},'language':{'type':Sequelize[_0x1340('0x1')]},'accountcode':{'type':Sequelize[_0x1340('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x1340('0x1')]},'priority':{'type':Sequelize[_0x1340('0x1')]},'destchannel':{'type':Sequelize[_0x1340('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x1340('0x1')]},'destcalleridnum':{'type':Sequelize[_0x1340('0x1')]},'destcalleridname':{'type':Sequelize[_0x1340('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x1340('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x1340('0x1')]},'destaccountcode':{'type':Sequelize[_0x1340('0x1')]},'destcontext':{'type':Sequelize[_0x1340('0x1')]},'destexten':{'type':Sequelize[_0x1340('0x1')]},'destpriority':{'type':Sequelize[_0x1340('0x1')]},'destuniqueid':{'type':Sequelize[_0x1340('0x1')]},'messageId':{'type':Sequelize[_0x1340('0x1')]},'inReplyTo':{'type':Sequelize[_0x1340('0x1')]},'subject':{'type':Sequelize[_0x1340('0x1')]},'from':{'type':Sequelize[_0x1340('0x1')]},'to':{'type':Sequelize[_0x1340('0x1')]},'cc':{'type':Sequelize[_0x1340('0x1')]},'attachment':{'type':Sequelize[_0x1340('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x1340('0x5')]},'status':{'type':Sequelize[_0x1340('0x6')](_0x1340('0x7'),'SENDING',_0x1340('0x8'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x1340('0x1')]},'projectId':{'type':Sequelize[_0x1340('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 4a80202..40859fc 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 _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 +var _0x65d6=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','save','update','destroy','error','name','send','index','map','IntegrationReport','fieldName','key','model','query','keys','filters','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','filter','options','then','includeAll','include','rows','catch','show','rawAttributes','intersection','create','body','find','params'];(function(_0x2a0e59,_0x586fcb){var _0x562b26=function(_0x2e7ade){while(--_0x2e7ade){_0x2a0e59['push'](_0x2a0e59['shift']());}};_0x562b26(++_0x586fcb);}(_0x65d6,0x1eb));var _0x665d=function(_0x204b00,_0x1c5ac5){_0x204b00=_0x204b00-0x0;var _0x26e4d1=_0x65d6[_0x204b00];return _0x26e4d1;};'use strict';var emlformat=require(_0x665d('0x0'));var rimraf=require(_0x665d('0x1'));var zipdir=require(_0x665d('0x2'));var jsonpatch=require(_0x665d('0x3'));var rp=require(_0x665d('0x4'));var moment=require(_0x665d('0x5'));var BPromise=require(_0x665d('0x6'));var Mustache=require(_0x665d('0x7'));var util=require(_0x665d('0x8'));var path=require(_0x665d('0x9'));var sox=require(_0x665d('0xa'));var csv=require('to-csv');var ejs=require(_0x665d('0xb'));var fs=require('fs');var fs_extra=require(_0x665d('0xc'));var _=require('lodash');var squel=require(_0x665d('0xd'));var crypto=require(_0x665d('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x665d('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x665d('0x10'));var qs=require(_0x665d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x665d('0x12'));var logger=require('../../config/logger')(_0x665d('0x13'));var utils=require('../../config/utils');var config=require(_0x665d('0x14'));var licenseUtil=require(_0x665d('0x15'));var db=require(_0x665d('0x16'))['db'];function respondWithStatusCode(_0x4308a0,_0x298043){_0x298043=_0x298043||0xcc;return function(_0x5805ad){if(_0x5805ad){return _0x4308a0[_0x665d('0x17')](_0x298043);}return _0x4308a0[_0x665d('0x18')](_0x298043)['end']();};}function respondWithResult(_0xa6762c,_0x26fb3f){_0x26fb3f=_0x26fb3f||0xc8;return function(_0x53bc8d){if(_0x53bc8d){return _0xa6762c['status'](_0x26fb3f)['json'](_0x53bc8d);}};}function respondWithFilteredResult(_0x46aa1e,_0xd63714){return function(_0x42b0ec){if(_0x42b0ec){var _0x1acf1b=typeof _0xd63714['offset']===_0x665d('0x19')&&typeof _0xd63714[_0x665d('0x1a')]===_0x665d('0x19');var _0x87f16f=_0x42b0ec[_0x665d('0x1b')];var _0x118532=_0x1acf1b?0x0:_0xd63714[_0x665d('0x1c')];var _0x39b38f=_0x1acf1b?_0x42b0ec[_0x665d('0x1b')]:_0xd63714[_0x665d('0x1c')]+_0xd63714['limit'];var _0x1246bd;if(_0x39b38f>=_0x87f16f){_0x39b38f=_0x87f16f;_0x1246bd=0xc8;}else{_0x1246bd=0xce;}_0x46aa1e[_0x665d('0x18')](_0x1246bd);return _0x46aa1e[_0x665d('0x1d')](_0x665d('0x1e'),_0x118532+'-'+_0x39b38f+'/'+_0x87f16f)[_0x665d('0x1f')](_0x42b0ec);}return null;};}function patchUpdates(_0x4669e5){return function(_0x539238){try{jsonpatch['apply'](_0x539238,_0x4669e5,!![]);}catch(_0x206138){return BPromise['reject'](_0x206138);}return _0x539238[_0x665d('0x20')]();};}function saveUpdates(_0x2108c9,_0x5d437a){return function(_0x6dc3e6){if(_0x6dc3e6){return _0x6dc3e6[_0x665d('0x21')](_0x2108c9)['then'](function(_0x5df824){return _0x5df824;});}return null;};}function removeEntity(_0x196316,_0x1a2090){return function(_0x4c774f){if(_0x4c774f){return _0x4c774f[_0x665d('0x22')]()['then'](function(){_0x196316[_0x665d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x446cdc,_0x2eab66){return function(_0x4e2cb4){if(!_0x4e2cb4){_0x446cdc[_0x665d('0x17')](0x194);}return _0x4e2cb4;};}function handleError(_0x50c1af,_0x30f449){_0x30f449=_0x30f449||0x1f4;return function(_0x115c86){logger[_0x665d('0x23')](_0x115c86['stack']);if(_0x115c86[_0x665d('0x24')]){delete _0x115c86[_0x665d('0x24')];}_0x50c1af['status'](_0x30f449)[_0x665d('0x25')](_0x115c86);};}exports[_0x665d('0x26')]=function(_0x2bd186,_0x595fb0){var _0x2c6cce={},_0x27767c={},_0x76104a={'count':0x0,'rows':[]};var _0x4024d1=_[_0x665d('0x27')](db[_0x665d('0x28')]['rawAttributes'],function(_0x36e3bb){return{'name':_0x36e3bb[_0x665d('0x29')],'type':_0x36e3bb['type'][_0x665d('0x2a')]};});_0x27767c[_0x665d('0x2b')]=_[_0x665d('0x27')](_0x4024d1,_0x665d('0x24'));_0x27767c[_0x665d('0x2c')]=_[_0x665d('0x2d')](_0x2bd186[_0x665d('0x2c')]);_0x27767c[_0x665d('0x2e')]=_['intersection'](_0x27767c[_0x665d('0x2b')],_0x27767c['query']);_0x2c6cce[_0x665d('0x2f')]=_['intersection'](_0x27767c['model'],qs[_0x665d('0x30')](_0x2bd186[_0x665d('0x2c')]['fields']));_0x2c6cce['attributes']=_0x2c6cce['attributes'][_0x665d('0x31')]?_0x2c6cce[_0x665d('0x2f')]:_0x27767c[_0x665d('0x2b')];if(!_0x2bd186[_0x665d('0x2c')]['hasOwnProperty'](_0x665d('0x32'))){_0x2c6cce[_0x665d('0x1a')]=qs[_0x665d('0x1a')](_0x2bd186[_0x665d('0x2c')][_0x665d('0x1a')]);_0x2c6cce[_0x665d('0x1c')]=qs[_0x665d('0x1c')](_0x2bd186[_0x665d('0x2c')]['offset']);}_0x2c6cce['order']=qs[_0x665d('0x33')](_0x2bd186['query'][_0x665d('0x33')]);_0x2c6cce[_0x665d('0x34')]=qs[_0x665d('0x2e')](_['pick'](_0x2bd186['query'],_0x27767c[_0x665d('0x2e')]),_0x4024d1);if(_0x2bd186[_0x665d('0x2c')]['filter']){_0x2c6cce[_0x665d('0x34')]=_[_0x665d('0x35')](_0x2c6cce[_0x665d('0x34')],{'$or':_[_0x665d('0x27')](_0x4024d1,function(_0x3e0c6e){if(_0x3e0c6e['type']!==_0x665d('0x36')){var _0xf6b4dd={};_0xf6b4dd[_0x3e0c6e[_0x665d('0x24')]]={'$like':'%'+_0x2bd186['query'][_0x665d('0x37')]+'%'};return _0xf6b4dd;}})});}_0x2c6cce=_[_0x665d('0x35')]({},_0x2c6cce,_0x2bd186[_0x665d('0x38')]);var _0x4c0035={'where':_0x2c6cce[_0x665d('0x34')]};return db[_0x665d('0x28')]['count'](_0x4c0035)[_0x665d('0x39')](function(_0xa74cb4){_0x76104a[_0x665d('0x1b')]=_0xa74cb4;if(_0x2bd186[_0x665d('0x2c')][_0x665d('0x3a')]){_0x2c6cce[_0x665d('0x3b')]=[{'all':!![]}];}return db[_0x665d('0x28')]['findAll'](_0x2c6cce);})['then'](function(_0x2f28d8){_0x76104a[_0x665d('0x3c')]=_0x2f28d8;return _0x76104a;})['then'](respondWithFilteredResult(_0x595fb0,_0x2c6cce))[_0x665d('0x3d')](handleError(_0x595fb0,null));};exports[_0x665d('0x3e')]=function(_0x376b2c,_0x25e016){var _0x1f9af4={'raw':![],'where':{'id':_0x376b2c['params']['id']}},_0x5742d2={};_0x5742d2[_0x665d('0x2b')]=_[_0x665d('0x2d')](db[_0x665d('0x28')][_0x665d('0x3f')]);_0x5742d2[_0x665d('0x2c')]=_[_0x665d('0x2d')](_0x376b2c[_0x665d('0x2c')]);_0x5742d2[_0x665d('0x2e')]=_[_0x665d('0x40')](_0x5742d2[_0x665d('0x2b')],_0x5742d2[_0x665d('0x2c')]);_0x1f9af4[_0x665d('0x2f')]=_[_0x665d('0x40')](_0x5742d2[_0x665d('0x2b')],qs[_0x665d('0x30')](_0x376b2c[_0x665d('0x2c')][_0x665d('0x30')]));_0x1f9af4['attributes']=_0x1f9af4[_0x665d('0x2f')][_0x665d('0x31')]?_0x1f9af4[_0x665d('0x2f')]:_0x5742d2['model'];if(_0x376b2c[_0x665d('0x2c')]['includeAll']){_0x1f9af4[_0x665d('0x3b')]=[{'all':!![]}];}_0x1f9af4=_['merge']({},_0x1f9af4,_0x376b2c[_0x665d('0x38')]);return db[_0x665d('0x28')]['find'](_0x1f9af4)[_0x665d('0x39')](handleEntityNotFound(_0x25e016,null))[_0x665d('0x39')](respondWithResult(_0x25e016,null))[_0x665d('0x3d')](handleError(_0x25e016,null));};exports[_0x665d('0x41')]=function(_0x30da9b,_0x4314e7){return db[_0x665d('0x28')]['create'](_0x30da9b[_0x665d('0x42')],{})[_0x665d('0x39')](respondWithResult(_0x4314e7,0xc9))[_0x665d('0x3d')](handleError(_0x4314e7,null));};exports['update']=function(_0x502f61,_0x3161c9){if(_0x502f61['body']['id']){delete _0x502f61['body']['id'];}return db['IntegrationReport'][_0x665d('0x43')]({'where':{'id':_0x502f61[_0x665d('0x44')]['id']}})[_0x665d('0x39')](handleEntityNotFound(_0x3161c9,null))[_0x665d('0x39')](saveUpdates(_0x502f61[_0x665d('0x42')],null))[_0x665d('0x39')](respondWithResult(_0x3161c9,null))[_0x665d('0x3d')](handleError(_0x3161c9,null));};exports['destroy']=function(_0x524fe9,_0x3b34b5){return db[_0x665d('0x28')][_0x665d('0x43')]({'where':{'id':_0x524fe9['params']['id']}})[_0x665d('0x39')](handleEntityNotFound(_0x3b34b5,null))['then'](removeEntity(_0x3b34b5,null))['catch'](handleError(_0x3b34b5,null));};exports[_0x665d('0x45')]=function(_0x30016d,_0x891f3d){return db[_0x665d('0x28')][_0x665d('0x45')]()[_0x665d('0x39')](respondWithResult(_0x891f3d,null))[_0x665d('0x3d')](handleError(_0x891f3d,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index a7517e0..31e664e 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 _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 +var _0x88e0=['bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','IntegrationReport','report_integration','lodash','../../config/logger','api','moment'];(function(_0x5df311,_0x148e1a){var _0x278b94=function(_0x5ea803){while(--_0x5ea803){_0x5df311['push'](_0x5df311['shift']());}};_0x278b94(++_0x148e1a);}(_0x88e0,0x98));var _0x088e=function(_0x547c98,_0x273584){_0x547c98=_0x547c98-0x0;var _0x3cd14c=_0x88e0[_0x547c98];return _0x3cd14c;};'use strict';var _=require(_0x088e('0x0'));var util=require('util');var logger=require(_0x088e('0x1'))(_0x088e('0x2'));var moment=require(_0x088e('0x3'));var BPromise=require(_0x088e('0x4'));var rp=require(_0x088e('0x5'));var fs=require('fs');var path=require(_0x088e('0x6'));var rimraf=require(_0x088e('0x7'));var config=require(_0x088e('0x8'));var attributes=require(_0x088e('0x9'));module['exports']=function(_0x1c3de0,_0x26d628){return _0x1c3de0['define'](_0x088e('0xa'),attributes,{'tableName':_0x088e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index b94049b..368ce87 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 _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 +var _0x2542=['info','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x4fe2c5,_0x764f2c){var _0x43db45=function(_0xd172f7){while(--_0xd172f7){_0x4fe2c5['push'](_0x4fe2c5['shift']());}};_0x43db45(++_0x764f2c);}(_0x2542,0x169));var _0x2254=function(_0x5077aa,_0x522b9f){_0x5077aa=_0x5077aa-0x0;var _0x45fdff=_0x2542[_0x5077aa];return _0x45fdff;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 7defd84..7e349cd 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 _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 +var _0x2899=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','getIntervals','post','isAuthenticated','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','delete'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2899,0xfe));var _0x9289=function(_0xaa16d5,_0x2520a7){_0xaa16d5=_0xaa16d5-0x0;var _0x5e61b8=_0x2899[_0xaa16d5];return _0x5e61b8;};'use strict';var multer=require(_0x9289('0x0'));var util=require(_0x9289('0x1'));var path=require(_0x9289('0x2'));var timeout=require(_0x9289('0x3'));var express=require(_0x9289('0x4'));var router=express[_0x9289('0x5')]();var fs_extra=require(_0x9289('0x6'));var auth=require(_0x9289('0x7'));var interaction=require(_0x9289('0x8'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0x9289('0x9')]('/',auth['isAuthenticated'](),controller[_0x9289('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x9289('0xb')]);router[_0x9289('0xc')]('/',auth[_0x9289('0xd')](),controller[_0x9289('0xe')]);router[_0x9289('0xc')]('/:id/sub_intervals',auth[_0x9289('0xd')](),controller[_0x9289('0xf')]);router[_0x9289('0xc')](_0x9289('0x10'),auth[_0x9289('0xd')](),controller[_0x9289('0x11')]);router[_0x9289('0x12')](_0x9289('0x13'),auth[_0x9289('0xd')](),controller[_0x9289('0x14')]);router[_0x9289('0x15')]('/:id',auth[_0x9289('0xd')](),controller['destroy']);module[_0x9289('0x16')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index b273859..0af16bb 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 _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 +var _0xd09e=['STRING','sequelize'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xd09e,0x85));var _0xed09=function(_0x20dd8d,_0x464aca){_0x20dd8d=_0x20dd8d-0x0;var _0xda17db=_0xd09e[_0x20dd8d];return _0xda17db;};'use strict';var Sequelize=require(_0xed09('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xed09('0x1')]},'interval':{'type':Sequelize[_0xed09('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 058d0ec..0e7f431 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 _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 +var _0x2a4d=['to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','get','Intervals','UserProfileResource','destroy','error','name','send','index','Interval','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','update','params','getIntervals','findOne','sort','merge','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x51f8a0,_0x4f425e){var _0x4591d0=function(_0x4e3721){while(--_0x4e3721){_0x51f8a0['push'](_0x51f8a0['shift']());}};_0x4591d0(++_0x4f425e);}(_0x2a4d,0xaf));var _0xd2a4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x2a4d[_0x422905];return _0x33dc6c;};'use strict';var emlformat=require(_0xd2a4('0x0'));var rimraf=require(_0xd2a4('0x1'));var zipdir=require(_0xd2a4('0x2'));var jsonpatch=require(_0xd2a4('0x3'));var rp=require('request-promise');var moment=require(_0xd2a4('0x4'));var BPromise=require(_0xd2a4('0x5'));var Mustache=require(_0xd2a4('0x6'));var util=require(_0xd2a4('0x7'));var path=require(_0xd2a4('0x8'));var sox=require(_0xd2a4('0x9'));var csv=require('to-csv');var ejs=require(_0xd2a4('0xa'));var fs=require('fs');var fs_extra=require(_0xd2a4('0xb'));var _=require(_0xd2a4('0xc'));var squel=require(_0xd2a4('0xd'));var crypto=require(_0xd2a4('0xe'));var jsforce=require(_0xd2a4('0xf'));var deskjs=require(_0xd2a4('0x10'));var toCsv=require(_0xd2a4('0x11'));var querystring=require(_0xd2a4('0x12'));var Papa=require('papaparse');var Redis=require(_0xd2a4('0x13'));var authService=require(_0xd2a4('0x14'));var qs=require(_0xd2a4('0x15'));var as=require(_0xd2a4('0x16'));var hardwareService=require(_0xd2a4('0x17'));var logger=require('../../config/logger')(_0xd2a4('0x18'));var utils=require(_0xd2a4('0x19'));var config=require(_0xd2a4('0x1a'));var licenseUtil=require(_0xd2a4('0x1b'));var db=require(_0xd2a4('0x1c'))['db'];var extensions=require(_0xd2a4('0x1d'));function respondWithStatusCode(_0x52caa7,_0xa45c37){_0xa45c37=_0xa45c37||0xcc;return function(_0xb0d216){if(_0xb0d216){return _0x52caa7[_0xd2a4('0x1e')](_0xa45c37);}return _0x52caa7[_0xd2a4('0x1f')](_0xa45c37)[_0xd2a4('0x20')]();};}function respondWithResult(_0x1bcccd,_0x347ae7){_0x347ae7=_0x347ae7||0xc8;return function(_0x1e47bd){if(_0x1e47bd){return _0x1bcccd[_0xd2a4('0x1f')](_0x347ae7)[_0xd2a4('0x21')](_0x1e47bd);}};}function respondWithFilteredResult(_0x20f80c,_0xbf2168){return function(_0xbdd848){if(_0xbdd848){var _0x5128cf=typeof _0xbf2168[_0xd2a4('0x22')]==='undefined'&&typeof _0xbf2168['limit']===_0xd2a4('0x23');var _0x5d83da=_0xbdd848[_0xd2a4('0x24')];var _0x50579a=_0x5128cf?0x0:_0xbf2168[_0xd2a4('0x22')];var _0x432f01=_0x5128cf?_0xbdd848[_0xd2a4('0x24')]:_0xbf2168[_0xd2a4('0x22')]+_0xbf2168[_0xd2a4('0x25')];var _0x224212;if(_0x432f01>=_0x5d83da){_0x432f01=_0x5d83da;_0x224212=0xc8;}else{_0x224212=0xce;}_0x20f80c[_0xd2a4('0x1f')](_0x224212);return _0x20f80c['set'](_0xd2a4('0x26'),_0x50579a+'-'+_0x432f01+'/'+_0x5d83da)[_0xd2a4('0x21')](_0xbdd848);}return null;};}function patchUpdates(_0x3a0db6){return function(_0x1266c1){try{jsonpatch[_0xd2a4('0x27')](_0x1266c1,_0x3a0db6,!![]);}catch(_0x132f50){return BPromise[_0xd2a4('0x28')](_0x132f50);}return _0x1266c1[_0xd2a4('0x29')]();};}function saveUpdates(_0x336082,_0xb4bfec){return function(_0x3620de){if(_0x3620de){return _0x3620de['update'](_0x336082)[_0xd2a4('0x2a')](function(_0x2ab492){return _0x2ab492;});}return null;};}function removeEntity(_0x1660e1,_0x14702d){return function(_0x228900){if(_0x228900){return _0x228900['destroy']()[_0xd2a4('0x2a')](function(){var _0x332374=_0x228900[_0xd2a4('0x2b')]({'plain':!![]});var _0x1f6b2e=_0xd2a4('0x2c');return db[_0xd2a4('0x2d')][_0xd2a4('0x2e')]({'where':{'type':_0x1f6b2e,'resourceId':_0x332374['id']}})[_0xd2a4('0x2a')](function(){return _0x228900;});})[_0xd2a4('0x2a')](function(){_0x1660e1[_0xd2a4('0x1f')](0xcc)[_0xd2a4('0x20')]();});}};}function handleEntityNotFound(_0x5d5d89,_0x391bb2){return function(_0x37465f){if(!_0x37465f){_0x5d5d89['sendStatus'](0x194);}return _0x37465f;};}function handleError(_0x2ede38,_0x18817c){_0x18817c=_0x18817c||0x1f4;return function(_0x32966a){logger[_0xd2a4('0x2f')](_0x32966a['stack']);if(_0x32966a[_0xd2a4('0x30')]){delete _0x32966a[_0xd2a4('0x30')];}_0x2ede38[_0xd2a4('0x1f')](_0x18817c)[_0xd2a4('0x31')](_0x32966a);};}exports[_0xd2a4('0x32')]=function(_0x3790d0,_0x2c5052){var _0x3eb866={},_0x1505e7={},_0x5898aa={'count':0x0,'rows':[]};var _0x4bad41=_['map'](db[_0xd2a4('0x33')][_0xd2a4('0x34')],function(_0x4b127b){return{'name':_0x4b127b[_0xd2a4('0x35')],'type':_0x4b127b['type'][_0xd2a4('0x36')]};});_0x1505e7[_0xd2a4('0x37')]=_[_0xd2a4('0x38')](_0x4bad41,_0xd2a4('0x30'));_0x1505e7[_0xd2a4('0x39')]=_[_0xd2a4('0x3a')](_0x3790d0[_0xd2a4('0x39')]);_0x1505e7[_0xd2a4('0x3b')]=_[_0xd2a4('0x3c')](_0x1505e7[_0xd2a4('0x37')],_0x1505e7[_0xd2a4('0x39')]);_0x3eb866[_0xd2a4('0x3d')]=_[_0xd2a4('0x3c')](_0x1505e7[_0xd2a4('0x37')],qs['fields'](_0x3790d0[_0xd2a4('0x39')][_0xd2a4('0x3e')]));_0x3eb866[_0xd2a4('0x3d')]=_0x3eb866[_0xd2a4('0x3d')][_0xd2a4('0x3f')]?_0x3eb866[_0xd2a4('0x3d')]:_0x1505e7['model'];if(!_0x3790d0[_0xd2a4('0x39')][_0xd2a4('0x40')](_0xd2a4('0x41'))){_0x3eb866[_0xd2a4('0x25')]=qs[_0xd2a4('0x25')](_0x3790d0[_0xd2a4('0x39')][_0xd2a4('0x25')]);_0x3eb866[_0xd2a4('0x22')]=qs[_0xd2a4('0x22')](_0x3790d0[_0xd2a4('0x39')][_0xd2a4('0x22')]);}_0x3eb866[_0xd2a4('0x42')]=qs['sort'](_0x3790d0[_0xd2a4('0x39')]['sort']);_0x3eb866[_0xd2a4('0x43')]=qs[_0xd2a4('0x3b')](_[_0xd2a4('0x44')](_0x3790d0[_0xd2a4('0x39')],_0x1505e7[_0xd2a4('0x3b')]),_0x4bad41);if(_0x3790d0[_0xd2a4('0x39')][_0xd2a4('0x45')]){_0x3eb866['where']=_['merge'](_0x3eb866[_0xd2a4('0x43')],{'$or':_[_0xd2a4('0x38')](_0x4bad41,function(_0x4a5251){if(_0x4a5251[_0xd2a4('0x46')]!==_0xd2a4('0x47')){var _0x50864d={};_0x50864d[_0x4a5251[_0xd2a4('0x30')]]={'$like':'%'+_0x3790d0[_0xd2a4('0x39')]['filter']+'%'};return _0x50864d;}})});}_0x3eb866=_['merge']({},_0x3eb866,_0x3790d0[_0xd2a4('0x48')]);var _0x471e31={'where':_0x3eb866['where']};return db[_0xd2a4('0x33')][_0xd2a4('0x24')](_0x471e31)[_0xd2a4('0x2a')](function(_0xc766a3){_0x5898aa[_0xd2a4('0x24')]=_0xc766a3;if(_0x3790d0[_0xd2a4('0x39')][_0xd2a4('0x49')]){_0x3eb866[_0xd2a4('0x4a')]=[{'all':!![]}];}return db[_0xd2a4('0x33')][_0xd2a4('0x4b')](_0x3eb866);})[_0xd2a4('0x2a')](function(_0x4cb531){_0x5898aa[_0xd2a4('0x4c')]=_0x4cb531;return _0x5898aa;})['then'](respondWithFilteredResult(_0x2c5052,_0x3eb866))[_0xd2a4('0x4d')](handleError(_0x2c5052,null));};exports['show']=function(_0x4b4c0c,_0x2639fc){var _0x8ef6fe={'raw':!![],'where':{'id':_0x4b4c0c['params']['id']}},_0x224774={};_0x224774[_0xd2a4('0x37')]=_[_0xd2a4('0x3a')](db['Interval'][_0xd2a4('0x34')]);_0x224774[_0xd2a4('0x39')]=_['keys'](_0x4b4c0c[_0xd2a4('0x39')]);_0x224774['filters']=_['intersection'](_0x224774[_0xd2a4('0x37')],_0x224774[_0xd2a4('0x39')]);_0x8ef6fe['attributes']=_[_0xd2a4('0x3c')](_0x224774[_0xd2a4('0x37')],qs['fields'](_0x4b4c0c[_0xd2a4('0x39')][_0xd2a4('0x3e')]));_0x8ef6fe[_0xd2a4('0x3d')]=_0x8ef6fe[_0xd2a4('0x3d')][_0xd2a4('0x3f')]?_0x8ef6fe[_0xd2a4('0x3d')]:_0x224774[_0xd2a4('0x37')];if(_0x4b4c0c[_0xd2a4('0x39')][_0xd2a4('0x49')]){_0x8ef6fe[_0xd2a4('0x4a')]=[{'all':!![]}];}_0x8ef6fe=_['merge']({},_0x8ef6fe,_0x4b4c0c[_0xd2a4('0x48')]);return db[_0xd2a4('0x33')]['find'](_0x8ef6fe)[_0xd2a4('0x2a')](handleEntityNotFound(_0x2639fc,null))[_0xd2a4('0x2a')](respondWithResult(_0x2639fc,null))[_0xd2a4('0x4d')](handleError(_0x2639fc,null));};exports[_0xd2a4('0x4e')]=function(_0x4662b8,_0x17bf11){return db['Interval']['create'](_0x4662b8[_0xd2a4('0x4f')],{})[_0xd2a4('0x2a')](function(_0x16ff2c){var _0x5ede40=_0x4662b8[_0xd2a4('0x50')][_0xd2a4('0x2b')]({'plain':!![]});if(!_0x5ede40)throw new Error(_0xd2a4('0x51'));if(_0x5ede40[_0xd2a4('0x52')]===_0xd2a4('0x50')){var _0x3fb91f=_0x16ff2c[_0xd2a4('0x2b')]({'plain':!![]});var _0x42f4bf=_0xd2a4('0x2c');return db[_0xd2a4('0x53')][_0xd2a4('0x54')]({'where':{'name':_0x42f4bf,'userProfileId':_0x5ede40[_0xd2a4('0x55')]},'raw':!![]})[_0xd2a4('0x2a')](function(_0x147624){if(_0x147624&&_0x147624['autoAssociation']===0x0){return db['UserProfileResource'][_0xd2a4('0x4e')]({'name':_0x3fb91f[_0xd2a4('0x30')],'resourceId':_0x3fb91f['id'],'type':_0x147624['name'],'sectionId':_0x147624['id']},{})['then'](function(){return _0x16ff2c;});}else{return _0x16ff2c;}})['catch'](function(_0x52fdce){logger[_0xd2a4('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52fdce);throw _0x52fdce;});}return _0x16ff2c;})[_0xd2a4('0x2a')](respondWithResult(_0x17bf11,0xc9))[_0xd2a4('0x4d')](handleError(_0x17bf11,null));};exports[_0xd2a4('0x56')]=function(_0x5d309a,_0x29f2fd){if(_0x5d309a['body']['id']){delete _0x5d309a['body']['id'];}return db[_0xd2a4('0x33')]['find']({'where':{'id':_0x5d309a[_0xd2a4('0x57')]['id']}})['then'](handleEntityNotFound(_0x29f2fd,null))[_0xd2a4('0x2a')](saveUpdates(_0x5d309a[_0xd2a4('0x4f')],null))[_0xd2a4('0x2a')](respondWithResult(_0x29f2fd,null))[_0xd2a4('0x4d')](handleError(_0x29f2fd,null));};exports[_0xd2a4('0x2e')]=function(_0xc911ec,_0x245bbc){return db[_0xd2a4('0x33')][_0xd2a4('0x54')]({'where':{'id':_0xc911ec[_0xd2a4('0x57')]['id']}})[_0xd2a4('0x2a')](handleEntityNotFound(_0x245bbc,null))[_0xd2a4('0x2a')](removeEntity(_0x245bbc,null))[_0xd2a4('0x4d')](handleError(_0x245bbc,null));};exports['addInterval']=function(_0x2a2d90,_0x418bd9,_0x1d9b21){if(_0x2a2d90[_0xd2a4('0x4f')]['id']){delete _0x2a2d90[_0xd2a4('0x4f')]['id'];}return db[_0xd2a4('0x33')][_0xd2a4('0x54')]({'where':{'id':_0x2a2d90[_0xd2a4('0x57')]['id']}})[_0xd2a4('0x2a')](handleEntityNotFound(_0x418bd9,null))[_0xd2a4('0x2a')](function(_0x1d27ea){if(_0x1d27ea){_0x2a2d90[_0xd2a4('0x4f')]['IntervalId']=_0x1d27ea['id'];return db[_0xd2a4('0x33')]['create'](_0x2a2d90[_0xd2a4('0x4f')]);}})[_0xd2a4('0x2a')](respondWithResult(_0x418bd9,null))[_0xd2a4('0x4d')](handleError(_0x418bd9,null));};exports[_0xd2a4('0x58')]=function(_0x5dbdf8,_0x45d18a,_0x3d1bc7){var _0x597ade={};var _0x661df={};var _0x4656b4;var _0x74158;return db[_0xd2a4('0x33')][_0xd2a4('0x59')]({'where':{'id':_0x5dbdf8[_0xd2a4('0x57')]['id']}})[_0xd2a4('0x2a')](handleEntityNotFound(_0x45d18a,null))['then'](function(_0x3399e3){if(_0x3399e3){_0x4656b4=_0x3399e3;_0x661df[_0xd2a4('0x37')]=_[_0xd2a4('0x3a')](db['Interval']['rawAttributes']);_0x661df[_0xd2a4('0x39')]=_[_0xd2a4('0x3a')](_0x5dbdf8[_0xd2a4('0x39')]);_0x661df['filters']=_[_0xd2a4('0x3c')](_0x661df[_0xd2a4('0x37')],_0x661df[_0xd2a4('0x39')]);_0x597ade['attributes']=_[_0xd2a4('0x3c')](_0x661df[_0xd2a4('0x37')],qs[_0xd2a4('0x3e')](_0x5dbdf8[_0xd2a4('0x39')][_0xd2a4('0x3e')]));_0x597ade[_0xd2a4('0x3d')]=_0x597ade[_0xd2a4('0x3d')]['length']?_0x597ade[_0xd2a4('0x3d')]:_0x661df[_0xd2a4('0x37')];_0x597ade[_0xd2a4('0x42')]=qs[_0xd2a4('0x5a')](_0x5dbdf8[_0xd2a4('0x39')]['sort']);_0x597ade[_0xd2a4('0x43')]=qs[_0xd2a4('0x3b')](_[_0xd2a4('0x44')](_0x5dbdf8[_0xd2a4('0x39')],_0x661df[_0xd2a4('0x3b')]));if(_0x5dbdf8[_0xd2a4('0x39')][_0xd2a4('0x45')]){_0x597ade[_0xd2a4('0x43')]=_[_0xd2a4('0x5b')](_0x597ade[_0xd2a4('0x43')],{'$or':_[_0xd2a4('0x38')](_0x597ade[_0xd2a4('0x3d')],function(_0x1e636a){var _0x42a9fb={};_0x42a9fb[_0x1e636a]={'$like':'%'+_0x5dbdf8['query'][_0xd2a4('0x45')]+'%'};return _0x42a9fb;})});}_0x597ade=_[_0xd2a4('0x5b')]({},_0x597ade,_0x5dbdf8['options']);return _0x4656b4['getIntervals'](_0x597ade);}})[_0xd2a4('0x2a')](function(_0x178a57){if(_0x178a57){_0x74158=_0x178a57[_0xd2a4('0x3f')];if(!_0x5dbdf8[_0xd2a4('0x39')]['hasOwnProperty'](_0xd2a4('0x41'))){_0x597ade[_0xd2a4('0x25')]=qs[_0xd2a4('0x25')](_0x5dbdf8[_0xd2a4('0x39')][_0xd2a4('0x25')]);_0x597ade[_0xd2a4('0x22')]=qs[_0xd2a4('0x22')](_0x5dbdf8[_0xd2a4('0x39')]['offset']);}return _0x4656b4[_0xd2a4('0x58')](_0x597ade);}})[_0xd2a4('0x2a')](function(_0x212ff7){if(_0x212ff7){return _0x212ff7?{'count':_0x74158,'rows':_0x212ff7}:null;}})['then'](respondWithResult(_0x45d18a,null))['catch'](handleError(_0x45d18a,null));};exports[_0xd2a4('0x5c')]=function(_0xca6d4e,_0x3ed106,_0x2afdee){return db[_0xd2a4('0x33')]['findOne']({'where':{'id':_0xca6d4e[_0xd2a4('0x57')]['id']}})['then'](handleEntityNotFound(_0x3ed106,null))[_0xd2a4('0x2a')](function(_0x1f7972){if(_0x1f7972){return db[_0xd2a4('0x5d')][_0xd2a4('0x5e')](function(_0x1e46fa){return db[_0xd2a4('0x33')][_0xd2a4('0x2e')]({'where':{'IntervalId':_0xca6d4e[_0xd2a4('0x57')]['id']},'transaction':_0x1e46fa})[_0xd2a4('0x2a')](function(_0x154118){var _0x2ea819=_[_0xd2a4('0x38')](_0xca6d4e['body'],function(_0x404fab){delete _0x404fab['id'];_0x404fab['IntervalId']=_0xca6d4e['params']['id'];return _0x404fab;});return db[_0xd2a4('0x33')][_0xd2a4('0x5f')](_0x2ea819,{'transaction':_0x1e46fa});});})[_0xd2a4('0x2a')](function(){return db[_0xd2a4('0x33')][_0xd2a4('0x4b')]({'where':{'IntervalId':_0xca6d4e['params']['id']}});});}})[_0xd2a4('0x2a')](respondWithResult(_0x3ed106,null))[_0xd2a4('0x4d')](handleError(_0x3ed106,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 327c417..572f341 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 _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 +var _0x2535=['map','ifTime','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','exports','define','rewrite','interval','string','getIntervals','then','all'];(function(_0x17e3e7,_0xeb44ba){var _0x235adc=function(_0xba389f){while(--_0xba389f){_0x17e3e7['push'](_0x17e3e7['shift']());}};_0x235adc(++_0xeb44ba);}(_0x2535,0x10c));var _0x5253=function(_0x26ff90,_0x5e77bf){_0x26ff90=_0x26ff90-0x0;var _0x582360=_0x2535[_0x26ff90];return _0x582360;};'use strict';var attributes=require(_0x5253('0x0'));var extensions=require(_0x5253('0x1'));var iftime=require(_0x5253('0x2'))[_0x5253('0x3')];module[_0x5253('0x4')]=function(_0x1aacaa){return _0x1aacaa[_0x5253('0x5')]('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x473de0){extensions[_0x5253('0x6')](_0x1aacaa,_0x473de0);},'afterBulkCreate':function(_0x1340c9,_0x4e14fa,_0x335c29){_0x335c29();extensions[_0x5253('0x6')](_0x1aacaa,_0x1340c9[0x0]);},'afterUpdate':function(_0x3871fa){extensions[_0x5253('0x6')](_0x1aacaa,_0x3871fa);},'afterDestroy':function(_0x282147){extensions[_0x5253('0x6')](_0x1aacaa,_0x282147);}},'instanceMethods':{'ifTime':function(_0x5ac340=undefined,_0x27049f=new Date()){if(typeof this[_0x5253('0x7')]===_0x5253('0x8')){return iftime(this[_0x5253('0x7')],_0x5ac340,_0x27049f);}else{return this[_0x5253('0x9')]()[_0x5253('0xa')](function(_0x5c30b8){return Promise[_0x5253('0xb')](_0x5c30b8[_0x5253('0xc')](function(_0x3cb646){return _0x3cb646[_0x5253('0xd')](_0x5ac340,_0x27049f);}));})['then'](function(_0x36783f){return _0x36783f['reduce'](function(_0x554715,_0x175ad7){return _0x554715||_0x175ad7;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index b733c48..8d797bf 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 _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 +var _0xbe25=['Interval','options','raw','where','attributes','limit','include','map','model','then','info','catch','error','message','ShowInterval','debug','stringify','findAll','all','ifTime','reduce','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','name','IntervalIftime','isArray','intervals','timezone','length','format','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','silly','resolve','lodash','util','iftime','rpc','GetInterval'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe25,0x11a));var _0x5be2=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xbe25[_0x26462c];return _0x509a42;};'use strict';var _=require(_0x5be2('0x0'));var util=require(_0x5be2('0x1'));var db=require('../../mysqldb')['db'];var iftime=require('../../utils/iftime')[_0x5be2('0x2')];var logger=require('../../config/logger')(_0x5be2('0x3'));exports[_0x5be2('0x4')]=function(_0x4efee9){var _0x55d101=this;return new Promise(function(_0x17aae3,_0x35dd43){return db[_0x5be2('0x5')]['findAll']({'raw':_0x4efee9[_0x5be2('0x6')]?_0x4efee9[_0x5be2('0x6')][_0x5be2('0x7')]===undefined?!![]:![]:!![],'where':_0x4efee9['options']?_0x4efee9['options'][_0x5be2('0x8')]||null:null,'attributes':_0x4efee9[_0x5be2('0x6')]?_0x4efee9[_0x5be2('0x6')][_0x5be2('0x9')]||null:null,'limit':_0x4efee9['options']?_0x4efee9[_0x5be2('0x6')][_0x5be2('0xa')]||null:null,'include':_0x4efee9[_0x5be2('0x6')]?_0x4efee9[_0x5be2('0x6')][_0x5be2('0xb')]?_[_0x5be2('0xc')](_0x4efee9[_0x5be2('0x6')][_0x5be2('0xb')],function(_0x544db7){return{'model':db[_0x544db7[_0x5be2('0xd')]],'as':_0x544db7['as'],'attributes':_0x544db7[_0x5be2('0x9')],'include':_0x544db7[_0x5be2('0xb')]?_['map'](_0x544db7[_0x5be2('0xb')],function(_0x189d0f){return{'model':db[_0x189d0f[_0x5be2('0xd')]],'as':_0x189d0f['as'],'attributes':_0x189d0f['attributes'],'include':_0x189d0f['include']?_[_0x5be2('0xc')](_0x189d0f[_0x5be2('0xb')],function(_0x5bab07){return{'model':db[_0x5bab07[_0x5be2('0xd')]],'as':_0x5bab07['as'],'attributes':_0x5bab07['attributes']};}):[]};}):[]};}):[]:[]})[_0x5be2('0xe')](function(_0x271e69){logger[_0x5be2('0xf')](_0x5be2('0x4'),_0x4efee9);logger['debug']('GetInterval',_0x4efee9,JSON['stringify'](_0x271e69));_0x17aae3(_0x271e69);})[_0x5be2('0x10')](function(_0x2f4710){logger[_0x5be2('0x11')](_0x5be2('0x4'),_0x2f4710[_0x5be2('0x12')],_0x4efee9);_0x35dd43(_0x55d101[_0x5be2('0x11')](0x1f4,_0x2f4710[_0x5be2('0x12')]));});});};exports[_0x5be2('0x13')]=function(_0x1b1878){var _0x12b029=this;return new Promise(function(_0x1efa40,_0xf78fa4){return db['Interval']['find']({'raw':_0x1b1878['options']?_0x1b1878['options'][_0x5be2('0x7')]===undefined?!![]:![]:!![],'where':_0x1b1878[_0x5be2('0x6')]?_0x1b1878['options'][_0x5be2('0x8')]||null:null,'attributes':_0x1b1878[_0x5be2('0x6')]?_0x1b1878[_0x5be2('0x6')]['attributes']||null:null,'include':_0x1b1878[_0x5be2('0x6')]?_0x1b1878['options'][_0x5be2('0xb')]?_[_0x5be2('0xc')](_0x1b1878['options'][_0x5be2('0xb')],function(_0x42b73c){return{'model':db[_0x42b73c[_0x5be2('0xd')]],'as':_0x42b73c['as'],'attributes':_0x42b73c[_0x5be2('0x9')],'include':_0x42b73c[_0x5be2('0xb')]?_[_0x5be2('0xc')](_0x42b73c['include'],function(_0xad040f){return{'model':db[_0xad040f[_0x5be2('0xd')]],'as':_0xad040f['as'],'attributes':_0xad040f[_0x5be2('0x9')],'include':_0xad040f[_0x5be2('0xb')]?_[_0x5be2('0xc')](_0xad040f[_0x5be2('0xb')],function(_0x334c03){return{'model':db[_0x334c03[_0x5be2('0xd')]],'as':_0x334c03['as'],'attributes':_0x334c03[_0x5be2('0x9')]};}):[]};}):[]};}):[]:[]})[_0x5be2('0xe')](function(_0x4b0e47){logger[_0x5be2('0xf')](_0x5be2('0x13'),_0x1b1878);logger[_0x5be2('0x14')](_0x5be2('0x13'),_0x1b1878,JSON[_0x5be2('0x15')](_0x4b0e47));_0x1efa40(_0x4b0e47);})[_0x5be2('0x10')](function(_0x4cdfec){logger[_0x5be2('0x11')](_0x5be2('0x13'),_0x4cdfec[_0x5be2('0x12')],_0x1b1878);_0xf78fa4(_0x12b029[_0x5be2('0x11')](0x1f4,_0x4cdfec[_0x5be2('0x12')]));});});};function checkArrayOfIntervals(_0x579799,_0x5c5e66){var _0xe8f963=[];return db[_0x5be2('0x5')][_0x5be2('0x16')]({'where':{'id':_0x579799}})['then'](function(_0x4fbdf8){_0xe8f963=_0x4fbdf8;return Promise[_0x5be2('0x17')](_0xe8f963['map'](function(_0x2daf8a){return _0x2daf8a[_0x5be2('0x18')](_0x5c5e66);}));})[_0x5be2('0xe')](function(_0x3a1757){var _0x5103b4=_0x3a1757[_0x5be2('0x19')](function(_0x2e73fd,_0x4f51ae){return _0x2e73fd||_0x4f51ae;},![]);logger[_0x5be2('0xf')](util['format'](_0x5be2('0x1a'),_0xe8f963[_0x5be2('0xc')](function(_0x19f54c){return _0x19f54c['name'];})[_0x5be2('0x1b')](',\x20'),_0xe8f963[_0x5be2('0xc')](function(_0x25bc80){return _0x25bc80['id'];})[_0x5be2('0x1b')](',\x20')));return _0x5103b4;});}function checkSingleInterval(_0x5d652f,_0x608b59){return db['Interval'][_0x5be2('0x1c')](_0x5d652f)[_0x5be2('0xe')](function(_0x343231){if(_0x343231){logger[_0x5be2('0xf')](util['format'](_0x5be2('0x1d'),_0x343231[_0x5be2('0x1e')],_0x343231['id']));return _0x343231[_0x5be2('0x18')](_0x608b59);}});}exports[_0x5be2('0x1f')]=function(_0x489899){var _0x2e05fb=_0x489899['intervalIds'];var _0x14f28a=Array[_0x5be2('0x20')](_0x489899[_0x5be2('0x21')])?_0x489899[_0x5be2('0x21')]:typeof _0x489899[_0x5be2('0x21')]==='string'?[_0x489899[_0x5be2('0x21')]]:[];var _0x3005aa=_0x489899[_0x5be2('0x22')]||undefined;var _0x58bfc8=![];if(_0x14f28a[_0x5be2('0x23')]){logger[_0x5be2('0xf')](util[_0x5be2('0x24')](_0x5be2('0x25'),_0x14f28a['join'](';\x20')));}if(_0x3005aa){logger[_0x5be2('0xf')](util['format'](_0x5be2('0x26'),_0x3005aa));}logger[_0x5be2('0x14')]('Iftime',_0x58bfc8);logger[_0x5be2('0x27')]('IntervalIftime',_0x489899);return Promise[_0x5be2('0x28')]()[_0x5be2('0xe')](function(){if(Array[_0x5be2('0x20')](_0x2e05fb)){return checkArrayOfIntervals(_0x2e05fb,_0x3005aa);}else if(_0x2e05fb){return checkSingleInterval(_0x2e05fb,_0x3005aa);}})['then'](function(_0x5cd530){var _0x1fd77c=_0x14f28a[_0x5be2('0x19')](function(_0x4e4837,_0x56c8c7){return _0x4e4837||iftime(_0x56c8c7,_0x3005aa);},![]);_0x58bfc8=_0x5cd530||_0x1fd77c;return _0x58bfc8;})[_0x5be2('0x10')](function(_0x58fd6e){logger['error']('IntervalIftime',_0x489899,_0x58fd6e);throw this[_0x5be2('0x11')](0x1f4,_0x58fd6e['message']);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 386e32f..6c333db 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 _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 +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x3b15f5,_0x588262){var _0x57726d=function(_0x29c3d4){while(--_0x29c3d4){_0x3b15f5['push'](_0x3b15f5['shift']());}};_0x57726d(++_0x588262);}(_0xdb28,0x106));var _0x8db2=function(_0x4169f5,_0x42e1de){_0x4169f5=_0x4169f5-0x0;var _0x46dc7c=_0xdb28[_0x4169f5];return _0x46dc7c;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index a3b6cd1..b5967ed 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 _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 +var _0xca07=['parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','openIssue','send','headers','x-forwarded-for','socket','remoteAddress','connection','body','bluebird','../../config/logger','MOTGUI','Report','description','Bug','fields','customfield_11500','email','newToken','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','Basic\x20','toString','stringify','setEncoding','utf8','data','status','statusCode','json'];(function(_0xa7fcdd,_0x2316e2){var _0x44f3c2=function(_0xcd8e5b){while(--_0xcd8e5b){_0xa7fcdd['push'](_0xa7fcdd['shift']());}};_0x44f3c2(++_0x2316e2);}(_0xca07,0xf2));var _0x7ca0=function(_0x18bfdb,_0x241d43){_0x18bfdb=_0x18bfdb-0x0;var _0x44334c=_0xca07[_0x18bfdb];return _0x44334c;};'use strict';var BPromise=require(_0x7ca0('0x0'));var https=require('https');var logger=require(_0x7ca0('0x1'))('api');var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x38e868,_0x113982){var _0x444aec={'fields':{'project':{'key':_0x38e868['key']||_0x7ca0('0x2')},'summary':(_0x38e868['summary']||_0x7ca0('0x3'))+'\x20from\x20'+_0x38e868['ip'],'description':_0x38e868[_0x7ca0('0x4')]||JSON['stringify'](_0x38e868),'issuetype':{'name':_0x38e868['issuetype']||_0x7ca0('0x5')}}};_0x444aec[_0x7ca0('0x6')][_0x7ca0('0x7')]=_0x38e868[_0x7ca0('0x8')];_0x444aec['fields']['customfield_11501']=_0x38e868['oldToken'];_0x444aec[_0x7ca0('0x6')]['customfield_11502']=_0x38e868[_0x7ca0('0x9')];_0x444aec['fields']['customfield_11503']=_0x38e868['name'];_0x444aec['fields'][_0x7ca0('0xa')]=_0x38e868[_0x7ca0('0xb')];_0x444aec[_0x7ca0('0x6')][_0x7ca0('0xc')]=_0x38e868['ip'];var _0x1f939e={'host':_0x7ca0('0xd'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x7ca0('0xe'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x7ca0('0xf')+new Buffer(USERNAME+':'+PASSWORD)[_0x7ca0('0x10')]('base64')}};var _0x32252d=JSON[_0x7ca0('0x11')](_0x444aec);var _0x48eecc=https['request'](_0x1f939e,function(_0x204ae4){_0x204ae4[_0x7ca0('0x12')](_0x7ca0('0x13'));var _0x3d7dc8='';_0x204ae4['on'](_0x7ca0('0x14'),function(_0x4c998b){_0x3d7dc8+=_0x4c998b;});_0x204ae4['on']('end',function(){if(_0x113982){return _0x113982[_0x7ca0('0x15')](_0x204ae4[_0x7ca0('0x16')])[_0x7ca0('0x17')](JSON[_0x7ca0('0x18')](_0x3d7dc8));}});});_0x48eecc['on'](_0x7ca0('0x19'),function(_0x48011a){if(_0x113982){return _0x113982[_0x7ca0('0x15')](0x1f4)[_0x7ca0('0x17')]({'errors':[{'message':_0x7ca0('0x1a'),'type':_0x7ca0('0x1b')}]});}});_0x48eecc[_0x7ca0('0x1c')](_0x32252d);_0x48eecc[_0x7ca0('0x1d')]();}exports[_0x7ca0('0x1e')]=openIssue;exports[_0x7ca0('0x1f')]=function(_0x512deb,_0x1943d8){_0x512deb['body']['ip']=_0x512deb[_0x7ca0('0x20')][_0x7ca0('0x21')]||_0x512deb['connection']['remoteAddress']||_0x512deb[_0x7ca0('0x22')][_0x7ca0('0x23')]||_0x512deb[_0x7ca0('0x24')][_0x7ca0('0x22')][_0x7ca0('0x23')];return openIssue(_0x512deb[_0x7ca0('0x25')],_0x1943d8);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 47486bc..2474137 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 _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 +var _0x17ba=['/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x17ba,0xab));var _0xa17b=function(_0x265172,_0x2252c3){_0x265172=_0x265172-0x0;var _0x5442f1=_0x17ba[_0x265172];return _0x5442f1;};'use strict';var multer=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var path=require('path');var timeout=require(_0xa17b('0x2'));var express=require(_0xa17b('0x3'));var router=express[_0xa17b('0x4')]();var fs_extra=require(_0xa17b('0x5'));var auth=require(_0xa17b('0x6'));var interaction=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var controller=require(_0xa17b('0x9'));router[_0xa17b('0xa')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0xc')]);router[_0xa17b('0xa')](_0xa17b('0xd'),auth[_0xa17b('0xb')](),controller[_0xa17b('0xe')]);router[_0xa17b('0xa')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x10')]);router['post']('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0x11')]);router[_0xa17b('0x12')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x13')]);router[_0xa17b('0x14')]('/:id',auth[_0xa17b('0xb')](),controller[_0xa17b('0x15')]);module[_0xa17b('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 91dbd3e..9c13bce 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(_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 +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x7a54,0x106));var _0x47a5=function(_0x269e6c,_0x402e12){_0x269e6c=_0x269e6c-0x0;var _0x6ff286=_0x7a54[_0x269e6c];return _0x6ff286;};'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 1eec4d3..6344b89 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 _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 +var _0x0a52=['show','params','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','nolimit','sort','filters','pick','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x158081,_0x4cef4d){var _0x50bd1f=function(_0x5a2169){while(--_0x5a2169){_0x158081['push'](_0x158081['shift']());}};_0x50bd1f(++_0x4cef4d);}(_0x0a52,0xe4));var _0x20a5=function(_0x2851c5,_0x3da017){_0x2851c5=_0x2851c5-0x0;var _0x463a6e=_0x0a52[_0x2851c5];return _0x463a6e;};'use strict';var emlformat=require(_0x20a5('0x0'));var rimraf=require(_0x20a5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x20a5('0x2'));var rp=require(_0x20a5('0x3'));var moment=require(_0x20a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x20a5('0x5'));var util=require(_0x20a5('0x6'));var path=require(_0x20a5('0x7'));var sox=require(_0x20a5('0x8'));var csv=require(_0x20a5('0x9'));var ejs=require(_0x20a5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x20a5('0xb'));var crypto=require(_0x20a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x20a5('0xd'));var toCsv=require(_0x20a5('0x9'));var querystring=require(_0x20a5('0xe'));var Papa=require(_0x20a5('0xf'));var Redis=require('ioredis');var authService=require(_0x20a5('0x10'));var qs=require(_0x20a5('0x11'));var as=require(_0x20a5('0x12'));var hardwareService=require(_0x20a5('0x13'));var logger=require(_0x20a5('0x14'))(_0x20a5('0x15'));var utils=require(_0x20a5('0x16'));var config=require(_0x20a5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x20a5('0x18'))['db'];function respondWithStatusCode(_0x5e6c3b,_0xd07281){_0xd07281=_0xd07281||0xcc;return function(_0x429c69){if(_0x429c69){return _0x5e6c3b['sendStatus'](_0xd07281);}return _0x5e6c3b[_0x20a5('0x19')](_0xd07281)[_0x20a5('0x1a')]();};}function respondWithResult(_0x46acee,_0x43528b){_0x43528b=_0x43528b||0xc8;return function(_0x42bc38){if(_0x42bc38){return _0x46acee[_0x20a5('0x19')](_0x43528b)[_0x20a5('0x1b')](_0x42bc38);}};}function respondWithFilteredResult(_0x254546,_0x39b063){return function(_0x446a4f){if(_0x446a4f){var _0x24e1b0=typeof _0x39b063[_0x20a5('0x1c')]==='undefined'&&typeof _0x39b063[_0x20a5('0x1d')]==='undefined';var _0x312978=_0x446a4f[_0x20a5('0x1e')];var _0x11a4e3=_0x24e1b0?0x0:_0x39b063[_0x20a5('0x1c')];var _0x2cb0e8=_0x24e1b0?_0x446a4f[_0x20a5('0x1e')]:_0x39b063[_0x20a5('0x1c')]+_0x39b063['limit'];var _0x43cd40;if(_0x2cb0e8>=_0x312978){_0x2cb0e8=_0x312978;_0x43cd40=0xc8;}else{_0x43cd40=0xce;}_0x254546['status'](_0x43cd40);return _0x254546[_0x20a5('0x1f')](_0x20a5('0x20'),_0x11a4e3+'-'+_0x2cb0e8+'/'+_0x312978)[_0x20a5('0x1b')](_0x446a4f);}return null;};}function patchUpdates(_0x3bf093){return function(_0x40e28e){try{jsonpatch[_0x20a5('0x21')](_0x40e28e,_0x3bf093,!![]);}catch(_0xf577cd){return BPromise[_0x20a5('0x22')](_0xf577cd);}return _0x40e28e[_0x20a5('0x23')]();};}function saveUpdates(_0x1e43e4,_0x42c159){return function(_0x580d39){if(_0x580d39){return _0x580d39[_0x20a5('0x24')](_0x1e43e4)[_0x20a5('0x25')](function(_0x39ac06){return _0x39ac06;});}return null;};}function removeEntity(_0x4d4052,_0x370efa){return function(_0x1b2850){if(_0x1b2850){return _0x1b2850[_0x20a5('0x26')]()[_0x20a5('0x25')](function(){_0x4d4052['status'](0xcc)[_0x20a5('0x1a')]();});}};}function handleEntityNotFound(_0x3103bd,_0x16022f){return function(_0x21978f){if(!_0x21978f){_0x3103bd[_0x20a5('0x27')](0x194);}return _0x21978f;};}function handleError(_0x23239d,_0x171cd5){_0x171cd5=_0x171cd5||0x1f4;return function(_0x3987c5){logger['error'](_0x3987c5['stack']);if(_0x3987c5[_0x20a5('0x28')]){delete _0x3987c5[_0x20a5('0x28')];}_0x23239d['status'](_0x171cd5)[_0x20a5('0x29')](_0x3987c5);};}exports[_0x20a5('0x2a')]=function(_0x2b891c,_0x38bae9){var _0x5a84be={},_0x33f000={},_0x571e92={'count':0x0,'rows':[]};var _0x96280e=_[_0x20a5('0x2b')](db[_0x20a5('0x2c')][_0x20a5('0x2d')],function(_0xf23890){return{'name':_0xf23890[_0x20a5('0x2e')],'type':_0xf23890['type'][_0x20a5('0x2f')]};});_0x33f000[_0x20a5('0x30')]=_[_0x20a5('0x2b')](_0x96280e,_0x20a5('0x28'));_0x33f000['query']=_[_0x20a5('0x31')](_0x2b891c[_0x20a5('0x32')]);_0x33f000['filters']=_[_0x20a5('0x33')](_0x33f000[_0x20a5('0x30')],_0x33f000[_0x20a5('0x32')]);_0x5a84be[_0x20a5('0x34')]=_[_0x20a5('0x33')](_0x33f000[_0x20a5('0x30')],qs[_0x20a5('0x35')](_0x2b891c['query'][_0x20a5('0x35')]));_0x5a84be[_0x20a5('0x34')]=_0x5a84be[_0x20a5('0x34')][_0x20a5('0x36')]?_0x5a84be[_0x20a5('0x34')]:_0x33f000[_0x20a5('0x30')];if(!_0x2b891c[_0x20a5('0x32')]['hasOwnProperty'](_0x20a5('0x37'))){_0x5a84be[_0x20a5('0x1d')]=qs[_0x20a5('0x1d')](_0x2b891c[_0x20a5('0x32')]['limit']);_0x5a84be[_0x20a5('0x1c')]=qs[_0x20a5('0x1c')](_0x2b891c[_0x20a5('0x32')][_0x20a5('0x1c')]);}_0x5a84be['order']=qs[_0x20a5('0x38')](_0x2b891c['query'][_0x20a5('0x38')]);_0x5a84be['where']=qs[_0x20a5('0x39')](_[_0x20a5('0x3a')](_0x2b891c[_0x20a5('0x32')],_0x33f000[_0x20a5('0x39')]),_0x96280e);if(_0x2b891c[_0x20a5('0x32')]['filter']){_0x5a84be[_0x20a5('0x3b')]=_[_0x20a5('0x3c')](_0x5a84be[_0x20a5('0x3b')],{'$or':_[_0x20a5('0x2b')](_0x96280e,function(_0x2bdc15){if(_0x2bdc15[_0x20a5('0x3d')]!==_0x20a5('0x3e')){var _0x110550={};_0x110550[_0x2bdc15['name']]={'$like':'%'+_0x2b891c[_0x20a5('0x32')]['filter']+'%'};return _0x110550;}})});}_0x5a84be=_[_0x20a5('0x3c')]({},_0x5a84be,_0x2b891c[_0x20a5('0x3f')]);var _0x16c726={'where':_0x5a84be[_0x20a5('0x3b')]};return db['JscriptyAnswerReport'][_0x20a5('0x1e')](_0x16c726)[_0x20a5('0x25')](function(_0x26fdee){_0x571e92['count']=_0x26fdee;if(_0x2b891c['query'][_0x20a5('0x40')]){_0x5a84be[_0x20a5('0x41')]=[{'all':!![]}];}return db[_0x20a5('0x2c')][_0x20a5('0x42')](_0x5a84be);})[_0x20a5('0x25')](function(_0x96baad){_0x571e92[_0x20a5('0x43')]=_0x96baad;return _0x571e92;})[_0x20a5('0x25')](respondWithFilteredResult(_0x38bae9,_0x5a84be))['catch'](handleError(_0x38bae9,null));};exports[_0x20a5('0x44')]=function(_0xc8c498,_0x3c3b4a){var _0x9b618e={'raw':!![],'where':{'id':_0xc8c498[_0x20a5('0x45')]['id']}},_0x4d6a1e={};_0x4d6a1e[_0x20a5('0x30')]=_['keys'](db['JscriptyAnswerReport'][_0x20a5('0x2d')]);_0x4d6a1e['query']=_[_0x20a5('0x31')](_0xc8c498['query']);_0x4d6a1e[_0x20a5('0x39')]=_[_0x20a5('0x33')](_0x4d6a1e['model'],_0x4d6a1e[_0x20a5('0x32')]);_0x9b618e['attributes']=_[_0x20a5('0x33')](_0x4d6a1e[_0x20a5('0x30')],qs[_0x20a5('0x35')](_0xc8c498[_0x20a5('0x32')][_0x20a5('0x35')]));_0x9b618e['attributes']=_0x9b618e[_0x20a5('0x34')][_0x20a5('0x36')]?_0x9b618e['attributes']:_0x4d6a1e['model'];if(_0xc8c498[_0x20a5('0x32')][_0x20a5('0x40')]){_0x9b618e[_0x20a5('0x41')]=[{'all':!![]}];}_0x9b618e=_[_0x20a5('0x3c')]({},_0x9b618e,_0xc8c498[_0x20a5('0x3f')]);return db['JscriptyAnswerReport'][_0x20a5('0x46')](_0x9b618e)[_0x20a5('0x25')](handleEntityNotFound(_0x3c3b4a,null))[_0x20a5('0x25')](respondWithResult(_0x3c3b4a,null))[_0x20a5('0x47')](handleError(_0x3c3b4a,null));};exports[_0x20a5('0x48')]=function(_0x23c27f,_0x42aa14){return db[_0x20a5('0x2c')][_0x20a5('0x48')](_0x23c27f['body'],{})[_0x20a5('0x25')](respondWithResult(_0x42aa14,0xc9))[_0x20a5('0x47')](handleError(_0x42aa14,null));};exports[_0x20a5('0x24')]=function(_0x1e6981,_0x78729f){if(_0x1e6981['body']['id']){delete _0x1e6981[_0x20a5('0x49')]['id'];}return db[_0x20a5('0x2c')]['find']({'where':{'id':_0x1e6981[_0x20a5('0x45')]['id']}})[_0x20a5('0x25')](handleEntityNotFound(_0x78729f,null))[_0x20a5('0x25')](saveUpdates(_0x1e6981['body'],null))[_0x20a5('0x25')](respondWithResult(_0x78729f,null))[_0x20a5('0x47')](handleError(_0x78729f,null));};exports[_0x20a5('0x26')]=function(_0x45ef54,_0x58fa88){return db[_0x20a5('0x2c')][_0x20a5('0x46')]({'where':{'id':_0x45ef54[_0x20a5('0x45')]['id']}})[_0x20a5('0x25')](handleEntityNotFound(_0x58fa88,null))[_0x20a5('0x25')](removeEntity(_0x58fa88,null))[_0x20a5('0x47')](handleError(_0x58fa88,null));};exports['describe']=function(_0x4ad70d,_0x40ad8b){return db[_0x20a5('0x2c')]['describe']()[_0x20a5('0x25')](respondWithResult(_0x40ad8b,null))['catch'](handleError(_0x40ad8b,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 7172633..1ffa012 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 _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 +var _0xd360=['../../config/logger','moment','bluebird','request-promise','path','rimraf','JscriptyAnswerReport','report_jscripty_answers','lodash','util'];(function(_0x11df64,_0x2d8ef3){var _0x45e801=function(_0x115b32){while(--_0x115b32){_0x11df64['push'](_0x11df64['shift']());}};_0x45e801(++_0x2d8ef3);}(_0xd360,0x80));var _0x0d36=function(_0x255258,_0x335596){_0x255258=_0x255258-0x0;var _0x50c7af=_0xd360[_0x255258];return _0x50c7af;};'use strict';var _=require(_0x0d36('0x0'));var util=require(_0x0d36('0x1'));var logger=require(_0x0d36('0x2'))('api');var moment=require(_0x0d36('0x3'));var BPromise=require(_0x0d36('0x4'));var rp=require(_0x0d36('0x5'));var fs=require('fs');var path=require(_0x0d36('0x6'));var rimraf=require(_0x0d36('0x7'));var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x12cc9b,_0x502af8){return _0x12cc9b['define'](_0x0d36('0x8'),attributes,{'tableName':_0x0d36('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index f74c4a8..ac64cb4 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 _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 +var _0x986d=['debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','util','moment','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s'];(function(_0x1b2898,_0x47b261){var _0x2a47eb=function(_0x309d34){while(--_0x309d34){_0x1b2898['push'](_0x1b2898['shift']());}};_0x2a47eb(++_0x47b261);}(_0x986d,0x137));var _0xd986=function(_0x42b592,_0x28f828){_0x42b592=_0x42b592-0x0;var _0x6338fb=_0x986d[_0x42b592];return _0x6338fb;};'use strict';var _=require('lodash');var util=require(_0xd986('0x0'));var moment=require(_0xd986('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd986('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd986('0x3'))('rpc');var config=require(_0xd986('0x4'));var jayson=require(_0xd986('0x5'));var client=jayson[_0xd986('0x6')][_0xd986('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2412ca,_0x56ca9e,_0x492f16){return new BPromise(function(_0x5a4e82,_0x2df7de){return client[_0xd986('0x8')](_0x2412ca,_0x492f16)[_0xd986('0x9')](function(_0x5e6a53){logger[_0xd986('0xa')](_0xd986('0xb'),_0x56ca9e,'request\x20sent');logger[_0xd986('0xc')](_0xd986('0xd'),_0x56ca9e,_0xd986('0xe'),JSON[_0xd986('0xf')](_0x5e6a53));if(_0x5e6a53['error']){if(_0x5e6a53[_0xd986('0x10')]['code']===0x1f4){logger[_0xd986('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x56ca9e,_0x5e6a53[_0xd986('0x10')][_0xd986('0x11')]);return _0x2df7de(_0x5e6a53[_0xd986('0x10')][_0xd986('0x11')]);}logger[_0xd986('0x10')](_0xd986('0xb'),_0x56ca9e,_0x5e6a53[_0xd986('0x10')][_0xd986('0x11')]);return _0x5a4e82(_0x5e6a53['error']['message']);}else{logger['info'](_0xd986('0xb'),_0x56ca9e,'request\x20sent');_0x5a4e82(_0x5e6a53[_0xd986('0x12')][_0xd986('0x11')]);}})['catch'](function(_0x18b85f){logger[_0xd986('0x10')](_0xd986('0xb'),_0x56ca9e,_0x18b85f);_0x2df7de(_0x18b85f);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 2ff4c5b..1b981b8 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 _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 +var _0x4f60=['create','clone','put','update','delete','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','/:id','show','/:id/sessions','isAuthenticated','/:id/answers','getAnswers','30s','getSummary','post'];(function(_0x5149fe,_0xa35d5){var _0x2aa81f=function(_0x3e858b){while(--_0x3e858b){_0x5149fe['push'](_0x5149fe['shift']());}};_0x2aa81f(++_0xa35d5);}(_0x4f60,0x148));var _0x04f6=function(_0x36c9d9,_0x551484){_0x36c9d9=_0x36c9d9-0x0;var _0x26921b=_0x4f60[_0x36c9d9];return _0x26921b;};'use strict';var multer=require(_0x04f6('0x0'));var util=require(_0x04f6('0x1'));var path=require('path');var timeout=require(_0x04f6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x04f6('0x3'));var auth=require(_0x04f6('0x4'));var interaction=require(_0x04f6('0x5'));var config=require('../../config/environment');var controller=require(_0x04f6('0x6'));router[_0x04f6('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x04f6('0x7')](_0x04f6('0x8'),auth['isAuthenticated'](),controller[_0x04f6('0x9')]);router[_0x04f6('0x7')](_0x04f6('0xa'),auth[_0x04f6('0xb')](),controller['getSessions']);router[_0x04f6('0x7')](_0x04f6('0xc'),auth[_0x04f6('0xb')](),controller[_0x04f6('0xd')]);router[_0x04f6('0x7')]('/:id/summary',auth[_0x04f6('0xb')](),timeout(_0x04f6('0xe')),controller[_0x04f6('0xf')]);router[_0x04f6('0x10')]('/',auth['isAuthenticated'](),controller[_0x04f6('0x11')]);router[_0x04f6('0x10')]('/:id/clone',auth['isAuthenticated'](),controller[_0x04f6('0x12')]);router[_0x04f6('0x13')](_0x04f6('0x8'),auth[_0x04f6('0xb')](),controller[_0x04f6('0x14')]);router[_0x04f6('0x15')](_0x04f6('0x8'),auth[_0x04f6('0xb')](),controller['destroy']);module[_0x04f6('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 6d99c09..85d7b3c 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 _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 +var _0x16ab=['lodash','util','exports','STRING','TEXT','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize'];(function(_0x527fe0,_0x33c712){var _0x4c1c0a=function(_0x1a3a3c){while(--_0x1a3a3c){_0x527fe0['push'](_0x527fe0['shift']());}};_0x4c1c0a(++_0x33c712);}(_0x16ab,0xbf));var _0xb16a=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x16ab[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require(_0xb16a('0x0'));var _=require(_0xb16a('0x1'));var util=require(_0xb16a('0x2'));module[_0xb16a('0x3')]={'name':{'type':Sequelize[_0xb16a('0x4')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xb16a('0x5')]('long'),'set':function(_0xf6a323){if(_[_0xb16a('0x6')](_0xf6a323)){this[_0xb16a('0x7')](_0xb16a('0x8'),JSON[_0xb16a('0x9')](_0xf6a323));}else if(_[_0xb16a('0xa')](_0xf6a323)){this[_0xb16a('0x7')](_0xb16a('0x8'),_0xf6a323);}else{this['setDataValue'](_0xb16a('0x8'),util[_0xb16a('0xb')](_0xb16a('0xc'),this['getDataValue']('name')||'',this[_0xb16a('0xd')](_0xb16a('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xb16a('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xb16a('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index a70fdf6..9c31cf9 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 _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 +var _0xf925=['fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','merge','where','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','role','get','Projects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','omit','createdAt','updatedAt','getSessions','findOne','JscriptySessionReport','pick','ProjectId','filter','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','SessionId','answer','push','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes'];(function(_0x188bcd,_0x52f234){var _0x3c4e5b=function(_0x23dc8f){while(--_0x23dc8f){_0x188bcd['push'](_0x188bcd['shift']());}};_0x3c4e5b(++_0x52f234);}(_0xf925,0xb7));var _0x5f92=function(_0x4c11fb,_0x32dbc0){_0x4c11fb=_0x4c11fb-0x0;var _0x4caf73=_0xf925[_0x4c11fb];return _0x4caf73;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5f92('0x0'));var rp=require(_0x5f92('0x1'));var moment=require(_0x5f92('0x2'));var BPromise=require(_0x5f92('0x3'));var Mustache=require('mustache');var util=require(_0x5f92('0x4'));var path=require(_0x5f92('0x5'));var sox=require(_0x5f92('0x6'));var csv=require(_0x5f92('0x7'));var ejs=require(_0x5f92('0x8'));var fs=require('fs');var fs_extra=require(_0x5f92('0x9'));var _=require(_0x5f92('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5f92('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5f92('0xc'));var Papa=require(_0x5f92('0xd'));var Redis=require('ioredis');var authService=require(_0x5f92('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x5f92('0xf'));var hardwareService=require(_0x5f92('0x10'));var logger=require(_0x5f92('0x11'))(_0x5f92('0x12'));var utils=require('../../config/utils');var config=require(_0x5f92('0x13'));var licenseUtil=require(_0x5f92('0x14'));var db=require(_0x5f92('0x15'))['db'];function respondWithStatusCode(_0x171464,_0x50dddf){_0x50dddf=_0x50dddf||0xcc;return function(_0x37640f){if(_0x37640f){return _0x171464[_0x5f92('0x16')](_0x50dddf);}return _0x171464[_0x5f92('0x17')](_0x50dddf)['end']();};}function respondWithResult(_0x5e2878,_0x3ef88d){_0x3ef88d=_0x3ef88d||0xc8;return function(_0x2642f5){if(_0x2642f5){return _0x5e2878['status'](_0x3ef88d)['json'](_0x2642f5);}};}function respondWithFilteredResult(_0xb1c3fa,_0x3151eb){return function(_0x4ccd50){if(_0x4ccd50){var _0x2099e5=typeof _0x3151eb[_0x5f92('0x18')]==='undefined'&&typeof _0x3151eb[_0x5f92('0x19')]==='undefined';var _0x4d954d=_0x4ccd50[_0x5f92('0x1a')];var _0x4d22cf=_0x2099e5?0x0:_0x3151eb[_0x5f92('0x18')];var _0xb9c506=_0x2099e5?_0x4ccd50[_0x5f92('0x1a')]:_0x3151eb[_0x5f92('0x18')]+_0x3151eb[_0x5f92('0x19')];var _0x1c8ab6;if(_0xb9c506>=_0x4d954d){_0xb9c506=_0x4d954d;_0x1c8ab6=0xc8;}else{_0x1c8ab6=0xce;}_0xb1c3fa[_0x5f92('0x17')](_0x1c8ab6);return _0xb1c3fa[_0x5f92('0x1b')](_0x5f92('0x1c'),_0x4d22cf+'-'+_0xb9c506+'/'+_0x4d954d)[_0x5f92('0x1d')](_0x4ccd50);}return null;};}function patchUpdates(_0x215085){return function(_0x3bd2c6){try{jsonpatch[_0x5f92('0x1e')](_0x3bd2c6,_0x215085,!![]);}catch(_0x4923be){return BPromise[_0x5f92('0x1f')](_0x4923be);}return _0x3bd2c6[_0x5f92('0x20')]();};}function saveUpdates(_0xd1be3,_0x57dbc8){return function(_0x534f68){if(_0x534f68){return _0x534f68[_0x5f92('0x21')](_0xd1be3)['then'](function(_0x15ba80){return _0x15ba80;});}return null;};}function removeEntity(_0x52e110,_0x21482e){return function(_0x2a4fe2){if(_0x2a4fe2){return _0x2a4fe2[_0x5f92('0x22')]()[_0x5f92('0x23')](function(){var _0x2d3a16=_0x2a4fe2['get']({'plain':!![]});var _0x4fbc22='Projects';return db[_0x5f92('0x24')][_0x5f92('0x22')]({'where':{'type':_0x4fbc22,'resourceId':_0x2d3a16['id']}})['then'](function(){return _0x2a4fe2;});})[_0x5f92('0x23')](function(){_0x52e110[_0x5f92('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37620f,_0x49d9da){return function(_0x55a327){if(!_0x55a327){_0x37620f[_0x5f92('0x16')](0x194);}return _0x55a327;};}function handleError(_0x558867,_0x26b5b9){_0x26b5b9=_0x26b5b9||0x1f4;return function(_0x45dd8e){logger[_0x5f92('0x25')](_0x45dd8e[_0x5f92('0x26')]);if(_0x45dd8e[_0x5f92('0x27')]){delete _0x45dd8e[_0x5f92('0x27')];}_0x558867['status'](_0x26b5b9)[_0x5f92('0x28')](_0x45dd8e);};}exports[_0x5f92('0x29')]=function(_0x18258a,_0x1893d1){var _0x56369b={},_0x224972={},_0x2996ad={'count':0x0,'rows':[]};var _0x130093=_[_0x5f92('0x2a')](db[_0x5f92('0x2b')][_0x5f92('0x2c')],function(_0x124218){return{'name':_0x124218[_0x5f92('0x2d')],'type':_0x124218[_0x5f92('0x2e')][_0x5f92('0x2f')]};});_0x224972[_0x5f92('0x30')]=_['map'](_0x130093,'name');_0x224972[_0x5f92('0x31')]=_[_0x5f92('0x32')](_0x18258a['query']);_0x224972[_0x5f92('0x33')]=_['intersection'](_0x224972[_0x5f92('0x30')],_0x224972[_0x5f92('0x31')]);_0x56369b['attributes']=_[_0x5f92('0x34')](_0x224972[_0x5f92('0x30')],qs[_0x5f92('0x35')](_0x18258a[_0x5f92('0x31')][_0x5f92('0x35')]));_0x56369b[_0x5f92('0x36')]=_0x56369b['attributes']['length']?_0x56369b[_0x5f92('0x36')]:_0x224972[_0x5f92('0x30')];if(!_0x18258a[_0x5f92('0x31')][_0x5f92('0x37')](_0x5f92('0x38'))){_0x56369b[_0x5f92('0x19')]=qs[_0x5f92('0x19')](_0x18258a[_0x5f92('0x31')][_0x5f92('0x19')]);_0x56369b[_0x5f92('0x18')]=qs['offset'](_0x18258a['query'][_0x5f92('0x18')]);}_0x56369b[_0x5f92('0x39')]=qs[_0x5f92('0x3a')](_0x18258a[_0x5f92('0x31')]['sort']);_0x56369b['where']=qs['filters'](_['pick'](_0x18258a[_0x5f92('0x31')],_0x224972[_0x5f92('0x33')]),_0x130093);if(_0x18258a[_0x5f92('0x31')]['filter']){_0x56369b['where']=_[_0x5f92('0x3b')](_0x56369b[_0x5f92('0x3c')],{'$or':_[_0x5f92('0x2a')](_0x130093,function(_0xf48367){if(_0xf48367[_0x5f92('0x2e')]!=='VIRTUAL'){var _0x1d01ed={};_0x1d01ed[_0xf48367['name']]={'$like':'%'+_0x18258a[_0x5f92('0x31')]['filter']+'%'};return _0x1d01ed;}})});}_0x56369b=_[_0x5f92('0x3b')]({},_0x56369b,_0x18258a[_0x5f92('0x3d')]);var _0x40cfad={'where':_0x56369b[_0x5f92('0x3c')]};return db[_0x5f92('0x2b')][_0x5f92('0x1a')](_0x40cfad)['then'](function(_0x3c8602){_0x2996ad['count']=_0x3c8602;if(_0x18258a[_0x5f92('0x31')]['includeAll']){_0x56369b[_0x5f92('0x3e')]=[{'all':!![]}];}return db['JscriptyProject'][_0x5f92('0x3f')](_0x56369b);})[_0x5f92('0x23')](function(_0x378a43){_0x2996ad[_0x5f92('0x40')]=_0x378a43;return _0x2996ad;})['then'](respondWithFilteredResult(_0x1893d1,_0x56369b))[_0x5f92('0x41')](handleError(_0x1893d1,null));};exports[_0x5f92('0x42')]=function(_0x25ffd6,_0xd3ca9){var _0x52ee61={'raw':![],'where':{'id':_0x25ffd6[_0x5f92('0x43')]['id']}},_0x1ed7c6={};_0x1ed7c6[_0x5f92('0x30')]=_[_0x5f92('0x32')](db[_0x5f92('0x2b')]['rawAttributes']);_0x1ed7c6[_0x5f92('0x31')]=_[_0x5f92('0x32')](_0x25ffd6['query']);_0x1ed7c6[_0x5f92('0x33')]=_[_0x5f92('0x34')](_0x1ed7c6['model'],_0x1ed7c6[_0x5f92('0x31')]);_0x52ee61['attributes']=_[_0x5f92('0x34')](_0x1ed7c6[_0x5f92('0x30')],qs[_0x5f92('0x35')](_0x25ffd6[_0x5f92('0x31')]['fields']));_0x52ee61[_0x5f92('0x36')]=_0x52ee61[_0x5f92('0x36')]['length']?_0x52ee61[_0x5f92('0x36')]:_0x1ed7c6['model'];if(_0x25ffd6[_0x5f92('0x31')][_0x5f92('0x44')]){_0x52ee61[_0x5f92('0x3e')]=[{'all':!![]}];}_0x52ee61=_[_0x5f92('0x3b')]({},_0x52ee61,_0x25ffd6[_0x5f92('0x3d')]);return db[_0x5f92('0x2b')][_0x5f92('0x45')](_0x52ee61)[_0x5f92('0x23')](handleEntityNotFound(_0xd3ca9,null))['then'](respondWithResult(_0xd3ca9,null))[_0x5f92('0x41')](handleError(_0xd3ca9,null));};exports[_0x5f92('0x46')]=function(_0x6c66a5,_0x1423be){return db['JscriptyProject'][_0x5f92('0x46')](_0x6c66a5[_0x5f92('0x47')],{})[_0x5f92('0x23')](function(_0x417b8c){var _0x159365=_0x6c66a5[_0x5f92('0x48')]['get']({'plain':!![]});if(!_0x159365)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x159365[_0x5f92('0x49')]===_0x5f92('0x48')){var _0x1e6b94=_0x417b8c[_0x5f92('0x4a')]({'plain':!![]});var _0x373b6a=_0x5f92('0x4b');return db[_0x5f92('0x4c')]['find']({'where':{'name':_0x373b6a,'userProfileId':_0x159365[_0x5f92('0x4d')]},'raw':!![]})['then'](function(_0x2aecb5){if(_0x2aecb5&&_0x2aecb5[_0x5f92('0x4e')]===0x0){return db[_0x5f92('0x24')][_0x5f92('0x46')]({'name':_0x1e6b94[_0x5f92('0x27')],'resourceId':_0x1e6b94['id'],'type':_0x2aecb5[_0x5f92('0x27')],'sectionId':_0x2aecb5['id']},{})[_0x5f92('0x23')](function(){return _0x417b8c;});}else{return _0x417b8c;}})['catch'](function(_0x2791a8){logger[_0x5f92('0x25')](_0x5f92('0x4f'),_0x2791a8);throw _0x2791a8;});}return _0x417b8c;})[_0x5f92('0x23')](respondWithResult(_0x1423be,0xc9))[_0x5f92('0x41')](handleError(_0x1423be,null));};exports['clone']=function(_0x132fcb,_0x4c8e03){var _0xab8e38={'where':{'id':_0x132fcb['params']['id']}},_0x44313e={};_0x44313e[_0x5f92('0x30')]=_[_0x5f92('0x32')](db[_0x5f92('0x2b')]['rawAttributes']);_0xab8e38['attributes']=_[_0x5f92('0x34')](_0x44313e[_0x5f92('0x30')],qs['fields'](_0x132fcb[_0x5f92('0x31')]['fields']));_0xab8e38['attributes']=_0xab8e38['attributes'][_0x5f92('0x50')]?_0xab8e38[_0x5f92('0x36')]:_0x44313e[_0x5f92('0x30')];if(_0x132fcb[_0x5f92('0x31')][_0x5f92('0x44')]){_0xab8e38[_0x5f92('0x3e')]=[{'all':!![]}];}_0xab8e38=_[_0x5f92('0x3b')]({},_0xab8e38,_0x132fcb[_0x5f92('0x3d')]);return db[_0x5f92('0x2b')][_0x5f92('0x45')](_0xab8e38)[_0x5f92('0x23')](handleEntityNotFound(_0x4c8e03,null))[_0x5f92('0x23')](function(_0x205b0c){if(_0x205b0c){var _0x3910f6=_0x205b0c[_0x5f92('0x4a')]({'plain':!![]});_0x3910f6=qs[_0x5f92('0x51')](_0x3910f6,['id',_0x5f92('0x52'),_0x5f92('0x53')]);_0x132fcb['body']=_[_0x5f92('0x51')](_0x132fcb[_0x5f92('0x47')],['id',_0x5f92('0x52'),'updatedAt']);return db[_0x5f92('0x2b')][_0x5f92('0x46')](_['merge'](_0x3910f6,_0x132fcb['body']),{'include':_0x132fcb[_0x5f92('0x31')][_0x5f92('0x44')]?[{'all':!![]}]:undefined})[_0x5f92('0x23')](function(_0x32351d){var _0xaed387=_0x132fcb[_0x5f92('0x48')]['get']({'plain':!![]});if(!_0xaed387)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xaed387[_0x5f92('0x49')]===_0x5f92('0x48')){var _0x3f32e4=_0x32351d[_0x5f92('0x4a')]({'plain':!![]});var _0x45ce65='Projects';return db[_0x5f92('0x4c')]['find']({'where':{'name':_0x45ce65,'userProfileId':_0xaed387[_0x5f92('0x4d')]},'raw':!![]})[_0x5f92('0x23')](function(_0x26c64a){if(_0x26c64a&&_0x26c64a[_0x5f92('0x4e')]===0x0){return db[_0x5f92('0x24')][_0x5f92('0x46')]({'name':_0x3f32e4[_0x5f92('0x27')],'resourceId':_0x3f32e4['id'],'type':_0x26c64a[_0x5f92('0x27')],'sectionId':_0x26c64a['id']},{})['then'](function(){return _0x32351d;});}else{return _0x32351d;}})[_0x5f92('0x41')](function(_0x214c08){logger['error'](_0x5f92('0x4f'),_0x214c08);throw _0x214c08;});}return _0x32351d;});}})[_0x5f92('0x23')](respondWithResult(_0x4c8e03,0xc9))[_0x5f92('0x41')](handleError(_0x4c8e03,null));};exports[_0x5f92('0x21')]=function(_0x4d6ced,_0x28c087){if(_0x4d6ced[_0x5f92('0x47')]['id']){delete _0x4d6ced[_0x5f92('0x47')]['id'];}return db[_0x5f92('0x2b')]['find']({'where':{'id':_0x4d6ced['params']['id']}})[_0x5f92('0x23')](handleEntityNotFound(_0x28c087,null))['then'](saveUpdates(_0x4d6ced['body'],null))[_0x5f92('0x23')](respondWithResult(_0x28c087,null))[_0x5f92('0x41')](handleError(_0x28c087,null));};exports['destroy']=function(_0x306e58,_0x43fd8a){return db['JscriptyProject'][_0x5f92('0x45')]({'where':{'id':_0x306e58[_0x5f92('0x43')]['id']}})[_0x5f92('0x23')](handleEntityNotFound(_0x43fd8a,null))[_0x5f92('0x23')](removeEntity(_0x43fd8a,null))[_0x5f92('0x41')](handleError(_0x43fd8a,null));};exports[_0x5f92('0x54')]=function(_0x2908d6,_0x348e7b,_0xd58ddd){var _0xb4b55f={'raw':!![],'where':{}};var _0x887546={};var _0x1b658f={'count':0x0,'rows':[]};return db[_0x5f92('0x2b')][_0x5f92('0x55')]({'where':{'id':_0x2908d6['params']['id']}})[_0x5f92('0x23')](handleEntityNotFound(_0x348e7b,null))[_0x5f92('0x23')](function(_0x12ce5c){if(_0x12ce5c){_0x887546[_0x5f92('0x30')]=_[_0x5f92('0x32')](db[_0x5f92('0x56')][_0x5f92('0x2c')]);_0x887546[_0x5f92('0x31')]=_[_0x5f92('0x32')](_0x2908d6[_0x5f92('0x31')]);_0x887546[_0x5f92('0x33')]=_['intersection'](_0x887546[_0x5f92('0x30')],_0x887546['query']);_0xb4b55f[_0x5f92('0x36')]=_[_0x5f92('0x34')](_0x887546[_0x5f92('0x30')],qs['fields'](_0x2908d6[_0x5f92('0x31')][_0x5f92('0x35')]));_0xb4b55f['attributes']=_0xb4b55f[_0x5f92('0x36')][_0x5f92('0x50')]?_0xb4b55f[_0x5f92('0x36')]:_0x887546[_0x5f92('0x30')];if(!_0x2908d6['query'][_0x5f92('0x37')]('nolimit')){_0xb4b55f[_0x5f92('0x19')]=qs[_0x5f92('0x19')](_0x2908d6[_0x5f92('0x31')][_0x5f92('0x19')]);_0xb4b55f['offset']=qs[_0x5f92('0x18')](_0x2908d6[_0x5f92('0x31')][_0x5f92('0x18')]);}_0xb4b55f['order']=qs[_0x5f92('0x3a')](_0x2908d6[_0x5f92('0x31')][_0x5f92('0x3a')]);_0xb4b55f[_0x5f92('0x3c')]=qs[_0x5f92('0x33')](_[_0x5f92('0x57')](_0x2908d6[_0x5f92('0x31')],_0x887546[_0x5f92('0x33')]));_0xb4b55f[_0x5f92('0x3c')][_0x5f92('0x58')]=_0x12ce5c['id'];if(_0x2908d6[_0x5f92('0x31')][_0x5f92('0x59')]){_0xb4b55f[_0x5f92('0x3c')]=_['merge'](_0xb4b55f[_0x5f92('0x3c')],{'$or':_[_0x5f92('0x2a')](_0xb4b55f[_0x5f92('0x36')],function(_0xdd4528){var _0x5f1d4f={};_0x5f1d4f[_0xdd4528]={'$like':'%'+_0x2908d6[_0x5f92('0x31')][_0x5f92('0x59')]+'%'};return _0x5f1d4f;})});}_0xb4b55f=_[_0x5f92('0x3b')]({},_0xb4b55f,_0x2908d6['options']);return db['JscriptySessionReport']['count']({'where':_0xb4b55f[_0x5f92('0x3c')]})[_0x5f92('0x23')](function(_0x56346f){_0x1b658f[_0x5f92('0x1a')]=_0x56346f;if(_0x2908d6['query']['includeAll']){_0xb4b55f['include']=[{'all':!![]}];}return db[_0x5f92('0x56')][_0x5f92('0x3f')](_0xb4b55f);})[_0x5f92('0x23')](function(_0xd478b1){_0x1b658f[_0x5f92('0x40')]=_0xd478b1;return _0x1b658f;});}})[_0x5f92('0x23')](respondWithFilteredResult(_0x348e7b,_0xb4b55f))[_0x5f92('0x41')](handleError(_0x348e7b,null));};exports['getAnswers']=function(_0x26aa03,_0x326bc6,_0x3f7938){var _0x3e3b8c={'raw':!![],'where':{}};var _0x1b3b44={};var _0x1eced2={'count':0x0,'rows':[]};return db[_0x5f92('0x2b')][_0x5f92('0x55')]({'where':{'id':_0x26aa03[_0x5f92('0x43')]['id']}})[_0x5f92('0x23')](handleEntityNotFound(_0x326bc6,null))[_0x5f92('0x23')](function(_0x31ce88){if(_0x31ce88){_0x1b3b44[_0x5f92('0x30')]=_[_0x5f92('0x32')](db[_0x5f92('0x5a')][_0x5f92('0x2c')]);_0x1b3b44[_0x5f92('0x31')]=_[_0x5f92('0x32')](_0x26aa03['query']);_0x1b3b44[_0x5f92('0x33')]=_[_0x5f92('0x34')](_0x1b3b44['model'],_0x1b3b44[_0x5f92('0x31')]);_0x3e3b8c[_0x5f92('0x36')]=_[_0x5f92('0x34')](_0x1b3b44[_0x5f92('0x30')],qs[_0x5f92('0x35')](_0x26aa03['query'][_0x5f92('0x35')]));_0x3e3b8c['attributes']=_0x3e3b8c[_0x5f92('0x36')][_0x5f92('0x50')]?_0x3e3b8c[_0x5f92('0x36')]:_0x1b3b44[_0x5f92('0x30')];if(!_0x26aa03['query'][_0x5f92('0x37')](_0x5f92('0x38'))){_0x3e3b8c[_0x5f92('0x19')]=qs[_0x5f92('0x19')](_0x26aa03[_0x5f92('0x31')][_0x5f92('0x19')]);_0x3e3b8c[_0x5f92('0x18')]=qs[_0x5f92('0x18')](_0x26aa03[_0x5f92('0x31')][_0x5f92('0x18')]);}_0x3e3b8c[_0x5f92('0x39')]=qs[_0x5f92('0x3a')](_0x26aa03[_0x5f92('0x31')][_0x5f92('0x3a')]);_0x3e3b8c[_0x5f92('0x3c')]=qs['filters'](_['pick'](_0x26aa03[_0x5f92('0x31')],_0x1b3b44[_0x5f92('0x33')]));_0x3e3b8c['where'][_0x5f92('0x58')]=_0x31ce88['id'];if(_0x26aa03[_0x5f92('0x31')][_0x5f92('0x59')]){_0x3e3b8c[_0x5f92('0x3c')]=_[_0x5f92('0x3b')](_0x3e3b8c[_0x5f92('0x3c')],{'$or':_[_0x5f92('0x2a')](_0x3e3b8c[_0x5f92('0x36')],function(_0x404cfa){var _0x3535ea={};_0x3535ea[_0x404cfa]={'$like':'%'+_0x26aa03['query'][_0x5f92('0x59')]+'%'};return _0x3535ea;})});}_0x3e3b8c=_[_0x5f92('0x3b')]({},_0x3e3b8c,_0x26aa03['options']);return db[_0x5f92('0x5a')][_0x5f92('0x1a')]({'where':_0x3e3b8c[_0x5f92('0x3c')]})[_0x5f92('0x23')](function(_0x5594a7){_0x1eced2[_0x5f92('0x1a')]=_0x5594a7;if(_0x26aa03['query'][_0x5f92('0x44')]){_0x3e3b8c[_0x5f92('0x3e')]=[{'all':!![]}];}return db[_0x5f92('0x5a')][_0x5f92('0x3f')](_0x3e3b8c);})[_0x5f92('0x23')](function(_0xf9470c){_0x1eced2[_0x5f92('0x40')]=_0xf9470c;return _0x1eced2;});}})[_0x5f92('0x23')](respondWithFilteredResult(_0x326bc6,_0x3e3b8c))['catch'](handleError(_0x326bc6,null));};function char(_0x482cd2){return _0x5f92('0x5b')===typeof _0x482cd2?String['fromCharCode'][_0x5f92('0x1e')](null,arguments):_0x482cd2;}function needsEncapsulation(_0x3962cd){return!!_0x3962cd&&(_0x3962cd[_0x5f92('0x5c')]()[_0x5f92('0x5d')](char(0xd))>=0x0||_0x3962cd[_0x5f92('0x5c')]()[_0x5f92('0x5d')](char(0xa))>=0x0||_0x3962cd[_0x5f92('0x5c')]()[_0x5f92('0x5d')](char(0x2c))>=0x0||_0x3962cd[_0x5f92('0x5c')]()[_0x5f92('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x4ad892){var _0x565eab=char(0x22),_0x2d49bd='\x5c'+char(0x22),_0x546419=_0x4ad892['toString']()[_0x5f92('0x5e')](new RegExp(_0x565eab,'g'),_0x2d49bd);return _0x565eab+_0x546419+_0x565eab;}exports[_0x5f92('0x5f')]=function(_0x119716,_0x424cf9,_0x2d4351){var _0x23383e,_0x2f1f97;var _0x296066={'where':{'ProjectId':_0x119716[_0x5f92('0x43')]['id']}};if(_0x119716[_0x5f92('0x31')][_0x5f92('0x60')]){_0x296066[_0x5f92('0x3c')]['starttime']=JSON[_0x5f92('0x61')](_0x119716[_0x5f92('0x31')]['startTime']);}return db[_0x5f92('0x56')][_0x5f92('0x3f')](_0x296066)['then'](handleEntityNotFound(_0x424cf9,null))[_0x5f92('0x23')](function(_0x12a92f){if(_0x12a92f){_0x23383e=_0x12a92f;return db[_0x5f92('0x62')][_0x5f92('0x3f')]({'where':{'SessionId':{'$in':_[_0x5f92('0x2a')](_0x23383e,'id')},'ProjectId':_0x119716[_0x5f92('0x43')]['id']},'order':_0x5f92('0x63')});}})[_0x5f92('0x23')](handleEntityNotFound(_0x424cf9,null))['then'](function(_0x344d26){if(_0x344d26){_0x2f1f97=_0x344d26;var _0x1751de={};for(var _0x2a3ef2=0x0,_0x165c8c=_0x2f1f97['length'];_0x2a3ef2<_0x165c8c;_0x2a3ef2++){if(!_0x1751de['hasOwnProperty'](_0x2f1f97[_0x2a3ef2]['questionId'])){_0x1751de[_0x2f1f97[_0x2a3ef2][_0x5f92('0x64')]]=needsEncapsulation(_0x2f1f97[_0x2a3ef2]['question'])?encapsulate(_0x2f1f97[_0x2a3ef2]['question']):_0x2f1f97[_0x2a3ef2][_0x5f92('0x65')];}}var _0x21943d=[],_0x381578={};for(var _0x56733c=0x0,_0x3c3e68=_0x23383e[_0x5f92('0x50')];_0x56733c<_0x3c3e68;_0x56733c++){_0x381578={'ProjectId':_0x119716[_0x5f92('0x43')]['id'],'SessionId':_0x23383e[_0x56733c]['id'],'StartTime':moment(_0x23383e[_0x56733c]['starttime'])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x1a510e=0x0,_0x1f492c=_0x2f1f97[_0x5f92('0x50')];_0x1a510e<_0x1f492c;_0x1a510e++){if(_0x2f1f97[_0x1a510e][_0x5f92('0x66')]==_0x23383e[_0x56733c]['id']&&_0x1751de[_0x5f92('0x37')](_0x2f1f97[_0x1a510e]['questionId'])){_0x381578[_0x1751de[_0x2f1f97[_0x1a510e][_0x5f92('0x64')]]]=_0x2f1f97[_0x1a510e][_0x5f92('0x67')];}}for(var _0x1e2ffd in _0x1751de){if(!_0x381578['hasOwnProperty'](_0x1751de[_0x1e2ffd])){_0x381578[_0x1751de[_0x1e2ffd]]=null;}}_0x21943d[_0x5f92('0x68')](_0x381578);}return _0x21943d;}})['then'](function(_0x1a6aa0){if(!_['isEmpty'](_0x1a6aa0)){var _0xa110c5=toCsv(_0x1a6aa0);var _0x49e033=Date[_0x5f92('0x69')]();fs[_0x5f92('0x6a')](util[_0x5f92('0x6b')](_0x5f92('0x6c'),_0x119716['params']['id'],_0x49e033),_0xa110c5);_0x424cf9[_0x5f92('0x6d')]('Content-disposition','attachment;\x20filename='+util['format'](_0x5f92('0x6e'),_0x119716[_0x5f92('0x43')]['id'],_0x49e033));_0x424cf9[_0x5f92('0x6d')](_0x5f92('0x6f'),_0x5f92('0x70'));return _0x424cf9[_0x5f92('0x71')](util[_0x5f92('0x6b')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x119716[_0x5f92('0x43')]['id'],_0x49e033));}else{return _0x424cf9[_0x5f92('0x16')](0xcc);}})['catch'](handleError(_0x424cf9,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 1442d4f..eea7cd7 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 _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 +var _0xeb79=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects'];(function(_0x524221,_0x198104){var _0x2310f7=function(_0x3cd95d){while(--_0x3cd95d){_0x524221['push'](_0x524221['shift']());}};_0x2310f7(++_0x198104);}(_0xeb79,0x87));var _0x9eb7=function(_0x2517e0,_0x1ab572){_0x2517e0=_0x2517e0-0x0;var _0x3b430b=_0xeb79[_0x2517e0];return _0x3b430b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9eb7('0x0'))('api');var moment=require(_0x9eb7('0x1'));var BPromise=require('bluebird');var rp=require(_0x9eb7('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9eb7('0x3'));var config=require(_0x9eb7('0x4'));var attributes=require(_0x9eb7('0x5'));module[_0x9eb7('0x6')]=function(_0x58bc03,_0x501d0c){return _0x58bc03[_0x9eb7('0x7')]('JscriptyProject',attributes,{'tableName':_0x9eb7('0x8'),'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 5c6d356..841f298 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 _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 +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x488b05,_0x2d3ef8){var _0x29b171=function(_0xb753dc){while(--_0xb753dc){_0x488b05['push'](_0x488b05['shift']());}};_0x29b171(++_0x2d3ef8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0xcb91[_0x2543d6];return _0x55213c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index bb7ac0c..311e275 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 _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 +var _0xcf94=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x27df4b,_0x4253de){var _0x258ef4=function(_0x4b7a97){while(--_0x4b7a97){_0x27df4b['push'](_0x27df4b['shift']());}};_0x258ef4(++_0x4253de);}(_0xcf94,0x113));var _0x4cf9=function(_0x754728,_0x4c54ab){_0x754728=_0x754728-0x0;var _0x13d2dc=_0xcf94[_0x754728];return _0x13d2dc;};'use strict';var multer=require(_0x4cf9('0x0'));var util=require(_0x4cf9('0x1'));var path=require('path');var timeout=require(_0x4cf9('0x2'));var express=require(_0x4cf9('0x3'));var router=express['Router']();var fs_extra=require(_0x4cf9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4cf9('0x5'));var config=require(_0x4cf9('0x6'));var controller=require(_0x4cf9('0x7'));router['get']('/',auth[_0x4cf9('0x8')](),controller[_0x4cf9('0x9')]);router['get'](_0x4cf9('0xa'),auth[_0x4cf9('0x8')](),controller[_0x4cf9('0xb')]);router['get'](_0x4cf9('0xc'),auth[_0x4cf9('0x8')](),controller[_0x4cf9('0xd')]);router[_0x4cf9('0xe')]('/',auth['isAuthenticated'](),controller[_0x4cf9('0xf')]);router[_0x4cf9('0x10')](_0x4cf9('0xc'),auth[_0x4cf9('0x8')](),controller[_0x4cf9('0x11')]);router[_0x4cf9('0x12')](_0x4cf9('0xc'),auth[_0x4cf9('0x8')](),controller[_0x4cf9('0x13')]);module[_0x4cf9('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 9722cbc..692bff9 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(_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 +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7a54,0x106));var _0x47a5=function(_0xf4d9f0,_0x29de01){_0xf4d9f0=_0xf4d9f0-0x0;var _0x1bde9e=_0x7a54[_0xf4d9f0];return _0x1bde9e;};'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 8ae320f..b32fec4 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 _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 +var _0x3aaa=['fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','type','VIRTUAL','merge','options','includeAll','include','show','params','find','catch','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','JscriptyQuestionReport'];(function(_0x449b81,_0x4b2a6f){var _0xb9b60c=function(_0x2e9e0a){while(--_0x2e9e0a){_0x449b81['push'](_0x449b81['shift']());}};_0xb9b60c(++_0x4b2a6f);}(_0x3aaa,0xa4));var _0xa3aa=function(_0x3919c4,_0x5c13c2){_0x3919c4=_0x3919c4-0x0;var _0x31323f=_0x3aaa[_0x3919c4];return _0x31323f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa3aa('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa3aa('0x1'));var rp=require(_0xa3aa('0x2'));var moment=require(_0xa3aa('0x3'));var BPromise=require(_0xa3aa('0x4'));var Mustache=require('mustache');var util=require(_0xa3aa('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xa3aa('0x6'));var ejs=require(_0xa3aa('0x7'));var fs=require('fs');var fs_extra=require(_0xa3aa('0x8'));var _=require(_0xa3aa('0x9'));var squel=require(_0xa3aa('0xa'));var crypto=require(_0xa3aa('0xb'));var jsforce=require(_0xa3aa('0xc'));var deskjs=require(_0xa3aa('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa3aa('0xe'));var Papa=require(_0xa3aa('0xf'));var Redis=require(_0xa3aa('0x10'));var authService=require(_0xa3aa('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa3aa('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa3aa('0x13'))(_0xa3aa('0x14'));var utils=require('../../config/utils');var config=require(_0xa3aa('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1162a1,_0x3fb977){_0x3fb977=_0x3fb977||0xcc;return function(_0x5b1b83){if(_0x5b1b83){return _0x1162a1[_0xa3aa('0x16')](_0x3fb977);}return _0x1162a1[_0xa3aa('0x17')](_0x3fb977)[_0xa3aa('0x18')]();};}function respondWithResult(_0x15b6e2,_0x4a9078){_0x4a9078=_0x4a9078||0xc8;return function(_0x5cb44a){if(_0x5cb44a){return _0x15b6e2[_0xa3aa('0x17')](_0x4a9078)[_0xa3aa('0x19')](_0x5cb44a);}};}function respondWithFilteredResult(_0x4e8c37,_0x16a487){return function(_0x18339c){if(_0x18339c){var _0x310e61=typeof _0x16a487[_0xa3aa('0x1a')]===_0xa3aa('0x1b')&&typeof _0x16a487[_0xa3aa('0x1c')]===_0xa3aa('0x1b');var _0x1dde83=_0x18339c[_0xa3aa('0x1d')];var _0x181eb7=_0x310e61?0x0:_0x16a487[_0xa3aa('0x1a')];var _0x38b74a=_0x310e61?_0x18339c[_0xa3aa('0x1d')]:_0x16a487['offset']+_0x16a487[_0xa3aa('0x1c')];var _0x3c8308;if(_0x38b74a>=_0x1dde83){_0x38b74a=_0x1dde83;_0x3c8308=0xc8;}else{_0x3c8308=0xce;}_0x4e8c37[_0xa3aa('0x17')](_0x3c8308);return _0x4e8c37[_0xa3aa('0x1e')](_0xa3aa('0x1f'),_0x181eb7+'-'+_0x38b74a+'/'+_0x1dde83)['json'](_0x18339c);}return null;};}function patchUpdates(_0x22ceb2){return function(_0x1ce6c1){try{jsonpatch[_0xa3aa('0x20')](_0x1ce6c1,_0x22ceb2,!![]);}catch(_0x4eaac2){return BPromise[_0xa3aa('0x21')](_0x4eaac2);}return _0x1ce6c1[_0xa3aa('0x22')]();};}function saveUpdates(_0x23f75a,_0x31c020){return function(_0x53c44a){if(_0x53c44a){return _0x53c44a[_0xa3aa('0x23')](_0x23f75a)[_0xa3aa('0x24')](function(_0x59a573){return _0x59a573;});}return null;};}function removeEntity(_0x379cb8,_0x29488f){return function(_0x1b6105){if(_0x1b6105){return _0x1b6105[_0xa3aa('0x25')]()[_0xa3aa('0x24')](function(){_0x379cb8[_0xa3aa('0x17')](0xcc)[_0xa3aa('0x18')]();});}};}function handleEntityNotFound(_0x5c438a,_0x20f94f){return function(_0x52db98){if(!_0x52db98){_0x5c438a[_0xa3aa('0x16')](0x194);}return _0x52db98;};}function handleError(_0x4ca6c3,_0xcf2c07){_0xcf2c07=_0xcf2c07||0x1f4;return function(_0x577dda){logger['error'](_0x577dda['stack']);if(_0x577dda[_0xa3aa('0x26')]){delete _0x577dda[_0xa3aa('0x26')];}_0x4ca6c3[_0xa3aa('0x17')](_0xcf2c07)[_0xa3aa('0x27')](_0x577dda);};}exports[_0xa3aa('0x28')]=function(_0x1e1b0c,_0x1ccfe6){var _0x27ea81={},_0x4e210c={},_0x464199={'count':0x0,'rows':[]};var _0x547209=_[_0xa3aa('0x29')](db[_0xa3aa('0x2a')]['rawAttributes'],function(_0x3ca1f5){return{'name':_0x3ca1f5[_0xa3aa('0x2b')],'type':_0x3ca1f5['type']['key']};});_0x4e210c['model']=_['map'](_0x547209,_0xa3aa('0x26'));_0x4e210c[_0xa3aa('0x2c')]=_[_0xa3aa('0x2d')](_0x1e1b0c[_0xa3aa('0x2c')]);_0x4e210c[_0xa3aa('0x2e')]=_[_0xa3aa('0x2f')](_0x4e210c[_0xa3aa('0x30')],_0x4e210c[_0xa3aa('0x2c')]);_0x27ea81[_0xa3aa('0x31')]=_[_0xa3aa('0x2f')](_0x4e210c[_0xa3aa('0x30')],qs[_0xa3aa('0x32')](_0x1e1b0c['query'][_0xa3aa('0x32')]));_0x27ea81[_0xa3aa('0x31')]=_0x27ea81[_0xa3aa('0x31')][_0xa3aa('0x33')]?_0x27ea81['attributes']:_0x4e210c[_0xa3aa('0x30')];if(!_0x1e1b0c['query'][_0xa3aa('0x34')]('nolimit')){_0x27ea81[_0xa3aa('0x1c')]=qs[_0xa3aa('0x1c')](_0x1e1b0c['query'][_0xa3aa('0x1c')]);_0x27ea81[_0xa3aa('0x1a')]=qs[_0xa3aa('0x1a')](_0x1e1b0c[_0xa3aa('0x2c')][_0xa3aa('0x1a')]);}_0x27ea81[_0xa3aa('0x35')]=qs[_0xa3aa('0x36')](_0x1e1b0c[_0xa3aa('0x2c')][_0xa3aa('0x36')]);_0x27ea81['where']=qs[_0xa3aa('0x2e')](_['pick'](_0x1e1b0c[_0xa3aa('0x2c')],_0x4e210c[_0xa3aa('0x2e')]),_0x547209);if(_0x1e1b0c[_0xa3aa('0x2c')]['filter']){_0x27ea81[_0xa3aa('0x37')]=_['merge'](_0x27ea81[_0xa3aa('0x37')],{'$or':_[_0xa3aa('0x29')](_0x547209,function(_0x556883){if(_0x556883[_0xa3aa('0x38')]!==_0xa3aa('0x39')){var _0x2a0233={};_0x2a0233[_0x556883[_0xa3aa('0x26')]]={'$like':'%'+_0x1e1b0c[_0xa3aa('0x2c')]['filter']+'%'};return _0x2a0233;}})});}_0x27ea81=_[_0xa3aa('0x3a')]({},_0x27ea81,_0x1e1b0c[_0xa3aa('0x3b')]);var _0x5f0a01={'where':_0x27ea81[_0xa3aa('0x37')]};return db[_0xa3aa('0x2a')][_0xa3aa('0x1d')](_0x5f0a01)[_0xa3aa('0x24')](function(_0x4cc243){_0x464199['count']=_0x4cc243;if(_0x1e1b0c[_0xa3aa('0x2c')][_0xa3aa('0x3c')]){_0x27ea81[_0xa3aa('0x3d')]=[{'all':!![]}];}return db[_0xa3aa('0x2a')]['findAll'](_0x27ea81);})[_0xa3aa('0x24')](function(_0x2041c7){_0x464199['rows']=_0x2041c7;return _0x464199;})['then'](respondWithFilteredResult(_0x1ccfe6,_0x27ea81))['catch'](handleError(_0x1ccfe6,null));};exports[_0xa3aa('0x3e')]=function(_0x15129b,_0x52ebc1){var _0x2b31fc={'raw':!![],'where':{'id':_0x15129b[_0xa3aa('0x3f')]['id']}},_0x72302e={};_0x72302e[_0xa3aa('0x30')]=_[_0xa3aa('0x2d')](db['JscriptyQuestionReport']['rawAttributes']);_0x72302e[_0xa3aa('0x2c')]=_[_0xa3aa('0x2d')](_0x15129b[_0xa3aa('0x2c')]);_0x72302e[_0xa3aa('0x2e')]=_[_0xa3aa('0x2f')](_0x72302e['model'],_0x72302e[_0xa3aa('0x2c')]);_0x2b31fc[_0xa3aa('0x31')]=_['intersection'](_0x72302e['model'],qs[_0xa3aa('0x32')](_0x15129b[_0xa3aa('0x2c')]['fields']));_0x2b31fc['attributes']=_0x2b31fc[_0xa3aa('0x31')][_0xa3aa('0x33')]?_0x2b31fc[_0xa3aa('0x31')]:_0x72302e['model'];if(_0x15129b[_0xa3aa('0x2c')][_0xa3aa('0x3c')]){_0x2b31fc[_0xa3aa('0x3d')]=[{'all':!![]}];}_0x2b31fc=_['merge']({},_0x2b31fc,_0x15129b[_0xa3aa('0x3b')]);return db[_0xa3aa('0x2a')][_0xa3aa('0x40')](_0x2b31fc)['then'](handleEntityNotFound(_0x52ebc1,null))[_0xa3aa('0x24')](respondWithResult(_0x52ebc1,null))[_0xa3aa('0x41')](handleError(_0x52ebc1,null));};exports[_0xa3aa('0x42')]=function(_0x2b218a,_0x12f1ed){return db[_0xa3aa('0x2a')][_0xa3aa('0x42')](_0x2b218a[_0xa3aa('0x43')],{})[_0xa3aa('0x24')](respondWithResult(_0x12f1ed,0xc9))[_0xa3aa('0x41')](handleError(_0x12f1ed,null));};exports[_0xa3aa('0x23')]=function(_0x229b22,_0x52ae8a){if(_0x229b22[_0xa3aa('0x43')]['id']){delete _0x229b22['body']['id'];}return db[_0xa3aa('0x2a')][_0xa3aa('0x40')]({'where':{'id':_0x229b22[_0xa3aa('0x3f')]['id']}})[_0xa3aa('0x24')](handleEntityNotFound(_0x52ae8a,null))[_0xa3aa('0x24')](saveUpdates(_0x229b22[_0xa3aa('0x43')],null))['then'](respondWithResult(_0x52ae8a,null))[_0xa3aa('0x41')](handleError(_0x52ae8a,null));};exports[_0xa3aa('0x25')]=function(_0x33fb16,_0x4f1079){return db['JscriptyQuestionReport'][_0xa3aa('0x40')]({'where':{'id':_0x33fb16['params']['id']}})[_0xa3aa('0x24')](handleEntityNotFound(_0x4f1079,null))['then'](removeEntity(_0x4f1079,null))[_0xa3aa('0x41')](handleError(_0x4f1079,null));};exports[_0xa3aa('0x44')]=function(_0x3b15f8,_0x53d122){return db[_0xa3aa('0x2a')][_0xa3aa('0x44')]()['then'](respondWithResult(_0x53d122,null))[_0xa3aa('0x41')](handleError(_0x53d122,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 7a80a9c..31a5414 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 _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 +var _0x7136=['../../config/environment','exports','JscriptyQuestionReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x25d4ab,_0x307164){var _0x3b31f3=function(_0x12f56c){while(--_0x12f56c){_0x25d4ab['push'](_0x25d4ab['shift']());}};_0x3b31f3(++_0x307164);}(_0x7136,0x92));var _0x6713=function(_0x5ec634,_0xa835b9){_0x5ec634=_0x5ec634-0x0;var _0x5b94a9=_0x7136[_0x5ec634];return _0x5b94a9;};'use strict';var _=require(_0x6713('0x0'));var util=require(_0x6713('0x1'));var logger=require(_0x6713('0x2'))(_0x6713('0x3'));var moment=require(_0x6713('0x4'));var BPromise=require(_0x6713('0x5'));var rp=require(_0x6713('0x6'));var fs=require('fs');var path=require(_0x6713('0x7'));var rimraf=require('rimraf');var config=require(_0x6713('0x8'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x6713('0x9')]=function(_0x1e04fb,_0x3418a5){return _0x1e04fb['define'](_0x6713('0xa'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index fca7483..b16c8b1 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 _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 +var _0xc54d=['request','then','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x38d14a,_0x24860f){var _0x34f32a=function(_0x443c5f){while(--_0x443c5f){_0x38d14a['push'](_0x38d14a['shift']());}};_0x34f32a(++_0x24860f);}(_0xc54d,0x164));var _0xdc54=function(_0x54de5d,_0x1f8b26){_0x54de5d=_0x54de5d-0x0;var _0x1b349e=_0xc54d[_0x54de5d];return _0x1b349e;};'use strict';var _=require(_0xdc54('0x0'));var util=require(_0xdc54('0x1'));var moment=require('moment');var BPromise=require(_0xdc54('0x2'));var rs=require(_0xdc54('0x3'));var fs=require('fs');var Redis=require(_0xdc54('0x4'));var db=require(_0xdc54('0x5'))['db'];var utils=require(_0xdc54('0x6'));var logger=require(_0xdc54('0x7'))(_0xdc54('0x8'));var config=require(_0xdc54('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdc54('0xa')][_0xdc54('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dbf88,_0x1a7dc3,_0x281b4b){return new BPromise(function(_0x375afe,_0x323e33){return client[_0xdc54('0xc')](_0x1dbf88,_0x281b4b)[_0xdc54('0xd')](function(_0x12c726){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1a7dc3,_0xdc54('0xe'));logger[_0xdc54('0xf')](_0xdc54('0x10'),_0x1a7dc3,_0xdc54('0xe'),JSON[_0xdc54('0x11')](_0x12c726));if(_0x12c726[_0xdc54('0x12')]){if(_0x12c726['error'][_0xdc54('0x13')]===0x1f4){logger['error'](_0xdc54('0x14'),_0x1a7dc3,_0x12c726[_0xdc54('0x12')]['message']);return _0x323e33(_0x12c726[_0xdc54('0x12')][_0xdc54('0x15')]);}logger[_0xdc54('0x12')](_0xdc54('0x14'),_0x1a7dc3,_0x12c726[_0xdc54('0x12')][_0xdc54('0x15')]);return _0x375afe(_0x12c726[_0xdc54('0x12')][_0xdc54('0x15')]);}else{logger['info'](_0xdc54('0x14'),_0x1a7dc3,'request\x20sent');_0x375afe(_0x12c726[_0xdc54('0x16')][_0xdc54('0x15')]);}})['catch'](function(_0x2b74ab){logger['error'](_0xdc54('0x14'),_0x1a7dc3,_0x2b74ab);_0x323e33(_0x2b74ab);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 0620296..ca2eca9 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 _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 +var _0x2b2c=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/questions','getQuestions','post','create','put','/:id'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x2b2c,0x16c));var _0xc2b2=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x2b2c[_0x11005e];return _0x29338f;};'use strict';var multer=require('multer');var util=require(_0xc2b2('0x0'));var path=require(_0xc2b2('0x1'));var timeout=require(_0xc2b2('0x2'));var express=require(_0xc2b2('0x3'));var router=express[_0xc2b2('0x4')]();var fs_extra=require(_0xc2b2('0x5'));var auth=require(_0xc2b2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc2b2('0x7'));var controller=require('./jscriptySessionReport.controller');router[_0xc2b2('0x8')]('/',auth[_0xc2b2('0x9')](),controller[_0xc2b2('0xa')]);router[_0xc2b2('0x8')](_0xc2b2('0xb'),auth[_0xc2b2('0x9')](),controller[_0xc2b2('0xc')]);router[_0xc2b2('0x8')]('/:id',auth[_0xc2b2('0x9')](),controller[_0xc2b2('0xd')]);router[_0xc2b2('0x8')](_0xc2b2('0xe'),auth[_0xc2b2('0x9')](),controller[_0xc2b2('0xf')]);router[_0xc2b2('0x10')]('/',auth['isAuthenticated'](),controller[_0xc2b2('0x11')]);router[_0xc2b2('0x12')](_0xc2b2('0x13'),auth[_0xc2b2('0x9')](),controller[_0xc2b2('0x14')]);router[_0xc2b2('0x15')]('/:id',auth[_0xc2b2('0x9')](),controller[_0xc2b2('0x16')]);module[_0xc2b2('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 3f363a4..992c6cb 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 _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 +var _0xff69=['STRING','moment','sequelize','DATE','setDataValue','starttime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x198446,_0x119c8f){var _0x38d7b7=function(_0x293752){while(--_0x293752){_0x198446['push'](_0x198446['shift']());}};_0x38d7b7(++_0x119c8f);}(_0xff69,0x119));var _0x9ff6=function(_0x44b827,_0x1bb1aa){_0x44b827=_0x44b827-0x0;var _0x527342=_0xff69[_0x44b827];return _0x527342;};'use strict';var moment=require(_0x9ff6('0x0'));var Sequelize=require(_0x9ff6('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x9ff6('0x2')],'set':function(_0x1595c2){this[_0x9ff6('0x3')](_0x9ff6('0x4'),_0x1595c2);this[_0x9ff6('0x3')]('endtime',moment()[_0x9ff6('0x5')](_0x9ff6('0x6')));}},'endtime':{'type':Sequelize[_0x9ff6('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x9ff6('0x7')]},'queue':{'type':Sequelize[_0x9ff6('0x7')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9ff6('0x7')]},'calleridnum':{'type':Sequelize[_0x9ff6('0x7')]},'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 3af6dc3..fa796b1 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 _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 +var _0x527b=['keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','describe','findOne','JscriptyQuestionReport','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','destroy','then','sendStatus','error','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model'];(function(_0xa599d0,_0xace5b3){var _0x8e728d=function(_0x50384a){while(--_0x50384a){_0xa599d0['push'](_0xa599d0['shift']());}};_0x8e728d(++_0xace5b3);}(_0x527b,0x1a5));var _0xb527=function(_0x47a40b,_0x443ecf){_0x47a40b=_0x47a40b-0x0;var _0x19610c=_0x527b[_0x47a40b];return _0x19610c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb527('0x0'));var jsonpatch=require(_0xb527('0x1'));var rp=require('request-promise');var moment=require(_0xb527('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xb527('0x3'));var util=require(_0xb527('0x4'));var path=require('path');var sox=require(_0xb527('0x5'));var csv=require(_0xb527('0x6'));var ejs=require(_0xb527('0x7'));var fs=require('fs');var fs_extra=require(_0xb527('0x8'));var _=require(_0xb527('0x9'));var squel=require(_0xb527('0xa'));var crypto=require('crypto');var jsforce=require(_0xb527('0xb'));var deskjs=require(_0xb527('0xc'));var toCsv=require(_0xb527('0x6'));var querystring=require(_0xb527('0xd'));var Papa=require('papaparse');var Redis=require(_0xb527('0xe'));var authService=require(_0xb527('0xf'));var qs=require(_0xb527('0x10'));var as=require(_0xb527('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb527('0x12'));var utils=require(_0xb527('0x13'));var config=require(_0xb527('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb527('0x15'))['db'];function respondWithStatusCode(_0x182996,_0x42c4f2){_0x42c4f2=_0x42c4f2||0xcc;return function(_0x502f48){if(_0x502f48){return _0x182996['sendStatus'](_0x42c4f2);}return _0x182996[_0xb527('0x16')](_0x42c4f2)[_0xb527('0x17')]();};}function respondWithResult(_0x2ed068,_0x53dd84){_0x53dd84=_0x53dd84||0xc8;return function(_0x15835d){if(_0x15835d){return _0x2ed068[_0xb527('0x16')](_0x53dd84)[_0xb527('0x18')](_0x15835d);}};}function respondWithFilteredResult(_0x45a4f4,_0x43a9db){return function(_0x55b93a){if(_0x55b93a){var _0x3d88f4=typeof _0x43a9db['offset']===_0xb527('0x19')&&typeof _0x43a9db[_0xb527('0x1a')]===_0xb527('0x19');var _0x5c9deb=_0x55b93a['count'];var _0xd4af8=_0x3d88f4?0x0:_0x43a9db[_0xb527('0x1b')];var _0x3c07d4=_0x3d88f4?_0x55b93a['count']:_0x43a9db[_0xb527('0x1b')]+_0x43a9db[_0xb527('0x1a')];var _0x5825fa;if(_0x3c07d4>=_0x5c9deb){_0x3c07d4=_0x5c9deb;_0x5825fa=0xc8;}else{_0x5825fa=0xce;}_0x45a4f4['status'](_0x5825fa);return _0x45a4f4[_0xb527('0x1c')](_0xb527('0x1d'),_0xd4af8+'-'+_0x3c07d4+'/'+_0x5c9deb)[_0xb527('0x18')](_0x55b93a);}return null;};}function patchUpdates(_0x197e7c){return function(_0x5be64f){try{jsonpatch[_0xb527('0x1e')](_0x5be64f,_0x197e7c,!![]);}catch(_0xee4925){return BPromise[_0xb527('0x1f')](_0xee4925);}return _0x5be64f[_0xb527('0x20')]();};}function saveUpdates(_0xb16c69,_0x5702bc){return function(_0x2b13e4){if(_0x2b13e4){return _0x2b13e4['update'](_0xb16c69)['then'](function(_0x2fcd2b){return _0x2fcd2b;});}return null;};}function removeEntity(_0x2ae10c,_0x16403b){return function(_0x2bb846){if(_0x2bb846){return _0x2bb846[_0xb527('0x21')]()[_0xb527('0x22')](function(){_0x2ae10c['status'](0xcc)[_0xb527('0x17')]();});}};}function handleEntityNotFound(_0x5a264c,_0x2ad92b){return function(_0x99aa14){if(!_0x99aa14){_0x5a264c[_0xb527('0x23')](0x194);}return _0x99aa14;};}function handleError(_0x4c4aa3,_0x2037b2){_0x2037b2=_0x2037b2||0x1f4;return function(_0x347d60){logger[_0xb527('0x24')](_0x347d60['stack']);if(_0x347d60[_0xb527('0x25')]){delete _0x347d60[_0xb527('0x25')];}_0x4c4aa3[_0xb527('0x16')](_0x2037b2)[_0xb527('0x26')](_0x347d60);};}exports[_0xb527('0x27')]=function(_0x36db02,_0x23c6df){var _0x235906={},_0x38d3b7={},_0x3ee483={'count':0x0,'rows':[]};var _0x49c717=_[_0xb527('0x28')](db[_0xb527('0x29')][_0xb527('0x2a')],function(_0x5c539f){return{'name':_0x5c539f[_0xb527('0x2b')],'type':_0x5c539f[_0xb527('0x2c')][_0xb527('0x2d')]};});_0x38d3b7[_0xb527('0x2e')]=_[_0xb527('0x28')](_0x49c717,_0xb527('0x25'));_0x38d3b7['query']=_[_0xb527('0x2f')](_0x36db02[_0xb527('0x30')]);_0x38d3b7['filters']=_[_0xb527('0x31')](_0x38d3b7[_0xb527('0x2e')],_0x38d3b7[_0xb527('0x30')]);_0x235906['attributes']=_[_0xb527('0x31')](_0x38d3b7[_0xb527('0x2e')],qs[_0xb527('0x32')](_0x36db02['query'][_0xb527('0x32')]));_0x235906[_0xb527('0x33')]=_0x235906[_0xb527('0x33')][_0xb527('0x34')]?_0x235906['attributes']:_0x38d3b7[_0xb527('0x2e')];if(!_0x36db02[_0xb527('0x30')][_0xb527('0x35')](_0xb527('0x36'))){_0x235906['limit']=qs[_0xb527('0x1a')](_0x36db02[_0xb527('0x30')][_0xb527('0x1a')]);_0x235906[_0xb527('0x1b')]=qs[_0xb527('0x1b')](_0x36db02[_0xb527('0x30')][_0xb527('0x1b')]);}_0x235906[_0xb527('0x37')]=qs['sort'](_0x36db02[_0xb527('0x30')][_0xb527('0x38')]);_0x235906[_0xb527('0x39')]=qs[_0xb527('0x3a')](_[_0xb527('0x3b')](_0x36db02[_0xb527('0x30')],_0x38d3b7[_0xb527('0x3a')]),_0x49c717);if(_0x36db02[_0xb527('0x30')][_0xb527('0x3c')]){_0x235906[_0xb527('0x39')]=_[_0xb527('0x3d')](_0x235906[_0xb527('0x39')],{'$or':_['map'](_0x49c717,function(_0x28aa37){if(_0x28aa37[_0xb527('0x2c')]!=='VIRTUAL'){var _0x9d8e8d={};_0x9d8e8d[_0x28aa37[_0xb527('0x25')]]={'$like':'%'+_0x36db02['query'][_0xb527('0x3c')]+'%'};return _0x9d8e8d;}})});}_0x235906=_[_0xb527('0x3d')]({},_0x235906,_0x36db02[_0xb527('0x3e')]);var _0xabe764={'where':_0x235906[_0xb527('0x39')]};return db[_0xb527('0x29')]['count'](_0xabe764)[_0xb527('0x22')](function(_0x1a79d6){_0x3ee483[_0xb527('0x3f')]=_0x1a79d6;if(_0x36db02[_0xb527('0x30')][_0xb527('0x40')]){_0x235906['include']=[{'all':!![]}];}return db[_0xb527('0x29')][_0xb527('0x41')](_0x235906);})[_0xb527('0x22')](function(_0x278d44){_0x3ee483[_0xb527('0x42')]=_0x278d44;return _0x3ee483;})[_0xb527('0x22')](respondWithFilteredResult(_0x23c6df,_0x235906))[_0xb527('0x43')](handleError(_0x23c6df,null));};exports[_0xb527('0x44')]=function(_0xbf42fa,_0x366761){var _0x3b937f={'raw':!![],'where':{'id':_0xbf42fa[_0xb527('0x45')]['id']}},_0x24e78b={};_0x24e78b[_0xb527('0x2e')]=_[_0xb527('0x2f')](db[_0xb527('0x29')]['rawAttributes']);_0x24e78b[_0xb527('0x30')]=_[_0xb527('0x2f')](_0xbf42fa[_0xb527('0x30')]);_0x24e78b[_0xb527('0x3a')]=_[_0xb527('0x31')](_0x24e78b[_0xb527('0x2e')],_0x24e78b[_0xb527('0x30')]);_0x3b937f[_0xb527('0x33')]=_['intersection'](_0x24e78b[_0xb527('0x2e')],qs[_0xb527('0x32')](_0xbf42fa[_0xb527('0x30')][_0xb527('0x32')]));_0x3b937f[_0xb527('0x33')]=_0x3b937f['attributes']['length']?_0x3b937f['attributes']:_0x24e78b[_0xb527('0x2e')];if(_0xbf42fa[_0xb527('0x30')][_0xb527('0x40')]){_0x3b937f[_0xb527('0x46')]=[{'all':!![]}];}_0x3b937f=_[_0xb527('0x3d')]({},_0x3b937f,_0xbf42fa['options']);return db[_0xb527('0x29')][_0xb527('0x47')](_0x3b937f)[_0xb527('0x22')](handleEntityNotFound(_0x366761,null))[_0xb527('0x22')](respondWithResult(_0x366761,null))[_0xb527('0x43')](handleError(_0x366761,null));};exports[_0xb527('0x48')]=function(_0x9d548,_0x25b27a){return db['JscriptySessionReport'][_0xb527('0x48')](_0x9d548[_0xb527('0x49')],{})[_0xb527('0x22')](respondWithResult(_0x25b27a,0xc9))[_0xb527('0x43')](handleError(_0x25b27a,null));};exports[_0xb527('0x4a')]=function(_0x14383a,_0x35e714){if(_0x14383a['body']['id']){delete _0x14383a['body']['id'];}return db[_0xb527('0x29')][_0xb527('0x47')]({'where':{'id':_0x14383a['params']['id']}})[_0xb527('0x22')](handleEntityNotFound(_0x35e714,null))['then'](saveUpdates(_0x14383a[_0xb527('0x49')],null))[_0xb527('0x22')](respondWithResult(_0x35e714,null))[_0xb527('0x43')](handleError(_0x35e714,null));};exports[_0xb527('0x21')]=function(_0x3cf105,_0x495408){return db['JscriptySessionReport'][_0xb527('0x47')]({'where':{'id':_0x3cf105[_0xb527('0x45')]['id']}})['then'](handleEntityNotFound(_0x495408,null))['then'](removeEntity(_0x495408,null))[_0xb527('0x43')](handleError(_0x495408,null));};exports[_0xb527('0x4b')]=function(_0x4917fc,_0x5c5c34){return db[_0xb527('0x29')][_0xb527('0x4b')]()[_0xb527('0x22')](respondWithResult(_0x5c5c34,null))[_0xb527('0x43')](handleError(_0x5c5c34,null));};exports['getQuestions']=function(_0xe55dc4,_0x3c1447,_0x46a738){var _0x38b89e={'raw':!![],'where':{}};var _0x4f2350={};var _0x50999c={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xb527('0x4c')]({'where':{'id':_0xe55dc4['params']['id']}})[_0xb527('0x22')](handleEntityNotFound(_0x3c1447,null))[_0xb527('0x22')](function(_0x508c13){if(_0x508c13){_0x4f2350[_0xb527('0x2e')]=_[_0xb527('0x2f')](db[_0xb527('0x4d')][_0xb527('0x2a')]);_0x4f2350['query']=_[_0xb527('0x2f')](_0xe55dc4[_0xb527('0x30')]);_0x4f2350['filters']=_['intersection'](_0x4f2350[_0xb527('0x2e')],_0x4f2350['query']);_0x38b89e[_0xb527('0x33')]=_[_0xb527('0x31')](_0x4f2350[_0xb527('0x2e')],qs[_0xb527('0x32')](_0xe55dc4[_0xb527('0x30')][_0xb527('0x32')]));_0x38b89e[_0xb527('0x33')]=_0x38b89e[_0xb527('0x33')][_0xb527('0x34')]?_0x38b89e[_0xb527('0x33')]:_0x4f2350[_0xb527('0x2e')];if(!_0xe55dc4[_0xb527('0x30')][_0xb527('0x35')](_0xb527('0x36'))){_0x38b89e[_0xb527('0x1a')]=qs[_0xb527('0x1a')](_0xe55dc4[_0xb527('0x30')][_0xb527('0x1a')]);_0x38b89e[_0xb527('0x1b')]=qs[_0xb527('0x1b')](_0xe55dc4[_0xb527('0x30')][_0xb527('0x1b')]);}_0x38b89e['order']=qs[_0xb527('0x38')](_0xe55dc4[_0xb527('0x30')]['sort']);_0x38b89e[_0xb527('0x39')]=qs[_0xb527('0x3a')](_[_0xb527('0x3b')](_0xe55dc4[_0xb527('0x30')],_0x4f2350[_0xb527('0x3a')]));_0x38b89e['where']['SessionId']=_0x508c13['id'];if(_0xe55dc4[_0xb527('0x30')][_0xb527('0x3c')]){_0x38b89e[_0xb527('0x39')]=_[_0xb527('0x3d')](_0x38b89e[_0xb527('0x39')],{'$or':_[_0xb527('0x28')](_0x38b89e[_0xb527('0x33')],function(_0x555332){var _0x219356={};_0x219356[_0x555332]={'$like':'%'+_0xe55dc4[_0xb527('0x30')]['filter']+'%'};return _0x219356;})});}_0x38b89e=_[_0xb527('0x3d')]({},_0x38b89e,_0xe55dc4[_0xb527('0x3e')]);return db['JscriptyQuestionReport'][_0xb527('0x3f')]({'where':_0x38b89e[_0xb527('0x39')]})[_0xb527('0x22')](function(_0x27ace7){_0x50999c[_0xb527('0x3f')]=_0x27ace7;if(_0xe55dc4[_0xb527('0x30')][_0xb527('0x40')]){_0x38b89e['include']=[{'all':!![]}];}return db[_0xb527('0x4d')][_0xb527('0x41')](_0x38b89e);})[_0xb527('0x22')](function(_0x35ca57){_0x50999c[_0xb527('0x42')]=_0x35ca57;return _0x50999c;});}})['then'](respondWithFilteredResult(_0x3c1447,_0x38b89e))[_0xb527('0x43')](handleError(_0x3c1447,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index e939dab..8a5ed44 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 _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 +var _0x7278=['define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports'];(function(_0x4b9c09,_0xfaacb4){var _0x5462a2=function(_0x19e08a){while(--_0x19e08a){_0x4b9c09['push'](_0x4b9c09['shift']());}};_0x5462a2(++_0xfaacb4);}(_0x7278,0x161));var _0x8727=function(_0x203b85,_0x3c3432){_0x203b85=_0x203b85-0x0;var _0x5d2c34=_0x7278[_0x203b85];return _0x5d2c34;};'use strict';var _=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var logger=require(_0x8727('0x2'))(_0x8727('0x3'));var moment=require(_0x8727('0x4'));var BPromise=require('bluebird');var rp=require(_0x8727('0x5'));var fs=require('fs');var path=require(_0x8727('0x6'));var rimraf=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var attributes=require(_0x8727('0x9'));module[_0x8727('0xa')]=function(_0x180b71,_0x5549d5){return _0x180b71[_0x8727('0xb')](_0x8727('0xc'),attributes,{'tableName':_0x8727('0xd'),'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 4bb98d7..c7b874c 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 _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 +var _0x781d=['debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s'];(function(_0x55d59f,_0x31317c){var _0x2ebf84=function(_0x3d01ea){while(--_0x3d01ea){_0x55d59f['push'](_0x55d59f['shift']());}};_0x2ebf84(++_0x31317c);}(_0x781d,0x14a));var _0xd781=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x781d[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd781('0x2'));var fs=require('fs');var Redis=require(_0xd781('0x3'));var db=require(_0xd781('0x4'))['db'];var utils=require(_0xd781('0x5'));var logger=require(_0xd781('0x6'))(_0xd781('0x7'));var config=require(_0xd781('0x8'));var jayson=require(_0xd781('0x9'));var client=jayson[_0xd781('0xa')][_0xd781('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a07f0,_0x133509,_0x1a242d){return new BPromise(function(_0x50610d,_0x248172){return client['request'](_0x5a07f0,_0x1a242d)[_0xd781('0xc')](function(_0x5c18c8){logger[_0xd781('0xd')](_0xd781('0xe'),_0x133509,'request\x20sent');logger[_0xd781('0xf')](_0xd781('0x10'),_0x133509,'request\x20sent',JSON['stringify'](_0x5c18c8));if(_0x5c18c8[_0xd781('0x11')]){if(_0x5c18c8[_0xd781('0x11')][_0xd781('0x12')]===0x1f4){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);return _0x248172(_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);}logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8['error'][_0xd781('0x13')]);return _0x50610d(_0x5c18c8[_0xd781('0x11')]['message']);}else{logger[_0xd781('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x133509,_0xd781('0x14'));_0x50610d(_0x5c18c8[_0xd781('0x15')][_0xd781('0x13')]);}})[_0xd781('0x16')](function(_0x42a9c1){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x42a9c1);_0x248172(_0x42a9c1);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index cf03708..47be5b1 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 _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 +var _0xc1fd=['exports','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','put','/:id','isAuthenticated','get','/download_log_file'];(function(_0x117a8e,_0x31955e){var _0x1f487a=function(_0xa3607c){while(--_0xa3607c){_0x117a8e['push'](_0x117a8e['shift']());}};_0x1f487a(++_0x31955e);}(_0xc1fd,0x16d));var _0xdc1f=function(_0x258319,_0x5d618d){_0x258319=_0x258319-0x0;var _0x1ec7cb=_0xc1fd[_0x258319];return _0x1ec7cb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdc1f('0x0'));var timeout=require('connect-timeout');var express=require(_0xdc1f('0x1'));var router=express[_0xdc1f('0x2')]();var fs_extra=require(_0xdc1f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xdc1f('0x4'));var config=require(_0xdc1f('0x5'));var controller=require(_0xdc1f('0x6'));router['get']('/',controller['index']);router[_0xdc1f('0x7')](_0xdc1f('0x8'),auth[_0xdc1f('0x9')](),controller['update']);router[_0xdc1f('0xa')](_0xdc1f('0xb'),auth[_0xdc1f('0x9')](),controller['downloadLogFile']);module[_0xdc1f('0xc')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 3f52df1..814cba8 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 _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 +var _0x09ea=['STRING','INTEGER','exports','TEXT'];(function(_0x5a7ed0,_0x27aae9){var _0x4a8cae=function(_0x443370){while(--_0x443370){_0x5a7ed0['push'](_0x5a7ed0['shift']());}};_0x4a8cae(++_0x27aae9);}(_0x09ea,0x9a));var _0xa09e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x09ea[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xa09e('0x0')]={'license':{'type':Sequelize[_0xa09e('0x1')]},'data1':{'type':Sequelize[_0xa09e('0x2')]},'data2':{'type':Sequelize[_0xa09e('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xa09e('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 4f1ecef..a887307 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 _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 +var _0x6f55=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','stack','name','send','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields','getLicense','catch','update','body','License','find','get','key','demo','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','set','text/plain','download','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f55,0xb6));var _0x56f5=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x6f55[_0x166d93];return _0xba708;};'use strict';var emlformat=require(_0x56f5('0x0'));var rimraf=require(_0x56f5('0x1'));var zipdir=require(_0x56f5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x56f5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x56f5('0x4'));var path=require(_0x56f5('0x5'));var sox=require(_0x56f5('0x6'));var csv=require(_0x56f5('0x7'));var ejs=require(_0x56f5('0x8'));var fs=require('fs');var fs_extra=require(_0x56f5('0x9'));var _=require('lodash');var squel=require(_0x56f5('0xa'));var crypto=require(_0x56f5('0xb'));var jsforce=require(_0x56f5('0xc'));var deskjs=require(_0x56f5('0xd'));var toCsv=require(_0x56f5('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x56f5('0xe'));var qs=require(_0x56f5('0xf'));var as=require(_0x56f5('0x10'));var hardwareService=require(_0x56f5('0x11'));var logger=require('../../config/logger')(_0x56f5('0x12'));var utils=require(_0x56f5('0x13'));var config=require(_0x56f5('0x14'));var licenseUtil=require(_0x56f5('0x15'));var db=require(_0x56f5('0x16'))['db'];function respondWithStatusCode(_0x38929d,_0x3ab87f){_0x3ab87f=_0x3ab87f||0xcc;return function(_0x188d9c){if(_0x188d9c){return _0x38929d[_0x56f5('0x17')](_0x3ab87f);}return _0x38929d[_0x56f5('0x18')](_0x3ab87f)[_0x56f5('0x19')]();};}function respondWithResult(_0x4e700d,_0x5619b2){_0x5619b2=_0x5619b2||0xc8;return function(_0x4e72fb){if(_0x4e72fb){return _0x4e700d[_0x56f5('0x18')](_0x5619b2)[_0x56f5('0x1a')](_0x4e72fb);}};}function respondWithFilteredResult(_0x110aca,_0x124085){return function(_0x50b986){if(_0x50b986){var _0x13ab66=typeof _0x124085[_0x56f5('0x1b')]==='undefined'&&typeof _0x124085[_0x56f5('0x1c')]===_0x56f5('0x1d');var _0x3888f9=_0x50b986[_0x56f5('0x1e')];var _0x2dab09=_0x13ab66?0x0:_0x124085[_0x56f5('0x1b')];var _0x5b522c=_0x13ab66?_0x50b986['count']:_0x124085[_0x56f5('0x1b')]+_0x124085[_0x56f5('0x1c')];var _0x3e1f2b;if(_0x5b522c>=_0x3888f9){_0x5b522c=_0x3888f9;_0x3e1f2b=0xc8;}else{_0x3e1f2b=0xce;}_0x110aca[_0x56f5('0x18')](_0x3e1f2b);return _0x110aca['set'](_0x56f5('0x1f'),_0x2dab09+'-'+_0x5b522c+'/'+_0x3888f9)[_0x56f5('0x1a')](_0x50b986);}return null;};}function patchUpdates(_0x39a3ab){return function(_0x5bf284){try{jsonpatch[_0x56f5('0x20')](_0x5bf284,_0x39a3ab,!![]);}catch(_0x248e44){return BPromise[_0x56f5('0x21')](_0x248e44);}return _0x5bf284[_0x56f5('0x22')]();};}function saveUpdates(_0x249247,_0x32224b){return function(_0x13e95a){if(_0x13e95a){return _0x13e95a['update'](_0x249247)['then'](function(_0x5ed43d){return _0x5ed43d;});}return null;};}function removeEntity(_0x4726bf,_0x3c50d9){return function(_0x506a25){if(_0x506a25){return _0x506a25['destroy']()[_0x56f5('0x23')](function(){_0x4726bf[_0x56f5('0x18')](0xcc)[_0x56f5('0x19')]();});}};}function handleEntityNotFound(_0x56fc26,_0x42ba04){return function(_0x257787){if(!_0x257787){_0x56fc26['sendStatus'](0x194);}return _0x257787;};}function handleError(_0x1ef0e1,_0x132cba){_0x132cba=_0x132cba||0x1f4;return function(_0x3802db){logger['error'](_0x3802db[_0x56f5('0x24')]);if(_0x3802db[_0x56f5('0x25')]){delete _0x3802db[_0x56f5('0x25')];}_0x1ef0e1['status'](_0x132cba)[_0x56f5('0x26')](_0x3802db);};}var utilLicense=require(_0x56f5('0x15'));exports[_0x56f5('0x27')]=function(_0x5c45c4,_0x3356cf){var _0x286cd0={'raw':!![],'where':{'id':0x1}},_0x4b507a={};_0x4b507a[_0x56f5('0x28')]=_[_0x56f5('0x29')](db['License'][_0x56f5('0x2a')]);_0x4b507a[_0x56f5('0x2b')]=_[_0x56f5('0x29')](_0x5c45c4[_0x56f5('0x2b')]);_0x4b507a[_0x56f5('0x2c')]=_[_0x56f5('0x2d')](_0x4b507a[_0x56f5('0x28')],_0x4b507a[_0x56f5('0x2b')]);_0x286cd0[_0x56f5('0x2e')]=_[_0x56f5('0x2d')](_0x4b507a[_0x56f5('0x28')],qs[_0x56f5('0x2f')](_0x5c45c4[_0x56f5('0x2b')][_0x56f5('0x2f')]));_0x286cd0[_0x56f5('0x2e')]=_0x286cd0[_0x56f5('0x2e')]['length']?_0x286cd0[_0x56f5('0x2e')]:_0x4b507a[_0x56f5('0x28')];_0x286cd0=_['merge']({},_0x286cd0,_0x5c45c4['options']);return utilLicense[_0x56f5('0x30')](_0x286cd0)[_0x56f5('0x23')](respondWithResult(_0x3356cf,null))[_0x56f5('0x31')](handleError(_0x3356cf,null));};exports[_0x56f5('0x32')]=function(_0x58c51c,_0x1975cf){if(_0x58c51c[_0x56f5('0x33')]['id']){delete _0x58c51c[_0x56f5('0x33')]['id'];}return db[_0x56f5('0x34')][_0x56f5('0x35')]({'where':{'id':_0x58c51c['params']['id']}})[_0x56f5('0x23')](handleEntityNotFound(_0x1975cf,null))[_0x56f5('0x23')](function(_0x4ff3ab){var _0x37aade=_0x4ff3ab[_0x56f5('0x36')]({'plain':!![]});return utilLicense['checkLicense'](_0x37aade,_0x58c51c[_0x56f5('0x33')][_0x56f5('0x37')]);})[_0x56f5('0x23')](function(_0x1fbd88){if(!_0x1fbd88[_0x56f5('0x38')]){return saveUpdates(_0x58c51c[_0x56f5('0x33')],null);}return _0x1fbd88;})[_0x56f5('0x23')](respondWithResult(_0x1975cf,null))[_0x56f5('0x31')](handleError(_0x1975cf,null));};exports['downloadLogFile']=function(_0x208c32,_0x31de09){var _0x4b960d=_0x56f5('0x39');var _0x98cba0=path[_0x56f5('0x3a')](_0x56f5('0x3b'),_0x56f5('0x3c'),_0x56f5('0x3d'),_0x4b960d);_0x31de09[_0x56f5('0x3e')](_0x56f5('0x3f'),'attachment;\x20filename='+_0x4b960d);_0x31de09[_0x56f5('0x40')]('Content-Type',_0x56f5('0x41'));_0x31de09[_0x56f5('0x42')](_0x98cba0);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 6346ae4..43ac359 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 _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 +var _0x7954=['license','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./license.attributes','define','License'];(function(_0x1e9fc5,_0x288642){var _0x46576d=function(_0x38b2f9){while(--_0x38b2f9){_0x1e9fc5['push'](_0x1e9fc5['shift']());}};_0x46576d(++_0x288642);}(_0x7954,0x169));var _0x4795=function(_0x3edc8b,_0x1996cb){_0x3edc8b=_0x3edc8b-0x0;var _0xbf74e5=_0x7954[_0x3edc8b];return _0xbf74e5;};'use strict';var _=require(_0x4795('0x0'));var util=require(_0x4795('0x1'));var logger=require(_0x4795('0x2'))('api');var moment=require(_0x4795('0x3'));var BPromise=require(_0x4795('0x4'));var rp=require(_0x4795('0x5'));var fs=require('fs');var path=require(_0x4795('0x6'));var rimraf=require('rimraf');var config=require(_0x4795('0x7'));var attributes=require(_0x4795('0x8'));module['exports']=function(_0x25d835,_0xaee130){return _0x25d835[_0x4795('0x9')](_0x4795('0xa'),attributes,{'tableName':_0x4795('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 04e7022..e6c859f 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 _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 +var _0x5c1b=['../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5e920f,_0x2531fa){var _0x2c2d69=function(_0xb08ab6){while(--_0xb08ab6){_0x5e920f['push'](_0x5e920f['shift']());}};_0x2c2d69(++_0x2531fa);}(_0x5c1b,0xb2));var _0xb5c1=function(_0x1ecf1b,_0xc6554){_0x1ecf1b=_0x1ecf1b-0x0;var _0x242a80=_0x5c1b[_0x1ecf1b];return _0x242a80;};'use strict';var _=require(_0xb5c1('0x0'));var util=require('util');var moment=require(_0xb5c1('0x1'));var BPromise=require('bluebird');var rs=require(_0xb5c1('0x2'));var fs=require('fs');var Redis=require(_0xb5c1('0x3'));var db=require(_0xb5c1('0x4'))['db'];var utils=require(_0xb5c1('0x5'));var logger=require(_0xb5c1('0x6'))(_0xb5c1('0x7'));var config=require(_0xb5c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb5c1('0x9')][_0xb5c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x236a74,_0x19aafe,_0x3e828){return new BPromise(function(_0x26d81b,_0x12ceda){return client[_0xb5c1('0xb')](_0x236a74,_0x3e828)[_0xb5c1('0xc')](function(_0x3579c7){logger['info']('License,\x20%s,\x20%s',_0x19aafe,_0xb5c1('0xd'));logger[_0xb5c1('0xe')](_0xb5c1('0xf'),_0x19aafe,_0xb5c1('0xd'),JSON[_0xb5c1('0x10')](_0x3579c7));if(_0x3579c7[_0xb5c1('0x11')]){if(_0x3579c7['error'][_0xb5c1('0x12')]===0x1f4){logger[_0xb5c1('0x11')](_0xb5c1('0x13'),_0x19aafe,_0x3579c7[_0xb5c1('0x11')][_0xb5c1('0x14')]);return _0x12ceda(_0x3579c7[_0xb5c1('0x11')]['message']);}logger[_0xb5c1('0x11')](_0xb5c1('0x13'),_0x19aafe,_0x3579c7['error'][_0xb5c1('0x14')]);return _0x26d81b(_0x3579c7[_0xb5c1('0x11')][_0xb5c1('0x14')]);}else{logger['info']('License,\x20%s,\x20%s',_0x19aafe,_0xb5c1('0xd'));_0x26d81b(_0x3579c7[_0xb5c1('0x15')][_0xb5c1('0x14')]);}})[_0xb5c1('0x16')](function(_0x26abdf){logger['error'](_0xb5c1('0x13'),_0x19aafe,_0x26abdf);_0x12ceda(_0x26abdf);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 0ebc0f3..98a51d0 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 _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 +var _0xa0f9=['addSmtp','addInteraction','/:id/send','send','addAgents','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','post','addDisposition','addAnswer','create','/:id/in_servers','addImap'];(function(_0x3b1188,_0x408ef3){var _0x3d103d=function(_0x3ebd0b){while(--_0x3ebd0b){_0x3b1188['push'](_0x3b1188['shift']());}};_0x3d103d(++_0x408ef3);}(_0xa0f9,0x126));var _0x9a0f=function(_0x68fd87,_0x17f037){_0x68fd87=_0x68fd87-0x0;var _0x559470=_0xa0f9[_0x68fd87];return _0x559470;};'use strict';var multer=require(_0x9a0f('0x0'));var util=require(_0x9a0f('0x1'));var path=require(_0x9a0f('0x2'));var timeout=require('connect-timeout');var express=require(_0x9a0f('0x3'));var router=express[_0x9a0f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9a0f('0x5'));var interaction=require(_0x9a0f('0x6'));var config=require(_0x9a0f('0x7'));var controller=require('./mailAccount.controller');router[_0x9a0f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x9a0f('0x9')](),controller[_0x9a0f('0xa')]);router[_0x9a0f('0x8')](_0x9a0f('0xb'),auth['isAuthenticated'](),controller[_0x9a0f('0xc')]);router[_0x9a0f('0x8')](_0x9a0f('0xd'),auth[_0x9a0f('0x9')](),controller[_0x9a0f('0xe')]);router[_0x9a0f('0x8')](_0x9a0f('0xf'),auth[_0x9a0f('0x9')](),controller[_0x9a0f('0x10')]);router[_0x9a0f('0x8')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x9a0f('0x11')]);router[_0x9a0f('0x8')](_0x9a0f('0x12'),auth['isAuthenticated'](),controller[_0x9a0f('0x13')]);router[_0x9a0f('0x8')](_0x9a0f('0x14'),auth[_0x9a0f('0x9')](),controller[_0x9a0f('0x15')]);router[_0x9a0f('0x8')](_0x9a0f('0x16'),auth['isAuthenticated'](),controller[_0x9a0f('0x17')]);router[_0x9a0f('0x8')](_0x9a0f('0x18'),auth[_0x9a0f('0x9')](),controller[_0x9a0f('0x19')]);router[_0x9a0f('0x8')](_0x9a0f('0x1a'),auth[_0x9a0f('0x9')](),controller[_0x9a0f('0x1b')]);router[_0x9a0f('0x8')](_0x9a0f('0x1c'),auth[_0x9a0f('0x9')](),controller['getAgents']);router[_0x9a0f('0x1d')](_0x9a0f('0xd'),auth[_0x9a0f('0x9')](),controller[_0x9a0f('0x1e')]);router['post'](_0x9a0f('0xf'),auth[_0x9a0f('0x9')](),controller[_0x9a0f('0x1f')]);router[_0x9a0f('0x1d')]('/',auth[_0x9a0f('0x9')](),controller[_0x9a0f('0x20')]);router['post'](_0x9a0f('0x21'),auth[_0x9a0f('0x9')](),controller[_0x9a0f('0x22')]);router[_0x9a0f('0x1d')](_0x9a0f('0x12'),auth['isAuthenticated'](),controller[_0x9a0f('0x23')]);router[_0x9a0f('0x1d')](_0x9a0f('0x14'),auth[_0x9a0f('0x9')](),controller[_0x9a0f('0x24')]);router['post'](_0x9a0f('0x16'),auth[_0x9a0f('0x9')](),controller['addApplications']);router[_0x9a0f('0x1d')](_0x9a0f('0x25'),auth[_0x9a0f('0x9')](),controller[_0x9a0f('0x26')]);router[_0x9a0f('0x1d')](_0x9a0f('0x1c'),auth[_0x9a0f('0x9')](),controller[_0x9a0f('0x27')]);router['put'](_0x9a0f('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x9a0f('0x28')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x9a0f('0x28')](_0x9a0f('0xf'),auth[_0x9a0f('0x9')](),controller[_0x9a0f('0x29')]);router[_0x9a0f('0x28')]('/:id/in_servers',auth[_0x9a0f('0x9')](),controller[_0x9a0f('0x2a')]);router[_0x9a0f('0x28')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x9a0f('0x2b')]);router[_0x9a0f('0x28')](_0x9a0f('0xb'),auth['isAuthenticated'](),controller[_0x9a0f('0x2c')]);router[_0x9a0f('0x28')](_0x9a0f('0x1c'),auth[_0x9a0f('0x9')](),controller[_0x9a0f('0x2d')]);module[_0x9a0f('0x2e')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 6ae4ab4..3ef1f51 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 _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 +var _0x52b3=['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','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','ENUM','yahoo','outlook365','getDataValue','provider','custom','STRING','BOOLEAN','TEXT'];(function(_0x57b587,_0x60a3e4){var _0x5e51a3=function(_0x2ea512){while(--_0x2ea512){_0x57b587['push'](_0x57b587['shift']());}};_0x5e51a3(++_0x60a3e4);}(_0x52b3,0xd5));var _0x352b=function(_0x3f090f,_0xcb1291){_0x3f090f=_0x3f090f-0x0;var _0x2b76fb=_0x52b3[_0x3f090f];return _0x2b76fb;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x352b('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0x352b('0x1')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x352b('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x352b('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x352b('0x2')]},'markAsUnread':{'type':Sequelize[_0x352b('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x352b('0x0')],'allowNull':![],'defaultValue':_0x352b('0x3')},'fontSize':{'type':Sequelize[_0x352b('0x4')](0x2)[_0x352b('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x352b('0x6');}},'notificationSound':{'type':Sequelize[_0x352b('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x352b('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x352b('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x352b('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x352b('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x352b('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x352b('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x352b('0x1')],'defaultValue':![],'comment':_0x352b('0x8'),'set':function(_0x123c3a){if(!_0x123c3a)this['setDataValue'](_0x352b('0x9'),null);this[_0x352b('0xa')](_0x352b('0xb'),_0x123c3a);}},'provider':{'type':Sequelize[_0x352b('0xc')]('gmail','hotmail',_0x352b('0xd'),_0x352b('0xe')),'defaultValue':null,'get':function(){if(!this[_0x352b('0xf')](_0x352b('0x10')))return _0x352b('0x11');return this[_0x352b('0xf')](_0x352b('0x10'));},'set':function(_0x27ad27){if(_0x27ad27===_0x352b('0x11'))_0x27ad27=null;return this[_0x352b('0xa')](_0x352b('0x10'),_0x27ad27);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 4d6e318..8052017 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 _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 +var _0x3db8=['filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','params','fields','includeAll','find','body','provider','custom','Smtp','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','create','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','hasOwnProperty','CannedAnswer','findAll','removeAnswers','email','ListId','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','finally','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','true','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','getSmtpOptions','List\x20not\x20found','messageId','subject','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','User','moment','util','path','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','update','destroy','get','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','hotmail','user','username','pass','password','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','Imap','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0xe7ea8d,_0x5a0ce8){var _0x2187de=function(_0x3df1fa){while(--_0x3df1fa){_0xe7ea8d['push'](_0xe7ea8d['shift']());}};_0x2187de(++_0x5a0ce8);}(_0x3db8,0x1e9));var _0x83db=function(_0x41d477,_0x2b496e){_0x41d477=_0x41d477-0x0;var _0x490217=_0x3db8[_0x41d477];return _0x490217;};'use strict';var moment=require(_0x83db('0x0'));var BPromise=require('bluebird');var util=require(_0x83db('0x1'));var path=require(_0x83db('0x2'));var _=require(_0x83db('0x3'));var juice=require('juice');var Redis=require('ioredis');var qs=require(_0x83db('0x4'));var logger=require(_0x83db('0x5'))(_0x83db('0x6'));var config=require('../../config/environment');var db=require(_0x83db('0x7'))['db'];config[_0x83db('0x8')]=_['defaults'](config[_0x83db('0x8')],{'host':_0x83db('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x83db('0x8')]));require(_0x83db('0xa'))[_0x83db('0xb')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x5c9c96,_0x47e24d,_0x448998,_0x33d41b){return new BPromise(function(_0x2d1079,_0x1b0bfd){var _0x2fb170=_0x33d41b||client;return _0x2fb170[_0x83db('0xc')](_0x5c9c96,_0x448998)[_0x83db('0xd')](function(_0x4615aa){logger[_0x83db('0xe')](_0x83db('0xf'),_0x47e24d,_0x83db('0x10'));logger[_0x83db('0x11')](_0x83db('0x12'),_0x47e24d,_0x83db('0x10'),JSON['stringify'](_0x4615aa));if(_0x4615aa['error']){if(_0x4615aa['error']['code']===0x1f4){logger[_0x83db('0x13')](_0x83db('0xf'),_0x47e24d,_0x4615aa[_0x83db('0x13')][_0x83db('0x14')]);return _0x1b0bfd(_0x4615aa[_0x83db('0x13')]['message']);}logger[_0x83db('0x13')](_0x83db('0xf'),_0x47e24d,_0x4615aa['error'][_0x83db('0x14')]);return _0x2d1079(_0x4615aa['error']['message']);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x47e24d,_0x83db('0x10'));_0x2d1079(_0x4615aa[_0x83db('0x15')]['message']);}})['catch'](function(_0x3be028){logger[_0x83db('0x13')]('MailAccount,\x20%s,\x20%s',_0x47e24d,_0x3be028);_0x1b0bfd(_0x3be028);});});}function respondWithStatusCode(_0x26900a,_0x42c164){_0x42c164=_0x42c164||0xcc;return function(_0x3d8ac0){if(_0x3d8ac0){return _0x26900a[_0x83db('0x16')](_0x42c164);}return _0x26900a[_0x83db('0x17')](_0x42c164)[_0x83db('0x18')]();};}function respondWithResult(_0x25889d,_0x569856){_0x569856=_0x569856||0xc8;return function(_0x2f0f12){if(_0x2f0f12){return _0x25889d[_0x83db('0x17')](_0x569856)[_0x83db('0x19')](_0x2f0f12);}};}function respondWithFilteredResult(_0x2ca37f,_0x11c5fe){return function(_0x44b07f){if(_0x44b07f){var _0x328e8d=typeof _0x11c5fe[_0x83db('0x1a')]===_0x83db('0x1b')&&typeof _0x11c5fe[_0x83db('0x1c')]==='undefined';var _0x2c618e=_0x44b07f[_0x83db('0x1d')];var _0xd3201c=_0x328e8d?0x0:_0x11c5fe[_0x83db('0x1a')];var _0x5047e3=_0x328e8d?_0x44b07f[_0x83db('0x1d')]:_0x11c5fe[_0x83db('0x1a')]+_0x11c5fe[_0x83db('0x1c')];var _0x4bd0d9;if(_0x5047e3>=_0x2c618e){_0x5047e3=_0x2c618e;_0x4bd0d9=0xc8;}else{_0x4bd0d9=0xce;}_0x2ca37f[_0x83db('0x17')](_0x4bd0d9);return _0x2ca37f[_0x83db('0x1e')]('Content-Range',_0xd3201c+'-'+_0x5047e3+'/'+_0x2c618e)[_0x83db('0x19')](_0x44b07f);}return null;};}function saveUpdates(_0x2f9e6a){return function(_0x4d5760){if(_0x4d5760){return _0x4d5760[_0x83db('0x1f')](_0x2f9e6a)[_0x83db('0xd')](function(_0x19f1ed){return _0x19f1ed;});}return null;};}function removeEntity(_0x542e1e){return function(_0x188ed3){if(_0x188ed3){return _0x188ed3[_0x83db('0x20')]()[_0x83db('0xd')](function(){var _0x2b8d40=_0x188ed3[_0x83db('0x21')]({'plain':!![]});var _0x1ce6b3='MailAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x1ce6b3,'resourceId':_0x2b8d40['id']}})[_0x83db('0xd')](function(){return _0x188ed3;});})['then'](function(){_0x542e1e['status'](0xcc)[_0x83db('0x18')]();});}};}function handleEntityNotFound(_0x346796){return function(_0x1b8e85){if(!_0x1b8e85){_0x346796[_0x83db('0x16')](0x194);}return _0x1b8e85;};}function handleError(_0x19ca9d,_0x2d6720){_0x2d6720=_0x2d6720||0x1f4;return function(_0x269861){logger[_0x83db('0x13')](_0x269861[_0x83db('0x22')]);if(_0x269861['name']){delete _0x269861[_0x83db('0x23')];}_0x19ca9d[_0x83db('0x17')](_0x2d6720)[_0x83db('0x24')](_0x269861);};}function getImapHost(_0x487adf){switch(_0x487adf){case _0x83db('0x25'):return _0x83db('0x26');case _0x83db('0x27'):return _0x83db('0x28');case'hotmail':return _0x83db('0x29');case'outlook365':return _0x83db('0x2a');}throw new Error(_0x83db('0x2b'),_0x487adf);}function getSmtpHost(_0x1fa01c){switch(_0x1fa01c){case'gmail':return'smtp.gmail.com';case'yahoo':return _0x83db('0x2c');case _0x83db('0x2d'):return'smtp-mail.outlook.com';case'outlook365':return'smtp.office365.com';}throw new Error(_0x83db('0x2b'),_0x1fa01c);}function getAuthenticationOptions(_0xcab085,_0x569f34){var _0x13a566={};var _0x32447d={};if(_0xcab085){_0x13a566[_0x83db('0x2e')]=_0x32447d['user']=_0x569f34[_0x83db('0x2f')];_0x13a566['password']=_0x32447d[_0x83db('0x30')]=_0x569f34[_0x83db('0x31')];if(_0x569f34['modernAuthentication']){_0x13a566['modernAuthentication']=_0x32447d[_0x83db('0x32')]=!![];_0x13a566[_0x83db('0x33')]=_0x32447d[_0x83db('0x33')]=_0x569f34[_0x83db('0x33')];_0x13a566[_0x83db('0x31')]=_0x32447d[_0x83db('0x30')]=null;}else{_0x13a566['CloudProviderId']=_0x32447d[_0x83db('0x33')]=null;}_0x13a566['host']=getImapHost(_0xcab085);_0x13a566[_0x83db('0x34')]=0x3e1;_0x32447d[_0x83db('0x35')]=getSmtpHost(_0xcab085);_0x32447d[_0x83db('0x34')]=0x24b;_0x32447d[_0x83db('0x36')]=![];_0x13a566[_0x83db('0x37')]=_0x32447d[_0x83db('0x37')]=null;}else{if(_0x569f34['authentication']){_0x13a566[_0x83db('0x2e')]=_0x32447d[_0x83db('0x2e')]=_0x569f34[_0x83db('0x2f')];_0x13a566[_0x83db('0x31')]=_0x32447d[_0x83db('0x30')]=_0x569f34[_0x83db('0x31')];}else{_0x13a566[_0x83db('0x38')]=_0x32447d[_0x83db('0x38')]=![];_0x13a566['user']=_0x32447d[_0x83db('0x2e')]=null;_0x13a566['password']=_0x32447d[_0x83db('0x30')]=null;}_0x13a566[_0x83db('0x35')]=_0x569f34['Imap'][_0x83db('0x35')];_0x13a566[_0x83db('0x34')]=_0x569f34[_0x83db('0x39')][_0x83db('0x34')];_0x32447d[_0x83db('0x35')]=_0x569f34['Smtp']['host'];_0x32447d[_0x83db('0x34')]=_0x569f34['Smtp'][_0x83db('0x34')];}return{'Imap':_0x13a566,'Smtp':_0x32447d};}exports[_0x83db('0x3a')]=function(_0x3997dc,_0x12892d){var _0x12b7e4={'include':[{'model':db[_0x83db('0x3b')],'as':_0x83db('0x39')},{'model':db[_0x83db('0x3c')],'as':'Smtp'},{'model':db[_0x83db('0x3d')],'as':_0x83db('0x3e')}]},_0x478b81={},_0x135af5={'count':0x0,'rows':[]};var _0xa8cc5d=_[_0x83db('0x3f')](db[_0x83db('0x40')][_0x83db('0x41')],function(_0x2fefaf){return{'name':_0x2fefaf[_0x83db('0x42')],'type':_0x2fefaf[_0x83db('0x43')][_0x83db('0x44')]};});_0x478b81[_0x83db('0x45')]=_[_0x83db('0x3f')](_0xa8cc5d,'name');_0x478b81[_0x83db('0x46')]=_[_0x83db('0x47')](_0x3997dc[_0x83db('0x46')]);_0x478b81[_0x83db('0x48')]=_[_0x83db('0x49')](_0x478b81[_0x83db('0x45')],_0x478b81['query']);_0x12b7e4[_0x83db('0x4a')]=_['intersection'](_0x478b81['model'],qs['fields'](_0x3997dc[_0x83db('0x46')]['fields']));_0x12b7e4[_0x83db('0x4a')]=_0x12b7e4[_0x83db('0x4a')][_0x83db('0x4b')]?_0x12b7e4[_0x83db('0x4a')]:_0x478b81[_0x83db('0x45')];if(!_0x3997dc[_0x83db('0x46')]['hasOwnProperty'](_0x83db('0x4c'))){_0x12b7e4[_0x83db('0x1c')]=qs[_0x83db('0x1c')](_0x3997dc[_0x83db('0x46')][_0x83db('0x1c')]);_0x12b7e4[_0x83db('0x1a')]=qs[_0x83db('0x1a')](_0x3997dc[_0x83db('0x46')]['offset']);}_0x12b7e4[_0x83db('0x4d')]=qs[_0x83db('0x4e')](_0x3997dc['query'][_0x83db('0x4e')]);_0x12b7e4[_0x83db('0x4f')]=qs[_0x83db('0x48')](_[_0x83db('0x50')](_0x3997dc['query'],_0x478b81[_0x83db('0x48')]),_0xa8cc5d);if(_0x3997dc['query'][_0x83db('0x51')]){_0x12b7e4[_0x83db('0x4f')]=_[_0x83db('0x52')](_0x12b7e4['where'],{'$or':_['map'](_0xa8cc5d,function(_0x2ea62b){if(_0x2ea62b[_0x83db('0x43')]!==_0x83db('0x53')){var _0x12ca78={};_0x12ca78[_0x2ea62b['name']]={'$like':'%'+_0x3997dc[_0x83db('0x46')][_0x83db('0x51')]+'%'};return _0x12ca78;}})});}_0x12b7e4=_[_0x83db('0x52')]({},_0x12b7e4,_0x3997dc[_0x83db('0x54')]);var _0x1a47ce={'where':_0x12b7e4[_0x83db('0x4f')]};return db[_0x83db('0x40')]['count'](_0x1a47ce)['then'](function(_0xd72b9){_0x135af5[_0x83db('0x1d')]=_0xd72b9;if(_0x3997dc['query']['includeAll']){_0x12b7e4[_0x83db('0x55')]=[{'all':!![]}];}return db[_0x83db('0x40')]['findAll'](_0x12b7e4);})[_0x83db('0xd')](function(_0xc38c9f){_0x135af5[_0x83db('0x56')]=_0xc38c9f;return _0x135af5;})[_0x83db('0xd')](respondWithFilteredResult(_0x12892d,_0x12b7e4))[_0x83db('0x57')](handleError(_0x12892d,null));};exports['show']=function(_0xf6d19f,_0x36df05){var _0x385265={'raw':![],'where':{'id':_0xf6d19f[_0x83db('0x58')]['id']},'include':[{'model':db[_0x83db('0x3b')],'as':_0x83db('0x39')},{'model':db[_0x83db('0x3c')],'as':'Smtp'},{'model':db['Pause'],'as':_0x83db('0x3e')}]},_0x5f28c4={};_0x5f28c4[_0x83db('0x45')]=_[_0x83db('0x47')](db[_0x83db('0x40')][_0x83db('0x41')]);_0x5f28c4['query']=_[_0x83db('0x47')](_0xf6d19f['query']);_0x5f28c4['filters']=_[_0x83db('0x49')](_0x5f28c4[_0x83db('0x45')],_0x5f28c4[_0x83db('0x46')]);_0x385265[_0x83db('0x4a')]=_[_0x83db('0x49')](_0x5f28c4['model'],qs[_0x83db('0x59')](_0xf6d19f[_0x83db('0x46')][_0x83db('0x59')]));_0x385265[_0x83db('0x4a')]=_0x385265[_0x83db('0x4a')][_0x83db('0x4b')]?_0x385265[_0x83db('0x4a')]:_0x5f28c4[_0x83db('0x45')];if(_0xf6d19f[_0x83db('0x46')][_0x83db('0x5a')]){_0x385265[_0x83db('0x55')]=[{'all':!![]}];}_0x385265=_['merge']({},_0x385265,_0xf6d19f[_0x83db('0x54')]);return db[_0x83db('0x40')][_0x83db('0x5b')](_0x385265)[_0x83db('0xd')](handleEntityNotFound(_0x36df05,null))[_0x83db('0xd')](respondWithResult(_0x36df05,null))[_0x83db('0x57')](handleError(_0x36df05,null));};exports[_0x83db('0x1f')]=function(_0x55566b,_0x212706){if(_0x55566b[_0x83db('0x5c')]['id']){delete _0x55566b[_0x83db('0x5c')]['id'];}var _0x139fcd=_0x55566b['body'][_0x83db('0x5d')]===_0x83db('0x5e')?null:_0x55566b[_0x83db('0x5c')][_0x83db('0x5d')];var _0x393eb5=_0x55566b[_0x83db('0x5c')]['Imap']||{};var _0x1cb49c=_0x55566b[_0x83db('0x5c')][_0x83db('0x5f')]||{};if(_0x139fcd){_0x393eb5['host']=getImapHost(_0x139fcd);_0x393eb5[_0x83db('0x34')]=0x3e1;_0x1cb49c['host']=getSmtpHost(_0x139fcd);_0x1cb49c[_0x83db('0x34')]=0x24b;_0x1cb49c[_0x83db('0x36')]=![];}if(_0x1cb49c[_0x83db('0x32')]){_0x1cb49c['secure']=![];}else{_0x1cb49c[_0x83db('0x33')]=null;}if(!_0x393eb5[_0x83db('0x32')])_0x393eb5[_0x83db('0x33')]=null;_0x55566b['body'][_0x83db('0x39')]=_0x393eb5;_0x55566b[_0x83db('0x5c')][_0x83db('0x5f')]=_0x1cb49c;return db[_0x83db('0x40')][_0x83db('0x5b')]({'where':{'id':_0x55566b[_0x83db('0x58')]['id']},'include':[{'model':db[_0x83db('0x3b')],'as':'Imap'},{'model':db[_0x83db('0x3c')],'as':_0x83db('0x5f')},{'model':db[_0x83db('0x3d')],'as':'mandatoryDispositionPause'}]})[_0x83db('0xd')](handleEntityNotFound(_0x212706,null))['then'](function(_0x50b95d){if(!_0x50b95d)throw new Error(_0x83db('0x60'));if(_0x50b95d[_0x83db('0x37')])delete _0x55566b[_0x83db('0x5c')][_0x83db('0x39')];return _0x50b95d;})[_0x83db('0xd')](saveUpdates(_0x55566b[_0x83db('0x5c')],null))[_0x83db('0xd')](function(_0xc89fe6){if(!_0x55566b[_0x83db('0x5c')]['Imap'])return _0xc89fe6;return db['MailServerIn']['update'](_0x55566b[_0x83db('0x5c')][_0x83db('0x39')],{'where':{'MailAccountId':_0xc89fe6['id']}})[_0x83db('0xd')](function(){return _0xc89fe6;});})[_0x83db('0xd')](function(_0x4e58d0){if(!_0x55566b['body'][_0x83db('0x5f')])return _0x4e58d0;return db[_0x83db('0x3c')][_0x83db('0x1f')](_0x55566b[_0x83db('0x5c')][_0x83db('0x5f')],{'where':{'MailAccountId':_0x4e58d0['id']}})[_0x83db('0xd')](function(){return _0x4e58d0;});})[_0x83db('0xd')](respondWithResult(_0x212706,null))[_0x83db('0x57')](handleError(_0x212706,null));};exports[_0x83db('0x61')]=function(_0x5de8b9,_0x182fbc){return db[_0x83db('0x40')][_0x83db('0x61')]()[_0x83db('0xd')](respondWithResult(_0x182fbc,null))['catch'](handleError(_0x182fbc,null));};exports[_0x83db('0x62')]=function(_0x117037,_0x4011d0){if(_0x117037[_0x83db('0x5c')]['id']){delete _0x117037[_0x83db('0x5c')]['id'];}return db[_0x83db('0x40')][_0x83db('0x5b')]({'where':{'id':_0x117037[_0x83db('0x58')]['id']}})[_0x83db('0xd')](handleEntityNotFound(_0x4011d0,null))[_0x83db('0xd')](function(_0x423cfc){if(_0x423cfc){_0x117037['body'][_0x83db('0x63')]=_0x423cfc['id'];return db['Disposition'][_0x83db('0x64')](_0x117037['body']);}})[_0x83db('0xd')](respondWithResult(_0x4011d0,null))[_0x83db('0x57')](handleError(_0x4011d0,null));};exports[_0x83db('0x65')]=function(_0x123def,_0x577f71){var _0x29cce2={'raw':![],'where':{}};var _0x295d41={};var _0x2e8e4f={'count':0x0,'rows':[]};return db['MailAccount'][_0x83db('0x66')]({'where':{'id':_0x123def[_0x83db('0x58')]['id']}})[_0x83db('0xd')](handleEntityNotFound(_0x577f71,null))[_0x83db('0xd')](function(_0x266f5d){if(_0x266f5d){_0x295d41[_0x83db('0x45')]=_['keys'](db['Disposition'][_0x83db('0x41')]);_0x295d41[_0x83db('0x46')]=_[_0x83db('0x47')](_0x123def[_0x83db('0x46')]);_0x295d41[_0x83db('0x48')]=_[_0x83db('0x49')](_0x295d41[_0x83db('0x45')],_0x295d41[_0x83db('0x46')]);_0x29cce2['attributes']=_[_0x83db('0x49')](_0x295d41['model'],qs[_0x83db('0x59')](_0x123def[_0x83db('0x46')][_0x83db('0x59')]));_0x29cce2['attributes']=_0x29cce2[_0x83db('0x4a')][_0x83db('0x4b')]?_0x29cce2['attributes']:_0x295d41[_0x83db('0x45')];if(!_0x123def['query']['hasOwnProperty']('nolimit')){_0x29cce2['limit']=qs['limit'](_0x123def[_0x83db('0x46')][_0x83db('0x1c')]);_0x29cce2['offset']=qs['offset'](_0x123def[_0x83db('0x46')][_0x83db('0x1a')]);}_0x29cce2[_0x83db('0x4d')]=qs[_0x83db('0x4e')](_0x123def[_0x83db('0x46')][_0x83db('0x4e')]);_0x29cce2[_0x83db('0x4f')]=qs[_0x83db('0x48')](_['pick'](_0x123def[_0x83db('0x46')],_0x295d41[_0x83db('0x48')]));_0x29cce2[_0x83db('0x4f')][_0x83db('0x63')]=_0x266f5d['id'];if(_0x123def[_0x83db('0x46')][_0x83db('0x51')]){_0x29cce2['where']=_[_0x83db('0x52')](_0x29cce2['where'],{'$or':_['map'](_0x29cce2['attributes'],function(_0x14e7c6){var _0x50a61e={};_0x50a61e[_0x14e7c6]={'$like':'%'+_0x123def[_0x83db('0x46')]['filter']+'%'};return _0x50a61e;})});}_0x29cce2=_[_0x83db('0x52')]({},_0x29cce2,_0x123def[_0x83db('0x54')]);return db[_0x83db('0x67')]['count']({'where':_0x29cce2[_0x83db('0x4f')]})[_0x83db('0xd')](function(_0x5e36b4){_0x2e8e4f[_0x83db('0x1d')]=_0x5e36b4;if(_0x123def[_0x83db('0x46')][_0x83db('0x5a')]){_0x29cce2[_0x83db('0x55')]=[{'all':!![]}];}return db[_0x83db('0x67')]['findAll'](_0x29cce2);})[_0x83db('0xd')](function(_0x794596){_0x2e8e4f[_0x83db('0x56')]=_0x794596;return _0x2e8e4f;});}})['then'](respondWithFilteredResult(_0x577f71,_0x29cce2))[_0x83db('0x57')](handleError(_0x577f71,null));};exports[_0x83db('0x68')]=function(_0x3cc51e,_0x288a32){return db['MailAccount'][_0x83db('0x5b')]({'where':{'id':_0x3cc51e[_0x83db('0x58')]['id']}})[_0x83db('0xd')](handleEntityNotFound(_0x288a32,null))['then'](function(_0x1e7e5d){if(_0x1e7e5d){return _0x1e7e5d['removeDispositions'](_0x3cc51e['query'][_0x83db('0x69')]);}})[_0x83db('0xd')](respondWithStatusCode(_0x288a32,null))[_0x83db('0x57')](handleError(_0x288a32,null));};exports[_0x83db('0x6a')]=function(_0x310936,_0x343103){if(_0x310936[_0x83db('0x5c')]['id']){delete _0x310936['body']['id'];}return db[_0x83db('0x40')][_0x83db('0x5b')]({'where':{'id':_0x310936[_0x83db('0x58')]['id']}})[_0x83db('0xd')](handleEntityNotFound(_0x343103,null))[_0x83db('0xd')](function(_0x35312c){if(_0x35312c){_0x310936[_0x83db('0x5c')][_0x83db('0x63')]=_0x35312c['id'];return db['CannedAnswer']['create'](_0x310936[_0x83db('0x5c')]);}})[_0x83db('0xd')](respondWithResult(_0x343103,null))[_0x83db('0x57')](handleError(_0x343103,null));};exports['getAnswers']=function(_0x18e8da,_0x170481){var _0x3ff83f={'raw':![],'where':{}};var _0x31c158={};var _0x5522bc={'count':0x0,'rows':[]};return db[_0x83db('0x40')][_0x83db('0x66')]({'where':{'id':_0x18e8da[_0x83db('0x58')]['id']}})[_0x83db('0xd')](handleEntityNotFound(_0x170481,null))[_0x83db('0xd')](function(_0x369dcb){if(_0x369dcb){_0x31c158['model']=_['keys'](db['CannedAnswer'][_0x83db('0x41')]);_0x31c158[_0x83db('0x46')]=_[_0x83db('0x47')](_0x18e8da[_0x83db('0x46')]);_0x31c158[_0x83db('0x48')]=_[_0x83db('0x49')](_0x31c158[_0x83db('0x45')],_0x31c158[_0x83db('0x46')]);_0x3ff83f[_0x83db('0x4a')]=_[_0x83db('0x49')](_0x31c158['model'],qs[_0x83db('0x59')](_0x18e8da['query'][_0x83db('0x59')]));_0x3ff83f[_0x83db('0x4a')]=_0x3ff83f[_0x83db('0x4a')][_0x83db('0x4b')]?_0x3ff83f[_0x83db('0x4a')]:_0x31c158[_0x83db('0x45')];if(!_0x18e8da[_0x83db('0x46')][_0x83db('0x6b')](_0x83db('0x4c'))){_0x3ff83f[_0x83db('0x1c')]=qs[_0x83db('0x1c')](_0x18e8da[_0x83db('0x46')][_0x83db('0x1c')]);_0x3ff83f[_0x83db('0x1a')]=qs['offset'](_0x18e8da[_0x83db('0x46')][_0x83db('0x1a')]);}_0x3ff83f[_0x83db('0x4d')]=qs[_0x83db('0x4e')](_0x18e8da[_0x83db('0x46')]['sort']);_0x3ff83f[_0x83db('0x4f')]=qs[_0x83db('0x48')](_['pick'](_0x18e8da[_0x83db('0x46')],_0x31c158[_0x83db('0x48')]));_0x3ff83f[_0x83db('0x4f')]['MailAccountId']=_0x369dcb['id'];if(_0x18e8da[_0x83db('0x46')]['filter']){_0x3ff83f['where']=_[_0x83db('0x52')](_0x3ff83f[_0x83db('0x4f')],{'$or':_[_0x83db('0x3f')](_0x3ff83f['attributes'],function(_0x381eb1){var _0x2098cf={};_0x2098cf[_0x381eb1]={'$like':'%'+_0x18e8da[_0x83db('0x46')]['filter']+'%'};return _0x2098cf;})});}_0x3ff83f=_[_0x83db('0x52')]({},_0x3ff83f,_0x18e8da[_0x83db('0x54')]);return db[_0x83db('0x6c')][_0x83db('0x1d')]({'where':_0x3ff83f[_0x83db('0x4f')]})['then'](function(_0x668ce0){_0x5522bc[_0x83db('0x1d')]=_0x668ce0;if(_0x18e8da[_0x83db('0x46')][_0x83db('0x5a')]){_0x3ff83f[_0x83db('0x55')]=[{'all':!![]}];}return db[_0x83db('0x6c')][_0x83db('0x6d')](_0x3ff83f);})[_0x83db('0xd')](function(_0x4dcbe5){_0x5522bc['rows']=_0x4dcbe5;return _0x5522bc;});}})[_0x83db('0xd')](respondWithFilteredResult(_0x170481,_0x3ff83f))['catch'](handleError(_0x170481,null));};exports[_0x83db('0x6e')]=function(_0x5714c3,_0x563cfc){return db['MailAccount'][_0x83db('0x5b')]({'where':{'id':_0x5714c3[_0x83db('0x58')]['id']}})['then'](handleEntityNotFound(_0x563cfc,null))[_0x83db('0xd')](function(_0x8a0fca){if(_0x8a0fca){return _0x8a0fca['removeAnswers'](_0x5714c3[_0x83db('0x46')]['ids']);}})[_0x83db('0xd')](respondWithStatusCode(_0x563cfc,null))['catch'](handleError(_0x563cfc,null));};exports[_0x83db('0x64')]=function(_0x589243,_0x252256){var _0x3c15e3={'name':_0x589243[_0x83db('0x5c')]['name'],'key':_0x589243[_0x83db('0x5c')]['key'],'provider':_0x589243[_0x83db('0x5c')]['provider']==='custom'?null:_0x589243[_0x83db('0x5c')][_0x83db('0x5d')],'email':_0x589243[_0x83db('0x5c')][_0x83db('0x6f')],'ListId':_0x589243['body'][_0x83db('0x70')],'active':!_['isNil'](_0x589243[_0x83db('0x5c')][_0x83db('0x71')])?_0x589243[_0x83db('0x5c')][_0x83db('0x71')]:!![],'description':_0x589243[_0x83db('0x5c')][_0x83db('0x72')]||null};var _0x39dd6a=getAuthenticationOptions(_0x3c15e3['provider'],_0x589243['body']);_0x3c15e3[_0x83db('0x39')]=_0x39dd6a['Imap'];_0x3c15e3[_0x83db('0x5f')]=_0x39dd6a[_0x83db('0x5f')];return db['MailAccount'][_0x83db('0x64')](_0x3c15e3,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0x83db('0x39')}]})[_0x83db('0xd')](function(_0x31aa96){var _0x5bdb50=_0x589243['user'][_0x83db('0x21')]({'plain':!![]});if(!_0x5bdb50)throw new Error(_0x83db('0x73'));if(_0x5bdb50[_0x83db('0x74')]===_0x83db('0x2e')){var _0x5b867c=_0x31aa96[_0x83db('0x21')]({'plain':!![]});return db[_0x83db('0x75')][_0x83db('0x5b')]({'where':{'name':_0x83db('0x76'),'userProfileId':_0x5bdb50[_0x83db('0x77')]},'raw':!![]})[_0x83db('0xd')](function(_0x330656){if(_0x330656&&_0x330656[_0x83db('0x78')]===0x0){return db[_0x83db('0x79')][_0x83db('0x64')]({'name':_0x5b867c[_0x83db('0x23')],'resourceId':_0x5b867c['id'],'type':_0x330656['name'],'sectionId':_0x330656['id']},{})[_0x83db('0xd')](function(){return _0x31aa96;});}else{return _0x31aa96;}})[_0x83db('0x57')](function(_0x5e19dc){logger[_0x83db('0x13')](_0x83db('0x7a'),_0x5e19dc);throw _0x5e19dc;});}return _0x31aa96;})[_0x83db('0xd')](respondWithResult(_0x252256,0xc9))[_0x83db('0x57')](handleError(_0x252256,null));};exports[_0x83db('0x7b')]=function(_0x4e6b1f,_0x5f7dfe){return db['MailAccount'][_0x83db('0x66')]({'where':{'id':_0x4e6b1f[_0x83db('0x58')]['id']}})[_0x83db('0xd')](handleEntityNotFound(_0x5f7dfe,null))[_0x83db('0xd')](function(_0xc43ec0){if(_0xc43ec0){return _0xc43ec0[_0x83db('0x7b')]();}return null;})[_0x83db('0xd')](respondWithResult(_0x5f7dfe,null))[_0x83db('0x57')](handleError(_0x5f7dfe,null));};exports[_0x83db('0x7c')]=function(_0x47060d,_0x4976f6){if(_0x47060d[_0x83db('0x5c')]['id']){delete _0x47060d[_0x83db('0x5c')]['id'];}return db[_0x83db('0x40')][_0x83db('0x5b')]({'where':{'id':_0x47060d['params']['id']}})['then'](handleEntityNotFound(_0x4976f6,null))['then'](function(_0x2abeb1){if(_0x2abeb1){_0x47060d[_0x83db('0x5c')][_0x83db('0x63')]=_0x2abeb1['id'];return db[_0x83db('0x3b')]['create'](_0x47060d[_0x83db('0x5c')]);}})[_0x83db('0xd')](respondWithResult(_0x4976f6,null))[_0x83db('0x57')](handleError(_0x4976f6,null));};exports[_0x83db('0x7d')]=function(_0xbc2bf3,_0x4e722f){return db[_0x83db('0x40')][_0x83db('0x66')]({'where':{'id':_0xbc2bf3[_0x83db('0x58')]['id']}})['then'](handleEntityNotFound(_0x4e722f,null))[_0x83db('0xd')](function(_0x246205){if(_0x246205){return _0x246205['setImap'](null);}return null;})[_0x83db('0xd')](respondWithStatusCode(_0x4e722f,null))[_0x83db('0x57')](handleError(_0x4e722f,null));};exports['getSmtp']=function(_0xca14ee,_0x47d8d3){return db['MailAccount'][_0x83db('0x66')]({'where':{'id':_0xca14ee['params']['id']}})[_0x83db('0xd')](handleEntityNotFound(_0x47d8d3,null))[_0x83db('0xd')](function(_0x4be5e0){if(_0x4be5e0){return _0x4be5e0[_0x83db('0x7e')]();}return null;})[_0x83db('0xd')](respondWithResult(_0x47d8d3,null))[_0x83db('0x57')](handleError(_0x47d8d3,null));};exports[_0x83db('0x7f')]=function(_0x1621f9,_0x36fe8a){if(_0x1621f9[_0x83db('0x5c')]['id']){delete _0x1621f9[_0x83db('0x5c')]['id'];}return db[_0x83db('0x40')][_0x83db('0x5b')]({'where':{'id':_0x1621f9['params']['id']}})[_0x83db('0xd')](handleEntityNotFound(_0x36fe8a,null))[_0x83db('0xd')](function(_0xdca1dd){if(_0xdca1dd){_0x1621f9[_0x83db('0x5c')]['MailAccountId']=_0xdca1dd['id'];return db[_0x83db('0x3c')][_0x83db('0x64')](_0x1621f9[_0x83db('0x5c')]);}})[_0x83db('0xd')](respondWithResult(_0x36fe8a,null))[_0x83db('0x57')](handleError(_0x36fe8a,null));};exports[_0x83db('0x80')]=function(_0x137058,_0x336518){return db[_0x83db('0x40')]['findOne']({'where':{'id':_0x137058[_0x83db('0x58')]['id']}})[_0x83db('0xd')](handleEntityNotFound(_0x336518,null))['then'](function(_0x788968){if(_0x788968){return _0x788968['setSmtp'](null);}return null;})[_0x83db('0xd')](respondWithStatusCode(_0x336518,null))[_0x83db('0x57')](handleError(_0x336518,null));};exports[_0x83db('0x81')]=function(_0x1b3d3e,_0x40ad64){return db[_0x83db('0x82')][_0x83db('0x5b')]({'where':{'id':_0x1b3d3e['params']['id']}})['then'](handleEntityNotFound(_0x40ad64,null))[_0x83db('0xd')](function(_0x20284f){if(_0x20284f){return _0x20284f[_0x83db('0x81')](_0x1b3d3e['body'][_0x83db('0x69')],_['omit'](_0x1b3d3e[_0x83db('0x5c')],[_0x83db('0x69'),'id'])||{});}})['then'](respondWithResult(_0x40ad64,null))[_0x83db('0x57')](handleError(_0x40ad64,null));};exports[_0x83db('0x83')]=function(_0x36618a,_0x5d65a6){var _0x46e71a={'raw':![],'where':{}};var _0x759bdc={};var _0x39e867={'count':0x0,'rows':[]};return db[_0x83db('0x40')][_0x83db('0x66')]({'where':{'id':_0x36618a[_0x83db('0x58')]['id']}})[_0x83db('0xd')](handleEntityNotFound(_0x5d65a6,null))[_0x83db('0xd')](function(_0x18101e){if(_0x18101e){_0x759bdc[_0x83db('0x45')]=_['keys'](db[_0x83db('0x82')]['rawAttributes']);_0x759bdc[_0x83db('0x46')]=_[_0x83db('0x47')](_0x36618a[_0x83db('0x46')]);_0x759bdc[_0x83db('0x48')]=_[_0x83db('0x49')](_0x759bdc[_0x83db('0x45')],_0x759bdc[_0x83db('0x46')]);_0x46e71a[_0x83db('0x4a')]=_[_0x83db('0x49')](_0x759bdc[_0x83db('0x45')],qs['fields'](_0x36618a[_0x83db('0x46')]['fields']));_0x46e71a['attributes']=_0x46e71a[_0x83db('0x4a')][_0x83db('0x4b')]?_0x46e71a[_0x83db('0x4a')]:_0x759bdc['model'];if(!_0x36618a['query'][_0x83db('0x6b')](_0x83db('0x4c'))){_0x46e71a['limit']=qs[_0x83db('0x1c')](_0x36618a[_0x83db('0x46')][_0x83db('0x1c')]);_0x46e71a['offset']=qs[_0x83db('0x1a')](_0x36618a[_0x83db('0x46')]['offset']);}_0x46e71a['order']=qs[_0x83db('0x4e')](_0x36618a[_0x83db('0x46')][_0x83db('0x4e')]);_0x46e71a[_0x83db('0x4f')]=qs[_0x83db('0x48')](_[_0x83db('0x50')](_0x36618a['query'],_0x759bdc['filters']));_0x46e71a[_0x83db('0x4f')][_0x83db('0x63')]=_0x18101e['id'];if(_0x36618a['query'][_0x83db('0x51')]){_0x46e71a['where']=_['merge'](_0x46e71a[_0x83db('0x4f')],{'$or':_[_0x83db('0x3f')](_0x46e71a['attributes'],function(_0x5b98e9){var _0x543f9d={};_0x543f9d[_0x5b98e9]={'$like':'%'+_0x36618a['query'][_0x83db('0x51')]+'%'};return _0x543f9d;})});}_0x46e71a=_[_0x83db('0x52')]({},_0x46e71a,_0x36618a['options']);return db[_0x83db('0x82')][_0x83db('0x1d')]({'where':_0x46e71a[_0x83db('0x4f')]})[_0x83db('0xd')](function(_0xd58a81){_0x39e867[_0x83db('0x1d')]=_0xd58a81;if(_0x36618a[_0x83db('0x46')][_0x83db('0x5a')]){_0x46e71a[_0x83db('0x55')]=[{'model':db['CmContact'],'as':_0x83db('0x84'),'required':![]},{'model':db['User'],'as':_0x83db('0x85'),'attributes':[_0x83db('0x23'),_0x83db('0x86'),'internal'],'required':![]},{'model':db[_0x83db('0x87')],'as':_0x83db('0x88'),'attributes':['id',_0x83db('0x23'),_0x83db('0x89')],'where':_0x36618a[_0x83db('0x46')][_0x83db('0x8a')]?{'id':_0x36618a[_0x83db('0x46')]['tag']}:undefined,'required':_0x36618a[_0x83db('0x46')][_0x83db('0x8a')]?!![]:![]}];}return db[_0x83db('0x82')][_0x83db('0x6d')](_0x46e71a);})[_0x83db('0xd')](function(_0x517336){_0x39e867[_0x83db('0x56')]=_0x517336;return _0x39e867;});}})[_0x83db('0xd')](respondWithFilteredResult(_0x5d65a6,_0x46e71a))[_0x83db('0x57')](handleError(_0x5d65a6,null));};exports[_0x83db('0x8b')]=function addApplications(_0x3acc23,_0x44a428){var _0x19c9c4=_0x3acc23[_0x83db('0x58')]['id'];var _0x1793ea=_0x3acc23[_0x83db('0x5c')];var _0x538bb9=0xc8;var _0x19ae4e=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0x83db('0x8c')][_0x83db('0x8d')][_0x83db('0x8e')]},function(_0xf470c0){return db[_0x83db('0x40')][_0x83db('0x66')]({'where':{'id':_0x19c9c4},'transaction':_0xf470c0})[_0x83db('0xd')](function(_0x977428){if(_0x977428){return db[_0x83db('0x8f')][_0x83db('0x20')]({'where':{'MailAccountId':_0x19c9c4},'transaction':_0xf470c0})[_0x83db('0xd')](function(){var _0x28d54b=_[_0x83db('0x3f')](_0x1793ea,function(_0x1422c1){_0x1422c1[_0x83db('0x63')]=_0x19c9c4;return _0x1422c1;});return db[_0x83db('0x8f')]['bulkCreate'](_0x28d54b,{'transaction':_0xf470c0});});}else{_0x538bb9=0x194;_0x19ae4e=[];}});})['then'](function(){if(_0x538bb9!==0x194){return db['MailApplication'][_0x83db('0x90')]({'where':{'MailAccountId':_0x19c9c4},'order':'priority'})[_0x83db('0xd')](function(_0x57c232){_0x19ae4e=_0x57c232;});}})[_0x83db('0x57')](function(_0x35177b){_0x538bb9=0x1f4;logger[_0x83db('0x13')](_0x35177b['stack']);if(_0x35177b['name']){delete _0x35177b['name'];}_0x19ae4e=_0x35177b;})[_0x83db('0x91')](function(){if(_0x19ae4e===null){_0x44a428[_0x83db('0x16')](_0x538bb9);}else{if(_0x538bb9===0x1f4){_0x44a428[_0x83db('0x17')](_0x538bb9)['send'](_0x19ae4e);}else{_0x44a428[_0x83db('0x17')](_0x538bb9)[_0x83db('0x19')](_0x19ae4e);}}});};exports[_0x83db('0x92')]=function(_0x256cb7,_0x31e680){var _0x52dd89={};var _0x2d49a2={};var _0x3ecb7f;var _0x191d72;return db['MailAccount'][_0x83db('0x66')]({'where':{'id':_0x256cb7[_0x83db('0x58')]['id']}})[_0x83db('0xd')](handleEntityNotFound(_0x31e680,null))['then'](function(_0x48a0d6){if(_0x48a0d6){_0x3ecb7f=_0x48a0d6;_0x2d49a2[_0x83db('0x45')]=_[_0x83db('0x47')](db[_0x83db('0x8f')][_0x83db('0x41')]);_0x2d49a2['query']=_[_0x83db('0x47')](_0x256cb7[_0x83db('0x46')]);_0x2d49a2['filters']=_[_0x83db('0x49')](_0x2d49a2[_0x83db('0x45')],_0x2d49a2[_0x83db('0x46')]);_0x52dd89['attributes']=_[_0x83db('0x49')](_0x2d49a2['model'],qs[_0x83db('0x59')](_0x256cb7[_0x83db('0x46')][_0x83db('0x59')]));_0x52dd89[_0x83db('0x4a')]=_0x52dd89[_0x83db('0x4a')][_0x83db('0x4b')]?_0x52dd89[_0x83db('0x4a')]:_0x2d49a2[_0x83db('0x45')];_0x52dd89['order']=qs['sort'](_0x256cb7['query'][_0x83db('0x4e')]);_0x52dd89['where']=qs[_0x83db('0x48')](_['pick'](_0x256cb7[_0x83db('0x46')],_0x2d49a2[_0x83db('0x48')]));if(_0x256cb7[_0x83db('0x46')][_0x83db('0x51')]){_0x52dd89[_0x83db('0x4f')]=_[_0x83db('0x52')](_0x52dd89[_0x83db('0x4f')],{'$or':_[_0x83db('0x3f')](_0x52dd89['attributes'],function(_0x47195f){var _0x2ad830={};_0x2ad830[_0x47195f]={'$like':'%'+_0x256cb7[_0x83db('0x46')]['filter']+'%'};return _0x2ad830;})});}_0x52dd89=_['merge']({},_0x52dd89,_0x256cb7['options']);return _0x3ecb7f[_0x83db('0x92')](_0x52dd89);}})['then'](function(_0x3c5e9b){if(_0x3c5e9b){_0x191d72=_0x3c5e9b['length'];if(!_0x256cb7[_0x83db('0x46')][_0x83db('0x6b')](_0x83db('0x4c'))){_0x52dd89['limit']=qs[_0x83db('0x1c')](_0x256cb7['query'][_0x83db('0x1c')]);_0x52dd89[_0x83db('0x1a')]=qs[_0x83db('0x1a')](_0x256cb7[_0x83db('0x46')][_0x83db('0x1a')]);}return _0x3ecb7f[_0x83db('0x92')](_0x52dd89);}})['then'](function(_0x570f3d){if(_0x570f3d){return _0x570f3d?{'count':_0x191d72,'rows':_0x570f3d}:null;}})[_0x83db('0xd')](respondWithResult(_0x31e680,null))[_0x83db('0x57')](handleError(_0x31e680,null));};exports[_0x83db('0x93')]=function(_0x16dacf,_0x5ad8f1){var _0x2ff8ec={'raw':!![],'where':{}};var _0x3b6851={};var _0xc573eb={'count':0x0,'rows':[]};return db[_0x83db('0x40')][_0x83db('0x66')]({'where':{'id':_0x16dacf['params']['id']}})[_0x83db('0xd')](handleEntityNotFound(_0x5ad8f1,null))[_0x83db('0xd')](function(_0x2f65f9){if(_0x2f65f9){_0x3b6851[_0x83db('0x45')]=_[_0x83db('0x47')](db['MailMessage'][_0x83db('0x41')]);_0x3b6851[_0x83db('0x46')]=_[_0x83db('0x47')](_0x16dacf['query']);_0x3b6851[_0x83db('0x48')]=_['intersection'](_0x3b6851['model'],_0x3b6851[_0x83db('0x46')]);_0x2ff8ec['attributes']=_['intersection'](_0x3b6851['model'],qs['fields'](_0x16dacf['query'][_0x83db('0x59')]));_0x2ff8ec[_0x83db('0x4a')]=_0x2ff8ec[_0x83db('0x4a')][_0x83db('0x4b')]?_0x2ff8ec[_0x83db('0x4a')]:_0x3b6851[_0x83db('0x45')];if(!_0x16dacf[_0x83db('0x46')][_0x83db('0x6b')](_0x83db('0x4c'))){_0x2ff8ec[_0x83db('0x1c')]=qs[_0x83db('0x1c')](_0x16dacf['query']['limit']);_0x2ff8ec['offset']=qs[_0x83db('0x1a')](_0x16dacf[_0x83db('0x46')][_0x83db('0x1a')]);}_0x2ff8ec[_0x83db('0x4d')]=qs[_0x83db('0x4e')](_0x16dacf['query'][_0x83db('0x4e')]);_0x2ff8ec[_0x83db('0x4f')]=qs[_0x83db('0x48')](_['pick'](_0x16dacf['query'],_0x3b6851[_0x83db('0x48')]));_0x2ff8ec[_0x83db('0x4f')][_0x83db('0x63')]=_0x2f65f9['id'];if(_0x16dacf[_0x83db('0x46')]['filter']){_0x2ff8ec[_0x83db('0x4f')]=_[_0x83db('0x52')](_0x2ff8ec['where'],{'$or':_[_0x83db('0x3f')](_0x2ff8ec[_0x83db('0x4a')],function(_0x4af4a3){var _0x37f451={};_0x37f451[_0x4af4a3]={'$like':'%'+_0x16dacf['query'][_0x83db('0x51')]+'%'};return _0x37f451;})});}if(_0x16dacf[_0x83db('0x46')][_0x83db('0x94')]){var _0x37b83f=_0x16dacf[_0x83db('0x46')][_0x83db('0x94')][_0x83db('0x95')](',');var _0x45525d={};_0x45525d[_0x37b83f[0x0]]={'$gte':moment(_0x37b83f[0x1])[_0x83db('0x96')](_0x83db('0x97'))};_0x2ff8ec[_0x83db('0x4f')]=_['merge'](_0x2ff8ec['where'],_0x45525d);}_0x2ff8ec=_[_0x83db('0x52')]({},_0x2ff8ec,_0x16dacf['options']);return db[_0x83db('0x98')][_0x83db('0x1d')]({'where':_0x2ff8ec['where']})[_0x83db('0xd')](function(_0x48c420){_0xc573eb[_0x83db('0x1d')]=_0x48c420;if(_0x16dacf[_0x83db('0x46')][_0x83db('0x5a')]){_0x2ff8ec['include']=[{'all':!![]}];}return db[_0x83db('0x98')]['findAll'](_0x2ff8ec);})[_0x83db('0xd')](function(_0x1122e1){if(_0x16dacf['query']['inlineCss']===_0x83db('0x99')){for(var _0x43a6b0=0x0;_0x43a6b0<_0x1122e1[_0x83db('0x4b')];_0x43a6b0++){_0x1122e1[_0x43a6b0][_0x83db('0x5c')]=juice(_0x1122e1[_0x43a6b0][_0x83db('0x5c')]);}}_0xc573eb[_0x83db('0x56')]=_0x1122e1;return _0xc573eb;});}})[_0x83db('0xd')](respondWithFilteredResult(_0x5ad8f1,_0x2ff8ec))['catch'](handleError(_0x5ad8f1,null));};exports[_0x83db('0x24')]=function(_0x3e9cdc,_0x2dc05e){var _0x2306cc,_0x56c9f0={},_0x368060;if(_0x3e9cdc['body']['to']){_0x368060=_0x3e9cdc[_0x83db('0x5c')]['to']['split'](',')[0x0];}return db[_0x83db('0x40')]['find']({'where':{'id':_0x3e9cdc['params']['id']},'include':[{'model':db[_0x83db('0x9a')],'as':_0x83db('0x9b'),'include':[{'model':db['CmContact'],'as':_0x83db('0x9c'),'where':{'email':_0x368060},'limit':0x1,'order':[[_0x83db('0x9d'),_0x83db('0x9e')]]}]},{'model':db[_0x83db('0x3c')],'as':_0x83db('0x5f'),'raw':!![],'include':[{'model':db[_0x83db('0x9f')],'as':_0x83db('0x9f'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x2dc05e,null))['then'](function(_0x196337){if(!_0x196337)return;_0x2306cc=_0x196337;if(!_0x196337[_0x83db('0x5f')])throw new Error(_0x83db('0xa0'));if(_['isNil'](_0x3e9cdc[_0x83db('0x5c')][_0x83db('0xa1')])){_0x3e9cdc[_0x83db('0x5c')]['from']=util[_0x83db('0x96')](_0x83db('0xa2'),_0x196337[_0x83db('0x23')],_0x196337[_0x83db('0x6f')]||_0x196337[_0x83db('0x5f')][_0x83db('0x2e')]);}if(_0x3e9cdc['body'][_0x83db('0xa3')]&&_0x3e9cdc[_0x83db('0x5c')][_0x83db('0xa3')][_0x83db('0x4b')]){for(var _0x533910=0x0;_0x533910<_0x3e9cdc[_0x83db('0x5c')][_0x83db('0xa3')][_0x83db('0x4b')];_0x533910+=0x1){_0x3e9cdc['body'][_0x83db('0xa3')][_0x533910]={'filename':_0x3e9cdc['body']['attachments'][_0x533910][_0x83db('0x23')],'path':path[_0x83db('0xa4')](config['root'],_0x83db('0xa5'),_0x3e9cdc['body'][_0x83db('0xa3')][_0x533910][_0x83db('0xa6')])};}}var _0xa2d47=_0x196337[_0x83db('0xa7')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0xa2d47,'message':_0x3e9cdc[_0x83db('0x5c')]});})[_0x83db('0xd')](function(_0xac92e3){if(!_0xac92e3)return;_0x56c9f0=_0xac92e3;if(!_0x2306cc[_0x83db('0x9b')])throw new Error(_0x83db('0xa8'));if(_0x2306cc['List'][_0x83db('0x9c')][_0x83db('0x4b')])return _0x2306cc[_0x83db('0x9b')][_0x83db('0x9c')][0x0];return db['CmContact'][_0x83db('0x64')](_['defaults'](_0x3e9cdc[_0x83db('0x5c')],{'firstName':_0x3e9cdc[_0x83db('0x5c')]['to'],'email':_0x3e9cdc['body']['to'],'phone':_0x3e9cdc['body']['to'],'ListId':_0x2306cc['ListId']}));})['then'](function(_0x31b6ed){if(!_0x31b6ed)return;var _0x2c1e74={'UserId':_0x3e9cdc[_0x83db('0x2e')]['id'],'ContactId':_0x31b6ed['id'],'MailAccountId':_0x2306cc['id'],'inReplyTo':_0x56c9f0[_0x83db('0xa9')],'to':_0x3e9cdc[_0x83db('0x5c')]['from'],'cc':_0x3e9cdc['body']['cc'],'subject':_0x3e9cdc['body'][_0x83db('0xaa')],'attach':_0x3e9cdc[_0x83db('0x5c')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()[_0x83db('0x96')](_0x83db('0x97')),'lastMsgDirection':_0x83db('0xab'),'Messages':[_[_0x83db('0x52')](_0x3e9cdc[_0x83db('0x5c')],{'messageId':_0x56c9f0[_0x83db('0xa9')],'sentAt':moment()[_0x83db('0x96')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x2306cc['id'],'UserId':_0x3e9cdc[_0x83db('0x2e')]['id'],'ContactId':_0x31b6ed['id']})]};if(_0x3e9cdc[_0x83db('0x5c')]['Interaction']){_0x2c1e74=_[_0x83db('0x52')](_0x2c1e74,_0x3e9cdc[_0x83db('0x5c')][_0x83db('0xac')]);}return db[_0x83db('0x82')][_0x83db('0x64')](_0x2c1e74,{'include':[{'model':db[_0x83db('0x98')],'as':_0x83db('0xad')}]});})['then'](respondWithResult(_0x2dc05e,null))[_0x83db('0x57')](handleError(_0x2dc05e,null));};exports[_0x83db('0xae')]=function(_0x5568ec,_0x575b3b){return db[_0x83db('0x40')][_0x83db('0x5b')]({'where':{'id':_0x5568ec[_0x83db('0x58')]['id']},'include':[{'model':db[_0x83db('0x3c')],'as':_0x83db('0x5f'),'raw':!![],'include':[{'model':db[_0x83db('0x9f')],'as':_0x83db('0x9f'),'raw':!![]}]}]})[_0x83db('0xd')](handleEntityNotFound(_0x575b3b,null))[_0x83db('0xd')](function(_0xb83333){if(!_0xb83333[_0x83db('0x5f')])return;var _0x2dc0e9=_0xb83333['getSmtpOptions']();return respondWithRpcPromise(_0x83db('0xaf'),_0x83db('0xae'),{'account':_0x2dc0e9});})[_0x83db('0xd')](respondWithResult(_0x575b3b,null))[_0x83db('0x57')](handleError(_0x575b3b,null));};exports['destroy']=function(_0x205567,_0x2b24d4){return db[_0x83db('0x40')]['find']({'where':{'id':_0x205567[_0x83db('0x58')]['id']}})[_0x83db('0xd')](handleEntityNotFound(_0x2b24d4,null))[_0x83db('0xd')](function(_0x4333d9){if(_0x4333d9&&_0x4333d9[_0x83db('0x37')]){throw new db[(_0x83db('0xb0'))][(_0x83db('0xb1'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x4333d9;})[_0x83db('0xd')](removeEntity(_0x2b24d4,null))['catch'](handleError(_0x2b24d4,null));};exports[_0x83db('0xb2')]=function(_0x450834,_0x8efeb7){return db[_0x83db('0x40')][_0x83db('0x5b')]({'where':{'id':_0x450834[_0x83db('0x58')]['id']}})[_0x83db('0xd')](handleEntityNotFound(_0x8efeb7,null))[_0x83db('0xd')](function(_0x532530){if(_0x532530){return _0x532530['addAgents'](_0x450834[_0x83db('0x5c')]['ids'],_['omit'](_0x450834['body'],[_0x83db('0x69'),'id'])||{})[_0x83db('0xb3')](function(_0x1249b4){for(var _0x1be3d8=0x0;_0x1be3d8<_0x450834[_0x83db('0x5c')]['ids'][_0x83db('0x4b')];_0x1be3d8+=0x1){socket[_0x83db('0xb4')](_0x83db('0xb5'),{'UserId':Number(_0x450834[_0x83db('0x5c')]['ids'][_0x1be3d8]),'MailAccountId':Number(_0x450834[_0x83db('0x58')]['id'])});}return _0x1249b4;});}})['then'](respondWithResult(_0x8efeb7,null))['catch'](handleError(_0x8efeb7,null));};exports[_0x83db('0xb6')]=function(_0x368f14,_0xbce5f7){return db[_0x83db('0x40')][_0x83db('0x5b')]({'where':{'id':_0x368f14[_0x83db('0x58')]['id']}})[_0x83db('0xd')](handleEntityNotFound(_0xbce5f7,null))[_0x83db('0xd')](function(_0x2d8785){if(_0x2d8785){return _0x2d8785[_0x83db('0xb6')](_0x368f14[_0x83db('0x46')]['ids'])['then'](function(){if(_[_0x83db('0xb7')](_0x368f14[_0x83db('0x46')][_0x83db('0x69')])){for(var _0xda3fe9=0x0;_0xda3fe9<_0x368f14[_0x83db('0x46')][_0x83db('0x69')][_0x83db('0x4b')];_0xda3fe9+=0x1){socket[_0x83db('0xb4')](_0x83db('0xb8'),{'UserId':Number(_0x368f14[_0x83db('0x46')]['ids'][_0xda3fe9]),'MailAccountId':Number(_0x368f14[_0x83db('0x58')]['id'])});}}else{socket['emit'](_0x83db('0xb8'),{'UserId':Number(_0x368f14['query'][_0x83db('0x69')]),'MailAccountId':Number(_0x368f14[_0x83db('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0xbce5f7,null))[_0x83db('0x57')](handleError(_0xbce5f7,null));};exports[_0x83db('0xb9')]=function(_0x37e5ff,_0x203cd4){var _0x1520f2={};var _0xaea185={};var _0x12d0a1;var _0x3999a5;return db[_0x83db('0x40')][_0x83db('0x66')]({'where':{'id':_0x37e5ff[_0x83db('0x58')]['id']}})[_0x83db('0xd')](handleEntityNotFound(_0x203cd4,null))[_0x83db('0xd')](function(_0x7e0e2f){if(_0x7e0e2f){_0x12d0a1=_0x7e0e2f;_0xaea185[_0x83db('0x45')]=_['keys'](db[_0x83db('0xba')][_0x83db('0x41')]);_0xaea185[_0x83db('0x46')]=_[_0x83db('0x47')](_0x37e5ff[_0x83db('0x46')]);_0xaea185[_0x83db('0x48')]=_[_0x83db('0x49')](_0xaea185[_0x83db('0x45')],_0xaea185[_0x83db('0x46')]);_0x1520f2[_0x83db('0x4a')]=_[_0x83db('0x49')](_0xaea185[_0x83db('0x45')],qs[_0x83db('0x59')](_0x37e5ff[_0x83db('0x46')][_0x83db('0x59')]));_0x1520f2['attributes']=_0x1520f2[_0x83db('0x4a')]['length']?_0x1520f2['attributes']:_0xaea185[_0x83db('0x45')];_0x1520f2['order']=qs[_0x83db('0x4e')](_0x37e5ff[_0x83db('0x46')][_0x83db('0x4e')]);_0x1520f2['where']=qs[_0x83db('0x48')](_['pick'](_0x37e5ff[_0x83db('0x46')],_0xaea185[_0x83db('0x48')]));if(_0x37e5ff[_0x83db('0x46')][_0x83db('0x51')]){_0x1520f2['where']=_[_0x83db('0x52')](_0x1520f2[_0x83db('0x4f')],{'$or':_[_0x83db('0x3f')](_0x1520f2['attributes'],function(_0x52bef2){var _0xfd85e4={};_0xfd85e4[_0x52bef2]={'$like':'%'+_0x37e5ff[_0x83db('0x46')][_0x83db('0x51')]+'%'};return _0xfd85e4;})});}_0x1520f2=_[_0x83db('0x52')]({},_0x1520f2,_0x37e5ff[_0x83db('0x54')]);return _0x12d0a1[_0x83db('0xb9')](_0x1520f2);}})[_0x83db('0xd')](function(_0x175270){if(_0x175270){_0x3999a5=_0x175270['length'];if(!_0x37e5ff['query'][_0x83db('0x6b')](_0x83db('0x4c'))){_0x1520f2[_0x83db('0x1c')]=qs['limit'](_0x37e5ff[_0x83db('0x46')][_0x83db('0x1c')]);_0x1520f2[_0x83db('0x1a')]=qs[_0x83db('0x1a')](_0x37e5ff['query'][_0x83db('0x1a')]);}return _0x12d0a1[_0x83db('0xb9')](_0x1520f2);}})['then'](function(_0x13aa1f){if(_0x13aa1f){return _0x13aa1f?{'count':_0x3999a5,'rows':_0x13aa1f}:null;}})[_0x83db('0xd')](respondWithResult(_0x203cd4,null))[_0x83db('0x57')](handleError(_0x203cd4,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 0502d04..4bb66e8 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 _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 +var _0x8cc1=['save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8cc1,0x14e));var _0x18cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8cc1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x18cc('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x18cc('0x1')](0x0);var events={'afterCreate':_0x18cc('0x2'),'afterUpdate':_0x18cc('0x3'),'afterDestroy':_0x18cc('0x4')};function emitEvent(_0x47a61b){return function(_0x42cc6b,_0x48b5b0,_0x1e39ca){MailAccountEvents[_0x18cc('0x5')](_0x47a61b+':'+_0x42cc6b['id'],_0x42cc6b);MailAccountEvents[_0x18cc('0x5')](_0x47a61b,_0x42cc6b);_0x1e39ca(null);};}for(var e in events){if(events[_0x18cc('0x6')](e)){var event=events[e];MailAccount[_0x18cc('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 9cb104e..4341ca7 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 _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 +var _0x6891=['service','host','port','Smtp','secure','authentication','modernAuthentication','auth','CloudProvider','data5','user','pass','exports','define','MailAccount','mail_accounts','provider'];(function(_0xa43e71,_0x359151){var _0x408e63=function(_0x50aaa5){while(--_0x50aaa5){_0xa43e71['push'](_0xa43e71['shift']());}};_0x408e63(++_0x359151);}(_0x6891,0xd8));var _0x1689=function(_0x2577f7,_0x4e4781){_0x2577f7=_0x2577f7-0x0;var _0x55d372=_0x6891[_0x2577f7];return _0x55d372;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x1689('0x0')]=function(_0x53d2ed){return _0x53d2ed[_0x1689('0x1')](_0x1689('0x2'),attributes,{'tableName':_0x1689('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0xc7aabb=this;var _0x33c2bc={'id':_0xc7aabb['id'],'tls':{'rejectUnauthorized':![]}};if(_0xc7aabb[_0x1689('0x4')]!=='custom'){_0x33c2bc[_0x1689('0x5')]=_0xc7aabb[_0x1689('0x4')];}else{_0x33c2bc['host']=_0xc7aabb['Smtp'][_0x1689('0x6')];_0x33c2bc[_0x1689('0x7')]=_0xc7aabb[_0x1689('0x8')][_0x1689('0x7')];_0x33c2bc[_0x1689('0x9')]=_0xc7aabb[_0x1689('0x8')][_0x1689('0x9')];}if(_0xc7aabb[_0x1689('0x8')][_0x1689('0xa')]){if(_0xc7aabb[_0x1689('0x8')][_0x1689('0xb')]){if(!_0xc7aabb[_0x1689('0x8')]['CloudProvider'])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x33c2bc[_0x1689('0xc')]={'type':'OAuth2','user':_0xc7aabb[_0x1689('0x8')]['user'],'accessToken':_0xc7aabb[_0x1689('0x8')][_0x1689('0xd')][_0x1689('0xe')]};}else{_0x33c2bc[_0x1689('0xc')]={'user':_0xc7aabb['Smtp'][_0x1689('0xf')],'pass':_0xc7aabb[_0x1689('0x8')][_0x1689('0x10')]};}}return _0x33c2bc;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index dd7ef6e..a998dc7 100644 --- a/server/api/mailAccount/mailAccount.rpc.js +++ b/server/api/mailAccount/mailAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66fa=['ShowMailAccount','smtp','getSmtpOptions','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','Applications','MailServerOut','Smtp','List','get','omit','smtpOptions','applications','list','orderBy','priority','asc','autoclose','push','close','*,*,*,*','create','List\x20not\x20found','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','update','attach','interaction','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','then','MailAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','map','model','catch'];(function(_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 +var _0x4137=['Smtp','CloudProvider','get','omit','Applications','applications','priority','asc','push','length','Contacts','create','contact','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Contact\x20not\x20found','spread','update','interaction','created','MailMessage','originTo','originCc','bcc','originChannel','ChatOfflineMessageId','Attachment','Attachments','User','name','UserId','*,*,*,*','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','request\x20sent','debug','stringify','error','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','mail','difference','keys','CmContact','createdAt','CompanyId','ListId','body','isNil','from','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','account','CmList','List','DESC','MailServerOut'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x4137,0xf8));var _0x7413=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4137[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x7413('0x0'));var moment=require(_0x7413('0x1'));var BPromise=require(_0x7413('0x2'));var rs=require(_0x7413('0x3'));var Redis=require(_0x7413('0x4'));var db=require(_0x7413('0x5'))['db'];var logger=require(_0x7413('0x6'))(_0x7413('0x7'));var config=require(_0x7413('0x8'));var jayson=require(_0x7413('0x9'));var client=jayson[_0x7413('0xa')][_0x7413('0xb')]({'port':0x232c});config['redis']=_[_0x7413('0xc')](config[_0x7413('0xd')],{'host':_0x7413('0xe'),'port':0x18eb});var socket=require(_0x7413('0xf'))(new Redis(config['redis']));require(_0x7413('0x10'))[_0x7413('0x11')](socket);function respondWithRpcPromise(_0x4e320b,_0x422bf5,_0x2f4b54){return new BPromise(function(_0x50fde0,_0x29f124){return client[_0x7413('0x12')](_0x4e320b,_0x2f4b54)[_0x7413('0x13')](function(_0x3e026b){logger[_0x7413('0x14')]('MailAccount,\x20%s,\x20%s',_0x422bf5,_0x7413('0x15'));logger[_0x7413('0x16')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x422bf5,_0x7413('0x15'),JSON[_0x7413('0x17')](_0x3e026b));if(_0x3e026b[_0x7413('0x18')]){if(_0x3e026b['error']['code']===0x1f4){logger['error'](_0x7413('0x19'),_0x422bf5,_0x3e026b[_0x7413('0x18')]['message']);return _0x29f124(_0x3e026b[_0x7413('0x18')][_0x7413('0x1a')]);}logger['error'](_0x7413('0x19'),_0x422bf5,_0x3e026b['error']['message']);return _0x50fde0(_0x3e026b[_0x7413('0x18')]['message']);}else{logger[_0x7413('0x14')]('MailAccount,\x20%s,\x20%s',_0x422bf5,_0x7413('0x15'));_0x50fde0(_0x3e026b[_0x7413('0x1b')][_0x7413('0x1a')]);}})[_0x7413('0x1c')](function(_0x2a3417){logger[_0x7413('0x18')]('MailAccount,\x20%s,\x20%s',_0x422bf5,_0x2a3417);_0x29f124(_0x2a3417);});});}exports[_0x7413('0x1d')]=function(_0x17c062){var _0x11f8a1=this;return new Promise(function(_0xfe5b8c,_0x5bee15){return db[_0x7413('0x1e')][_0x7413('0x1f')]({'raw':_0x17c062[_0x7413('0x20')]?_0x17c062[_0x7413('0x20')][_0x7413('0x21')]===undefined?!![]:![]:!![],'where':_0x17c062[_0x7413('0x20')]?_0x17c062[_0x7413('0x20')][_0x7413('0x22')]||null:null,'attributes':_0x17c062['options']?_0x17c062['options'][_0x7413('0x23')]||null:null,'limit':_0x17c062['options']?_0x17c062[_0x7413('0x20')][_0x7413('0x24')]||null:null,'include':_0x17c062[_0x7413('0x20')]?_0x17c062[_0x7413('0x20')][_0x7413('0x25')]?_[_0x7413('0x26')](_0x17c062[_0x7413('0x20')][_0x7413('0x25')],function(_0x1d455b){return{'model':db[_0x1d455b['model']],'as':_0x1d455b['as'],'attributes':_0x1d455b['attributes'],'include':_0x1d455b[_0x7413('0x25')]?_['map'](_0x1d455b[_0x7413('0x25')],function(_0x71cbb4){return{'model':db[_0x71cbb4[_0x7413('0x27')]],'as':_0x71cbb4['as'],'attributes':_0x71cbb4['attributes'],'include':_0x71cbb4[_0x7413('0x25')]?_[_0x7413('0x26')](_0x71cbb4[_0x7413('0x25')],function(_0x4843fd){return{'model':db[_0x4843fd[_0x7413('0x27')]],'as':_0x4843fd['as'],'attributes':_0x4843fd[_0x7413('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24dce7){logger['info'](_0x7413('0x1d'),_0x17c062);logger[_0x7413('0x16')](_0x7413('0x1d'),_0x17c062,JSON[_0x7413('0x17')](_0x24dce7));_0xfe5b8c(_0x24dce7);})[_0x7413('0x1c')](function(_0x2004ea){logger['error'](_0x7413('0x1d'),_0x2004ea[_0x7413('0x1a')],_0x17c062);_0x5bee15(_0x11f8a1[_0x7413('0x18')](0x1f4,_0x2004ea[_0x7413('0x1a')]));});});};exports[_0x7413('0x28')]=function(_0x256395){var _0x185cfe=this;return new Promise(function(_0x5b4426,_0xd763f9){return db[_0x7413('0x1e')][_0x7413('0x29')]({'raw':_0x256395[_0x7413('0x20')]?_0x256395[_0x7413('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x256395[_0x7413('0x20')]?_0x256395['options'][_0x7413('0x22')]||null:null,'attributes':_0x256395[_0x7413('0x20')]?_0x256395[_0x7413('0x20')]['attributes']||null:null,'include':_0x256395[_0x7413('0x20')]?_0x256395['options'][_0x7413('0x25')]?_[_0x7413('0x26')](_0x256395['options']['include'],function(_0x440bfe){return{'model':db[_0x440bfe[_0x7413('0x27')]],'as':_0x440bfe['as'],'attributes':_0x440bfe[_0x7413('0x23')],'include':_0x440bfe['include']?_['map'](_0x440bfe[_0x7413('0x25')],function(_0x5a92ab){return{'model':db[_0x5a92ab['model']],'as':_0x5a92ab['as'],'attributes':_0x5a92ab[_0x7413('0x23')],'include':_0x5a92ab['include']?_[_0x7413('0x26')](_0x5a92ab[_0x7413('0x25')],function(_0xf34b21){return{'model':db[_0xf34b21[_0x7413('0x27')]],'as':_0xf34b21['as'],'attributes':_0xf34b21[_0x7413('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa58bd2){if(_0x256395[_0x7413('0x20')][_0x7413('0x2a')]===!![])_0xa58bd2[_0x7413('0x2b')](_0x7413('0x2c'),_0xa58bd2[_0x7413('0x2d')]());logger[_0x7413('0x14')](_0x7413('0x28'),_0x256395);logger[_0x7413('0x16')](_0x7413('0x28'),_0x256395,JSON[_0x7413('0x17')](_0xa58bd2));_0x5b4426(_0xa58bd2);})[_0x7413('0x1c')](function(_0x5a9791){logger[_0x7413('0x18')]('ShowMailAccount',_0x5a9791['message'],_0x256395);_0xd763f9(_0x185cfe['error'](0x1f4,_0x5a9791['message']));});});};exports['NotifyMailAccount']=function(_0x44af7d){var _0x4c1770=this;return new Promise(function(_0x535e49,_0x5dc077){var _0x4d0008={'body':_0x44af7d['body'],'channel':_0x7413('0x2e')};var _0x32f1e8=_[_0x7413('0x2f')](_[_0x7413('0x30')](db[_0x7413('0x31')]['rawAttributes']),[_0x7413('0x32'),'updatedAt',_0x7413('0x33'),_0x7413('0x34')]);var _0xa063d1=![];if(_0x44af7d[_0x7413('0x35')]['id']){delete _0x44af7d[_0x7413('0x35')]['id'];}if(_[_0x7413('0x36')](_0x44af7d[_0x7413('0x35')][_0x7413('0x37')])){return _0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x7413('0x38')));}if(_[_0x7413('0x36')](_0x44af7d[_0x7413('0x35')][_0x7413('0x35')])||_0x44af7d['body'][_0x7413('0x35')]===''){return _0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x7413('0x39')));}if(_[_0x7413('0x36')](_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')])){return _0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x7413('0x3b')+_0x32f1e8));}if(!_[_0x7413('0x3c')](_0x32f1e8,_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')])){return _0x5dc077(_0x4c1770['error'](0x1f4,_0x7413('0x3d')+_0x32f1e8));}var _0x52a088={};_0x52a088[_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')]]=_0x44af7d[_0x7413('0x35')][_0x7413('0x37')];return db[_0x7413('0x1e')][_0x7413('0x29')]({'where':{'id':_0x44af7d[_0x7413('0x3e')]['id']},'include':[{'model':db[_0x7413('0x3f')],'as':_0x7413('0x40'),'include':[{'model':db[_0x7413('0x31')],'as':'Contacts','where':_0x52a088,'limit':0x1,'order':[['updatedAt',_0x7413('0x41')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db[_0x7413('0x42')],'as':_0x7413('0x43'),'include':[{'model':db['CloudProvider'],'as':_0x7413('0x44')}]}]})['then'](function(_0x562bae){if(_0x562bae&&_0x562bae[_0x7413('0x40')]){var _0x5f263e=_0x562bae[_0x7413('0x45')]({'plain':!![]});_0x4d0008[_0x7413('0x3e')]=_[_0x7413('0x46')](_0x5f263e,[_0x7413('0x47'),_0x7413('0x40')]);_0x4d0008[_0x7413('0x3e')][_0x7413('0x2c')]=_0x562bae[_0x7413('0x2d')]();_0x4d0008[_0x7413('0x48')]=_0x5f263e[_0x7413('0x47')];_0x4d0008['list']=_0x5f263e[_0x7413('0x40')];_0x4d0008['applications']=_['orderBy'](_0x4d0008['applications'],[_0x7413('0x49')],[_0x7413('0x4a')]);if(_0x4d0008[_0x7413('0x3e')]&&_0x4d0008[_0x7413('0x3e')]['autoclose']){_0x4d0008['applications'][_0x7413('0x4b')]({'id':0x0,'priority':_0x4d0008['applications'][_0x7413('0x4c')]+0x1,'app':'close','appdata':'autoclose','interval':'*,*,*,*'});}if(_0x4d0008['account']['Applications']){delete _0x4d0008[_0x7413('0x3e')][_0x7413('0x47')];}if(_0x4d0008[_0x7413('0x3e')][_0x7413('0x40')]){delete _0x4d0008[_0x7413('0x3e')]['List'];}if(_0x5f263e[_0x7413('0x40')][_0x7413('0x4d')][_0x7413('0x4c')]){return _0x5f263e['List'][_0x7413('0x4d')][0x0];}var _0x5c3324=_['defaults'](_0x44af7d[_0x7413('0x35')],{'firstName':_0x44af7d[_0x7413('0x35')][_0x7413('0x37')],'ListId':_0x5f263e[_0x7413('0x34')]});_0x5c3324[_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')]]=_0x44af7d['body'][_0x7413('0x37')];return db['CmContact'][_0x7413('0x4e')](_0x5c3324);}else{throw new Error('List\x20not\x20found');}})[_0x7413('0x13')](function(_0x4d4faa){_0x4d0008[_0x7413('0x4f')]=_0x4d4faa;if(_0x4d4faa){if(!_0x44af7d[_0x7413('0x35')]['message'][_0x7413('0x50')]){_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x50')]=rs['generate']()+'\x20'+_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['from'];}var _0x3ce34c={'ContactId':_0x4d4faa['id'],'MailAccountId':_0x44af7d[_0x7413('0x3e')]['id'],'inReplyTo':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x50')],'to':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x37')],'cc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['cc'],'subject':_0x44af7d[_0x7413('0x35')]['message'][_0x7413('0x51')],'attach':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x52')],'lastMsgAt':moment()[_0x7413('0x53')](_0x7413('0x54')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x44af7d['account']['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':[_0x7413('0x50')],'where':{'messageId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['inReplyTo']}}]})[_0x7413('0x13')](function(_0xb7dd83){if(_0xb7dd83){return[_0xb7dd83,![]];}return db[_0x7413('0x55')][_0x7413('0x4e')](_0x3ce34c)[_0x7413('0x13')](function(_0x3db284){return[_0x3db284,!![]];});});}else{throw new Error(_0x7413('0x56'));}})[_0x7413('0x57')](function(_0x1ec131,_0x47512d){if(_0x1ec131){_0xa063d1=_0x47512d;if(!_0x47512d){return _0x1ec131[_0x7413('0x58')]({'inReplyTo':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['messageId'],'to':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['from'],'cc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['cc'],'subject':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x51')],'attach':_0x1ec131[_0x7413('0x52')]?_0x1ec131['attach']:_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['attach'],'substatus':null,'substatusAt':moment()[_0x7413('0x53')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x7413('0x54')),'lastMsgDirection':'in'});}else{return _0x1ec131;}}})[_0x7413('0x13')](function(_0x167c6b){_0x4d0008[_0x7413('0x59')]=_0x167c6b[_0x7413('0x45')]({'plain':!![]});_0x4d0008[_0x7413('0x59')][_0x7413('0x5a')]=_0xa063d1;return db[_0x7413('0x5b')]['create']({'body':_0x44af7d[_0x7413('0x35')]['body'],'MailAccountId':_0x44af7d[_0x7413('0x3e')]['id'],'MailInteractionId':_0x167c6b['id'],'direction':'in','ContactId':_0x4d0008[_0x7413('0x4f')]['id'],'messageId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x50')],'from':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x37')],'to':_0x44af7d[_0x7413('0x35')]['message']['to'],'cc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['cc'],'subject':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x51')],'attach':_0x44af7d['body'][_0x7413('0x1a')]['attach'],'Attachments':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['attachments'],'originTo':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x5c')],'originCc':_0x44af7d[_0x7413('0x35')]['message'][_0x7413('0x5d')],'bcc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x5e')],'ChatWebsiteId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['ChatWebsiteId']||null,'originChannel':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x5f')]||'Email','ChatOfflineMessageId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x60')]||null},{'include':[{'model':db[_0x7413('0x61')],'as':_0x7413('0x62')}]});})[_0x7413('0x13')](function(_0x46e9f8){_0x4d0008[_0x7413('0x1a')]=_0x46e9f8;if(_0x4d0008[_0x7413('0x59')]['UserId']){return db[_0x7413('0x63')][_0x7413('0x29')]({'attributes':['id',_0x7413('0x64')],'where':{'id':_0x4d0008[_0x7413('0x59')][_0x7413('0x65')]}})[_0x7413('0x13')](function(_0x4c9d1b){if(_0x4c9d1b){_0x4d0008[_0x7413('0x48')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4c9d1b[_0x7413('0x64')]+','+(_0x4d0008[_0x7413('0x3e')]['waitForTheAssignedAgent']||0xa),'interval':_0x7413('0x66')});}return respondWithRpcPromise(_0x7413('0x67'),_0x7413('0x68'),_0x4d0008);});}return respondWithRpcPromise(_0x7413('0x67'),_0x7413('0x68'),_0x4d0008);})[_0x7413('0x13')](function(_0x2d361c){_0x535e49(_0x2d361c);})[_0x7413('0x1c')](function(_0x5f4765){_0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x5f4765['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 928009c..ffc838c 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 _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 +var _0x1932=['remove','update','emit','removeListener','register','length','mailAccount:','./mailAccount.events','save'];(function(_0x3e478c,_0x152670){var _0x29ef89=function(_0x3d0d77){while(--_0x3d0d77){_0x3e478c['push'](_0x3e478c['shift']());}};_0x29ef89(++_0x152670);}(_0x1932,0xbb));var _0x2193=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x1932[_0x1caf6a];return _0x1bf493;};'use strict';var MailAccountEvents=require(_0x2193('0x0'));var events=[_0x2193('0x1'),_0x2193('0x2'),_0x2193('0x3')];function createListener(_0x47440d,_0x4f60ca){return function(_0x2eb2fe){_0x4f60ca[_0x2193('0x4')](_0x47440d,_0x2eb2fe);};}function removeListener(_0x1d0fc1,_0x1557cc){return function(){MailAccountEvents[_0x2193('0x5')](_0x1d0fc1,_0x1557cc);};}exports[_0x2193('0x6')]=function(_0x50aaa8){for(var _0x377c15=0x0,_0x3479ff=events[_0x2193('0x7')];_0x377c15<_0x3479ff;_0x377c15++){var _0xe886ff=events[_0x377c15];var _0x436b26=createListener(_0x2193('0x8')+_0xe886ff,_0x50aaa8);MailAccountEvents['on'](_0xe886ff,_0x436b26);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 02b7dbe..94ebcde 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 _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 +var _0xa829=['Router','fs-extra','../../components/auth/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x375d7c,_0x301cb6){var _0x800b24=function(_0x1e2393){while(--_0x1e2393){_0x375d7c['push'](_0x375d7c['shift']());}};_0x800b24(++_0x301cb6);}(_0xa829,0x13f));var _0x9a82=function(_0x5e5b9d,_0x18bcd2){_0x5e5b9d=_0x5e5b9d-0x0;var _0x1e6d0e=_0xa829[_0x5e5b9d];return _0x1e6d0e;};'use strict';var multer=require('multer');var util=require(_0x9a82('0x0'));var path=require(_0x9a82('0x1'));var timeout=require(_0x9a82('0x2'));var express=require('express');var router=express[_0x9a82('0x3')]();var fs_extra=require(_0x9a82('0x4'));var auth=require(_0x9a82('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9a82('0x6'));var controller=require(_0x9a82('0x7'));router['get'](_0x9a82('0x8'),auth[_0x9a82('0x9')](),controller['show']);router[_0x9a82('0xa')](_0x9a82('0x8'),auth['isAuthenticated'](),controller[_0x9a82('0xb')]);router[_0x9a82('0xc')](_0x9a82('0x8'),auth[_0x9a82('0x9')](),controller[_0x9a82('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 3bca490..144efb6 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 _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 +var _0x2bbe=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0xb6096,_0xb27a34){var _0x1ceb53=function(_0x126f8b){while(--_0x126f8b){_0xb6096['push'](_0xb6096['shift']());}};_0x1ceb53(++_0xb27a34);}(_0x2bbe,0x1a5));var _0xe2bb=function(_0x54bc97,_0x568a67){_0x54bc97=_0x54bc97-0x0;var _0x27e624=_0x2bbe[_0x54bc97];return _0x27e624;};'use strict';var Sequelize=require(_0xe2bb('0x0'));module[_0xe2bb('0x1')]={'priority':{'type':Sequelize[_0xe2bb('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe2bb('0x3')],'allowNull':![],'defaultValue':_0xe2bb('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe2bb('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xe2bb('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index e5845ca..c45bfa1 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(_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 +var _0x54ef=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x1e2b1f,_0x225881){var _0x4bb65b=function(_0x34d7aa){while(--_0x34d7aa){_0x1e2b1f['push'](_0x1e2b1f['shift']());}};_0x4bb65b(++_0x225881);}(_0x54ef,0x112));var _0xf54e=function(_0x21ac16,_0x5b17a8){_0x21ac16=_0x21ac16-0x0;var _0x33c08f=_0x54ef[_0x21ac16];return _0x33c08f;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x19')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x28')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x29')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1a')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2a')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={'raw':!![],'where':{'id':_0x269f47[_0xf54e('0x2b')]['id']}},_0x25b643={};_0x25b643[_0xf54e('0x2c')]=_['keys'](db['MailApplication'][_0xf54e('0x2d')]);_0x25b643[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x269f47[_0xf54e('0x2e')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2c')],_0x25b643[_0xf54e('0x2e')]);_0xa13cd0[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x25b643['model'],qs['fields'](_0x269f47[_0xf54e('0x2e')][_0xf54e('0x33')]));_0xa13cd0['attributes']=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643[_0xf54e('0x2c')];if(_0x269f47['query']['includeAll']){_0xa13cd0['include']=[{'all':!![]}];}_0xa13cd0=_[_0xf54e('0x35')]({},_0xa13cd0,_0x269f47[_0xf54e('0x36')]);return db[_0xf54e('0x37')][_0xf54e('0x38')](_0xa13cd0)[_0xf54e('0x26')](handleEntityNotFound(_0x21ba00,null))[_0xf54e('0x26')](respondWithResult(_0x21ba00,null))['catch'](handleError(_0x21ba00,null));};exports['update']=function(_0x530cee,_0xc04e04){if(_0x530cee[_0xf54e('0x39')]['id']){delete _0x530cee['body']['id'];}return db['MailApplication'][_0xf54e('0x38')]({'where':{'id':_0x530cee[_0xf54e('0x2b')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0xc04e04,null))['then'](saveUpdates(_0x530cee[_0xf54e('0x39')],null))[_0xf54e('0x26')](respondWithResult(_0xc04e04,null))['catch'](handleError(_0xc04e04,null));};exports[_0xf54e('0x27')]=function(_0x6e5bdf,_0x5af03){return db[_0xf54e('0x37')][_0xf54e('0x38')]({'where':{'id':_0x6e5bdf[_0xf54e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af03,null))['then'](removeEntity(_0x5af03,null))[_0xf54e('0x3a')](handleError(_0x5af03,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 1b879b9..aa3a7d9 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 _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 +var _0xeba9=['./mailApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x5ae93d,_0x48a929){var _0x3bc344=function(_0x37d1e8){while(--_0x37d1e8){_0x5ae93d['push'](_0x5ae93d['shift']());}};_0x3bc344(++_0x48a929);}(_0xeba9,0x178));var _0x9eba=function(_0x5797fd,_0x27cfb0){_0x5797fd=_0x5797fd-0x0;var _0xfa26d5=_0xeba9[_0x5797fd];return _0xfa26d5;};'use strict';var _=require('lodash');var util=require(_0x9eba('0x0'));var logger=require(_0x9eba('0x1'))(_0x9eba('0x2'));var moment=require(_0x9eba('0x3'));var BPromise=require('bluebird');var rp=require(_0x9eba('0x4'));var fs=require('fs');var path=require(_0x9eba('0x5'));var rimraf=require(_0x9eba('0x6'));var config=require(_0x9eba('0x7'));var attributes=require(_0x9eba('0x8'));module[_0x9eba('0x9')]=function(_0x1b3493,_0x5f58fc){return _0x1b3493['define']('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9eba('0xa'),'collate':_0x9eba('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 6f7f287..63ff639 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 _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 +var _0x2dcf=['where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MailApplication,\x20%s,\x20%s','result','catch','update','options','raw'];(function(_0x12bb31,_0x39ddf7){var _0x5f1503=function(_0x2e2769){while(--_0x2e2769){_0x12bb31['push'](_0x12bb31['shift']());}};_0x5f1503(++_0x39ddf7);}(_0x2dcf,0x1c5));var _0xf2dc=function(_0x35ce2a,_0x44ba7e){_0x35ce2a=_0x35ce2a-0x0;var _0x211a7a=_0x2dcf[_0x35ce2a];return _0x211a7a;};'use strict';var _=require(_0xf2dc('0x0'));var util=require(_0xf2dc('0x1'));var moment=require(_0xf2dc('0x2'));var BPromise=require(_0xf2dc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf2dc('0x4'))['db'];var utils=require(_0xf2dc('0x5'));var logger=require(_0xf2dc('0x6'))(_0xf2dc('0x7'));var config=require(_0xf2dc('0x8'));var jayson=require(_0xf2dc('0x9'));var client=jayson[_0xf2dc('0xa')][_0xf2dc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x131aee,_0x23f1d7,_0x3e1bdf){return new BPromise(function(_0x1170ce,_0x58ce23){return client[_0xf2dc('0xc')](_0x131aee,_0x3e1bdf)['then'](function(_0x20f4f9){logger[_0xf2dc('0xd')]('MailApplication,\x20%s,\x20%s',_0x23f1d7,'request\x20sent');logger[_0xf2dc('0xe')](_0xf2dc('0xf'),_0x23f1d7,_0xf2dc('0x10'),JSON[_0xf2dc('0x11')](_0x20f4f9));if(_0x20f4f9[_0xf2dc('0x12')]){if(_0x20f4f9[_0xf2dc('0x12')][_0xf2dc('0x13')]===0x1f4){logger[_0xf2dc('0x12')]('MailApplication,\x20%s,\x20%s',_0x23f1d7,_0x20f4f9['error'][_0xf2dc('0x14')]);return _0x58ce23(_0x20f4f9[_0xf2dc('0x12')]['message']);}logger['error'](_0xf2dc('0x15'),_0x23f1d7,_0x20f4f9[_0xf2dc('0x12')]['message']);return _0x1170ce(_0x20f4f9[_0xf2dc('0x12')][_0xf2dc('0x14')]);}else{logger['info'](_0xf2dc('0x15'),_0x23f1d7,'request\x20sent');_0x1170ce(_0x20f4f9[_0xf2dc('0x16')][_0xf2dc('0x14')]);}})[_0xf2dc('0x17')](function(_0x1cbffe){logger[_0xf2dc('0x12')](_0xf2dc('0x15'),_0x23f1d7,_0x1cbffe);_0x58ce23(_0x1cbffe);});});}exports['UpdateMailApplication']=function(_0x217fbb){var _0x20a6fe=this;return new Promise(function(_0x629c6a,_0x5495bc){return db['MailApplication'][_0xf2dc('0x18')](_0x217fbb['body'],{'raw':_0x217fbb[_0xf2dc('0x19')]?_0x217fbb[_0xf2dc('0x19')][_0xf2dc('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x217fbb['options']?_0x217fbb[_0xf2dc('0x19')][_0xf2dc('0x1b')]||null:null,'attributes':_0x217fbb[_0xf2dc('0x19')]?_0x217fbb[_0xf2dc('0x19')][_0xf2dc('0x1c')]||null:null,'limit':_0x217fbb['options']?_0x217fbb[_0xf2dc('0x19')][_0xf2dc('0x1d')]||null:null})[_0xf2dc('0x1e')](function(_0xfbc8){logger['info'](_0xf2dc('0x1f'),_0x217fbb);logger[_0xf2dc('0xe')](_0xf2dc('0x1f'),_0x217fbb,JSON[_0xf2dc('0x11')](_0xfbc8));_0x629c6a(_0xfbc8);})[_0xf2dc('0x17')](function(_0x2118d9){logger['error'](_0xf2dc('0x1f'),_0x2118d9[_0xf2dc('0x14')],_0x217fbb);_0x5495bc(_0x20a6fe[_0xf2dc('0x12')](0x1f4,_0x2118d9[_0xf2dc('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 274d0ee..c2dae83 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 _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 +var _0x33ae=['destroy','delete','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','mail','tracked'];(function(_0x5afad8,_0x6737b4){var _0x47aa13=function(_0x562c51){while(--_0x562c51){_0x5afad8['push'](_0x5afad8['shift']());}};_0x47aa13(++_0x6737b4);}(_0x33ae,0x194));var _0xe33a=function(_0xbf19d7,_0x58b2bf){_0xbf19d7=_0xbf19d7-0x0;var _0x376e11=_0x33ae[_0xbf19d7];return _0x376e11;};'use strict';var express=require('express');var router=express[_0xe33a('0x0')]();var auth=require(_0xe33a('0x1'));var interaction=require(_0xe33a('0x2'));var controller=require(_0xe33a('0x3'));router[_0xe33a('0x4')]('/',auth[_0xe33a('0x5')](),controller[_0xe33a('0x6')]);router[_0xe33a('0x4')](_0xe33a('0x7'),auth['isAuthenticated'](),controller[_0xe33a('0x8')]);router[_0xe33a('0x4')](_0xe33a('0x9'),auth[_0xe33a('0x5')](),controller[_0xe33a('0xa')]);router['get'](_0xe33a('0xb'),auth[_0xe33a('0x5')](),controller[_0xe33a('0xc')]);router['get'](_0xe33a('0xd'),auth['isAuthenticated'](),controller[_0xe33a('0xe')]);router[_0xe33a('0xf')]('/',auth[_0xe33a('0x5')](),controller[_0xe33a('0x10')]);router[_0xe33a('0xf')](_0xe33a('0xb'),auth[_0xe33a('0x5')](),controller[_0xe33a('0x11')]);router[_0xe33a('0xf')](_0xe33a('0x12'),auth[_0xe33a('0x5')](),interaction['tracked'](_0xe33a('0x13'),'mailinteraction:addtags'),controller['addTags']);router['put'](_0xe33a('0x9'),auth[_0xe33a('0x5')](),interaction[_0xe33a('0x14')]('mail','mailinteraction:update'),controller['update']);router['delete'](_0xe33a('0x9'),auth[_0xe33a('0x5')](),interaction['tracked'](_0xe33a('0x13'),'mailinteraction:destroy'),controller[_0xe33a('0x15')]);router[_0xe33a('0x16')](_0xe33a('0x12'),auth[_0xe33a('0x5')](),controller[_0xe33a('0x17')]);module[_0xe33a('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 7c1ed2c..1a74551 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 _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 +var _0x8bc5=['ENUM','sequelize','iconv','exports','BOOLEAN','DATE','STRING','long','TEXT','out'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x8bc5,0xab));var _0x58bc=function(_0x182b80,_0x1b1e50){_0x182b80=_0x182b80-0x0;var _0x3ae12b=_0x8bc5[_0x182b80];return _0x3ae12b;};'use strict';var Sequelize=require(_0x58bc('0x0'));var iconv=require(_0x58bc('0x1'));module[_0x58bc('0x2')]={'closed':{'type':Sequelize[_0x58bc('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x58bc('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x58bc('0x5')]},'thirdDisposition':{'type':Sequelize[_0x58bc('0x5')]},'note':{'type':Sequelize[_0x58bc('0x5')]},'inReplyTo':{'type':Sequelize[_0x58bc('0x5')](0x1fe)},'to':{'type':Sequelize[_0x58bc('0x5')]},'cc':{'type':Sequelize['TEXT'](_0x58bc('0x6'))},'subject':{'type':Sequelize[_0x58bc('0x7')]()},'attach':{'type':Sequelize[_0x58bc('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x58bc('0x4')]},'substatus':{'type':Sequelize[_0x58bc('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x58bc('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x58bc('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x58bc('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x58bc('0x9')]('in',_0x58bc('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x58bc('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index b8683c8..8ea2d5f 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 _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 +var _0xe3cf=['from','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','readFileSync','writeFileSync','eml-format','zip-dir','moment','util','path','lodash','juice','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','update','destroy','then','error','name','send','index','MailInteraction','rawAttributes','fieldName','type','findAll','mail','query','user','catch','show','params','model','keys','intersection','attributes','fields','length','includeAll','merge','find','create','body','describe','addMessage','omit','getMessages','MailMessage','filters','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','include','true','setTags','ids','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','Attachment','Attachments','bcc','subject','createdAt','get','mkdirSync','each','Messages'];(function(_0x3bbd51,_0x2c1612){var _0x387291=function(_0x12234f){while(--_0x12234f){_0x3bbd51['push'](_0x3bbd51['shift']());}};_0x387291(++_0x2c1612);}(_0xe3cf,0x150));var _0xfe3c=function(_0x4e3d3e,_0x1b3134){_0x4e3d3e=_0x4e3d3e-0x0;var _0x4ca2ee=_0xe3cf[_0x4e3d3e];return _0x4ca2ee;};'use strict';var emlformat=require(_0xfe3c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe3c('0x1'));var moment=require(_0xfe3c('0x2'));var BPromise=require('bluebird');var util=require(_0xfe3c('0x3'));var path=require(_0xfe3c('0x4'));var fs=require('fs');var _=require(_0xfe3c('0x5'));var juice=require(_0xfe3c('0x6'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0xfe3c('0x7'));var logger=require(_0xfe3c('0x8'))(_0xfe3c('0x9'));var config=require(_0xfe3c('0xa'));var db=require(_0xfe3c('0xb'))['db'];var htmlEntities=require('html-entities');config[_0xfe3c('0xc')]=_['defaults'](config[_0xfe3c('0xc')],{'host':_0xfe3c('0xd'),'port':0x18eb});var socket=require(_0xfe3c('0xe'))(new Redis(config[_0xfe3c('0xc')]));require(_0xfe3c('0xf'))[_0xfe3c('0x10')](socket);function respondWithStatusCode(_0x298e0c,_0x1c46cf){_0x1c46cf=_0x1c46cf||0xcc;return function(_0x24fa23){if(_0x24fa23){return _0x298e0c[_0xfe3c('0x11')](_0x1c46cf);}return _0x298e0c[_0xfe3c('0x12')](_0x1c46cf)[_0xfe3c('0x13')]();};}function respondWithResult(_0x2e770e,_0x18c076){_0x18c076=_0x18c076||0xc8;return function(_0x13ce7f){if(_0x13ce7f){return _0x2e770e[_0xfe3c('0x12')](_0x18c076)['json'](_0x13ce7f);}};}function respondWithFilteredResult(_0x243812,_0x4a65a0){return function(_0xf52848){if(_0xf52848){var _0x1158e3=typeof _0x4a65a0[_0xfe3c('0x14')]===_0xfe3c('0x15')&&typeof _0x4a65a0['limit']===_0xfe3c('0x15');var _0x297201=_0xf52848[_0xfe3c('0x16')];var _0x147a66=_0x1158e3?0x0:_0x4a65a0['offset'];var _0x4a2b70=_0x1158e3?_0xf52848[_0xfe3c('0x16')]:_0x4a65a0[_0xfe3c('0x14')]+_0x4a65a0[_0xfe3c('0x17')];var _0x36eb77;if(_0x4a2b70>=_0x297201){_0x4a2b70=_0x297201;_0x36eb77=0xc8;}else{_0x36eb77=0xce;}_0x243812[_0xfe3c('0x12')](_0x36eb77);return _0x243812[_0xfe3c('0x18')]('Content-Range',_0x147a66+'-'+_0x4a2b70+'/'+_0x297201)['json'](_0xf52848);}return null;};}function saveUpdates(_0x2d52d5){return function(_0x5d3f37){if(_0x5d3f37){return _0x5d3f37[_0xfe3c('0x19')](_0x2d52d5)['then'](function(_0x16a3da){return _0x16a3da;});}return null;};}function removeEntity(_0x84b1b){return function(_0xec1c32){if(_0xec1c32){return _0xec1c32[_0xfe3c('0x1a')]()[_0xfe3c('0x1b')](function(){_0x84b1b[_0xfe3c('0x12')](0xcc)[_0xfe3c('0x13')]();});}};}function handleEntityNotFound(_0x18b20d){return function(_0x122ebd){if(!_0x122ebd){_0x18b20d[_0xfe3c('0x11')](0x194);}return _0x122ebd;};}function handleError(_0x542ec5,_0x3ce976){_0x3ce976=_0x3ce976||0x1f4;return function(_0x24af30){logger[_0xfe3c('0x1c')](_0x24af30['stack']);if(_0x24af30[_0xfe3c('0x1d')]){delete _0x24af30[_0xfe3c('0x1d')];}_0x542ec5[_0xfe3c('0x12')](_0x3ce976)[_0xfe3c('0x1e')](_0x24af30);};}exports[_0xfe3c('0x1f')]=function(_0x347a40,_0x1920cf){var _0x1129e7={};var _0x20b494=_['map'](db[_0xfe3c('0x20')][_0xfe3c('0x21')],function(_0x2e5765){return{'name':_0x2e5765[_0xfe3c('0x22')],'type':_0x2e5765[_0xfe3c('0x23')]['key']};});_0x1129e7=qs['getOptions'](_0x20b494,_0x347a40);return interaction[_0xfe3c('0x24')](_0xfe3c('0x25'),_0x347a40[_0xfe3c('0x26')],_0x347a40[_0xfe3c('0x27')],_0x1129e7,_0x20b494)[_0xfe3c('0x1b')](respondWithFilteredResult(_0x1920cf,_0x1129e7))[_0xfe3c('0x28')](handleError(_0x1920cf,null));};exports[_0xfe3c('0x29')]=function(_0x1b1b6a,_0x357170){var _0x2c18f3={'raw':![],'where':{'id':_0x1b1b6a[_0xfe3c('0x2a')]['id']}},_0x8f4481={};_0x8f4481[_0xfe3c('0x2b')]=_['keys'](db[_0xfe3c('0x20')][_0xfe3c('0x21')]);_0x8f4481[_0xfe3c('0x26')]=_[_0xfe3c('0x2c')](_0x1b1b6a[_0xfe3c('0x26')]);_0x8f4481['filters']=_[_0xfe3c('0x2d')](_0x8f4481[_0xfe3c('0x2b')],_0x8f4481[_0xfe3c('0x26')]);_0x2c18f3[_0xfe3c('0x2e')]=_[_0xfe3c('0x2d')](_0x8f4481[_0xfe3c('0x2b')],qs[_0xfe3c('0x2f')](_0x1b1b6a[_0xfe3c('0x26')][_0xfe3c('0x2f')]));_0x2c18f3[_0xfe3c('0x2e')]=_0x2c18f3[_0xfe3c('0x2e')][_0xfe3c('0x30')]?_0x2c18f3[_0xfe3c('0x2e')]:_0x8f4481['model'];if(_0x1b1b6a[_0xfe3c('0x26')][_0xfe3c('0x31')]){_0x2c18f3['include']=[{'all':!![]}];}_0x2c18f3=_[_0xfe3c('0x32')]({},_0x2c18f3,_0x1b1b6a['options']);return db[_0xfe3c('0x20')][_0xfe3c('0x33')](_0x2c18f3)[_0xfe3c('0x1b')](handleEntityNotFound(_0x357170,null))[_0xfe3c('0x1b')](respondWithResult(_0x357170,null))['catch'](handleError(_0x357170,null));};exports['create']=function(_0x2ae915,_0x58d4c3){return db['MailInteraction'][_0xfe3c('0x34')](_0x2ae915[_0xfe3c('0x35')],{})[_0xfe3c('0x1b')](respondWithResult(_0x58d4c3,0xc9))[_0xfe3c('0x28')](handleError(_0x58d4c3,null));};exports[_0xfe3c('0x19')]=function(_0x17fc65,_0x1a8d87){if(_0x17fc65[_0xfe3c('0x35')]['id']){delete _0x17fc65[_0xfe3c('0x35')]['id'];}return db[_0xfe3c('0x20')]['find']({'where':{'id':_0x17fc65[_0xfe3c('0x2a')]['id']}})[_0xfe3c('0x1b')](handleEntityNotFound(_0x1a8d87,null))[_0xfe3c('0x1b')](saveUpdates(_0x17fc65[_0xfe3c('0x35')],null))[_0xfe3c('0x1b')](respondWithResult(_0x1a8d87,null))[_0xfe3c('0x28')](handleError(_0x1a8d87,null));};exports[_0xfe3c('0x1a')]=function(_0x4c5d84,_0x394a1e){return db[_0xfe3c('0x20')][_0xfe3c('0x33')]({'where':{'id':_0x4c5d84['params']['id']}})[_0xfe3c('0x1b')](handleEntityNotFound(_0x394a1e,null))[_0xfe3c('0x1b')](removeEntity(_0x394a1e,null))[_0xfe3c('0x28')](handleError(_0x394a1e,null));};exports[_0xfe3c('0x36')]=function(_0x4692d5,_0x415b2e){return db[_0xfe3c('0x20')][_0xfe3c('0x36')]()[_0xfe3c('0x1b')](respondWithResult(_0x415b2e,null))[_0xfe3c('0x28')](handleError(_0x415b2e,null));};exports[_0xfe3c('0x37')]=function(_0x2d3387,_0x58b916){return db['MailMessage'][_0xfe3c('0x33')]({'where':{'id':_0x2d3387['params']['id']}})['then'](handleEntityNotFound(_0x58b916,null))[_0xfe3c('0x1b')](function(_0x31bc8b){if(_0x31bc8b){return _0x31bc8b[_0xfe3c('0x37')](_0x2d3387[_0xfe3c('0x35')]['ids'],_[_0xfe3c('0x38')](_0x2d3387[_0xfe3c('0x35')],['ids','id'])||{});}})['then'](respondWithResult(_0x58b916,null))[_0xfe3c('0x28')](handleError(_0x58b916,null));};exports[_0xfe3c('0x39')]=function(_0x22a9e6,_0x586bbb){var _0x2de4ef={'raw':![],'where':{}};var _0x462df7={};var _0x4ec181={'count':0x0,'rows':[]};return db[_0xfe3c('0x20')]['findOne']({'where':{'id':_0x22a9e6[_0xfe3c('0x2a')]['id']}})[_0xfe3c('0x1b')](handleEntityNotFound(_0x586bbb,null))['then'](function(_0x584633){if(_0x584633){_0x462df7[_0xfe3c('0x2b')]=_['keys'](db[_0xfe3c('0x3a')][_0xfe3c('0x21')]);_0x462df7[_0xfe3c('0x26')]=_[_0xfe3c('0x2c')](_0x22a9e6[_0xfe3c('0x26')]);_0x462df7[_0xfe3c('0x3b')]=_['intersection'](_0x462df7['model'],_0x462df7[_0xfe3c('0x26')]);_0x2de4ef['attributes']=_[_0xfe3c('0x2d')](_0x462df7[_0xfe3c('0x2b')],qs['fields'](_0x22a9e6[_0xfe3c('0x26')][_0xfe3c('0x2f')]));_0x2de4ef[_0xfe3c('0x2e')]=_0x2de4ef[_0xfe3c('0x2e')][_0xfe3c('0x30')]?_0x2de4ef[_0xfe3c('0x2e')]:_0x462df7[_0xfe3c('0x2b')];if(!_0x22a9e6[_0xfe3c('0x26')][_0xfe3c('0x3c')](_0xfe3c('0x3d'))){_0x2de4ef[_0xfe3c('0x17')]=qs[_0xfe3c('0x17')](_0x22a9e6['query']['limit']);_0x2de4ef[_0xfe3c('0x14')]=qs[_0xfe3c('0x14')](_0x22a9e6[_0xfe3c('0x26')][_0xfe3c('0x14')]);}_0x2de4ef[_0xfe3c('0x3e')]=qs[_0xfe3c('0x3f')](_0x22a9e6[_0xfe3c('0x26')][_0xfe3c('0x3f')]);_0x2de4ef[_0xfe3c('0x40')]=qs[_0xfe3c('0x3b')](_[_0xfe3c('0x41')](_0x22a9e6[_0xfe3c('0x26')],_0x462df7['filters']));_0x2de4ef[_0xfe3c('0x40')]['MailInteractionId']=_0x584633['id'];if(_0x22a9e6[_0xfe3c('0x26')][_0xfe3c('0x42')]){_0x2de4ef[_0xfe3c('0x40')]=_[_0xfe3c('0x32')](_0x2de4ef['where'],{'$or':_[_0xfe3c('0x43')](_0x2de4ef[_0xfe3c('0x2e')],function(_0x54ea42){var _0x16bd1b={};_0x16bd1b[_0x54ea42]={'$like':'%'+_0x22a9e6['query'][_0xfe3c('0x42')]+'%'};return _0x16bd1b;})});}if(_0x22a9e6['query'][_0xfe3c('0x44')]){var _0x37a17d=_0x22a9e6[_0xfe3c('0x26')][_0xfe3c('0x44')][_0xfe3c('0x45')](',');var _0x24df80={};_0x24df80[_0x37a17d[0x0]]={'$gte':moment(_0x37a17d[0x1])['format'](_0xfe3c('0x46'))};_0x2de4ef[_0xfe3c('0x40')]=_['merge'](_0x2de4ef[_0xfe3c('0x40')],_0x24df80);}_0x2de4ef=_[_0xfe3c('0x32')]({},_0x2de4ef,_0x22a9e6[_0xfe3c('0x47')]);return db[_0xfe3c('0x3a')]['count']({'where':_0x2de4ef[_0xfe3c('0x40')]})['then'](function(_0x287d0b){_0x4ec181[_0xfe3c('0x16')]=_0x287d0b;if(_0x22a9e6[_0xfe3c('0x26')][_0xfe3c('0x31')]){_0x2de4ef[_0xfe3c('0x48')]=[{'all':!![]}];}return db[_0xfe3c('0x3a')][_0xfe3c('0x24')](_0x2de4ef);})[_0xfe3c('0x1b')](function(_0x208d45){if(_0x22a9e6[_0xfe3c('0x26')]['inlineCss']===_0xfe3c('0x49')){for(var _0xcab059=0x0;_0xcab059<_0x208d45[_0xfe3c('0x30')];_0xcab059++){_0x208d45[_0xcab059]['body']=juice(_0x208d45[_0xcab059][_0xfe3c('0x35')]);}}_0x4ec181['rows']=_0x208d45;return _0x4ec181;});}})[_0xfe3c('0x1b')](respondWithFilteredResult(_0x586bbb,_0x2de4ef))['catch'](handleError(_0x586bbb,null));};exports['addTags']=function(_0xad6ef0,_0x375ae4){return db[_0xfe3c('0x20')][_0xfe3c('0x33')]({'where':{'id':_0xad6ef0[_0xfe3c('0x2a')]['id']}})['then'](handleEntityNotFound(_0x375ae4,null))['then'](function(_0x58939d){if(_0x58939d){return _0x58939d[_0xfe3c('0x4a')](_0xad6ef0[_0xfe3c('0x35')][_0xfe3c('0x4b')],_[_0xfe3c('0x38')](_0xad6ef0['body'],[_0xfe3c('0x4b'),'id'])||{})['spread'](function(){return db['Tag'][_0xfe3c('0x24')]({'attributes':['id','name',_0xfe3c('0x4c')],'where':{'id':_0xad6ef0['body'][_0xfe3c('0x4b')]}});})[_0xfe3c('0x1b')](function(_0x2c2ac6){socket[_0xfe3c('0x4d')](_0xfe3c('0x4e'),{'id':Number(_0xad6ef0[_0xfe3c('0x2a')]['id']),'tags':_0x2c2ac6||[]});return{'id':Number(_0xad6ef0[_0xfe3c('0x2a')]['id']),'tags':_0x2c2ac6||[]};});}})['then'](respondWithResult(_0x375ae4,null))['catch'](handleError(_0x375ae4,null));};exports[_0xfe3c('0x4f')]=function(_0xada8b3,_0x1be946){return db[_0xfe3c('0x20')][_0xfe3c('0x33')]({'where':{'id':_0xada8b3['params']['id']}})[_0xfe3c('0x1b')](handleEntityNotFound(_0x1be946,null))['then'](function(_0x13149a){if(_0x13149a){return _0x13149a[_0xfe3c('0x4f')](_0xada8b3[_0xfe3c('0x26')][_0xfe3c('0x4b')]);}})[_0xfe3c('0x1b')](respondWithStatusCode(_0x1be946,null))[_0xfe3c('0x28')](handleError(_0x1be946,null));};exports[_0xfe3c('0x50')]=function(_0x5a4367,_0x5f33c4){var _0xbf7387=moment()[_0xfe3c('0x51')]()[_0xfe3c('0x52')]();var _0x229a2d=path[_0xfe3c('0x53')](config[_0xfe3c('0x54')],_0xfe3c('0x55'),_0xfe3c('0x56'),_0xfe3c('0x57'));var _0x4b547d=path[_0xfe3c('0x53')](config['root'],_0xfe3c('0x55'),_0xfe3c('0x56'),_0xfe3c('0x58'));var _0x5b72b4=path[_0xfe3c('0x53')](_0x229a2d,_0xbf7387);var _0x31db56=util[_0xfe3c('0x59')](_0xfe3c('0x5a'),_0x5a4367['params']['id'],_0xbf7387);var _0x78df6f=path[_0xfe3c('0x53')](_0x229a2d,_0x31db56);var _0x4d736d=[];if(_0x5a4367[_0xfe3c('0x26')][_0xfe3c('0x58')]){_0x4d736d['push']({'model':db[_0xfe3c('0x5b')],'as':_0xfe3c('0x5c'),'raw':!![]});}var _0x31730e=[{'model':db[_0xfe3c('0x3a')],'as':'Messages','attributes':['id','body','from','to','cc',_0xfe3c('0x5d'),_0xfe3c('0x5e'),_0xfe3c('0x5f')],'where':{'secret':![]},'order':qs[_0xfe3c('0x3f')]('id'),'include':_0x4d736d}];return db['MailInteraction'][_0xfe3c('0x33')]({'where':{'id':_0x5a4367[_0xfe3c('0x2a')]['id']},'include':_0x31730e})[_0xfe3c('0x1b')](handleEntityNotFound(_0x5f33c4,null))[_0xfe3c('0x1b')](function(_0x3fa719){if(_0x3fa719&&_0x3fa719['Messages']){var _0x208872=_0x3fa719[_0xfe3c('0x60')]({'plain':!![]});fs[_0xfe3c('0x61')](_0x5b72b4);return BPromise[_0xfe3c('0x62')](_0x208872[_0xfe3c('0x63')],function(_0x4ad144,_0x4d9ad9){var _0x489edb={'from':_0x4ad144[_0xfe3c('0x64')],'to':_0x4ad144['to']||_0xfe3c('0x65'),'subject':_0x4ad144[_0xfe3c('0x5e')],'html':htmlEntities[_0xfe3c('0x66')](_0x4ad144[_0xfe3c('0x35')]),'headers':{'Date':moment(_0x4ad144[_0xfe3c('0x5f')])['format'](_0xfe3c('0x67'))},'attachments':[]};if(_0x4ad144['cc']){_0x489edb['headers']['Cc']=_0x4ad144['cc'];}if(_0x4ad144[_0xfe3c('0x5d')]){_0x489edb[_0xfe3c('0x68')]['Bcc']=_0x4ad144[_0xfe3c('0x5d')];}return new BPromise(function(_0x2311ad,_0x5f2f49){if(_0x4ad144[_0xfe3c('0x5c')]){for(var _0x285949=0x0;_0x285949<_0x4ad144[_0xfe3c('0x5c')][_0xfe3c('0x30')];_0x285949++){var _0x4864cd=_0x4ad144[_0xfe3c('0x5c')][_0x285949];var _0x226ad2=path[_0xfe3c('0x53')](_0x4b547d,_0x4864cd[_0xfe3c('0x69')]);if(fs[_0xfe3c('0x6a')](_0x226ad2)){_0x489edb[_0xfe3c('0x58')]['push']({'name':_0x4864cd['name'],'contentType':_0x4864cd[_0xfe3c('0x23')],'data':fs[_0xfe3c('0x6b')](_0x226ad2)});}}}emlformat['build'](_0x489edb,function(_0x51dbb7,_0x39084c){if(_0x51dbb7)return _0x5f2f49(_0x51dbb7);fs[_0xfe3c('0x6c')](path[_0xfe3c('0x53')](_0x5b72b4,util[_0xfe3c('0x59')]('message%d.eml',_0x4d9ad9)),_0x39084c);return _0x2311ad(_0x39084c);});});})['then'](function(){return new BPromise(function(_0xe9ffc7,_0x51c101){zipdir(_0x5b72b4,{'saveTo':_0x78df6f},function(_0x402de6,_0x33daf1){if(_0x402de6)return _0x51c101(_0x402de6);return _0xe9ffc7(_0x33daf1);});})[_0xfe3c('0x1b')](function(){return new BPromise(function(_0x264b99,_0x4b838a){rimraf(_0x5b72b4,function(_0xbb5568){if(_0xbb5568)_0x4b838a(_0xbb5568);return _0x264b99();});});})['then'](function(){return _0x5f33c4[_0xfe3c('0x50')](_0x78df6f,_0x31db56,function(_0xb6c893){if(!_0xb6c893)fs['unlinkSync'](_0x78df6f);});});});}else{return _0x5f33c4[_0xfe3c('0x11')](0xc8);}})['catch'](handleError(_0x5f33c4,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 094ce8e..7372d79 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 _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 +var _0xb270=['length','emit','catch','hook','exports','events','../../mysqldb','MailInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xb270,0xb9));var _0x0b27=function(_0x2755fb,_0x5970f1){_0x2755fb=_0x2755fb-0x0;var _0x293f12=_0xb270[_0x2755fb];return _0x293f12;};'use strict';var EventEmitter=require(_0x0b27('0x0'));var MailInteraction=require(_0x0b27('0x1'))['db'][_0x0b27('0x2')];var MailMessage=require(_0x0b27('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x0b27('0x3')](0x0);var events={'afterCreate':_0x0b27('0x4'),'afterUpdate':_0x0b27('0x5'),'afterDestroy':_0x0b27('0x6')};function emitEvent(_0x4747b7){return function(_0x5e4056,_0x5da13b,_0x2e5ce3){_0x5e4056[_0x0b27('0x7')]({'attributes':['id'],'raw':!![]})[_0x0b27('0x8')](function(_0xfe3fd9){_0x5e4056[_0x0b27('0x9')]('Users',_0xfe3fd9[_0x0b27('0xa')](function(_0x4dc6b2){return{'id':_0x4dc6b2['id']};}));return MailMessage[_0x0b27('0xb')]({'where':{'MailInteractionId':_0x5e4056['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x28e70b){_0x5e4056[_0x0b27('0x9')](_0x0b27('0xc'),_0x28e70b[_0x0b27('0xd')]);MailInteractionEvents['emit'](_0x4747b7+':'+_0x5e4056['id'],_0x5e4056);MailInteractionEvents[_0x0b27('0xe')](_0x4747b7,_0x5e4056);_0x2e5ce3(null);})[_0x0b27('0xf')](_0x2e5ce3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x0b27('0x10')](e,emitEvent(event));}}module[_0x0b27('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 590ff86..7d244e4 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 _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 +var _0x14a8=['define','MailInteraction','mail_interactions','fti_mail_interactions','subject','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','changed','substatus','closedAt','format','models','get','MailMessage','update','then','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./mailInteraction.attributes','exports'];(function(_0x51113f,_0x5f056c){var _0x205716=function(_0x3c07a8){while(--_0x3c07a8){_0x51113f['push'](_0x51113f['shift']());}};_0x205716(++_0x5f056c);}(_0x14a8,0x162));var _0x814a=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x14a8[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x814a('0x0'));var util=require(_0x814a('0x1'));var logger=require(_0x814a('0x2'))(_0x814a('0x3'));var moment=require(_0x814a('0x4'));var BPromise=require(_0x814a('0x5'));var rp=require(_0x814a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x814a('0x7'));var config=require('../../config/environment');var attributes=require(_0x814a('0x8'));module[_0x814a('0x9')]=function(_0x31978a,_0x1f907d){return _0x31978a[_0x814a('0xa')](_0x814a('0xb'),attributes,{'tableName':_0x814a('0xc'),'paranoid':![],'indexes':[{'name':_0x814a('0xd'),'fields':[_0x814a('0xe'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5e8195,_0x4baaef,_0x3f4816){if(_0x5e8195['substatus']){_0x5e8195[_0x814a('0xf')]=moment()['format'](_0x814a('0x10'));}if(_0x5e8195[_0x814a('0x11')]){_0x5e8195['closedAt']=moment()['format'](_0x814a('0x10'));}_0x3f4816(null,_0x4baaef);},'beforeUpdate':function(_0x41d7b8,_0x4cc0da,_0x168723){if(_0x41d7b8[_0x814a('0x12')](_0x814a('0x13'))){_0x41d7b8[_0x814a('0xf')]=_0x41d7b8['substatus']?moment()['format'](_0x814a('0x10')):null;}if(_0x41d7b8[_0x814a('0x12')]('closed')){_0x41d7b8[_0x814a('0x14')]=moment()[_0x814a('0x15')](_0x814a('0x10'));_0x41d7b8[_0x814a('0x13')]=null;_0x41d7b8[_0x814a('0xf')]=null;}_0x168723(null,_0x41d7b8);},'afterUpdate':function(_0x2a9d75,_0x1cabfe,_0x466e1d){var _0x5ac517=_0x31978a[_0x814a('0x16')];var _0x2b4e73=_0x2a9d75[_0x814a('0x17')]({'plain':!![]});if(_0x2b4e73['closed']){return _0x5ac517[_0x814a('0x18')][_0x814a('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x2b4e73['id']}})[_0x814a('0x1a')](function(){_0x466e1d();})['catch'](function(_0x380cbd){_0x466e1d(_0x380cbd);});}else{_0x466e1d();}}},'charset':_0x814a('0x1b'),'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 7d79f2c..fa5f066 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 _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 +var _0xbcba=['stringify','error','message','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','attributes','limit','AddTagsToMailInteraction','where','addTags','ids','omit','AddTags','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x320876,_0x431175){var _0x29c4c2=function(_0x4e941c){while(--_0x4e941c){_0x320876['push'](_0x320876['shift']());}};_0x29c4c2(++_0x431175);}(_0xbcba,0x198));var _0xabcb=function(_0x589584,_0x9c4c6d){_0x589584=_0x589584-0x0;var _0x421662=_0xbcba[_0x589584];return _0x421662;};'use strict';var _=require(_0xabcb('0x0'));var util=require(_0xabcb('0x1'));var moment=require(_0xabcb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xabcb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xabcb('0x4'));var logger=require(_0xabcb('0x5'))(_0xabcb('0x6'));var config=require(_0xabcb('0x7'));var jayson=require(_0xabcb('0x8'));var client=jayson[_0xabcb('0x9')]['http']({'port':0x232a});config['redis']=_[_0xabcb('0xa')](config[_0xabcb('0xb')],{'host':_0xabcb('0xc'),'port':0x18eb});var socket=require(_0xabcb('0xd'))(new Redis(config['redis']));require('./mailInteraction.socket')[_0xabcb('0xe')](socket);function respondWithRpcPromise(_0x3a7bcd,_0x404d12,_0x4eeb83){return new BPromise(function(_0x726d3,_0x5cd732){return client[_0xabcb('0xf')](_0x3a7bcd,_0x4eeb83)[_0xabcb('0x10')](function(_0x409a35){logger[_0xabcb('0x11')](_0xabcb('0x12'),_0x404d12,_0xabcb('0x13'));logger[_0xabcb('0x14')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x404d12,'request\x20sent',JSON[_0xabcb('0x15')](_0x409a35));if(_0x409a35[_0xabcb('0x16')]){if(_0x409a35['error']['code']===0x1f4){logger['error'](_0xabcb('0x12'),_0x404d12,_0x409a35[_0xabcb('0x16')][_0xabcb('0x17')]);return _0x5cd732(_0x409a35['error'][_0xabcb('0x17')]);}logger[_0xabcb('0x16')](_0xabcb('0x12'),_0x404d12,_0x409a35[_0xabcb('0x16')][_0xabcb('0x17')]);return _0x726d3(_0x409a35[_0xabcb('0x16')][_0xabcb('0x17')]);}else{logger[_0xabcb('0x11')](_0xabcb('0x12'),_0x404d12,_0xabcb('0x13'));_0x726d3(_0x409a35['result'][_0xabcb('0x17')]);}})[_0xabcb('0x18')](function(_0xbd0db6){logger[_0xabcb('0x16')](_0xabcb('0x12'),_0x404d12,_0xbd0db6);_0x5cd732(_0xbd0db6);});});}exports[_0xabcb('0x19')]=function(_0x57a06c){var _0x19bcca=this;return new Promise(function(_0x4cfaf8,_0x5b6d3f){return db[_0xabcb('0x1a')][_0xabcb('0x1b')](_0x57a06c[_0xabcb('0x1c')],{'raw':_0x57a06c[_0xabcb('0x1d')]?_0x57a06c[_0xabcb('0x1d')][_0xabcb('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57a06c[_0xabcb('0x1d')]?_0x57a06c[_0xabcb('0x1d')]['where']||null:null,'attributes':_0x57a06c[_0xabcb('0x1d')]?_0x57a06c['options'][_0xabcb('0x1f')]||null:null,'limit':_0x57a06c['options']?_0x57a06c[_0xabcb('0x1d')][_0xabcb('0x20')]||null:null})['then'](function(_0x402ff3){logger['info']('UpdateMailInteraction',_0x57a06c);logger[_0xabcb('0x14')](_0xabcb('0x19'),_0x57a06c,JSON['stringify'](_0x402ff3));_0x4cfaf8(_0x402ff3);})[_0xabcb('0x18')](function(_0x2a50d7){logger[_0xabcb('0x16')]('UpdateMailInteraction',_0x2a50d7[_0xabcb('0x17')],_0x57a06c);_0x5b6d3f(_0x19bcca[_0xabcb('0x16')](0x1f4,_0x2a50d7[_0xabcb('0x17')]));});});};exports[_0xabcb('0x21')]=function(_0x1e4568){return new Promise(function(_0x432aa3,_0x4a2a92){return db[_0xabcb('0x1a')]['find']({'where':_0x1e4568['options']?_0x1e4568['options'][_0xabcb('0x22')]||null:null})[_0xabcb('0x10')](function(_0x2c25f2){if(_0x2c25f2){return _0x2c25f2[_0xabcb('0x23')](_0x1e4568[_0xabcb('0x1c')][_0xabcb('0x24')],_[_0xabcb('0x25')](_0x1e4568[_0xabcb('0x1c')],[_0xabcb('0x24'),'id'])||{});}})['spread'](function(_0x57ff5e){logger['info'](_0xabcb('0x26'),_0x1e4568);logger[_0xabcb('0x14')](_0xabcb('0x26'),_0x1e4568,JSON[_0xabcb('0x15')](_0x57ff5e));_0x432aa3(_0x57ff5e);})[_0xabcb('0x18')](function(_0x2e12a0){logger['error'](_0xabcb('0x26'),_0x2e12a0['message'],_0x1e4568);_0x4a2a92(_this[_0xabcb('0x16')](0x1f4,_0x2e12a0[_0xabcb('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 442bd34..ea51661 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 _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 +var _0x0412=['emit','removeListener','register','mailInteraction:','update'];(function(_0x2c18e7,_0x23ef98){var _0x46d642=function(_0x2a84cf){while(--_0x2a84cf){_0x2c18e7['push'](_0x2c18e7['shift']());}};_0x46d642(++_0x23ef98);}(_0x0412,0x194));var _0x2041=function(_0x5fd03,_0x135420){_0x5fd03=_0x5fd03-0x0;var _0x10d3fd=_0x0412[_0x5fd03];return _0x10d3fd;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save','remove',_0x2041('0x0')];function createListener(_0x5ae2c7,_0x740cc5){return function(_0x360341){_0x740cc5[_0x2041('0x1')](_0x5ae2c7,_0x360341);};}function removeListener(_0x293237,_0x17cbd0){return function(){MailInteractionEvents[_0x2041('0x2')](_0x293237,_0x17cbd0);};}exports[_0x2041('0x3')]=function(_0x496747){for(var _0x5238b0=0x0,_0x4411ea=events['length'];_0x5238b0<_0x4411ea;_0x5238b0++){var _0x42330d=events[_0x5238b0];var _0x57e21d=createListener(_0x2041('0x4')+_0x42330d,_0x496747);MailInteractionEvents['on'](_0x42330d,_0x57e21d);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 5961e67..3a6c3c1 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 _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 +var _0x38dc=['/describe','/:id','show','/:id/download','download','post','tracked','mailmessage:create','put','/:id/accept','accept','/:id/reject','reject','destroy','exports','path','connect-timeout','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x38dc,0x117));var _0xc38d=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x38dc[_0x4b369d];return _0x571a98;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc38d('0x0'));var timeout=require(_0xc38d('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc38d('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xc38d('0x3'));var controller=require('./mailMessage.controller');router[_0xc38d('0x4')]('/',auth[_0xc38d('0x5')](),controller[_0xc38d('0x6')]);router[_0xc38d('0x4')](_0xc38d('0x7'),auth[_0xc38d('0x5')](),controller['describe']);router[_0xc38d('0x4')](_0xc38d('0x8'),auth[_0xc38d('0x5')](),controller[_0xc38d('0x9')]);router[_0xc38d('0x4')](_0xc38d('0xa'),auth[_0xc38d('0x5')](),controller[_0xc38d('0xb')]);router[_0xc38d('0xc')]('/',auth['isAuthenticated'](),interaction[_0xc38d('0xd')]('mail',_0xc38d('0xe')),controller['create']);router[_0xc38d('0xf')](_0xc38d('0x8'),auth['isAuthenticated'](),controller['update']);router['put'](_0xc38d('0x10'),auth[_0xc38d('0x5')](),controller[_0xc38d('0x11')]);router[_0xc38d('0xf')](_0xc38d('0x12'),auth[_0xc38d('0x5')](),controller[_0xc38d('0x13')]);router['delete'](_0xc38d('0x8'),auth['isAuthenticated'](),controller[_0xc38d('0x14')]);module[_0xc38d('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index b1e4353..acd1c1d 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 _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 +var _0xe949=['long','medium','ENUM','out','STRING','DATE','INTEGER','BOOLEAN','Email','Chat','sequelize','lodash','exports','TEXT'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0xe949,0x1a0));var _0x9e94=function(_0x5ddaf6,_0x3886a6){_0x5ddaf6=_0x5ddaf6-0x0;var _0x32e592=_0xe949[_0x5ddaf6];return _0x32e592;};'use strict';var Sequelize=require(_0x9e94('0x0'));var _=require(_0x9e94('0x1'));module[_0x9e94('0x2')]={'body':{'type':Sequelize[_0x9e94('0x3')](_0x9e94('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x9e94('0x3')](_0x9e94('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9e94('0x6')]('in',_0x9e94('0x7')),'defaultValue':_0x9e94('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9e94('0x8')](0x1fe)},'from':{'type':Sequelize[_0x9e94('0x8')]},'to':{'type':Sequelize[_0x9e94('0x3')](_0x9e94('0x4'))},'cc':{'type':Sequelize['TEXT'](_0x9e94('0x4'))},'bcc':{'type':Sequelize[_0x9e94('0x3')](_0x9e94('0x4'))},'subject':{'type':Sequelize[_0x9e94('0x3')]},'sentAt':{'type':Sequelize[_0x9e94('0x9')]},'attach':{'type':Sequelize[_0x9e94('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x9e94('0xb')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x9e94('0x3')](_0x9e94('0x4'))},'originCc':{'type':Sequelize[_0x9e94('0x3')](_0x9e94('0x4'))},'originChannel':{'type':Sequelize[_0x9e94('0x6')](_0x9e94('0xc'),_0x9e94('0xd')),'defaultValue':_0x9e94('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 4e6c0e9..20c64b5 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 _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 +var _0xe70a=['agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','manual','interface','SIP/%s','channel','motionChannel','event','accept','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','internal','rejectmessage','download','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','push','writeFileSync','unlinkSync','eml-format','bluebird','util','path','lodash','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','html-entities','./mailMessage.socket','register','client','http','request','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailMessage,\x20%s,\x20%s','info','result','catch','status','json','offset','undefined','count','limit','Content-Range','then','destroy','end','sendStatus','name','index','map','MailMessage','rawAttributes','fieldName','type','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','model','length','find','body','describe','create','direction','out','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','DESC','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','SendMail','sendMail','update','YYYY-MM-DD\x20HH:mm:ss','mail','readAt','format','UserId','user'];(function(_0x4f0f36,_0x47775c){var _0x1078b0=function(_0x294c48){while(--_0x294c48){_0x4f0f36['push'](_0x4f0f36['shift']());}};_0x1078b0(++_0x47775c);}(_0xe70a,0x16d));var _0xae70=function(_0xb5f90d,_0x4392d3){_0xb5f90d=_0xb5f90d-0x0;var _0x14298a=_0xe70a[_0xb5f90d];return _0x14298a;};'use strict';var emlformat=require(_0xae70('0x0'));var moment=require('moment');var BPromise=require(_0xae70('0x1'));var util=require(_0xae70('0x2'));var path=require(_0xae70('0x3'));var fs=require('fs');var _=require(_0xae70('0x4'));var Redis=require('ioredis');var htmlToText=require('html-to-text');var qs=require(_0xae70('0x5'));var logger=require(_0xae70('0x6'))(_0xae70('0x7'));var interaction_log=require(_0xae70('0x6'))(_0xae70('0x8'));var config=require(_0xae70('0x9'));var db=require(_0xae70('0xa'))['db'];config[_0xae70('0xb')]=_[_0xae70('0xc')](config[_0xae70('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xae70('0xd'))(new Redis(config['redis']));var htmlEntities=require(_0xae70('0xe'));require(_0xae70('0xf'))[_0xae70('0x10')](socket);var jayson=require('jayson/promise');var client=jayson[_0xae70('0x11')][_0xae70('0x12')]({'port':0x232c});var client9003=jayson[_0xae70('0x11')][_0xae70('0x12')]({'port':0x232b});var client9002=jayson[_0xae70('0x11')][_0xae70('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x452e92,_0x295473,_0x27bbdc,_0x414661){return new BPromise(function(_0x18c63b,_0x14cffe){var _0x204e88=_0x414661||client;return _0x204e88[_0xae70('0x13')](_0x452e92,_0x27bbdc)['then'](function(_0x176df7){logger['info']('MailMessage,\x20%s,\x20%s',_0x295473,_0xae70('0x14'));logger[_0xae70('0x15')](_0xae70('0x16'),_0x295473,_0xae70('0x14'),JSON[_0xae70('0x17')](_0x176df7));if(_0x176df7[_0xae70('0x18')]){if(_0x176df7[_0xae70('0x18')][_0xae70('0x19')]===0x1f4){logger[_0xae70('0x18')]('MailMessage,\x20%s,\x20%s',_0x295473,_0x176df7[_0xae70('0x18')][_0xae70('0x1a')]);return _0x14cffe(_0x176df7[_0xae70('0x18')]['message']);}logger[_0xae70('0x18')](_0xae70('0x1b'),_0x295473,_0x176df7['error']['message']);return _0x18c63b(_0x176df7[_0xae70('0x18')][_0xae70('0x1a')]);}else{logger[_0xae70('0x1c')](_0xae70('0x1b'),_0x295473,_0xae70('0x14'));_0x18c63b(_0x176df7[_0xae70('0x1d')]['message']);}})[_0xae70('0x1e')](function(_0x3db8ef){logger[_0xae70('0x18')](_0xae70('0x1b'),_0x295473,_0x3db8ef);_0x14cffe(_0x3db8ef);});});}function respondWithResult(_0x12bc30,_0x33a901){_0x33a901=_0x33a901||0xc8;return function(_0x2c0020){if(_0x2c0020){return _0x12bc30[_0xae70('0x1f')](_0x33a901)[_0xae70('0x20')](_0x2c0020);}};}function respondWithFilteredResult(_0x815814,_0x5c80ef){return function(_0x359456){if(_0x359456){var _0x6c53c2=typeof _0x5c80ef[_0xae70('0x21')]===_0xae70('0x22')&&typeof _0x5c80ef['limit']==='undefined';var _0x87bdb7=_0x359456[_0xae70('0x23')];var _0x58af37=_0x6c53c2?0x0:_0x5c80ef[_0xae70('0x21')];var _0x38f9a4=_0x6c53c2?_0x359456['count']:_0x5c80ef[_0xae70('0x21')]+_0x5c80ef[_0xae70('0x24')];var _0x1cd2e0;if(_0x38f9a4>=_0x87bdb7){_0x38f9a4=_0x87bdb7;_0x1cd2e0=0xc8;}else{_0x1cd2e0=0xce;}_0x815814[_0xae70('0x1f')](_0x1cd2e0);return _0x815814['set'](_0xae70('0x25'),_0x58af37+'-'+_0x38f9a4+'/'+_0x87bdb7)['json'](_0x359456);}return null;};}function saveUpdates(_0xabaa0f){return function(_0x1cf52a){if(_0x1cf52a){return _0x1cf52a['update'](_0xabaa0f)[_0xae70('0x26')](function(_0x228827){return _0x228827;});}return null;};}function removeEntity(_0x4b8229){return function(_0x50d2d7){if(_0x50d2d7){return _0x50d2d7[_0xae70('0x27')]()[_0xae70('0x26')](function(){_0x4b8229[_0xae70('0x1f')](0xcc)[_0xae70('0x28')]();});}};}function handleEntityNotFound(_0x23d61f){return function(_0x3ce7a0){if(!_0x3ce7a0){_0x23d61f[_0xae70('0x29')](0x194);}return _0x3ce7a0;};}function handleError(_0x59997d,_0x518bbf){_0x518bbf=_0x518bbf||0x1f4;return function(_0x2f4b4e){logger[_0xae70('0x18')](_0x2f4b4e['stack']);if(_0x2f4b4e[_0xae70('0x2a')]){delete _0x2f4b4e[_0xae70('0x2a')];}_0x59997d[_0xae70('0x1f')](_0x518bbf)['send'](_0x2f4b4e);};}exports[_0xae70('0x2b')]=function(_0x2bccce,_0x38e20b){var _0xa23b44={},_0x4bf351={},_0x1163c1={'count':0x0,'rows':[]};var _0x4a79db=_[_0xae70('0x2c')](db[_0xae70('0x2d')][_0xae70('0x2e')],function(_0x1025fd){return{'name':_0x1025fd[_0xae70('0x2f')],'type':_0x1025fd[_0xae70('0x30')]['key']};});_0x4bf351['model']=_[_0xae70('0x2c')](_0x4a79db,_0xae70('0x2a'));_0x4bf351[_0xae70('0x31')]=_[_0xae70('0x32')](_0x2bccce[_0xae70('0x31')]);_0x4bf351['filters']=_[_0xae70('0x33')](_0x4bf351['model'],_0x4bf351[_0xae70('0x31')]);_0xa23b44[_0xae70('0x34')]=_['intersection'](_0x4bf351['model'],qs[_0xae70('0x35')](_0x2bccce[_0xae70('0x31')][_0xae70('0x35')]));_0xa23b44[_0xae70('0x34')]=_0xa23b44[_0xae70('0x34')]['length']?_0xa23b44[_0xae70('0x34')]:_0x4bf351['model'];if(!_0x2bccce[_0xae70('0x31')][_0xae70('0x36')](_0xae70('0x37'))){_0xa23b44[_0xae70('0x24')]=qs[_0xae70('0x24')](_0x2bccce['query'][_0xae70('0x24')]);_0xa23b44[_0xae70('0x21')]=qs[_0xae70('0x21')](_0x2bccce[_0xae70('0x31')][_0xae70('0x21')]);}_0xa23b44[_0xae70('0x38')]=qs[_0xae70('0x39')](_0x2bccce[_0xae70('0x31')]['sort']);_0xa23b44[_0xae70('0x3a')]=qs[_0xae70('0x3b')](_[_0xae70('0x3c')](_0x2bccce['query'],_0x4bf351[_0xae70('0x3b')]),_0x4a79db);if(_0x2bccce[_0xae70('0x31')][_0xae70('0x3d')]){_0xa23b44[_0xae70('0x3a')]=_[_0xae70('0x3e')](_0xa23b44['where'],{'$or':_[_0xae70('0x2c')](_0x4a79db,function(_0x59997a){if(_0x59997a[_0xae70('0x30')]!==_0xae70('0x3f')){var _0x2b26f6={};_0x2b26f6[_0x59997a[_0xae70('0x2a')]]={'$like':'%'+_0x2bccce[_0xae70('0x31')][_0xae70('0x3d')]+'%'};return _0x2b26f6;}})});}_0xa23b44=_[_0xae70('0x3e')]({},_0xa23b44,_0x2bccce[_0xae70('0x40')]);var _0x5eef1d={'where':_0xa23b44[_0xae70('0x3a')]};return db[_0xae70('0x2d')][_0xae70('0x23')](_0x5eef1d)[_0xae70('0x26')](function(_0x1f748c){_0x1163c1['count']=_0x1f748c;if(_0x2bccce[_0xae70('0x31')][_0xae70('0x41')]){_0xa23b44[_0xae70('0x42')]=[{'all':!![]}];}return db[_0xae70('0x2d')][_0xae70('0x43')](_0xa23b44);})[_0xae70('0x26')](function(_0x33a3fc){_0x1163c1[_0xae70('0x44')]=_0x33a3fc;return _0x1163c1;})[_0xae70('0x26')](respondWithFilteredResult(_0x38e20b,_0xa23b44))[_0xae70('0x1e')](handleError(_0x38e20b,null));};exports['show']=function(_0x49a907,_0x217c2b){var _0x334b93={'raw':!![],'where':{'id':_0x49a907[_0xae70('0x45')]['id']}},_0x59d086={};_0x59d086[_0xae70('0x46')]=_[_0xae70('0x32')](db['MailMessage'][_0xae70('0x2e')]);_0x59d086[_0xae70('0x31')]=_[_0xae70('0x32')](_0x49a907[_0xae70('0x31')]);_0x59d086[_0xae70('0x3b')]=_[_0xae70('0x33')](_0x59d086['model'],_0x59d086[_0xae70('0x31')]);_0x334b93[_0xae70('0x34')]=_[_0xae70('0x33')](_0x59d086[_0xae70('0x46')],qs[_0xae70('0x35')](_0x49a907[_0xae70('0x31')]['fields']));_0x334b93[_0xae70('0x34')]=_0x334b93[_0xae70('0x34')][_0xae70('0x47')]?_0x334b93['attributes']:_0x59d086['model'];if(_0x49a907[_0xae70('0x31')][_0xae70('0x41')]){_0x334b93['include']=[{'all':!![]}];}_0x334b93=_['merge']({},_0x334b93,_0x49a907[_0xae70('0x40')]);return db[_0xae70('0x2d')][_0xae70('0x48')](_0x334b93)['then'](handleEntityNotFound(_0x217c2b,null))['then'](respondWithResult(_0x217c2b,null))[_0xae70('0x1e')](handleError(_0x217c2b,null));};exports['update']=function(_0x535090,_0x42f3ac){if(_0x535090['body']['id']){delete _0x535090[_0xae70('0x49')]['id'];}return db['MailMessage'][_0xae70('0x48')]({'where':{'id':_0x535090[_0xae70('0x45')]['id']}})[_0xae70('0x26')](handleEntityNotFound(_0x42f3ac,null))[_0xae70('0x26')](saveUpdates(_0x535090['body'],null))[_0xae70('0x26')](respondWithResult(_0x42f3ac,null))[_0xae70('0x1e')](handleError(_0x42f3ac,null));};exports[_0xae70('0x27')]=function(_0x4d6deb,_0x350c31){return db[_0xae70('0x2d')]['find']({'where':{'id':_0x4d6deb[_0xae70('0x45')]['id']}})[_0xae70('0x26')](handleEntityNotFound(_0x350c31,null))[_0xae70('0x26')](removeEntity(_0x350c31,null))['catch'](handleError(_0x350c31,null));};exports[_0xae70('0x4a')]=function(_0x48c088,_0x2dd7bc){return db[_0xae70('0x2d')]['describe']()[_0xae70('0x26')](respondWithResult(_0x2dd7bc,null))['catch'](handleError(_0x2dd7bc,null));};exports[_0xae70('0x4b')]=function(_0x344906,_0x4558a0){return db[_0xae70('0x2d')][_0xae70('0x4b')](_0x344906[_0xae70('0x49')])[_0xae70('0x26')](function(_0xd4b7a5){if(_0xd4b7a5){if(_0xd4b7a5[_0xae70('0x4c')]===_0xae70('0x4d')&&!_0xd4b7a5['secret']){var _0x29b1de,_0x24e86a,_0x548bf3;if(_0x344906[_0xae70('0x49')]['to']){_0x24e86a=_0x344906[_0xae70('0x49')]['to'][_0xae70('0x4e')](',')[0x0];}return db[_0xae70('0x4f')][_0xae70('0x50')]({'where':{'id':_0xd4b7a5[_0xae70('0x51')]},'include':[{'model':db[_0xae70('0x52')],'as':_0xae70('0x53'),'include':[{'model':db[_0xae70('0x54')],'as':_0xae70('0x55'),'where':{'email':_0x24e86a},'limit':0x1,'order':[['updatedAt',_0xae70('0x56')]]}]},{'model':db['MailServerOut'],'as':_0xae70('0x57'),'raw':!![],'include':[{'model':db[_0xae70('0x58')],'as':'CloudProvider','raw':!![]}]}]})[_0xae70('0x26')](function(_0x10ec9d){_0x29b1de=_0x10ec9d;if(!_0x29b1de||!_0x29b1de[_0xae70('0x57')])return;var _0x9f2f0=_0x29b1de[_0xae70('0x59')]();if(_0x344906[_0xae70('0x49')][_0xae70('0x5a')]&&_0x344906[_0xae70('0x49')][_0xae70('0x5a')][_0xae70('0x47')]){for(var _0xe3f0fe=0x0;_0xe3f0fe<_0x344906[_0xae70('0x49')]['attachments'][_0xae70('0x47')];_0xe3f0fe+=0x1){_0x344906[_0xae70('0x49')][_0xae70('0x5a')][_0xe3f0fe]={'filename':_0x344906['body'][_0xae70('0x5a')][_0xe3f0fe]['name'],'path':path[_0xae70('0x5b')](config[_0xae70('0x5c')],_0xae70('0x5d'),_0x344906[_0xae70('0x49')][_0xae70('0x5a')][_0xe3f0fe]['basename'])};}}_0x548bf3={'account':_0x9f2f0,'message':_0x344906[_0xae70('0x49')]};return;})['then'](function(){if(_0x29b1de['List']){if(_0x29b1de[_0xae70('0x53')][_0xae70('0x55')]['length']){return _0x29b1de['List'][_0xae70('0x55')][0x0];}else{return db[_0xae70('0x54')][_0xae70('0x4b')](_[_0xae70('0xc')](_0x344906[_0xae70('0x49')],{'firstName':_0x344906[_0xae70('0x49')]['to'],'email':_0x344906[_0xae70('0x49')]['to'],'phone':_0x344906['body']['to'],'ListId':_0x29b1de['ListId']}));}}else{throw new Error('List\x20not\x20found');}})[_0xae70('0x26')](function(){if(_0x548bf3){return respondWithRpcPromise(_0xae70('0x5e'),_0xae70('0x5f'),_0x548bf3,client9003)[_0xae70('0x26')](function(_0xe0e3c6){return _0xd4b7a5[_0xae70('0x60')]({'read':!![],'messageId':_0xe0e3c6['messageId'],'sentAt':moment()['format'](_0xae70('0x61'))});})[_0xae70('0x1e')](function(_0x4760c1){logger[_0xae70('0x18')]('%s',JSON['stringify'](_0x4760c1));return _0xd4b7a5;});}return _0xd4b7a5;});}return _0xd4b7a5;}})[_0xae70('0x26')](respondWithResult(_0x4558a0,0xc9))[_0xae70('0x1e')](handleError(_0x4558a0,null));};exports['accept']=function(_0x3d18af,_0x1f3334){var _0x981a0d={'agent':{},'channel':_0xae70('0x62')};if(_0x3d18af[_0xae70('0x49')]['id']){delete _0x3d18af[_0xae70('0x49')]['id'];}_0x3d18af[_0xae70('0x49')]['read']=!![];_0x3d18af[_0xae70('0x49')][_0xae70('0x63')]=moment()[_0xae70('0x64')](_0xae70('0x61'));_0x3d18af[_0xae70('0x49')][_0xae70('0x65')]=_0x3d18af[_0xae70('0x49')][_0xae70('0x65')]||_0x3d18af[_0xae70('0x66')]['id'];_0x981a0d[_0xae70('0x67')]['id']=_0x3d18af[_0xae70('0x49')][_0xae70('0x65')];return db['MailMessage']['find']({'where':{'id':_0x3d18af[_0xae70('0x45')]['id'],'UserId':null}})[_0xae70('0x26')](handleEntityNotFound(_0x1f3334,null))[_0xae70('0x26')](saveUpdates(_0x3d18af[_0xae70('0x49')],null))['then'](function(_0xf38801){if(_0xf38801){_0x981a0d[_0xae70('0x1a')]=_0xf38801[_0xae70('0x68')]({'plain':!![]});return db[_0xae70('0x69')][_0xae70('0x48')]({'where':{'id':_0xf38801[_0xae70('0x6a')]}});}return null;})[_0xae70('0x26')](handleEntityNotFound(_0x1f3334,null))[_0xae70('0x26')](function(_0x2803ad){if(_0x2803ad){return _0x2803ad['update']({'UserId':_0x3d18af[_0xae70('0x49')][_0xae70('0x65')],'read1stAt':_[_0xae70('0x6b')](_0x2803ad[_0xae70('0x6c')])?moment()['format'](_0xae70('0x61')):undefined});}return null;})['then'](function(_0x53fd5f){if(_0x53fd5f){_0x981a0d[_0xae70('0x6d')]=_0x53fd5f[_0xae70('0x68')]({'plain':!![]});interaction_log[_0xae70('0x1c')](_0xae70('0x6e'),_0x3d18af[_0xae70('0x66')]['id'],_0x3d18af[_0xae70('0x66')][_0xae70('0x2a')],_0x3d18af[_0xae70('0x66')][_0xae70('0x6f')],_0x981a0d['interaction']['id'],_0x3d18af['body']?JSON[_0xae70('0x17')](_0x3d18af['body']):'null');return respondWithRpcPromise(_0xae70('0x70'),'acceptMessage',_0x981a0d);}return null;})[_0xae70('0x26')](function(_0x5b9d77){var _0x10b914=_0xae70('0x71')+_0x5b9d77[_0xae70('0x1a')][_0xae70('0x72')];return db[_0xae70('0x73')][_0xae70('0x31')](_0x10b914,{'type':db[_0xae70('0x74')][_0xae70('0x75')][_0xae70('0x76')],'raw':!![]})[_0xae70('0x26')](function(_0x21a0b9){return _0x21a0b9;});})[_0xae70('0x26')](function(_0x407bcf){if(_0x407bcf){_0x981a0d[_0xae70('0x1a')][_0xae70('0x77')]=_0x407bcf[0x0];if(!_0x3d18af['body'][_0xae70('0x65')])return;return db[_0xae70('0x78')][_0xae70('0x48')]({'where':{'id':_0x3d18af[_0xae70('0x49')][_0xae70('0x65')],'role':_0xae70('0x67')},'attributes':['id',_0xae70('0x2a'),'fullname',_0xae70('0x79'),'internal'],'raw':!![]});}return null;})[_0xae70('0x26')](function(_0x558fab){if(!_0x558fab)return null;_0x981a0d['message'][_0xae70('0x67')]=_0x558fab;return _0x981a0d;})['then'](function(_0x4abfd2){if(_0x4abfd2){if(_0x3d18af['body'][_0xae70('0x7a')]){_0x981a0d[_0xae70('0x1a')][_0xae70('0x7b')]=util[_0xae70('0x64')](_0xae70('0x7c'),_0x3d18af[_0xae70('0x66')]['name']);_0x981a0d['message'][_0xae70('0x7d')]=_0x981a0d[_0xae70('0x7d')];_0x981a0d['message'][_0xae70('0x7e')]=_0x981a0d[_0xae70('0x7d')];_0x981a0d[_0xae70('0x1a')][_0xae70('0x7f')]=_0xae70('0x80');_0x981a0d[_0xae70('0x1a')][_0xae70('0x49')]=htmlToText[_0xae70('0x81')](_0x981a0d[_0xae70('0x1a')]['body']);return respondWithRpcPromise(_0xae70('0x82'),_0xae70('0x82'),{'event':_0xae70('0x83'),'message':_0x981a0d[_0xae70('0x1a')]},client9002)[_0xae70('0x26')](function(){return _0x981a0d;});}return _0x981a0d;}return null;})[_0xae70('0x26')](respondWithResult(_0x1f3334,null))[_0xae70('0x1e')](handleError(_0x1f3334,null));};exports[_0xae70('0x84')]=function(_0x42a53d,_0x289e7a){var _0x21d47f={'agent':{},'channel':'mail'};if(_0x42a53d['body']['id']){delete _0x42a53d[_0xae70('0x49')]['id'];}_0x42a53d[_0xae70('0x49')]['UserId']=_0x42a53d[_0xae70('0x49')][_0xae70('0x65')]||_0x42a53d[_0xae70('0x66')]['id'];_0x21d47f['agent']['id']=_0x42a53d[_0xae70('0x49')]['UserId'];return db['MailMessage'][_0xae70('0x48')]({'where':{'id':_0x42a53d['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x289e7a,null))['then'](function(_0x2ad1f8){if(_0x2ad1f8){_0x21d47f['message']=_0x2ad1f8[_0xae70('0x68')]({'plain':!![]});return db[_0xae70('0x69')][_0xae70('0x48')]({'where':{'id':_0x2ad1f8[_0xae70('0x6a')]}});}return null;})[_0xae70('0x26')](handleEntityNotFound(_0x289e7a,null))[_0xae70('0x26')](function(_0x321503){if(_0x321503){_0x21d47f[_0xae70('0x6d')]=_0x321503[_0xae70('0x68')]({'plain':!![]});interaction_log[_0xae70('0x1c')](_0xae70('0x85'),_0x42a53d[_0xae70('0x66')]['id'],_0x42a53d['user'][_0xae70('0x2a')],_0x42a53d[_0xae70('0x66')][_0xae70('0x6f')],_0x21d47f[_0xae70('0x6d')]['id'],_0x42a53d[_0xae70('0x49')]?JSON['stringify'](_0x42a53d[_0xae70('0x49')]):_0xae70('0x86'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x21d47f);}return null;})[_0xae70('0x26')](function(_0x4487df){var _0x15ad7c=_0xae70('0x71')+_0x4487df[_0xae70('0x1a')][_0xae70('0x72')];return db['sequelize'][_0xae70('0x31')](_0x15ad7c,{'type':db[_0xae70('0x74')][_0xae70('0x75')]['SELECT'],'raw':!![]})[_0xae70('0x26')](function(_0x22de5c){return _0x22de5c;});})['then'](function(_0x5ea18e){if(_0x5ea18e){_0x21d47f[_0xae70('0x1a')][_0xae70('0x77')]=_0x5ea18e[0x0];if(!_0x42a53d[_0xae70('0x49')]['UserId'])return;return db[_0xae70('0x78')][_0xae70('0x48')]({'where':{'id':_0x42a53d[_0xae70('0x49')][_0xae70('0x65')],'role':'agent'},'attributes':['id',_0xae70('0x2a'),'fullname','email',_0xae70('0x87')],'raw':!![]});}return null;})[_0xae70('0x26')](function(_0x13c49c){if(!_0x13c49c)return null;_0x21d47f['message'][_0xae70('0x67')]=_0x13c49c;return _0x21d47f;})[_0xae70('0x26')](function(_0x89767e){if(_0x89767e){_0x89767e[_0xae70('0x1a')][_0xae70('0x7b')]=util[_0xae70('0x64')](_0xae70('0x7c'),_0x42a53d[_0xae70('0x66')][_0xae70('0x2a')]);_0x89767e[_0xae70('0x1a')][_0xae70('0x7d')]=_0x21d47f[_0xae70('0x7d')];_0x89767e[_0xae70('0x1a')]['motionChannel']=_0x21d47f['channel'];_0x89767e[_0xae70('0x1a')][_0xae70('0x7f')]='reject';_0x89767e['message']['body']=htmlToText[_0xae70('0x81')](_0x21d47f[_0xae70('0x1a')][_0xae70('0x49')]);respondWithRpcPromise(_0xae70('0x82'),'EventManager',{'event':_0xae70('0x88'),'message':_0x89767e[_0xae70('0x1a')]},client9002);return _0x21d47f;}return null;})[_0xae70('0x26')](respondWithResult(_0x289e7a,null))[_0xae70('0x1e')](handleError(_0x289e7a,null));};exports[_0xae70('0x89')]=function(_0xe8bbfe,_0x124b26){var _0x496f39=moment()['unix']()[_0xae70('0x8a')]();var _0x315afe=path[_0xae70('0x5b')](config[_0xae70('0x5c')],_0xae70('0x8b'),_0xae70('0x8c'),_0xae70('0x8d'));var _0x253716=path['join'](config['root'],'server',_0xae70('0x8c'),'attachments');var _0x595c35=util[_0xae70('0x64')](_0xae70('0x8e'),_0x496f39);return db[_0xae70('0x2d')][_0xae70('0x48')]({'where':{'id':_0xe8bbfe['params']['id']},'attributes':['id',_0xae70('0x49'),_0xae70('0x8f'),'to','cc',_0xae70('0x90'),_0xae70('0x91'),_0xae70('0x92')],'include':_0xe8bbfe[_0xae70('0x31')][_0xae70('0x5a')]?[{'model':db[_0xae70('0x93')],'as':_0xae70('0x94')}]:undefined})['then'](handleEntityNotFound(_0x124b26,null))[_0xae70('0x26')](function(_0x18b897){if(_0x18b897){var _0x44cbd1=_0x18b897;var _0x2bdac1={'from':_0x44cbd1[_0xae70('0x8f')],'to':_0x44cbd1['to'],'subject':_0x44cbd1[_0xae70('0x91')],'html':htmlEntities['decode'](_0x44cbd1[_0xae70('0x49')]),'headers':{'Date':moment(_0x44cbd1[_0xae70('0x92')])[_0xae70('0x64')](_0xae70('0x95'))},'attachments':[]};if(_0x18b897['cc']){_0x2bdac1[_0xae70('0x96')]['Cc']=_0x18b897['cc'];}if(_0x18b897[_0xae70('0x90')]){_0x2bdac1[_0xae70('0x96')]['Bcc']=_0x18b897['bcc'];}return new BPromise(function(_0x251eed,_0x29a0ef){if(_0x18b897[_0xae70('0x94')]){for(var _0x1b389=0x0;_0x1b389<_0x18b897['Attachments'][_0xae70('0x47')];_0x1b389++){var _0x54347e=_0x18b897[_0xae70('0x94')][_0x1b389];var _0x3f26e6=path[_0xae70('0x5b')](_0x253716,_0x54347e[_0xae70('0x97')]);if(fs[_0xae70('0x98')](_0x3f26e6)){_0x2bdac1[_0xae70('0x5a')][_0xae70('0x99')]({'name':_0x54347e['name'],'contentType':_0x54347e['type'],'data':fs['readFileSync'](_0x3f26e6)});}}}emlformat['build'](_0x2bdac1,function(_0xc6297b,_0x155854){if(_0xc6297b)return _0x29a0ef(_0xc6297b);fs[_0xae70('0x9a')](path[_0xae70('0x5b')](_0x315afe,_0x595c35),_0x155854);return _0x251eed(_0x155854);});});}})[_0xae70('0x26')](function(_0x143d03){if(_0x143d03){return _0x124b26[_0xae70('0x89')](path[_0xae70('0x5b')](_0x315afe,_0x595c35),_0x595c35,function(_0x25e29e){if(!_0x25e29e)fs[_0xae70('0x9b')](path[_0xae70('0x5b')](_0x315afe,_0x595c35));});}})['catch'](handleError(_0x124b26,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 437a4a4..b9dcfb1 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 _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 +var _0x6a22=['hasOwnProperty','hook','exports','events','MailMessage','remove','emit'];(function(_0x12d951,_0x249808){var _0x44de17=function(_0x182fd9){while(--_0x182fd9){_0x12d951['push'](_0x12d951['shift']());}};_0x44de17(++_0x249808);}(_0x6a22,0xf8));var _0x26a2=function(_0x1b95a1,_0x529852){_0x1b95a1=_0x1b95a1-0x0;var _0x57aef1=_0x6a22[_0x1b95a1];return _0x57aef1;};'use strict';var EventEmitter=require(_0x26a2('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x26a2('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x26a2('0x2')};function emitEvent(_0x43b844){return function(_0x471020,_0x3a89de,_0x4467d3){MailMessageEvents[_0x26a2('0x3')](_0x43b844+':'+_0x471020['id'],_0x471020);MailMessageEvents['emit'](_0x43b844,_0x471020);_0x4467d3(null);};}for(var e in events){if(events[_0x26a2('0x4')](e)){var event=events[e];MailMessage[_0x26a2('0x5')](e,emitEvent(event));}}module[_0x26a2('0x6')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index ef93c15..d07727f 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 _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 +var _0x49b2=['../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','plainBody','subject','FULLTEXT','body','models','get','direction','toLowerCase','MailInteraction','findOne','MailInteractionId','then','createdAt','catch','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x1bfc33,_0x48c342){var _0x2422b6=function(_0x3c676e){while(--_0x3c676e){_0x1bfc33['push'](_0x1bfc33['shift']());}};_0x2422b6(++_0x48c342);}(_0x49b2,0xbe));var _0x249b=function(_0x38be4c,_0x59d584){_0x38be4c=_0x38be4c-0x0;var _0x3b82ee=_0x49b2[_0x38be4c];return _0x3b82ee;};'use strict';var _=require(_0x249b('0x0'));var util=require(_0x249b('0x1'));var logger=require(_0x249b('0x2'))(_0x249b('0x3'));var moment=require(_0x249b('0x4'));var BPromise=require('bluebird');var rp=require(_0x249b('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x249b('0x6'));var attributes=require(_0x249b('0x7'));module[_0x249b('0x8')]=function(_0x2c150d,_0x21e1a8){return _0x2c150d[_0x249b('0x9')](_0x249b('0xa'),attributes,{'tableName':_0x249b('0xb'),'paranoid':![],'indexes':[{'name':_0x249b('0xc'),'fields':[_0x249b('0xc')]},{'name':'fti_mail_messages','fields':[_0x249b('0xd'),_0x249b('0xe')],'type':_0x249b('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4a7431,_0x15fe67,_0x5035f2){if(_0x4a7431[_0x249b('0x10')]){_0x4a7431['plainBody']=htmlToText['fromString'](_0x4a7431[_0x249b('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5035f2(null,_0x15fe67);},'afterCreate':function(_0x48d968,_0x1d0f3d,_0x33b0f2){var _0x494435=_0x2c150d[_0x249b('0x11')];var _0x5b5d59=_0x48d968[_0x249b('0x12')]({'plain':!![]});if(_0x5b5d59[_0x249b('0x13')][_0x249b('0x14')]()==='in'||_0x5b5d59['direction'][_0x249b('0x14')]()==='out'&&!_0x5b5d59['secret']&&!_['isNil'](_0x5b5d59['UserId'])){_0x494435[_0x249b('0x15')][_0x249b('0x16')]({'where':{'id':_0x5b5d59[_0x249b('0x17')]}})[_0x249b('0x18')](function(_0x32f642){if(_0x32f642){_0x32f642['update']({'lastMsgAt':_0x5b5d59[_0x249b('0x19')],'lastMsgDirection':_0x5b5d59[_0x249b('0x13')][_0x249b('0x14')]()});}})[_0x249b('0x1a')](function(_0x4dce2b){console['error'](_0x4dce2b);});}_0x33b0f2();}},'charset':_0x249b('0x1b'),'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 dccdcf3..99dc9b4 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 _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 +var _0xd943=['CreateMailMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','localhost','./mailMessage.socket','register','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','MailMessage','options','raw'];(function(_0x2013b9,_0x5a1e8a){var _0x369db8=function(_0x5d4ced){while(--_0x5d4ced){_0x2013b9['push'](_0x2013b9['shift']());}};_0x369db8(++_0x5a1e8a);}(_0xd943,0x15d));var _0x3d94=function(_0x2002ac,_0x3c7111){_0x2002ac=_0x2002ac-0x0;var _0x4a1eb2=_0xd943[_0x2002ac];return _0x4a1eb2;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x3d94('0xa')],{'host':_0x3d94('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3d94('0xc'))[_0x3d94('0xd')](socket);function respondWithRpcPromise(_0x1cc58c,_0x5908a7,_0x182066){return new BPromise(function(_0x4ac968,_0x39e2fa){return client[_0x3d94('0xe')](_0x1cc58c,_0x182066)['then'](function(_0x1897de){logger[_0x3d94('0xf')](_0x3d94('0x10'),_0x5908a7,_0x3d94('0x11'));logger[_0x3d94('0x12')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x5908a7,_0x3d94('0x11'),JSON[_0x3d94('0x13')](_0x1897de));if(_0x1897de[_0x3d94('0x14')]){if(_0x1897de['error'][_0x3d94('0x15')]===0x1f4){logger[_0x3d94('0x14')](_0x3d94('0x10'),_0x5908a7,_0x1897de['error'][_0x3d94('0x16')]);return _0x39e2fa(_0x1897de[_0x3d94('0x14')][_0x3d94('0x16')]);}logger[_0x3d94('0x14')](_0x3d94('0x10'),_0x5908a7,_0x1897de[_0x3d94('0x14')][_0x3d94('0x16')]);return _0x4ac968(_0x1897de[_0x3d94('0x14')]['message']);}else{logger[_0x3d94('0xf')](_0x3d94('0x10'),_0x5908a7,_0x3d94('0x11'));_0x4ac968(_0x1897de[_0x3d94('0x17')][_0x3d94('0x16')]);}})[_0x3d94('0x18')](function(_0xef8b3){logger['error'](_0x3d94('0x10'),_0x5908a7,_0xef8b3);_0x39e2fa(_0xef8b3);});});}exports['CreateMailMessage']=function(_0x28bead){var _0x193934=this;return new Promise(function(_0x16a6d0,_0x1e9ec2){return db[_0x3d94('0x19')]['create'](_0x28bead['body'],{'raw':_0x28bead[_0x3d94('0x1a')]?_0x28bead[_0x3d94('0x1a')][_0x3d94('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x30af25){logger[_0x3d94('0xf')](_0x3d94('0x1c'),_0x28bead);logger[_0x3d94('0x12')](_0x3d94('0x1c'),_0x28bead,JSON[_0x3d94('0x13')](_0x30af25));_0x16a6d0(_0x30af25);})[_0x3d94('0x18')](function(_0x27f978){logger[_0x3d94('0x14')](_0x3d94('0x1c'),_0x27f978[_0x3d94('0x16')],_0x28bead);_0x1e9ec2(_0x193934[_0x3d94('0x14')](0x1f4,_0x27f978[_0x3d94('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index b4d2db2..1b73daa 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 _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 +var _0xaf93=['length','./mailMessage.events','save','emit','removeListener','register'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0xaf93,0x151));var _0x3af9=function(_0x323116,_0x5ced14){_0x323116=_0x323116-0x0;var _0x14b3ea=_0xaf93[_0x323116];return _0x14b3ea;};'use strict';var MailMessageEvents=require(_0x3af9('0x0'));var events=[_0x3af9('0x1'),'remove','update'];function createListener(_0x13f5d7,_0x3e84b6){return function(_0x528aa0){_0x3e84b6[_0x3af9('0x2')](_0x13f5d7,_0x528aa0);};}function removeListener(_0x44ae6e,_0x5add3){return function(){MailMessageEvents[_0x3af9('0x3')](_0x44ae6e,_0x5add3);};}exports[_0x3af9('0x4')]=function(_0x1ad446){for(var _0x333abb=0x0,_0x535583=events[_0x3af9('0x5')];_0x333abb<_0x535583;_0x333abb++){var _0x56e4c2=events[_0x333abb];var _0x133672=createListener('mailMessage:'+_0x56e4c2,_0x1ad446);MailMessageEvents['on'](_0x56e4c2,_0x133672);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index ffc84f3..358efce 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 _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 +var _0xdbd7=['post','create','/:id/teams','addTeams','addAgents','update','delete','/:id','destroy','removeTeams','removeAgents','multer','util','path','express','Router','fs-extra','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','show','getMembers','getTeams','/:id/users','getAgents'];(function(_0x381170,_0x525e60){var _0x366e37=function(_0xe696b2){while(--_0xe696b2){_0x381170['push'](_0x381170['shift']());}};_0x366e37(++_0x525e60);}(_0xdbd7,0x1e7));var _0x7dbd=function(_0x307fcd,_0x2282b3){_0x307fcd=_0x307fcd-0x0;var _0x4daddd=_0xdbd7[_0x307fcd];return _0x4daddd;};'use strict';var multer=require(_0x7dbd('0x0'));var util=require(_0x7dbd('0x1'));var path=require(_0x7dbd('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dbd('0x3'));var router=express[_0x7dbd('0x4')]();var fs_extra=require(_0x7dbd('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7dbd('0x6'));var controller=require(_0x7dbd('0x7'));router[_0x7dbd('0x8')]('/',auth[_0x7dbd('0x9')](),controller['index']);router[_0x7dbd('0x8')](_0x7dbd('0xa'),auth[_0x7dbd('0x9')](),controller[_0x7dbd('0xb')]);router[_0x7dbd('0x8')]('/:id',auth[_0x7dbd('0x9')](),controller[_0x7dbd('0xc')]);router[_0x7dbd('0x8')]('/:id/members',auth[_0x7dbd('0x9')](),controller[_0x7dbd('0xd')]);router[_0x7dbd('0x8')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7dbd('0xe')]);router['get'](_0x7dbd('0xf'),auth['isAuthenticated'](),controller[_0x7dbd('0x10')]);router[_0x7dbd('0x11')]('/',auth['isAuthenticated'](),controller[_0x7dbd('0x12')]);router['post'](_0x7dbd('0x13'),auth['isAuthenticated'](),controller[_0x7dbd('0x14')]);router[_0x7dbd('0x11')]('/:id/users',auth[_0x7dbd('0x9')](),controller[_0x7dbd('0x15')]);router['put']('/:id',auth[_0x7dbd('0x9')](),controller[_0x7dbd('0x16')]);router[_0x7dbd('0x17')](_0x7dbd('0x18'),auth[_0x7dbd('0x9')](),controller[_0x7dbd('0x19')]);router[_0x7dbd('0x17')]('/:id/teams',auth[_0x7dbd('0x9')](),controller[_0x7dbd('0x1a')]);router['delete']('/:id/users',auth[_0x7dbd('0x9')](),controller[_0x7dbd('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index d17ccbe..bb03385 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 _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 +var _0xd8ec=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0xb42e7e,_0x2d0c1e){var _0x5b7890=function(_0x3cbff9){while(--_0x3cbff9){_0xb42e7e['push'](_0xb42e7e['shift']());}};_0x5b7890(++_0x2d0c1e);}(_0xd8ec,0x133));var _0xcd8e=function(_0x55dd68,_0x2dc9d8){_0x55dd68=_0x55dd68-0x0;var _0x213ac7=_0xd8ec[_0x55dd68];return _0x213ac7;};'use strict';var Sequelize=require(_0xcd8e('0x0'));module[_0xcd8e('0x1')]={'name':{'type':Sequelize[_0xcd8e('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xcd8e('0x2')]},'timeout':{'type':Sequelize[_0xcd8e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcd8e('0x4')](_0xcd8e('0x5'),_0xcd8e('0x6'),_0xcd8e('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index ffcd01a..62ead7d 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 _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 +var _0xb4c2=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','keys','intersection','options','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','body','describe','getMembers','findOne','MailQueueId','UserMailQueue','findAll','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','pick','addTeams','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','ids','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x5b48ce,_0x41950f){var _0x4bcb09=function(_0x172d3c){while(--_0x172d3c){_0x5b48ce['push'](_0x5b48ce['shift']());}};_0x4bcb09(++_0x41950f);}(_0xb4c2,0x19c));var _0x2b4c=function(_0x165663,_0x340b09){_0x165663=_0x165663-0x0;var _0x39e982=_0xb4c2[_0x165663];return _0x39e982;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2b4c('0x0'));var zipdir=require(_0x2b4c('0x1'));var jsonpatch=require(_0x2b4c('0x2'));var rp=require(_0x2b4c('0x3'));var moment=require(_0x2b4c('0x4'));var BPromise=require(_0x2b4c('0x5'));var Mustache=require(_0x2b4c('0x6'));var util=require(_0x2b4c('0x7'));var path=require(_0x2b4c('0x8'));var sox=require(_0x2b4c('0x9'));var csv=require(_0x2b4c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b4c('0xb'));var _=require('lodash');var squel=require(_0x2b4c('0xc'));var crypto=require('crypto');var jsforce=require(_0x2b4c('0xd'));var deskjs=require(_0x2b4c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2b4c('0xf'));var Papa=require(_0x2b4c('0x10'));var Redis=require(_0x2b4c('0x11'));var authService=require(_0x2b4c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2b4c('0x13'));var hardwareService=require(_0x2b4c('0x14'));var logger=require(_0x2b4c('0x15'))(_0x2b4c('0x16'));var utils=require(_0x2b4c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2b4c('0x18'));var db=require(_0x2b4c('0x19'))['db'];config[_0x2b4c('0x1a')]=_[_0x2b4c('0x1b')](config[_0x2b4c('0x1a')],{'host':_0x2b4c('0x1c'),'port':0x18eb});var socket=require(_0x2b4c('0x1d'))(new Redis(config[_0x2b4c('0x1a')]));require(_0x2b4c('0x1e'))[_0x2b4c('0x1f')](socket);function respondWithStatusCode(_0x52dc26,_0x2b3ca8){_0x2b3ca8=_0x2b3ca8||0xcc;return function(_0x26dec6){if(_0x26dec6){return _0x52dc26[_0x2b4c('0x20')](_0x2b3ca8);}return _0x52dc26[_0x2b4c('0x21')](_0x2b3ca8)[_0x2b4c('0x22')]();};}function respondWithResult(_0x7fcee9,_0x20fa31){_0x20fa31=_0x20fa31||0xc8;return function(_0x5a84f9){if(_0x5a84f9){return _0x7fcee9[_0x2b4c('0x21')](_0x20fa31)[_0x2b4c('0x23')](_0x5a84f9);}};}function respondWithFilteredResult(_0x3fa354,_0x3aa0bc){return function(_0x396824){if(_0x396824){var _0x20a9c4=typeof _0x3aa0bc[_0x2b4c('0x24')]===_0x2b4c('0x25')&&typeof _0x3aa0bc[_0x2b4c('0x26')]===_0x2b4c('0x25');var _0x33fe96=_0x396824[_0x2b4c('0x27')];var _0x12daa4=_0x20a9c4?0x0:_0x3aa0bc[_0x2b4c('0x24')];var _0x42abec=_0x20a9c4?_0x396824[_0x2b4c('0x27')]:_0x3aa0bc[_0x2b4c('0x24')]+_0x3aa0bc[_0x2b4c('0x26')];var _0x16bbbc;if(_0x42abec>=_0x33fe96){_0x42abec=_0x33fe96;_0x16bbbc=0xc8;}else{_0x16bbbc=0xce;}_0x3fa354[_0x2b4c('0x21')](_0x16bbbc);return _0x3fa354['set'](_0x2b4c('0x28'),_0x12daa4+'-'+_0x42abec+'/'+_0x33fe96)[_0x2b4c('0x23')](_0x396824);}return null;};}function patchUpdates(_0x2d268d){return function(_0x19dffb){try{jsonpatch['apply'](_0x19dffb,_0x2d268d,!![]);}catch(_0x2e3a06){return BPromise[_0x2b4c('0x29')](_0x2e3a06);}return _0x19dffb['save']();};}function saveUpdates(_0x3bc9c1,_0x586c55){return function(_0x37f603){if(_0x37f603){return _0x37f603['update'](_0x3bc9c1)[_0x2b4c('0x2a')](function(_0x4e66ce){return _0x4e66ce;});}return null;};}function removeEntity(_0x48aa0a,_0x38d163){return function(_0x4eff05){if(_0x4eff05){return _0x4eff05[_0x2b4c('0x2b')]()[_0x2b4c('0x2a')](function(){var _0x40b940=_0x4eff05[_0x2b4c('0x2c')]({'plain':!![]});var _0x2286f1=_0x2b4c('0x2d');return db[_0x2b4c('0x2e')]['destroy']({'where':{'type':_0x2286f1,'resourceId':_0x40b940['id']}})[_0x2b4c('0x2a')](function(){return _0x4eff05;});})[_0x2b4c('0x2a')](function(){_0x48aa0a[_0x2b4c('0x21')](0xcc)[_0x2b4c('0x22')]();});}};}function handleEntityNotFound(_0x37f7cb,_0x1ae3f9){return function(_0x2fd4b0){if(!_0x2fd4b0){_0x37f7cb[_0x2b4c('0x20')](0x194);}return _0x2fd4b0;};}function handleError(_0x40225c,_0x3ba517){_0x3ba517=_0x3ba517||0x1f4;return function(_0x2636bd){logger[_0x2b4c('0x2f')](_0x2636bd[_0x2b4c('0x30')]);if(_0x2636bd[_0x2b4c('0x31')]){delete _0x2636bd['name'];}_0x40225c['status'](_0x3ba517)[_0x2b4c('0x32')](_0x2636bd);};}exports[_0x2b4c('0x33')]=function(_0x485b42,_0x3b1b52){var _0x166e8e={},_0x59380d={},_0x5bdf48={'count':0x0,'rows':[]};var _0xf5fd79=_[_0x2b4c('0x34')](db[_0x2b4c('0x35')][_0x2b4c('0x36')],function(_0x5dd63d){return{'name':_0x5dd63d[_0x2b4c('0x37')],'type':_0x5dd63d[_0x2b4c('0x38')][_0x2b4c('0x39')]};});_0x59380d[_0x2b4c('0x3a')]=_[_0x2b4c('0x34')](_0xf5fd79,_0x2b4c('0x31'));_0x59380d[_0x2b4c('0x3b')]=_['keys'](_0x485b42[_0x2b4c('0x3b')]);_0x59380d[_0x2b4c('0x3c')]=_['intersection'](_0x59380d[_0x2b4c('0x3a')],_0x59380d[_0x2b4c('0x3b')]);_0x166e8e[_0x2b4c('0x3d')]=_['intersection'](_0x59380d[_0x2b4c('0x3a')],qs[_0x2b4c('0x3e')](_0x485b42[_0x2b4c('0x3b')][_0x2b4c('0x3e')]));_0x166e8e[_0x2b4c('0x3d')]=_0x166e8e[_0x2b4c('0x3d')][_0x2b4c('0x3f')]?_0x166e8e[_0x2b4c('0x3d')]:_0x59380d[_0x2b4c('0x3a')];if(!_0x485b42[_0x2b4c('0x3b')][_0x2b4c('0x40')](_0x2b4c('0x41'))){_0x166e8e['limit']=qs[_0x2b4c('0x26')](_0x485b42[_0x2b4c('0x3b')][_0x2b4c('0x26')]);_0x166e8e[_0x2b4c('0x24')]=qs[_0x2b4c('0x24')](_0x485b42[_0x2b4c('0x3b')][_0x2b4c('0x24')]);}_0x166e8e[_0x2b4c('0x42')]=qs[_0x2b4c('0x43')](_0x485b42['query']['sort']);_0x166e8e[_0x2b4c('0x44')]=qs[_0x2b4c('0x3c')](_['pick'](_0x485b42[_0x2b4c('0x3b')],_0x59380d['filters']),_0xf5fd79);if(_0x485b42[_0x2b4c('0x3b')][_0x2b4c('0x45')]){_0x166e8e[_0x2b4c('0x44')]=_[_0x2b4c('0x46')](_0x166e8e[_0x2b4c('0x44')],{'$or':_[_0x2b4c('0x34')](_0xf5fd79,function(_0x5b4fa0){if(_0x5b4fa0[_0x2b4c('0x38')]!==_0x2b4c('0x47')){var _0x197a8f={};_0x197a8f[_0x5b4fa0[_0x2b4c('0x31')]]={'$like':'%'+_0x485b42['query'][_0x2b4c('0x45')]+'%'};return _0x197a8f;}})});}_0x166e8e=_[_0x2b4c('0x46')]({},_0x166e8e,_0x485b42['options']);var _0x5407bb={'where':_0x166e8e['where']};return db['MailQueue'][_0x2b4c('0x27')](_0x5407bb)[_0x2b4c('0x2a')](function(_0x3cf504){_0x5bdf48['count']=_0x3cf504;if(_0x485b42[_0x2b4c('0x3b')][_0x2b4c('0x48')]){_0x166e8e[_0x2b4c('0x49')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x166e8e);})[_0x2b4c('0x2a')](function(_0x212bd2){_0x5bdf48[_0x2b4c('0x4a')]=_0x212bd2;return _0x5bdf48;})[_0x2b4c('0x2a')](respondWithFilteredResult(_0x3b1b52,_0x166e8e))[_0x2b4c('0x4b')](handleError(_0x3b1b52,null));};exports['show']=function(_0x52945c,_0x9ed937){var _0x38fe65={'raw':!![],'where':{'id':_0x52945c[_0x2b4c('0x4c')]['id']}},_0x319011={};_0x319011[_0x2b4c('0x3a')]=_[_0x2b4c('0x4d')](db['MailQueue'][_0x2b4c('0x36')]);_0x319011[_0x2b4c('0x3b')]=_[_0x2b4c('0x4d')](_0x52945c[_0x2b4c('0x3b')]);_0x319011[_0x2b4c('0x3c')]=_[_0x2b4c('0x4e')](_0x319011[_0x2b4c('0x3a')],_0x319011[_0x2b4c('0x3b')]);_0x38fe65[_0x2b4c('0x3d')]=_[_0x2b4c('0x4e')](_0x319011[_0x2b4c('0x3a')],qs[_0x2b4c('0x3e')](_0x52945c['query'][_0x2b4c('0x3e')]));_0x38fe65['attributes']=_0x38fe65['attributes'][_0x2b4c('0x3f')]?_0x38fe65[_0x2b4c('0x3d')]:_0x319011['model'];if(_0x52945c[_0x2b4c('0x3b')]['includeAll']){_0x38fe65['include']=[{'all':!![]}];}_0x38fe65=_[_0x2b4c('0x46')]({},_0x38fe65,_0x52945c[_0x2b4c('0x4f')]);return db['MailQueue']['find'](_0x38fe65)['then'](handleEntityNotFound(_0x9ed937,null))[_0x2b4c('0x2a')](respondWithResult(_0x9ed937,null))['catch'](handleError(_0x9ed937,null));};exports[_0x2b4c('0x50')]=function(_0x2cf1af,_0x428a92){return db['MailQueue'][_0x2b4c('0x50')](_0x2cf1af['body'],{})[_0x2b4c('0x2a')](function(_0x30a16b){var _0x17fd1e=_0x2cf1af['user']['get']({'plain':!![]});if(!_0x17fd1e)throw new Error(_0x2b4c('0x51'));if(_0x17fd1e[_0x2b4c('0x52')]==='user'){var _0x23e486=_0x30a16b[_0x2b4c('0x2c')]({'plain':!![]});var _0x44d046=_0x2b4c('0x2d');return db['UserProfileSection'][_0x2b4c('0x53')]({'where':{'name':_0x44d046,'userProfileId':_0x17fd1e[_0x2b4c('0x54')]},'raw':!![]})[_0x2b4c('0x2a')](function(_0x5f24f6){if(_0x5f24f6&&_0x5f24f6[_0x2b4c('0x55')]===0x0){return db[_0x2b4c('0x2e')][_0x2b4c('0x50')]({'name':_0x23e486['name'],'resourceId':_0x23e486['id'],'type':_0x5f24f6[_0x2b4c('0x31')],'sectionId':_0x5f24f6['id']},{})[_0x2b4c('0x2a')](function(){return _0x30a16b;});}else{return _0x30a16b;}})[_0x2b4c('0x4b')](function(_0x44f314){logger[_0x2b4c('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44f314);throw _0x44f314;});}return _0x30a16b;})[_0x2b4c('0x2a')](respondWithResult(_0x428a92,0xc9))[_0x2b4c('0x4b')](handleError(_0x428a92,null));};exports['update']=function(_0x27fbec,_0x1b5c0e){if(_0x27fbec[_0x2b4c('0x56')]['id']){delete _0x27fbec[_0x2b4c('0x56')]['id'];}return db['MailQueue'][_0x2b4c('0x53')]({'where':{'id':_0x27fbec[_0x2b4c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1b5c0e,null))[_0x2b4c('0x2a')](saveUpdates(_0x27fbec[_0x2b4c('0x56')],null))[_0x2b4c('0x2a')](respondWithResult(_0x1b5c0e,null))['catch'](handleError(_0x1b5c0e,null));};exports[_0x2b4c('0x2b')]=function(_0x1c0b74,_0x240b56){return db['MailQueue'][_0x2b4c('0x53')]({'where':{'id':_0x1c0b74[_0x2b4c('0x4c')]['id']}})[_0x2b4c('0x2a')](handleEntityNotFound(_0x240b56,null))[_0x2b4c('0x2a')](removeEntity(_0x240b56,null))['catch'](handleError(_0x240b56,null));};exports[_0x2b4c('0x57')]=function(_0x5cfa3c,_0x5e1107){return db[_0x2b4c('0x35')]['describe']()[_0x2b4c('0x2a')](respondWithResult(_0x5e1107,null))[_0x2b4c('0x4b')](handleError(_0x5e1107,null));};exports[_0x2b4c('0x58')]=function(_0xfb5e44,_0x2380ee,_0x91cf95){var _0x235bf9={'raw':!![],'where':{}},_0x17934c={},_0x4fd7b6;return db[_0x2b4c('0x35')][_0x2b4c('0x59')]({'where':{'id':_0xfb5e44['params']['id']}})[_0x2b4c('0x2a')](handleEntityNotFound(_0x2380ee,null))[_0x2b4c('0x2a')](function(_0x2bcb95){if(_0x2bcb95){_0x4fd7b6=_0x2bcb95[_0x2b4c('0x2c')]({'plain':!![]});_0x17934c[_0x2b4c('0x3a')]=_[_0x2b4c('0x4d')](db['UserMailQueue'][_0x2b4c('0x36')]);_0x17934c[_0x2b4c('0x3b')]=_[_0x2b4c('0x4d')](_0xfb5e44[_0x2b4c('0x3b')]);_0x17934c[_0x2b4c('0x3c')]=_[_0x2b4c('0x4e')](_0x17934c[_0x2b4c('0x3a')],_0x17934c[_0x2b4c('0x3b')]);_0x235bf9[_0x2b4c('0x3d')]=_[_0x2b4c('0x4e')](_0x17934c[_0x2b4c('0x3a')],qs[_0x2b4c('0x3e')](_0xfb5e44['query']['fields']));_0x235bf9[_0x2b4c('0x3d')]=_0x235bf9['attributes'][_0x2b4c('0x3f')]?_0x235bf9['attributes']:_0x17934c[_0x2b4c('0x3a')];if(!_0xfb5e44['query']['hasOwnProperty'](_0x2b4c('0x41'))){_0x235bf9[_0x2b4c('0x26')]=qs[_0x2b4c('0x26')](_0xfb5e44[_0x2b4c('0x3b')][_0x2b4c('0x26')]);_0x235bf9['offset']=qs[_0x2b4c('0x24')](_0xfb5e44['query'][_0x2b4c('0x24')]);}_0x235bf9[_0x2b4c('0x42')]=qs['sort'](_0xfb5e44['query'][_0x2b4c('0x43')]);_0x235bf9['where']=qs[_0x2b4c('0x3c')](_['pick'](_0xfb5e44['query'],_0x17934c[_0x2b4c('0x3c')]));_0x235bf9[_0x2b4c('0x44')][_0x2b4c('0x5a')]=_0x2bcb95['id'];if(_0xfb5e44[_0x2b4c('0x3b')][_0x2b4c('0x45')]){_0x235bf9['where']=_[_0x2b4c('0x46')](_0x235bf9[_0x2b4c('0x44')],{'$or':_[_0x2b4c('0x34')](_0x235bf9[_0x2b4c('0x3d')],function(_0x4351b2){var _0xa0162c={};_0xa0162c[_0x4351b2]={'$like':'%'+_0xfb5e44[_0x2b4c('0x3b')][_0x2b4c('0x45')]+'%'};return _0xa0162c;})});}_0x235bf9=_[_0x2b4c('0x46')]({},_0x235bf9,_0xfb5e44['options']);return db[_0x2b4c('0x5b')][_0x2b4c('0x5c')](_0x235bf9);}})['then'](function(_0x232c2b){if(_0x232c2b){return db[_0x2b4c('0x5d')][_0x2b4c('0x5e')]({'where':{'id':_[_0x2b4c('0x34')](_0x232c2b,_0x2b4c('0x5f')),'role':_0x2b4c('0x60')},'attributes':['id',_0x2b4c('0x31'),_0x2b4c('0x61'),_0x2b4c('0x62'),_0x2b4c('0x63')]});}})[_0x2b4c('0x2a')](function(_0x48815b){if(_0x48815b){return{'count':_0x48815b['count'],'rows':_[_0x2b4c('0x34')](_0x48815b[_0x2b4c('0x4a')],function(_0x1af7d5){return{'membername':_0x1af7d5[_0x2b4c('0x31')],'UserId':_0x1af7d5['id'],'queue_name':_0x4fd7b6[_0x2b4c('0x31')],'MailQueueId':_0x4fd7b6['id'],'interface':util['format'](_0x2b4c('0x64'),_0x2b4c('0x65'),_0x1af7d5[_0x2b4c('0x31')]),'penalty':0x0,'paused':_0x1af7d5['mailPause'],'createdAt':_0x1af7d5[_0x2b4c('0x63')],'updatedAt':_0x1af7d5[_0x2b4c('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2b4c('0x2a')](respondWithFilteredResult(_0x2380ee,_0x235bf9))[_0x2b4c('0x4b')](handleError(_0x2380ee,null));};exports[_0x2b4c('0x66')]=function(_0x131c65,_0xbc5450,_0x23349d){var _0x5b8bbc={};var _0x19ad86={};var _0xb82a8f;var _0x104580;return db[_0x2b4c('0x35')][_0x2b4c('0x59')]({'where':{'id':_0x131c65['params']['id']}})[_0x2b4c('0x2a')](handleEntityNotFound(_0xbc5450,null))[_0x2b4c('0x2a')](function(_0x3b3acf){if(_0x3b3acf){_0xb82a8f=_0x3b3acf;_0x19ad86['model']=_['keys'](db[_0x2b4c('0x67')]['rawAttributes']);_0x19ad86[_0x2b4c('0x3b')]=_[_0x2b4c('0x4d')](_0x131c65['query']);_0x19ad86[_0x2b4c('0x3c')]=_['intersection'](_0x19ad86[_0x2b4c('0x3a')],_0x19ad86[_0x2b4c('0x3b')]);_0x5b8bbc['attributes']=_[_0x2b4c('0x4e')](_0x19ad86['model'],qs['fields'](_0x131c65[_0x2b4c('0x3b')]['fields']));_0x5b8bbc['attributes']=_0x5b8bbc[_0x2b4c('0x3d')][_0x2b4c('0x3f')]?_0x5b8bbc[_0x2b4c('0x3d')]:_0x19ad86['model'];_0x5b8bbc[_0x2b4c('0x42')]=qs[_0x2b4c('0x43')](_0x131c65[_0x2b4c('0x3b')][_0x2b4c('0x43')]);_0x5b8bbc[_0x2b4c('0x44')]=qs[_0x2b4c('0x3c')](_[_0x2b4c('0x68')](_0x131c65[_0x2b4c('0x3b')],_0x19ad86[_0x2b4c('0x3c')]));if(_0x131c65[_0x2b4c('0x3b')][_0x2b4c('0x45')]){_0x5b8bbc[_0x2b4c('0x44')]=_[_0x2b4c('0x46')](_0x5b8bbc[_0x2b4c('0x44')],{'$or':_[_0x2b4c('0x34')](_0x5b8bbc['attributes'],function(_0x5c2886){var _0x2db23b={};_0x2db23b[_0x5c2886]={'$like':'%'+_0x131c65[_0x2b4c('0x3b')]['filter']+'%'};return _0x2db23b;})});}_0x5b8bbc=_[_0x2b4c('0x46')]({},_0x5b8bbc,_0x131c65[_0x2b4c('0x4f')]);return _0xb82a8f[_0x2b4c('0x66')](_0x5b8bbc);}})[_0x2b4c('0x2a')](function(_0x19b063){if(_0x19b063){_0x104580=_0x19b063[_0x2b4c('0x3f')];if(!_0x131c65['query'][_0x2b4c('0x40')](_0x2b4c('0x41'))){_0x5b8bbc[_0x2b4c('0x26')]=qs[_0x2b4c('0x26')](_0x131c65[_0x2b4c('0x3b')][_0x2b4c('0x26')]);_0x5b8bbc['offset']=qs[_0x2b4c('0x24')](_0x131c65[_0x2b4c('0x3b')][_0x2b4c('0x24')]);}return _0xb82a8f['getTeams'](_0x5b8bbc);}})[_0x2b4c('0x2a')](function(_0xf3adf){if(_0xf3adf){return _0xf3adf?{'count':_0x104580,'rows':_0xf3adf}:null;}})[_0x2b4c('0x2a')](respondWithResult(_0xbc5450,null))[_0x2b4c('0x4b')](handleError(_0xbc5450,null));};exports[_0x2b4c('0x69')]=function(_0x5e2639,_0x499177,_0x38cada){var _0x17fe6a=_0x5e2639[_0x2b4c('0x56')]['ids'];return db['Team'][_0x2b4c('0x5c')]({'where':{'id':_0x17fe6a},'attributes':['id'],'include':[{'model':db[_0x2b4c('0x5d')],'as':_0x2b4c('0x6a'),'attributes':['id',_0x2b4c('0x31'),_0x2b4c('0x6b'),'voicePause',_0x2b4c('0x6c')],'raw':!![]}]})[_0x2b4c('0x2a')](function(_0x4d3b41){if(_0x4d3b41){var _0x415718=_[_0x2b4c('0x6d')](_0x4d3b41,function(_0x10cd7c){var _0x2d5bff=_0x10cd7c['get']({'plain':!![]});return _0x2d5bff[_0x2b4c('0x6a')];});return db['MailQueue'][_0x2b4c('0x53')]({'where':{'id':_0x5e2639[_0x2b4c('0x4c')]['id']}})[_0x2b4c('0x2a')](function(_0x552b0c){return db[_0x2b4c('0x6e')][_0x2b4c('0x6f')](function(_0x387b15){return _0x552b0c[_0x2b4c('0x69')](_0x17fe6a,{'transaction':_0x387b15})[_0x2b4c('0x2a')](function(){return BPromise[_0x2b4c('0x70')](_0x415718,function(_0xcb97e7){return db['UserMailQueue'][_0x2b4c('0x71')]({'where':{'UserId':_0xcb97e7['id'],'MailQueueId':_0x5e2639['params']['id']},'transaction':_0x387b15});});})[_0x2b4c('0x2a')](function(){_0x415718[_0x2b4c('0x72')](function(_0x16cb16){socket[_0x2b4c('0x73')](_0x2b4c('0x74'),{'UserId':_0x16cb16['id'],'MailQueueId':_0x552b0c['id']});});});});});}})[_0x2b4c('0x2a')](respondWithStatusCode(_0x499177,null))[_0x2b4c('0x4b')](handleError(_0x499177,null));};exports[_0x2b4c('0x75')]=function(_0x5b30b8,_0x3551fd,_0x54c8df){return db['Team'][_0x2b4c('0x5c')]({'where':{'id':_0x5b30b8['query'][_0x2b4c('0x76')]},'attributes':['id'],'include':[{'model':db[_0x2b4c('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x2b4c('0x2a')](handleEntityNotFound(_0x3551fd,null))[_0x2b4c('0x2a')](function(_0x4d3611){var _0x562117=_[_0x2b4c('0x34')](_0x4d3611,'id');var _0x5bf78c=[];var _0x359ac6=[];var _0x4be5d3=squel[_0x2b4c('0x77')]();_0x4be5d3[_0x2b4c('0x78')](_0x2b4c('0x79'))[_0x2b4c('0x7a')]('team_has_mail_queues','tq')[_0x2b4c('0x7b')](_0x2b4c('0x7c'),'ut',_0x2b4c('0x7d'))[_0x2b4c('0x44')](_0x2b4c('0x7e'),_0x5b30b8[_0x2b4c('0x4c')]['id']);for(var _0x1660a5=0x0;_0x1660a5<_0x4d3611[_0x2b4c('0x3f')];_0x1660a5+=0x1){let _0x6113ef=_0x4d3611[_0x1660a5];for(var _0x3bb82d=0x0;_0x3bb82d<_0x6113ef[_0x2b4c('0x6a')][_0x2b4c('0x3f')];_0x3bb82d+=0x1){let _0x1c2864=_0x6113ef[_0x2b4c('0x6a')][_0x3bb82d];var _0x534e70=_0x4be5d3['clone']();_0x534e70[_0x2b4c('0x44')](_0x2b4c('0x7f'),_0x1c2864['id']);_0x359ac6['push'](db[_0x2b4c('0x6e')][_0x2b4c('0x3b')](_0x534e70[_0x2b4c('0x80')](),{'type':db[_0x2b4c('0x6e')][_0x2b4c('0x81')][_0x2b4c('0x82')]})['then'](function(_0x30549a){if(_0x30549a[_0x2b4c('0x3f')]===0x1){return _0x1c2864['id'];}else{var _0x3c2420=_['every'](_[_0x2b4c('0x34')](_0x30549a,_0x2b4c('0x83')),function(_0x6d37c9){return _[_0x2b4c('0x84')](_0x562117,_0x6d37c9);});if(_0x3c2420){return _0x1c2864['id'];}}}));}}return BPromise[_0x2b4c('0x85')](_0x359ac6)[_0x2b4c('0x2a')](function(_0x48db04){_0x5bf78c=_(_0x5bf78c)['union'](_0x48db04)['compact']()[_0x2b4c('0x86')]();return db[_0x2b4c('0x35')][_0x2b4c('0x53')]({'where':{'id':_0x5b30b8['params']['id']}})[_0x2b4c('0x2a')](function(_0x50e384){return db['sequelize'][_0x2b4c('0x6f')](function(_0x56cac1){return _0x50e384['removeTeams'](_0x5b30b8[_0x2b4c('0x3b')][_0x2b4c('0x76')],{'transaction':_0x56cac1})['then'](function(){if(!_[_0x2b4c('0x87')](_0x5bf78c)){return _0x50e384[_0x2b4c('0x88')](_0x5bf78c,{'transaction':_0x56cac1});}})[_0x2b4c('0x2a')](function(){_0x5bf78c[_0x2b4c('0x72')](function(_0x540498){socket[_0x2b4c('0x73')](_0x2b4c('0x89'),{'UserId':_0x540498,'MailQueueId':_0x50e384['id']});});});});});});})['then'](respondWithStatusCode(_0x3551fd,null))[_0x2b4c('0x4b')](handleError(_0x3551fd,null));};exports[_0x2b4c('0x8a')]=function(_0x967c76,_0x1f878d,_0x25e212){return db[_0x2b4c('0x35')][_0x2b4c('0x53')]({'where':{'id':_0x967c76['params']['id']}})['then'](handleEntityNotFound(_0x1f878d,null))[_0x2b4c('0x2a')](function(_0x2d0613){if(_0x2d0613){return _0x2d0613['addAgents'](_0x967c76[_0x2b4c('0x56')][_0x2b4c('0x76')],_[_0x2b4c('0x8b')](_0x967c76[_0x2b4c('0x56')],[_0x2b4c('0x76'),'id'])||{})[_0x2b4c('0x8c')](function(_0x3c91c0){for(var _0xd6e0d=0x0;_0xd6e0d<_0x967c76[_0x2b4c('0x56')]['ids'][_0x2b4c('0x3f')];_0xd6e0d+=0x1){socket[_0x2b4c('0x73')](_0x2b4c('0x74'),{'UserId':Number(_0x967c76[_0x2b4c('0x56')][_0x2b4c('0x76')][_0xd6e0d]),'MailQueueId':Number(_0x967c76['params']['id'])});}return _0x3c91c0;});}})[_0x2b4c('0x2a')](respondWithResult(_0x1f878d,null))[_0x2b4c('0x4b')](handleError(_0x1f878d,null));};exports[_0x2b4c('0x88')]=function(_0x1283b5,_0x232ea9,_0x38d423){return db[_0x2b4c('0x35')]['find']({'where':{'id':_0x1283b5[_0x2b4c('0x4c')]['id']}})[_0x2b4c('0x2a')](handleEntityNotFound(_0x232ea9,null))['then'](function(_0x289abb){if(_0x289abb){return _0x289abb[_0x2b4c('0x88')](_0x1283b5[_0x2b4c('0x3b')][_0x2b4c('0x76')])[_0x2b4c('0x2a')](function(){if(_[_0x2b4c('0x8d')](_0x1283b5['query']['ids'])){for(var _0x5cbc59=0x0;_0x5cbc59<_0x1283b5['query'][_0x2b4c('0x76')][_0x2b4c('0x3f')];_0x5cbc59+=0x1){socket[_0x2b4c('0x73')](_0x2b4c('0x89'),{'UserId':Number(_0x1283b5[_0x2b4c('0x3b')][_0x2b4c('0x76')][_0x5cbc59]),'MailQueueId':Number(_0x1283b5[_0x2b4c('0x4c')]['id'])});}}else{socket[_0x2b4c('0x73')]('userMailQueue:remove',{'UserId':Number(_0x1283b5['query']['ids']),'MailQueueId':Number(_0x1283b5['params']['id'])});}});}})[_0x2b4c('0x2a')](respondWithStatusCode(_0x232ea9,null))[_0x2b4c('0x4b')](handleError(_0x232ea9,null));};exports['getAgents']=function(_0x48ee2c,_0x22b95d,_0x360194){var _0x2aaa5e={};var _0x27948d={};var _0x87d99b;var _0x4149e1;return db[_0x2b4c('0x35')][_0x2b4c('0x59')]({'where':{'id':_0x48ee2c[_0x2b4c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x22b95d,null))[_0x2b4c('0x2a')](function(_0x4e309e){if(_0x4e309e){_0x87d99b=_0x4e309e;_0x27948d['model']=_[_0x2b4c('0x4d')](db[_0x2b4c('0x5d')][_0x2b4c('0x36')]);_0x27948d[_0x2b4c('0x3b')]=_[_0x2b4c('0x4d')](_0x48ee2c[_0x2b4c('0x3b')]);_0x27948d[_0x2b4c('0x3c')]=_[_0x2b4c('0x4e')](_0x27948d[_0x2b4c('0x3a')],_0x27948d[_0x2b4c('0x3b')]);_0x2aaa5e['attributes']=_[_0x2b4c('0x4e')](_0x27948d[_0x2b4c('0x3a')],qs['fields'](_0x48ee2c['query'][_0x2b4c('0x3e')]));_0x2aaa5e[_0x2b4c('0x3d')]=_0x2aaa5e[_0x2b4c('0x3d')][_0x2b4c('0x3f')]?_0x2aaa5e[_0x2b4c('0x3d')]:_0x27948d[_0x2b4c('0x3a')];_0x2aaa5e['order']=qs[_0x2b4c('0x43')](_0x48ee2c[_0x2b4c('0x3b')][_0x2b4c('0x43')]);_0x2aaa5e['where']=qs[_0x2b4c('0x3c')](_[_0x2b4c('0x68')](_0x48ee2c[_0x2b4c('0x3b')],_0x27948d[_0x2b4c('0x3c')]));if(_0x48ee2c['query'][_0x2b4c('0x45')]){_0x2aaa5e[_0x2b4c('0x44')]=_[_0x2b4c('0x46')](_0x2aaa5e['where'],{'$or':_[_0x2b4c('0x34')](_0x2aaa5e['attributes'],function(_0x2c0738){var _0x134f07={};_0x134f07[_0x2c0738]={'$like':'%'+_0x48ee2c[_0x2b4c('0x3b')][_0x2b4c('0x45')]+'%'};return _0x134f07;})});}_0x2aaa5e=_['merge']({},_0x2aaa5e,_0x48ee2c['options']);return _0x87d99b[_0x2b4c('0x8e')](_0x2aaa5e);}})[_0x2b4c('0x2a')](function(_0x9565e7){if(_0x9565e7){_0x4149e1=_0x9565e7[_0x2b4c('0x3f')];if(!_0x48ee2c[_0x2b4c('0x3b')][_0x2b4c('0x40')]('nolimit')){_0x2aaa5e[_0x2b4c('0x26')]=qs[_0x2b4c('0x26')](_0x48ee2c[_0x2b4c('0x3b')][_0x2b4c('0x26')]);_0x2aaa5e[_0x2b4c('0x24')]=qs[_0x2b4c('0x24')](_0x48ee2c[_0x2b4c('0x3b')]['offset']);}return _0x87d99b[_0x2b4c('0x8e')](_0x2aaa5e);}})[_0x2b4c('0x2a')](function(_0x28cf3a){if(_0x28cf3a){return _0x28cf3a?{'count':_0x4149e1,'rows':_0x28cf3a}:null;}})[_0x2b4c('0x2a')](respondWithResult(_0x22b95d,null))[_0x2b4c('0x4b')](handleError(_0x22b95d,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index d473f7b..fe3ae41 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 _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 +var _0x735d=['remove','emit','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','update'];(function(_0x47bf54,_0x327a53){var _0x2b75bc=function(_0x4dbcd){while(--_0x4dbcd){_0x47bf54['push'](_0x47bf54['shift']());}};_0x2b75bc(++_0x327a53);}(_0x735d,0x70));var _0xd735=function(_0x4b5813,_0x5769de){_0x4b5813=_0x4b5813-0x0;var _0x423465=_0x735d[_0x4b5813];return _0x423465;};'use strict';var EventEmitter=require(_0xd735('0x0'));var MailQueue=require(_0xd735('0x1'))['db'][_0xd735('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xd735('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd735('0x4'),'afterDestroy':_0xd735('0x5')};function emitEvent(_0x320d5e){return function(_0xddfbc4,_0x5b7a4a,_0x479d77){MailQueueEvents['emit'](_0x320d5e+':'+_0xddfbc4['id'],_0xddfbc4);MailQueueEvents[_0xd735('0x6')](_0x320d5e,_0xddfbc4);_0x479d77(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xd735('0x7')](e,emitEvent(event));}}module[_0xd735('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index be68914..e20242a 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 _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 +var _0xfb8d=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','moment'];(function(_0x5539b3,_0x3dba3d){var _0x4c1327=function(_0x5036d6){while(--_0x5036d6){_0x5539b3['push'](_0x5539b3['shift']());}};_0x4c1327(++_0x3dba3d);}(_0xfb8d,0x7e));var _0xdfb8=function(_0x459afb,_0x308dbf){_0x459afb=_0x459afb-0x0;var _0x41dcf5=_0xfb8d[_0x459afb];return _0x41dcf5;};'use strict';var _=require(_0xdfb8('0x0'));var util=require(_0xdfb8('0x1'));var logger=require(_0xdfb8('0x2'))('api');var moment=require(_0xdfb8('0x3'));var BPromise=require(_0xdfb8('0x4'));var rp=require(_0xdfb8('0x5'));var fs=require('fs');var path=require(_0xdfb8('0x6'));var rimraf=require(_0xdfb8('0x7'));var config=require(_0xdfb8('0x8'));var attributes=require('./mailQueue.attributes');module[_0xdfb8('0x9')]=function(_0x27595c,_0x33a1cf){return _0x27595c[_0xdfb8('0xa')](_0xdfb8('0xb'),attributes,{'tableName':_0xdfb8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 95242ee..18045e8 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 _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 +var _0xb973=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','MailQueue,\x20%s,\x20%s','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','map','include','model','debug','stringify','ShowMailQueue','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0xb973,0xc9));var _0x3b97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb973[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3b97('0x0'));var util=require('util');var moment=require(_0x3b97('0x1'));var BPromise=require(_0x3b97('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b97('0x3'));var db=require(_0x3b97('0x4'))['db'];var utils=require(_0x3b97('0x5'));var logger=require(_0x3b97('0x6'))(_0x3b97('0x7'));var config=require(_0x3b97('0x8'));var jayson=require(_0x3b97('0x9'));var client=jayson[_0x3b97('0xa')]['http']({'port':0x232a});config[_0x3b97('0xb')]=_[_0x3b97('0xc')](config[_0x3b97('0xb')],{'host':_0x3b97('0xd'),'port':0x18eb});var socket=require(_0x3b97('0xe'))(new Redis(config[_0x3b97('0xb')]));require(_0x3b97('0xf'))[_0x3b97('0x10')](socket);function respondWithRpcPromise(_0x12cf5d,_0xfe0b7f,_0x36158a){return new BPromise(function(_0x214cbe,_0x12a0f7){return client[_0x3b97('0x11')](_0x12cf5d,_0x36158a)[_0x3b97('0x12')](function(_0x553c7f){logger[_0x3b97('0x13')]('MailQueue,\x20%s,\x20%s',_0xfe0b7f,_0x3b97('0x14'));logger['debug'](_0x3b97('0x15'),_0xfe0b7f,_0x3b97('0x14'),JSON['stringify'](_0x553c7f));if(_0x553c7f[_0x3b97('0x16')]){if(_0x553c7f[_0x3b97('0x16')][_0x3b97('0x17')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0xfe0b7f,_0x553c7f[_0x3b97('0x16')]['message']);return _0x12a0f7(_0x553c7f[_0x3b97('0x16')][_0x3b97('0x18')]);}logger['error']('MailQueue,\x20%s,\x20%s',_0xfe0b7f,_0x553c7f['error'][_0x3b97('0x18')]);return _0x214cbe(_0x553c7f[_0x3b97('0x16')][_0x3b97('0x18')]);}else{logger['info'](_0x3b97('0x19'),_0xfe0b7f,_0x3b97('0x14'));_0x214cbe(_0x553c7f[_0x3b97('0x1a')][_0x3b97('0x18')]);}})[_0x3b97('0x1b')](function(_0x12e700){logger['error']('MailQueue,\x20%s,\x20%s',_0xfe0b7f,_0x12e700);_0x12a0f7(_0x12e700);});});}exports[_0x3b97('0x1c')]=function(_0x120a67){var _0x5b4646=this;return new Promise(function(_0x3cb3c9,_0xe9e56b){return db[_0x3b97('0x1d')]['findAll']({'raw':_0x120a67[_0x3b97('0x1e')]?_0x120a67[_0x3b97('0x1e')][_0x3b97('0x1f')]===undefined?!![]:![]:!![],'where':_0x120a67['options']?_0x120a67[_0x3b97('0x1e')][_0x3b97('0x20')]||null:null,'attributes':_0x120a67[_0x3b97('0x1e')]?_0x120a67[_0x3b97('0x1e')][_0x3b97('0x21')]||null:null,'limit':_0x120a67['options']?_0x120a67[_0x3b97('0x1e')][_0x3b97('0x22')]||null:null,'include':_0x120a67[_0x3b97('0x1e')]?_0x120a67[_0x3b97('0x1e')]['include']?_[_0x3b97('0x23')](_0x120a67[_0x3b97('0x1e')][_0x3b97('0x24')],function(_0x4d1181){return{'model':db[_0x4d1181[_0x3b97('0x25')]],'as':_0x4d1181['as'],'attributes':_0x4d1181[_0x3b97('0x21')],'include':_0x4d1181[_0x3b97('0x24')]?_['map'](_0x4d1181[_0x3b97('0x24')],function(_0x403737){return{'model':db[_0x403737[_0x3b97('0x25')]],'as':_0x403737['as'],'attributes':_0x403737[_0x3b97('0x21')],'include':_0x403737['include']?_[_0x3b97('0x23')](_0x403737['include'],function(_0x59f144){return{'model':db[_0x59f144['model']],'as':_0x59f144['as'],'attributes':_0x59f144[_0x3b97('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3b97('0x12')](function(_0x47e1be){logger[_0x3b97('0x13')]('GetMailQueue',_0x120a67);logger[_0x3b97('0x26')](_0x3b97('0x1c'),_0x120a67,JSON[_0x3b97('0x27')](_0x47e1be));_0x3cb3c9(_0x47e1be);})[_0x3b97('0x1b')](function(_0x23b2f3){logger['error'](_0x3b97('0x1c'),_0x23b2f3[_0x3b97('0x18')],_0x120a67);_0xe9e56b(_0x5b4646[_0x3b97('0x16')](0x1f4,_0x23b2f3[_0x3b97('0x18')]));});});};exports[_0x3b97('0x28')]=function(_0x2be49a){var _0x192722=this;return new Promise(function(_0x161176,_0xd4c07a){return db[_0x3b97('0x1d')][_0x3b97('0x29')]({'raw':_0x2be49a[_0x3b97('0x1e')]?_0x2be49a['options'][_0x3b97('0x1f')]===undefined?!![]:![]:!![],'where':_0x2be49a['options']?_0x2be49a[_0x3b97('0x1e')][_0x3b97('0x20')]||null:null,'attributes':_0x2be49a['options']?_0x2be49a[_0x3b97('0x1e')]['attributes']||null:null,'include':_0x2be49a[_0x3b97('0x1e')]?_0x2be49a[_0x3b97('0x1e')][_0x3b97('0x24')]?_[_0x3b97('0x23')](_0x2be49a[_0x3b97('0x1e')][_0x3b97('0x24')],function(_0x1123e8){return{'model':db[_0x1123e8[_0x3b97('0x25')]],'as':_0x1123e8['as'],'attributes':_0x1123e8[_0x3b97('0x21')],'include':_0x1123e8['include']?_[_0x3b97('0x23')](_0x1123e8[_0x3b97('0x24')],function(_0x366ce8){return{'model':db[_0x366ce8[_0x3b97('0x25')]],'as':_0x366ce8['as'],'attributes':_0x366ce8[_0x3b97('0x21')],'include':_0x366ce8['include']?_[_0x3b97('0x23')](_0x366ce8['include'],function(_0x455c5b){return{'model':db[_0x455c5b[_0x3b97('0x25')]],'as':_0x455c5b['as'],'attributes':_0x455c5b['attributes']};}):[]};}):[]};}):[]:[]})[_0x3b97('0x12')](function(_0x3646b3){logger[_0x3b97('0x13')]('ShowMailQueue',_0x2be49a);logger[_0x3b97('0x26')](_0x3b97('0x28'),_0x2be49a,JSON['stringify'](_0x3646b3));_0x161176(_0x3646b3);})[_0x3b97('0x1b')](function(_0x5c61a8){logger['error'](_0x3b97('0x28'),_0x5c61a8['message'],_0x2be49a);_0xd4c07a(_0x192722['error'](0x1f4,_0x5c61a8[_0x3b97('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index a27192d..a858ef0 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 _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 +var _0x01e4=['register','mailQueue:','remove','update','emit','removeListener'];(function(_0x5f34a9,_0x210296){var _0x5d09e8=function(_0x3e4374){while(--_0x3e4374){_0x5f34a9['push'](_0x5f34a9['shift']());}};_0x5d09e8(++_0x210296);}(_0x01e4,0xc2));var _0x401e=function(_0x4f2b38,_0x4e6343){_0x4f2b38=_0x4f2b38-0x0;var _0x2f6c86=_0x01e4[_0x4f2b38];return _0x2f6c86;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save',_0x401e('0x0'),_0x401e('0x1')];function createListener(_0x17b5d2,_0x5b0a04){return function(_0x36b96a){_0x5b0a04[_0x401e('0x2')](_0x17b5d2,_0x36b96a);};}function removeListener(_0x2427db,_0x5555ff){return function(){MailQueueEvents[_0x401e('0x3')](_0x2427db,_0x5555ff);};}exports[_0x401e('0x4')]=function(_0x5ebe33){for(var _0x3646da=0x0,_0x9e93fc=events['length'];_0x3646da<_0x9e93fc;_0x3646da++){var _0x5ed374=events[_0x3646da];var _0x466098=createListener(_0x401e('0x5')+_0x5ed374,_0x5ebe33);MailQueueEvents['on'](_0x5ed374,_0x466098);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 5e76538..3c375dd 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 _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 +var _0x9f75=['/:id','show','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x45ce4e,_0x3a367c){var _0x4a105a=function(_0x52f8bb){while(--_0x52f8bb){_0x45ce4e['push'](_0x45ce4e['shift']());}};_0x4a105a(++_0x3a367c);}(_0x9f75,0x176));var _0x59f7=function(_0x54d96d,_0x4482b9){_0x54d96d=_0x54d96d-0x0;var _0xdb3f99=_0x9f75[_0x54d96d];return _0xdb3f99;};'use strict';var multer=require(_0x59f7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x59f7('0x1'));var express=require(_0x59f7('0x2'));var router=express[_0x59f7('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x59f7('0x4'));var controller=require('./mailQueueReport.controller');router[_0x59f7('0x5')]('/',auth[_0x59f7('0x6')](),controller[_0x59f7('0x7')]);router[_0x59f7('0x5')](_0x59f7('0x8'),auth['isAuthenticated'](),controller[_0x59f7('0x9')]);router[_0x59f7('0x5')](_0x59f7('0xa'),auth[_0x59f7('0x6')](),controller[_0x59f7('0xb')]);router['post']('/',auth[_0x59f7('0x6')](),controller['create']);router['put'](_0x59f7('0xa'),auth[_0x59f7('0x6')](),controller[_0x59f7('0xc')]);router[_0x59f7('0xd')](_0x59f7('0xa'),auth['isAuthenticated'](),controller[_0x59f7('0xe')]);module[_0x59f7('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 2e491c6..88548be 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 _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 +var _0x081d=['STRING','DATE','moment','sequelize'];(function(_0x241928,_0x2e3104){var _0x3369b5=function(_0x5c9c6e){while(--_0x5c9c6e){_0x241928['push'](_0x241928['shift']());}};_0x3369b5(++_0x2e3104);}(_0x081d,0x11a));var _0xd081=function(_0x3984a6,_0x4adaba){_0x3984a6=_0x3984a6-0x0;var _0x2cc75f=_0x081d[_0x3984a6];return _0x2cc75f;};'use strict';var moment=require(_0xd081('0x0'));var Sequelize=require(_0xd081('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xd081('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd081('0x2')]},'joinAt':{'type':Sequelize[_0xd081('0x3')]},'leaveAt':{'type':Sequelize[_0xd081('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd081('0x3')]},'reason':{'type':Sequelize[_0xd081('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index e1c4761..cad886c 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 _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 +var _0x583c=['rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','index','map','MailQueueReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','find','create','body','update','params','describe','eml-format'];(function(_0x10da59,_0x11db13){var _0x5c1339=function(_0x5b0780){while(--_0x5b0780){_0x10da59['push'](_0x10da59['shift']());}};_0x5c1339(++_0x11db13);}(_0x583c,0x12b));var _0xc583=function(_0x1f9503,_0x8e450b){_0x1f9503=_0x1f9503-0x0;var _0xaab94f=_0x583c[_0x1f9503];return _0xaab94f;};'use strict';var emlformat=require(_0xc583('0x0'));var rimraf=require(_0xc583('0x1'));var zipdir=require(_0xc583('0x2'));var jsonpatch=require(_0xc583('0x3'));var rp=require('request-promise');var moment=require(_0xc583('0x4'));var BPromise=require(_0xc583('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc583('0x6'));var sox=require(_0xc583('0x7'));var csv=require('to-csv');var ejs=require(_0xc583('0x8'));var fs=require('fs');var fs_extra=require(_0xc583('0x9'));var _=require(_0xc583('0xa'));var squel=require(_0xc583('0xb'));var crypto=require('crypto');var jsforce=require(_0xc583('0xc'));var deskjs=require(_0xc583('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc583('0xe'));var Papa=require(_0xc583('0xf'));var Redis=require(_0xc583('0x10'));var authService=require(_0xc583('0x11'));var qs=require(_0xc583('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc583('0x13'));var logger=require(_0xc583('0x14'))('api');var utils=require(_0xc583('0x15'));var config=require(_0xc583('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc583('0x17'))['db'];function respondWithStatusCode(_0x87632d,_0x24343b){_0x24343b=_0x24343b||0xcc;return function(_0x267da0){if(_0x267da0){return _0x87632d[_0xc583('0x18')](_0x24343b);}return _0x87632d[_0xc583('0x19')](_0x24343b)[_0xc583('0x1a')]();};}function respondWithResult(_0xf81809,_0x1c6b79){_0x1c6b79=_0x1c6b79||0xc8;return function(_0x5403a3){if(_0x5403a3){return _0xf81809[_0xc583('0x19')](_0x1c6b79)['json'](_0x5403a3);}};}function respondWithFilteredResult(_0x19f46a,_0x299fa1){return function(_0x510090){if(_0x510090){var _0x263552=typeof _0x299fa1[_0xc583('0x1b')]==='undefined'&&typeof _0x299fa1[_0xc583('0x1c')]===_0xc583('0x1d');var _0x5127fa=_0x510090[_0xc583('0x1e')];var _0x8a2d84=_0x263552?0x0:_0x299fa1[_0xc583('0x1b')];var _0x36e0fd=_0x263552?_0x510090['count']:_0x299fa1[_0xc583('0x1b')]+_0x299fa1['limit'];var _0x227ec2;if(_0x36e0fd>=_0x5127fa){_0x36e0fd=_0x5127fa;_0x227ec2=0xc8;}else{_0x227ec2=0xce;}_0x19f46a[_0xc583('0x19')](_0x227ec2);return _0x19f46a[_0xc583('0x1f')](_0xc583('0x20'),_0x8a2d84+'-'+_0x36e0fd+'/'+_0x5127fa)[_0xc583('0x21')](_0x510090);}return null;};}function patchUpdates(_0x12b910){return function(_0x3ce81b){try{jsonpatch[_0xc583('0x22')](_0x3ce81b,_0x12b910,!![]);}catch(_0x37fcd4){return BPromise[_0xc583('0x23')](_0x37fcd4);}return _0x3ce81b[_0xc583('0x24')]();};}function saveUpdates(_0x3b31bc,_0x21466f){return function(_0x478ee1){if(_0x478ee1){return _0x478ee1['update'](_0x3b31bc)[_0xc583('0x25')](function(_0x3e075c){return _0x3e075c;});}return null;};}function removeEntity(_0x8443dc,_0x5ceef1){return function(_0x1521e2){if(_0x1521e2){return _0x1521e2[_0xc583('0x26')]()[_0xc583('0x25')](function(){_0x8443dc[_0xc583('0x19')](0xcc)[_0xc583('0x1a')]();});}};}function handleEntityNotFound(_0x48c95e,_0x4cad36){return function(_0x45871c){if(!_0x45871c){_0x48c95e['sendStatus'](0x194);}return _0x45871c;};}function handleError(_0x45ef74,_0xcbe9b2){_0xcbe9b2=_0xcbe9b2||0x1f4;return function(_0xbabf24){logger[_0xc583('0x27')](_0xbabf24[_0xc583('0x28')]);if(_0xbabf24['name']){delete _0xbabf24[_0xc583('0x29')];}_0x45ef74[_0xc583('0x19')](_0xcbe9b2)['send'](_0xbabf24);};}exports[_0xc583('0x2a')]=function(_0x483357,_0x2c9088){var _0x8d4ecb={},_0x1c80b1={},_0x3ed083={'count':0x0,'rows':[]};var _0x1b2b49=_[_0xc583('0x2b')](db[_0xc583('0x2c')]['rawAttributes'],function(_0x529dbe){return{'name':_0x529dbe[_0xc583('0x2d')],'type':_0x529dbe[_0xc583('0x2e')][_0xc583('0x2f')]};});_0x1c80b1[_0xc583('0x30')]=_[_0xc583('0x2b')](_0x1b2b49,'name');_0x1c80b1[_0xc583('0x31')]=_['keys'](_0x483357['query']);_0x1c80b1[_0xc583('0x32')]=_[_0xc583('0x33')](_0x1c80b1[_0xc583('0x30')],_0x1c80b1[_0xc583('0x31')]);_0x8d4ecb[_0xc583('0x34')]=_['intersection'](_0x1c80b1[_0xc583('0x30')],qs[_0xc583('0x35')](_0x483357[_0xc583('0x31')]['fields']));_0x8d4ecb[_0xc583('0x34')]=_0x8d4ecb['attributes'][_0xc583('0x36')]?_0x8d4ecb[_0xc583('0x34')]:_0x1c80b1[_0xc583('0x30')];if(!_0x483357[_0xc583('0x31')][_0xc583('0x37')]('nolimit')){_0x8d4ecb[_0xc583('0x1c')]=qs['limit'](_0x483357[_0xc583('0x31')]['limit']);_0x8d4ecb[_0xc583('0x1b')]=qs[_0xc583('0x1b')](_0x483357[_0xc583('0x31')][_0xc583('0x1b')]);}_0x8d4ecb[_0xc583('0x38')]=qs[_0xc583('0x39')](_0x483357['query']['sort']);_0x8d4ecb[_0xc583('0x3a')]=qs[_0xc583('0x32')](_['pick'](_0x483357[_0xc583('0x31')],_0x1c80b1[_0xc583('0x32')]),_0x1b2b49);if(_0x483357[_0xc583('0x31')][_0xc583('0x3b')]){_0x8d4ecb[_0xc583('0x3a')]=_[_0xc583('0x3c')](_0x8d4ecb['where'],{'$or':_[_0xc583('0x2b')](_0x1b2b49,function(_0x595351){if(_0x595351[_0xc583('0x2e')]!==_0xc583('0x3d')){var _0x39bed4={};_0x39bed4[_0x595351['name']]={'$like':'%'+_0x483357['query']['filter']+'%'};return _0x39bed4;}})});}_0x8d4ecb=_[_0xc583('0x3c')]({},_0x8d4ecb,_0x483357[_0xc583('0x3e')]);var _0x2b957d={'where':_0x8d4ecb[_0xc583('0x3a')]};return db['MailQueueReport'][_0xc583('0x1e')](_0x2b957d)[_0xc583('0x25')](function(_0x594a0b){_0x3ed083['count']=_0x594a0b;if(_0x483357[_0xc583('0x31')]['includeAll']){_0x8d4ecb[_0xc583('0x3f')]=[{'all':!![]}];}return db[_0xc583('0x2c')][_0xc583('0x40')](_0x8d4ecb);})[_0xc583('0x25')](function(_0x58553e){_0x3ed083[_0xc583('0x41')]=_0x58553e;return _0x3ed083;})[_0xc583('0x25')](respondWithFilteredResult(_0x2c9088,_0x8d4ecb))[_0xc583('0x42')](handleError(_0x2c9088,null));};exports[_0xc583('0x43')]=function(_0x2c1c22,_0x5e6e7e){var _0x3ffeb7={'raw':!![],'where':{'id':_0x2c1c22['params']['id']}},_0x5f5a97={};_0x5f5a97[_0xc583('0x30')]=_[_0xc583('0x44')](db['MailQueueReport']['rawAttributes']);_0x5f5a97[_0xc583('0x31')]=_[_0xc583('0x44')](_0x2c1c22[_0xc583('0x31')]);_0x5f5a97[_0xc583('0x32')]=_['intersection'](_0x5f5a97[_0xc583('0x30')],_0x5f5a97['query']);_0x3ffeb7[_0xc583('0x34')]=_['intersection'](_0x5f5a97[_0xc583('0x30')],qs[_0xc583('0x35')](_0x2c1c22[_0xc583('0x31')][_0xc583('0x35')]));_0x3ffeb7[_0xc583('0x34')]=_0x3ffeb7['attributes'][_0xc583('0x36')]?_0x3ffeb7[_0xc583('0x34')]:_0x5f5a97[_0xc583('0x30')];if(_0x2c1c22['query']['includeAll']){_0x3ffeb7['include']=[{'all':!![]}];}_0x3ffeb7=_[_0xc583('0x3c')]({},_0x3ffeb7,_0x2c1c22['options']);return db[_0xc583('0x2c')][_0xc583('0x45')](_0x3ffeb7)[_0xc583('0x25')](handleEntityNotFound(_0x5e6e7e,null))[_0xc583('0x25')](respondWithResult(_0x5e6e7e,null))[_0xc583('0x42')](handleError(_0x5e6e7e,null));};exports[_0xc583('0x46')]=function(_0x302038,_0x32cfbf){return db[_0xc583('0x2c')][_0xc583('0x46')](_0x302038[_0xc583('0x47')],{})['then'](respondWithResult(_0x32cfbf,0xc9))[_0xc583('0x42')](handleError(_0x32cfbf,null));};exports[_0xc583('0x48')]=function(_0x453df7,_0x230a45){if(_0x453df7['body']['id']){delete _0x453df7[_0xc583('0x47')]['id'];}return db[_0xc583('0x2c')][_0xc583('0x45')]({'where':{'id':_0x453df7[_0xc583('0x49')]['id']}})[_0xc583('0x25')](handleEntityNotFound(_0x230a45,null))[_0xc583('0x25')](saveUpdates(_0x453df7[_0xc583('0x47')],null))[_0xc583('0x25')](respondWithResult(_0x230a45,null))[_0xc583('0x42')](handleError(_0x230a45,null));};exports['destroy']=function(_0x1f4901,_0x1919fa){return db[_0xc583('0x2c')][_0xc583('0x45')]({'where':{'id':_0x1f4901[_0xc583('0x49')]['id']}})[_0xc583('0x25')](handleEntityNotFound(_0x1919fa,null))[_0xc583('0x25')](removeEntity(_0x1919fa,null))[_0xc583('0x42')](handleError(_0x1919fa,null));};exports[_0xc583('0x4a')]=function(_0xa03d53,_0x1a0f91){return db[_0xc583('0x2c')][_0xc583('0x4a')]()['then'](respondWithResult(_0x1a0f91,null))[_0xc583('0x42')](handleError(_0x1a0f91,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 78ffc33..086081c 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 _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 +var _0xf4da=['bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x2db1cb,_0x29c234){var _0x4a403b=function(_0x1b8d88){while(--_0x1b8d88){_0x2db1cb['push'](_0x2db1cb['shift']());}};_0x4a403b(++_0x29c234);}(_0xf4da,0x190));var _0xaf4d=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xf4da[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0xaf4d('0x0'));var util=require(_0xaf4d('0x1'));var logger=require(_0xaf4d('0x2'))(_0xaf4d('0x3'));var moment=require(_0xaf4d('0x4'));var BPromise=require(_0xaf4d('0x5'));var rp=require(_0xaf4d('0x6'));var fs=require('fs');var path=require(_0xaf4d('0x7'));var rimraf=require(_0xaf4d('0x8'));var config=require(_0xaf4d('0x9'));var attributes=require(_0xaf4d('0xa'));module['exports']=function(_0x3a9d67,_0x4e3b72){return _0x3a9d67[_0xaf4d('0xb')](_0xaf4d('0xc'),attributes,{'tableName':_0xaf4d('0xd'),'paranoid':![],'indexes':[{'name':_0xaf4d('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 10f1285..4fbb875 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 _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 +var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0xb3eeb,_0xb365f3){var _0x5d6853=function(_0x34e808){while(--_0x34e808){_0xb3eeb['push'](_0xb3eeb['shift']());}};_0x5d6853(++_0xb365f3);}(_0xadb5,0xad));var _0x5adb=function(_0x5eccfb,_0x3699a6){_0x5eccfb=_0x5eccfb-0x0;var _0x2a3eec=_0xadb5[_0x5eccfb];return _0x2a3eec;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index a5c2bc2..2dfb998 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 _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 +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1be899,_0x5f3791){var _0x26832b=function(_0x2497e4){while(--_0x2497e4){_0x1be899['push'](_0x1be899['shift']());}};_0x26832b(++_0x5f3791);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1c7889,_0x24cd26){_0x1c7889=_0x1c7889-0x0;var _0x2f14e5=_0xcb91[_0x1c7889];return _0x2f14e5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 45e01db..e4e63bb 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 _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 +var _0x3752=['INBOX','STRING','BOOLEAN','INTEGER'];(function(_0x1c4409,_0x3b2e8f){var _0x356d8f=function(_0xae43bf){while(--_0xae43bf){_0x1c4409['push'](_0x1c4409['shift']());}};_0x356d8f(++_0x3b2e8f);}(_0x3752,0x1b5));var _0x2375=function(_0x45b36c,_0x4efbfe){_0x45b36c=_0x45b36c-0x0;var _0x1dad2f=_0x3752[_0x45b36c];return _0x1dad2f;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x2375('0x0')]},'host':{'type':Sequelize[_0x2375('0x0')]},'authentication':{'type':Sequelize[_0x2375('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x2375('0x0')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x2375('0x2')]},'tls':{'type':Sequelize[_0x2375('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x2375('0x0')],'defaultValue':_0x2375('0x3')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x2375('0x2')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 5cd3856..763a0b2 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 _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 +var _0xfdc8=['moment','bluebird','request-promise','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','api'];(function(_0x48cec3,_0x41e212){var _0x3093c6=function(_0x1d75e1){while(--_0x1d75e1){_0x48cec3['push'](_0x48cec3['shift']());}};_0x3093c6(++_0x41e212);}(_0xfdc8,0x15d));var _0x8fdc=function(_0x2962b4,_0x4b0786){_0x2962b4=_0x2962b4-0x0;var _0x411b7d=_0xfdc8[_0x2962b4];return _0x411b7d;};'use strict';var _=require(_0x8fdc('0x0'));var util=require(_0x8fdc('0x1'));var logger=require('../../config/logger')(_0x8fdc('0x2'));var moment=require(_0x8fdc('0x3'));var BPromise=require(_0x8fdc('0x4'));var rp=require(_0x8fdc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8fdc('0x6'));module[_0x8fdc('0x7')]=function(_0x258311,_0x4a2330){return _0x258311[_0x8fdc('0x8')](_0x8fdc('0x9'),attributes,{'tableName':_0x8fdc('0xa'),'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 b06f89a..f48b45e 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 _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 +var _0xde4a=['info','catch','GetMailServerIn','MailServerIn','options','limit','map','include','model','attributes','lodash','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailServerIn,\x20%s,\x20%s'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xde4a,0x1e6));var _0xade4=function(_0x239868,_0x52e2cc){_0x239868=_0x239868-0x0;var _0x41bd21=_0xde4a[_0x239868];return _0x41bd21;};'use strict';var _=require(_0xade4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xade4('0x1'));var rs=require(_0xade4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xade4('0x3'))(_0xade4('0x4'));var config=require(_0xade4('0x5'));var jayson=require(_0xade4('0x6'));var client=jayson[_0xade4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48ceac,_0x4b6fc,_0xb356b){return new BPromise(function(_0x461182,_0x5c2af8){return client[_0xade4('0x8')](_0x48ceac,_0xb356b)[_0xade4('0x9')](function(_0x14ea31){logger['info']('MailServerIn,\x20%s,\x20%s',_0x4b6fc,_0xade4('0xa'));logger[_0xade4('0xb')](_0xade4('0xc'),_0x4b6fc,'request\x20sent',JSON[_0xade4('0xd')](_0x14ea31));if(_0x14ea31[_0xade4('0xe')]){if(_0x14ea31[_0xade4('0xe')][_0xade4('0xf')]===0x1f4){logger[_0xade4('0xe')]('MailServerIn,\x20%s,\x20%s',_0x4b6fc,_0x14ea31[_0xade4('0xe')][_0xade4('0x10')]);return _0x5c2af8(_0x14ea31['error'][_0xade4('0x10')]);}logger['error'](_0xade4('0x11'),_0x4b6fc,_0x14ea31[_0xade4('0xe')][_0xade4('0x10')]);return _0x461182(_0x14ea31[_0xade4('0xe')]['message']);}else{logger[_0xade4('0x12')](_0xade4('0x11'),_0x4b6fc,_0xade4('0xa'));_0x461182(_0x14ea31['result'][_0xade4('0x10')]);}})[_0xade4('0x13')](function(_0x2ba5b5){logger[_0xade4('0xe')](_0xade4('0x11'),_0x4b6fc,_0x2ba5b5);_0x5c2af8(_0x2ba5b5);});});}exports[_0xade4('0x14')]=function(_0x5110b1){var _0x24353c=this;return new Promise(function(_0x384332,_0x191030){return db[_0xade4('0x15')]['findAll']({'raw':_0x5110b1[_0xade4('0x16')]?_0x5110b1['options']['raw']===undefined?!![]:![]:!![],'where':_0x5110b1[_0xade4('0x16')]?_0x5110b1['options']['where']||null:null,'attributes':_0x5110b1[_0xade4('0x16')]?_0x5110b1[_0xade4('0x16')]['attributes']||null:null,'limit':_0x5110b1[_0xade4('0x16')]?_0x5110b1[_0xade4('0x16')][_0xade4('0x17')]||null:null,'include':_0x5110b1[_0xade4('0x16')]?_0x5110b1['options']['include']?_[_0xade4('0x18')](_0x5110b1[_0xade4('0x16')][_0xade4('0x19')],function(_0x1cad4b){return{'model':db[_0x1cad4b['model']],'as':_0x1cad4b['as'],'attributes':_0x1cad4b['attributes'],'include':_0x1cad4b[_0xade4('0x19')]?_[_0xade4('0x18')](_0x1cad4b[_0xade4('0x19')],function(_0x6705ac){return{'model':db[_0x6705ac[_0xade4('0x1a')]],'as':_0x6705ac['as'],'attributes':_0x6705ac['attributes'],'include':_0x6705ac['include']?_[_0xade4('0x18')](_0x6705ac[_0xade4('0x19')],function(_0x2af3d8){return{'model':db[_0x2af3d8['model']],'as':_0x2af3d8['as'],'attributes':_0x2af3d8[_0xade4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xade4('0x9')](function(_0xa7280e){logger[_0xade4('0x12')](_0xade4('0x14'),_0x5110b1);logger[_0xade4('0xb')](_0xade4('0x14'),_0x5110b1,JSON[_0xade4('0xd')](_0xa7280e));_0x384332(_0xa7280e);})['catch'](function(_0x5b86a4){logger[_0xade4('0xe')](_0xade4('0x14'),_0x5b86a4['message'],_0x5110b1);_0x191030(_0x24353c[_0xade4('0xe')](0x1f4,_0x5b86a4['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 4365eb4..02b838a 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(_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 +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(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_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 diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index a3a9212..28c8b9c 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 _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 +var _0x7af2=['BOOLEAN','exports','STRING','INTEGER'];(function(_0x2302ec,_0x584a71){var _0x3fa449=function(_0x571980){while(--_0x571980){_0x2302ec['push'](_0x2302ec['shift']());}};_0x3fa449(++_0x584a71);}(_0x7af2,0x119));var _0x27af=function(_0x12c8bd,_0x2110d0){_0x12c8bd=_0x12c8bd-0x0;var _0x2d5faf=_0x7af2[_0x12c8bd];return _0x2d5faf;};'use strict';var Sequelize=require('sequelize');module[_0x27af('0x0')]={'description':{'type':Sequelize[_0x27af('0x1')]},'host':{'type':Sequelize[_0x27af('0x1')]},'user':{'type':Sequelize[_0x27af('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x27af('0x2')]},'secure':{'type':Sequelize[_0x27af('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x27af('0x1')]},'authentication':{'type':Sequelize[_0x27af('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x27af('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 bcf90c0..bdded33 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 _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 +var _0x496b=['ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','offset','count','apply','reject','save','update','then','end','error','stack','send','map','MailServerOut','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','name','filter','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x96b765,_0x3909ff){var _0x697963=function(_0x3f2401){while(--_0x3f2401){_0x96b765['push'](_0x96b765['shift']());}};_0x697963(++_0x3909ff);}(_0x496b,0xd4));var _0xb496=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x496b[_0x403c20];return _0x2b271a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb496('0x0'));var zipdir=require(_0xb496('0x1'));var jsonpatch=require(_0xb496('0x2'));var rp=require(_0xb496('0x3'));var moment=require(_0xb496('0x4'));var BPromise=require(_0xb496('0x5'));var Mustache=require(_0xb496('0x6'));var util=require(_0xb496('0x7'));var path=require(_0xb496('0x8'));var sox=require('sox');var csv=require(_0xb496('0x9'));var ejs=require(_0xb496('0xa'));var fs=require('fs');var fs_extra=require(_0xb496('0xb'));var _=require(_0xb496('0xc'));var squel=require(_0xb496('0xd'));var crypto=require(_0xb496('0xe'));var jsforce=require(_0xb496('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb496('0x10'));var Redis=require(_0xb496('0x11'));var authService=require(_0xb496('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb496('0x13'));var logger=require(_0xb496('0x14'))(_0xb496('0x15'));var utils=require('../../config/utils');var config=require(_0xb496('0x16'));var licenseUtil=require(_0xb496('0x17'));var db=require(_0xb496('0x18'))['db'];function respondWithStatusCode(_0x4030de,_0x4c7cd0){_0x4c7cd0=_0x4c7cd0||0xcc;return function(_0x3c2ad7){if(_0x3c2ad7){return _0x4030de[_0xb496('0x19')](_0x4c7cd0);}return _0x4030de[_0xb496('0x1a')](_0x4c7cd0)['end']();};}function respondWithResult(_0x25f36e,_0x19f991){_0x19f991=_0x19f991||0xc8;return function(_0x23e37e){if(_0x23e37e){return _0x25f36e[_0xb496('0x1a')](_0x19f991)['json'](_0x23e37e);}};}function respondWithFilteredResult(_0x51c7cd,_0x2576f4){return function(_0x516614){if(_0x516614){var _0x102b35=typeof _0x2576f4['offset']===_0xb496('0x1b')&&typeof _0x2576f4['limit']===_0xb496('0x1b');var _0x51aa72=_0x516614['count'];var _0xcc1e64=_0x102b35?0x0:_0x2576f4[_0xb496('0x1c')];var _0x47f50e=_0x102b35?_0x516614[_0xb496('0x1d')]:_0x2576f4[_0xb496('0x1c')]+_0x2576f4['limit'];var _0x5ea9dd;if(_0x47f50e>=_0x51aa72){_0x47f50e=_0x51aa72;_0x5ea9dd=0xc8;}else{_0x5ea9dd=0xce;}_0x51c7cd[_0xb496('0x1a')](_0x5ea9dd);return _0x51c7cd['set']('Content-Range',_0xcc1e64+'-'+_0x47f50e+'/'+_0x51aa72)['json'](_0x516614);}return null;};}function patchUpdates(_0x56116d){return function(_0x1d5cc6){try{jsonpatch[_0xb496('0x1e')](_0x1d5cc6,_0x56116d,!![]);}catch(_0x437ce1){return BPromise[_0xb496('0x1f')](_0x437ce1);}return _0x1d5cc6[_0xb496('0x20')]();};}function saveUpdates(_0x4b5fe2,_0x342a61){return function(_0x374657){if(_0x374657){return _0x374657[_0xb496('0x21')](_0x4b5fe2)[_0xb496('0x22')](function(_0x1a4837){return _0x1a4837;});}return null;};}function removeEntity(_0xe8507f,_0x24b1fb){return function(_0x57e452){if(_0x57e452){return _0x57e452['destroy']()[_0xb496('0x22')](function(){_0xe8507f[_0xb496('0x1a')](0xcc)[_0xb496('0x23')]();});}};}function handleEntityNotFound(_0x11e925,_0x535ffa){return function(_0x590850){if(!_0x590850){_0x11e925[_0xb496('0x19')](0x194);}return _0x590850;};}function handleError(_0x34f272,_0x2e66d4){_0x2e66d4=_0x2e66d4||0x1f4;return function(_0x1f9e82){logger[_0xb496('0x24')](_0x1f9e82[_0xb496('0x25')]);if(_0x1f9e82['name']){delete _0x1f9e82['name'];}_0x34f272[_0xb496('0x1a')](_0x2e66d4)[_0xb496('0x26')](_0x1f9e82);};}exports['index']=function(_0x34debf,_0x56ac3c){var _0x5d6e11={},_0x570443={},_0x316932={'count':0x0,'rows':[]};var _0x1fdca0=_[_0xb496('0x27')](db[_0xb496('0x28')]['rawAttributes'],function(_0x43f0ce){return{'name':_0x43f0ce[_0xb496('0x29')],'type':_0x43f0ce[_0xb496('0x2a')][_0xb496('0x2b')]};});_0x570443[_0xb496('0x2c')]=_[_0xb496('0x27')](_0x1fdca0,'name');_0x570443['query']=_[_0xb496('0x2d')](_0x34debf['query']);_0x570443[_0xb496('0x2e')]=_[_0xb496('0x2f')](_0x570443[_0xb496('0x2c')],_0x570443[_0xb496('0x30')]);_0x5d6e11['attributes']=_['intersection'](_0x570443[_0xb496('0x2c')],qs[_0xb496('0x31')](_0x34debf[_0xb496('0x30')][_0xb496('0x31')]));_0x5d6e11[_0xb496('0x32')]=_0x5d6e11[_0xb496('0x32')][_0xb496('0x33')]?_0x5d6e11['attributes']:_0x570443['model'];if(!_0x34debf[_0xb496('0x30')][_0xb496('0x34')](_0xb496('0x35'))){_0x5d6e11['limit']=qs[_0xb496('0x36')](_0x34debf[_0xb496('0x30')][_0xb496('0x36')]);_0x5d6e11[_0xb496('0x1c')]=qs[_0xb496('0x1c')](_0x34debf[_0xb496('0x30')][_0xb496('0x1c')]);}_0x5d6e11[_0xb496('0x37')]=qs[_0xb496('0x38')](_0x34debf[_0xb496('0x30')][_0xb496('0x38')]);_0x5d6e11[_0xb496('0x39')]=qs[_0xb496('0x2e')](_[_0xb496('0x3a')](_0x34debf['query'],_0x570443['filters']),_0x1fdca0);if(_0x34debf[_0xb496('0x30')]['filter']){_0x5d6e11[_0xb496('0x39')]=_[_0xb496('0x3b')](_0x5d6e11[_0xb496('0x39')],{'$or':_[_0xb496('0x27')](_0x1fdca0,function(_0x3ac217){if(_0x3ac217[_0xb496('0x2a')]!=='VIRTUAL'){var _0x385a3f={};_0x385a3f[_0x3ac217[_0xb496('0x3c')]]={'$like':'%'+_0x34debf[_0xb496('0x30')][_0xb496('0x3d')]+'%'};return _0x385a3f;}})});}_0x5d6e11=_[_0xb496('0x3b')]({},_0x5d6e11,_0x34debf['options']);var _0x452ecb={'where':_0x5d6e11[_0xb496('0x39')]};return db[_0xb496('0x28')][_0xb496('0x1d')](_0x452ecb)[_0xb496('0x22')](function(_0x5c455b){_0x316932['count']=_0x5c455b;if(_0x34debf[_0xb496('0x30')][_0xb496('0x3e')]){_0x5d6e11[_0xb496('0x3f')]=[{'all':!![]}];}return db[_0xb496('0x28')][_0xb496('0x40')](_0x5d6e11);})[_0xb496('0x22')](function(_0x32cefd){_0x316932[_0xb496('0x41')]=_0x32cefd;return _0x316932;})['then'](respondWithFilteredResult(_0x56ac3c,_0x5d6e11))[_0xb496('0x42')](handleError(_0x56ac3c,null));};exports['show']=function(_0x1a0501,_0x365fea){var _0x36d183={'raw':!![],'where':{'id':_0x1a0501[_0xb496('0x43')]['id']}},_0x3a690f={};_0x3a690f[_0xb496('0x2c')]=_[_0xb496('0x2d')](db[_0xb496('0x28')][_0xb496('0x44')]);_0x3a690f['query']=_[_0xb496('0x2d')](_0x1a0501[_0xb496('0x30')]);_0x3a690f[_0xb496('0x2e')]=_['intersection'](_0x3a690f[_0xb496('0x2c')],_0x3a690f[_0xb496('0x30')]);_0x36d183[_0xb496('0x32')]=_['intersection'](_0x3a690f[_0xb496('0x2c')],qs['fields'](_0x1a0501['query'][_0xb496('0x31')]));_0x36d183[_0xb496('0x32')]=_0x36d183[_0xb496('0x32')][_0xb496('0x33')]?_0x36d183[_0xb496('0x32')]:_0x3a690f[_0xb496('0x2c')];if(_0x1a0501['query'][_0xb496('0x3e')]){_0x36d183[_0xb496('0x3f')]=[{'all':!![]}];}_0x36d183=_['merge']({},_0x36d183,_0x1a0501[_0xb496('0x45')]);return db[_0xb496('0x28')][_0xb496('0x46')](_0x36d183)['then'](handleEntityNotFound(_0x365fea,null))[_0xb496('0x22')](respondWithResult(_0x365fea,null))[_0xb496('0x42')](handleError(_0x365fea,null));};exports[_0xb496('0x47')]=function(_0x511dd1,_0x6fd789){return db[_0xb496('0x28')]['create'](_0x511dd1['body'],{})['then'](respondWithResult(_0x6fd789,0xc9))['catch'](handleError(_0x6fd789,null));};exports[_0xb496('0x21')]=function(_0x46f0fe,_0xc422ff){if(_0x46f0fe[_0xb496('0x48')]['id']){delete _0x46f0fe[_0xb496('0x48')]['id'];}return db[_0xb496('0x28')][_0xb496('0x46')]({'where':{'id':_0x46f0fe['params']['id']}})[_0xb496('0x22')](handleEntityNotFound(_0xc422ff,null))[_0xb496('0x22')](saveUpdates(_0x46f0fe[_0xb496('0x48')],null))[_0xb496('0x22')](respondWithResult(_0xc422ff,null))[_0xb496('0x42')](handleError(_0xc422ff,null));};exports[_0xb496('0x49')]=function(_0x12a8aa,_0x2101ce){return db[_0xb496('0x28')][_0xb496('0x46')]({'where':{'id':_0x12a8aa[_0xb496('0x43')]['id']}})[_0xb496('0x22')](handleEntityNotFound(_0x2101ce,null))['then'](removeEntity(_0x2101ce,null))[_0xb496('0x42')](handleError(_0x2101ce,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 7374059..6bf46ba 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 _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 +var _0xc8f2=['exports','MailServerOut','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2904a4,_0x591694){var _0x45cf5d=function(_0x4f8c0c){while(--_0x4f8c0c){_0x2904a4['push'](_0x2904a4['shift']());}};_0x45cf5d(++_0x591694);}(_0xc8f2,0x1e2));var _0x2c8f=function(_0x2b6cdc,_0x5c0d98){_0x2b6cdc=_0x2b6cdc-0x0;var _0x31bd91=_0xc8f2[_0x2b6cdc];return _0x31bd91;};'use strict';var _=require(_0x2c8f('0x0'));var util=require(_0x2c8f('0x1'));var logger=require(_0x2c8f('0x2'))('api');var moment=require(_0x2c8f('0x3'));var BPromise=require(_0x2c8f('0x4'));var rp=require(_0x2c8f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2c8f('0x6'));var config=require(_0x2c8f('0x7'));var attributes=require('./mailServerOut.attributes');module[_0x2c8f('0x8')]=function(_0x5458bd,_0x50d660){return _0x5458bd['define'](_0x2c8f('0x9'),attributes,{'tableName':'mail_servers_out','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 755cf27..2f4cd56 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 _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 +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x1fa477,_0x2d78b6){var _0x9772cb=function(_0x1f103f){while(--_0x1f103f){_0x1fa477['push'](_0x1fa477['shift']());}};_0x9772cb(++_0x2d78b6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x58336c,_0x2c1cf3){_0x58336c=_0x58336c-0x0;var _0x18a1fb=_0x5f2f[_0x58336c];return _0x18a1fb;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index bb44214..47ab11d 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 _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 +var _0x2fc9=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout'];(function(_0x5c52f3,_0xdeb088){var _0x26046c=function(_0x226acb){while(--_0x226acb){_0x5c52f3['push'](_0x5c52f3['shift']());}};_0x26046c(++_0xdeb088);}(_0x2fc9,0x123));var _0x92fc=function(_0x26b622,_0x237e9e){_0x26b622=_0x26b622-0x0;var _0x58a028=_0x2fc9[_0x26b622];return _0x58a028;};'use strict';var multer=require(_0x92fc('0x0'));var util=require(_0x92fc('0x1'));var path=require('path');var timeout=require(_0x92fc('0x2'));var express=require('express');var router=express[_0x92fc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x92fc('0x4'));var interaction=require(_0x92fc('0x5'));var config=require(_0x92fc('0x6'));var controller=require('./mailSubstatus.controller');router[_0x92fc('0x7')]('/',auth[_0x92fc('0x8')](),controller[_0x92fc('0x9')]);router[_0x92fc('0x7')](_0x92fc('0xa'),auth[_0x92fc('0x8')](),controller[_0x92fc('0xb')]);router[_0x92fc('0x7')]('/:id',auth[_0x92fc('0x8')](),controller[_0x92fc('0xc')]);router[_0x92fc('0xd')]('/',auth['isAuthenticated'](),controller[_0x92fc('0xe')]);router[_0x92fc('0xf')]('/:id',auth[_0x92fc('0x8')](),controller[_0x92fc('0x10')]);router[_0x92fc('0x11')](_0x92fc('0x12'),auth[_0x92fc('0x8')](),controller[_0x92fc('0x13')]);module[_0x92fc('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 85a12d9..eadfddb 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 _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 +var _0x6c7b=['STRING','sequelize'];(function(_0x909a37,_0x4f6441){var _0x540ad6=function(_0xd3ae30){while(--_0xd3ae30){_0x909a37['push'](_0x909a37['shift']());}};_0x540ad6(++_0x4f6441);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x4ae488,_0x39896e){_0x4ae488=_0x4ae488-0x0;var _0x145f8b=_0x6c7b[_0x4ae488];return _0x145f8b;};'use strict';var Sequelize=require(_0xb6c7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb6c7('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 69baffe..67d0782 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 _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 +var _0xeda1=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','map','MailSubstatus','rawAttributes','fieldName','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','show','params','intersection','length','include','find','body','catch','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xeda1,0x1c6));var _0x1eda=function(_0x34def0,_0x554b5b){_0x34def0=_0x34def0-0x0;var _0x2be1c9=_0xeda1[_0x34def0];return _0x2be1c9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1eda('0x0'));var jsonpatch=require(_0x1eda('0x1'));var rp=require(_0x1eda('0x2'));var moment=require(_0x1eda('0x3'));var BPromise=require(_0x1eda('0x4'));var Mustache=require(_0x1eda('0x5'));var util=require(_0x1eda('0x6'));var path=require('path');var sox=require(_0x1eda('0x7'));var csv=require(_0x1eda('0x8'));var ejs=require(_0x1eda('0x9'));var fs=require('fs');var fs_extra=require(_0x1eda('0xa'));var _=require(_0x1eda('0xb'));var squel=require(_0x1eda('0xc'));var crypto=require('crypto');var jsforce=require(_0x1eda('0xd'));var deskjs=require(_0x1eda('0xe'));var toCsv=require(_0x1eda('0x8'));var querystring=require(_0x1eda('0xf'));var Papa=require(_0x1eda('0x10'));var Redis=require(_0x1eda('0x11'));var authService=require(_0x1eda('0x12'));var qs=require(_0x1eda('0x13'));var as=require(_0x1eda('0x14'));var hardwareService=require(_0x1eda('0x15'));var logger=require(_0x1eda('0x16'))(_0x1eda('0x17'));var utils=require(_0x1eda('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1eda('0x19'));var db=require(_0x1eda('0x1a'))['db'];function respondWithStatusCode(_0x269c85,_0x4990b5){_0x4990b5=_0x4990b5||0xcc;return function(_0x49d1e2){if(_0x49d1e2){return _0x269c85[_0x1eda('0x1b')](_0x4990b5);}return _0x269c85['status'](_0x4990b5)[_0x1eda('0x1c')]();};}function respondWithResult(_0x184608,_0x1d1f57){_0x1d1f57=_0x1d1f57||0xc8;return function(_0x325e8e){if(_0x325e8e){return _0x184608[_0x1eda('0x1d')](_0x1d1f57)[_0x1eda('0x1e')](_0x325e8e);}};}function respondWithFilteredResult(_0x34904b,_0x45385a){return function(_0x546c17){if(_0x546c17){var _0x4f2fa4=typeof _0x45385a['offset']===_0x1eda('0x1f')&&typeof _0x45385a['limit']===_0x1eda('0x1f');var _0xf3161e=_0x546c17['count'];var _0x2517b5=_0x4f2fa4?0x0:_0x45385a[_0x1eda('0x20')];var _0x5e7bd1=_0x4f2fa4?_0x546c17[_0x1eda('0x21')]:_0x45385a['offset']+_0x45385a[_0x1eda('0x22')];var _0x41f7df;if(_0x5e7bd1>=_0xf3161e){_0x5e7bd1=_0xf3161e;_0x41f7df=0xc8;}else{_0x41f7df=0xce;}_0x34904b[_0x1eda('0x1d')](_0x41f7df);return _0x34904b[_0x1eda('0x23')](_0x1eda('0x24'),_0x2517b5+'-'+_0x5e7bd1+'/'+_0xf3161e)['json'](_0x546c17);}return null;};}function patchUpdates(_0x133665){return function(_0xc70dcb){try{jsonpatch[_0x1eda('0x25')](_0xc70dcb,_0x133665,!![]);}catch(_0x520f58){return BPromise[_0x1eda('0x26')](_0x520f58);}return _0xc70dcb[_0x1eda('0x27')]();};}function saveUpdates(_0x48d84f,_0x13ba9a){return function(_0x4cf334){if(_0x4cf334){return _0x4cf334[_0x1eda('0x28')](_0x48d84f)[_0x1eda('0x29')](function(_0x379f00){return _0x379f00;});}return null;};}function removeEntity(_0x431aef,_0x89fe13){return function(_0x127ebf){if(_0x127ebf){return _0x127ebf[_0x1eda('0x2a')]()[_0x1eda('0x29')](function(){_0x431aef[_0x1eda('0x1d')](0xcc)[_0x1eda('0x1c')]();});}};}function handleEntityNotFound(_0x49c640,_0x1af71f){return function(_0x2ad0f3){if(!_0x2ad0f3){_0x49c640['sendStatus'](0x194);}return _0x2ad0f3;};}function handleError(_0x160ae8,_0x2a05f0){_0x2a05f0=_0x2a05f0||0x1f4;return function(_0x8d1816){logger[_0x1eda('0x2b')](_0x8d1816['stack']);if(_0x8d1816[_0x1eda('0x2c')]){delete _0x8d1816[_0x1eda('0x2c')];}_0x160ae8[_0x1eda('0x1d')](_0x2a05f0)['send'](_0x8d1816);};}exports['index']=function(_0x974bf5,_0x157fe4){var _0x4d362f={},_0x26fd97={},_0x1caa17={'count':0x0,'rows':[]};var _0x2e405f=_[_0x1eda('0x2d')](db[_0x1eda('0x2e')][_0x1eda('0x2f')],function(_0x4f5c89){return{'name':_0x4f5c89[_0x1eda('0x30')],'type':_0x4f5c89['type'][_0x1eda('0x31')]};});_0x26fd97[_0x1eda('0x32')]=_[_0x1eda('0x2d')](_0x2e405f,_0x1eda('0x2c'));_0x26fd97[_0x1eda('0x33')]=_['keys'](_0x974bf5[_0x1eda('0x33')]);_0x26fd97[_0x1eda('0x34')]=_['intersection'](_0x26fd97[_0x1eda('0x32')],_0x26fd97['query']);_0x4d362f[_0x1eda('0x35')]=_['intersection'](_0x26fd97['model'],qs[_0x1eda('0x36')](_0x974bf5[_0x1eda('0x33')][_0x1eda('0x36')]));_0x4d362f['attributes']=_0x4d362f[_0x1eda('0x35')]['length']?_0x4d362f[_0x1eda('0x35')]:_0x26fd97['model'];if(!_0x974bf5[_0x1eda('0x33')][_0x1eda('0x37')](_0x1eda('0x38'))){_0x4d362f[_0x1eda('0x22')]=qs['limit'](_0x974bf5['query']['limit']);_0x4d362f['offset']=qs[_0x1eda('0x20')](_0x974bf5[_0x1eda('0x33')][_0x1eda('0x20')]);}_0x4d362f[_0x1eda('0x39')]=qs[_0x1eda('0x3a')](_0x974bf5[_0x1eda('0x33')][_0x1eda('0x3a')]);_0x4d362f[_0x1eda('0x3b')]=qs[_0x1eda('0x34')](_[_0x1eda('0x3c')](_0x974bf5[_0x1eda('0x33')],_0x26fd97[_0x1eda('0x34')]),_0x2e405f);if(_0x974bf5[_0x1eda('0x33')][_0x1eda('0x3d')]){_0x4d362f[_0x1eda('0x3b')]=_[_0x1eda('0x3e')](_0x4d362f[_0x1eda('0x3b')],{'$or':_[_0x1eda('0x2d')](_0x2e405f,function(_0x5bb0e2){if(_0x5bb0e2[_0x1eda('0x3f')]!==_0x1eda('0x40')){var _0x499d38={};_0x499d38[_0x5bb0e2['name']]={'$like':'%'+_0x974bf5['query'][_0x1eda('0x3d')]+'%'};return _0x499d38;}})});}_0x4d362f=_['merge']({},_0x4d362f,_0x974bf5[_0x1eda('0x41')]);var _0xc04387={'where':_0x4d362f[_0x1eda('0x3b')]};return db[_0x1eda('0x2e')][_0x1eda('0x21')](_0xc04387)[_0x1eda('0x29')](function(_0x49bb43){_0x1caa17[_0x1eda('0x21')]=_0x49bb43;if(_0x974bf5['query'][_0x1eda('0x42')]){_0x4d362f['include']=[{'all':!![]}];}return db[_0x1eda('0x2e')][_0x1eda('0x43')](_0x4d362f);})[_0x1eda('0x29')](function(_0x559304){_0x1caa17['rows']=_0x559304;return _0x1caa17;})[_0x1eda('0x29')](respondWithFilteredResult(_0x157fe4,_0x4d362f))['catch'](handleError(_0x157fe4,null));};exports[_0x1eda('0x44')]=function(_0x399926,_0xb63f63){var _0xd465f2={'raw':!![],'where':{'id':_0x399926[_0x1eda('0x45')]['id']}},_0x2b8ab5={};_0x2b8ab5[_0x1eda('0x32')]=_['keys'](db[_0x1eda('0x2e')][_0x1eda('0x2f')]);_0x2b8ab5['query']=_['keys'](_0x399926[_0x1eda('0x33')]);_0x2b8ab5['filters']=_[_0x1eda('0x46')](_0x2b8ab5[_0x1eda('0x32')],_0x2b8ab5[_0x1eda('0x33')]);_0xd465f2[_0x1eda('0x35')]=_[_0x1eda('0x46')](_0x2b8ab5[_0x1eda('0x32')],qs[_0x1eda('0x36')](_0x399926[_0x1eda('0x33')][_0x1eda('0x36')]));_0xd465f2['attributes']=_0xd465f2[_0x1eda('0x35')][_0x1eda('0x47')]?_0xd465f2[_0x1eda('0x35')]:_0x2b8ab5[_0x1eda('0x32')];if(_0x399926[_0x1eda('0x33')][_0x1eda('0x42')]){_0xd465f2[_0x1eda('0x48')]=[{'all':!![]}];}_0xd465f2=_['merge']({},_0xd465f2,_0x399926[_0x1eda('0x41')]);return db['MailSubstatus'][_0x1eda('0x49')](_0xd465f2)[_0x1eda('0x29')](handleEntityNotFound(_0xb63f63,null))['then'](respondWithResult(_0xb63f63,null))['catch'](handleError(_0xb63f63,null));};exports['create']=function(_0x433e60,_0xfe5b3d){return db[_0x1eda('0x2e')]['create'](_0x433e60[_0x1eda('0x4a')],{})['then'](respondWithResult(_0xfe5b3d,0xc9))[_0x1eda('0x4b')](handleError(_0xfe5b3d,null));};exports[_0x1eda('0x28')]=function(_0x17b653,_0x2f6476){if(_0x17b653[_0x1eda('0x4a')]['id']){delete _0x17b653[_0x1eda('0x4a')]['id'];}return db[_0x1eda('0x2e')]['find']({'where':{'id':_0x17b653[_0x1eda('0x45')]['id']}})['then'](handleEntityNotFound(_0x2f6476,null))[_0x1eda('0x29')](saveUpdates(_0x17b653[_0x1eda('0x4a')],null))[_0x1eda('0x29')](respondWithResult(_0x2f6476,null))[_0x1eda('0x4b')](handleError(_0x2f6476,null));};exports[_0x1eda('0x2a')]=function(_0x4ef94f,_0x4b7e51){return db[_0x1eda('0x2e')][_0x1eda('0x49')]({'where':{'id':_0x4ef94f[_0x1eda('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b7e51,null))[_0x1eda('0x29')](removeEntity(_0x4b7e51,null))[_0x1eda('0x4b')](handleError(_0x4b7e51,null));};exports[_0x1eda('0x4c')]=function(_0x3c27be,_0x249794){return db['MailSubstatus'][_0x1eda('0x4c')]()['then'](respondWithResult(_0x249794,null))['catch'](handleError(_0x249794,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index df261bb..70e870e 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 _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 +var _0xe706=['../../mysqldb','MailSubstatus','setMaxListeners','update','emit','exports'];(function(_0x3fdfb0,_0x1fb4e0){var _0x5ac97a=function(_0x3cef9b){while(--_0x3cef9b){_0x3fdfb0['push'](_0x3fdfb0['shift']());}};_0x5ac97a(++_0x1fb4e0);}(_0xe706,0xc0));var _0x6e70=function(_0x221f71,_0x221c04){_0x221f71=_0x221f71-0x0;var _0x2df2e5=_0xe706[_0x221f71];return _0x2df2e5;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x6e70('0x0'))['db'][_0x6e70('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x6e70('0x2')](0x0);var events={'afterUpdate':_0x6e70('0x3')};function emitEvent(_0x31110a){return function(_0x2fde8f,_0x5321c3,_0x27b455){MailSubstatusEvents[_0x6e70('0x4')](_0x31110a+':'+_0x2fde8f['id'],_0x2fde8f);MailSubstatusEvents[_0x6e70('0x4')](_0x31110a,_0x2fde8f);_0x27b455(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x6e70('0x5')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index c1c2265..6f78c6e 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 _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 +var _0x8347=['Condition','name','mailSubstatus','_previousDataValues','then','./mailSubstatus.attributes','define','MailSubstatus','mail_substatuses'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x8347,0x83));var _0x7834=function(_0x14ad1d,_0x3d669e){_0x14ad1d=_0x14ad1d-0x0;var _0x18dbbc=_0x8347[_0x14ad1d];return _0x18dbbc;};'use strict';var attributes=require(_0x7834('0x0'));module['exports']=function(_0x2ab221){var _0x3c43ee=_0x2ab221['models'];return _0x2ab221[_0x7834('0x1')](_0x7834('0x2'),attributes,{'tableName':_0x7834('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x149ff2,_0x432045,_0x3300f9){return _0x3c43ee[_0x7834('0x4')]['update']({'value':_0x149ff2[_0x7834('0x5')]},{'where':{'field':_0x7834('0x6'),'value':_0x149ff2[_0x7834('0x7')][_0x7834('0x5')]}})[_0x7834('0x8')](function(){_0x3300f9();})['catch'](function(_0x3cc5f9){_0x3300f9(_0x3cc5f9);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 424e211..0845365 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 _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 +var _0xf518=['jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1f91a5,_0x7d1387){var _0x5dff7c=function(_0x661bb3){while(--_0x661bb3){_0x1f91a5['push'](_0x1f91a5['shift']());}};_0x5dff7c(++_0x7d1387);}(_0xf518,0xd4));var _0x8f51=function(_0x416cdc,_0x213b87){_0x416cdc=_0x416cdc-0x0;var _0x1931ce=_0xf518[_0x416cdc];return _0x1931ce;};'use strict';var _=require('lodash');var util=require(_0x8f51('0x0'));var moment=require('moment');var BPromise=require(_0x8f51('0x1'));var rs=require(_0x8f51('0x2'));var fs=require('fs');var Redis=require(_0x8f51('0x3'));var db=require(_0x8f51('0x4'))['db'];var utils=require(_0x8f51('0x5'));var logger=require(_0x8f51('0x6'))(_0x8f51('0x7'));var config=require('../../config/environment');var jayson=require(_0x8f51('0x8'));var client=jayson[_0x8f51('0x9')][_0x8f51('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bd4e0,_0x49cfd9,_0x5ad58c){return new BPromise(function(_0x373c3f,_0xe4617){return client[_0x8f51('0xb')](_0x3bd4e0,_0x5ad58c)[_0x8f51('0xc')](function(_0x422f70){logger[_0x8f51('0xd')](_0x8f51('0xe'),_0x49cfd9,_0x8f51('0xf'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x49cfd9,_0x8f51('0xf'),JSON['stringify'](_0x422f70));if(_0x422f70[_0x8f51('0x10')]){if(_0x422f70[_0x8f51('0x10')][_0x8f51('0x11')]===0x1f4){logger[_0x8f51('0x10')](_0x8f51('0xe'),_0x49cfd9,_0x422f70[_0x8f51('0x10')][_0x8f51('0x12')]);return _0xe4617(_0x422f70[_0x8f51('0x10')][_0x8f51('0x12')]);}logger[_0x8f51('0x10')](_0x8f51('0xe'),_0x49cfd9,_0x422f70[_0x8f51('0x10')][_0x8f51('0x12')]);return _0x373c3f(_0x422f70[_0x8f51('0x10')]['message']);}else{logger[_0x8f51('0xd')](_0x8f51('0xe'),_0x49cfd9,_0x8f51('0xf'));_0x373c3f(_0x422f70['result'][_0x8f51('0x12')]);}})[_0x8f51('0x13')](function(_0x5d900d){logger[_0x8f51('0x10')](_0x8f51('0xe'),_0x49cfd9,_0x5d900d);_0xe4617(_0x5d900d);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index baef33d..f3b9435 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 _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 +var _0x07e0=['create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/:id','post'];(function(_0x43b6e9,_0x20f537){var _0x1a2e3e=function(_0x19e6e1){while(--_0x19e6e1){_0x43b6e9['push'](_0x43b6e9['shift']());}};_0x1a2e3e(++_0x20f537);}(_0x07e0,0x108));var _0x007e=function(_0x17b3d9,_0x2d9e5f){_0x17b3d9=_0x17b3d9-0x0;var _0x2acc46=_0x07e0[_0x17b3d9];return _0x2acc46;};'use strict';var multer=require(_0x007e('0x0'));var util=require(_0x007e('0x1'));var path=require(_0x007e('0x2'));var timeout=require(_0x007e('0x3'));var express=require(_0x007e('0x4'));var router=express[_0x007e('0x5')]();var fs_extra=require(_0x007e('0x6'));var auth=require(_0x007e('0x7'));var interaction=require(_0x007e('0x8'));var config=require(_0x007e('0x9'));var controller=require(_0x007e('0xa'));router[_0x007e('0xb')]('/',auth[_0x007e('0xc')](),controller[_0x007e('0xd')]);router[_0x007e('0xb')]('/describe',auth[_0x007e('0xc')](),controller['describe']);router['get'](_0x007e('0xe'),auth[_0x007e('0xc')](),controller['show']);router[_0x007e('0xf')]('/',auth[_0x007e('0xc')](),controller[_0x007e('0x10')]);router[_0x007e('0x11')]('/:id',auth[_0x007e('0xc')](),controller['update']);router['delete'](_0x007e('0xe'),auth[_0x007e('0xc')](),controller[_0x007e('0x12')]);module[_0x007e('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 1ae312f..c16ebcc 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 _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 +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x4a70df,_0x140683){var _0x526538=function(_0xaba988){while(--_0xaba988){_0x4a70df['push'](_0x4a70df['shift']());}};_0x526538(++_0x140683);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 7896cc8..a0677ec 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 _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 +var _0x1b65=['moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','zip-dir','request-promise'];(function(_0x49899b,_0x5993ef){var _0x14da54=function(_0x196c45){while(--_0x196c45){_0x49899b['push'](_0x49899b['shift']());}};_0x14da54(++_0x5993ef);}(_0x1b65,0x131));var _0x51b6=function(_0x52a397,_0x50af17){_0x52a397=_0x52a397-0x0;var _0x14f164=_0x1b65[_0x52a397];return _0x14f164;};'use strict';var emlformat=require(_0x51b6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x51b6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x51b6('0x2'));var moment=require(_0x51b6('0x3'));var BPromise=require(_0x51b6('0x4'));var Mustache=require(_0x51b6('0x5'));var util=require(_0x51b6('0x6'));var path=require(_0x51b6('0x7'));var sox=require('sox');var csv=require(_0x51b6('0x8'));var ejs=require(_0x51b6('0x9'));var fs=require('fs');var fs_extra=require(_0x51b6('0xa'));var _=require(_0x51b6('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x51b6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x51b6('0x8'));var querystring=require('querystring');var Papa=require(_0x51b6('0xd'));var Redis=require(_0x51b6('0xe'));var authService=require(_0x51b6('0xf'));var qs=require(_0x51b6('0x10'));var as=require(_0x51b6('0x11'));var hardwareService=require(_0x51b6('0x12'));var logger=require('../../config/logger')(_0x51b6('0x13'));var utils=require(_0x51b6('0x14'));var config=require(_0x51b6('0x15'));var licenseUtil=require(_0x51b6('0x16'));var db=require(_0x51b6('0x17'))['db'];function respondWithStatusCode(_0x37a9eb,_0x43c9d9){_0x43c9d9=_0x43c9d9||0xcc;return function(_0x309e0b){if(_0x309e0b){return _0x37a9eb[_0x51b6('0x18')](_0x43c9d9);}return _0x37a9eb[_0x51b6('0x19')](_0x43c9d9)[_0x51b6('0x1a')]();};}function respondWithResult(_0x541336,_0x5e7534){_0x5e7534=_0x5e7534||0xc8;return function(_0x3c892a){if(_0x3c892a){return _0x541336['status'](_0x5e7534)[_0x51b6('0x1b')](_0x3c892a);}};}function respondWithFilteredResult(_0x16dfa7,_0x3d1137){return function(_0x362e5a){if(_0x362e5a){var _0x5404ff=typeof _0x3d1137[_0x51b6('0x1c')]===_0x51b6('0x1d')&&typeof _0x3d1137[_0x51b6('0x1e')]===_0x51b6('0x1d');var _0x3d6017=_0x362e5a['count'];var _0x527fbb=_0x5404ff?0x0:_0x3d1137[_0x51b6('0x1c')];var _0x5d313f=_0x5404ff?_0x362e5a[_0x51b6('0x1f')]:_0x3d1137[_0x51b6('0x1c')]+_0x3d1137[_0x51b6('0x1e')];var _0x2bf911;if(_0x5d313f>=_0x3d6017){_0x5d313f=_0x3d6017;_0x2bf911=0xc8;}else{_0x2bf911=0xce;}_0x16dfa7[_0x51b6('0x19')](_0x2bf911);return _0x16dfa7[_0x51b6('0x20')](_0x51b6('0x21'),_0x527fbb+'-'+_0x5d313f+'/'+_0x3d6017)[_0x51b6('0x1b')](_0x362e5a);}return null;};}function patchUpdates(_0x71ec00){return function(_0x3bf912){try{jsonpatch[_0x51b6('0x22')](_0x3bf912,_0x71ec00,!![]);}catch(_0x28ae7a){return BPromise['reject'](_0x28ae7a);}return _0x3bf912[_0x51b6('0x23')]();};}function saveUpdates(_0x4b26ee,_0x1cb9ad){return function(_0x57450f){if(_0x57450f){return _0x57450f['update'](_0x4b26ee)[_0x51b6('0x24')](function(_0x4f14dd){return _0x4f14dd;});}return null;};}function removeEntity(_0x55d517,_0x3054bf){return function(_0x57ae2c){if(_0x57ae2c){return _0x57ae2c[_0x51b6('0x25')]()[_0x51b6('0x24')](function(){_0x55d517[_0x51b6('0x19')](0xcc)[_0x51b6('0x1a')]();});}};}function handleEntityNotFound(_0x188125,_0x5014e6){return function(_0x3e88c9){if(!_0x3e88c9){_0x188125['sendStatus'](0x194);}return _0x3e88c9;};}function handleError(_0x4c1d27,_0x3e4227){_0x3e4227=_0x3e4227||0x1f4;return function(_0x83c902){logger['error'](_0x83c902['stack']);if(_0x83c902[_0x51b6('0x26')]){delete _0x83c902[_0x51b6('0x26')];}_0x4c1d27[_0x51b6('0x19')](_0x3e4227)[_0x51b6('0x27')](_0x83c902);};}exports[_0x51b6('0x28')]=function(_0x8ada6e,_0x3525d5){var _0x5c3bbb={},_0x1d9592={},_0x42362e={'count':0x0,'rows':[]};var _0x3f6640=_[_0x51b6('0x29')](db[_0x51b6('0x2a')][_0x51b6('0x2b')],function(_0x167542){return{'name':_0x167542[_0x51b6('0x2c')],'type':_0x167542[_0x51b6('0x2d')][_0x51b6('0x2e')]};});_0x1d9592[_0x51b6('0x2f')]=_[_0x51b6('0x29')](_0x3f6640,_0x51b6('0x26'));_0x1d9592[_0x51b6('0x30')]=_[_0x51b6('0x31')](_0x8ada6e[_0x51b6('0x30')]);_0x1d9592[_0x51b6('0x32')]=_[_0x51b6('0x33')](_0x1d9592[_0x51b6('0x2f')],_0x1d9592[_0x51b6('0x30')]);_0x5c3bbb[_0x51b6('0x34')]=_['intersection'](_0x1d9592[_0x51b6('0x2f')],qs[_0x51b6('0x35')](_0x8ada6e[_0x51b6('0x30')][_0x51b6('0x35')]));_0x5c3bbb[_0x51b6('0x34')]=_0x5c3bbb[_0x51b6('0x34')][_0x51b6('0x36')]?_0x5c3bbb[_0x51b6('0x34')]:_0x1d9592[_0x51b6('0x2f')];if(!_0x8ada6e[_0x51b6('0x30')][_0x51b6('0x37')](_0x51b6('0x38'))){_0x5c3bbb[_0x51b6('0x1e')]=qs[_0x51b6('0x1e')](_0x8ada6e[_0x51b6('0x30')]['limit']);_0x5c3bbb[_0x51b6('0x1c')]=qs[_0x51b6('0x1c')](_0x8ada6e['query']['offset']);}_0x5c3bbb[_0x51b6('0x39')]=qs[_0x51b6('0x3a')](_0x8ada6e['query'][_0x51b6('0x3a')]);_0x5c3bbb['where']=qs['filters'](_[_0x51b6('0x3b')](_0x8ada6e[_0x51b6('0x30')],_0x1d9592[_0x51b6('0x32')]),_0x3f6640);if(_0x8ada6e[_0x51b6('0x30')][_0x51b6('0x3c')]){_0x5c3bbb[_0x51b6('0x3d')]=_[_0x51b6('0x3e')](_0x5c3bbb['where'],{'$or':_['map'](_0x3f6640,function(_0x558db7){if(_0x558db7[_0x51b6('0x2d')]!==_0x51b6('0x3f')){var _0x498fc7={};_0x498fc7[_0x558db7['name']]={'$like':'%'+_0x8ada6e[_0x51b6('0x30')][_0x51b6('0x3c')]+'%'};return _0x498fc7;}})});}_0x5c3bbb=_[_0x51b6('0x3e')]({},_0x5c3bbb,_0x8ada6e[_0x51b6('0x40')]);var _0x5b4ac6={'where':_0x5c3bbb[_0x51b6('0x3d')]};return db[_0x51b6('0x2a')]['count'](_0x5b4ac6)[_0x51b6('0x24')](function(_0x1bca19){_0x42362e['count']=_0x1bca19;if(_0x8ada6e[_0x51b6('0x30')][_0x51b6('0x41')]){_0x5c3bbb[_0x51b6('0x42')]=[{'all':!![]}];}return db[_0x51b6('0x2a')][_0x51b6('0x43')](_0x5c3bbb);})['then'](function(_0xc26a53){_0x42362e[_0x51b6('0x44')]=_0xc26a53;return _0x42362e;})['then'](respondWithFilteredResult(_0x3525d5,_0x5c3bbb))[_0x51b6('0x45')](handleError(_0x3525d5,null));};exports[_0x51b6('0x46')]=function(_0x2d0b61,_0x4b12bf){var _0x4fb7a5={'raw':!![],'where':{'id':_0x2d0b61[_0x51b6('0x47')]['id']}},_0x4dccd6={};_0x4dccd6[_0x51b6('0x2f')]=_[_0x51b6('0x31')](db[_0x51b6('0x2a')][_0x51b6('0x2b')]);_0x4dccd6[_0x51b6('0x30')]=_[_0x51b6('0x31')](_0x2d0b61[_0x51b6('0x30')]);_0x4dccd6[_0x51b6('0x32')]=_[_0x51b6('0x33')](_0x4dccd6[_0x51b6('0x2f')],_0x4dccd6['query']);_0x4fb7a5['attributes']=_[_0x51b6('0x33')](_0x4dccd6[_0x51b6('0x2f')],qs[_0x51b6('0x35')](_0x2d0b61[_0x51b6('0x30')]['fields']));_0x4fb7a5[_0x51b6('0x34')]=_0x4fb7a5[_0x51b6('0x34')][_0x51b6('0x36')]?_0x4fb7a5[_0x51b6('0x34')]:_0x4dccd6['model'];if(_0x2d0b61[_0x51b6('0x30')][_0x51b6('0x41')]){_0x4fb7a5['include']=[{'all':!![]}];}_0x4fb7a5=_[_0x51b6('0x3e')]({},_0x4fb7a5,_0x2d0b61[_0x51b6('0x40')]);return db[_0x51b6('0x2a')][_0x51b6('0x48')](_0x4fb7a5)['then'](handleEntityNotFound(_0x4b12bf,null))[_0x51b6('0x24')](respondWithResult(_0x4b12bf,null))[_0x51b6('0x45')](handleError(_0x4b12bf,null));};exports[_0x51b6('0x49')]=function(_0x59717a,_0x40234a){return db[_0x51b6('0x2a')][_0x51b6('0x49')](_0x59717a[_0x51b6('0x4a')],{})['then'](respondWithResult(_0x40234a,0xc9))['catch'](handleError(_0x40234a,null));};exports[_0x51b6('0x4b')]=function(_0x27d588,_0x3ef894){if(_0x27d588['body']['id']){delete _0x27d588[_0x51b6('0x4a')]['id'];}return db[_0x51b6('0x2a')][_0x51b6('0x48')]({'where':{'id':_0x27d588[_0x51b6('0x47')]['id']}})[_0x51b6('0x24')](handleEntityNotFound(_0x3ef894,null))['then'](saveUpdates(_0x27d588['body'],null))[_0x51b6('0x24')](respondWithResult(_0x3ef894,null))['catch'](handleError(_0x3ef894,null));};exports[_0x51b6('0x25')]=function(_0x19a1a4,_0x3dbd7b){return db['MailTransferReport']['find']({'where':{'id':_0x19a1a4[_0x51b6('0x47')]['id']}})[_0x51b6('0x24')](handleEntityNotFound(_0x3dbd7b,null))[_0x51b6('0x24')](removeEntity(_0x3dbd7b,null))[_0x51b6('0x45')](handleError(_0x3dbd7b,null));};exports[_0x51b6('0x4c')]=function(_0x2f8f33,_0x303ddd){return db[_0x51b6('0x2a')][_0x51b6('0x4c')]()[_0x51b6('0x24')](respondWithResult(_0x303ddd,null))[_0x51b6('0x45')](handleError(_0x303ddd,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 3af1b7e..485da97 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 _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 +var _0x8fa6=['define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5045ec,_0x38de9b){var _0x5d0662=function(_0x346a02){while(--_0x346a02){_0x5045ec['push'](_0x5045ec['shift']());}};_0x5d0662(++_0x38de9b);}(_0x8fa6,0x1c0));var _0x68fa=function(_0x239e4d,_0x5d7fbb){_0x239e4d=_0x239e4d-0x0;var _0x3d20c5=_0x8fa6[_0x239e4d];return _0x3d20c5;};'use strict';var _=require(_0x68fa('0x0'));var util=require(_0x68fa('0x1'));var logger=require(_0x68fa('0x2'))('api');var moment=require(_0x68fa('0x3'));var BPromise=require(_0x68fa('0x4'));var rp=require(_0x68fa('0x5'));var fs=require('fs');var path=require(_0x68fa('0x6'));var rimraf=require('rimraf');var config=require(_0x68fa('0x7'));var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0x304098,_0x501af1){return _0x304098[_0x68fa('0x8')](_0x68fa('0x9'),attributes,{'tableName':_0x68fa('0xa'),'paranoid':![],'indexes':[{'name':_0x68fa('0xb'),'fields':[_0x68fa('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 ce2f1f0..5d7dac6 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 _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 +var _0x17d8=['client','http','then','request\x20sent','stringify','error','message','MailTransferReport,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x17d8,0x8f));var _0x817d=function(_0x3a2a8f,_0x48ba88){_0x3a2a8f=_0x3a2a8f-0x0;var _0x18f5fb=_0x17d8[_0x3a2a8f];return _0x18f5fb;};'use strict';var _=require('lodash');var util=require(_0x817d('0x0'));var moment=require(_0x817d('0x1'));var BPromise=require(_0x817d('0x2'));var rs=require(_0x817d('0x3'));var fs=require('fs');var Redis=require(_0x817d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x817d('0x5'));var logger=require(_0x817d('0x6'))(_0x817d('0x7'));var config=require('../../config/environment');var jayson=require(_0x817d('0x8'));var client=jayson[_0x817d('0x9')][_0x817d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x437252,_0x2d686d,_0x46ea24){return new BPromise(function(_0x22fbd2,_0x23c185){return client['request'](_0x437252,_0x46ea24)[_0x817d('0xb')](function(_0x20f1a5){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x2d686d,_0x817d('0xc'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x2d686d,_0x817d('0xc'),JSON[_0x817d('0xd')](_0x20f1a5));if(_0x20f1a5[_0x817d('0xe')]){if(_0x20f1a5[_0x817d('0xe')]['code']===0x1f4){logger[_0x817d('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x2d686d,_0x20f1a5[_0x817d('0xe')][_0x817d('0xf')]);return _0x23c185(_0x20f1a5[_0x817d('0xe')]['message']);}logger[_0x817d('0xe')](_0x817d('0x10'),_0x2d686d,_0x20f1a5[_0x817d('0xe')][_0x817d('0xf')]);return _0x22fbd2(_0x20f1a5[_0x817d('0xe')][_0x817d('0xf')]);}else{logger['info'](_0x817d('0x10'),_0x2d686d,_0x817d('0xc'));_0x22fbd2(_0x20f1a5[_0x817d('0x11')]['message']);}})[_0x817d('0x12')](function(_0x590ff4){logger[_0x817d('0xe')](_0x817d('0x10'),_0x2d686d,_0x590ff4);_0x23c185(_0x590ff4);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index ceb79b2..39c9a51 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 _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 +var _0xf93c=['isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','/describe'];(function(_0x466d24,_0x3a3d6c){var _0x535da6=function(_0x241c41){while(--_0x241c41){_0x466d24['push'](_0x466d24['shift']());}};_0x535da6(++_0x3a3d6c);}(_0xf93c,0x149));var _0xcf93=function(_0xa818b1,_0x516178){_0xa818b1=_0xa818b1-0x0;var _0x2a5711=_0xf93c[_0xa818b1];return _0x2a5711;};'use strict';var multer=require('multer');var util=require(_0xcf93('0x0'));var path=require(_0xcf93('0x1'));var timeout=require(_0xcf93('0x2'));var express=require(_0xcf93('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcf93('0x4'));var interaction=require(_0xcf93('0x5'));var config=require(_0xcf93('0x6'));var controller=require(_0xcf93('0x7'));router[_0xcf93('0x8')]('/',auth['isAuthenticated'](),controller[_0xcf93('0x9')]);router['get'](_0xcf93('0xa'),auth[_0xcf93('0xb')](),controller[_0xcf93('0xc')]);router[_0xcf93('0x8')](_0xcf93('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xcf93('0xe')]('/',auth[_0xcf93('0xb')](),controller[_0xcf93('0xf')]);router[_0xcf93('0x10')]('/:id',auth[_0xcf93('0xb')](),controller[_0xcf93('0x11')]);router[_0xcf93('0x12')](_0xcf93('0xd'),auth[_0xcf93('0xb')](),controller[_0xcf93('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 2802b1b..c05aa2b 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 _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 +var _0xfd00=['sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[queue]','INTEGER'];(function(_0x343824,_0x5899cf){var _0x5d0b26=function(_0x5463e7){while(--_0x5463e7){_0x343824['push'](_0x343824['shift']());}};_0x5d0b26(++_0x5899cf);}(_0xfd00,0x96));var _0x0fd0=function(_0x42e175,_0x1f88f7){_0x42e175=_0x42e175-0x0;var _0x2c5590=_0xfd00[_0x42e175];return _0x2c5590;};'use strict';var Sequelize=require(_0x0fd0('0x0'));var moment=require('moment');module[_0x0fd0('0x1')]={'channel':{'type':Sequelize[_0x0fd0('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x0fd0('0x2')]},'type':{'type':Sequelize[_0x0fd0('0x2')],'defaultValue':_0x0fd0('0x3'),'comment':_0x0fd0('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x0fd0('0x5')]},'exitAt':{'type':Sequelize[_0x0fd0('0x5')],'set':function(_0x56e76e){var _0x1f996c=moment(_0x56e76e);var _0x118b64=moment(this['getDataValue']('enterAt'));var _0x1d290e=_0x1f996c[_0x0fd0('0x6')](_0x118b64,_0x0fd0('0x7'));this[_0x0fd0('0x8')](_0x0fd0('0x9'),_0x56e76e);this[_0x0fd0('0x8')](_0x0fd0('0xa'),_0x1d290e>=0x0?_0x1d290e:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x0fd0('0xb')},'data2':{'type':Sequelize[_0x0fd0('0x2')],'comment':_0x0fd0('0xc')},'data3':{'type':Sequelize[_0x0fd0('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x0fd0('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x0fd0('0x2')],'comment':_0x0fd0('0xd')},'role':{'type':Sequelize[_0x0fd0('0x2')]},'internal':{'type':Sequelize[_0x0fd0('0xe')]},'uniqueid':{'type':Sequelize[_0x0fd0('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index a099ad8..9584a59 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_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 +var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','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','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x4ad43b,_0x304964){var _0x686a41=function(_0x3f24ef){while(--_0x3f24ef){_0x4ad43b['push'](_0x4ad43b['shift']());}};_0x686a41(++_0x304964);}(_0x008c,0x188));var _0xc008=function(_0x31687e,_0x42b91a){_0x31687e=_0x31687e-0x0;var _0x10fbb4=_0x008c[_0x31687e];return _0x10fbb4;};'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(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 047cb0b..dd8c2ed 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 _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 +var _0x3787=['membername_interface','membername','interface','util','api','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member'];(function(_0x570b53,_0x52ef45){var _0x4c5209=function(_0x315a61){while(--_0x315a61){_0x570b53['push'](_0x570b53['shift']());}};_0x4c5209(++_0x52ef45);}(_0x3787,0xd3));var _0x7378=function(_0x45d59b,_0x454156){_0x45d59b=_0x45d59b-0x0;var _0x966451=_0x3787[_0x45d59b];return _0x966451;};'use strict';var _=require('lodash');var util=require(_0x7378('0x0'));var logger=require('../../config/logger')(_0x7378('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7378('0x2'));var rimraf=require(_0x7378('0x3'));var config=require(_0x7378('0x4'));var attributes=require(_0x7378('0x5'));module[_0x7378('0x6')]=function(_0xd11fdd,_0x1150ba){return _0xd11fdd[_0x7378('0x7')](_0x7378('0x8'),attributes,{'tableName':_0x7378('0x9'),'paranoid':![],'indexes':[{'name':_0x7378('0xa'),'fields':[_0x7378('0xb'),_0x7378('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 810c452..28b4ba4 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 _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 +var _0xdf98=['debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','options','raw','where','attributes','map','include','model','CreateMemberReport','body','UpdateMemberReport','MemberReport','update','limit','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MemberReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1e500e,_0x2c9d74){var _0x10dc5e=function(_0x354423){while(--_0x354423){_0x1e500e['push'](_0x1e500e['shift']());}};_0x10dc5e(++_0x2c9d74);}(_0xdf98,0xcf));var _0x8df9=function(_0xadc7d9,_0x203608){_0xadc7d9=_0xadc7d9-0x0;var _0x915ca1=_0xdf98[_0xadc7d9];return _0x915ca1;};'use strict';var _=require(_0x8df9('0x0'));var util=require('util');var moment=require(_0x8df9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8df9('0x2'));var db=require(_0x8df9('0x3'))['db'];var utils=require(_0x8df9('0x4'));var logger=require(_0x8df9('0x5'))(_0x8df9('0x6'));var config=require(_0x8df9('0x7'));var jayson=require(_0x8df9('0x8'));var client=jayson[_0x8df9('0x9')][_0x8df9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e79af,_0x1ffe3b,_0x393533){return new BPromise(function(_0x410568,_0x48bc8e){return client['request'](_0x5e79af,_0x393533)[_0x8df9('0xb')](function(_0x513b37){logger[_0x8df9('0xc')](_0x8df9('0xd'),_0x1ffe3b,_0x8df9('0xe'));logger[_0x8df9('0xf')](_0x8df9('0x10'),_0x1ffe3b,_0x8df9('0xe'),JSON[_0x8df9('0x11')](_0x513b37));if(_0x513b37[_0x8df9('0x12')]){if(_0x513b37['error'][_0x8df9('0x13')]===0x1f4){logger[_0x8df9('0x12')](_0x8df9('0xd'),_0x1ffe3b,_0x513b37['error'][_0x8df9('0x14')]);return _0x48bc8e(_0x513b37[_0x8df9('0x12')][_0x8df9('0x14')]);}logger[_0x8df9('0x12')]('MemberReport,\x20%s,\x20%s',_0x1ffe3b,_0x513b37['error'][_0x8df9('0x14')]);return _0x410568(_0x513b37[_0x8df9('0x12')][_0x8df9('0x14')]);}else{logger['info'](_0x8df9('0xd'),_0x1ffe3b,'request\x20sent');_0x410568(_0x513b37[_0x8df9('0x15')]['message']);}})[_0x8df9('0x16')](function(_0x8e547d){logger[_0x8df9('0x12')](_0x8df9('0xd'),_0x1ffe3b,_0x8e547d);_0x48bc8e(_0x8e547d);});});}exports[_0x8df9('0x17')]=function(_0x16e8c4){var _0x5e19e5=this;return new Promise(function(_0x54f2b0,_0x3bf137){return db['MemberReport']['findAll']({'raw':_0x16e8c4[_0x8df9('0x18')]?_0x16e8c4[_0x8df9('0x18')][_0x8df9('0x19')]===undefined?!![]:![]:!![],'where':_0x16e8c4[_0x8df9('0x18')]?_0x16e8c4[_0x8df9('0x18')][_0x8df9('0x1a')]||null:null,'attributes':_0x16e8c4['options']?_0x16e8c4[_0x8df9('0x18')][_0x8df9('0x1b')]||null:null,'limit':_0x16e8c4[_0x8df9('0x18')]?_0x16e8c4['options']['limit']||null:null,'include':_0x16e8c4['options']?_0x16e8c4['options']['include']?_[_0x8df9('0x1c')](_0x16e8c4[_0x8df9('0x18')][_0x8df9('0x1d')],function(_0x3dea66){return{'model':db[_0x3dea66[_0x8df9('0x1e')]],'as':_0x3dea66['as'],'attributes':_0x3dea66[_0x8df9('0x1b')],'include':_0x3dea66[_0x8df9('0x1d')]?_[_0x8df9('0x1c')](_0x3dea66['include'],function(_0x3323dc){return{'model':db[_0x3323dc[_0x8df9('0x1e')]],'as':_0x3323dc['as'],'attributes':_0x3323dc[_0x8df9('0x1b')],'include':_0x3323dc['include']?_['map'](_0x3323dc[_0x8df9('0x1d')],function(_0x5117c9){return{'model':db[_0x5117c9['model']],'as':_0x5117c9['as'],'attributes':_0x5117c9[_0x8df9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8df9('0xb')](function(_0x3a43c5){logger[_0x8df9('0xc')](_0x8df9('0x17'),_0x16e8c4);logger['debug']('GetMemberReport',_0x16e8c4,JSON[_0x8df9('0x11')](_0x3a43c5));_0x54f2b0(_0x3a43c5);})[_0x8df9('0x16')](function(_0x2a9fee){logger['error'](_0x8df9('0x17'),_0x2a9fee[_0x8df9('0x14')],_0x16e8c4);_0x3bf137(_0x5e19e5['error'](0x1f4,_0x2a9fee[_0x8df9('0x14')]));});});};exports[_0x8df9('0x1f')]=function(_0x4a522f){var _0x26b063=this;return new Promise(function(_0x6463b5,_0x13ee72){return db['MemberReport']['create'](_0x4a522f[_0x8df9('0x20')],{'raw':_0x4a522f[_0x8df9('0x18')]?_0x4a522f[_0x8df9('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x8df9('0xb')](function(_0x395651){logger[_0x8df9('0xc')](_0x8df9('0x1f'),_0x4a522f);logger['debug'](_0x8df9('0x1f'),_0x4a522f,JSON[_0x8df9('0x11')](_0x395651));_0x6463b5(_0x395651);})['catch'](function(_0x26e3b6){logger['error']('CreateMemberReport',_0x26e3b6['message'],_0x4a522f);_0x13ee72(_0x26b063['error'](0x1f4,_0x26e3b6[_0x8df9('0x14')]));});});};exports[_0x8df9('0x21')]=function(_0x16b95e){var _0x8c94f6=this;return new Promise(function(_0x43dce0,_0x3bfe71){return db[_0x8df9('0x22')][_0x8df9('0x23')](_0x16b95e[_0x8df9('0x20')],{'raw':_0x16b95e[_0x8df9('0x18')]?_0x16b95e[_0x8df9('0x18')][_0x8df9('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16b95e['options']?_0x16b95e['options']['where']||null:null,'attributes':_0x16b95e[_0x8df9('0x18')]?_0x16b95e[_0x8df9('0x18')]['attributes']||null:null,'limit':_0x16b95e[_0x8df9('0x18')]?_0x16b95e['options'][_0x8df9('0x24')]||null:null})[_0x8df9('0xb')](function(_0x4fdf54){logger['info']('UpdateMemberReport',_0x16b95e);logger[_0x8df9('0xf')](_0x8df9('0x21'),_0x16b95e,JSON[_0x8df9('0x11')](_0x4fdf54));_0x43dce0(_0x4fdf54);})['catch'](function(_0x589633){logger[_0x8df9('0x12')]('UpdateMemberReport',_0x589633[_0x8df9('0x14')],_0x16b95e);_0x3bfe71(_0x8c94f6[_0x8df9('0x12')](0x1f4,_0x589633['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 4cdebb1..41221a2 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 _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 +var _0x5825=['../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','index','multer','util','path','express','Router','fs-extra'];(function(_0x425cc1,_0x2ff21b){var _0x699b5d=function(_0x4a1c16){while(--_0x4a1c16){_0x425cc1['push'](_0x425cc1['shift']());}};_0x699b5d(++_0x2ff21b);}(_0x5825,0xb5));var _0x5582=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5825[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x5582('0x0'));var util=require(_0x5582('0x1'));var path=require(_0x5582('0x2'));var timeout=require('connect-timeout');var express=require(_0x5582('0x3'));var router=express[_0x5582('0x4')]();var fs_extra=require(_0x5582('0x5'));var auth=require(_0x5582('0x6'));var interaction=require(_0x5582('0x7'));var config=require(_0x5582('0x8'));var controller=require(_0x5582('0x9'));router['get']('/',controller[_0x5582('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 7bf3882..9fa8950 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 _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 +var _0xed86=['sequelize','exports'];(function(_0x5a88d1,_0x52da1d){var _0x474eb2=function(_0x41d755){while(--_0x41d755){_0x5a88d1['push'](_0x5a88d1['shift']());}};_0x474eb2(++_0x52da1d);}(_0xed86,0xa0));var _0x6ed8=function(_0xdd827a,_0x482ad2){_0xdd827a=_0xdd827a-0x0;var _0x2f46f1=_0xed86[_0xdd827a];return _0x2f46f1;};'use strict';var Sequelize=require(_0x6ed8('0x0'));module[_0x6ed8('0x1')]={'version':{'type':Sequelize['STRING'],'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 a3dd589..112ad2e 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 _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 +var _0xc813=['merge','VIRTUAL','options','includeAll','findAll','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','Migration','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0xf23730,_0x2c89d1){var _0x478303=function(_0x3ff8d4){while(--_0x3ff8d4){_0xf23730['push'](_0xf23730['shift']());}};_0x478303(++_0x2c89d1);}(_0xc813,0x1db));var _0x3c81=function(_0x15cbce,_0xda8402){_0x15cbce=_0x15cbce-0x0;var _0x257f29=_0xc813[_0x15cbce];return _0x257f29;};'use strict';var emlformat=require(_0x3c81('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3c81('0x1'));var jsonpatch=require(_0x3c81('0x2'));var rp=require(_0x3c81('0x3'));var moment=require(_0x3c81('0x4'));var BPromise=require(_0x3c81('0x5'));var Mustache=require(_0x3c81('0x6'));var util=require(_0x3c81('0x7'));var path=require(_0x3c81('0x8'));var sox=require(_0x3c81('0x9'));var csv=require(_0x3c81('0xa'));var ejs=require(_0x3c81('0xb'));var fs=require('fs');var fs_extra=require(_0x3c81('0xc'));var _=require('lodash');var squel=require(_0x3c81('0xd'));var crypto=require('crypto');var jsforce=require(_0x3c81('0xe'));var deskjs=require(_0x3c81('0xf'));var toCsv=require(_0x3c81('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3c81('0x10'));var authService=require(_0x3c81('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3c81('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c81('0x13'))(_0x3c81('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3c81('0x15'));var db=require(_0x3c81('0x16'))['db'];function respondWithStatusCode(_0x39613e,_0x2c61ae){_0x2c61ae=_0x2c61ae||0xcc;return function(_0x51887a){if(_0x51887a){return _0x39613e[_0x3c81('0x17')](_0x2c61ae);}return _0x39613e[_0x3c81('0x18')](_0x2c61ae)[_0x3c81('0x19')]();};}function respondWithResult(_0x53aaec,_0x2e8993){_0x2e8993=_0x2e8993||0xc8;return function(_0x1113a8){if(_0x1113a8){return _0x53aaec[_0x3c81('0x18')](_0x2e8993)[_0x3c81('0x1a')](_0x1113a8);}};}function respondWithFilteredResult(_0x2af43f,_0xd045ab){return function(_0x4d3d04){if(_0x4d3d04){var _0x2cbbb2=typeof _0xd045ab[_0x3c81('0x1b')]===_0x3c81('0x1c')&&typeof _0xd045ab[_0x3c81('0x1d')]===_0x3c81('0x1c');var _0x143ed0=_0x4d3d04[_0x3c81('0x1e')];var _0x355805=_0x2cbbb2?0x0:_0xd045ab[_0x3c81('0x1b')];var _0x18fa6c=_0x2cbbb2?_0x4d3d04['count']:_0xd045ab[_0x3c81('0x1b')]+_0xd045ab['limit'];var _0xa0c16b;if(_0x18fa6c>=_0x143ed0){_0x18fa6c=_0x143ed0;_0xa0c16b=0xc8;}else{_0xa0c16b=0xce;}_0x2af43f[_0x3c81('0x18')](_0xa0c16b);return _0x2af43f[_0x3c81('0x1f')](_0x3c81('0x20'),_0x355805+'-'+_0x18fa6c+'/'+_0x143ed0)[_0x3c81('0x1a')](_0x4d3d04);}return null;};}function patchUpdates(_0x33c450){return function(_0x4f2c67){try{jsonpatch[_0x3c81('0x21')](_0x4f2c67,_0x33c450,!![]);}catch(_0x1cb471){return BPromise[_0x3c81('0x22')](_0x1cb471);}return _0x4f2c67[_0x3c81('0x23')]();};}function saveUpdates(_0x3f1e87,_0x1f5933){return function(_0x47fbff){if(_0x47fbff){return _0x47fbff[_0x3c81('0x24')](_0x3f1e87)[_0x3c81('0x25')](function(_0x3c3987){return _0x3c3987;});}return null;};}function removeEntity(_0x1ea3ef,_0x53ce15){return function(_0x52d7e3){if(_0x52d7e3){return _0x52d7e3[_0x3c81('0x26')]()[_0x3c81('0x25')](function(){_0x1ea3ef[_0x3c81('0x18')](0xcc)[_0x3c81('0x19')]();});}};}function handleEntityNotFound(_0x5d2773,_0xff1a39){return function(_0x22d7ed){if(!_0x22d7ed){_0x5d2773['sendStatus'](0x194);}return _0x22d7ed;};}function handleError(_0x43642e,_0x3375e7){_0x3375e7=_0x3375e7||0x1f4;return function(_0x1a4dd9){logger[_0x3c81('0x27')](_0x1a4dd9['stack']);if(_0x1a4dd9[_0x3c81('0x28')]){delete _0x1a4dd9[_0x3c81('0x28')];}_0x43642e[_0x3c81('0x18')](_0x3375e7)['send'](_0x1a4dd9);};}exports[_0x3c81('0x29')]=function(_0x553054,_0xaba94d){var _0x37da24={},_0x3bc617={},_0x4745a4={'count':0x0,'rows':[]};var _0x404757=_[_0x3c81('0x2a')](db[_0x3c81('0x2b')][_0x3c81('0x2c')],function(_0x532b4a){return{'name':_0x532b4a[_0x3c81('0x2d')],'type':_0x532b4a[_0x3c81('0x2e')][_0x3c81('0x2f')]};});_0x3bc617[_0x3c81('0x30')]=_['map'](_0x404757,_0x3c81('0x28'));_0x3bc617['query']=_[_0x3c81('0x31')](_0x553054['query']);_0x3bc617[_0x3c81('0x32')]=_['intersection'](_0x3bc617[_0x3c81('0x30')],_0x3bc617['query']);_0x37da24['attributes']=_['intersection'](_0x3bc617[_0x3c81('0x30')],qs['fields'](_0x553054[_0x3c81('0x33')]['fields']));_0x37da24[_0x3c81('0x34')]=_0x37da24[_0x3c81('0x34')][_0x3c81('0x35')]?_0x37da24['attributes']:_0x3bc617[_0x3c81('0x30')];if(!_0x553054[_0x3c81('0x33')][_0x3c81('0x36')](_0x3c81('0x37'))){_0x37da24['limit']=qs[_0x3c81('0x1d')](_0x553054[_0x3c81('0x33')][_0x3c81('0x1d')]);_0x37da24[_0x3c81('0x1b')]=qs[_0x3c81('0x1b')](_0x553054['query'][_0x3c81('0x1b')]);}_0x37da24[_0x3c81('0x38')]=qs[_0x3c81('0x39')](_0x553054[_0x3c81('0x33')][_0x3c81('0x39')]);_0x37da24[_0x3c81('0x3a')]=qs[_0x3c81('0x32')](_[_0x3c81('0x3b')](_0x553054[_0x3c81('0x33')],_0x3bc617[_0x3c81('0x32')]),_0x404757);if(_0x553054['query'][_0x3c81('0x3c')]){_0x37da24[_0x3c81('0x3a')]=_[_0x3c81('0x3d')](_0x37da24[_0x3c81('0x3a')],{'$or':_['map'](_0x404757,function(_0x37a487){if(_0x37a487[_0x3c81('0x2e')]!==_0x3c81('0x3e')){var _0x11eec9={};_0x11eec9[_0x37a487[_0x3c81('0x28')]]={'$like':'%'+_0x553054[_0x3c81('0x33')][_0x3c81('0x3c')]+'%'};return _0x11eec9;}})});}_0x37da24=_['merge']({},_0x37da24,_0x553054[_0x3c81('0x3f')]);var _0x1e5ae1={'where':_0x37da24[_0x3c81('0x3a')]};return db[_0x3c81('0x2b')]['count'](_0x1e5ae1)[_0x3c81('0x25')](function(_0x159e5d){_0x4745a4['count']=_0x159e5d;if(_0x553054[_0x3c81('0x33')][_0x3c81('0x40')]){_0x37da24['include']=[{'all':!![]}];}return db['Migration'][_0x3c81('0x41')](_0x37da24);})[_0x3c81('0x25')](function(_0x5465ff){_0x4745a4['rows']=_0x5465ff;return _0x4745a4;})[_0x3c81('0x25')](respondWithFilteredResult(_0xaba94d,_0x37da24))[_0x3c81('0x42')](handleError(_0xaba94d,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index a2a8ecc..ea05b53 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 _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 +var _0xa7ce=['../../config/environment','exports','define','Migration','migrations','util','api','bluebird','request-promise','path','rimraf'];(function(_0x3a9198,_0xabc051){var _0x54f787=function(_0x4a9bcc){while(--_0x4a9bcc){_0x3a9198['push'](_0x3a9198['shift']());}};_0x54f787(++_0xabc051);}(_0xa7ce,0x118));var _0xea7c=function(_0x3879d5,_0x459b09){_0x3879d5=_0x3879d5-0x0;var _0x387d95=_0xa7ce[_0x3879d5];return _0x387d95;};'use strict';var _=require('lodash');var util=require(_0xea7c('0x0'));var logger=require('../../config/logger')(_0xea7c('0x1'));var moment=require('moment');var BPromise=require(_0xea7c('0x2'));var rp=require(_0xea7c('0x3'));var fs=require('fs');var path=require(_0xea7c('0x4'));var rimraf=require(_0xea7c('0x5'));var config=require(_0xea7c('0x6'));var attributes=require('./migration.attributes');module[_0xea7c('0x7')]=function(_0x57b5a8,_0x45da69){return _0x57b5a8[_0xea7c('0x8')](_0xea7c('0x9'),attributes,{'tableName':_0xea7c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 82f7f46..3561d9f 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 _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 +var _0x67da=['error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3048ea,_0x3838c2){var _0x1a13c4=function(_0x2c6a6b){while(--_0x2c6a6b){_0x3048ea['push'](_0x3048ea['shift']());}};_0x1a13c4(++_0x3838c2);}(_0x67da,0x192));var _0xa67d=function(_0x4e377d,_0x3dd5bb){_0x4e377d=_0x4e377d-0x0;var _0x1aae22=_0x67da[_0x4e377d];return _0x1aae22;};'use strict';var _=require('lodash');var util=require(_0xa67d('0x0'));var moment=require(_0xa67d('0x1'));var BPromise=require(_0xa67d('0x2'));var rs=require(_0xa67d('0x3'));var fs=require('fs');var Redis=require(_0xa67d('0x4'));var db=require(_0xa67d('0x5'))['db'];var utils=require(_0xa67d('0x6'));var logger=require(_0xa67d('0x7'))(_0xa67d('0x8'));var config=require(_0xa67d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa67d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d2734,_0x31d56a,_0x2346f4){return new BPromise(function(_0x10f89a,_0x2c37c2){return client[_0xa67d('0xb')](_0x4d2734,_0x2346f4)[_0xa67d('0xc')](function(_0x330a9f){logger[_0xa67d('0xd')](_0xa67d('0xe'),_0x31d56a,_0xa67d('0xf'));logger['debug'](_0xa67d('0x10'),_0x31d56a,_0xa67d('0xf'),JSON[_0xa67d('0x11')](_0x330a9f));if(_0x330a9f[_0xa67d('0x12')]){if(_0x330a9f['error'][_0xa67d('0x13')]===0x1f4){logger[_0xa67d('0x12')]('Migration,\x20%s,\x20%s',_0x31d56a,_0x330a9f['error'][_0xa67d('0x14')]);return _0x2c37c2(_0x330a9f['error'][_0xa67d('0x14')]);}logger['error']('Migration,\x20%s,\x20%s',_0x31d56a,_0x330a9f[_0xa67d('0x12')][_0xa67d('0x14')]);return _0x10f89a(_0x330a9f['error'][_0xa67d('0x14')]);}else{logger[_0xa67d('0xd')](_0xa67d('0xe'),_0x31d56a,_0xa67d('0xf'));_0x10f89a(_0x330a9f['result']['message']);}})['catch'](function(_0x4fa50f){logger[_0xa67d('0x12')]('Migration,\x20%s,\x20%s',_0x31d56a,_0x4fa50f);_0x2c37c2(_0x4fa50f);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index fefc6eb..5bb385f 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 _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 +var _0x5a3c=['../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x55eef9,_0xd3605){var _0x3c681e=function(_0x5b125b){while(--_0x5b125b){_0x55eef9['push'](_0x55eef9['shift']());}};_0x3c681e(++_0xd3605);}(_0x5a3c,0x176));var _0xc5a3=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x5a3c[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0xc5a3('0x0'));var util=require(_0xc5a3('0x1'));var path=require(_0xc5a3('0x2'));var timeout=require('connect-timeout');var express=require(_0xc5a3('0x3'));var router=express[_0xc5a3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc5a3('0x5'));var interaction=require(_0xc5a3('0x6'));var config=require(_0xc5a3('0x7'));var controller=require(_0xc5a3('0x8'));router[_0xc5a3('0x9')]('/',auth[_0xc5a3('0xa')](),controller[_0xc5a3('0xb')]);router[_0xc5a3('0x9')](_0xc5a3('0xc'),auth[_0xc5a3('0xa')](),controller[_0xc5a3('0xd')]);router[_0xc5a3('0xe')]('/',auth[_0xc5a3('0xa')](),controller[_0xc5a3('0xf')]);router['put'](_0xc5a3('0xc'),auth[_0xc5a3('0xa')](),controller[_0xc5a3('0x10')]);router[_0xc5a3('0x11')](_0xc5a3('0xc'),auth[_0xc5a3('0xa')](),controller[_0xc5a3('0x12')]);module[_0xc5a3('0x13')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index e8cc383..87b547e 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 _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 +var _0x8371=['turn','STRING','sequelize','exports','localnet','externip'];(function(_0xc2a14d,_0x5a8219){var _0xf84416=function(_0x3363b7){while(--_0x3363b7){_0xc2a14d['push'](_0xc2a14d['shift']());}};_0xf84416(++_0x5a8219);}(_0x8371,0xf2));var _0x1837=function(_0x565683,_0x1d743b){_0x565683=_0x565683-0x0;var _0x34a2a8=_0x8371[_0x565683];return _0x34a2a8;};'use strict';var Sequelize=require(_0x1837('0x0'));module[_0x1837('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1837('0x2'),_0x1837('0x3'),'stun',_0x1837('0x4'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x1837('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index bd8a85c..8da18f3 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 _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 +var _0xa3fd=['Network','includeAll','include','rows','show','rawAttributes','find','create','body','toUpperCase','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','res_stun_monitor.so','TURN','root','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','params','findAll','/etc/asterisk/stun_xcally.conf','server/files/templates/turn_multiple.ejs','path','ejs','api','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','json','offset','undefined','count','limit','set','Content-Range','destroy','end','sendStatus','stack','name','index','map','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','options'];(function(_0x1f2647,_0x1c9275){var _0x4b7045=function(_0x11c09d){while(--_0x11c09d){_0x1f2647['push'](_0x1f2647['shift']());}};_0x4b7045(++_0x1c9275);}(_0xa3fd,0x164));var _0xda3f=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0xa3fd[_0x21f9c2];return _0x3da17f;};'use strict';var util=require('util');var path=require(_0xda3f('0x0'));var ejs=require(_0xda3f('0x1'));var fs=require('fs');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xda3f('0x2'));var config=require('../../config/environment');var db=require(_0xda3f('0x3'))['db'];var jayson=require(_0xda3f('0x4'));var client=jayson[_0xda3f('0x5')][_0xda3f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xbdccf,_0xd675ef,_0x416e04,_0xb64f4){return new Promise(function(_0x35d8e3,_0x45fbee){var _0x47e7ac=_0xb64f4||client;return _0x47e7ac[_0xda3f('0x7')](_0xbdccf,_0x416e04)[_0xda3f('0x8')](function(_0xc4ee09){logger[_0xda3f('0x9')](_0xda3f('0xa'),_0xd675ef,_0xda3f('0xb'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0xd675ef,_0xda3f('0xb'),JSON[_0xda3f('0xc')](_0xc4ee09));if(_0xc4ee09['error']){if(_0xc4ee09[_0xda3f('0xd')][_0xda3f('0xe')]===0x1f4){logger[_0xda3f('0xd')](_0xda3f('0xa'),_0xd675ef,_0xc4ee09['error'][_0xda3f('0xf')]);return _0x45fbee(_0xc4ee09['error'][_0xda3f('0xf')]);}logger[_0xda3f('0xd')](_0xda3f('0xa'),_0xd675ef,_0xc4ee09['error'][_0xda3f('0xf')]);return _0x35d8e3(_0xc4ee09[_0xda3f('0xd')]['message']);}else{logger[_0xda3f('0x9')](_0xda3f('0xa'),_0xd675ef,_0xda3f('0xb'));_0x35d8e3(_0xc4ee09['result'][_0xda3f('0xf')]);}})[_0xda3f('0x10')](function(_0x3f1702){logger[_0xda3f('0xd')](_0xda3f('0xa'),_0xd675ef,_0x3f1702);_0x45fbee(_0x3f1702);});});}function respondWithResult(_0x2eb4bb,_0x24dd08){_0x24dd08=_0x24dd08||0xc8;return function(_0xac8b97){if(_0xac8b97){return _0x2eb4bb[_0xda3f('0x11')](_0x24dd08)[_0xda3f('0x12')](_0xac8b97);}};}function respondWithFilteredResult(_0x5d7b96,_0x4cfc1d){return function(_0x1b30e4){if(_0x1b30e4){var _0xa5951a=typeof _0x4cfc1d[_0xda3f('0x13')]===_0xda3f('0x14')&&typeof _0x4cfc1d['limit']==='undefined';var _0x37c547=_0x1b30e4['count'];var _0x3b4411=_0xa5951a?0x0:_0x4cfc1d[_0xda3f('0x13')];var _0x5ae881=_0xa5951a?_0x1b30e4[_0xda3f('0x15')]:_0x4cfc1d[_0xda3f('0x13')]+_0x4cfc1d[_0xda3f('0x16')];var _0x3c6694;if(_0x5ae881>=_0x37c547){_0x5ae881=_0x37c547;_0x3c6694=0xc8;}else{_0x3c6694=0xce;}_0x5d7b96[_0xda3f('0x11')](_0x3c6694);return _0x5d7b96[_0xda3f('0x17')](_0xda3f('0x18'),_0x3b4411+'-'+_0x5ae881+'/'+_0x37c547)['json'](_0x1b30e4);}return null;};}function saveUpdates(_0x4c4189){return function(_0x44b78c){if(_0x44b78c){return _0x44b78c['update'](_0x4c4189)[_0xda3f('0x8')](function(_0x26aeb8){return _0x26aeb8;});}return null;};}function removeEntity(_0x3eecd7){return function(_0x8dd4f5){if(_0x8dd4f5){return _0x8dd4f5[_0xda3f('0x19')]()[_0xda3f('0x8')](function(){_0x3eecd7[_0xda3f('0x11')](0xcc)[_0xda3f('0x1a')]();});}};}function handleEntityNotFound(_0x43f7d9){return function(_0xf68304){if(!_0xf68304){_0x43f7d9[_0xda3f('0x1b')](0x194);}return _0xf68304;};}function handleError(_0x3d9b39,_0x52de48){_0x52de48=_0x52de48||0x1f4;return function(_0x26fe23){logger[_0xda3f('0xd')](_0x26fe23[_0xda3f('0x1c')]);if(_0x26fe23[_0xda3f('0x1d')]){delete _0x26fe23[_0xda3f('0x1d')];}_0x3d9b39[_0xda3f('0x11')](_0x52de48)['send'](_0x26fe23);};}exports[_0xda3f('0x1e')]=function(_0x396461,_0x4b0d6a){var _0x1b9269={},_0x296f48={},_0x4b9cb2={'count':0x0,'rows':[]};var _0x124825=_[_0xda3f('0x1f')](db['Network']['rawAttributes'],function(_0x2cc5d1){return{'name':_0x2cc5d1['fieldName'],'type':_0x2cc5d1['type'][_0xda3f('0x20')]};});_0x296f48[_0xda3f('0x21')]=_['map'](_0x124825,'name');_0x296f48[_0xda3f('0x22')]=_[_0xda3f('0x23')](_0x396461[_0xda3f('0x22')]);_0x296f48[_0xda3f('0x24')]=_['intersection'](_0x296f48['model'],_0x296f48[_0xda3f('0x22')]);_0x1b9269[_0xda3f('0x25')]=_[_0xda3f('0x26')](_0x296f48['model'],qs[_0xda3f('0x27')](_0x396461[_0xda3f('0x22')][_0xda3f('0x27')]));_0x1b9269['attributes']=_0x1b9269[_0xda3f('0x25')][_0xda3f('0x28')]?_0x1b9269[_0xda3f('0x25')]:_0x296f48[_0xda3f('0x21')];if(!_0x396461['query'][_0xda3f('0x29')]('nolimit')){_0x1b9269[_0xda3f('0x16')]=qs[_0xda3f('0x16')](_0x396461[_0xda3f('0x22')]['limit']);_0x1b9269[_0xda3f('0x13')]=qs[_0xda3f('0x13')](_0x396461[_0xda3f('0x22')][_0xda3f('0x13')]);}_0x1b9269['order']=qs[_0xda3f('0x2a')](_0x396461[_0xda3f('0x22')]['sort']);_0x1b9269[_0xda3f('0x2b')]=qs[_0xda3f('0x24')](_[_0xda3f('0x2c')](_0x396461[_0xda3f('0x22')],_0x296f48[_0xda3f('0x24')]),_0x124825);if(_0x396461[_0xda3f('0x22')][_0xda3f('0x2d')]){_0x1b9269[_0xda3f('0x2b')]=_['merge'](_0x1b9269[_0xda3f('0x2b')],{'$or':_[_0xda3f('0x1f')](_0x124825,function(_0x32e5c6){if(_0x32e5c6[_0xda3f('0x2e')]!==_0xda3f('0x2f')){var _0xe747b4={};_0xe747b4[_0x32e5c6[_0xda3f('0x1d')]]={'$like':'%'+_0x396461[_0xda3f('0x22')][_0xda3f('0x2d')]+'%'};return _0xe747b4;}})});}_0x1b9269=_['merge']({},_0x1b9269,_0x396461[_0xda3f('0x30')]);var _0x176d14={'where':_0x1b9269[_0xda3f('0x2b')]};return db[_0xda3f('0x31')][_0xda3f('0x15')](_0x176d14)[_0xda3f('0x8')](function(_0x1696e2){_0x4b9cb2[_0xda3f('0x15')]=_0x1696e2;if(_0x396461[_0xda3f('0x22')][_0xda3f('0x32')]){_0x1b9269[_0xda3f('0x33')]=[{'all':!![]}];}return db[_0xda3f('0x31')]['findAll'](_0x1b9269);})[_0xda3f('0x8')](function(_0x49e50c){_0x4b9cb2[_0xda3f('0x34')]=_0x49e50c;return _0x4b9cb2;})['then'](respondWithFilteredResult(_0x4b0d6a,_0x1b9269))[_0xda3f('0x10')](handleError(_0x4b0d6a,null));};exports[_0xda3f('0x35')]=function(_0x5a19b4,_0x555227){var _0x352b45={'raw':!![],'where':{'id':_0x5a19b4['params']['id']}},_0x41f505={};_0x41f505[_0xda3f('0x21')]=_['keys'](db[_0xda3f('0x31')][_0xda3f('0x36')]);_0x41f505[_0xda3f('0x22')]=_['keys'](_0x5a19b4[_0xda3f('0x22')]);_0x41f505[_0xda3f('0x24')]=_['intersection'](_0x41f505['model'],_0x41f505[_0xda3f('0x22')]);_0x352b45[_0xda3f('0x25')]=_[_0xda3f('0x26')](_0x41f505[_0xda3f('0x21')],qs[_0xda3f('0x27')](_0x5a19b4[_0xda3f('0x22')]['fields']));_0x352b45['attributes']=_0x352b45[_0xda3f('0x25')][_0xda3f('0x28')]?_0x352b45[_0xda3f('0x25')]:_0x41f505[_0xda3f('0x21')];if(_0x5a19b4[_0xda3f('0x22')][_0xda3f('0x32')]){_0x352b45[_0xda3f('0x33')]=[{'all':!![]}];}_0x352b45=_['merge']({},_0x352b45,_0x5a19b4['options']);return db[_0xda3f('0x31')][_0xda3f('0x37')](_0x352b45)[_0xda3f('0x8')](handleEntityNotFound(_0x555227,null))[_0xda3f('0x8')](respondWithResult(_0x555227,null))[_0xda3f('0x10')](handleError(_0x555227,null));};exports[_0xda3f('0x38')]=function(_0x1b4b21,_0x6034ff){var _0x4abfc5;return db['Network'][_0xda3f('0x38')](_0x1b4b21[_0xda3f('0x39')],{'raw':!![]})[_0xda3f('0x8')](function(_0x1217fa){_0x4abfc5=_0x1217fa;return db[_0xda3f('0x31')]['findAll']({'where':{'type':_0x1b4b21[_0xda3f('0x39')][_0xda3f('0x2e')]},'raw':!![]});})['then'](function(_0x28edb0){if(_0x4abfc5[_0xda3f('0x2e')][_0xda3f('0x3a')]()==_0xda3f('0x3b')){var _0x851a97=fs[_0xda3f('0x3c')](path[_0xda3f('0x3d')](config['root'],_0xda3f('0x3e')),_0xda3f('0x3f'));var _0x5c522c=ejs[_0xda3f('0x40')](_0x851a97,{'networks':_0x28edb0||[]});fs[_0xda3f('0x41')]('/etc/asterisk/stun_xcally.conf',_0x5c522c);return respondWithRpcPromise('Reload',_0xda3f('0x38'),{'module':_0xda3f('0x42')});}else if(_0x4abfc5[_0xda3f('0x2e')][_0xda3f('0x3a')]()==_0xda3f('0x43')){var _0x25e6a8=fs[_0xda3f('0x3c')](path[_0xda3f('0x3d')](config[_0xda3f('0x44')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x4a875d=ejs['render'](_0x25e6a8,{'networks':_0x28edb0||[]});fs[_0xda3f('0x41')](_0xda3f('0x45'),_0x4a875d);return respondWithRpcPromise(_0xda3f('0x46'),_0xda3f('0x38'),{'module':_0xda3f('0x42')});}else{var _0x511c41=fs['readFileSync'](path[_0xda3f('0x3d')](config[_0xda3f('0x44')],_0xda3f('0x47')),_0xda3f('0x3f'));var _0x34019d=ejs[_0xda3f('0x40')](_0x511c41,{'networks':_0x28edb0||[]});fs[_0xda3f('0x41')](util[_0xda3f('0x48')](_0xda3f('0x49'),_0x1b4b21[_0xda3f('0x39')]['type'][_0xda3f('0x4a')]()),_0x34019d);return respondWithRpcPromise(_0xda3f('0x46'),_0xda3f('0x38'),{'module':_0xda3f('0x4b')});}})[_0xda3f('0x8')](function(){return _0x4abfc5;})['then'](respondWithResult(_0x6034ff,0xc9))[_0xda3f('0x10')](handleError(_0x6034ff,null));};exports[_0xda3f('0x4c')]=function(_0x1aab12,_0x214528){var _0x462f64;return db[_0xda3f('0x31')]['find']({'where':{'id':_0x1aab12[_0xda3f('0x4d')]['id']}})[_0xda3f('0x8')](handleEntityNotFound(_0x214528,null))['then'](saveUpdates(_0x1aab12['body'],null))[_0xda3f('0x8')](function(_0x3566cb){if(_0x3566cb){_0x462f64=_0x3566cb;return db['Network'][_0xda3f('0x4e')]({'where':{'type':_0x462f64[_0xda3f('0x2e')]},'raw':!![]});}return null;})['then'](function(_0x20cf92){if(_0x462f64[_0xda3f('0x2e')]['toUpperCase']()=='STUN'){var _0xbec254=fs['readFileSync'](path[_0xda3f('0x3d')](config[_0xda3f('0x44')],'server/files/templates/stun_multiple.ejs'),_0xda3f('0x3f'));var _0xbb5cc1=ejs[_0xda3f('0x40')](_0xbec254,{'networks':_0x20cf92||[]});fs['writeFileSync'](_0xda3f('0x4f'),_0xbb5cc1);return respondWithRpcPromise(_0xda3f('0x46'),'update',{'module':_0xda3f('0x42')});}else if(_0x462f64[_0xda3f('0x2e')]['toUpperCase']()=='TURN'){var _0x239cdd=fs[_0xda3f('0x3c')](path[_0xda3f('0x3d')](config[_0xda3f('0x44')],'server/files/templates/turn_multiple.ejs'),_0xda3f('0x3f'));var _0xecaa76=ejs['render'](_0x239cdd,{'networks':_0x20cf92||[]});fs[_0xda3f('0x41')](_0xda3f('0x45'),_0xecaa76);return respondWithRpcPromise(_0xda3f('0x46'),_0xda3f('0x4c'),{'module':'res_stun_monitor.so'});}else{var _0xee574a=fs[_0xda3f('0x3c')](path['join'](config[_0xda3f('0x44')],_0xda3f('0x47')),_0xda3f('0x3f'));var _0x22d778=ejs[_0xda3f('0x40')](_0xee574a,{'networks':_0x20cf92||[]});fs['writeFileSync'](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x1aab12[_0xda3f('0x39')][_0xda3f('0x2e')][_0xda3f('0x4a')]()),_0x22d778);return respondWithRpcPromise('Reload','update',{'module':_0xda3f('0x4b')});}})['then'](function(_0x17acca){if(_0x17acca){return _0x462f64;}return null;})['then'](respondWithResult(_0x214528,null))['catch'](handleError(_0x214528,null));};exports['destroy']=function(_0x40b980,_0x46d54a){var _0x369a16;return db[_0xda3f('0x31')]['find']({'where':{'id':_0x40b980[_0xda3f('0x4d')]['id']}})[_0xda3f('0x8')](function(_0x18897b){_0x369a16=_0x18897b;return _0x18897b;})['then'](handleEntityNotFound(_0x46d54a,null))['then'](removeEntity(_0x46d54a,null))['then'](function(){if(_0x369a16){return db[_0xda3f('0x31')][_0xda3f('0x4e')]({'where':{'type':_0x369a16[_0xda3f('0x2e')]},'raw':!![]});}})[_0xda3f('0x8')](function(_0x3e5fa6){if(_0x369a16[_0xda3f('0x2e')][_0xda3f('0x3a')]()==_0xda3f('0x3b')){var _0x5dc21f=fs[_0xda3f('0x3c')](path[_0xda3f('0x3d')](config[_0xda3f('0x44')],_0xda3f('0x3e')),'utf8');var _0x2268ce=ejs[_0xda3f('0x40')](_0x5dc21f,{'networks':_0x3e5fa6||[]});fs[_0xda3f('0x41')](_0xda3f('0x4f'),_0x2268ce);return respondWithRpcPromise(_0xda3f('0x46'),_0xda3f('0x19'),{'module':_0xda3f('0x42')});}else if(_0x369a16[_0xda3f('0x2e')][_0xda3f('0x3a')]()==_0xda3f('0x43')){var _0x495a4e=fs[_0xda3f('0x3c')](path[_0xda3f('0x3d')](config[_0xda3f('0x44')],_0xda3f('0x50')),'utf8');var _0x409fa4=ejs['render'](_0x495a4e,{'networks':_0x3e5fa6||[]});fs[_0xda3f('0x41')](_0xda3f('0x45'),_0x409fa4);return respondWithRpcPromise(_0xda3f('0x46'),'destroy',{'module':_0xda3f('0x42')});}else{var _0x3f522d=fs[_0xda3f('0x3c')](path[_0xda3f('0x3d')](config['root'],_0xda3f('0x47')),'utf8');var _0x20a9ea=ejs[_0xda3f('0x40')](_0x3f522d,{'networks':_0x3e5fa6||[]});fs[_0xda3f('0x41')](util[_0xda3f('0x48')]('/etc/asterisk/sip_xcally_%s.conf',_0x369a16[_0xda3f('0x2e')]['toLowerCase']()),_0x20a9ea);return respondWithRpcPromise(_0xda3f('0x46'),'destroy',{'module':_0xda3f('0x4b')});}})[_0xda3f('0x10')](handleError(_0x46d54a,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index ea89058..1642fba 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 _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 +var _0x3140=['../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x3fab82,_0x2dc357){var _0x52839a=function(_0x194b44){while(--_0x194b44){_0x3fab82['push'](_0x3fab82['shift']());}};_0x52839a(++_0x2dc357);}(_0x3140,0xaf));var _0x0314=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0x3140[_0x469a3c];return _0x968f4;};'use strict';var _=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var logger=require(_0x0314('0x2'))(_0x0314('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0314('0x4'));var fs=require('fs');var path=require(_0x0314('0x5'));var rimraf=require(_0x0314('0x6'));var config=require(_0x0314('0x7'));var attributes=require(_0x0314('0x8'));module[_0x0314('0x9')]=function(_0x9e308d,_0xf87d26){return _0x9e308d[_0x0314('0xa')](_0x0314('0xb'),attributes,{'tableName':_0x0314('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 8c9a4f0..8e45e4c 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_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 +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x343fb9,_0x215ad0){_0x343fb9=_0x343fb9-0x0;var _0x3c9c0d=_0x7a54[_0x343fb9];return _0x3c9c0d;};'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 a88a421..1f37faf 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 _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 +var _0x7cb6=['/:id/interactions','getInteractions','/:id/users','create','post','addAnswer','/:id/notify','notify','addApplications','send','put','update','delete','destroy','/:id/dispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','isAuthenticated','index','get','/:id','show','getDispositions','/:id/canned_answers','/:id/applications','getApplications'];(function(_0x432385,_0x5b7a37){var _0x204192=function(_0x2feba8){while(--_0x2feba8){_0x432385['push'](_0x432385['shift']());}};_0x204192(++_0x5b7a37);}(_0x7cb6,0x188));var _0x67cb=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x7cb6[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x67cb('0x0'));var util=require('util');var path=require(_0x67cb('0x1'));var timeout=require(_0x67cb('0x2'));var express=require(_0x67cb('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x67cb('0x4'));var interaction=require(_0x67cb('0x5'));var config=require('../../config/environment');var controller=require(_0x67cb('0x6'));router['get']('/',auth[_0x67cb('0x7')](),controller[_0x67cb('0x8')]);router[_0x67cb('0x9')]('/describe',auth[_0x67cb('0x7')](),controller['describe']);router[_0x67cb('0x9')](_0x67cb('0xa'),auth[_0x67cb('0x7')](),controller[_0x67cb('0xb')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x67cb('0xc')]);router['get'](_0x67cb('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x67cb('0xe'),auth[_0x67cb('0x7')](),controller[_0x67cb('0xf')]);router[_0x67cb('0x9')](_0x67cb('0x10'),auth[_0x67cb('0x7')](),controller[_0x67cb('0x11')]);router[_0x67cb('0x9')](_0x67cb('0x12'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x67cb('0x7')](),controller[_0x67cb('0x13')]);router[_0x67cb('0x14')]('/:id/dispositions',auth[_0x67cb('0x7')](),controller['addDisposition']);router['post'](_0x67cb('0xd'),auth[_0x67cb('0x7')](),controller[_0x67cb('0x15')]);router[_0x67cb('0x14')](_0x67cb('0x16'),controller[_0x67cb('0x17')]);router[_0x67cb('0x14')](_0x67cb('0xe'),auth[_0x67cb('0x7')](),controller[_0x67cb('0x18')]);router['post'](_0x67cb('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0x67cb('0x14')]('/:id/send',auth['isAuthenticated'](),controller[_0x67cb('0x19')]);router[_0x67cb('0x1a')](_0x67cb('0xa'),auth[_0x67cb('0x7')](),controller[_0x67cb('0x1b')]);router[_0x67cb('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x67cb('0x1d')]);router['delete'](_0x67cb('0x1e'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x67cb('0x1c')](_0x67cb('0xd'),auth[_0x67cb('0x7')](),controller[_0x67cb('0x1f')]);router[_0x67cb('0x1c')](_0x67cb('0x12'),auth[_0x67cb('0x7')](),controller[_0x67cb('0x20')]);module[_0x67cb('0x21')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 94a081c..340a797 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 _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 +var _0x926c=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x15af16,_0x357799){var _0x1a3650=function(_0x3594cf){while(--_0x3594cf){_0x15af16['push'](_0x15af16['shift']());}};_0x1a3650(++_0x357799);}(_0x926c,0x166));var _0xc926=function(_0x247f19,_0x419bd5){_0x247f19=_0x247f19-0x0;var _0x554ef6=_0x926c[_0x247f19];return _0x554ef6;};'use strict';var Sequelize=require(_0xc926('0x0'));var rs=require(_0xc926('0x1'));module['exports']={'name':{'type':Sequelize[_0xc926('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xc926('0x2')]},'token':{'type':Sequelize[_0xc926('0x2')],'defaultValue':function(){return rs[_0xc926('0x3')]();}},'replyUri':{'type':Sequelize[_0xc926('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc926('0x4')],'defaultValue':function(){return _0xc926('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc926('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc926('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xc926('0x2')]},'queueTransfer':{'type':Sequelize[_0xc926('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc926('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc926('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc926('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc926('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xc926('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xc926('0x6')],'defaultValue':![],'comment':_0xc926('0x9'),'set':function(_0x4fd2c2){if(!_0x4fd2c2)this['setDataValue'](_0xc926('0xa'),null);this[_0xc926('0xb')](_0xc926('0xc'),_0x4fd2c2);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index f3baec5..9a27689 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 _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 +var _0xe43c=['getAgents','out','Messages','spread','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','get','OpenchannelAccounts','UserProfileResource','end','stack','name','send','index','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','include','rows','show','Pause','keys','rawAttributes','includeAll','options','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','findOne','OpenchannelAccountId','merge','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','openchannel','CmContact','ValidationError','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','OpenchannelApplication','Applications','List','account','applications','list','priority','asc','contact','lastName','threadId','OpenchannelInteraction','messageId','interaction','created','autoclose','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe43c,0x180));var _0xce43=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xe43c[_0x209941];return _0x1e8729;};'use strict';var emlformat=require(_0xce43('0x0'));var rimraf=require(_0xce43('0x1'));var zipdir=require(_0xce43('0x2'));var jsonpatch=require(_0xce43('0x3'));var rp=require(_0xce43('0x4'));var moment=require(_0xce43('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xce43('0x6'));var util=require('util');var path=require(_0xce43('0x7'));var sox=require(_0xce43('0x8'));var csv=require(_0xce43('0x9'));var ejs=require(_0xce43('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce43('0xb'));var squel=require('squel');var crypto=require(_0xce43('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xce43('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xce43('0xe'));var Redis=require(_0xce43('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce43('0x10'));var logger=require('../../config/logger')(_0xce43('0x11'));var utils=require('../../config/utils');var config=require(_0xce43('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xce43('0x13'))['db'];config[_0xce43('0x14')]=_[_0xce43('0x15')](config[_0xce43('0x14')],{'host':_0xce43('0x16'),'port':0x18eb});var socket=require(_0xce43('0x17'))(new Redis(config[_0xce43('0x14')]));require('./openchannelAccount.socket')[_0xce43('0x18')](socket);var jayson=require(_0xce43('0x19'));var client=jayson[_0xce43('0x1a')][_0xce43('0x1b')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c0948,_0x3e4218,_0x2eb70b,_0x2a9cb4){return new BPromise(function(_0xd5282,_0x3f79bd){var _0x4e166b=_0x2a9cb4||client;return _0x4e166b[_0xce43('0x1c')](_0x3c0948,_0x2eb70b)[_0xce43('0x1d')](function(_0xbc38f0){logger[_0xce43('0x1e')]('OpenchannelAccount,\x20%s,\x20%s',_0x3e4218,_0xce43('0x1f'));logger[_0xce43('0x20')](_0xce43('0x21'),_0x3e4218,_0xce43('0x1f'),JSON[_0xce43('0x22')](_0xbc38f0));if(_0xbc38f0[_0xce43('0x23')]){if(_0xbc38f0['error'][_0xce43('0x24')]===0x1f4){logger[_0xce43('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x3e4218,_0xbc38f0[_0xce43('0x23')][_0xce43('0x25')]);return _0x3f79bd(_0xbc38f0[_0xce43('0x23')]['message']);}logger['error'](_0xce43('0x26'),_0x3e4218,_0xbc38f0[_0xce43('0x23')][_0xce43('0x25')]);return _0xd5282(_0xbc38f0[_0xce43('0x23')][_0xce43('0x25')]);}else{logger[_0xce43('0x1e')](_0xce43('0x26'),_0x3e4218,'request\x20sent');_0xd5282(_0xbc38f0[_0xce43('0x27')][_0xce43('0x25')]);}})[_0xce43('0x28')](function(_0x2ae225){logger['error'](_0xce43('0x26'),_0x3e4218,_0x2ae225);_0x3f79bd(_0x2ae225);});});}function respondWithStatusCode(_0x45fec7,_0x117ac1){_0x117ac1=_0x117ac1||0xcc;return function(_0x1bb63f){if(_0x1bb63f){return _0x45fec7[_0xce43('0x29')](_0x117ac1);}return _0x45fec7[_0xce43('0x2a')](_0x117ac1)['end']();};}function respondWithResult(_0x371985,_0x5cb93a){_0x5cb93a=_0x5cb93a||0xc8;return function(_0xe9a34c){if(_0xe9a34c){return _0x371985[_0xce43('0x2a')](_0x5cb93a)[_0xce43('0x2b')](_0xe9a34c);}};}function respondWithFilteredResult(_0x167d5d,_0x536452){return function(_0xb6527c){if(_0xb6527c){var _0x4402f8=typeof _0x536452[_0xce43('0x2c')]===_0xce43('0x2d')&&typeof _0x536452['limit']===_0xce43('0x2d');var _0x345eaf=_0xb6527c['count'];var _0x388279=_0x4402f8?0x0:_0x536452[_0xce43('0x2c')];var _0x124776=_0x4402f8?_0xb6527c[_0xce43('0x2e')]:_0x536452[_0xce43('0x2c')]+_0x536452[_0xce43('0x2f')];var _0x496d25;if(_0x124776>=_0x345eaf){_0x124776=_0x345eaf;_0x496d25=0xc8;}else{_0x496d25=0xce;}_0x167d5d['status'](_0x496d25);return _0x167d5d[_0xce43('0x30')](_0xce43('0x31'),_0x388279+'-'+_0x124776+'/'+_0x345eaf)['json'](_0xb6527c);}return null;};}function patchUpdates(_0x2ebb25){return function(_0x102271){try{jsonpatch[_0xce43('0x32')](_0x102271,_0x2ebb25,!![]);}catch(_0x8e5838){return BPromise[_0xce43('0x33')](_0x8e5838);}return _0x102271['save']();};}function saveUpdates(_0x4b3d12,_0x3072e8){return function(_0x32b5e1){if(_0x32b5e1){return _0x32b5e1[_0xce43('0x34')](_0x4b3d12)[_0xce43('0x1d')](function(_0x107be7){return _0x107be7;});}return null;};}function removeEntity(_0x211252,_0x737b2c){return function(_0x667b99){if(_0x667b99){return _0x667b99[_0xce43('0x35')]()[_0xce43('0x1d')](function(){var _0x391e41=_0x667b99[_0xce43('0x36')]({'plain':!![]});var _0x24a782=_0xce43('0x37');return db[_0xce43('0x38')][_0xce43('0x35')]({'where':{'type':_0x24a782,'resourceId':_0x391e41['id']}})[_0xce43('0x1d')](function(){return _0x667b99;});})['then'](function(){_0x211252[_0xce43('0x2a')](0xcc)[_0xce43('0x39')]();});}};}function handleEntityNotFound(_0x1dd276,_0x3a9a70){return function(_0xe4449e){if(!_0xe4449e){_0x1dd276[_0xce43('0x29')](0x194);}return _0xe4449e;};}function handleError(_0x4a96ae,_0x3f8a5f){_0x3f8a5f=_0x3f8a5f||0x1f4;return function(_0x1af0c2){logger[_0xce43('0x23')](_0x1af0c2[_0xce43('0x3a')]);if(_0x1af0c2[_0xce43('0x3b')]){delete _0x1af0c2['name'];}_0x4a96ae['status'](_0x3f8a5f)[_0xce43('0x3c')](_0x1af0c2);};}exports[_0xce43('0x3d')]=function(_0x5d7d69,_0x338c54){var _0x269d81={'include':[{'model':db['Pause'],'as':_0xce43('0x3e')}]},_0x87477d={},_0x2fcb62={'count':0x0,'rows':[]};var _0x54d6c4=_[_0xce43('0x3f')](db[_0xce43('0x40')]['rawAttributes'],function(_0x30ad29){return{'name':_0x30ad29[_0xce43('0x41')],'type':_0x30ad29[_0xce43('0x42')]['key']};});_0x87477d['model']=_[_0xce43('0x3f')](_0x54d6c4,_0xce43('0x3b'));_0x87477d[_0xce43('0x43')]=_['keys'](_0x5d7d69[_0xce43('0x43')]);_0x87477d[_0xce43('0x44')]=_[_0xce43('0x45')](_0x87477d[_0xce43('0x46')],_0x87477d['query']);_0x269d81[_0xce43('0x47')]=_[_0xce43('0x45')](_0x87477d[_0xce43('0x46')],qs[_0xce43('0x48')](_0x5d7d69[_0xce43('0x43')][_0xce43('0x48')]));_0x269d81[_0xce43('0x47')]=_0x269d81[_0xce43('0x47')][_0xce43('0x49')]?_0x269d81['attributes']:_0x87477d['model'];if(!_0x5d7d69[_0xce43('0x43')][_0xce43('0x4a')](_0xce43('0x4b'))){_0x269d81[_0xce43('0x2f')]=qs[_0xce43('0x2f')](_0x5d7d69[_0xce43('0x43')][_0xce43('0x2f')]);_0x269d81[_0xce43('0x2c')]=qs[_0xce43('0x2c')](_0x5d7d69[_0xce43('0x43')][_0xce43('0x2c')]);}_0x269d81[_0xce43('0x4c')]=qs[_0xce43('0x4d')](_0x5d7d69[_0xce43('0x43')][_0xce43('0x4d')]);_0x269d81[_0xce43('0x4e')]=qs[_0xce43('0x44')](_[_0xce43('0x4f')](_0x5d7d69['query'],_0x87477d[_0xce43('0x44')]),_0x54d6c4);if(_0x5d7d69[_0xce43('0x43')][_0xce43('0x50')]){_0x269d81['where']=_['merge'](_0x269d81[_0xce43('0x4e')],{'$or':_['map'](_0x54d6c4,function(_0x4c13e4){if(_0x4c13e4['type']!=='VIRTUAL'){var _0x3de6ec={};_0x3de6ec[_0x4c13e4[_0xce43('0x3b')]]={'$like':'%'+_0x5d7d69['query'][_0xce43('0x50')]+'%'};return _0x3de6ec;}})});}_0x269d81=_['merge']({},_0x269d81,_0x5d7d69['options']);var _0x451c44={'where':_0x269d81['where']};return db['OpenchannelAccount'][_0xce43('0x2e')](_0x451c44)[_0xce43('0x1d')](function(_0x489aa2){_0x2fcb62['count']=_0x489aa2;if(_0x5d7d69[_0xce43('0x43')]['includeAll']){_0x269d81[_0xce43('0x51')]=[{'all':!![]}];}return db[_0xce43('0x40')]['findAll'](_0x269d81);})[_0xce43('0x1d')](function(_0x2421e3){_0x2fcb62[_0xce43('0x52')]=_0x2421e3;return _0x2fcb62;})[_0xce43('0x1d')](respondWithFilteredResult(_0x338c54,_0x269d81))[_0xce43('0x28')](handleError(_0x338c54,null));};exports[_0xce43('0x53')]=function(_0x3a418f,_0x2d44ac){var _0xc2c210={'raw':![],'where':{'id':_0x3a418f['params']['id']},'include':[{'model':db[_0xce43('0x54')],'as':_0xce43('0x3e')}]},_0x4933ce={};_0x4933ce[_0xce43('0x46')]=_[_0xce43('0x55')](db[_0xce43('0x40')][_0xce43('0x56')]);_0x4933ce['query']=_[_0xce43('0x55')](_0x3a418f[_0xce43('0x43')]);_0x4933ce[_0xce43('0x44')]=_[_0xce43('0x45')](_0x4933ce[_0xce43('0x46')],_0x4933ce[_0xce43('0x43')]);_0xc2c210[_0xce43('0x47')]=_[_0xce43('0x45')](_0x4933ce[_0xce43('0x46')],qs[_0xce43('0x48')](_0x3a418f[_0xce43('0x43')]['fields']));_0xc2c210[_0xce43('0x47')]=_0xc2c210[_0xce43('0x47')][_0xce43('0x49')]?_0xc2c210['attributes']:_0x4933ce[_0xce43('0x46')];if(_0x3a418f[_0xce43('0x43')][_0xce43('0x57')]){_0xc2c210['include']=[{'all':!![]}];}_0xc2c210=_['merge']({},_0xc2c210,_0x3a418f[_0xce43('0x58')]);return db['OpenchannelAccount'][_0xce43('0x59')](_0xc2c210)[_0xce43('0x1d')](handleEntityNotFound(_0x2d44ac,null))[_0xce43('0x1d')](respondWithResult(_0x2d44ac,null))['catch'](handleError(_0x2d44ac,null));};exports['create']=function(_0x5181ba,_0x5aaeeb){return db['OpenchannelAccount']['create'](_0x5181ba[_0xce43('0x5a')],{})[_0xce43('0x1d')](function(_0x1dd2ca){var _0x1acb75=_0x5181ba['user']['get']({'plain':!![]});if(!_0x1acb75)throw new Error(_0xce43('0x5b'));if(_0x1acb75[_0xce43('0x5c')]===_0xce43('0x5d')){var _0x3adb37=_0x1dd2ca['get']({'plain':!![]});var _0x456eec=_0xce43('0x37');return db['UserProfileSection'][_0xce43('0x59')]({'where':{'name':_0x456eec,'userProfileId':_0x1acb75[_0xce43('0x5e')]},'raw':!![]})[_0xce43('0x1d')](function(_0x5f49df){if(_0x5f49df&&_0x5f49df[_0xce43('0x5f')]===0x0){return db[_0xce43('0x38')][_0xce43('0x60')]({'name':_0x3adb37['name'],'resourceId':_0x3adb37['id'],'type':_0x5f49df['name'],'sectionId':_0x5f49df['id']},{})[_0xce43('0x1d')](function(){return _0x1dd2ca;});}else{return _0x1dd2ca;}})['catch'](function(_0x40e11b){logger['error'](_0xce43('0x61'),_0x40e11b);throw _0x40e11b;});}return _0x1dd2ca;})['then'](respondWithResult(_0x5aaeeb,0xc9))['catch'](handleError(_0x5aaeeb,null));};exports[_0xce43('0x34')]=function(_0x4b6956,_0x2b2af4){if(_0x4b6956[_0xce43('0x5a')]['id']){delete _0x4b6956[_0xce43('0x5a')]['id'];}return db[_0xce43('0x40')][_0xce43('0x59')]({'where':{'id':_0x4b6956[_0xce43('0x62')]['id']},'include':[{'model':db[_0xce43('0x54')],'as':_0xce43('0x3e')}]})[_0xce43('0x1d')](handleEntityNotFound(_0x2b2af4,null))[_0xce43('0x1d')](saveUpdates(_0x4b6956[_0xce43('0x5a')],null))['then'](respondWithResult(_0x2b2af4,null))[_0xce43('0x28')](handleError(_0x2b2af4,null));};exports[_0xce43('0x35')]=function(_0x25b2a8,_0x286d08){return db[_0xce43('0x40')][_0xce43('0x59')]({'where':{'id':_0x25b2a8[_0xce43('0x62')]['id']}})[_0xce43('0x1d')](handleEntityNotFound(_0x286d08,null))['then'](removeEntity(_0x286d08,null))['catch'](handleError(_0x286d08,null));};exports[_0xce43('0x63')]=function(_0x2f95f3,_0x55d73e){return db[_0xce43('0x40')]['describe']()['then'](respondWithResult(_0x55d73e,null))[_0xce43('0x28')](handleError(_0x55d73e,null));};exports[_0xce43('0x64')]=function(_0x35db1a,_0x8c3fa2,_0x183829){if(_0x35db1a['body']['id']){delete _0x35db1a[_0xce43('0x5a')]['id'];}return db[_0xce43('0x40')]['find']({'where':{'id':_0x35db1a[_0xce43('0x62')]['id']}})['then'](handleEntityNotFound(_0x8c3fa2,null))[_0xce43('0x1d')](function(_0x31c96e){if(_0x31c96e){_0x35db1a[_0xce43('0x5a')]['OpenchannelAccountId']=_0x31c96e['id'];return db[_0xce43('0x65')]['create'](_0x35db1a[_0xce43('0x5a')]);}})['then'](respondWithResult(_0x8c3fa2,null))[_0xce43('0x28')](handleError(_0x8c3fa2,null));};exports['getDispositions']=function(_0x4ac1d6,_0x529656,_0x259320){var _0x502cdf={'raw':![],'where':{}};var _0x4c8861={};var _0x2d0587={'count':0x0,'rows':[]};return db[_0xce43('0x40')][_0xce43('0x66')]({'where':{'id':_0x4ac1d6['params']['id']}})[_0xce43('0x1d')](handleEntityNotFound(_0x529656,null))[_0xce43('0x1d')](function(_0x215892){if(_0x215892){_0x4c8861[_0xce43('0x46')]=_['keys'](db['Disposition'][_0xce43('0x56')]);_0x4c8861[_0xce43('0x43')]=_[_0xce43('0x55')](_0x4ac1d6[_0xce43('0x43')]);_0x4c8861['filters']=_[_0xce43('0x45')](_0x4c8861[_0xce43('0x46')],_0x4c8861['query']);_0x502cdf[_0xce43('0x47')]=_['intersection'](_0x4c8861[_0xce43('0x46')],qs[_0xce43('0x48')](_0x4ac1d6[_0xce43('0x43')][_0xce43('0x48')]));_0x502cdf[_0xce43('0x47')]=_0x502cdf[_0xce43('0x47')][_0xce43('0x49')]?_0x502cdf[_0xce43('0x47')]:_0x4c8861[_0xce43('0x46')];if(!_0x4ac1d6[_0xce43('0x43')][_0xce43('0x4a')](_0xce43('0x4b'))){_0x502cdf[_0xce43('0x2f')]=qs[_0xce43('0x2f')](_0x4ac1d6['query']['limit']);_0x502cdf[_0xce43('0x2c')]=qs[_0xce43('0x2c')](_0x4ac1d6[_0xce43('0x43')]['offset']);}_0x502cdf[_0xce43('0x4c')]=qs['sort'](_0x4ac1d6[_0xce43('0x43')][_0xce43('0x4d')]);_0x502cdf['where']=qs[_0xce43('0x44')](_[_0xce43('0x4f')](_0x4ac1d6['query'],_0x4c8861[_0xce43('0x44')]));_0x502cdf['where'][_0xce43('0x67')]=_0x215892['id'];if(_0x4ac1d6[_0xce43('0x43')][_0xce43('0x50')]){_0x502cdf[_0xce43('0x4e')]=_[_0xce43('0x68')](_0x502cdf[_0xce43('0x4e')],{'$or':_[_0xce43('0x3f')](_0x502cdf[_0xce43('0x47')],function(_0x393552){var _0x3c1c6d={};_0x3c1c6d[_0x393552]={'$like':'%'+_0x4ac1d6[_0xce43('0x43')]['filter']+'%'};return _0x3c1c6d;})});}_0x502cdf=_['merge']({},_0x502cdf,_0x4ac1d6['options']);return db[_0xce43('0x65')][_0xce43('0x2e')]({'where':_0x502cdf[_0xce43('0x4e')]})[_0xce43('0x1d')](function(_0x334e78){_0x2d0587[_0xce43('0x2e')]=_0x334e78;if(_0x4ac1d6[_0xce43('0x43')][_0xce43('0x57')]){_0x502cdf[_0xce43('0x51')]=[{'all':!![]}];}return db[_0xce43('0x65')]['findAll'](_0x502cdf);})[_0xce43('0x1d')](function(_0x4f09da){_0x2d0587['rows']=_0x4f09da;return _0x2d0587;});}})[_0xce43('0x1d')](respondWithFilteredResult(_0x529656,_0x502cdf))[_0xce43('0x28')](handleError(_0x529656,null));};exports[_0xce43('0x69')]=function(_0x268cba,_0x34609a,_0x4188e8){return db[_0xce43('0x40')][_0xce43('0x59')]({'where':{'id':_0x268cba[_0xce43('0x62')]['id']}})[_0xce43('0x1d')](handleEntityNotFound(_0x34609a,null))[_0xce43('0x1d')](function(_0x46c2b2){if(_0x46c2b2){return _0x46c2b2[_0xce43('0x69')](_0x268cba['query'][_0xce43('0x6a')]);}})[_0xce43('0x1d')](respondWithStatusCode(_0x34609a,null))['catch'](handleError(_0x34609a,null));};exports[_0xce43('0x6b')]=function(_0x213c62,_0x8d10df,_0x591e91){if(_0x213c62[_0xce43('0x5a')]['id']){delete _0x213c62[_0xce43('0x5a')]['id'];}return db[_0xce43('0x40')][_0xce43('0x59')]({'where':{'id':_0x213c62['params']['id']}})['then'](handleEntityNotFound(_0x8d10df,null))[_0xce43('0x1d')](function(_0x120bcd){if(_0x120bcd){_0x213c62[_0xce43('0x5a')][_0xce43('0x67')]=_0x120bcd['id'];return db[_0xce43('0x6c')][_0xce43('0x60')](_0x213c62[_0xce43('0x5a')]);}})['then'](respondWithResult(_0x8d10df,null))[_0xce43('0x28')](handleError(_0x8d10df,null));};exports[_0xce43('0x6d')]=function(_0x33881f,_0x3fe1f8,_0x18cefb){var _0x58f5fd={'raw':![],'where':{}};var _0x12dc4d={};var _0xf81d42={'count':0x0,'rows':[]};return db[_0xce43('0x40')][_0xce43('0x66')]({'where':{'id':_0x33881f[_0xce43('0x62')]['id']}})[_0xce43('0x1d')](handleEntityNotFound(_0x3fe1f8,null))[_0xce43('0x1d')](function(_0x380dac){if(_0x380dac){_0x12dc4d[_0xce43('0x46')]=_['keys'](db[_0xce43('0x6c')][_0xce43('0x56')]);_0x12dc4d[_0xce43('0x43')]=_['keys'](_0x33881f[_0xce43('0x43')]);_0x12dc4d[_0xce43('0x44')]=_['intersection'](_0x12dc4d[_0xce43('0x46')],_0x12dc4d[_0xce43('0x43')]);_0x58f5fd[_0xce43('0x47')]=_['intersection'](_0x12dc4d[_0xce43('0x46')],qs['fields'](_0x33881f[_0xce43('0x43')][_0xce43('0x48')]));_0x58f5fd[_0xce43('0x47')]=_0x58f5fd[_0xce43('0x47')][_0xce43('0x49')]?_0x58f5fd[_0xce43('0x47')]:_0x12dc4d[_0xce43('0x46')];if(!_0x33881f[_0xce43('0x43')][_0xce43('0x4a')]('nolimit')){_0x58f5fd[_0xce43('0x2f')]=qs[_0xce43('0x2f')](_0x33881f[_0xce43('0x43')][_0xce43('0x2f')]);_0x58f5fd[_0xce43('0x2c')]=qs[_0xce43('0x2c')](_0x33881f['query'][_0xce43('0x2c')]);}_0x58f5fd[_0xce43('0x4c')]=qs[_0xce43('0x4d')](_0x33881f[_0xce43('0x43')][_0xce43('0x4d')]);_0x58f5fd[_0xce43('0x4e')]=qs[_0xce43('0x44')](_[_0xce43('0x4f')](_0x33881f[_0xce43('0x43')],_0x12dc4d[_0xce43('0x44')]));_0x58f5fd[_0xce43('0x4e')][_0xce43('0x67')]=_0x380dac['id'];if(_0x33881f[_0xce43('0x43')][_0xce43('0x50')]){_0x58f5fd[_0xce43('0x4e')]=_[_0xce43('0x68')](_0x58f5fd[_0xce43('0x4e')],{'$or':_[_0xce43('0x3f')](_0x58f5fd['attributes'],function(_0x477d57){var _0x2c04cf={};_0x2c04cf[_0x477d57]={'$like':'%'+_0x33881f[_0xce43('0x43')]['filter']+'%'};return _0x2c04cf;})});}_0x58f5fd=_[_0xce43('0x68')]({},_0x58f5fd,_0x33881f[_0xce43('0x58')]);return db[_0xce43('0x6c')]['count']({'where':_0x58f5fd[_0xce43('0x4e')]})[_0xce43('0x1d')](function(_0x4da74a){_0xf81d42[_0xce43('0x2e')]=_0x4da74a;if(_0x33881f['query'][_0xce43('0x57')]){_0x58f5fd[_0xce43('0x51')]=[{'all':!![]}];}return db[_0xce43('0x6c')][_0xce43('0x6e')](_0x58f5fd);})[_0xce43('0x1d')](function(_0x523528){_0xf81d42[_0xce43('0x52')]=_0x523528;return _0xf81d42;});}})[_0xce43('0x1d')](respondWithFilteredResult(_0x3fe1f8,_0x58f5fd))[_0xce43('0x28')](handleError(_0x3fe1f8,null));};exports[_0xce43('0x6f')]=function(_0x535664,_0xf93a5c,_0x3bfef1){return db[_0xce43('0x40')][_0xce43('0x59')]({'where':{'id':_0x535664[_0xce43('0x62')]['id']}})[_0xce43('0x1d')](handleEntityNotFound(_0xf93a5c,null))[_0xce43('0x1d')](function(_0x32414f){if(_0x32414f){return _0x32414f[_0xce43('0x6f')](_0x535664[_0xce43('0x43')][_0xce43('0x6a')]);}})[_0xce43('0x1d')](respondWithStatusCode(_0xf93a5c,null))[_0xce43('0x28')](handleError(_0xf93a5c,null));};exports['notify']=function(_0x3f5c74,_0x2e935a,_0x417b2e){var _0x5cfd2f={'body':_0x3f5c74[_0xce43('0x5a')],'channel':_0xce43('0x70')};var _0x4d5186=[];var _0xd9d118=[];var _0x330428={};var _0x13839e=![];return db[_0xce43('0x71')]['describe']()['then'](function(_0x928998){if(!_0x928998){throw new db['Sequelize'][(_0xce43('0x72'))]('no\x20available\x20attributes');}_0x4d5186=_['difference'](_[_0xce43('0x55')](_0x928998),['createdAt',_0xce43('0x73')]);_0xd9d118=_['difference'](_['keys'](_0x928998),['createdAt',_0xce43('0x73'),_0xce43('0x74'),_0xce43('0x75')]);if(_0x3f5c74[_0xce43('0x5a')]['id']){delete _0x3f5c74[_0xce43('0x5a')]['id'];}if(_[_0xce43('0x76')](_0x3f5c74[_0xce43('0x5a')][_0xce43('0x77')])){throw new db['Sequelize'][(_0xce43('0x72'))](_0xce43('0x78'));}if(_[_0xce43('0x76')](_0x3f5c74[_0xce43('0x5a')][_0xce43('0x5a')])||_0x3f5c74['body'][_0xce43('0x5a')]===''){throw new db[(_0xce43('0x79'))][(_0xce43('0x72'))](_0xce43('0x7a'));}if(_[_0xce43('0x76')](_0x3f5c74[_0xce43('0x5a')][_0xce43('0x7b')])){throw new db[(_0xce43('0x79'))][(_0xce43('0x72'))](_0xce43('0x7c')+_0xd9d118);}if(!_[_0xce43('0x7d')](_0xd9d118,_0x3f5c74['body'][_0xce43('0x7b')])){throw new db[(_0xce43('0x79'))][(_0xce43('0x72'))](_0xce43('0x7e')+_0xd9d118);}_0x330428[_0x3f5c74[_0xce43('0x5a')]['mapKey']]=_0x3f5c74[_0xce43('0x5a')][_0xce43('0x77')];})[_0xce43('0x1d')](function(){return db[_0xce43('0x40')][_0xce43('0x59')]({'where':{'id':_0x3f5c74[_0xce43('0x62')]['id']},'include':[{'model':db[_0xce43('0x7f')],'as':'List','include':[{'model':db[_0xce43('0x71')],'as':_0xce43('0x80'),'where':_0x330428,'limit':0x1,'order':[[_0xce43('0x73'),_0xce43('0x81')]]}]},{'model':db[_0xce43('0x82')],'as':_0xce43('0x83')}]});})[_0xce43('0x1d')](handleEntityNotFound(_0x2e935a,null))[_0xce43('0x1d')](function(_0x1bfebc){if(_0x1bfebc&&_0x1bfebc[_0xce43('0x84')]){_0x5cfd2f[_0xce43('0x85')]=_0x1bfebc;_0x5cfd2f[_0xce43('0x86')]=_0x1bfebc[_0xce43('0x83')];_0x5cfd2f[_0xce43('0x87')]=_0x1bfebc['List'];_0x5cfd2f[_0xce43('0x86')]=_['orderBy'](_0x5cfd2f[_0xce43('0x86')],[_0xce43('0x88')],[_0xce43('0x89')]);if(_0x5cfd2f['account']['Applications']){delete _0x5cfd2f['account'][_0xce43('0x83')];}if(_0x5cfd2f[_0xce43('0x85')][_0xce43('0x84')]&&_0x5cfd2f['account'][_0xce43('0x84')][_0xce43('0x80')][_0xce43('0x49')]){return _0x5cfd2f['account'][_0xce43('0x84')][_0xce43('0x80')][0x0];}var _0x5c8060=_[_0xce43('0x15')](_0x3f5c74[_0xce43('0x5a')],{'firstName':_0x3f5c74[_0xce43('0x5a')][_0xce43('0x77')],'ListId':_0x1bfebc['ListId']});_0x5c8060[_0x3f5c74[_0xce43('0x5a')][_0xce43('0x7b')]]=_0x3f5c74['body']['from'];return db[_0xce43('0x71')][_0xce43('0x60')](_0x5c8060,{'fields':_0x4d5186,'raw':!![]});}})[_0xce43('0x1d')](handleEntityNotFound(_0x2e935a,null))[_0xce43('0x1d')](function(_0x4bb6ce){_0x5cfd2f[_0xce43('0x8a')]=_0x4bb6ce;if(_0x4bb6ce){var _0x999f58={'ContactId':_0x4bb6ce['id'],'OpenchannelAccountId':_0x3f5c74[_0xce43('0x62')]['id'],'from':(_0x4bb6ce['firstName']||'')+'\x20'+(_0x4bb6ce[_0xce43('0x8b')]||'')};var _0x5bab41={'OpenchannelAccountId':_0x3f5c74[_0xce43('0x62')]['id'],'closed':![]};if(_0x3f5c74[_0xce43('0x5a')]['threadId']){_0x5bab41[_0xce43('0x8c')]=_0x3f5c74['body'][_0xce43('0x8c')];return db[_0xce43('0x8d')]['find']({'where':_0x5bab41})['then'](function(_0x337faf){if(_0x337faf){return[_0x337faf,![]];}_0x999f58['threadId']=_0x3f5c74[_0xce43('0x5a')]['threadId'];_0x999f58['externalUrl']=_0x3f5c74[_0xce43('0x5a')]['externalUrl'];return db[_0xce43('0x8d')]['create'](_0x999f58)[_0xce43('0x1d')](function(_0x55455f){return[_0x55455f,!![]];});});}else{_0x5bab41[_0xce43('0x8c')]=null;}_0x5bab41['ContactId']=_0x4bb6ce['id'];return db['OpenchannelInteraction']['find']({'where':_0x5bab41})[_0xce43('0x1d')](function(_0x3ff970){if(_0x3ff970){return[_0x3ff970,![]];}return db['OpenchannelInteraction'][_0xce43('0x60')](_0x999f58)[_0xce43('0x1d')](function(_0x3aaa15){return[_0x3aaa15,!![]];});});}})['spread'](function(_0x62efc5,_0xcb5862){if(_0x62efc5){_0x13839e=_0xcb5862;if(!_0xcb5862){var _0xfeb8cc={'from':(_0x5cfd2f[_0xce43('0x8a')]['firstName']||'')+'\x20'+(_0x5cfd2f[_0xce43('0x8a')][_0xce43('0x8b')]||'')};if(_0x3f5c74[_0xce43('0x5a')]['threadId']&&_0x3f5c74[_0xce43('0x5a')][_0xce43('0x8e')]&&_0x3f5c74[_0xce43('0x5a')][_0xce43('0x8c')]!=_0x3f5c74[_0xce43('0x5a')][_0xce43('0x8e')]){_0xfeb8cc[_0xce43('0x8c')]=_0x3f5c74[_0xce43('0x5a')]['messageId'];}return _0x62efc5['update'](_0xfeb8cc);}else{return _0x62efc5;}}})[_0xce43('0x1d')](function(_0x217343){_0x5cfd2f[_0xce43('0x8f')]=_0x217343[_0xce43('0x36')]({'plain':!![]});_0x5cfd2f[_0xce43('0x8f')][_0xce43('0x90')]=_0x13839e;if(_0x5cfd2f[_0xce43('0x8f')]['created']){if(_0x5cfd2f['account'][_0xce43('0x91')]){_0x5cfd2f['applications']['push']({'id':0x0,'priority':_0x5cfd2f[_0xce43('0x86')][_0xce43('0x49')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xce43('0x92')});}}return db[_0xce43('0x93')][_0xce43('0x60')]({'body':_0x3f5c74['body'][_0xce43('0x5a')],'OpenchannelAccountId':_0x3f5c74[_0xce43('0x62')]['id'],'OpenchannelInteractionId':_0x217343['id'],'direction':'in','ContactId':_0x5cfd2f[_0xce43('0x8a')]['id'],'AttachmentId':_0x3f5c74[_0xce43('0x5a')][_0xce43('0x94')]});})['then'](function(_0x305f9e){_0x5cfd2f[_0xce43('0x25')]=_0x305f9e;if(_0x5cfd2f[_0xce43('0x8f')][_0xce43('0x95')]){return db[_0xce43('0x96')][_0xce43('0x59')]({'attributes':['id',_0xce43('0x3b')],'where':{'id':_0x5cfd2f[_0xce43('0x8f')][_0xce43('0x95')]}})[_0xce43('0x1d')](function(_0x1f52b1){if(_0x1f52b1){_0x5cfd2f[_0xce43('0x86')][_0xce43('0x97')]({'id':0x0,'priority':0x0,'app':_0xce43('0x98'),'appdata':_0x1f52b1[_0xce43('0x3b')]+','+(_0x5cfd2f[_0xce43('0x85')][_0xce43('0x99')]||0xa),'interval':_0xce43('0x92')});_0x5cfd2f[_0xce43('0x9a')]=![];}return respondWithRpcPromise('Start','startRouting',_0x5cfd2f);});}return respondWithRpcPromise(_0xce43('0x9b'),_0xce43('0x9c'),_0x5cfd2f);})[_0xce43('0x1d')](function(_0x53d525){respondWithRpcPromise('EventManager',_0xce43('0x9d'),{'event':_0xce43('0x9e'),'message':_0x53d525},client9002);return _0x53d525;})[_0xce43('0x1d')](respondWithResult(_0x2e935a,null))[_0xce43('0x28')](handleError(_0x2e935a,null));};exports[_0xce43('0x9f')]=function(_0x532721,_0x1686f0){var _0x146a2b=_0x532721[_0xce43('0x62')]['id'];var _0x3a3361=_0x532721[_0xce43('0x5a')];var _0x170fdc=0xc8;var _0x589bf3=null;return db[_0xce43('0xa0')][_0xce43('0xa1')]({'isolationLevel':db['sequelize'][_0xce43('0xa2')][_0xce43('0xa3')]['READ_COMMITTED']},function(_0x257502){return db['OpenchannelAccount'][_0xce43('0x66')]({'where':{'id':_0x146a2b},'transaction':_0x257502})['then'](function(_0x55593d){if(_0x55593d){return db[_0xce43('0x82')][_0xce43('0x35')]({'where':{'OpenchannelAccountId':_0x146a2b},'transaction':_0x257502})[_0xce43('0x1d')](function(){var _0x41b57f=_[_0xce43('0x3f')](_0x3a3361,function(_0x385b7c){_0x385b7c[_0xce43('0x67')]=_0x146a2b;return _0x385b7c;});return db[_0xce43('0x82')][_0xce43('0xa4')](_0x41b57f,{'transaction':_0x257502});});}else{_0x170fdc=0x194;_0x589bf3=[];}});})[_0xce43('0x1d')](function(){if(_0x170fdc!==0x194){return db[_0xce43('0x82')][_0xce43('0xa5')]({'where':{'OpenchannelAccountId':_0x146a2b},'order':_0xce43('0x88')})[_0xce43('0x1d')](function(_0x47f956){_0x589bf3=_0x47f956;});}})['catch'](function(_0x28e22f){_0x170fdc=0x1f4;logger[_0xce43('0x23')](_0x28e22f[_0xce43('0x3a')]);if(_0x28e22f[_0xce43('0x3b')]){delete _0x28e22f[_0xce43('0x3b')];}_0x589bf3=_0x28e22f;})[_0xce43('0xa6')](function(){if(_0x589bf3===null){_0x1686f0['sendStatus'](_0x170fdc);}else{if(_0x170fdc===0x1f4){_0x1686f0[_0xce43('0x2a')](_0x170fdc)['send'](_0x589bf3);}else{_0x1686f0[_0xce43('0x2a')](_0x170fdc)[_0xce43('0x2b')](_0x589bf3);}}});};exports[_0xce43('0xa7')]=function(_0xcf36f6,_0x9a9567,_0x1137cc){var _0x251218={};var _0x56cfda={};var _0x557e59;var _0x39c35d;return db['OpenchannelAccount'][_0xce43('0x66')]({'where':{'id':_0xcf36f6['params']['id']}})['then'](handleEntityNotFound(_0x9a9567,null))[_0xce43('0x1d')](function(_0x1b5c1d){if(_0x1b5c1d){_0x557e59=_0x1b5c1d;_0x56cfda['model']=_['keys'](db[_0xce43('0x82')][_0xce43('0x56')]);_0x56cfda[_0xce43('0x43')]=_[_0xce43('0x55')](_0xcf36f6['query']);_0x56cfda[_0xce43('0x44')]=_[_0xce43('0x45')](_0x56cfda[_0xce43('0x46')],_0x56cfda[_0xce43('0x43')]);_0x251218[_0xce43('0x47')]=_[_0xce43('0x45')](_0x56cfda[_0xce43('0x46')],qs['fields'](_0xcf36f6['query']['fields']));_0x251218[_0xce43('0x47')]=_0x251218['attributes'][_0xce43('0x49')]?_0x251218[_0xce43('0x47')]:_0x56cfda[_0xce43('0x46')];_0x251218[_0xce43('0x4c')]=qs[_0xce43('0x4d')](_0xcf36f6[_0xce43('0x43')][_0xce43('0x4d')]);_0x251218[_0xce43('0x4e')]=qs[_0xce43('0x44')](_[_0xce43('0x4f')](_0xcf36f6[_0xce43('0x43')],_0x56cfda[_0xce43('0x44')]));if(_0xcf36f6[_0xce43('0x43')]['filter']){_0x251218[_0xce43('0x4e')]=_[_0xce43('0x68')](_0x251218['where'],{'$or':_[_0xce43('0x3f')](_0x251218[_0xce43('0x47')],function(_0x38d585){var _0x1e831d={};_0x1e831d[_0x38d585]={'$like':'%'+_0xcf36f6['query']['filter']+'%'};return _0x1e831d;})});}_0x251218=_[_0xce43('0x68')]({},_0x251218,_0xcf36f6[_0xce43('0x58')]);return _0x557e59[_0xce43('0xa7')](_0x251218);}})[_0xce43('0x1d')](function(_0xfcbda9){if(_0xfcbda9){_0x39c35d=_0xfcbda9['length'];if(!_0xcf36f6[_0xce43('0x43')]['hasOwnProperty'](_0xce43('0x4b'))){_0x251218[_0xce43('0x2f')]=qs['limit'](_0xcf36f6[_0xce43('0x43')][_0xce43('0x2f')]);_0x251218[_0xce43('0x2c')]=qs[_0xce43('0x2c')](_0xcf36f6[_0xce43('0x43')]['offset']);}return _0x557e59[_0xce43('0xa7')](_0x251218);}})[_0xce43('0x1d')](function(_0x38d6b5){if(_0x38d6b5){return _0x38d6b5?{'count':_0x39c35d,'rows':_0x38d6b5}:null;}})[_0xce43('0x1d')](respondWithResult(_0x9a9567,null))[_0xce43('0x28')](handleError(_0x9a9567,null));};exports[_0xce43('0xa8')]=function(_0x2f3648,_0x43f875,_0x406899){var _0x279692={'raw':![],'where':{}};var _0x1af349={};var _0x445109={'count':0x0,'rows':[]};return db[_0xce43('0x40')][_0xce43('0x66')]({'where':{'id':_0x2f3648[_0xce43('0x62')]['id']}})[_0xce43('0x1d')](handleEntityNotFound(_0x43f875,null))[_0xce43('0x1d')](function(_0x4bdc0d){if(_0x4bdc0d){_0x1af349[_0xce43('0x46')]=_[_0xce43('0x55')](db[_0xce43('0x8d')][_0xce43('0x56')]);_0x1af349['query']=_[_0xce43('0x55')](_0x2f3648[_0xce43('0x43')]);_0x1af349['filters']=_['intersection'](_0x1af349[_0xce43('0x46')],_0x1af349['query']);_0x279692[_0xce43('0x47')]=_[_0xce43('0x45')](_0x1af349[_0xce43('0x46')],qs[_0xce43('0x48')](_0x2f3648[_0xce43('0x43')][_0xce43('0x48')]));_0x279692['attributes']=_0x279692[_0xce43('0x47')][_0xce43('0x49')]?_0x279692[_0xce43('0x47')]:_0x1af349[_0xce43('0x46')];if(!_0x2f3648[_0xce43('0x43')][_0xce43('0x4a')]('nolimit')){_0x279692[_0xce43('0x2f')]=qs[_0xce43('0x2f')](_0x2f3648[_0xce43('0x43')][_0xce43('0x2f')]);_0x279692[_0xce43('0x2c')]=qs['offset'](_0x2f3648[_0xce43('0x43')][_0xce43('0x2c')]);}_0x279692['order']=qs[_0xce43('0x4d')](_0x2f3648['query'][_0xce43('0x4d')]);_0x279692[_0xce43('0x4e')]=qs['filters'](_['pick'](_0x2f3648[_0xce43('0x43')],_0x1af349[_0xce43('0x44')]));_0x279692[_0xce43('0x4e')][_0xce43('0x67')]=_0x4bdc0d['id'];if(_0x2f3648[_0xce43('0x43')]['filter']){_0x279692[_0xce43('0x4e')]=_[_0xce43('0x68')](_0x279692[_0xce43('0x4e')],{'$or':_['map'](_0x279692[_0xce43('0x47')],function(_0x3794ba){var _0x25cbdd={};_0x25cbdd[_0x3794ba]={'$like':'%'+_0x2f3648[_0xce43('0x43')]['filter']+'%'};return _0x25cbdd;})});}_0x279692=_[_0xce43('0x68')]({},_0x279692,_0x2f3648[_0xce43('0x58')]);return db[_0xce43('0x8d')]['count']({'where':_0x279692['where']})['then'](function(_0x43b337){_0x445109[_0xce43('0x2e')]=_0x43b337;if(_0x2f3648[_0xce43('0x43')][_0xce43('0x57')]){_0x279692[_0xce43('0x51')]=[{'model':db[_0xce43('0x71')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xce43('0xa9'),'attributes':[_0xce43('0x3b'),_0xce43('0xaa'),_0xce43('0xab')],'required':![]},{'model':db[_0xce43('0xac')],'as':_0xce43('0xad'),'attributes':['id',_0xce43('0x3b'),_0xce43('0xae')],'where':_0x2f3648[_0xce43('0x43')][_0xce43('0xaf')]?{'id':_0x2f3648[_0xce43('0x43')][_0xce43('0xaf')]}:undefined,'required':_0x2f3648['query'][_0xce43('0xaf')]?!![]:![]}];}return db[_0xce43('0x8d')][_0xce43('0x6e')](_0x279692);})[_0xce43('0x1d')](function(_0x49898d){_0x445109[_0xce43('0x52')]=_0x49898d;return _0x445109;});}})[_0xce43('0x1d')](respondWithFilteredResult(_0x43f875,_0x279692))['catch'](handleError(_0x43f875,null));};exports[_0xce43('0xb0')]=function(_0x179b1e,_0x2be5e2,_0xd5a22c){return db[_0xce43('0x40')][_0xce43('0x59')]({'where':{'id':_0x179b1e[_0xce43('0x62')]['id']}})[_0xce43('0x1d')](handleEntityNotFound(_0x2be5e2,null))[_0xce43('0x1d')](function(_0x3f5fb6){if(_0x3f5fb6){return _0x3f5fb6[_0xce43('0xb0')](_0x179b1e['body'][_0xce43('0x6a')],_[_0xce43('0xb1')](_0x179b1e[_0xce43('0x5a')],['ids','id'])||{})['spread'](function(_0x11656e){for(var _0x67718=0x0;_0x67718<_0x179b1e[_0xce43('0x5a')][_0xce43('0x6a')]['length'];_0x67718+=0x1){socket['emit'](_0xce43('0xb2'),{'UserId':Number(_0x179b1e['body']['ids'][_0x67718]),'OpenchannelAccountId':Number(_0x179b1e[_0xce43('0x62')]['id'])});}return _0x11656e;});}})[_0xce43('0x1d')](respondWithResult(_0x2be5e2,null))['catch'](handleError(_0x2be5e2,null));};exports['removeAgents']=function(_0x25dd5c,_0x83b513,_0x3006cc){return db['OpenchannelAccount'][_0xce43('0x59')]({'where':{'id':_0x25dd5c[_0xce43('0x62')]['id']}})[_0xce43('0x1d')](handleEntityNotFound(_0x83b513,null))['then'](function(_0x42025e){if(_0x42025e){return _0x42025e[_0xce43('0xb3')](_0x25dd5c[_0xce43('0x43')][_0xce43('0x6a')])['then'](function(){if(_[_0xce43('0xb4')](_0x25dd5c[_0xce43('0x43')]['ids'])){for(var _0x516ca6=0x0;_0x516ca6<_0x25dd5c[_0xce43('0x43')][_0xce43('0x6a')][_0xce43('0x49')];_0x516ca6+=0x1){socket[_0xce43('0xb5')]('userOpenchannelAccount:remove',{'UserId':Number(_0x25dd5c[_0xce43('0x43')][_0xce43('0x6a')][_0x516ca6]),'OpenchannelAccountId':Number(_0x25dd5c[_0xce43('0x62')]['id'])});}}else{socket[_0xce43('0xb5')](_0xce43('0xb6'),{'UserId':Number(_0x25dd5c[_0xce43('0x43')][_0xce43('0x6a')]),'OpenchannelAccountId':Number(_0x25dd5c[_0xce43('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x83b513,null))['catch'](handleError(_0x83b513,null));};exports[_0xce43('0xb7')]=function(_0x3b0b39,_0x36ecf7,_0x2df3c4){var _0x5c2ba6={};var _0x173260={};var _0xb92d3a;var _0x4c02a9;return db[_0xce43('0x40')][_0xce43('0x66')]({'where':{'id':_0x3b0b39[_0xce43('0x62')]['id']}})['then'](handleEntityNotFound(_0x36ecf7,null))[_0xce43('0x1d')](function(_0x188eac){if(_0x188eac){_0xb92d3a=_0x188eac;_0x173260[_0xce43('0x46')]=_[_0xce43('0x55')](db[_0xce43('0x96')][_0xce43('0x56')]);_0x173260[_0xce43('0x43')]=_['keys'](_0x3b0b39[_0xce43('0x43')]);_0x173260[_0xce43('0x44')]=_[_0xce43('0x45')](_0x173260[_0xce43('0x46')],_0x173260['query']);_0x5c2ba6[_0xce43('0x47')]=_[_0xce43('0x45')](_0x173260[_0xce43('0x46')],qs[_0xce43('0x48')](_0x3b0b39[_0xce43('0x43')]['fields']));_0x5c2ba6[_0xce43('0x47')]=_0x5c2ba6['attributes'][_0xce43('0x49')]?_0x5c2ba6[_0xce43('0x47')]:_0x173260[_0xce43('0x46')];_0x5c2ba6[_0xce43('0x4c')]=qs[_0xce43('0x4d')](_0x3b0b39[_0xce43('0x43')][_0xce43('0x4d')]);_0x5c2ba6[_0xce43('0x4e')]=qs['filters'](_[_0xce43('0x4f')](_0x3b0b39[_0xce43('0x43')],_0x173260[_0xce43('0x44')]));if(_0x3b0b39['query'][_0xce43('0x50')]){_0x5c2ba6[_0xce43('0x4e')]=_[_0xce43('0x68')](_0x5c2ba6['where'],{'$or':_[_0xce43('0x3f')](_0x5c2ba6[_0xce43('0x47')],function(_0x3ba398){var _0x2b6d44={};_0x2b6d44[_0x3ba398]={'$like':'%'+_0x3b0b39[_0xce43('0x43')][_0xce43('0x50')]+'%'};return _0x2b6d44;})});}_0x5c2ba6=_['merge']({},_0x5c2ba6,_0x3b0b39[_0xce43('0x58')]);return _0xb92d3a['getAgents'](_0x5c2ba6);}})[_0xce43('0x1d')](function(_0x8100e5){if(_0x8100e5){_0x4c02a9=_0x8100e5[_0xce43('0x49')];if(!_0x3b0b39[_0xce43('0x43')][_0xce43('0x4a')](_0xce43('0x4b'))){_0x5c2ba6[_0xce43('0x2f')]=qs['limit'](_0x3b0b39[_0xce43('0x43')][_0xce43('0x2f')]);_0x5c2ba6['offset']=qs[_0xce43('0x2c')](_0x3b0b39[_0xce43('0x43')][_0xce43('0x2c')]);}return _0xb92d3a['getAgents'](_0x5c2ba6);}})['then'](function(_0x575ee2){if(_0x575ee2){return _0x575ee2?{'count':_0x4c02a9,'rows':_0x575ee2}:null;}})[_0xce43('0x1d')](respondWithResult(_0x36ecf7,null))['catch'](handleError(_0x36ecf7,null));};exports['send']=function(_0x1f454e,_0x25dd3a,_0x4adbf8){var _0x4954cd,_0x216057,_0x5b25da;if(_[_0xce43('0x76')](_0x1f454e[_0xce43('0x5a')][_0xce43('0x5a')])||_0x1f454e[_0xce43('0x5a')]['body']===''){throw new db[(_0xce43('0x79'))]['ValidationError'](_0xce43('0x7a'));}if(_['isNil'](_0x1f454e[_0xce43('0x5a')]['to'])){}_0x4954cd=_0x1f454e[_0xce43('0x5a')]['to'];return db[_0xce43('0x40')][_0xce43('0x66')]({'where':{'id':_0x1f454e[_0xce43('0x62')]['id']}})['then'](handleEntityNotFound(_0x25dd3a,null))[_0xce43('0x1d')](function(_0xe02884){if(_0xe02884){return db[_0xce43('0x40')][_0xce43('0x59')]({'where':{'id':_0xe02884['id']},'include':[{'model':db[_0xce43('0x7f')],'as':_0xce43('0x84'),'include':[{'model':db[_0xce43('0x71')],'as':'Contacts','where':{[_0xe02884[_0xce43('0x7b')]]:_0x4954cd},'limit':0x1,'order':[['updatedAt',_0xce43('0x81')]]}]}]})[_0xce43('0x1d')](handleEntityNotFound(_0x25dd3a,null))[_0xce43('0x1d')](function(_0x3a042f){if(_0x3a042f&&_0x3a042f['List']){_0x216057=_0x3a042f['get']({'plain':!![]});if(_0x216057[_0xce43('0x84')]&&_0x216057[_0xce43('0x84')]['Contacts'][_0xce43('0x49')]){return _0x216057['List'][_0xce43('0x80')][0x0];}return db[_0xce43('0x71')][_0xce43('0x60')](_[_0xce43('0x15')](_0x1f454e[_0xce43('0x5a')],{'firstName':_0x4954cd,[_0x3a042f[_0xce43('0x7b')]]:_0x4954cd,'phone':_0x4954cd,'ListId':_0x216057[_0xce43('0x75')]}));}})[_0xce43('0x1d')](handleEntityNotFound(_0x25dd3a,null))[_0xce43('0x1d')](function(_0x5aeb0a){if(_0x5aeb0a){_0x5b25da=_0x5aeb0a;return db[_0xce43('0x8d')][_0xce43('0x59')]({'where':{'ContactId':_0x5b25da['id'],'closed':![],'OpenchannelAccountId':_0x216057['id']}})[_0xce43('0x1d')](function(_0x4bbaa1){if(_0x4bbaa1){return[_0x4bbaa1,![]];}return db[_0xce43('0x8d')][_0xce43('0x60')]({'UserId':_0x1f454e[_0xce43('0x5d')]['id'],'ContactId':_0x5b25da['id'],'OpenchannelAccountId':_0x216057['id'],'lastMsgDirection':_0xce43('0xb8'),'firstMsgDirection':_0xce43('0xb8'),'Messages':[_[_0xce43('0x68')](_0x1f454e[_0xce43('0x5a')],{'read':![],'body':_0x1f454e['body'][_0xce43('0x5a')],'OpenchannelAccountId':_0x216057['id'],'UserId':_0x1f454e[_0xce43('0x5d')]['id'],'ContactId':_0x5b25da['id']})]},{'include':[{'model':db[_0xce43('0x93')],'as':_0xce43('0xb9')}]})[_0xce43('0x1d')](function(_0x5a8a85){return[_0x5a8a85,!![]];});});}})[_0xce43('0xba')](function(_0x174409,_0x538532){if(_0x538532){return _0x174409;}return db['OpenchannelMessage'][_0xce43('0x60')](_[_0xce43('0x68')](_0x1f454e[_0xce43('0x5a')],{'read':![],'body':_0x1f454e[_0xce43('0x5a')][_0xce43('0x5a')],'OpenchannelAccountId':_0x216057['id'],'OpenchannelInteractionId':_0x174409['id'],'UserId':_0x1f454e[_0xce43('0x5d')]['id'],'ContactId':_0x5b25da['id']}))[_0xce43('0x1d')](function(_0x4c76ec){_0x174409['dataValues'][_0xce43('0xb9')]=[];_0x174409[_0xce43('0xbb')][_0xce43('0xb9')][_0xce43('0xbc')](_0x4c76ec[_0xce43('0xbb')]);return _0x174409;});});}})['then'](respondWithResult(_0x25dd3a,null))['catch'](handleError(_0x25dd3a,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 47f7294..37788c1 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 _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 +var _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','update','emit'];(function(_0x25efdf,_0x521462){var _0x22c495=function(_0x184469){while(--_0x184469){_0x25efdf['push'](_0x25efdf['shift']());}};_0x22c495(++_0x521462);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var OpenchannelAccount=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){OpenchannelAccountEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);OpenchannelAccountEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];OpenchannelAccount[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 6b3c7a2..d1370fa 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(_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 +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x4b40fe,_0x505e2f){var _0x3d990c=function(_0x18afd8){while(--_0x18afd8){_0x4b40fe['push'](_0x4b40fe['shift']());}};_0x3d990c(++_0x505e2f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 e0758cd..a67dbbd 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 _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 +var _0x91a7=['catch','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x159e56,_0x1adcdf){var _0x2af053=function(_0x31b526){while(--_0x31b526){_0x159e56['push'](_0x159e56['shift']());}};_0x2af053(++_0x1adcdf);}(_0x91a7,0xe7));var _0x791a=function(_0x2cc115,_0x5cdf6c){_0x2cc115=_0x2cc115-0x0;var _0x5d28e3=_0x91a7[_0x2cc115];return _0x5d28e3;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var moment=require(_0x791a('0x1'));var BPromise=require(_0x791a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x791a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x791a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x791a('0x5'));var jayson=require(_0x791a('0x6'));var client=jayson['client'][_0x791a('0x7')]({'port':0x232a});config['redis']=_[_0x791a('0x8')](config[_0x791a('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x791a('0xa'))(new Redis(config[_0x791a('0x9')]));require(_0x791a('0xb'))[_0x791a('0xc')](socket);function respondWithRpcPromise(_0x266e4b,_0x5249d5,_0x21f0e0){return new BPromise(function(_0x38f7c2,_0x57e99c){return client[_0x791a('0xd')](_0x266e4b,_0x21f0e0)[_0x791a('0xe')](function(_0x167bc4){logger[_0x791a('0xf')](_0x791a('0x10'),_0x5249d5,_0x791a('0x11'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5249d5,_0x791a('0x11'),JSON[_0x791a('0x12')](_0x167bc4));if(_0x167bc4['error']){if(_0x167bc4[_0x791a('0x13')][_0x791a('0x14')]===0x1f4){logger['error'](_0x791a('0x10'),_0x5249d5,_0x167bc4[_0x791a('0x13')][_0x791a('0x15')]);return _0x57e99c(_0x167bc4[_0x791a('0x13')]['message']);}logger[_0x791a('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x5249d5,_0x167bc4[_0x791a('0x13')][_0x791a('0x15')]);return _0x38f7c2(_0x167bc4['error'][_0x791a('0x15')]);}else{logger['info'](_0x791a('0x10'),_0x5249d5,'request\x20sent');_0x38f7c2(_0x167bc4['result']['message']);}})[_0x791a('0x16')](function(_0x52fa43){logger['error'](_0x791a('0x10'),_0x5249d5,_0x52fa43);_0x57e99c(_0x52fa43);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index b378645..77df516 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 _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 +var _0x6ce9=['remove','emit','removeListener','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x486f1d,_0x90c2b5){var _0x5a2c2d=function(_0x1a5f79){while(--_0x1a5f79){_0x486f1d['push'](_0x486f1d['shift']());}};_0x5a2c2d(++_0x90c2b5);}(_0x6ce9,0x76));var _0x96ce=function(_0x3f849e,_0x1ab5db){_0x3f849e=_0x3f849e-0x0;var _0x1cf2bd=_0x6ce9[_0x3f849e];return _0x1cf2bd;};'use strict';var OpenchannelAccountEvents=require(_0x96ce('0x0'));var events=[_0x96ce('0x1'),_0x96ce('0x2'),'update'];function createListener(_0x48ccd5,_0x18bbb2){return function(_0x5bf6d5){_0x18bbb2[_0x96ce('0x3')](_0x48ccd5,_0x5bf6d5);};}function removeListener(_0x18a969,_0x2b5c98){return function(){OpenchannelAccountEvents[_0x96ce('0x4')](_0x18a969,_0x2b5c98);};}exports['register']=function(_0xce6b4f){for(var _0x2fe06e=0x0,_0x1a24c7=events['length'];_0x2fe06e<_0x1a24c7;_0x2fe06e++){var _0x1abd8c=events[_0x2fe06e];var _0x16a140=createListener(_0x96ce('0x5')+_0x1abd8c,_0xce6b4f);OpenchannelAccountEvents['on'](_0x1abd8c,_0x16a140);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index b1b2b15..261343f 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 _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 +var _0x6073=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x6073,0xd2));var _0x3607=function(_0x37999b,_0x5b2b56){_0x37999b=_0x37999b-0x0;var _0x2151c6=_0x6073[_0x37999b];return _0x2151c6;};'use strict';var multer=require(_0x3607('0x0'));var util=require(_0x3607('0x1'));var path=require(_0x3607('0x2'));var timeout=require(_0x3607('0x3'));var express=require(_0x3607('0x4'));var router=express[_0x3607('0x5')]();var fs_extra=require(_0x3607('0x6'));var auth=require(_0x3607('0x7'));var interaction=require(_0x3607('0x8'));var config=require(_0x3607('0x9'));var controller=require(_0x3607('0xa'));router[_0x3607('0xb')]('/',auth[_0x3607('0xc')](),controller[_0x3607('0xd')]);router[_0x3607('0xb')](_0x3607('0xe'),auth['isAuthenticated'](),controller[_0x3607('0xf')]);router['post']('/',auth[_0x3607('0xc')](),controller[_0x3607('0x10')]);router[_0x3607('0x11')]('/:id',auth[_0x3607('0xc')](),controller['update']);router[_0x3607('0x12')](_0x3607('0xe'),auth['isAuthenticated'](),controller[_0x3607('0x13')]);module[_0x3607('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 4456afd..2d66f20 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 _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 +var _0x01ae=['INTEGER','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x2fe44c,_0x1800bc){var _0x2005b8=function(_0x40a3d2){while(--_0x40a3d2){_0x2fe44c['push'](_0x2fe44c['shift']());}};_0x2005b8(++_0x1800bc);}(_0x01ae,0x16c));var _0xe01a=function(_0x4fbb86,_0x374ed0){_0x4fbb86=_0x4fbb86-0x0;var _0xb141fe=_0x01ae[_0x4fbb86];return _0xb141fe;};'use strict';var Sequelize=require(_0xe01a('0x0'));module['exports']={'priority':{'type':Sequelize[_0xe01a('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe01a('0x2')]()},'description':{'type':Sequelize[_0xe01a('0x3')]},'interval':{'type':Sequelize[_0xe01a('0x3')],'defaultValue':_0xe01a('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 4aed1d8..56766af 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 _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 +var _0x9e32=['update','destroy','then','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','OpenchannelApplication','includeAll','findAll','rows','catch','show','params','length','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save'];(function(_0x262201,_0x297619){var _0x2a2ee3=function(_0x12d9b7){while(--_0x12d9b7){_0x262201['push'](_0x262201['shift']());}};_0x2a2ee3(++_0x297619);}(_0x9e32,0x111));var _0x29e3=function(_0x273f88,_0x5d4150){_0x273f88=_0x273f88-0x0;var _0x177ca1=_0x9e32[_0x273f88];return _0x177ca1;};'use strict';var emlformat=require(_0x29e3('0x0'));var rimraf=require(_0x29e3('0x1'));var zipdir=require(_0x29e3('0x2'));var jsonpatch=require(_0x29e3('0x3'));var rp=require(_0x29e3('0x4'));var moment=require(_0x29e3('0x5'));var BPromise=require(_0x29e3('0x6'));var Mustache=require(_0x29e3('0x7'));var util=require(_0x29e3('0x8'));var path=require(_0x29e3('0x9'));var sox=require(_0x29e3('0xa'));var csv=require(_0x29e3('0xb'));var ejs=require(_0x29e3('0xc'));var fs=require('fs');var fs_extra=require(_0x29e3('0xd'));var _=require(_0x29e3('0xe'));var squel=require(_0x29e3('0xf'));var crypto=require(_0x29e3('0x10'));var jsforce=require(_0x29e3('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x29e3('0xb'));var querystring=require(_0x29e3('0x12'));var Papa=require(_0x29e3('0x13'));var Redis=require(_0x29e3('0x14'));var authService=require(_0x29e3('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x29e3('0x16'))('api');var utils=require(_0x29e3('0x17'));var config=require(_0x29e3('0x18'));var licenseUtil=require(_0x29e3('0x19'));var db=require(_0x29e3('0x1a'))['db'];function respondWithStatusCode(_0x541eb9,_0x1c2bfd){_0x1c2bfd=_0x1c2bfd||0xcc;return function(_0x3d87ef){if(_0x3d87ef){return _0x541eb9[_0x29e3('0x1b')](_0x1c2bfd);}return _0x541eb9[_0x29e3('0x1c')](_0x1c2bfd)[_0x29e3('0x1d')]();};}function respondWithResult(_0x710fb7,_0xf99c93){_0xf99c93=_0xf99c93||0xc8;return function(_0x199ecf){if(_0x199ecf){return _0x710fb7[_0x29e3('0x1c')](_0xf99c93)['json'](_0x199ecf);}};}function respondWithFilteredResult(_0x18a3bf,_0x3a6e6e){return function(_0x50c988){if(_0x50c988){var _0x1dec6f=typeof _0x3a6e6e[_0x29e3('0x1e')]===_0x29e3('0x1f')&&typeof _0x3a6e6e[_0x29e3('0x20')]===_0x29e3('0x1f');var _0x32579a=_0x50c988[_0x29e3('0x21')];var _0x5109a1=_0x1dec6f?0x0:_0x3a6e6e[_0x29e3('0x1e')];var _0x4765a1=_0x1dec6f?_0x50c988['count']:_0x3a6e6e[_0x29e3('0x1e')]+_0x3a6e6e['limit'];var _0x2527b8;if(_0x4765a1>=_0x32579a){_0x4765a1=_0x32579a;_0x2527b8=0xc8;}else{_0x2527b8=0xce;}_0x18a3bf[_0x29e3('0x1c')](_0x2527b8);return _0x18a3bf['set'](_0x29e3('0x22'),_0x5109a1+'-'+_0x4765a1+'/'+_0x32579a)[_0x29e3('0x23')](_0x50c988);}return null;};}function patchUpdates(_0x57d66c){return function(_0x2383a1){try{jsonpatch[_0x29e3('0x24')](_0x2383a1,_0x57d66c,!![]);}catch(_0x193169){return BPromise[_0x29e3('0x25')](_0x193169);}return _0x2383a1[_0x29e3('0x26')]();};}function saveUpdates(_0x53a165,_0x370b95){return function(_0x4c5576){if(_0x4c5576){return _0x4c5576[_0x29e3('0x27')](_0x53a165)['then'](function(_0x5292da){return _0x5292da;});}return null;};}function removeEntity(_0x4d9797,_0xb0107a){return function(_0x57b2b8){if(_0x57b2b8){return _0x57b2b8[_0x29e3('0x28')]()[_0x29e3('0x29')](function(){_0x4d9797[_0x29e3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2898a0,_0x3cd06c){return function(_0x41c5c1){if(!_0x41c5c1){_0x2898a0[_0x29e3('0x1b')](0x194);}return _0x41c5c1;};}function handleError(_0x51cb17,_0x37489d){_0x37489d=_0x37489d||0x1f4;return function(_0x1e9672){logger[_0x29e3('0x2a')](_0x1e9672['stack']);if(_0x1e9672[_0x29e3('0x2b')]){delete _0x1e9672[_0x29e3('0x2b')];}_0x51cb17[_0x29e3('0x1c')](_0x37489d)['send'](_0x1e9672);};}exports[_0x29e3('0x2c')]=function(_0x90837c,_0x2bf4ee){var _0xb8b87f={},_0x676e5e={},_0x2aabf2={'count':0x0,'rows':[]};var _0xabc56f=_[_0x29e3('0x2d')](db['OpenchannelApplication'][_0x29e3('0x2e')],function(_0x1f42a6){return{'name':_0x1f42a6[_0x29e3('0x2f')],'type':_0x1f42a6[_0x29e3('0x30')][_0x29e3('0x31')]};});_0x676e5e[_0x29e3('0x32')]=_['map'](_0xabc56f,_0x29e3('0x2b'));_0x676e5e[_0x29e3('0x33')]=_[_0x29e3('0x34')](_0x90837c[_0x29e3('0x33')]);_0x676e5e[_0x29e3('0x35')]=_['intersection'](_0x676e5e[_0x29e3('0x32')],_0x676e5e[_0x29e3('0x33')]);_0xb8b87f['attributes']=_[_0x29e3('0x36')](_0x676e5e['model'],qs['fields'](_0x90837c[_0x29e3('0x33')][_0x29e3('0x37')]));_0xb8b87f[_0x29e3('0x38')]=_0xb8b87f[_0x29e3('0x38')]['length']?_0xb8b87f[_0x29e3('0x38')]:_0x676e5e[_0x29e3('0x32')];if(!_0x90837c[_0x29e3('0x33')]['hasOwnProperty'](_0x29e3('0x39'))){_0xb8b87f['limit']=qs[_0x29e3('0x20')](_0x90837c['query'][_0x29e3('0x20')]);_0xb8b87f[_0x29e3('0x1e')]=qs[_0x29e3('0x1e')](_0x90837c[_0x29e3('0x33')][_0x29e3('0x1e')]);}_0xb8b87f[_0x29e3('0x3a')]=qs[_0x29e3('0x3b')](_0x90837c[_0x29e3('0x33')][_0x29e3('0x3b')]);_0xb8b87f['where']=qs[_0x29e3('0x35')](_[_0x29e3('0x3c')](_0x90837c[_0x29e3('0x33')],_0x676e5e['filters']),_0xabc56f);if(_0x90837c[_0x29e3('0x33')][_0x29e3('0x3d')]){_0xb8b87f[_0x29e3('0x3e')]=_[_0x29e3('0x3f')](_0xb8b87f[_0x29e3('0x3e')],{'$or':_[_0x29e3('0x2d')](_0xabc56f,function(_0xcb419){if(_0xcb419[_0x29e3('0x30')]!==_0x29e3('0x40')){var _0x1432b9={};_0x1432b9[_0xcb419['name']]={'$like':'%'+_0x90837c[_0x29e3('0x33')][_0x29e3('0x3d')]+'%'};return _0x1432b9;}})});}_0xb8b87f=_[_0x29e3('0x3f')]({},_0xb8b87f,_0x90837c['options']);var _0x4e07ac={'where':_0xb8b87f[_0x29e3('0x3e')]};return db[_0x29e3('0x41')][_0x29e3('0x21')](_0x4e07ac)[_0x29e3('0x29')](function(_0x24871e){_0x2aabf2['count']=_0x24871e;if(_0x90837c[_0x29e3('0x33')][_0x29e3('0x42')]){_0xb8b87f['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0x29e3('0x43')](_0xb8b87f);})[_0x29e3('0x29')](function(_0x27a8fd){_0x2aabf2[_0x29e3('0x44')]=_0x27a8fd;return _0x2aabf2;})[_0x29e3('0x29')](respondWithFilteredResult(_0x2bf4ee,_0xb8b87f))[_0x29e3('0x45')](handleError(_0x2bf4ee,null));};exports[_0x29e3('0x46')]=function(_0x376c34,_0x4ad4db){var _0x2ad88b={'raw':!![],'where':{'id':_0x376c34[_0x29e3('0x47')]['id']}},_0x56a1d6={};_0x56a1d6[_0x29e3('0x32')]=_[_0x29e3('0x34')](db['OpenchannelApplication'][_0x29e3('0x2e')]);_0x56a1d6[_0x29e3('0x33')]=_[_0x29e3('0x34')](_0x376c34[_0x29e3('0x33')]);_0x56a1d6[_0x29e3('0x35')]=_[_0x29e3('0x36')](_0x56a1d6[_0x29e3('0x32')],_0x56a1d6[_0x29e3('0x33')]);_0x2ad88b['attributes']=_[_0x29e3('0x36')](_0x56a1d6[_0x29e3('0x32')],qs[_0x29e3('0x37')](_0x376c34[_0x29e3('0x33')][_0x29e3('0x37')]));_0x2ad88b[_0x29e3('0x38')]=_0x2ad88b['attributes'][_0x29e3('0x48')]?_0x2ad88b[_0x29e3('0x38')]:_0x56a1d6[_0x29e3('0x32')];if(_0x376c34['query'][_0x29e3('0x42')]){_0x2ad88b[_0x29e3('0x49')]=[{'all':!![]}];}_0x2ad88b=_[_0x29e3('0x3f')]({},_0x2ad88b,_0x376c34[_0x29e3('0x4a')]);return db['OpenchannelApplication'][_0x29e3('0x4b')](_0x2ad88b)[_0x29e3('0x29')](handleEntityNotFound(_0x4ad4db,null))[_0x29e3('0x29')](respondWithResult(_0x4ad4db,null))[_0x29e3('0x45')](handleError(_0x4ad4db,null));};exports[_0x29e3('0x4c')]=function(_0x3dfb61,_0x1b1270){return db[_0x29e3('0x41')][_0x29e3('0x4c')](_0x3dfb61[_0x29e3('0x4d')],{})[_0x29e3('0x29')](respondWithResult(_0x1b1270,0xc9))['catch'](handleError(_0x1b1270,null));};exports['update']=function(_0x220f83,_0xfdde29){if(_0x220f83[_0x29e3('0x4d')]['id']){delete _0x220f83[_0x29e3('0x4d')]['id'];}return db['OpenchannelApplication'][_0x29e3('0x4b')]({'where':{'id':_0x220f83[_0x29e3('0x47')]['id']}})[_0x29e3('0x29')](handleEntityNotFound(_0xfdde29,null))[_0x29e3('0x29')](saveUpdates(_0x220f83[_0x29e3('0x4d')],null))[_0x29e3('0x29')](respondWithResult(_0xfdde29,null))['catch'](handleError(_0xfdde29,null));};exports[_0x29e3('0x28')]=function(_0xa20ecd,_0x169c93){return db[_0x29e3('0x41')][_0x29e3('0x4b')]({'where':{'id':_0xa20ecd['params']['id']}})[_0x29e3('0x29')](handleEntityNotFound(_0x169c93,null))[_0x29e3('0x29')](removeEntity(_0x169c93,null))[_0x29e3('0x45')](handleError(_0x169c93,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index b4b6350..679494c 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 _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 +var _0x5e37=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','lodash'];(function(_0x3f3d69,_0x1d654a){var _0x945cfc=function(_0x1caefc){while(--_0x1caefc){_0x3f3d69['push'](_0x3f3d69['shift']());}};_0x945cfc(++_0x1d654a);}(_0x5e37,0x103));var _0x75e3=function(_0x4702ee,_0xaf6a45){_0x4702ee=_0x4702ee-0x0;var _0x62ca7d=_0x5e37[_0x4702ee];return _0x62ca7d;};'use strict';var _=require(_0x75e3('0x0'));var util=require(_0x75e3('0x1'));var logger=require(_0x75e3('0x2'))('api');var moment=require(_0x75e3('0x3'));var BPromise=require(_0x75e3('0x4'));var rp=require(_0x75e3('0x5'));var fs=require('fs');var path=require(_0x75e3('0x6'));var rimraf=require(_0x75e3('0x7'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module[_0x75e3('0x8')]=function(_0x1b1d28,_0xc2ea34){return _0x1b1d28[_0x75e3('0x9')](_0x75e3('0xa'),attributes,{'tableName':_0x75e3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x75e3('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 7efa141..aeec65c 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 _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 +var _0x0637=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','attributes','limit','debug','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x15c8ca,_0x37e1a8){var _0x19cfad=function(_0x4c4335){while(--_0x4c4335){_0x15c8ca['push'](_0x15c8ca['shift']());}};_0x19cfad(++_0x37e1a8);}(_0x0637,0x7a));var _0x7063=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0637[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7063('0x0'));var util=require(_0x7063('0x1'));var moment=require(_0x7063('0x2'));var BPromise=require(_0x7063('0x3'));var rs=require(_0x7063('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7063('0x5'))['db'];var utils=require(_0x7063('0x6'));var logger=require(_0x7063('0x7'))(_0x7063('0x8'));var config=require(_0x7063('0x9'));var jayson=require(_0x7063('0xa'));var client=jayson[_0x7063('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a723,_0x521f11,_0x4d0307){return new BPromise(function(_0x3ee129,_0x1737d3){return client[_0x7063('0xc')](_0x41a723,_0x4d0307)[_0x7063('0xd')](function(_0x1fde67){logger[_0x7063('0xe')](_0x7063('0xf'),_0x521f11,'request\x20sent');logger['debug'](_0x7063('0x10'),_0x521f11,_0x7063('0x11'),JSON['stringify'](_0x1fde67));if(_0x1fde67[_0x7063('0x12')]){if(_0x1fde67['error'][_0x7063('0x13')]===0x1f4){logger[_0x7063('0x12')](_0x7063('0xf'),_0x521f11,_0x1fde67[_0x7063('0x12')][_0x7063('0x14')]);return _0x1737d3(_0x1fde67[_0x7063('0x12')][_0x7063('0x14')]);}logger[_0x7063('0x12')](_0x7063('0xf'),_0x521f11,_0x1fde67[_0x7063('0x12')][_0x7063('0x14')]);return _0x3ee129(_0x1fde67[_0x7063('0x12')][_0x7063('0x14')]);}else{logger[_0x7063('0xe')](_0x7063('0xf'),_0x521f11,'request\x20sent');_0x3ee129(_0x1fde67[_0x7063('0x15')][_0x7063('0x14')]);}})[_0x7063('0x16')](function(_0x1f6bde){logger[_0x7063('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x521f11,_0x1f6bde);_0x1737d3(_0x1f6bde);});});}exports[_0x7063('0x17')]=function(_0xb5496f){var _0x26f634=this;return new Promise(function(_0x4c6a3d,_0x1da1ee){return db[_0x7063('0x18')][_0x7063('0x19')](_0xb5496f['body'],{'raw':_0xb5496f['options']?_0xb5496f[_0x7063('0x1a')][_0x7063('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb5496f[_0x7063('0x1a')]?_0xb5496f[_0x7063('0x1a')]['where']||null:null,'attributes':_0xb5496f[_0x7063('0x1a')]?_0xb5496f['options'][_0x7063('0x1c')]||null:null,'limit':_0xb5496f['options']?_0xb5496f[_0x7063('0x1a')][_0x7063('0x1d')]||null:null})['then'](function(_0x3d47c1){logger[_0x7063('0xe')](_0x7063('0x17'),_0xb5496f);logger[_0x7063('0x1e')]('UpdateOpenchannelApplication',_0xb5496f,JSON[_0x7063('0x1f')](_0x3d47c1));_0x4c6a3d(_0x3d47c1);})['catch'](function(_0x56ab79){logger['error'](_0x7063('0x17'),_0x56ab79[_0x7063('0x14')],_0xb5496f);_0x1da1ee(_0x26f634[_0x7063('0x12')](0x1f4,_0x56ab79['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 9ee3555..ae6c5c4 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 _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 +var _0x6fde=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','multer','util','connect-timeout','express'];(function(_0x2b903f,_0x2f1dc1){var _0x3bb553=function(_0x1ad559){while(--_0x1ad559){_0x2b903f['push'](_0x2b903f['shift']());}};_0x3bb553(++_0x2f1dc1);}(_0x6fde,0x15c));var _0xe6fd=function(_0x2912ab,_0x2bc59a){_0x2912ab=_0x2912ab-0x0;var _0x11d7b2=_0x6fde[_0x2912ab];return _0x11d7b2;};'use strict';var multer=require(_0xe6fd('0x0'));var util=require(_0xe6fd('0x1'));var path=require('path');var timeout=require(_0xe6fd('0x2'));var express=require(_0xe6fd('0x3'));var router=express['Router']();var fs_extra=require(_0xe6fd('0x4'));var auth=require(_0xe6fd('0x5'));var interaction=require(_0xe6fd('0x6'));var config=require(_0xe6fd('0x7'));var controller=require(_0xe6fd('0x8'));router['get']('/',auth[_0xe6fd('0x9')](),controller['index']);router[_0xe6fd('0xa')](_0xe6fd('0xb'),auth[_0xe6fd('0x9')](),controller[_0xe6fd('0xc')]);router[_0xe6fd('0xa')](_0xe6fd('0xd'),auth[_0xe6fd('0x9')](),controller[_0xe6fd('0xe')]);router[_0xe6fd('0xa')](_0xe6fd('0xf'),auth[_0xe6fd('0x9')](),controller['getMessages']);router['get'](_0xe6fd('0x10'),auth['isAuthenticated'](),controller[_0xe6fd('0x11')]);router[_0xe6fd('0x12')]('/',auth[_0xe6fd('0x9')](),controller['create']);router[_0xe6fd('0x12')]('/:id/messages',auth[_0xe6fd('0x9')](),controller[_0xe6fd('0x13')]);router[_0xe6fd('0x12')](_0xe6fd('0x14'),auth[_0xe6fd('0x9')](),interaction[_0xe6fd('0x15')](_0xe6fd('0x16'),_0xe6fd('0x17')),controller['addTags']);router[_0xe6fd('0x18')](_0xe6fd('0xd'),auth['isAuthenticated'](),interaction[_0xe6fd('0x15')]('openchannel',_0xe6fd('0x19')),controller[_0xe6fd('0x1a')]);router['delete'](_0xe6fd('0xd'),auth[_0xe6fd('0x9')](),interaction['tracked']('openchannel',_0xe6fd('0x1b')),controller[_0xe6fd('0x1c')]);router[_0xe6fd('0x1d')]('/:id/tags',auth['isAuthenticated'](),controller[_0xe6fd('0x1e')]);module[_0xe6fd('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 53c2ff7..d029122 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 _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 +var _0xf021=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x494912,_0x5379ea){var _0x458a93=function(_0x1c6ea9){while(--_0x1c6ea9){_0x494912['push'](_0x494912['shift']());}};_0x458a93(++_0x5379ea);}(_0xf021,0x18f));var _0x1f02=function(_0x359bbe,_0x5b7fcc){_0x359bbe=_0x359bbe-0x0;var _0x1b3353=_0xf021[_0x359bbe];return _0x1b3353;};'use strict';var Sequelize=require(_0x1f02('0x0'));module[_0x1f02('0x1')]={'closed':{'type':Sequelize[_0x1f02('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1f02('0x3')]},'disposition':{'type':Sequelize[_0x1f02('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1f02('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x1f02('0x3')]},'threadId':{'type':Sequelize[_0x1f02('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x1f02('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x1f02('0x5')]('in',_0x1f02('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x1f02('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x1f02('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 58546b0..0dc8449 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 _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 +var _0xe31e=['options','create','body','find','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','filters','hasOwnProperty','order','sort','where','pick','OpenchannelInteractionId','filter','merge','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','color','emit','removeTags','download','unix','toString','join','tmp','root','server','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','Attachment','createdAt','direction','secret','read','Account','Owner','get','mkdirSync','Openchannel','closed','closedAt','Public','Private','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','Contact','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','sendStatus','rimraf','moment','util','path','ejs','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','status','end','json','undefined','limit','count','offset','Content-Range','update','then','destroy','error','name','send','OpenchannelInteraction','rawAttributes','fieldName','type','key','findAll','openchannel','query','catch','show','from','params','keys','intersection','attributes','model','fields'];(function(_0x208291,_0x973ee2){var _0x165f8c=function(_0x2fb2d9){while(--_0x2fb2d9){_0x208291['push'](_0x208291['shift']());}};_0x165f8c(++_0x973ee2);}(_0xe31e,0xc8));var _0xee31=function(_0x61045c,_0xc8a606){_0x61045c=_0x61045c-0x0;var _0x257852=_0xe31e[_0x61045c];return _0x257852;};'use strict';var rimraf=require(_0xee31('0x0'));var zipdir=require('zip-dir');var moment=require(_0xee31('0x1'));var util=require(_0xee31('0x2'));var path=require(_0xee31('0x3'));var ejs=require(_0xee31('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xee31('0x5'));var interaction=require(_0xee31('0x6'));var qs=require('../../components/parsers/qs');var pdf=require(_0xee31('0x7'));var logger=require(_0xee31('0x8'))(_0xee31('0x9'));var config=require(_0xee31('0xa'));var db=require(_0xee31('0xb'))['db'];config[_0xee31('0xc')]=_[_0xee31('0xd')](config['redis'],{'host':_0xee31('0xe'),'port':0x18eb});var socket=require(_0xee31('0xf'))(new Redis(config[_0xee31('0xc')]));require(_0xee31('0x10'))['register'](socket);function respondWithStatusCode(_0x2b5eca,_0x4465d8){_0x4465d8=_0x4465d8||0xcc;return function(_0x1eb45a){if(_0x1eb45a){return _0x2b5eca['sendStatus'](_0x4465d8);}return _0x2b5eca[_0xee31('0x11')](_0x4465d8)[_0xee31('0x12')]();};}function respondWithResult(_0x3cc8f3,_0x12e1f){_0x12e1f=_0x12e1f||0xc8;return function(_0x5d6c95){if(_0x5d6c95){return _0x3cc8f3[_0xee31('0x11')](_0x12e1f)[_0xee31('0x13')](_0x5d6c95);}};}function respondWithFilteredResult(_0x3fa478,_0x1c95eb){return function(_0x279d5c){if(_0x279d5c){var _0x41299f=typeof _0x1c95eb['offset']===_0xee31('0x14')&&typeof _0x1c95eb[_0xee31('0x15')]===_0xee31('0x14');var _0x389dfa=_0x279d5c[_0xee31('0x16')];var _0x50210e=_0x41299f?0x0:_0x1c95eb['offset'];var _0x127621=_0x41299f?_0x279d5c[_0xee31('0x16')]:_0x1c95eb[_0xee31('0x17')]+_0x1c95eb['limit'];var _0x5d0d3c;if(_0x127621>=_0x389dfa){_0x127621=_0x389dfa;_0x5d0d3c=0xc8;}else{_0x5d0d3c=0xce;}_0x3fa478['status'](_0x5d0d3c);return _0x3fa478['set'](_0xee31('0x18'),_0x50210e+'-'+_0x127621+'/'+_0x389dfa)[_0xee31('0x13')](_0x279d5c);}return null;};}function saveUpdates(_0x343b31){return function(_0x280bc8){if(_0x280bc8){return _0x280bc8[_0xee31('0x19')](_0x343b31)[_0xee31('0x1a')](function(_0x149276){return _0x149276;});}return null;};}function removeEntity(_0x1727f0){return function(_0x3e2a13){if(_0x3e2a13){return _0x3e2a13[_0xee31('0x1b')]()['then'](function(){_0x1727f0[_0xee31('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1be0e5){return function(_0x5f37d0){if(!_0x5f37d0){_0x1be0e5['sendStatus'](0x194);}return _0x5f37d0;};}function handleError(_0x8c8708,_0x426c4d){_0x426c4d=_0x426c4d||0x1f4;return function(_0x4937eb){logger[_0xee31('0x1c')](_0x4937eb['stack']);if(_0x4937eb['name']){delete _0x4937eb[_0xee31('0x1d')];}_0x8c8708[_0xee31('0x11')](_0x426c4d)[_0xee31('0x1e')](_0x4937eb);};}exports['index']=function(_0x4ee22f,_0x22c264){var _0x57aa2e={};var _0xeca358=_['map'](db[_0xee31('0x1f')][_0xee31('0x20')],function(_0x427df3){return{'name':_0x427df3[_0xee31('0x21')],'type':_0x427df3[_0xee31('0x22')][_0xee31('0x23')]};});_0x57aa2e=qs['getOptions'](_0xeca358,_0x4ee22f);return interaction[_0xee31('0x24')](_0xee31('0x25'),_0x4ee22f[_0xee31('0x26')],_0x4ee22f['user'],_0x57aa2e,_0xeca358)[_0xee31('0x1a')](respondWithFilteredResult(_0x22c264,_0x57aa2e))[_0xee31('0x27')](handleError(_0x22c264,null));};exports[_0xee31('0x28')]=function(_0x2287b1,_0x3d3df6){var _0x2bfaec={};if(_0x2287b1[_0xee31('0x26')][_0xee31('0x22')]&&_0x2287b1[_0xee31('0x26')][_0xee31('0x22')]==='from'){_0x2bfaec[_0xee31('0x29')]=_0x2287b1[_0xee31('0x2a')]['id'];}else{_0x2bfaec['id']=_0x2287b1[_0xee31('0x2a')]['id'];}var _0x16c6d1={'raw':![],'where':_0x2bfaec},_0x574be7={};_0x574be7['model']=_[_0xee31('0x2b')](db['OpenchannelInteraction'][_0xee31('0x20')]);_0x574be7[_0xee31('0x26')]=_[_0xee31('0x2b')](_0x2287b1[_0xee31('0x26')]);_0x574be7['filters']=_[_0xee31('0x2c')](_0x574be7['model'],_0x574be7[_0xee31('0x26')]);_0x16c6d1[_0xee31('0x2d')]=_['intersection'](_0x574be7[_0xee31('0x2e')],qs[_0xee31('0x2f')](_0x2287b1[_0xee31('0x26')][_0xee31('0x2f')]));_0x16c6d1[_0xee31('0x2d')]=_0x16c6d1[_0xee31('0x2d')]['length']?_0x16c6d1[_0xee31('0x2d')]:_0x574be7[_0xee31('0x2e')];if(_0x2287b1[_0xee31('0x26')]['includeAll']){_0x16c6d1['include']=[{'all':!![]}];}_0x16c6d1=_['merge']({},_0x16c6d1,_0x2287b1[_0xee31('0x30')]);return db[_0xee31('0x1f')]['find'](_0x16c6d1)[_0xee31('0x1a')](handleEntityNotFound(_0x3d3df6,null))[_0xee31('0x1a')](respondWithResult(_0x3d3df6,null))['catch'](handleError(_0x3d3df6,null));};exports[_0xee31('0x31')]=function(_0x349e26,_0x302b62){return db['OpenchannelInteraction'][_0xee31('0x31')](_0x349e26[_0xee31('0x32')],{})[_0xee31('0x1a')](respondWithResult(_0x302b62,0xc9))[_0xee31('0x27')](handleError(_0x302b62,null));};exports[_0xee31('0x19')]=function(_0x155ddc,_0x2f22fa){if(_0x155ddc[_0xee31('0x32')]['id']){delete _0x155ddc['body']['id'];}return db['OpenchannelInteraction'][_0xee31('0x33')]({'where':{'id':_0x155ddc[_0xee31('0x2a')]['id']}})[_0xee31('0x1a')](handleEntityNotFound(_0x2f22fa,null))[_0xee31('0x1a')](saveUpdates(_0x155ddc[_0xee31('0x32')],null))['then'](respondWithResult(_0x2f22fa,null))[_0xee31('0x27')](handleError(_0x2f22fa,null));};exports[_0xee31('0x1b')]=function(_0x13955e,_0x4528ae){return db[_0xee31('0x1f')][_0xee31('0x33')]({'where':{'id':_0x13955e[_0xee31('0x2a')]['id']}})[_0xee31('0x1a')](handleEntityNotFound(_0x4528ae,null))['then'](removeEntity(_0x4528ae,null))[_0xee31('0x27')](handleError(_0x4528ae,null));};exports[_0xee31('0x34')]=function(_0x1560b1,_0x103fc4){return db[_0xee31('0x1f')][_0xee31('0x34')]()[_0xee31('0x1a')](respondWithResult(_0x103fc4,null))[_0xee31('0x27')](handleError(_0x103fc4,null));};exports[_0xee31('0x35')]=function(_0x5d6821,_0x41a62d){return db[_0xee31('0x36')][_0xee31('0x33')]({'where':{'id':_0x5d6821[_0xee31('0x2a')]['id']}})[_0xee31('0x1a')](handleEntityNotFound(_0x41a62d,null))[_0xee31('0x1a')](function(_0x3fa78d){if(_0x3fa78d){return _0x3fa78d['addMessage'](_0x5d6821[_0xee31('0x32')][_0xee31('0x37')],_[_0xee31('0x38')](_0x5d6821[_0xee31('0x32')],[_0xee31('0x37'),'id'])||{});}})[_0xee31('0x1a')](respondWithResult(_0x41a62d,null))['catch'](handleError(_0x41a62d,null));};exports[_0xee31('0x39')]=function(_0x11b2c3,_0x311bd){var _0x3b447d={'raw':![],'where':{}};var _0x504551={};var _0x343d25={'count':0x0,'rows':[]};return db[_0xee31('0x1f')][_0xee31('0x3a')]({'where':{'id':_0x11b2c3[_0xee31('0x2a')]['id']}})[_0xee31('0x1a')](handleEntityNotFound(_0x311bd,null))[_0xee31('0x1a')](function(_0x1c5f0b){if(_0x1c5f0b){_0x504551[_0xee31('0x2e')]=_[_0xee31('0x2b')](db[_0xee31('0x36')][_0xee31('0x20')]);_0x504551[_0xee31('0x26')]=_[_0xee31('0x2b')](_0x11b2c3[_0xee31('0x26')]);_0x504551[_0xee31('0x3b')]=_[_0xee31('0x2c')](_0x504551[_0xee31('0x2e')],_0x504551[_0xee31('0x26')]);_0x3b447d[_0xee31('0x2d')]=_['intersection'](_0x504551[_0xee31('0x2e')],qs[_0xee31('0x2f')](_0x11b2c3[_0xee31('0x26')]['fields']));_0x3b447d[_0xee31('0x2d')]=_0x3b447d[_0xee31('0x2d')]['length']?_0x3b447d[_0xee31('0x2d')]:_0x504551['model'];if(!_0x11b2c3[_0xee31('0x26')][_0xee31('0x3c')]('nolimit')){_0x3b447d[_0xee31('0x15')]=qs[_0xee31('0x15')](_0x11b2c3[_0xee31('0x26')][_0xee31('0x15')]);_0x3b447d[_0xee31('0x17')]=qs['offset'](_0x11b2c3[_0xee31('0x26')][_0xee31('0x17')]);}_0x3b447d[_0xee31('0x3d')]=qs['sort'](_0x11b2c3['query'][_0xee31('0x3e')]);_0x3b447d[_0xee31('0x3f')]=qs[_0xee31('0x3b')](_[_0xee31('0x40')](_0x11b2c3['query'],_0x504551[_0xee31('0x3b')]));_0x3b447d['where'][_0xee31('0x41')]=_0x1c5f0b['id'];if(_0x11b2c3[_0xee31('0x26')][_0xee31('0x42')]){_0x3b447d[_0xee31('0x3f')]=_[_0xee31('0x43')](_0x3b447d['where'],{'$or':_[_0xee31('0x44')](_0x3b447d['attributes'],function(_0x5a11a7){var _0x11f0c9={};_0x11f0c9[_0x5a11a7]={'$like':'%'+_0x11b2c3[_0xee31('0x26')][_0xee31('0x42')]+'%'};return _0x11f0c9;})});}if(_0x11b2c3[_0xee31('0x26')][_0xee31('0x45')]){var _0x466e1b=_0x11b2c3[_0xee31('0x26')][_0xee31('0x45')][_0xee31('0x46')](',');var _0x2fa9b5={};_0x2fa9b5[_0x466e1b[0x0]]={'$gte':moment(_0x466e1b[0x1])[_0xee31('0x47')](_0xee31('0x48'))};_0x3b447d[_0xee31('0x3f')]=_[_0xee31('0x43')](_0x3b447d[_0xee31('0x3f')],_0x2fa9b5);}_0x3b447d=_[_0xee31('0x43')]({},_0x3b447d,_0x11b2c3['options']);return db[_0xee31('0x36')]['count']({'where':_0x3b447d['where']})[_0xee31('0x1a')](function(_0x5c83d0){_0x343d25[_0xee31('0x16')]=_0x5c83d0;if(_0x11b2c3[_0xee31('0x26')][_0xee31('0x49')]){_0x3b447d['include']=[{'all':!![]}];}return db[_0xee31('0x36')][_0xee31('0x24')](_0x3b447d);})[_0xee31('0x1a')](function(_0x3289be){_0x343d25[_0xee31('0x4a')]=_0x3289be;return _0x343d25;});}})[_0xee31('0x1a')](respondWithFilteredResult(_0x311bd,_0x3b447d))[_0xee31('0x27')](handleError(_0x311bd,null));};exports['addTags']=function(_0x33158f,_0x1fa41a){return db['OpenchannelInteraction']['find']({'where':{'id':_0x33158f['params']['id']}})[_0xee31('0x1a')](handleEntityNotFound(_0x1fa41a,null))['then'](function(_0xe0edd8){if(_0xe0edd8){return _0xe0edd8['setTags'](_0x33158f[_0xee31('0x32')]['ids'],_[_0xee31('0x38')](_0x33158f['body'],[_0xee31('0x37'),'id'])||{})['spread'](function(){return db['Tag'][_0xee31('0x24')]({'attributes':['id',_0xee31('0x1d'),_0xee31('0x4b')],'where':{'id':_0x33158f['body']['ids']}});})[_0xee31('0x1a')](function(_0x4eef7a){socket[_0xee31('0x4c')]('openchannelInteractionTags:save',{'id':Number(_0x33158f[_0xee31('0x2a')]['id']),'tags':_0x4eef7a||[]});return{'id':Number(_0x33158f['params']['id']),'tags':_0x4eef7a||[]};});}})[_0xee31('0x1a')](respondWithResult(_0x1fa41a,null))[_0xee31('0x27')](handleError(_0x1fa41a,null));};exports[_0xee31('0x4d')]=function(_0x233264,_0x2bb4ce){return db[_0xee31('0x1f')][_0xee31('0x33')]({'where':{'id':_0x233264[_0xee31('0x2a')]['id']}})[_0xee31('0x1a')](handleEntityNotFound(_0x2bb4ce,null))['then'](function(_0x1cf69b){if(_0x1cf69b){return _0x1cf69b[_0xee31('0x4d')](_0x233264['query'][_0xee31('0x37')]);}})[_0xee31('0x1a')](respondWithStatusCode(_0x2bb4ce,null))['catch'](handleError(_0x2bb4ce,null));};exports[_0xee31('0x4e')]=function(_0x4acfed,_0x53b5d1){var _0xe1c6b2=moment()[_0xee31('0x4f')]()[_0xee31('0x50')]();var _0x2ab95b=path[_0xee31('0x51')](config['root'],'server','files',_0xee31('0x52'));var _0x4bdc5e=path[_0xee31('0x51')](config[_0xee31('0x53')],_0xee31('0x54'),'files',_0xee31('0x55'));var _0x6ed35b=path[_0xee31('0x51')](_0x2ab95b,_0xe1c6b2);var _0x480899=util['format'](_0xee31('0x56'),_0x4acfed['params']['id'],_0xe1c6b2);var _0x20ab05=path['join'](_0x2ab95b,_0x480899);var _0x5621a6=[];_0x5621a6[_0xee31('0x57')]({'model':db[_0xee31('0x58')],'as':'User','attributes':['id',_0xee31('0x59')],'raw':!![]});_0x5621a6[_0xee31('0x57')]({'model':db[_0xee31('0x5a')],'as':'Contact','attributes':['id',_0xee31('0x5b'),_0xee31('0x5c')],'raw':!![]});if(_0x4acfed[_0xee31('0x26')][_0xee31('0x55')]){_0x5621a6[_0xee31('0x57')]({'model':db['Attachment'],'as':_0xee31('0x5d'),'raw':!![]});}var _0x42e106=[{'model':db[_0xee31('0x36')],'as':'Messages','attributes':['id',_0xee31('0x32'),_0xee31('0x5e'),_0xee31('0x5f'),_0xee31('0x60'),_0xee31('0x61')],'include':_0x5621a6}];_0x42e106['push']({'model':db['OpenchannelAccount'],'as':_0xee31('0x62'),'attributes':['id',_0xee31('0x1d')]});_0x42e106[_0xee31('0x57')]({'model':db[_0xee31('0x58')],'as':_0xee31('0x63'),'attributes':['id',_0xee31('0x59')]});return db[_0xee31('0x1f')][_0xee31('0x33')]({'where':{'id':_0x4acfed[_0xee31('0x2a')]['id']},'include':_0x42e106})[_0xee31('0x1a')](handleEntityNotFound(_0x53b5d1,null))[_0xee31('0x1a')](function(_0x379828){if(_0x379828){var _0x3f3ceb=_0x379828[_0xee31('0x64')]({'plain':!![]});fs[_0xee31('0x65')](_0x6ed35b);var _0x16b6b9={'channel':_0xee31('0x66'),'account':_0x3f3ceb[_0xee31('0x62')][_0xee31('0x1d')],'agent':_0x3f3ceb[_0xee31('0x63')]?_0x3f3ceb[_0xee31('0x63')][_0xee31('0x59')]:'N.A.','createdAt':moment(_0x3f3ceb[_0xee31('0x5e')])[_0xee31('0x47')](_0xee31('0x48'))[_0xee31('0x50')](),'closedAt':_0x3f3ceb[_0xee31('0x67')]?moment(_0x3f3ceb[_0xee31('0x68')])['format'](_0xee31('0x48'))[_0xee31('0x50')]():'','disposition':_0x3f3ceb['disposition'],'visibility':_0x3f3ceb['threadId']?_0xee31('0x69'):_0xee31('0x6a'),'messages':_(_0x3f3ceb[_0xee31('0x6b')])[_0xee31('0x42')]({'secret':![]})[_0xee31('0x44')](function(_0x4197f8){if(_0x4197f8[_0xee31('0x5d')]){var _0x14ff70=path[_0xee31('0x51')](_0x4bdc5e,_0x4197f8[_0xee31('0x5d')][_0xee31('0x6c')]);if(fs[_0xee31('0x6d')](_0x14ff70)){fs[_0xee31('0x6e')](_0x14ff70)[_0xee31('0x6f')](fs[_0xee31('0x70')](path[_0xee31('0x51')](_0x6ed35b,_0x4197f8[_0xee31('0x5d')][_0xee31('0x6c')])));}}return{'date':moment(_0x4197f8['createdAt'])[_0xee31('0x47')](_0xee31('0x48'))[_0xee31('0x50')](),'sender':_0x4197f8['direction']===_0xee31('0x71')?_0x4197f8['User']?_0x4197f8['User'][_0xee31('0x59')]:_0xee31('0x72'):_0x4197f8[_0xee31('0x73')][_0xee31('0x5b')]+(_0x4197f8[_0xee31('0x73')][_0xee31('0x5c')]?'\x20'+_0x4197f8['Contact'][_0xee31('0x5c')]:''),'body':_0x4197f8['Attachment']?_0x4197f8[_0xee31('0x5d')][_0xee31('0x6c')]:_0x4197f8['body'],'direction':_0x4197f8[_0xee31('0x5f')]==='out'?'A':'C','secret':_0x4197f8[_0xee31('0x60')],'read':_0x4197f8[_0xee31('0x61')],'attachment':_0x4197f8[_0xee31('0x5d')]};})['value']()};return ejs[_0xee31('0x74')](path[_0xee31('0x51')](config[_0xee31('0x53')],_0xee31('0x54'),_0xee31('0x75'),_0xee31('0x76')),{'interaction':_0x16b6b9})[_0xee31('0x1a')](function(_0x1bdc00){var _0x30ef08=path['join'](_0x6ed35b,_0xee31('0x77')+_0x3f3ceb['id']+'-'+_0xe1c6b2+_0xee31('0x78'));var _0x26b8de={'path':_0x30ef08,'channel':_0xee31('0x66'),'interactionId':_0x3f3ceb['id']};return pdf[_0xee31('0x79')](_0x1bdc00,_0x26b8de);})[_0xee31('0x1a')](function(){return new Promise(function(_0x262ed6,_0xb87eae){zipdir(_0x6ed35b,{'saveTo':_0x20ab05},function(_0x11ba06,_0x2f00d5){if(_0x11ba06)return _0xb87eae(_0x11ba06);return _0x262ed6(_0x2f00d5);});})['then'](function(){return new Promise(function(_0x35f643,_0x5c494b){rimraf(_0x6ed35b,function(_0x13114e){if(_0x13114e)_0x5c494b(_0x13114e);return _0x35f643();});});})[_0xee31('0x1a')](function(){return _0x53b5d1[_0xee31('0x4e')](_0x20ab05,_0x480899,function(_0x5f325c){if(_0x5f325c){logger[_0xee31('0x1c')](_0xee31('0x7a'),_0x5f325c);}else{fs['unlinkSync'](_0x20ab05);}});});});}else{return _0x53b5d1[_0xee31('0x7b')](0xc8);}})[_0xee31('0x27')](handleError(_0x53b5d1,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 359e665..75cfee8 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 _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 +var _0xe6a4=['findAll','then','setDataValue','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','remove','getUsers'];(function(_0x3b38eb,_0x15dc43){var _0x46a0e7=function(_0x53a884){while(--_0x53a884){_0x3b38eb['push'](_0x3b38eb['shift']());}};_0x46a0e7(++_0x15dc43);}(_0xe6a4,0x19d));var _0x4e6a=function(_0x52fc98,_0x234046){_0x52fc98=_0x52fc98-0x0;var _0x5ef66b=_0xe6a4[_0x52fc98];return _0x5ef66b;};'use strict';var EventEmitter=require(_0x4e6a('0x0'));var OpenchannelInteraction=require(_0x4e6a('0x1'))['db'][_0x4e6a('0x2')];var OpenchannelMessage=require(_0x4e6a('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x4e6a('0x3')](0x0);var events={'afterCreate':_0x4e6a('0x4'),'afterUpdate':'update','afterDestroy':_0x4e6a('0x5')};function emitEvent(_0x205fe3){return function(_0x226c12,_0x289d68,_0xc6583){_0x226c12[_0x4e6a('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3fa3b1){_0x226c12['setDataValue']('Users',_0x3fa3b1['map'](function(_0x51eb61){return{'id':_0x51eb61['id']};}));return OpenchannelMessage[_0x4e6a('0x7')]({'where':{'OpenchannelInteractionId':_0x226c12['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4e6a('0x8')](function(_0x14612a){_0x226c12[_0x4e6a('0x9')]('unreadMessages',_0x14612a[_0x4e6a('0xa')]);OpenchannelInteractionEvents[_0x4e6a('0xb')](_0x205fe3+':'+_0x226c12['id'],_0x226c12);OpenchannelInteractionEvents[_0x4e6a('0xb')](_0x205fe3,_0x226c12);_0xc6583(null);})[_0x4e6a('0xc')](_0xc6583(null));};}for(var e in events){if(events[_0x4e6a('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x4e6a('0xe')](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 b3f7313..dd8602d 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 _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 +var _0x5836=['../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x335e20,_0x3b998c){var _0x410b0f=function(_0x5c4075){while(--_0x5c4075){_0x335e20['push'](_0x335e20['shift']());}};_0x410b0f(++_0x3b998c);}(_0x5836,0x12c));var _0x6583=function(_0x54a892,_0x1a4eeb){_0x54a892=_0x54a892-0x0;var _0x1f24f1=_0x5836[_0x54a892];return _0x1f24f1;};'use strict';var _=require(_0x6583('0x0'));var util=require('util');var logger=require(_0x6583('0x1'))(_0x6583('0x2'));var moment=require('moment');var BPromise=require(_0x6583('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6583('0x4'));var rimraf=require(_0x6583('0x5'));var config=require(_0x6583('0x6'));var attributes=require(_0x6583('0x7'));module[_0x6583('0x8')]=function(_0x4cd71c,_0x17d685){return _0x4cd71c[_0x6583('0x9')](_0x6583('0xa'),attributes,{'tableName':_0x6583('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6583('0xc'),'collate':_0x6583('0xd'),'hooks':{'beforeUpdate':function(_0x8d2159,_0x2cbce2,_0xe48331){if(_0x8d2159[_0x6583('0xe')]('closed')){_0x8d2159[_0x6583('0xf')]=moment()[_0x6583('0x10')](_0x6583('0x11'));}_0xe48331(null,_0x8d2159);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 4037268..315e055 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 _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 +var _0x4247=['error','code','message','result','catch','OpenchannelInteraction','body','options','raw','where','attributes','then','UpdateOpenchannelInteraction','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x140add,_0x264320){var _0x46bef7=function(_0x149f93){while(--_0x149f93){_0x140add['push'](_0x140add['shift']());}};_0x46bef7(++_0x264320);}(_0x4247,0xaa));var _0x7424=function(_0x6cb702,_0x114093){_0x6cb702=_0x6cb702-0x0;var _0x65c56e=_0x4247[_0x6cb702];return _0x65c56e;};'use strict';var _=require('lodash');var util=require(_0x7424('0x0'));var moment=require(_0x7424('0x1'));var BPromise=require(_0x7424('0x2'));var rs=require(_0x7424('0x3'));var fs=require('fs');var Redis=require(_0x7424('0x4'));var db=require(_0x7424('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7424('0x6'))('rpc');var config=require(_0x7424('0x7'));var jayson=require(_0x7424('0x8'));var client=jayson[_0x7424('0x9')]['http']({'port':0x232a});config[_0x7424('0xa')]=_[_0x7424('0xb')](config[_0x7424('0xa')],{'host':_0x7424('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7424('0xa')]));require('./openchannelInteraction.socket')[_0x7424('0xd')](socket);function respondWithRpcPromise(_0x549acb,_0x15cdbc,_0x1cdb25){return new BPromise(function(_0x2bc004,_0x35e6c1){return client[_0x7424('0xe')](_0x549acb,_0x1cdb25)['then'](function(_0xf63d16){logger[_0x7424('0xf')](_0x7424('0x10'),_0x15cdbc,'request\x20sent');logger[_0x7424('0x11')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x15cdbc,_0x7424('0x12'),JSON[_0x7424('0x13')](_0xf63d16));if(_0xf63d16[_0x7424('0x14')]){if(_0xf63d16[_0x7424('0x14')][_0x7424('0x15')]===0x1f4){logger[_0x7424('0x14')](_0x7424('0x10'),_0x15cdbc,_0xf63d16[_0x7424('0x14')][_0x7424('0x16')]);return _0x35e6c1(_0xf63d16['error'][_0x7424('0x16')]);}logger['error'](_0x7424('0x10'),_0x15cdbc,_0xf63d16[_0x7424('0x14')][_0x7424('0x16')]);return _0x2bc004(_0xf63d16['error'][_0x7424('0x16')]);}else{logger[_0x7424('0xf')](_0x7424('0x10'),_0x15cdbc,_0x7424('0x12'));_0x2bc004(_0xf63d16[_0x7424('0x17')][_0x7424('0x16')]);}})[_0x7424('0x18')](function(_0x409db0){logger['error'](_0x7424('0x10'),_0x15cdbc,_0x409db0);_0x35e6c1(_0x409db0);});});}exports['UpdateOpenchannelInteraction']=function(_0x1a4383){var _0x3f72bc=this;return new Promise(function(_0x2dbb9e,_0x57a440){return db[_0x7424('0x19')]['update'](_0x1a4383[_0x7424('0x1a')],{'raw':_0x1a4383[_0x7424('0x1b')]?_0x1a4383['options'][_0x7424('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a4383['options']?_0x1a4383['options'][_0x7424('0x1d')]||null:null,'attributes':_0x1a4383[_0x7424('0x1b')]?_0x1a4383[_0x7424('0x1b')][_0x7424('0x1e')]||null:null,'limit':_0x1a4383['options']?_0x1a4383[_0x7424('0x1b')]['limit']||null:null})[_0x7424('0x1f')](function(_0x1eaeee){logger['info'](_0x7424('0x20'),_0x1a4383);logger['debug'](_0x7424('0x20'),_0x1a4383,JSON[_0x7424('0x13')](_0x1eaeee));_0x2dbb9e(_0x1eaeee);})[_0x7424('0x18')](function(_0x12b963){logger[_0x7424('0x14')](_0x7424('0x20'),_0x12b963[_0x7424('0x16')],_0x1a4383);_0x57a440(_0x3f72bc[_0x7424('0x14')](0x1f4,_0x12b963[_0x7424('0x16')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x2dbcf2){return new Promise(function(_0x25a9cf,_0x188e71){return db[_0x7424('0x19')]['find']({'where':_0x2dbcf2[_0x7424('0x1b')]?_0x2dbcf2[_0x7424('0x1b')][_0x7424('0x1d')]||null:null})['then'](function(_0x40ec18){if(_0x40ec18){return _0x40ec18[_0x7424('0x21')](_0x2dbcf2['body'][_0x7424('0x22')],_[_0x7424('0x23')](_0x2dbcf2[_0x7424('0x1a')],[_0x7424('0x22'),'id'])||{});}})[_0x7424('0x24')](function(_0x3365b7){logger[_0x7424('0xf')]('AddTags',_0x2dbcf2);logger[_0x7424('0x11')]('AddTags',_0x2dbcf2,JSON[_0x7424('0x13')](_0x3365b7));_0x25a9cf(_0x3365b7);})[_0x7424('0x18')](function(_0x5b3299){logger[_0x7424('0x14')](_0x7424('0x25'),_0x5b3299[_0x7424('0x16')],_0x2dbcf2);_0x188e71(_this[_0x7424('0x14')](0x1f4,_0x5b3299[_0x7424('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index ed8bf10..457494a 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 _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 +var _0xb0a0=['emit','register','openchannelInteraction:','save','remove'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb0a0,0x1c0));var _0x0b0a=function(_0x5dcbf0,_0x101d9d){_0x5dcbf0=_0x5dcbf0-0x0;var _0xcf87aa=_0xb0a0[_0x5dcbf0];return _0xcf87aa;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x0b0a('0x0'),_0x0b0a('0x1'),'update'];function createListener(_0x3e2eb4,_0x2c9f7c){return function(_0x2e19cd){_0x2c9f7c[_0x0b0a('0x2')](_0x3e2eb4,_0x2e19cd);};}function removeListener(_0x410566,_0x235a59){return function(){OpenchannelInteractionEvents['removeListener'](_0x410566,_0x235a59);};}exports[_0x0b0a('0x3')]=function(_0x49f3ba){for(var _0x6a2201=0x0,_0x359a03=events['length'];_0x6a2201<_0x359a03;_0x6a2201++){var _0x14af53=events[_0x6a2201];var _0x31eb07=createListener(_0x0b0a('0x4')+_0x14af53,_0x49f3ba);OpenchannelInteractionEvents['on'](_0x14af53,_0x31eb07);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 59ec71b..190da7e 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_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 +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x2f559c,_0x50d317){var _0x418cde=function(_0x5e7eed){while(--_0x5e7eed){_0x2f559c['push'](_0x2f559c['shift']());}};_0x418cde(++_0x50d317);}(_0xedd9,0xfc));var _0x9edd=function(_0x483d15,_0x195c60){_0x483d15=_0x483d15-0x0;var _0xf80886=_0xedd9[_0x483d15];return _0xf80886;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'openchannelmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x13')](_0x9edd('0x17'),auth['isAuthenticated'](),controller[_0x9edd('0x18')]);router[_0x9edd('0x19')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x1a')]);module[_0x9edd('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index d580c9d..067feae 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 _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 +var _0x9354=['out','DATE','STRING','exports','TEXT','BOOLEAN','ENUM'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x9354,0x96));var _0x4935=function(_0x2e6c19,_0x131233){_0x2e6c19=_0x2e6c19-0x0;var _0x52885d=_0x9354[_0x2e6c19];return _0x52885d;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'body':{'type':Sequelize[_0x4935('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x4935('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4935('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4935('0x3')]('in',_0x4935('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x4935('0x5')]},'providerName':{'type':Sequelize[_0x4935('0x6')]},'providerResponse':{'type':Sequelize[_0x4935('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 4064130..b2541b9 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 _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 +var _0xf032=['params','find','create','body','describe','openchannel-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','isNil','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','channel','motionChannel','event','EventManager','acceptmessage','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','QueryTypes','interface','SIP/%s','rejectmessage','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','info','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','result','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','map','OpenchannelMessage','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show'];(function(_0x78732b,_0x12e7b6){var _0x166267=function(_0x1cd8d9){while(--_0x1cd8d9){_0x78732b['push'](_0x78732b['shift']());}};_0x166267(++_0x12e7b6);}(_0xf032,0x131));var _0x2f03=function(_0x10322c,_0x3dedd9){_0x10322c=_0x10322c-0x0;var _0x1bded2=_0xf032[_0x10322c];return _0x1bded2;};'use strict';var emlformat=require(_0x2f03('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2f03('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2f03('0x2'));var moment=require(_0x2f03('0x3'));var BPromise=require(_0x2f03('0x4'));var Mustache=require(_0x2f03('0x5'));var util=require(_0x2f03('0x6'));var path=require(_0x2f03('0x7'));var sox=require(_0x2f03('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f03('0x9'));var _=require(_0x2f03('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2f03('0xb'));var deskjs=require(_0x2f03('0xc'));var toCsv=require(_0x2f03('0xd'));var querystring=require(_0x2f03('0xe'));var Papa=require(_0x2f03('0xf'));var Redis=require(_0x2f03('0x10'));var authService=require(_0x2f03('0x11'));var qs=require(_0x2f03('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f03('0x13'))(_0x2f03('0x14'));var utils=require(_0x2f03('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2f03('0x16'))['db'];config[_0x2f03('0x17')]=_['defaults'](config[_0x2f03('0x17')],{'host':_0x2f03('0x18'),'port':0x18eb});var socket=require(_0x2f03('0x19'))(new Redis(config[_0x2f03('0x17')]));require(_0x2f03('0x1a'))['register'](socket);var jayson=require(_0x2f03('0x1b'));var client=jayson[_0x2f03('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x2f03('0x1c')][_0x2f03('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x33f998,_0x52472d,_0x13c257,_0x58f9f5){return new BPromise(function(_0x30e136,_0x1aa89b){var _0x10a22f=_0x58f9f5||client;return _0x10a22f['request'](_0x33f998,_0x13c257)['then'](function(_0x4c503f){logger[_0x2f03('0x1e')]('OpenchannelMessage,\x20%s,\x20%s',_0x52472d,'request\x20sent');logger[_0x2f03('0x1f')](_0x2f03('0x20'),_0x52472d,_0x2f03('0x21'),JSON[_0x2f03('0x22')](_0x4c503f));if(_0x4c503f[_0x2f03('0x23')]){if(_0x4c503f[_0x2f03('0x23')]['code']===0x1f4){logger[_0x2f03('0x23')](_0x2f03('0x24'),_0x52472d,_0x4c503f[_0x2f03('0x23')]['message']);return _0x1aa89b(_0x4c503f['error'][_0x2f03('0x25')]);}logger[_0x2f03('0x23')](_0x2f03('0x24'),_0x52472d,_0x4c503f[_0x2f03('0x23')][_0x2f03('0x25')]);return _0x30e136(_0x4c503f[_0x2f03('0x23')]['message']);}else{logger[_0x2f03('0x1e')](_0x2f03('0x24'),_0x52472d,'request\x20sent');_0x30e136(_0x4c503f[_0x2f03('0x26')]['message']);}})['catch'](function(_0x357d23){logger[_0x2f03('0x23')](_0x2f03('0x24'),_0x52472d,_0x357d23);_0x1aa89b(_0x357d23);});});}function respondWithStatusCode(_0x853039,_0x5a73e8){_0x5a73e8=_0x5a73e8||0xcc;return function(_0x543786){if(_0x543786){return _0x853039[_0x2f03('0x27')](_0x5a73e8);}return _0x853039['status'](_0x5a73e8)['end']();};}function respondWithResult(_0x3cc5f3,_0x1b3aad){_0x1b3aad=_0x1b3aad||0xc8;return function(_0xe290ac){if(_0xe290ac){return _0x3cc5f3[_0x2f03('0x28')](_0x1b3aad)[_0x2f03('0x29')](_0xe290ac);}};}function respondWithFilteredResult(_0x4fbf4f,_0x24c427){return function(_0x42be80){if(_0x42be80){var _0xbb9458=typeof _0x24c427[_0x2f03('0x2a')]==='undefined'&&typeof _0x24c427[_0x2f03('0x2b')]===_0x2f03('0x2c');var _0x40f402=_0x42be80[_0x2f03('0x2d')];var _0x32fce7=_0xbb9458?0x0:_0x24c427[_0x2f03('0x2a')];var _0x5c84e6=_0xbb9458?_0x42be80[_0x2f03('0x2d')]:_0x24c427[_0x2f03('0x2a')]+_0x24c427['limit'];var _0x462109;if(_0x5c84e6>=_0x40f402){_0x5c84e6=_0x40f402;_0x462109=0xc8;}else{_0x462109=0xce;}_0x4fbf4f[_0x2f03('0x28')](_0x462109);return _0x4fbf4f['set'](_0x2f03('0x2e'),_0x32fce7+'-'+_0x5c84e6+'/'+_0x40f402)[_0x2f03('0x29')](_0x42be80);}return null;};}function patchUpdates(_0x5e9483){return function(_0x33d49a){try{jsonpatch[_0x2f03('0x2f')](_0x33d49a,_0x5e9483,!![]);}catch(_0x71ba54){return BPromise[_0x2f03('0x30')](_0x71ba54);}return _0x33d49a[_0x2f03('0x31')]();};}function saveUpdates(_0x248464,_0x3e2256){return function(_0x2b13fa){if(_0x2b13fa){return _0x2b13fa[_0x2f03('0x32')](_0x248464)[_0x2f03('0x33')](function(_0x4dbcc5){return _0x4dbcc5;});}return null;};}function removeEntity(_0xde8e60,_0x2df57a){return function(_0x2d73df){if(_0x2d73df){return _0x2d73df[_0x2f03('0x34')]()[_0x2f03('0x33')](function(){_0xde8e60[_0x2f03('0x28')](0xcc)[_0x2f03('0x35')]();});}};}function handleEntityNotFound(_0x4e6cce,_0x2a6b1e){return function(_0x3197cb){if(!_0x3197cb){_0x4e6cce[_0x2f03('0x27')](0x194);}return _0x3197cb;};}function handleError(_0xfc274e,_0x258bb0){_0x258bb0=_0x258bb0||0x1f4;return function(_0x3705c4){logger['error'](_0x3705c4['stack']);if(_0x3705c4[_0x2f03('0x36')]){delete _0x3705c4[_0x2f03('0x36')];}_0xfc274e[_0x2f03('0x28')](_0x258bb0)[_0x2f03('0x37')](_0x3705c4);};}exports[_0x2f03('0x38')]=function(_0x105add,_0x49e7f0){var _0x1f9239={},_0x3b5155={},_0x3f9678={'count':0x0,'rows':[]};var _0x113338=_[_0x2f03('0x39')](db[_0x2f03('0x3a')][_0x2f03('0x3b')],function(_0x5c0424){return{'name':_0x5c0424['fieldName'],'type':_0x5c0424['type'][_0x2f03('0x3c')]};});_0x3b5155['model']=_[_0x2f03('0x39')](_0x113338,_0x2f03('0x36'));_0x3b5155[_0x2f03('0x3d')]=_[_0x2f03('0x3e')](_0x105add[_0x2f03('0x3d')]);_0x3b5155[_0x2f03('0x3f')]=_[_0x2f03('0x40')](_0x3b5155[_0x2f03('0x41')],_0x3b5155[_0x2f03('0x3d')]);_0x1f9239[_0x2f03('0x42')]=_[_0x2f03('0x40')](_0x3b5155[_0x2f03('0x41')],qs[_0x2f03('0x43')](_0x105add[_0x2f03('0x3d')][_0x2f03('0x43')]));_0x1f9239[_0x2f03('0x42')]=_0x1f9239['attributes'][_0x2f03('0x44')]?_0x1f9239[_0x2f03('0x42')]:_0x3b5155[_0x2f03('0x41')];if(!_0x105add[_0x2f03('0x3d')][_0x2f03('0x45')](_0x2f03('0x46'))){_0x1f9239[_0x2f03('0x2b')]=qs[_0x2f03('0x2b')](_0x105add[_0x2f03('0x3d')][_0x2f03('0x2b')]);_0x1f9239['offset']=qs[_0x2f03('0x2a')](_0x105add[_0x2f03('0x3d')][_0x2f03('0x2a')]);}_0x1f9239[_0x2f03('0x47')]=qs[_0x2f03('0x48')](_0x105add[_0x2f03('0x3d')][_0x2f03('0x48')]);_0x1f9239[_0x2f03('0x49')]=qs[_0x2f03('0x3f')](_[_0x2f03('0x4a')](_0x105add[_0x2f03('0x3d')],_0x3b5155[_0x2f03('0x3f')]),_0x113338);if(_0x105add[_0x2f03('0x3d')][_0x2f03('0x4b')]){_0x1f9239[_0x2f03('0x49')]=_[_0x2f03('0x4c')](_0x1f9239[_0x2f03('0x49')],{'$or':_[_0x2f03('0x39')](_0x113338,function(_0x495654){if(_0x495654[_0x2f03('0x4d')]!==_0x2f03('0x4e')){var _0xdd95bc={};_0xdd95bc[_0x495654['name']]={'$like':'%'+_0x105add[_0x2f03('0x3d')][_0x2f03('0x4b')]+'%'};return _0xdd95bc;}})});}_0x1f9239=_[_0x2f03('0x4c')]({},_0x1f9239,_0x105add['options']);var _0xf84546={'where':_0x1f9239[_0x2f03('0x49')]};return db[_0x2f03('0x3a')][_0x2f03('0x2d')](_0xf84546)[_0x2f03('0x33')](function(_0x282d52){_0x3f9678[_0x2f03('0x2d')]=_0x282d52;if(_0x105add[_0x2f03('0x3d')][_0x2f03('0x4f')]){_0x1f9239[_0x2f03('0x50')]=[{'all':!![]}];}return db[_0x2f03('0x3a')][_0x2f03('0x51')](_0x1f9239);})[_0x2f03('0x33')](function(_0x1d23bb){_0x3f9678[_0x2f03('0x52')]=_0x1d23bb;return _0x3f9678;})[_0x2f03('0x33')](respondWithFilteredResult(_0x49e7f0,_0x1f9239))[_0x2f03('0x53')](handleError(_0x49e7f0,null));};exports[_0x2f03('0x54')]=function(_0x12a91b,_0x536b85){var _0x135636={'raw':!![],'where':{'id':_0x12a91b[_0x2f03('0x55')]['id']}},_0x376ee0={};_0x376ee0[_0x2f03('0x41')]=_[_0x2f03('0x3e')](db['OpenchannelMessage'][_0x2f03('0x3b')]);_0x376ee0[_0x2f03('0x3d')]=_[_0x2f03('0x3e')](_0x12a91b[_0x2f03('0x3d')]);_0x376ee0[_0x2f03('0x3f')]=_['intersection'](_0x376ee0[_0x2f03('0x41')],_0x376ee0[_0x2f03('0x3d')]);_0x135636['attributes']=_[_0x2f03('0x40')](_0x376ee0[_0x2f03('0x41')],qs[_0x2f03('0x43')](_0x12a91b[_0x2f03('0x3d')][_0x2f03('0x43')]));_0x135636[_0x2f03('0x42')]=_0x135636[_0x2f03('0x42')][_0x2f03('0x44')]?_0x135636['attributes']:_0x376ee0[_0x2f03('0x41')];if(_0x12a91b[_0x2f03('0x3d')][_0x2f03('0x4f')]){_0x135636[_0x2f03('0x50')]=[{'all':!![]}];}_0x135636=_[_0x2f03('0x4c')]({},_0x135636,_0x12a91b['options']);return db[_0x2f03('0x3a')][_0x2f03('0x56')](_0x135636)[_0x2f03('0x33')](handleEntityNotFound(_0x536b85,null))[_0x2f03('0x33')](respondWithResult(_0x536b85,null))[_0x2f03('0x53')](handleError(_0x536b85,null));};exports[_0x2f03('0x57')]=function(_0x8fd90,_0x306d86){return db[_0x2f03('0x3a')][_0x2f03('0x57')](_0x8fd90[_0x2f03('0x58')],{})[_0x2f03('0x33')](respondWithResult(_0x306d86,0xc9))[_0x2f03('0x53')](handleError(_0x306d86,null));};exports[_0x2f03('0x32')]=function(_0x164660,_0xbf1d5c){if(_0x164660['body']['id']){delete _0x164660[_0x2f03('0x58')]['id'];}return db['OpenchannelMessage'][_0x2f03('0x56')]({'where':{'id':_0x164660['params']['id']}})[_0x2f03('0x33')](handleEntityNotFound(_0xbf1d5c,null))[_0x2f03('0x33')](saveUpdates(_0x164660[_0x2f03('0x58')],null))[_0x2f03('0x33')](respondWithResult(_0xbf1d5c,null))[_0x2f03('0x53')](handleError(_0xbf1d5c,null));};exports['destroy']=function(_0x280e00,_0x212406){return db[_0x2f03('0x3a')][_0x2f03('0x56')]({'where':{'id':_0x280e00['params']['id']}})[_0x2f03('0x33')](handleEntityNotFound(_0x212406,null))[_0x2f03('0x33')](removeEntity(_0x212406,null))['catch'](handleError(_0x212406,null));};exports[_0x2f03('0x59')]=function(_0x2fd932,_0xb0f5c0){return db[_0x2f03('0x3a')][_0x2f03('0x59')]()[_0x2f03('0x33')](respondWithResult(_0xb0f5c0,null))[_0x2f03('0x53')](handleError(_0xb0f5c0,null));};var interaction_log=require(_0x2f03('0x13'))(_0x2f03('0x5a'));exports[_0x2f03('0x5b')]=function(_0x4af710,_0x228f5f,_0x244e1b){var _0x19a03f={'agent':{},'channel':'openchannel'};if(_0x4af710[_0x2f03('0x58')]['id']){delete _0x4af710[_0x2f03('0x58')]['id'];}_0x4af710[_0x2f03('0x58')]['read']=!![];_0x4af710[_0x2f03('0x58')][_0x2f03('0x5c')]=moment()[_0x2f03('0x5d')](_0x2f03('0x5e'));_0x4af710[_0x2f03('0x58')][_0x2f03('0x5f')]=_0x4af710[_0x2f03('0x58')][_0x2f03('0x5f')]||_0x4af710[_0x2f03('0x60')]['id'];_0x19a03f[_0x2f03('0x61')]['id']=_0x4af710['body'][_0x2f03('0x5f')];return db[_0x2f03('0x3a')][_0x2f03('0x56')]({'where':{'id':_0x4af710['params']['id'],'UserId':null}})[_0x2f03('0x33')](handleEntityNotFound(_0x228f5f,null))[_0x2f03('0x33')](saveUpdates(_0x4af710[_0x2f03('0x58')],null))[_0x2f03('0x33')](function(_0x312648){if(_0x312648){_0x19a03f[_0x2f03('0x25')]=_0x312648[_0x2f03('0x62')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x312648[_0x2f03('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x228f5f,null))[_0x2f03('0x33')](function(_0x336e0f){if(_0x336e0f){return _0x336e0f[_0x2f03('0x32')]({'UserId':_0x4af710[_0x2f03('0x58')][_0x2f03('0x5f')],'read1stAt':_[_0x2f03('0x64')](_0x336e0f['read1stAt'])?moment()[_0x2f03('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x2f03('0x33')](function(_0x4b8281){if(_0x4b8281){_0x19a03f[_0x2f03('0x65')]=_0x4b8281[_0x2f03('0x62')]({'plain':!![]});interaction_log[_0x2f03('0x1e')](_0x2f03('0x66'),_0x4af710['user']['id'],_0x4af710[_0x2f03('0x60')][_0x2f03('0x36')],_0x4af710[_0x2f03('0x60')]['role'],_0x19a03f[_0x2f03('0x65')]['id'],_0x4af710['body']?JSON[_0x2f03('0x22')](_0x4af710[_0x2f03('0x58')]):_0x2f03('0x67'));return respondWithRpcPromise(_0x2f03('0x68'),_0x2f03('0x69'),_0x19a03f);}return null;})[_0x2f03('0x33')](function(_0x3098b2){var _0x43e84a=_0x2f03('0x6a')+_0x3098b2[_0x2f03('0x25')]['ContactId'];return db[_0x2f03('0x6b')]['query'](_0x43e84a,{'type':db[_0x2f03('0x6c')]['QueryTypes'][_0x2f03('0x6d')],'raw':!![]})[_0x2f03('0x33')](function(_0x11b71c){return _0x11b71c;});})[_0x2f03('0x33')](function(_0x1134fe){if(_0x1134fe){_0x19a03f[_0x2f03('0x25')][_0x2f03('0x6e')]=_0x1134fe[0x0];if(!_0x4af710[_0x2f03('0x58')]['UserId'])return;return db[_0x2f03('0x6f')]['find']({'where':{'id':_0x4af710[_0x2f03('0x58')][_0x2f03('0x5f')],'role':'agent'},'attributes':['id',_0x2f03('0x36'),_0x2f03('0x70'),_0x2f03('0x71'),_0x2f03('0x72')],'raw':!![]});}return null;})[_0x2f03('0x33')](function(_0x347d08){if(!_0x347d08)return null;_0x19a03f[_0x2f03('0x25')][_0x2f03('0x61')]=_0x347d08;return _0x19a03f;})[_0x2f03('0x33')](function(_0x3aad9b){if(_0x3aad9b){if(_0x4af710['body'][_0x2f03('0x73')]){_0x19a03f[_0x2f03('0x25')]['interface']=util[_0x2f03('0x5d')]('SIP/%s',_0x4af710[_0x2f03('0x60')][_0x2f03('0x36')]);_0x19a03f[_0x2f03('0x25')]['channel']=_0x19a03f[_0x2f03('0x74')];_0x19a03f[_0x2f03('0x25')][_0x2f03('0x75')]=_0x19a03f[_0x2f03('0x74')];_0x19a03f[_0x2f03('0x25')][_0x2f03('0x76')]='accept';return respondWithRpcPromise(_0x2f03('0x77'),_0x2f03('0x77'),{'event':_0x2f03('0x78'),'message':_0x19a03f[_0x2f03('0x25')]},client9002)['then'](function(){return _0x19a03f;});}return _0x19a03f;}return null;})[_0x2f03('0x33')](respondWithResult(_0x228f5f,null))[_0x2f03('0x53')](handleError(_0x228f5f,null));};var interaction_log=require(_0x2f03('0x13'))('openchannel-interactions');exports['reject']=function(_0x54f412,_0x51c9f0,_0x5006f){var _0x5b0a9c={'agent':{},'channel':_0x2f03('0x79')};if(_0x54f412[_0x2f03('0x58')]['id']){delete _0x54f412[_0x2f03('0x58')]['id'];}_0x54f412['body']['UserId']=_0x54f412['body'][_0x2f03('0x5f')]||_0x54f412['user']['id'];_0x5b0a9c[_0x2f03('0x61')]['id']=_0x54f412[_0x2f03('0x58')][_0x2f03('0x5f')];return db['OpenchannelMessage'][_0x2f03('0x56')]({'where':{'id':_0x54f412[_0x2f03('0x55')]['id'],'UserId':null}})[_0x2f03('0x33')](handleEntityNotFound(_0x51c9f0,null))[_0x2f03('0x33')](function(_0x24cf82){if(_0x24cf82){_0x5b0a9c[_0x2f03('0x25')]=_0x24cf82['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x2f03('0x56')]({'where':{'id':_0x24cf82[_0x2f03('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x51c9f0,null))[_0x2f03('0x33')](function(_0x1ea257){if(_0x1ea257){_0x5b0a9c[_0x2f03('0x65')]=_0x1ea257['get']({'plain':!![]});interaction_log[_0x2f03('0x1e')](_0x2f03('0x7a'),_0x54f412[_0x2f03('0x60')]['id'],_0x54f412[_0x2f03('0x60')][_0x2f03('0x36')],_0x54f412['user']['role'],_0x5b0a9c[_0x2f03('0x65')]['id'],_0x54f412[_0x2f03('0x58')]?JSON[_0x2f03('0x22')](_0x54f412[_0x2f03('0x58')]):'null');return respondWithRpcPromise(_0x2f03('0x7b'),_0x2f03('0x7c'),_0x5b0a9c);}return null;})[_0x2f03('0x33')](function(_0x4a232c){var _0x382a1d=_0x2f03('0x6a')+_0x4a232c['message'][_0x2f03('0x7d')];return db[_0x2f03('0x6b')][_0x2f03('0x3d')](_0x382a1d,{'type':db['Sequelize'][_0x2f03('0x7e')][_0x2f03('0x6d')],'raw':!![]})[_0x2f03('0x33')](function(_0xcad618){return _0xcad618;});})[_0x2f03('0x33')](function(_0x102556){if(_0x102556){_0x5b0a9c[_0x2f03('0x25')][_0x2f03('0x6e')]=_0x102556[0x0];if(!_0x54f412[_0x2f03('0x58')][_0x2f03('0x5f')])return;return db['User'][_0x2f03('0x56')]({'where':{'id':_0x54f412[_0x2f03('0x58')][_0x2f03('0x5f')],'role':'agent'},'attributes':['id',_0x2f03('0x36'),'fullname',_0x2f03('0x71'),_0x2f03('0x72')],'raw':!![]});}return null;})[_0x2f03('0x33')](function(_0xccfa93){if(!_0xccfa93)return null;_0x5b0a9c['message'][_0x2f03('0x61')]=_0xccfa93;return _0x5b0a9c;})[_0x2f03('0x33')](function(_0x1ad05b){if(_0x1ad05b){_0x1ad05b[_0x2f03('0x25')][_0x2f03('0x7f')]=util[_0x2f03('0x5d')](_0x2f03('0x80'),_0x54f412[_0x2f03('0x60')][_0x2f03('0x36')]);_0x1ad05b['message'][_0x2f03('0x74')]=_0x5b0a9c[_0x2f03('0x74')];_0x1ad05b[_0x2f03('0x25')][_0x2f03('0x75')]=_0x5b0a9c[_0x2f03('0x74')];_0x1ad05b[_0x2f03('0x25')][_0x2f03('0x76')]='reject';respondWithRpcPromise(_0x2f03('0x77'),_0x2f03('0x77'),{'event':_0x2f03('0x81'),'message':_0x1ad05b[_0x2f03('0x25')]},client9002);return _0x5b0a9c;}return null;})[_0x2f03('0x33')](respondWithResult(_0x51c9f0,null))[_0x2f03('0x53')](handleError(_0x51c9f0,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 401b08f..7303440 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 _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 +var _0xd388=['exports','events','../../mysqldb','OpenchannelMessage','emit','hasOwnProperty','hook'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0xd388,0x104));var _0x8d38=function(_0x3782c6,_0x1c7267){_0x3782c6=_0x3782c6-0x0;var _0x56f758=_0xd388[_0x3782c6];return _0x56f758;};'use strict';var EventEmitter=require(_0x8d38('0x0'));var OpenchannelMessage=require(_0x8d38('0x1'))['db'][_0x8d38('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4f7d06){return function(_0x25c531,_0x85db89,_0x2a3614){OpenchannelMessageEvents[_0x8d38('0x3')](_0x4f7d06+':'+_0x25c531['id'],_0x25c531);OpenchannelMessageEvents[_0x8d38('0x3')](_0x4f7d06,_0x25c531);_0x2a3614(null);};}for(var e in events){if(events[_0x8d38('0x4')](e)){var event=events[e];OpenchannelMessage[_0x8d38('0x5')](e,emitEvent(event));}}module[_0x8d38('0x6')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 67f7ffe..a93f9f4 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 _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 +var _0x7c40=['get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','catch','error','describe','OpenchannelAccount','find','OpenchannelAccountId','CmContact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','Interactions','length','Interaction','omit','Contact','POST','GET','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','OpenchannelMessage','body','FULLTEXT','models'];(function(_0x1481fe,_0x497588){var _0x2281c1=function(_0x131759){while(--_0x131759){_0x1481fe['push'](_0x1481fe['shift']());}};_0x2281c1(++_0x497588);}(_0x7c40,0x83));var _0x07c4=function(_0x436c50,_0x1a35b0){_0x436c50=_0x436c50-0x0;var _0x1a315e=_0x7c40[_0x436c50];return _0x1a315e;};'use strict';var _=require('lodash');var util=require(_0x07c4('0x0'));var logger=require(_0x07c4('0x1'))(_0x07c4('0x2'));var moment=require(_0x07c4('0x3'));var BPromise=require(_0x07c4('0x4'));var rp=require(_0x07c4('0x5'));var fs=require('fs');var path=require(_0x07c4('0x6'));var rimraf=require(_0x07c4('0x7'));var config=require('../../config/environment');var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0x43bd6d,_0x5abe94){return _0x43bd6d[_0x07c4('0x8')](_0x07c4('0x9'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x07c4('0xa')],'type':_0x07c4('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b38f6,_0x55910a,_0x14a2be){var _0x1ad658=_0x43bd6d[_0x07c4('0xc')];var _0xe2ee6f=_0x2b38f6[_0x07c4('0xd')]({'plain':!![]});if(_0xe2ee6f[_0x07c4('0xe')][_0x07c4('0xf')]()==='in'||_0xe2ee6f[_0x07c4('0xe')][_0x07c4('0xf')]()===_0x07c4('0x10')&&!_0xe2ee6f[_0x07c4('0x11')]&&!_[_0x07c4('0x12')](_0xe2ee6f[_0x07c4('0x13')])){_0x1ad658[_0x07c4('0x14')][_0x07c4('0x15')]({'where':{'id':_0xe2ee6f[_0x07c4('0x16')]}})[_0x07c4('0x17')](function(_0x3bccd0){if(_0x3bccd0){_0x3bccd0[_0x07c4('0x18')]({'lastMsgAt':_0xe2ee6f['createdAt'],'lastMsgDirection':_0xe2ee6f[_0x07c4('0xe')][_0x07c4('0xf')]()});}})[_0x07c4('0x19')](function(_0x378088){console[_0x07c4('0x1a')](_0x378088);});}if(_0xe2ee6f[_0x07c4('0xe')]==='out'&&!_0xe2ee6f[_0x07c4('0x11')]){var _0xaa2fd0;_0x1ad658['CmContact'][_0x07c4('0x1b')]()['then'](function(_0x254af9){return _0x1ad658[_0x07c4('0x1c')][_0x07c4('0x1d')]({'where':{'id':_0xe2ee6f[_0x07c4('0x1e')]},'include':[{'model':_0x1ad658[_0x07c4('0x14')],'as':'Interactions','where':{'id':_0xe2ee6f[_0x07c4('0x16')]},'limit':0x1,'include':[{'model':_0x1ad658[_0x07c4('0x1f')],'as':'Contact','attributes':_['keys'](_0x254af9)}]}]});})[_0x07c4('0x17')](function(_0x3fa9bb){_0xaa2fd0=_0x3fa9bb[_0x07c4('0xd')]({'plain':!![]});if(_0xaa2fd0&&_0xaa2fd0[_0x07c4('0x20')]){logger[_0x07c4('0x21')](_0x07c4('0x22'),'afterCreate',util[_0x07c4('0x23')]('Forwarding\x20message\x20%d\x20to\x20%s',_0xe2ee6f['id'],_0xaa2fd0['replyUri']));if(_0xaa2fd0[_0x07c4('0x24')]&&_0xaa2fd0[_0x07c4('0x24')][_0x07c4('0x25')]){_0xe2ee6f[_0x07c4('0x26')]=_[_0x07c4('0x27')](_0xaa2fd0[_0x07c4('0x24')][0x0],'Contact');_0xe2ee6f[_0x07c4('0x28')]=_0xaa2fd0[_0x07c4('0x24')][0x0][_0x07c4('0x28')];}var _0x55910a={'method':_0x07c4('0x29'),'uri':encodeURI(_0xaa2fd0[_0x07c4('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x55910a['method']){case _0x07c4('0x2a'):_0x55910a['qs']=_0xe2ee6f;break;case'POST':_0x55910a[_0x07c4('0xa')]=_0xe2ee6f;break;}return rp(_0x55910a)[_0x07c4('0x17')](function(_0x5aba44){logger['info'](_0x07c4('0x22'),_0x07c4('0x2b'),util['format'](_0x07c4('0x2c'),_0xe2ee6f['id'],_0xaa2fd0['replyUri']));if(_0x5aba44[_0x07c4('0xa')]['threadId']&&_0x5aba44[_0x07c4('0xa')]['threadId']!=_0xe2ee6f[_0x07c4('0x26')][_0x07c4('0x2d')]){return _0x1ad658['OpenchannelInteraction'][_0x07c4('0x18')]({'threadId':_0x5aba44[_0x07c4('0xa')][_0x07c4('0x2d')]},{'where':{'id':_0xe2ee6f[_0x07c4('0x26')]['id']}});}else{return;}})['then'](function(){return _0x2b38f6[_0x07c4('0x18')]({'read':!![]});})[_0x07c4('0x19')](function(_0x84e5b){logger[_0x07c4('0x1a')](_0x07c4('0x22'),_0x07c4('0x2b'),util[_0x07c4('0x2e')](_0x84e5b,{'showHidden':![],'depth':null}));_0x14a2be();});}else{_0x14a2be();}})['finally'](function(){_0x14a2be();});}else{_0x14a2be();}}},'charset':_0x07c4('0x2f'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 36314b4..4eafb03 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(_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 +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2381c9,_0xddadfd){var _0x5d10ee=function(_0x233323){while(--_0x233323){_0x2381c9['push'](_0x2381c9['shift']());}};_0x5d10ee(++_0xddadfd);}(_0x1261,0x144));var _0x1126=function(_0x185334,_0x4630ac){_0x185334=_0x185334-0x0;var _0xf2e59a=_0x1261[_0x185334];return _0xf2e59a;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 23857f2..72434ec 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 _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 +var _0x1883=['./openchannelMessage.events','save','remove','update','emit','removeListener','register','length','openchannelMessage:'];(function(_0x1f239a,_0x40fa90){var _0x4982b7=function(_0x54f977){while(--_0x54f977){_0x1f239a['push'](_0x1f239a['shift']());}};_0x4982b7(++_0x40fa90);}(_0x1883,0xab));var _0x3188=function(_0x4ea85b,_0x663f8a){_0x4ea85b=_0x4ea85b-0x0;var _0x1e556d=_0x1883[_0x4ea85b];return _0x1e556d;};'use strict';var OpenchannelMessageEvents=require(_0x3188('0x0'));var events=[_0x3188('0x1'),_0x3188('0x2'),_0x3188('0x3')];function createListener(_0x11e3bf,_0x7ce655){return function(_0x2551e5){_0x7ce655[_0x3188('0x4')](_0x11e3bf,_0x2551e5);};}function removeListener(_0x1c7c86,_0x44afb8){return function(){OpenchannelMessageEvents[_0x3188('0x5')](_0x1c7c86,_0x44afb8);};}exports[_0x3188('0x6')]=function(_0x408ae0){for(var _0x33b62d=0x0,_0x24f2f1=events[_0x3188('0x7')];_0x33b62d<_0x24f2f1;_0x33b62d++){var _0x3e3afb=events[_0x33b62d];var _0x5c8f26=createListener(_0x3188('0x8')+_0x3e3afb,_0x408ae0);OpenchannelMessageEvents['on'](_0x3e3afb,_0x5c8f26);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 8b66c8c..44cc23a 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 _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 +var _0xc6e7=['../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','show','getMembers','post','create','/:id/teams','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x34ff1e,_0x1b0c97){var _0x5fe980=function(_0x216989){while(--_0x216989){_0x34ff1e['push'](_0x34ff1e['shift']());}};_0x5fe980(++_0x1b0c97);}(_0xc6e7,0x112));var _0x7c6e=function(_0x146a75,_0x1a290b){_0x146a75=_0x146a75-0x0;var _0x3521d8=_0xc6e7[_0x146a75];return _0x3521d8;};'use strict';var multer=require(_0x7c6e('0x0'));var util=require('util');var path=require(_0x7c6e('0x1'));var timeout=require(_0x7c6e('0x2'));var express=require(_0x7c6e('0x3'));var router=express['Router']();var fs_extra=require(_0x7c6e('0x4'));var auth=require(_0x7c6e('0x5'));var interaction=require(_0x7c6e('0x6'));var config=require(_0x7c6e('0x7'));var controller=require(_0x7c6e('0x8'));router[_0x7c6e('0x9')]('/',auth[_0x7c6e('0xa')](),controller[_0x7c6e('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7c6e('0xc')]);router[_0x7c6e('0x9')]('/:id',auth[_0x7c6e('0xa')](),controller[_0x7c6e('0xd')]);router[_0x7c6e('0x9')]('/:id/members',auth[_0x7c6e('0xa')](),controller[_0x7c6e('0xe')]);router[_0x7c6e('0x9')]('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0x7c6e('0x9')]('/:id/users',auth[_0x7c6e('0xa')](),controller['getAgents']);router[_0x7c6e('0xf')]('/',auth[_0x7c6e('0xa')](),controller[_0x7c6e('0x10')]);router[_0x7c6e('0xf')](_0x7c6e('0x11'),auth[_0x7c6e('0xa')](),controller[_0x7c6e('0x12')]);router[_0x7c6e('0xf')](_0x7c6e('0x13'),auth[_0x7c6e('0xa')](),controller[_0x7c6e('0x14')]);router[_0x7c6e('0x15')]('/:id',auth[_0x7c6e('0xa')](),controller[_0x7c6e('0x16')]);router[_0x7c6e('0x17')]('/:id',auth[_0x7c6e('0xa')](),controller[_0x7c6e('0x18')]);router[_0x7c6e('0x17')](_0x7c6e('0x11'),auth[_0x7c6e('0xa')](),controller[_0x7c6e('0x19')]);router[_0x7c6e('0x17')](_0x7c6e('0x13'),auth[_0x7c6e('0xa')](),controller[_0x7c6e('0x1a')]);module[_0x7c6e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index c0d6096..f2f433a 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 _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 +var _0xb238=['STRING','name','INTEGER','ENUM','rrmemory','beepall','exports'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0xb238,0x8b));var _0x8b23=function(_0x3a84ac,_0x3e1a0a){_0x3a84ac=_0x3a84ac-0x0;var _0x3a7c1f=_0xb238[_0x3a84ac];return _0x3a7c1f;};'use strict';var Sequelize=require('sequelize');module[_0x8b23('0x0')]={'name':{'type':Sequelize[_0x8b23('0x1')],'unique':_0x8b23('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8b23('0x1')]},'timeout':{'type':Sequelize[_0x8b23('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8b23('0x4')](_0x8b23('0x5'),_0x8b23('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 02fd599..c62977f 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 _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 +var _0x0ed0=['map','OpenchannelQueue','rawAttributes','key','model','query','keys','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','findOne','UserOpenchannelQueue','intersection','hasOwnProperty','User','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','Agents','online','voicePause','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','value','isEmpty','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','get','OpenchannelQueues','UserProfileResource','destroy','end','error','stack','name','send'];(function(_0x428faa,_0x3a0227){var _0x337ddc=function(_0x1dbd70){while(--_0x1dbd70){_0x428faa['push'](_0x428faa['shift']());}};_0x337ddc(++_0x3a0227);}(_0x0ed0,0x169));var _0x00ed=function(_0x1117e,_0x2a9786){_0x1117e=_0x1117e-0x0;var _0x23e6b5=_0x0ed0[_0x1117e];return _0x23e6b5;};'use strict';var emlformat=require(_0x00ed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x00ed('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x00ed('0x2'));var moment=require('moment');var BPromise=require(_0x00ed('0x3'));var Mustache=require(_0x00ed('0x4'));var util=require(_0x00ed('0x5'));var path=require(_0x00ed('0x6'));var sox=require(_0x00ed('0x7'));var csv=require(_0x00ed('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x00ed('0x9'));var _=require(_0x00ed('0xa'));var squel=require('squel');var crypto=require(_0x00ed('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x00ed('0x8'));var querystring=require(_0x00ed('0xc'));var Papa=require('papaparse');var Redis=require(_0x00ed('0xd'));var authService=require(_0x00ed('0xe'));var qs=require(_0x00ed('0xf'));var as=require(_0x00ed('0x10'));var hardwareService=require(_0x00ed('0x11'));var logger=require(_0x00ed('0x12'))('api');var utils=require(_0x00ed('0x13'));var config=require(_0x00ed('0x14'));var licenseUtil=require(_0x00ed('0x15'));var db=require('../../mysqldb')['db'];config[_0x00ed('0x16')]=_[_0x00ed('0x17')](config[_0x00ed('0x16')],{'host':_0x00ed('0x18'),'port':0x18eb});var socket=require(_0x00ed('0x19'))(new Redis(config[_0x00ed('0x16')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x941aba,_0x18ca09){_0x18ca09=_0x18ca09||0xcc;return function(_0x5e7c64){if(_0x5e7c64){return _0x941aba[_0x00ed('0x1a')](_0x18ca09);}return _0x941aba[_0x00ed('0x1b')](_0x18ca09)['end']();};}function respondWithResult(_0x3e8246,_0x3230ea){_0x3230ea=_0x3230ea||0xc8;return function(_0xfc03ab){if(_0xfc03ab){return _0x3e8246[_0x00ed('0x1b')](_0x3230ea)[_0x00ed('0x1c')](_0xfc03ab);}};}function respondWithFilteredResult(_0x18fedf,_0xe674a2){return function(_0x5ee53d){if(_0x5ee53d){var _0x349031=typeof _0xe674a2[_0x00ed('0x1d')]==='undefined'&&typeof _0xe674a2['limit']===_0x00ed('0x1e');var _0x3fd764=_0x5ee53d[_0x00ed('0x1f')];var _0x490a7=_0x349031?0x0:_0xe674a2[_0x00ed('0x1d')];var _0x3f52c2=_0x349031?_0x5ee53d[_0x00ed('0x1f')]:_0xe674a2[_0x00ed('0x1d')]+_0xe674a2[_0x00ed('0x20')];var _0x12aa7c;if(_0x3f52c2>=_0x3fd764){_0x3f52c2=_0x3fd764;_0x12aa7c=0xc8;}else{_0x12aa7c=0xce;}_0x18fedf[_0x00ed('0x1b')](_0x12aa7c);return _0x18fedf['set'](_0x00ed('0x21'),_0x490a7+'-'+_0x3f52c2+'/'+_0x3fd764)[_0x00ed('0x1c')](_0x5ee53d);}return null;};}function patchUpdates(_0x59f092){return function(_0x573df2){try{jsonpatch[_0x00ed('0x22')](_0x573df2,_0x59f092,!![]);}catch(_0xad6ea2){return BPromise[_0x00ed('0x23')](_0xad6ea2);}return _0x573df2[_0x00ed('0x24')]();};}function saveUpdates(_0x31fca1,_0x42a434){return function(_0xaef919){if(_0xaef919){return _0xaef919['update'](_0x31fca1)[_0x00ed('0x25')](function(_0x36de3b){return _0x36de3b;});}return null;};}function removeEntity(_0x342075,_0x5152cb){return function(_0x39bef4){if(_0x39bef4){return _0x39bef4['destroy']()[_0x00ed('0x25')](function(){var _0x5adf37=_0x39bef4[_0x00ed('0x26')]({'plain':!![]});var _0x31e2e0=_0x00ed('0x27');return db[_0x00ed('0x28')][_0x00ed('0x29')]({'where':{'type':_0x31e2e0,'resourceId':_0x5adf37['id']}})[_0x00ed('0x25')](function(){return _0x39bef4;});})['then'](function(){_0x342075[_0x00ed('0x1b')](0xcc)[_0x00ed('0x2a')]();});}};}function handleEntityNotFound(_0x4a9490,_0x1c0787){return function(_0x4eb780){if(!_0x4eb780){_0x4a9490[_0x00ed('0x1a')](0x194);}return _0x4eb780;};}function handleError(_0x4eddbd,_0x4ce973){_0x4ce973=_0x4ce973||0x1f4;return function(_0x2e21c1){logger[_0x00ed('0x2b')](_0x2e21c1[_0x00ed('0x2c')]);if(_0x2e21c1['name']){delete _0x2e21c1[_0x00ed('0x2d')];}_0x4eddbd['status'](_0x4ce973)[_0x00ed('0x2e')](_0x2e21c1);};}exports['index']=function(_0x23ff89,_0x1700d5){var _0x5b4f4a={},_0x2b1a3e={},_0x44565f={'count':0x0,'rows':[]};var _0x4ef307=_[_0x00ed('0x2f')](db[_0x00ed('0x30')][_0x00ed('0x31')],function(_0x353d5f){return{'name':_0x353d5f['fieldName'],'type':_0x353d5f['type'][_0x00ed('0x32')]};});_0x2b1a3e[_0x00ed('0x33')]=_[_0x00ed('0x2f')](_0x4ef307,'name');_0x2b1a3e[_0x00ed('0x34')]=_[_0x00ed('0x35')](_0x23ff89[_0x00ed('0x34')]);_0x2b1a3e['filters']=_['intersection'](_0x2b1a3e['model'],_0x2b1a3e['query']);_0x5b4f4a[_0x00ed('0x36')]=_['intersection'](_0x2b1a3e['model'],qs['fields'](_0x23ff89[_0x00ed('0x34')][_0x00ed('0x37')]));_0x5b4f4a['attributes']=_0x5b4f4a[_0x00ed('0x36')][_0x00ed('0x38')]?_0x5b4f4a['attributes']:_0x2b1a3e['model'];if(!_0x23ff89[_0x00ed('0x34')]['hasOwnProperty'](_0x00ed('0x39'))){_0x5b4f4a[_0x00ed('0x20')]=qs['limit'](_0x23ff89[_0x00ed('0x34')][_0x00ed('0x20')]);_0x5b4f4a[_0x00ed('0x1d')]=qs[_0x00ed('0x1d')](_0x23ff89[_0x00ed('0x34')][_0x00ed('0x1d')]);}_0x5b4f4a[_0x00ed('0x3a')]=qs[_0x00ed('0x3b')](_0x23ff89[_0x00ed('0x34')]['sort']);_0x5b4f4a[_0x00ed('0x3c')]=qs['filters'](_[_0x00ed('0x3d')](_0x23ff89['query'],_0x2b1a3e[_0x00ed('0x3e')]),_0x4ef307);if(_0x23ff89[_0x00ed('0x34')][_0x00ed('0x3f')]){_0x5b4f4a[_0x00ed('0x3c')]=_[_0x00ed('0x40')](_0x5b4f4a[_0x00ed('0x3c')],{'$or':_['map'](_0x4ef307,function(_0x230fb6){if(_0x230fb6[_0x00ed('0x41')]!==_0x00ed('0x42')){var _0x2bdaad={};_0x2bdaad[_0x230fb6[_0x00ed('0x2d')]]={'$like':'%'+_0x23ff89[_0x00ed('0x34')]['filter']+'%'};return _0x2bdaad;}})});}_0x5b4f4a=_[_0x00ed('0x40')]({},_0x5b4f4a,_0x23ff89[_0x00ed('0x43')]);var _0xc705ea={'where':_0x5b4f4a[_0x00ed('0x3c')]};return db['OpenchannelQueue']['count'](_0xc705ea)['then'](function(_0x5b9df0){_0x44565f[_0x00ed('0x1f')]=_0x5b9df0;if(_0x23ff89[_0x00ed('0x34')][_0x00ed('0x44')]){_0x5b4f4a[_0x00ed('0x45')]=[{'all':!![]}];}return db[_0x00ed('0x30')][_0x00ed('0x46')](_0x5b4f4a);})[_0x00ed('0x25')](function(_0x1d06d2){_0x44565f[_0x00ed('0x47')]=_0x1d06d2;return _0x44565f;})[_0x00ed('0x25')](respondWithFilteredResult(_0x1700d5,_0x5b4f4a))[_0x00ed('0x48')](handleError(_0x1700d5,null));};exports[_0x00ed('0x49')]=function(_0x387380,_0x24f5b4){var _0x22bafd={'raw':!![],'where':{'id':_0x387380['params']['id']}},_0x1fb7cf={};_0x1fb7cf[_0x00ed('0x33')]=_['keys'](db[_0x00ed('0x30')]['rawAttributes']);_0x1fb7cf[_0x00ed('0x34')]=_['keys'](_0x387380['query']);_0x1fb7cf[_0x00ed('0x3e')]=_['intersection'](_0x1fb7cf[_0x00ed('0x33')],_0x1fb7cf['query']);_0x22bafd[_0x00ed('0x36')]=_['intersection'](_0x1fb7cf[_0x00ed('0x33')],qs[_0x00ed('0x37')](_0x387380[_0x00ed('0x34')]['fields']));_0x22bafd[_0x00ed('0x36')]=_0x22bafd[_0x00ed('0x36')][_0x00ed('0x38')]?_0x22bafd[_0x00ed('0x36')]:_0x1fb7cf['model'];if(_0x387380['query'][_0x00ed('0x44')]){_0x22bafd[_0x00ed('0x45')]=[{'all':!![]}];}_0x22bafd=_[_0x00ed('0x40')]({},_0x22bafd,_0x387380[_0x00ed('0x43')]);return db[_0x00ed('0x30')][_0x00ed('0x4a')](_0x22bafd)[_0x00ed('0x25')](handleEntityNotFound(_0x24f5b4,null))[_0x00ed('0x25')](respondWithResult(_0x24f5b4,null))[_0x00ed('0x48')](handleError(_0x24f5b4,null));};exports[_0x00ed('0x4b')]=function(_0x60f3eb,_0x2aae43){return db[_0x00ed('0x30')][_0x00ed('0x4b')](_0x60f3eb[_0x00ed('0x4c')],{})[_0x00ed('0x25')](function(_0x3c2bf2){var _0x1795cb=_0x60f3eb[_0x00ed('0x4d')][_0x00ed('0x26')]({'plain':!![]});if(!_0x1795cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1795cb[_0x00ed('0x4e')]==='user'){var _0x421c2c=_0x3c2bf2[_0x00ed('0x26')]({'plain':!![]});var _0x30e89f=_0x00ed('0x27');return db[_0x00ed('0x4f')][_0x00ed('0x4a')]({'where':{'name':_0x30e89f,'userProfileId':_0x1795cb['userProfileId']},'raw':!![]})[_0x00ed('0x25')](function(_0x526aca){if(_0x526aca&&_0x526aca[_0x00ed('0x50')]===0x0){return db[_0x00ed('0x28')][_0x00ed('0x4b')]({'name':_0x421c2c[_0x00ed('0x2d')],'resourceId':_0x421c2c['id'],'type':_0x526aca[_0x00ed('0x2d')],'sectionId':_0x526aca['id']},{})[_0x00ed('0x25')](function(){return _0x3c2bf2;});}else{return _0x3c2bf2;}})[_0x00ed('0x48')](function(_0x580cb6){logger[_0x00ed('0x2b')](_0x00ed('0x51'),_0x580cb6);throw _0x580cb6;});}return _0x3c2bf2;})[_0x00ed('0x25')](respondWithResult(_0x2aae43,0xc9))[_0x00ed('0x48')](handleError(_0x2aae43,null));};exports[_0x00ed('0x52')]=function(_0x1d304d,_0x7f15b6){if(_0x1d304d[_0x00ed('0x4c')]['id']){delete _0x1d304d[_0x00ed('0x4c')]['id'];}return db[_0x00ed('0x30')][_0x00ed('0x4a')]({'where':{'id':_0x1d304d['params']['id']}})[_0x00ed('0x25')](handleEntityNotFound(_0x7f15b6,null))[_0x00ed('0x25')](saveUpdates(_0x1d304d[_0x00ed('0x4c')],null))[_0x00ed('0x25')](respondWithResult(_0x7f15b6,null))[_0x00ed('0x48')](handleError(_0x7f15b6,null));};exports[_0x00ed('0x29')]=function(_0x57e95d,_0x1d69eb){return db[_0x00ed('0x30')][_0x00ed('0x4a')]({'where':{'id':_0x57e95d[_0x00ed('0x53')]['id']}})[_0x00ed('0x25')](handleEntityNotFound(_0x1d69eb,null))['then'](removeEntity(_0x1d69eb,null))[_0x00ed('0x48')](handleError(_0x1d69eb,null));};exports[_0x00ed('0x54')]=function(_0x559c5d,_0x1e296b){return db[_0x00ed('0x30')][_0x00ed('0x54')]()[_0x00ed('0x25')](respondWithResult(_0x1e296b,null))[_0x00ed('0x48')](handleError(_0x1e296b,null));};exports['getMembers']=function(_0x5a63b4,_0x475908,_0x2fb3df){var _0x463093={'raw':!![],'where':{}},_0x2063f7={},_0x2205c3;return db['OpenchannelQueue'][_0x00ed('0x55')]({'where':{'id':_0x5a63b4[_0x00ed('0x53')]['id']}})[_0x00ed('0x25')](handleEntityNotFound(_0x475908,null))[_0x00ed('0x25')](function(_0x4322df){if(_0x4322df){_0x2205c3=_0x4322df[_0x00ed('0x26')]({'plain':!![]});_0x2063f7[_0x00ed('0x33')]=_[_0x00ed('0x35')](db[_0x00ed('0x56')]['rawAttributes']);_0x2063f7[_0x00ed('0x34')]=_[_0x00ed('0x35')](_0x5a63b4[_0x00ed('0x34')]);_0x2063f7[_0x00ed('0x3e')]=_[_0x00ed('0x57')](_0x2063f7[_0x00ed('0x33')],_0x2063f7[_0x00ed('0x34')]);_0x463093[_0x00ed('0x36')]=_[_0x00ed('0x57')](_0x2063f7['model'],qs[_0x00ed('0x37')](_0x5a63b4[_0x00ed('0x34')][_0x00ed('0x37')]));_0x463093['attributes']=_0x463093['attributes'][_0x00ed('0x38')]?_0x463093[_0x00ed('0x36')]:_0x2063f7[_0x00ed('0x33')];if(!_0x5a63b4[_0x00ed('0x34')][_0x00ed('0x58')](_0x00ed('0x39'))){_0x463093[_0x00ed('0x20')]=qs[_0x00ed('0x20')](_0x5a63b4[_0x00ed('0x34')][_0x00ed('0x20')]);_0x463093[_0x00ed('0x1d')]=qs[_0x00ed('0x1d')](_0x5a63b4['query'][_0x00ed('0x1d')]);}_0x463093[_0x00ed('0x3a')]=qs['sort'](_0x5a63b4['query']['sort']);_0x463093[_0x00ed('0x3c')]=qs['filters'](_['pick'](_0x5a63b4['query'],_0x2063f7[_0x00ed('0x3e')]));_0x463093['where']['OpenchannelQueueId']=_0x4322df['id'];if(_0x5a63b4['query'][_0x00ed('0x3f')]){_0x463093[_0x00ed('0x3c')]=_[_0x00ed('0x40')](_0x463093[_0x00ed('0x3c')],{'$or':_[_0x00ed('0x2f')](_0x463093[_0x00ed('0x36')],function(_0x21f830){var _0x5a0232={};_0x5a0232[_0x21f830]={'$like':'%'+_0x5a63b4[_0x00ed('0x34')][_0x00ed('0x3f')]+'%'};return _0x5a0232;})});}_0x463093=_['merge']({},_0x463093,_0x5a63b4[_0x00ed('0x43')]);return db['UserOpenchannelQueue'][_0x00ed('0x46')](_0x463093);}})[_0x00ed('0x25')](function(_0x472f5c){if(_0x472f5c){return db[_0x00ed('0x59')]['findAndCountAll']({'where':{'id':_[_0x00ed('0x2f')](_0x472f5c,'UserId'),'role':'agent'},'attributes':['id','name',_0x00ed('0x5a'),_0x00ed('0x5b'),_0x00ed('0x5c')]});}})[_0x00ed('0x25')](function(_0xa7163f){if(_0xa7163f){return{'count':_0xa7163f[_0x00ed('0x1f')],'rows':_[_0x00ed('0x2f')](_0xa7163f['rows'],function(_0x3d974a){return{'membername':_0x3d974a[_0x00ed('0x2d')],'UserId':_0x3d974a['id'],'queue_name':_0x2205c3[_0x00ed('0x2d')],'OpenchannelQueueId':_0x2205c3['id'],'interface':util[_0x00ed('0x5d')](_0x00ed('0x5e'),_0x00ed('0x5f'),_0x3d974a[_0x00ed('0x2d')]),'penalty':0x0,'paused':_0x3d974a[_0x00ed('0x5a')],'createdAt':_0x3d974a[_0x00ed('0x5c')],'updatedAt':_0x3d974a[_0x00ed('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x475908,_0x463093))['catch'](handleError(_0x475908,null));};exports['getTeams']=function(_0x6314ec,_0x56c31a,_0xb203ec){var _0x5b9f1b={};var _0x5ac5f6={};var _0x5e79b5;var _0x282907;return db[_0x00ed('0x30')]['findOne']({'where':{'id':_0x6314ec[_0x00ed('0x53')]['id']}})[_0x00ed('0x25')](handleEntityNotFound(_0x56c31a,null))[_0x00ed('0x25')](function(_0x4bb4f6){if(_0x4bb4f6){_0x5e79b5=_0x4bb4f6;_0x5ac5f6['model']=_[_0x00ed('0x35')](db[_0x00ed('0x60')][_0x00ed('0x31')]);_0x5ac5f6[_0x00ed('0x34')]=_[_0x00ed('0x35')](_0x6314ec['query']);_0x5ac5f6[_0x00ed('0x3e')]=_[_0x00ed('0x57')](_0x5ac5f6[_0x00ed('0x33')],_0x5ac5f6['query']);_0x5b9f1b[_0x00ed('0x36')]=_[_0x00ed('0x57')](_0x5ac5f6[_0x00ed('0x33')],qs['fields'](_0x6314ec[_0x00ed('0x34')][_0x00ed('0x37')]));_0x5b9f1b[_0x00ed('0x36')]=_0x5b9f1b[_0x00ed('0x36')][_0x00ed('0x38')]?_0x5b9f1b[_0x00ed('0x36')]:_0x5ac5f6[_0x00ed('0x33')];_0x5b9f1b[_0x00ed('0x3a')]=qs['sort'](_0x6314ec[_0x00ed('0x34')][_0x00ed('0x3b')]);_0x5b9f1b[_0x00ed('0x3c')]=qs[_0x00ed('0x3e')](_['pick'](_0x6314ec['query'],_0x5ac5f6[_0x00ed('0x3e')]));if(_0x6314ec[_0x00ed('0x34')][_0x00ed('0x3f')]){_0x5b9f1b[_0x00ed('0x3c')]=_[_0x00ed('0x40')](_0x5b9f1b[_0x00ed('0x3c')],{'$or':_[_0x00ed('0x2f')](_0x5b9f1b[_0x00ed('0x36')],function(_0x507e7e){var _0x4b7938={};_0x4b7938[_0x507e7e]={'$like':'%'+_0x6314ec['query'][_0x00ed('0x3f')]+'%'};return _0x4b7938;})});}_0x5b9f1b=_['merge']({},_0x5b9f1b,_0x6314ec[_0x00ed('0x43')]);return _0x5e79b5[_0x00ed('0x61')](_0x5b9f1b);}})[_0x00ed('0x25')](function(_0x2a1e88){if(_0x2a1e88){_0x282907=_0x2a1e88['length'];if(!_0x6314ec[_0x00ed('0x34')][_0x00ed('0x58')](_0x00ed('0x39'))){_0x5b9f1b[_0x00ed('0x20')]=qs[_0x00ed('0x20')](_0x6314ec['query'][_0x00ed('0x20')]);_0x5b9f1b[_0x00ed('0x1d')]=qs[_0x00ed('0x1d')](_0x6314ec['query'][_0x00ed('0x1d')]);}return _0x5e79b5['getTeams'](_0x5b9f1b);}})[_0x00ed('0x25')](function(_0x51bc03){if(_0x51bc03){return _0x51bc03?{'count':_0x282907,'rows':_0x51bc03}:null;}})[_0x00ed('0x25')](respondWithResult(_0x56c31a,null))[_0x00ed('0x48')](handleError(_0x56c31a,null));};exports[_0x00ed('0x62')]=function(_0x3ad5ff,_0x1bf053,_0x3565b3){var _0x34fdd8=_0x3ad5ff['body'][_0x00ed('0x63')];return db[_0x00ed('0x60')][_0x00ed('0x46')]({'where':{'id':_0x34fdd8},'attributes':['id'],'include':[{'model':db[_0x00ed('0x59')],'as':_0x00ed('0x64'),'attributes':['id','name',_0x00ed('0x65'),_0x00ed('0x66'),'interface'],'raw':!![]}]})[_0x00ed('0x25')](function(_0x5391d4){if(_0x5391d4){var _0x412d1e=_['flatMap'](_0x5391d4,function(_0x4b2916){var _0xfd7cd0=_0x4b2916[_0x00ed('0x26')]({'plain':!![]});return _0xfd7cd0['Agents'];});return db[_0x00ed('0x30')]['find']({'where':{'id':_0x3ad5ff[_0x00ed('0x53')]['id']}})[_0x00ed('0x25')](function(_0x5bbea2){return db[_0x00ed('0x67')][_0x00ed('0x68')](function(_0x1a8448){return _0x5bbea2[_0x00ed('0x62')](_0x34fdd8,{'transaction':_0x1a8448})[_0x00ed('0x25')](function(){return BPromise[_0x00ed('0x69')](_0x412d1e,function(_0x273860){return db[_0x00ed('0x56')][_0x00ed('0x6a')]({'where':{'UserId':_0x273860['id'],'OpenchannelQueueId':_0x3ad5ff[_0x00ed('0x53')]['id']},'transaction':_0x1a8448});});})[_0x00ed('0x25')](function(){_0x412d1e[_0x00ed('0x6b')](function(_0x4bd242){socket[_0x00ed('0x6c')](_0x00ed('0x6d'),{'UserId':_0x4bd242['id'],'OpenchannelQueueId':_0x5bbea2['id']});});});});});}})[_0x00ed('0x25')](respondWithStatusCode(_0x1bf053,null))[_0x00ed('0x48')](handleError(_0x1bf053,null));};exports[_0x00ed('0x6e')]=function(_0x19b021,_0x3556ea,_0x2efecb){return db['Team']['findAll']({'where':{'id':_0x19b021[_0x00ed('0x34')][_0x00ed('0x63')]},'attributes':['id'],'include':[{'model':db[_0x00ed('0x59')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x00ed('0x25')](handleEntityNotFound(_0x3556ea,null))[_0x00ed('0x25')](function(_0x37ca7d){var _0x31470e=_[_0x00ed('0x2f')](_0x37ca7d,'id');var _0x1a1300=[];var _0x48d7e9=[];var _0x12a118=squel[_0x00ed('0x6f')]();_0x12a118[_0x00ed('0x70')](_0x00ed('0x71'))[_0x00ed('0x72')]('team_has_openchannel_queues','tq')[_0x00ed('0x73')](_0x00ed('0x74'),'ut',_0x00ed('0x75'))['where'](_0x00ed('0x76'),_0x19b021[_0x00ed('0x53')]['id']);for(var _0x40df02=0x0;_0x40df02<_0x37ca7d[_0x00ed('0x38')];_0x40df02+=0x1){let _0x57109c=_0x37ca7d[_0x40df02];for(var _0x585bb5=0x0;_0x585bb5<_0x57109c['Agents']['length'];_0x585bb5+=0x1){let _0x9ae13b=_0x57109c[_0x00ed('0x64')][_0x585bb5];var _0x4f9eac=_0x12a118['clone']();_0x4f9eac['where'](_0x00ed('0x77'),_0x9ae13b['id']);_0x48d7e9[_0x00ed('0x78')](db[_0x00ed('0x67')][_0x00ed('0x34')](_0x4f9eac[_0x00ed('0x79')](),{'type':db['sequelize'][_0x00ed('0x7a')]['SELECT']})[_0x00ed('0x25')](function(_0x21e8bc){if(_0x21e8bc['length']===0x1){return _0x9ae13b['id'];}else{var _0x51bd69=_[_0x00ed('0x7b')](_[_0x00ed('0x2f')](_0x21e8bc,_0x00ed('0x7c')),function(_0x2ebe14){return _[_0x00ed('0x7d')](_0x31470e,_0x2ebe14);});if(_0x51bd69){return _0x9ae13b['id'];}}}));}}return BPromise[_0x00ed('0x7e')](_0x48d7e9)[_0x00ed('0x25')](function(_0x1ace21){_0x1a1300=_(_0x1a1300)[_0x00ed('0x7f')](_0x1ace21)['compact']()[_0x00ed('0x80')]();return db[_0x00ed('0x30')][_0x00ed('0x4a')]({'where':{'id':_0x19b021[_0x00ed('0x53')]['id']}})[_0x00ed('0x25')](function(_0x2cdd7a){return db[_0x00ed('0x67')]['transaction'](function(_0x343176){return _0x2cdd7a['removeTeams'](_0x19b021['query'][_0x00ed('0x63')],{'transaction':_0x343176})[_0x00ed('0x25')](function(){if(!_[_0x00ed('0x81')](_0x1a1300)){return _0x2cdd7a['removeAgents'](_0x1a1300,{'transaction':_0x343176});}})[_0x00ed('0x25')](function(){_0x1a1300['forEach'](function(_0x244765){socket[_0x00ed('0x6c')]('userOpenchannelQueue:remove',{'UserId':_0x244765,'OpenchannelQueueId':_0x2cdd7a['id']});});});});});});})[_0x00ed('0x25')](respondWithStatusCode(_0x3556ea,null))[_0x00ed('0x48')](handleError(_0x3556ea,null));};exports['addAgents']=function(_0x2708e7,_0x48c50f,_0x141dad){return db['OpenchannelQueue'][_0x00ed('0x4a')]({'where':{'id':_0x2708e7[_0x00ed('0x53')]['id']}})[_0x00ed('0x25')](handleEntityNotFound(_0x48c50f,null))[_0x00ed('0x25')](function(_0x34cab8){if(_0x34cab8){return _0x34cab8[_0x00ed('0x82')](_0x2708e7[_0x00ed('0x4c')][_0x00ed('0x63')],_[_0x00ed('0x83')](_0x2708e7[_0x00ed('0x4c')],[_0x00ed('0x63'),'id'])||{})[_0x00ed('0x84')](function(_0x384d35){for(var _0xf6f1bf=0x0;_0xf6f1bf<_0x2708e7[_0x00ed('0x4c')][_0x00ed('0x63')][_0x00ed('0x38')];_0xf6f1bf+=0x1){socket['emit'](_0x00ed('0x6d'),{'UserId':Number(_0x2708e7[_0x00ed('0x4c')][_0x00ed('0x63')][_0xf6f1bf]),'OpenchannelQueueId':Number(_0x2708e7[_0x00ed('0x53')]['id'])});}return _0x384d35;});}})['then'](respondWithResult(_0x48c50f,null))[_0x00ed('0x48')](handleError(_0x48c50f,null));};exports['removeAgents']=function(_0x24d269,_0x328b8e,_0x451f8f){return db['OpenchannelQueue'][_0x00ed('0x4a')]({'where':{'id':_0x24d269[_0x00ed('0x53')]['id']}})[_0x00ed('0x25')](handleEntityNotFound(_0x328b8e,null))[_0x00ed('0x25')](function(_0x37180d){if(_0x37180d){return _0x37180d[_0x00ed('0x85')](_0x24d269[_0x00ed('0x34')][_0x00ed('0x63')])[_0x00ed('0x25')](function(){if(_[_0x00ed('0x86')](_0x24d269[_0x00ed('0x34')][_0x00ed('0x63')])){for(var _0x56796d=0x0;_0x56796d<_0x24d269[_0x00ed('0x34')][_0x00ed('0x63')][_0x00ed('0x38')];_0x56796d+=0x1){socket[_0x00ed('0x6c')]('userOpenchannelQueue:remove',{'UserId':Number(_0x24d269['query'][_0x00ed('0x63')][_0x56796d]),'OpenchannelQueueId':Number(_0x24d269[_0x00ed('0x53')]['id'])});}}else{socket[_0x00ed('0x6c')]('userOpenchannelQueue:remove',{'UserId':Number(_0x24d269[_0x00ed('0x34')][_0x00ed('0x63')]),'OpenchannelQueueId':Number(_0x24d269[_0x00ed('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x328b8e,null))[_0x00ed('0x48')](handleError(_0x328b8e,null));};exports[_0x00ed('0x87')]=function(_0x20685d,_0x517615,_0x1d0f8e){var _0x2e8d5c={};var _0x3aa02b={};var _0x47bd30;var _0x208640;return db[_0x00ed('0x30')][_0x00ed('0x55')]({'where':{'id':_0x20685d['params']['id']}})[_0x00ed('0x25')](handleEntityNotFound(_0x517615,null))[_0x00ed('0x25')](function(_0x1b2440){if(_0x1b2440){_0x47bd30=_0x1b2440;_0x3aa02b[_0x00ed('0x33')]=_['keys'](db[_0x00ed('0x59')][_0x00ed('0x31')]);_0x3aa02b[_0x00ed('0x34')]=_['keys'](_0x20685d[_0x00ed('0x34')]);_0x3aa02b[_0x00ed('0x3e')]=_[_0x00ed('0x57')](_0x3aa02b[_0x00ed('0x33')],_0x3aa02b[_0x00ed('0x34')]);_0x2e8d5c[_0x00ed('0x36')]=_[_0x00ed('0x57')](_0x3aa02b[_0x00ed('0x33')],qs['fields'](_0x20685d['query'][_0x00ed('0x37')]));_0x2e8d5c[_0x00ed('0x36')]=_0x2e8d5c[_0x00ed('0x36')]['length']?_0x2e8d5c[_0x00ed('0x36')]:_0x3aa02b['model'];_0x2e8d5c['order']=qs['sort'](_0x20685d[_0x00ed('0x34')][_0x00ed('0x3b')]);_0x2e8d5c[_0x00ed('0x3c')]=qs['filters'](_['pick'](_0x20685d['query'],_0x3aa02b[_0x00ed('0x3e')]));if(_0x20685d[_0x00ed('0x34')]['filter']){_0x2e8d5c[_0x00ed('0x3c')]=_[_0x00ed('0x40')](_0x2e8d5c['where'],{'$or':_[_0x00ed('0x2f')](_0x2e8d5c[_0x00ed('0x36')],function(_0x2125aa){var _0x6d2800={};_0x6d2800[_0x2125aa]={'$like':'%'+_0x20685d[_0x00ed('0x34')][_0x00ed('0x3f')]+'%'};return _0x6d2800;})});}_0x2e8d5c=_[_0x00ed('0x40')]({},_0x2e8d5c,_0x20685d[_0x00ed('0x43')]);return _0x47bd30[_0x00ed('0x87')](_0x2e8d5c);}})['then'](function(_0x390e36){if(_0x390e36){_0x208640=_0x390e36[_0x00ed('0x38')];if(!_0x20685d['query'][_0x00ed('0x58')](_0x00ed('0x39'))){_0x2e8d5c[_0x00ed('0x20')]=qs[_0x00ed('0x20')](_0x20685d[_0x00ed('0x34')]['limit']);_0x2e8d5c['offset']=qs[_0x00ed('0x1d')](_0x20685d[_0x00ed('0x34')][_0x00ed('0x1d')]);}return _0x47bd30[_0x00ed('0x87')](_0x2e8d5c);}})[_0x00ed('0x25')](function(_0x2de668){if(_0x2de668){return _0x2de668?{'count':_0x208640,'rows':_0x2de668}:null;}})[_0x00ed('0x25')](respondWithResult(_0x517615,null))[_0x00ed('0x48')](handleError(_0x517615,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index d7a3536..86371e4 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 _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 +var _0x74c9=['setMaxListeners','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x5e8c32,_0x1b1f3f){var _0x595f7b=function(_0x38840e){while(--_0x38840e){_0x5e8c32['push'](_0x5e8c32['shift']());}};_0x595f7b(++_0x1b1f3f);}(_0x74c9,0xd0));var _0x974c=function(_0x48ab48,_0x2f99d1){_0x48ab48=_0x48ab48-0x0;var _0x5e8487=_0x74c9[_0x48ab48];return _0x5e8487;};'use strict';var EventEmitter=require(_0x974c('0x0'));var OpenchannelQueue=require(_0x974c('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x974c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x974c('0x3')};function emitEvent(_0x19d64d){return function(_0x48cd3c,_0x3c63d0,_0x466553){OpenchannelQueueEvents[_0x974c('0x4')](_0x19d64d+':'+_0x48cd3c['id'],_0x48cd3c);OpenchannelQueueEvents[_0x974c('0x4')](_0x19d64d,_0x48cd3c);_0x466553(null);};}for(var e in events){if(events[_0x974c('0x5')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x974c('0x6')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 36abc94..61cec07 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 _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 +var _0x9d69=['OpenchannelQueue','openchannel_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0x9d69,0x17c));var _0x99d6=function(_0x218c29,_0x1f7753){_0x218c29=_0x218c29-0x0;var _0x9cfde1=_0x9d69[_0x218c29];return _0x9cfde1;};'use strict';var _=require(_0x99d6('0x0'));var util=require(_0x99d6('0x1'));var logger=require('../../config/logger')(_0x99d6('0x2'));var moment=require(_0x99d6('0x3'));var BPromise=require(_0x99d6('0x4'));var rp=require(_0x99d6('0x5'));var fs=require('fs');var path=require(_0x99d6('0x6'));var rimraf=require(_0x99d6('0x7'));var config=require(_0x99d6('0x8'));var attributes=require(_0x99d6('0x9'));module[_0x99d6('0xa')]=function(_0x2d0154,_0x323245){return _0x2d0154[_0x99d6('0xb')](_0x99d6('0xc'),attributes,{'tableName':_0x99d6('0xd'),'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 a0eca8c..a33fbdf 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 _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 +var _0x9e69=['where','limit','map','include','model','attributes','then','info','stringify','ShowOpenchannelQueue','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','defaults','redis','socket.io-emitter','register','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x9e69,0x14f));var _0x99e6=function(_0x140a98,_0x43ddbc){_0x140a98=_0x140a98-0x0;var _0x244079=_0x9e69[_0x140a98];return _0x244079;};'use strict';var _=require(_0x99e6('0x0'));var util=require(_0x99e6('0x1'));var moment=require(_0x99e6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99e6('0x3'));var db=require(_0x99e6('0x4'))['db'];var utils=require(_0x99e6('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x99e6('0x6'));var jayson=require(_0x99e6('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x99e6('0x8')](config[_0x99e6('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x99e6('0xa'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x99e6('0xb')](socket);function respondWithRpcPromise(_0x233934,_0x2567e9,_0x2fbb14){return new BPromise(function(_0x2e0114,_0x1123c2){return client['request'](_0x233934,_0x2fbb14)['then'](function(_0x23d260){logger['info'](_0x99e6('0xc'),_0x2567e9,_0x99e6('0xd'));logger[_0x99e6('0xe')](_0x99e6('0xf'),_0x2567e9,_0x99e6('0xd'),JSON['stringify'](_0x23d260));if(_0x23d260[_0x99e6('0x10')]){if(_0x23d260[_0x99e6('0x10')][_0x99e6('0x11')]===0x1f4){logger[_0x99e6('0x10')](_0x99e6('0xc'),_0x2567e9,_0x23d260['error']['message']);return _0x1123c2(_0x23d260[_0x99e6('0x10')]['message']);}logger['error'](_0x99e6('0xc'),_0x2567e9,_0x23d260[_0x99e6('0x10')][_0x99e6('0x12')]);return _0x2e0114(_0x23d260[_0x99e6('0x10')]['message']);}else{logger['info'](_0x99e6('0xc'),_0x2567e9,'request\x20sent');_0x2e0114(_0x23d260[_0x99e6('0x13')][_0x99e6('0x12')]);}})[_0x99e6('0x14')](function(_0x8e2873){logger['error'](_0x99e6('0xc'),_0x2567e9,_0x8e2873);_0x1123c2(_0x8e2873);});});}exports[_0x99e6('0x15')]=function(_0x3b3741){var _0xe171d3=this;return new Promise(function(_0xaae87b,_0x353d9b){return db[_0x99e6('0x16')][_0x99e6('0x17')]({'raw':_0x3b3741[_0x99e6('0x18')]?_0x3b3741[_0x99e6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3b3741[_0x99e6('0x18')]?_0x3b3741[_0x99e6('0x18')][_0x99e6('0x19')]||null:null,'attributes':_0x3b3741[_0x99e6('0x18')]?_0x3b3741[_0x99e6('0x18')]['attributes']||null:null,'limit':_0x3b3741[_0x99e6('0x18')]?_0x3b3741[_0x99e6('0x18')][_0x99e6('0x1a')]||null:null,'include':_0x3b3741[_0x99e6('0x18')]?_0x3b3741['options']['include']?_[_0x99e6('0x1b')](_0x3b3741['options'][_0x99e6('0x1c')],function(_0x508938){return{'model':db[_0x508938[_0x99e6('0x1d')]],'as':_0x508938['as'],'attributes':_0x508938[_0x99e6('0x1e')],'include':_0x508938['include']?_[_0x99e6('0x1b')](_0x508938[_0x99e6('0x1c')],function(_0x25e547){return{'model':db[_0x25e547['model']],'as':_0x25e547['as'],'attributes':_0x25e547[_0x99e6('0x1e')],'include':_0x25e547[_0x99e6('0x1c')]?_[_0x99e6('0x1b')](_0x25e547[_0x99e6('0x1c')],function(_0x18dfba){return{'model':db[_0x18dfba[_0x99e6('0x1d')]],'as':_0x18dfba['as'],'attributes':_0x18dfba[_0x99e6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x99e6('0x1f')](function(_0x4d5585){logger[_0x99e6('0x20')](_0x99e6('0x15'),_0x3b3741);logger['debug'](_0x99e6('0x15'),_0x3b3741,JSON[_0x99e6('0x21')](_0x4d5585));_0xaae87b(_0x4d5585);})[_0x99e6('0x14')](function(_0x2eb3af){logger[_0x99e6('0x10')](_0x99e6('0x15'),_0x2eb3af['message'],_0x3b3741);_0x353d9b(_0xe171d3[_0x99e6('0x10')](0x1f4,_0x2eb3af[_0x99e6('0x12')]));});});};exports[_0x99e6('0x22')]=function(_0x41eb24){var _0x3ff1fb=this;return new Promise(function(_0x55d98c,_0x3da0e8){return db[_0x99e6('0x16')][_0x99e6('0x23')]({'raw':_0x41eb24[_0x99e6('0x18')]?_0x41eb24[_0x99e6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x41eb24[_0x99e6('0x18')]?_0x41eb24[_0x99e6('0x18')]['where']||null:null,'attributes':_0x41eb24['options']?_0x41eb24['options'][_0x99e6('0x1e')]||null:null,'include':_0x41eb24[_0x99e6('0x18')]?_0x41eb24[_0x99e6('0x18')][_0x99e6('0x1c')]?_[_0x99e6('0x1b')](_0x41eb24[_0x99e6('0x18')][_0x99e6('0x1c')],function(_0x1a5d27){return{'model':db[_0x1a5d27[_0x99e6('0x1d')]],'as':_0x1a5d27['as'],'attributes':_0x1a5d27[_0x99e6('0x1e')],'include':_0x1a5d27[_0x99e6('0x1c')]?_[_0x99e6('0x1b')](_0x1a5d27[_0x99e6('0x1c')],function(_0x1ebd2c){return{'model':db[_0x1ebd2c[_0x99e6('0x1d')]],'as':_0x1ebd2c['as'],'attributes':_0x1ebd2c[_0x99e6('0x1e')],'include':_0x1ebd2c[_0x99e6('0x1c')]?_[_0x99e6('0x1b')](_0x1ebd2c[_0x99e6('0x1c')],function(_0x4702cf){return{'model':db[_0x4702cf['model']],'as':_0x4702cf['as'],'attributes':_0x4702cf[_0x99e6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x99e6('0x1f')](function(_0x263e23){logger[_0x99e6('0x20')]('ShowOpenchannelQueue',_0x41eb24);logger[_0x99e6('0xe')](_0x99e6('0x22'),_0x41eb24,JSON[_0x99e6('0x21')](_0x263e23));_0x55d98c(_0x263e23);})[_0x99e6('0x14')](function(_0x176722){logger['error']('ShowOpenchannelQueue',_0x176722['message'],_0x41eb24);_0x3da0e8(_0x3ff1fb['error'](0x1f4,_0x176722['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 49de90a..e890beb 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 _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 +var _0xb4da=['remove','update','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x4caf11,_0x5c9031){var _0x11b295=function(_0x1fdb87){while(--_0x1fdb87){_0x4caf11['push'](_0x4caf11['shift']());}};_0x11b295(++_0x5c9031);}(_0xb4da,0xb2));var _0xab4d=function(_0x159c5d,_0x2ab9d7){_0x159c5d=_0x159c5d-0x0;var _0x148953=_0xb4da[_0x159c5d];return _0x148953;};'use strict';var OpenchannelQueueEvents=require(_0xab4d('0x0'));var events=[_0xab4d('0x1'),_0xab4d('0x2'),_0xab4d('0x3')];function createListener(_0x1e4281,_0x10e2ae){return function(_0xd8613a){_0x10e2ae[_0xab4d('0x4')](_0x1e4281,_0xd8613a);};}function removeListener(_0x577fa7,_0x36e3b3){return function(){OpenchannelQueueEvents[_0xab4d('0x5')](_0x577fa7,_0x36e3b3);};}exports[_0xab4d('0x6')]=function(_0x3e03f2){for(var _0x5cac48=0x0,_0x5e16cb=events[_0xab4d('0x7')];_0x5cac48<_0x5e16cb;_0x5cac48++){var _0x3586fd=events[_0x5cac48];var _0x28b810=createListener(_0xab4d('0x8')+_0x3586fd,_0x3e03f2);OpenchannelQueueEvents['on'](_0x3586fd,_0x28b810);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index debe1c5..7c5ca52 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 _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 +var _0x0e33=['./openchannelQueueReport.controller','get','/describe','describe','post','isAuthenticated','create','/:id','update','delete','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x21353c,_0x2ea587){var _0xa99120=function(_0x557f33){while(--_0x557f33){_0x21353c['push'](_0x21353c['shift']());}};_0xa99120(++_0x2ea587);}(_0x0e33,0xe3));var _0x30e3=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0e33[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x30e3('0x0'));var util=require('util');var path=require(_0x30e3('0x1'));var timeout=require('connect-timeout');var express=require(_0x30e3('0x2'));var router=express[_0x30e3('0x3')]();var fs_extra=require(_0x30e3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x30e3('0x5'));var config=require(_0x30e3('0x6'));var controller=require(_0x30e3('0x7'));router[_0x30e3('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x30e3('0x8')](_0x30e3('0x9'),auth['isAuthenticated'](),controller[_0x30e3('0xa')]);router[_0x30e3('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x30e3('0xb')]('/',auth[_0x30e3('0xc')](),controller[_0x30e3('0xd')]);router['put'](_0x30e3('0xe'),auth[_0x30e3('0xc')](),controller[_0x30e3('0xf')]);router[_0x30e3('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x30e3('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 3fd12f9..d58255f 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 _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 +var _0xfd02=['DATE','moment','exports','STRING'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0xfd02,0xbd));var _0x2fd0=function(_0x8fa4bc,_0x5cd2af){_0x8fa4bc=_0x8fa4bc-0x0;var _0x35b6a7=_0xfd02[_0x8fa4bc];return _0x35b6a7;};'use strict';var moment=require(_0x2fd0('0x0'));var Sequelize=require('sequelize');module[_0x2fd0('0x1')]={'uniqueid':{'type':Sequelize[_0x2fd0('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2fd0('0x2')]},'joinAt':{'type':Sequelize[_0x2fd0('0x3')]},'leaveAt':{'type':Sequelize[_0x2fd0('0x3')]},'acceptAt':{'type':Sequelize[_0x2fd0('0x3')]},'exitAt':{'type':Sequelize[_0x2fd0('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index e7d8825..6b661c2 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 _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 +var _0xde41=['query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','findAll','catch','show','length','include','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','model','keys'];(function(_0x535963,_0x326515){var _0x3975f6=function(_0x2e624f){while(--_0x2e624f){_0x535963['push'](_0x535963['shift']());}};_0x3975f6(++_0x326515);}(_0xde41,0x1d9));var _0x1de4=function(_0x36c383,_0x1f54f9){_0x36c383=_0x36c383-0x0;var _0x54388b=_0xde41[_0x36c383];return _0x54388b;};'use strict';var emlformat=require(_0x1de4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1de4('0x1'));var jsonpatch=require(_0x1de4('0x2'));var rp=require(_0x1de4('0x3'));var moment=require(_0x1de4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1de4('0x5'));var util=require(_0x1de4('0x6'));var path=require(_0x1de4('0x7'));var sox=require('sox');var csv=require(_0x1de4('0x8'));var ejs=require(_0x1de4('0x9'));var fs=require('fs');var fs_extra=require(_0x1de4('0xa'));var _=require(_0x1de4('0xb'));var squel=require('squel');var crypto=require(_0x1de4('0xc'));var jsforce=require(_0x1de4('0xd'));var deskjs=require(_0x1de4('0xe'));var toCsv=require(_0x1de4('0x8'));var querystring=require(_0x1de4('0xf'));var Papa=require('papaparse');var Redis=require(_0x1de4('0x10'));var authService=require(_0x1de4('0x11'));var qs=require(_0x1de4('0x12'));var as=require(_0x1de4('0x13'));var hardwareService=require(_0x1de4('0x14'));var logger=require(_0x1de4('0x15'))(_0x1de4('0x16'));var utils=require(_0x1de4('0x17'));var config=require(_0x1de4('0x18'));var licenseUtil=require(_0x1de4('0x19'));var db=require(_0x1de4('0x1a'))['db'];function respondWithStatusCode(_0x2501cd,_0x5d9762){_0x5d9762=_0x5d9762||0xcc;return function(_0x18f525){if(_0x18f525){return _0x2501cd[_0x1de4('0x1b')](_0x5d9762);}return _0x2501cd['status'](_0x5d9762)['end']();};}function respondWithResult(_0xb4659d,_0x1c5799){_0x1c5799=_0x1c5799||0xc8;return function(_0x4c5255){if(_0x4c5255){return _0xb4659d[_0x1de4('0x1c')](_0x1c5799)['json'](_0x4c5255);}};}function respondWithFilteredResult(_0x2ca224,_0xd88228){return function(_0x115bb4){if(_0x115bb4){var _0x322521=typeof _0xd88228[_0x1de4('0x1d')]===_0x1de4('0x1e')&&typeof _0xd88228[_0x1de4('0x1f')]===_0x1de4('0x1e');var _0xd0155b=_0x115bb4[_0x1de4('0x20')];var _0x398fb7=_0x322521?0x0:_0xd88228[_0x1de4('0x1d')];var _0x493b17=_0x322521?_0x115bb4['count']:_0xd88228[_0x1de4('0x1d')]+_0xd88228[_0x1de4('0x1f')];var _0x5acec4;if(_0x493b17>=_0xd0155b){_0x493b17=_0xd0155b;_0x5acec4=0xc8;}else{_0x5acec4=0xce;}_0x2ca224[_0x1de4('0x1c')](_0x5acec4);return _0x2ca224[_0x1de4('0x21')](_0x1de4('0x22'),_0x398fb7+'-'+_0x493b17+'/'+_0xd0155b)[_0x1de4('0x23')](_0x115bb4);}return null;};}function patchUpdates(_0x46824a){return function(_0x48970d){try{jsonpatch[_0x1de4('0x24')](_0x48970d,_0x46824a,!![]);}catch(_0x188bd6){return BPromise['reject'](_0x188bd6);}return _0x48970d[_0x1de4('0x25')]();};}function saveUpdates(_0x153439,_0x179926){return function(_0x9e6852){if(_0x9e6852){return _0x9e6852[_0x1de4('0x26')](_0x153439)[_0x1de4('0x27')](function(_0x5cbb16){return _0x5cbb16;});}return null;};}function removeEntity(_0x4c42cb,_0x107df7){return function(_0x3f6c75){if(_0x3f6c75){return _0x3f6c75[_0x1de4('0x28')]()[_0x1de4('0x27')](function(){_0x4c42cb[_0x1de4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29556a,_0x16fb1a){return function(_0x4a320d){if(!_0x4a320d){_0x29556a['sendStatus'](0x194);}return _0x4a320d;};}function handleError(_0x5ec534,_0x2cb9ad){_0x2cb9ad=_0x2cb9ad||0x1f4;return function(_0x129993){logger['error'](_0x129993[_0x1de4('0x29')]);if(_0x129993['name']){delete _0x129993[_0x1de4('0x2a')];}_0x5ec534['status'](_0x2cb9ad)[_0x1de4('0x2b')](_0x129993);};}exports[_0x1de4('0x2c')]=function(_0x200de6,_0x2ea6a1){var _0x24f140={},_0x5a6803={},_0x43aabb={'count':0x0,'rows':[]};var _0xb4f90e=_[_0x1de4('0x2d')](db[_0x1de4('0x2e')][_0x1de4('0x2f')],function(_0xd74c72){return{'name':_0xd74c72[_0x1de4('0x30')],'type':_0xd74c72[_0x1de4('0x31')]['key']};});_0x5a6803[_0x1de4('0x32')]=_['map'](_0xb4f90e,_0x1de4('0x2a'));_0x5a6803['query']=_[_0x1de4('0x33')](_0x200de6[_0x1de4('0x34')]);_0x5a6803[_0x1de4('0x35')]=_[_0x1de4('0x36')](_0x5a6803['model'],_0x5a6803['query']);_0x24f140[_0x1de4('0x37')]=_['intersection'](_0x5a6803[_0x1de4('0x32')],qs[_0x1de4('0x38')](_0x200de6['query']['fields']));_0x24f140[_0x1de4('0x37')]=_0x24f140[_0x1de4('0x37')]['length']?_0x24f140['attributes']:_0x5a6803[_0x1de4('0x32')];if(!_0x200de6[_0x1de4('0x34')][_0x1de4('0x39')]('nolimit')){_0x24f140[_0x1de4('0x1f')]=qs['limit'](_0x200de6[_0x1de4('0x34')][_0x1de4('0x1f')]);_0x24f140[_0x1de4('0x1d')]=qs[_0x1de4('0x1d')](_0x200de6[_0x1de4('0x34')][_0x1de4('0x1d')]);}_0x24f140[_0x1de4('0x3a')]=qs['sort'](_0x200de6[_0x1de4('0x34')][_0x1de4('0x3b')]);_0x24f140['where']=qs[_0x1de4('0x35')](_['pick'](_0x200de6[_0x1de4('0x34')],_0x5a6803[_0x1de4('0x35')]),_0xb4f90e);if(_0x200de6['query'][_0x1de4('0x3c')]){_0x24f140[_0x1de4('0x3d')]=_[_0x1de4('0x3e')](_0x24f140[_0x1de4('0x3d')],{'$or':_['map'](_0xb4f90e,function(_0x2e57aa){if(_0x2e57aa[_0x1de4('0x31')]!==_0x1de4('0x3f')){var _0x2d348e={};_0x2d348e[_0x2e57aa[_0x1de4('0x2a')]]={'$like':'%'+_0x200de6[_0x1de4('0x34')][_0x1de4('0x3c')]+'%'};return _0x2d348e;}})});}_0x24f140=_['merge']({},_0x24f140,_0x200de6[_0x1de4('0x40')]);var _0x423ab1={'where':_0x24f140[_0x1de4('0x3d')]};return db['OpenchannelQueueReport'][_0x1de4('0x20')](_0x423ab1)[_0x1de4('0x27')](function(_0x5e3667){_0x43aabb[_0x1de4('0x20')]=_0x5e3667;if(_0x200de6[_0x1de4('0x34')]['includeAll']){_0x24f140['include']=[{'all':!![]}];}return db[_0x1de4('0x2e')][_0x1de4('0x41')](_0x24f140);})['then'](function(_0x2f3c60){_0x43aabb['rows']=_0x2f3c60;return _0x43aabb;})[_0x1de4('0x27')](respondWithFilteredResult(_0x2ea6a1,_0x24f140))[_0x1de4('0x42')](handleError(_0x2ea6a1,null));};exports[_0x1de4('0x43')]=function(_0xaf26b2,_0x19d704){var _0x3274a2={'raw':!![],'where':{'id':_0xaf26b2['params']['id']}},_0x387256={};_0x387256[_0x1de4('0x32')]=_['keys'](db[_0x1de4('0x2e')]['rawAttributes']);_0x387256[_0x1de4('0x34')]=_[_0x1de4('0x33')](_0xaf26b2[_0x1de4('0x34')]);_0x387256[_0x1de4('0x35')]=_[_0x1de4('0x36')](_0x387256['model'],_0x387256[_0x1de4('0x34')]);_0x3274a2[_0x1de4('0x37')]=_[_0x1de4('0x36')](_0x387256[_0x1de4('0x32')],qs[_0x1de4('0x38')](_0xaf26b2[_0x1de4('0x34')][_0x1de4('0x38')]));_0x3274a2[_0x1de4('0x37')]=_0x3274a2['attributes'][_0x1de4('0x44')]?_0x3274a2[_0x1de4('0x37')]:_0x387256[_0x1de4('0x32')];if(_0xaf26b2['query']['includeAll']){_0x3274a2[_0x1de4('0x45')]=[{'all':!![]}];}_0x3274a2=_[_0x1de4('0x3e')]({},_0x3274a2,_0xaf26b2['options']);return db[_0x1de4('0x2e')]['find'](_0x3274a2)[_0x1de4('0x27')](handleEntityNotFound(_0x19d704,null))['then'](respondWithResult(_0x19d704,null))[_0x1de4('0x42')](handleError(_0x19d704,null));};exports[_0x1de4('0x46')]=function(_0x33ea8a,_0x3a95db){return db[_0x1de4('0x2e')]['create'](_0x33ea8a[_0x1de4('0x47')],{})[_0x1de4('0x27')](respondWithResult(_0x3a95db,0xc9))[_0x1de4('0x42')](handleError(_0x3a95db,null));};exports[_0x1de4('0x26')]=function(_0x240433,_0x3c4ddc){if(_0x240433['body']['id']){delete _0x240433[_0x1de4('0x47')]['id'];}return db['OpenchannelQueueReport'][_0x1de4('0x48')]({'where':{'id':_0x240433[_0x1de4('0x49')]['id']}})[_0x1de4('0x27')](handleEntityNotFound(_0x3c4ddc,null))[_0x1de4('0x27')](saveUpdates(_0x240433['body'],null))[_0x1de4('0x27')](respondWithResult(_0x3c4ddc,null))[_0x1de4('0x42')](handleError(_0x3c4ddc,null));};exports['destroy']=function(_0x26885e,_0xc95184){return db[_0x1de4('0x2e')][_0x1de4('0x48')]({'where':{'id':_0x26885e[_0x1de4('0x49')]['id']}})[_0x1de4('0x27')](handleEntityNotFound(_0xc95184,null))[_0x1de4('0x27')](removeEntity(_0xc95184,null))[_0x1de4('0x42')](handleError(_0xc95184,null));};exports[_0x1de4('0x4a')]=function(_0x5458c8,_0x2c7901){return db[_0x1de4('0x2e')]['describe']()[_0x1de4('0x27')](respondWithResult(_0x2c7901,null))[_0x1de4('0x42')](handleError(_0x2c7901,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index b478354..6c227a9 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 _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 +var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x65653e,_0x47b5ff){var _0x3720b5=function(_0x1f9d93){while(--_0x1f9d93){_0x65653e['push'](_0x65653e['shift']());}};_0x3720b5(++_0x47b5ff);}(_0x7a54,0x106));var _0x47a5=function(_0x57c22f,_0x3ad540){_0x57c22f=_0x57c22f-0x0;var _0x2555dc=_0x7a54[_0x57c22f];return _0x2555dc;};'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 5fe0ee9..e1d71ff 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 _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 +var _0x531a=['catch','CreateOpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x565fed,_0xb85768){var _0x3e018f=function(_0x104d8e){while(--_0x104d8e){_0x565fed['push'](_0x565fed['shift']());}};_0x3e018f(++_0xb85768);}(_0x531a,0x100));var _0xa531=function(_0x5b0263,_0x27b189){_0x5b0263=_0x5b0263-0x0;var _0x53c82f=_0x531a[_0x5b0263];return _0x53c82f;};'use strict';var _=require(_0xa531('0x0'));var util=require(_0xa531('0x1'));var moment=require(_0xa531('0x2'));var BPromise=require(_0xa531('0x3'));var rs=require(_0xa531('0x4'));var fs=require('fs');var Redis=require(_0xa531('0x5'));var db=require(_0xa531('0x6'))['db'];var utils=require(_0xa531('0x7'));var logger=require(_0xa531('0x8'))(_0xa531('0x9'));var config=require('../../config/environment');var jayson=require(_0xa531('0xa'));var client=jayson['client'][_0xa531('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4446b9,_0x3fd172,_0x286dc7){return new BPromise(function(_0x3b68a7,_0x5bd2f9){return client[_0xa531('0xc')](_0x4446b9,_0x286dc7)[_0xa531('0xd')](function(_0x4d07e4){logger[_0xa531('0xe')](_0xa531('0xf'),_0x3fd172,_0xa531('0x10'));logger[_0xa531('0x11')](_0xa531('0x12'),_0x3fd172,'request\x20sent',JSON[_0xa531('0x13')](_0x4d07e4));if(_0x4d07e4['error']){if(_0x4d07e4[_0xa531('0x14')][_0xa531('0x15')]===0x1f4){logger[_0xa531('0x14')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3fd172,_0x4d07e4[_0xa531('0x14')][_0xa531('0x16')]);return _0x5bd2f9(_0x4d07e4['error'][_0xa531('0x16')]);}logger[_0xa531('0x14')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3fd172,_0x4d07e4[_0xa531('0x14')][_0xa531('0x16')]);return _0x3b68a7(_0x4d07e4[_0xa531('0x14')]['message']);}else{logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x3fd172,_0xa531('0x10'));_0x3b68a7(_0x4d07e4[_0xa531('0x17')][_0xa531('0x16')]);}})[_0xa531('0x18')](function(_0x324076){logger[_0xa531('0x14')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3fd172,_0x324076);_0x5bd2f9(_0x324076);});});}exports[_0xa531('0x19')]=function(_0x5124a1){var _0x412b84=this;return new Promise(function(_0x146013,_0x4fb62e){return db['OpenchannelQueueReport'][_0xa531('0x1a')](_0x5124a1[_0xa531('0x1b')],{'raw':_0x5124a1[_0xa531('0x1c')]?_0x5124a1['options'][_0xa531('0x1d')]===undefined?!![]:![]:!![]})[_0xa531('0xd')](function(_0x4096f0){logger['info'](_0xa531('0x19'),_0x5124a1);logger[_0xa531('0x11')]('CreateOpenchannelQueueReport',_0x5124a1,JSON[_0xa531('0x13')](_0x4096f0));_0x146013(_0x4096f0);})[_0xa531('0x18')](function(_0x3a2016){logger[_0xa531('0x14')](_0xa531('0x19'),_0x3a2016[_0xa531('0x16')],_0x5124a1);_0x4fb62e(_0x412b84[_0xa531('0x14')](0x1f4,_0x3a2016[_0xa531('0x16')]));});});};exports[_0xa531('0x1e')]=function(_0x39f640){var _0x8e9ab3=this;return new Promise(function(_0x3ac4eb,_0x57f1b3){return db[_0xa531('0x1f')][_0xa531('0x20')](_0x39f640[_0xa531('0x1b')],{'raw':_0x39f640['options']?_0x39f640[_0xa531('0x1c')][_0xa531('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39f640['options']?_0x39f640['options'][_0xa531('0x21')]||null:null,'attributes':_0x39f640['options']?_0x39f640[_0xa531('0x1c')][_0xa531('0x22')]||null:null,'limit':_0x39f640['options']?_0x39f640[_0xa531('0x1c')]['limit']||null:null})[_0xa531('0xd')](function(_0x531b8c){logger['info']('UpdateOpenchannelQueueReport',_0x39f640);logger[_0xa531('0x11')](_0xa531('0x1e'),_0x39f640,JSON['stringify'](_0x531b8c));_0x3ac4eb(_0x531b8c);})['catch'](function(_0x380cec){logger['error'](_0xa531('0x1e'),_0x380cec[_0xa531('0x16')],_0x39f640);_0x57f1b3(_0x8e9ab3['error'](0x1f4,_0x380cec[_0xa531('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 513c257..7850084 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 _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 +var _0xb5a1=['/:id','show','post','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelTransferReport.controller','isAuthenticated','index','get','describe'];(function(_0x327c92,_0x230bec){var _0x7f7601=function(_0x4e3c6c){while(--_0x4e3c6c){_0x327c92['push'](_0x327c92['shift']());}};_0x7f7601(++_0x230bec);}(_0xb5a1,0x1c9));var _0x1b5a=function(_0x491faa,_0x4f2907){_0x491faa=_0x491faa-0x0;var _0x414440=_0xb5a1[_0x491faa];return _0x414440;};'use strict';var multer=require(_0x1b5a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1b5a('0x1'));var express=require(_0x1b5a('0x2'));var router=express[_0x1b5a('0x3')]();var fs_extra=require(_0x1b5a('0x4'));var auth=require(_0x1b5a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1b5a('0x6'));router['get']('/',auth[_0x1b5a('0x7')](),controller[_0x1b5a('0x8')]);router[_0x1b5a('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x1b5a('0xa')]);router[_0x1b5a('0x9')](_0x1b5a('0xb'),auth[_0x1b5a('0x7')](),controller[_0x1b5a('0xc')]);router[_0x1b5a('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1b5a('0xe')](_0x1b5a('0xb'),auth['isAuthenticated'](),controller[_0x1b5a('0xf')]);router[_0x1b5a('0x10')](_0x1b5a('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x1b5a('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index f50228c..6b67a18 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 _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 +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x10f68e,_0xf198ea){var _0x4c8372=function(_0x38517){while(--_0x38517){_0x10f68e['push'](_0x10f68e['shift']());}};_0x4c8372(++_0xf198ea);}(_0x9bde,0xe1));var _0xe9bd=function(_0x57690f,_0x916b2f){_0x57690f=_0x57690f-0x0;var _0x492f42=_0x9bde[_0x57690f];return _0x492f42;};'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/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index ae808cb..a3eefcc 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 _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 +var _0xc5ca=['OpenchannelTransferReport','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','include','findAll','catch','show','params','keys','rawAttributes','length','includeAll','find','body','destroy','describe','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','Content-Range','reject','save','update','then','error','stack','name','send','index','map'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc5ca,0x1d7));var _0xac5c=function(_0x32e1d7,_0x5b1cec){_0x32e1d7=_0x32e1d7-0x0;var _0x1f06d5=_0xc5ca[_0x32e1d7];return _0x1f06d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xac5c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xac5c('0x1'));var moment=require('moment');var BPromise=require(_0xac5c('0x2'));var Mustache=require(_0xac5c('0x3'));var util=require(_0xac5c('0x4'));var path=require(_0xac5c('0x5'));var sox=require(_0xac5c('0x6'));var csv=require(_0xac5c('0x7'));var ejs=require(_0xac5c('0x8'));var fs=require('fs');var fs_extra=require(_0xac5c('0x9'));var _=require(_0xac5c('0xa'));var squel=require(_0xac5c('0xb'));var crypto=require(_0xac5c('0xc'));var jsforce=require(_0xac5c('0xd'));var deskjs=require(_0xac5c('0xe'));var toCsv=require(_0xac5c('0x7'));var querystring=require('querystring');var Papa=require(_0xac5c('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xac5c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac5c('0x11'));var logger=require('../../config/logger')(_0xac5c('0x12'));var utils=require(_0xac5c('0x13'));var config=require(_0xac5c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xac5c('0x15'))['db'];function respondWithStatusCode(_0x43912e,_0x3ad062){_0x3ad062=_0x3ad062||0xcc;return function(_0x1dbba3){if(_0x1dbba3){return _0x43912e[_0xac5c('0x16')](_0x3ad062);}return _0x43912e[_0xac5c('0x17')](_0x3ad062)[_0xac5c('0x18')]();};}function respondWithResult(_0x37f8e8,_0x55e605){_0x55e605=_0x55e605||0xc8;return function(_0x266436){if(_0x266436){return _0x37f8e8[_0xac5c('0x17')](_0x55e605)[_0xac5c('0x19')](_0x266436);}};}function respondWithFilteredResult(_0x58d3f2,_0xf6b95d){return function(_0x3f1ca9){if(_0x3f1ca9){var _0x458f09=typeof _0xf6b95d[_0xac5c('0x1a')]==='undefined'&&typeof _0xf6b95d[_0xac5c('0x1b')]===_0xac5c('0x1c');var _0x4f9cfe=_0x3f1ca9['count'];var _0x5c5337=_0x458f09?0x0:_0xf6b95d['offset'];var _0x5b8a78=_0x458f09?_0x3f1ca9['count']:_0xf6b95d[_0xac5c('0x1a')]+_0xf6b95d[_0xac5c('0x1b')];var _0x5b24a0;if(_0x5b8a78>=_0x4f9cfe){_0x5b8a78=_0x4f9cfe;_0x5b24a0=0xc8;}else{_0x5b24a0=0xce;}_0x58d3f2[_0xac5c('0x17')](_0x5b24a0);return _0x58d3f2['set'](_0xac5c('0x1d'),_0x5c5337+'-'+_0x5b8a78+'/'+_0x4f9cfe)[_0xac5c('0x19')](_0x3f1ca9);}return null;};}function patchUpdates(_0x10e159){return function(_0x5b5fbf){try{jsonpatch['apply'](_0x5b5fbf,_0x10e159,!![]);}catch(_0x48c2de){return BPromise[_0xac5c('0x1e')](_0x48c2de);}return _0x5b5fbf[_0xac5c('0x1f')]();};}function saveUpdates(_0x120c44,_0x25e9ab){return function(_0x1de574){if(_0x1de574){return _0x1de574[_0xac5c('0x20')](_0x120c44)['then'](function(_0x4848c3){return _0x4848c3;});}return null;};}function removeEntity(_0x21ac0a,_0x52a458){return function(_0x35911f){if(_0x35911f){return _0x35911f['destroy']()[_0xac5c('0x21')](function(){_0x21ac0a['status'](0xcc)[_0xac5c('0x18')]();});}};}function handleEntityNotFound(_0x2ff3d7,_0x2a5505){return function(_0x3e2c48){if(!_0x3e2c48){_0x2ff3d7['sendStatus'](0x194);}return _0x3e2c48;};}function handleError(_0x23b137,_0xaad7c){_0xaad7c=_0xaad7c||0x1f4;return function(_0x459f9d){logger[_0xac5c('0x22')](_0x459f9d[_0xac5c('0x23')]);if(_0x459f9d[_0xac5c('0x24')]){delete _0x459f9d[_0xac5c('0x24')];}_0x23b137[_0xac5c('0x17')](_0xaad7c)[_0xac5c('0x25')](_0x459f9d);};}exports[_0xac5c('0x26')]=function(_0x3631d9,_0xd47f10){var _0x5baae6={},_0x49f4de={},_0x694be0={'count':0x0,'rows':[]};var _0x34d6db=_[_0xac5c('0x27')](db[_0xac5c('0x28')]['rawAttributes'],function(_0x37a84c){return{'name':_0x37a84c[_0xac5c('0x29')],'type':_0x37a84c[_0xac5c('0x2a')][_0xac5c('0x2b')]};});_0x49f4de[_0xac5c('0x2c')]=_[_0xac5c('0x27')](_0x34d6db,_0xac5c('0x24'));_0x49f4de['query']=_['keys'](_0x3631d9[_0xac5c('0x2d')]);_0x49f4de[_0xac5c('0x2e')]=_['intersection'](_0x49f4de[_0xac5c('0x2c')],_0x49f4de[_0xac5c('0x2d')]);_0x5baae6[_0xac5c('0x2f')]=_[_0xac5c('0x30')](_0x49f4de[_0xac5c('0x2c')],qs[_0xac5c('0x31')](_0x3631d9[_0xac5c('0x2d')][_0xac5c('0x31')]));_0x5baae6[_0xac5c('0x2f')]=_0x5baae6[_0xac5c('0x2f')]['length']?_0x5baae6[_0xac5c('0x2f')]:_0x49f4de[_0xac5c('0x2c')];if(!_0x3631d9[_0xac5c('0x2d')][_0xac5c('0x32')](_0xac5c('0x33'))){_0x5baae6[_0xac5c('0x1b')]=qs[_0xac5c('0x1b')](_0x3631d9[_0xac5c('0x2d')][_0xac5c('0x1b')]);_0x5baae6[_0xac5c('0x1a')]=qs[_0xac5c('0x1a')](_0x3631d9[_0xac5c('0x2d')][_0xac5c('0x1a')]);}_0x5baae6[_0xac5c('0x34')]=qs[_0xac5c('0x35')](_0x3631d9[_0xac5c('0x2d')][_0xac5c('0x35')]);_0x5baae6[_0xac5c('0x36')]=qs[_0xac5c('0x2e')](_[_0xac5c('0x37')](_0x3631d9['query'],_0x49f4de['filters']),_0x34d6db);if(_0x3631d9[_0xac5c('0x2d')][_0xac5c('0x38')]){_0x5baae6[_0xac5c('0x36')]=_[_0xac5c('0x39')](_0x5baae6[_0xac5c('0x36')],{'$or':_[_0xac5c('0x27')](_0x34d6db,function(_0x5ac1c9){if(_0x5ac1c9[_0xac5c('0x2a')]!=='VIRTUAL'){var _0x23a0aa={};_0x23a0aa[_0x5ac1c9[_0xac5c('0x24')]]={'$like':'%'+_0x3631d9[_0xac5c('0x2d')][_0xac5c('0x38')]+'%'};return _0x23a0aa;}})});}_0x5baae6=_['merge']({},_0x5baae6,_0x3631d9[_0xac5c('0x3a')]);var _0xd546f5={'where':_0x5baae6[_0xac5c('0x36')]};return db[_0xac5c('0x28')]['count'](_0xd546f5)['then'](function(_0x3e8828){_0x694be0[_0xac5c('0x3b')]=_0x3e8828;if(_0x3631d9[_0xac5c('0x2d')]['includeAll']){_0x5baae6[_0xac5c('0x3c')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xac5c('0x3d')](_0x5baae6);})[_0xac5c('0x21')](function(_0xbce587){_0x694be0['rows']=_0xbce587;return _0x694be0;})[_0xac5c('0x21')](respondWithFilteredResult(_0xd47f10,_0x5baae6))[_0xac5c('0x3e')](handleError(_0xd47f10,null));};exports[_0xac5c('0x3f')]=function(_0x20ebf6,_0x3d911a){var _0x287858={'raw':!![],'where':{'id':_0x20ebf6[_0xac5c('0x40')]['id']}},_0x3dd8b3={};_0x3dd8b3['model']=_[_0xac5c('0x41')](db['OpenchannelTransferReport'][_0xac5c('0x42')]);_0x3dd8b3[_0xac5c('0x2d')]=_['keys'](_0x20ebf6['query']);_0x3dd8b3[_0xac5c('0x2e')]=_[_0xac5c('0x30')](_0x3dd8b3[_0xac5c('0x2c')],_0x3dd8b3[_0xac5c('0x2d')]);_0x287858[_0xac5c('0x2f')]=_['intersection'](_0x3dd8b3['model'],qs[_0xac5c('0x31')](_0x20ebf6[_0xac5c('0x2d')][_0xac5c('0x31')]));_0x287858['attributes']=_0x287858['attributes'][_0xac5c('0x43')]?_0x287858[_0xac5c('0x2f')]:_0x3dd8b3[_0xac5c('0x2c')];if(_0x20ebf6[_0xac5c('0x2d')][_0xac5c('0x44')]){_0x287858[_0xac5c('0x3c')]=[{'all':!![]}];}_0x287858=_[_0xac5c('0x39')]({},_0x287858,_0x20ebf6[_0xac5c('0x3a')]);return db[_0xac5c('0x28')][_0xac5c('0x45')](_0x287858)[_0xac5c('0x21')](handleEntityNotFound(_0x3d911a,null))[_0xac5c('0x21')](respondWithResult(_0x3d911a,null))[_0xac5c('0x3e')](handleError(_0x3d911a,null));};exports['create']=function(_0x3a9ffc,_0x502eca){return db[_0xac5c('0x28')]['create'](_0x3a9ffc[_0xac5c('0x46')],{})[_0xac5c('0x21')](respondWithResult(_0x502eca,0xc9))[_0xac5c('0x3e')](handleError(_0x502eca,null));};exports[_0xac5c('0x20')]=function(_0x6769ae,_0x47e501){if(_0x6769ae[_0xac5c('0x46')]['id']){delete _0x6769ae[_0xac5c('0x46')]['id'];}return db[_0xac5c('0x28')][_0xac5c('0x45')]({'where':{'id':_0x6769ae[_0xac5c('0x40')]['id']}})['then'](handleEntityNotFound(_0x47e501,null))[_0xac5c('0x21')](saveUpdates(_0x6769ae[_0xac5c('0x46')],null))[_0xac5c('0x21')](respondWithResult(_0x47e501,null))[_0xac5c('0x3e')](handleError(_0x47e501,null));};exports[_0xac5c('0x47')]=function(_0x504e61,_0x6ba5e0){return db['OpenchannelTransferReport'][_0xac5c('0x45')]({'where':{'id':_0x504e61[_0xac5c('0x40')]['id']}})[_0xac5c('0x21')](handleEntityNotFound(_0x6ba5e0,null))[_0xac5c('0x21')](removeEntity(_0x6ba5e0,null))[_0xac5c('0x3e')](handleError(_0x6ba5e0,null));};exports[_0xac5c('0x48')]=function(_0x58c75e,_0x38744c){return db[_0xac5c('0x28')][_0xac5c('0x48')]()[_0xac5c('0x21')](respondWithResult(_0x38744c,null))[_0xac5c('0x3e')](handleError(_0x38744c,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 3b82f71..e4f19ed 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 _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 +var _0x77e3=['report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./openchannelTransferReport.attributes','define','OpenchannelTransferReport'];(function(_0x5d052b,_0x4e56f1){var _0x1868d7=function(_0x1f2561){while(--_0x1f2561){_0x5d052b['push'](_0x5d052b['shift']());}};_0x1868d7(++_0x4e56f1);}(_0x77e3,0x1c9));var _0x377e=function(_0x5a6d8e,_0x1d47e2){_0x5a6d8e=_0x5a6d8e-0x0;var _0x98f676=_0x77e3[_0x5a6d8e];return _0x98f676;};'use strict';var _=require(_0x377e('0x0'));var util=require(_0x377e('0x1'));var logger=require(_0x377e('0x2'))(_0x377e('0x3'));var moment=require(_0x377e('0x4'));var BPromise=require(_0x377e('0x5'));var rp=require(_0x377e('0x6'));var fs=require('fs');var path=require(_0x377e('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x377e('0x8'));module['exports']=function(_0x276c0f,_0x40da61){return _0x276c0f[_0x377e('0x9')](_0x377e('0xa'),attributes,{'tableName':_0x377e('0xb'),'paranoid':![],'indexes':[{'name':_0x377e('0xc'),'fields':[_0x377e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 65278ab..bb60279 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 _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 +var _0x8375=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x548dca,_0x178a8b){var _0xe8c63a=function(_0x206f26){while(--_0x206f26){_0x548dca['push'](_0x548dca['shift']());}};_0xe8c63a(++_0x178a8b);}(_0x8375,0xa8));var _0x5837=function(_0x6cbbf9,_0x15396d){_0x6cbbf9=_0x6cbbf9-0x0;var _0xd7ac14=_0x8375[_0x6cbbf9];return _0xd7ac14;};'use strict';var _=require(_0x5837('0x0'));var util=require(_0x5837('0x1'));var moment=require(_0x5837('0x2'));var BPromise=require('bluebird');var rs=require(_0x5837('0x3'));var fs=require('fs');var Redis=require(_0x5837('0x4'));var db=require(_0x5837('0x5'))['db'];var utils=require(_0x5837('0x6'));var logger=require(_0x5837('0x7'))(_0x5837('0x8'));var config=require('../../config/environment');var jayson=require(_0x5837('0x9'));var client=jayson[_0x5837('0xa')][_0x5837('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e383c,_0x3b11c3,_0x5bc421){return new BPromise(function(_0x508caf,_0x1e44c4){return client[_0x5837('0xc')](_0x2e383c,_0x5bc421)['then'](function(_0x24ca00){logger['info'](_0x5837('0xd'),_0x3b11c3,_0x5837('0xe'));logger[_0x5837('0xf')](_0x5837('0x10'),_0x3b11c3,_0x5837('0xe'),JSON[_0x5837('0x11')](_0x24ca00));if(_0x24ca00['error']){if(_0x24ca00[_0x5837('0x12')][_0x5837('0x13')]===0x1f4){logger[_0x5837('0x12')](_0x5837('0xd'),_0x3b11c3,_0x24ca00[_0x5837('0x12')]['message']);return _0x1e44c4(_0x24ca00['error']['message']);}logger[_0x5837('0x12')](_0x5837('0xd'),_0x3b11c3,_0x24ca00[_0x5837('0x12')][_0x5837('0x14')]);return _0x508caf(_0x24ca00[_0x5837('0x12')][_0x5837('0x14')]);}else{logger[_0x5837('0x15')](_0x5837('0xd'),_0x3b11c3,_0x5837('0xe'));_0x508caf(_0x24ca00['result'][_0x5837('0x14')]);}})[_0x5837('0x16')](function(_0x57342d){logger[_0x5837('0x12')](_0x5837('0xd'),_0x3b11c3,_0x57342d);_0x1e44c4(_0x57342d);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 58efa57..96afdba 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 _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 +var _0xc9eb=['../../config/environment','./pause.controller','get','/:id','isAuthenticated','post','create','update','delete','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x48c262,_0x433b1e){var _0x3ee79d=function(_0x2f110d){while(--_0x2f110d){_0x48c262['push'](_0x48c262['shift']());}};_0x3ee79d(++_0x433b1e);}(_0xc9eb,0xf9));var _0xbc9e=function(_0x1ebeaf,_0x2b7387){_0x1ebeaf=_0x1ebeaf-0x0;var _0x388001=_0xc9eb[_0x1ebeaf];return _0x388001;};'use strict';var multer=require(_0xbc9e('0x0'));var util=require(_0xbc9e('0x1'));var path=require('path');var timeout=require(_0xbc9e('0x2'));var express=require(_0xbc9e('0x3'));var router=express['Router']();var fs_extra=require(_0xbc9e('0x4'));var auth=require(_0xbc9e('0x5'));var interaction=require(_0xbc9e('0x6'));var config=require(_0xbc9e('0x7'));var controller=require(_0xbc9e('0x8'));router[_0xbc9e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbc9e('0x9')](_0xbc9e('0xa'),auth[_0xbc9e('0xb')](),controller['show']);router[_0xbc9e('0xc')]('/',auth[_0xbc9e('0xb')](),controller[_0xbc9e('0xd')]);router['put'](_0xbc9e('0xa'),auth[_0xbc9e('0xb')](),controller[_0xbc9e('0xe')]);router[_0xbc9e('0xf')](_0xbc9e('0xa'),auth[_0xbc9e('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index e7fe1bc..9b4026a 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 _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 +var _0x1046=['STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1046,0x1f2));var _0x6104=function(_0x562f9a,_0x2da4e5){_0x562f9a=_0x562f9a-0x0;var _0x5b2464=_0x1046[_0x562f9a];return _0x5b2464;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6104('0x0')],'unique':_0x6104('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x6104('0x0')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 2dd1a55..d8c748c 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 _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 +var _0x7928=['eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','Pauses','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','Pause','findAll','rows','show','params','keys','find','catch','create','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy'];(function(_0x23989e,_0x115ca2){var _0x136eb3=function(_0x4d6035){while(--_0x4d6035){_0x23989e['push'](_0x23989e['shift']());}};_0x136eb3(++_0x115ca2);}(_0x7928,0xa4));var _0x8792=function(_0x274395,_0x1d5e35){_0x274395=_0x274395-0x0;var _0x1df722=_0x7928[_0x274395];return _0x1df722;};'use strict';var emlformat=require(_0x8792('0x0'));var rimraf=require(_0x8792('0x1'));var zipdir=require(_0x8792('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8792('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8792('0x4'));var util=require(_0x8792('0x5'));var path=require(_0x8792('0x6'));var sox=require(_0x8792('0x7'));var csv=require('to-csv');var ejs=require(_0x8792('0x8'));var fs=require('fs');var fs_extra=require(_0x8792('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8792('0xa'));var jsforce=require(_0x8792('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8792('0xc'));var querystring=require(_0x8792('0xd'));var Papa=require(_0x8792('0xe'));var Redis=require('ioredis');var authService=require(_0x8792('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8792('0x10'));var logger=require(_0x8792('0x11'))(_0x8792('0x12'));var utils=require(_0x8792('0x13'));var config=require(_0x8792('0x14'));var licenseUtil=require(_0x8792('0x15'));var db=require(_0x8792('0x16'))['db'];function respondWithStatusCode(_0x3f01ff,_0x158b6b){_0x158b6b=_0x158b6b||0xcc;return function(_0x3a1827){if(_0x3a1827){return _0x3f01ff[_0x8792('0x17')](_0x158b6b);}return _0x3f01ff[_0x8792('0x18')](_0x158b6b)[_0x8792('0x19')]();};}function respondWithResult(_0x242d65,_0x5b3c4f){_0x5b3c4f=_0x5b3c4f||0xc8;return function(_0x34a852){if(_0x34a852){return _0x242d65[_0x8792('0x18')](_0x5b3c4f)[_0x8792('0x1a')](_0x34a852);}};}function respondWithFilteredResult(_0x2f731c,_0x50b798){return function(_0x55a576){if(_0x55a576){var _0xebda4=typeof _0x50b798[_0x8792('0x1b')]==='undefined'&&typeof _0x50b798['limit']===_0x8792('0x1c');var _0x4c4962=_0x55a576[_0x8792('0x1d')];var _0x3dd470=_0xebda4?0x0:_0x50b798['offset'];var _0x169fce=_0xebda4?_0x55a576[_0x8792('0x1d')]:_0x50b798['offset']+_0x50b798[_0x8792('0x1e')];var _0x21ef82;if(_0x169fce>=_0x4c4962){_0x169fce=_0x4c4962;_0x21ef82=0xc8;}else{_0x21ef82=0xce;}_0x2f731c[_0x8792('0x18')](_0x21ef82);return _0x2f731c[_0x8792('0x1f')](_0x8792('0x20'),_0x3dd470+'-'+_0x169fce+'/'+_0x4c4962)[_0x8792('0x1a')](_0x55a576);}return null;};}function patchUpdates(_0x2adb54){return function(_0x447569){try{jsonpatch[_0x8792('0x21')](_0x447569,_0x2adb54,!![]);}catch(_0x2dc486){return BPromise[_0x8792('0x22')](_0x2dc486);}return _0x447569[_0x8792('0x23')]();};}function saveUpdates(_0x536461,_0x5e97e4){return function(_0x21da6b){if(_0x21da6b){return _0x21da6b[_0x8792('0x24')](_0x536461)[_0x8792('0x25')](function(_0x33235d){return _0x33235d;});}return null;};}function removeEntity(_0x489285,_0x29d364){return function(_0x34cc2e){if(_0x34cc2e){return _0x34cc2e['destroy']()['then'](function(){var _0x4e83f6=_0x34cc2e[_0x8792('0x26')]({'plain':!![]});var _0x48cfcd=_0x8792('0x27');return db[_0x8792('0x28')]['destroy']({'where':{'type':_0x48cfcd,'resourceId':_0x4e83f6['id']}})[_0x8792('0x25')](function(){return _0x34cc2e;});})[_0x8792('0x25')](function(){_0x489285[_0x8792('0x18')](0xcc)[_0x8792('0x19')]();});}};}function handleEntityNotFound(_0x46db98,_0xf3d118){return function(_0x5c92bf){if(!_0x5c92bf){_0x46db98['sendStatus'](0x194);}return _0x5c92bf;};}function handleError(_0x2cb472,_0x1c2cba){_0x1c2cba=_0x1c2cba||0x1f4;return function(_0x705e5a){logger[_0x8792('0x29')](_0x705e5a[_0x8792('0x2a')]);if(_0x705e5a['name']){delete _0x705e5a[_0x8792('0x2b')];}_0x2cb472[_0x8792('0x18')](_0x1c2cba)[_0x8792('0x2c')](_0x705e5a);};}exports[_0x8792('0x2d')]=function(_0x3311d4,_0x5134c9){var _0x8f2c97={},_0x261047={},_0x5bc009={'count':0x0,'rows':[]};var _0x44ee07=_[_0x8792('0x2e')](db['Pause'][_0x8792('0x2f')],function(_0x596413){return{'name':_0x596413[_0x8792('0x30')],'type':_0x596413['type'][_0x8792('0x31')]};});_0x261047[_0x8792('0x32')]=_[_0x8792('0x2e')](_0x44ee07,'name');_0x261047['query']=_['keys'](_0x3311d4[_0x8792('0x33')]);_0x261047[_0x8792('0x34')]=_[_0x8792('0x35')](_0x261047['model'],_0x261047[_0x8792('0x33')]);_0x8f2c97[_0x8792('0x36')]=_[_0x8792('0x35')](_0x261047['model'],qs[_0x8792('0x37')](_0x3311d4[_0x8792('0x33')][_0x8792('0x37')]));_0x8f2c97[_0x8792('0x36')]=_0x8f2c97['attributes'][_0x8792('0x38')]?_0x8f2c97['attributes']:_0x261047[_0x8792('0x32')];if(!_0x3311d4[_0x8792('0x33')]['hasOwnProperty'](_0x8792('0x39'))){_0x8f2c97['limit']=qs[_0x8792('0x1e')](_0x3311d4[_0x8792('0x33')][_0x8792('0x1e')]);_0x8f2c97['offset']=qs[_0x8792('0x1b')](_0x3311d4[_0x8792('0x33')][_0x8792('0x1b')]);}_0x8f2c97['order']=qs[_0x8792('0x3a')](_0x3311d4['query'][_0x8792('0x3a')]);_0x8f2c97[_0x8792('0x3b')]=qs[_0x8792('0x34')](_['pick'](_0x3311d4[_0x8792('0x33')],_0x261047[_0x8792('0x34')]),_0x44ee07);if(_0x3311d4[_0x8792('0x33')]['filter']){_0x8f2c97[_0x8792('0x3b')]=_[_0x8792('0x3c')](_0x8f2c97[_0x8792('0x3b')],{'$or':_[_0x8792('0x2e')](_0x44ee07,function(_0x33e8c9){if(_0x33e8c9[_0x8792('0x3d')]!==_0x8792('0x3e')){var _0x319d81={};_0x319d81[_0x33e8c9[_0x8792('0x2b')]]={'$like':'%'+_0x3311d4[_0x8792('0x33')][_0x8792('0x3f')]+'%'};return _0x319d81;}})});}_0x8f2c97=_[_0x8792('0x3c')]({},_0x8f2c97,_0x3311d4[_0x8792('0x40')]);var _0x399736={'where':_0x8f2c97[_0x8792('0x3b')]};return db['Pause'][_0x8792('0x1d')](_0x399736)[_0x8792('0x25')](function(_0x5595f6){_0x5bc009['count']=_0x5595f6;if(_0x3311d4[_0x8792('0x33')][_0x8792('0x41')]){_0x8f2c97[_0x8792('0x42')]=[{'all':!![]}];}return db[_0x8792('0x43')][_0x8792('0x44')](_0x8f2c97);})['then'](function(_0x454bdd){_0x5bc009[_0x8792('0x45')]=_0x454bdd;return _0x5bc009;})[_0x8792('0x25')](respondWithFilteredResult(_0x5134c9,_0x8f2c97))['catch'](handleError(_0x5134c9,null));};exports[_0x8792('0x46')]=function(_0x2f5428,_0x15910c){var _0x1c8a8e={'raw':!![],'where':{'id':_0x2f5428[_0x8792('0x47')]['id']}},_0x3ac4fe={};_0x3ac4fe[_0x8792('0x32')]=_[_0x8792('0x48')](db['Pause'][_0x8792('0x2f')]);_0x3ac4fe[_0x8792('0x33')]=_[_0x8792('0x48')](_0x2f5428['query']);_0x3ac4fe['filters']=_[_0x8792('0x35')](_0x3ac4fe['model'],_0x3ac4fe[_0x8792('0x33')]);_0x1c8a8e[_0x8792('0x36')]=_[_0x8792('0x35')](_0x3ac4fe[_0x8792('0x32')],qs[_0x8792('0x37')](_0x2f5428[_0x8792('0x33')][_0x8792('0x37')]));_0x1c8a8e['attributes']=_0x1c8a8e[_0x8792('0x36')][_0x8792('0x38')]?_0x1c8a8e[_0x8792('0x36')]:_0x3ac4fe['model'];if(_0x2f5428[_0x8792('0x33')][_0x8792('0x41')]){_0x1c8a8e[_0x8792('0x42')]=[{'all':!![]}];}_0x1c8a8e=_['merge']({},_0x1c8a8e,_0x2f5428[_0x8792('0x40')]);return db[_0x8792('0x43')][_0x8792('0x49')](_0x1c8a8e)[_0x8792('0x25')](handleEntityNotFound(_0x15910c,null))[_0x8792('0x25')](respondWithResult(_0x15910c,null))[_0x8792('0x4a')](handleError(_0x15910c,null));};exports[_0x8792('0x4b')]=function(_0x3e1735,_0x76d376){return db[_0x8792('0x43')][_0x8792('0x4b')](_0x3e1735['body'],{})['then'](function(_0x586473){var _0x79b19d=_0x3e1735[_0x8792('0x4c')][_0x8792('0x26')]({'plain':!![]});if(!_0x79b19d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x79b19d[_0x8792('0x4d')]==='user'){var _0x58e55b=_0x586473[_0x8792('0x26')]({'plain':!![]});var _0x5559a5=_0x8792('0x27');return db[_0x8792('0x4e')][_0x8792('0x49')]({'where':{'name':_0x5559a5,'userProfileId':_0x79b19d['userProfileId']},'raw':!![]})[_0x8792('0x25')](function(_0x2b53be){if(_0x2b53be&&_0x2b53be['autoAssociation']===0x0){return db[_0x8792('0x28')][_0x8792('0x4b')]({'name':_0x58e55b[_0x8792('0x2b')],'resourceId':_0x58e55b['id'],'type':_0x2b53be[_0x8792('0x2b')],'sectionId':_0x2b53be['id']},{})[_0x8792('0x25')](function(){return _0x586473;});}else{return _0x586473;}})[_0x8792('0x4a')](function(_0x338b94){logger[_0x8792('0x29')](_0x8792('0x4f'),_0x338b94);throw _0x338b94;});}return _0x586473;})[_0x8792('0x25')](respondWithResult(_0x76d376,0xc9))[_0x8792('0x4a')](handleError(_0x76d376,null));};exports[_0x8792('0x24')]=function(_0x5a5126,_0x2949e4){if(_0x5a5126[_0x8792('0x50')]['id']){delete _0x5a5126[_0x8792('0x50')]['id'];}return db[_0x8792('0x43')][_0x8792('0x49')]({'where':{'id':_0x5a5126[_0x8792('0x47')]['id']}})['then'](handleEntityNotFound(_0x2949e4,null))['then'](saveUpdates(_0x5a5126[_0x8792('0x50')],null))[_0x8792('0x25')](respondWithResult(_0x2949e4,null))['catch'](handleError(_0x2949e4,null));};exports[_0x8792('0x51')]=function(_0x48141d,_0x35652f){return db[_0x8792('0x43')][_0x8792('0x49')]({'where':{'id':_0x48141d[_0x8792('0x47')]['id']}})[_0x8792('0x25')](handleEntityNotFound(_0x35652f,null))[_0x8792('0x25')](removeEntity(_0x35652f,null))[_0x8792('0x4a')](handleError(_0x35652f,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 6a9c346..3bed9a9 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(_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 +var _0xc4aa=['bluebird','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_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':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index d9747ae..27ea538 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(_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 +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(_0x12dd54,_0x45241d){var _0x569090=function(_0x597d6b){while(--_0x597d6b){_0x12dd54['push'](_0x12dd54['shift']());}};_0x569090(++_0x45241d);}(_0x7a54,0x106));var _0x47a5=function(_0x2c1923,_0x59e5ed){_0x2c1923=_0x2c1923-0x0;var _0x465915=_0x7a54[_0x2c1923];return _0x465915;};'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 62b1d52..a35d9b5 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 _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 +var _0x2dae=['put','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id','isAuthenticated','show','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','post','file','upload'];(function(_0x183f92,_0x43ef0d){var _0x4726e8=function(_0x34a06f){while(--_0x34a06f){_0x183f92['push'](_0x183f92['shift']());}};_0x4726e8(++_0x43ef0d);}(_0x2dae,0xc3));var _0xe2da=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x2dae[_0x58afd5];return _0x3e503b;};'use strict';var multer=require(_0xe2da('0x0'));var util=require('util');var path=require(_0xe2da('0x1'));var timeout=require(_0xe2da('0x2'));var express=require(_0xe2da('0x3'));var router=express[_0xe2da('0x4')]();var fs_extra=require(_0xe2da('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var controller=require(_0xe2da('0x8'));router[_0xe2da('0x9')]('/',auth['isAuthenticated'](),controller[_0xe2da('0xa')]);router[_0xe2da('0x9')](_0xe2da('0xb'),controller[_0xe2da('0xc')]);router[_0xe2da('0x9')](_0xe2da('0xd'),auth[_0xe2da('0xe')](),controller[_0xe2da('0xf')]);router[_0xe2da('0x9')]('/:id/download',auth[_0xe2da('0xe')](),controller[_0xe2da('0x10')]);var upload=multer({'storage':multer[_0xe2da('0x11')]({'destination':function(_0x17086c,_0x3c1309,_0x44ec3e){_0x44ec3e(null,path[_0xe2da('0x12')](config[_0xe2da('0x13')],'server/files/plugins'));},'filename':function(_0xb98909,_0x5200b1,_0x4377c6){_0x5200b1[_0xe2da('0x14')]=_0x5200b1[_0xe2da('0x14')][_0xe2da('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4377c6(null,util[_0xe2da('0x16')](_0xe2da('0x17'),path[_0xe2da('0x18')](_0x5200b1['originalname'],path[_0xe2da('0x19')](_0x5200b1['originalname'])),Date['now'](),path[_0xe2da('0x19')](_0x5200b1[_0xe2da('0x14')])));}})});router[_0xe2da('0x1a')]('/',upload['single'](_0xe2da('0x1b')),controller[_0xe2da('0x1c')]);router[_0xe2da('0x1a')](_0xe2da('0xb'),controller['webhookPost']);router[_0xe2da('0x1d')](_0xe2da('0xd'),auth[_0xe2da('0xe')](),controller[_0xe2da('0x1e')]);router[_0xe2da('0x1f')]('/:id',auth[_0xe2da('0xe')](),controller[_0xe2da('0x1f')]);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 e80f213..1964e7b 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 _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 +var _0x80d1=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','html','script','TEXT'];(function(_0x524815,_0x18a7d4){var _0x4c7a2c=function(_0x2b703c){while(--_0x2b703c){_0x524815['push'](_0x524815['shift']());}};_0x4c7a2c(++_0x18a7d4);}(_0x80d1,0x17a));var _0x180d=function(_0x1e8a61,_0x364cf6){_0x1e8a61=_0x1e8a61-0x0;var _0x19fe45=_0x80d1[_0x1e8a61];return _0x19fe45;};'use strict';var Sequelize=require('sequelize');module[_0x180d('0x0')]={'name':{'type':Sequelize[_0x180d('0x1')]},'type':{'type':Sequelize[_0x180d('0x2')](_0x180d('0x3'),_0x180d('0x4'))},'description':{'type':Sequelize[_0x180d('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x180d('0x1')],'comment':_0x180d('0x6')},'active':{'type':Sequelize[_0x180d('0x7')],'defaultValue':0x0,'comment':_0x180d('0x8')},'sidebar':{'type':Sequelize[_0x180d('0x2')]('adminOnly',_0x180d('0x9'),_0x180d('0xa'),'never'),'defaultValue':_0x180d('0xa'),'comment':_0x180d('0xb')},'icon':{'type':Sequelize[_0x180d('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x180d('0x1')]},'scriptPath':{'type':Sequelize[_0x180d('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index cd38f82..9790c11 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 _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 +var _0x44af=['Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','create','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','body','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','http://localhost:','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','crypto','to-csv','querystring','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./plugin.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','save','update','then','destroy','Plugins','error','name','send','map','Plugin','rawAttributes','fieldName','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','options','include','findAll','show','params','catch','download','find','join','root','server/files/plugins','format','%s.zip','createWriteStream','zip','warning','code','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath'];(function(_0xd85e7b,_0x95b861){var _0x54280b=function(_0x18bc3c){while(--_0x18bc3c){_0xd85e7b['push'](_0xd85e7b['shift']());}};_0x54280b(++_0x95b861);}(_0x44af,0x17b));var _0xf44a=function(_0x29215d,_0x39143f){_0x29215d=_0x29215d-0x0;var _0x265037=_0x44af[_0x29215d];return _0x265037;};'use strict';var emlformat=require(_0xf44a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf44a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf44a('0x2'));var moment=require('moment');var BPromise=require(_0xf44a('0x3'));var Mustache=require(_0xf44a('0x4'));var util=require('util');var path=require(_0xf44a('0x5'));var sox=require(_0xf44a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf44a('0x7'));var _=require(_0xf44a('0x8'));var squel=require('squel');var crypto=require(_0xf44a('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf44a('0xa'));var querystring=require(_0xf44a('0xb'));var Papa=require('papaparse');var extract=require(_0xf44a('0xc'));var rimraf=require('rimraf');var archiver=require(_0xf44a('0xd'));var Redis=require(_0xf44a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf44a('0xf'));var as=require(_0xf44a('0x10'));var hardwareService=require(_0xf44a('0x11'));var logger=require(_0xf44a('0x12'))('api');var utils=require(_0xf44a('0x13'));var config=require(_0xf44a('0x14'));var licenseUtil=require(_0xf44a('0x15'));var db=require(_0xf44a('0x16'))['db'];config[_0xf44a('0x17')]=_['defaults'](config[_0xf44a('0x17')],{'host':_0xf44a('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf44a('0x17')]));require(_0xf44a('0x19'))[_0xf44a('0x1a')](socket);function respondWithStatusCode(_0x52d4ed,_0x1336f3){_0x1336f3=_0x1336f3||0xcc;return function(_0x5c6a6e){if(_0x5c6a6e){return _0x52d4ed[_0xf44a('0x1b')](_0x1336f3);}return _0x52d4ed['status'](_0x1336f3)[_0xf44a('0x1c')]();};}function respondWithResult(_0x28960e,_0x5c5b95){_0x5c5b95=_0x5c5b95||0xc8;return function(_0x31ae96){if(_0x31ae96){return _0x28960e[_0xf44a('0x1d')](_0x5c5b95)[_0xf44a('0x1e')](_0x31ae96);}};}function respondWithFilteredResult(_0x3de848,_0x321786){return function(_0x5f4653){if(_0x5f4653){var _0x22851a=typeof _0x321786[_0xf44a('0x1f')]===_0xf44a('0x20')&&typeof _0x321786[_0xf44a('0x21')]==='undefined';var _0x16727d=_0x5f4653[_0xf44a('0x22')];var _0x171f61=_0x22851a?0x0:_0x321786[_0xf44a('0x1f')];var _0x553d6b=_0x22851a?_0x5f4653[_0xf44a('0x22')]:_0x321786[_0xf44a('0x1f')]+_0x321786[_0xf44a('0x21')];var _0x2b18f5;if(_0x553d6b>=_0x16727d){_0x553d6b=_0x16727d;_0x2b18f5=0xc8;}else{_0x2b18f5=0xce;}_0x3de848[_0xf44a('0x1d')](_0x2b18f5);return _0x3de848[_0xf44a('0x23')]('Content-Range',_0x171f61+'-'+_0x553d6b+'/'+_0x16727d)['json'](_0x5f4653);}return null;};}function patchUpdates(_0x57e9d4){return function(_0x44fd18){try{jsonpatch['apply'](_0x44fd18,_0x57e9d4,!![]);}catch(_0x4e232f){return BPromise['reject'](_0x4e232f);}return _0x44fd18[_0xf44a('0x24')]();};}function saveUpdates(_0x26ddf9,_0x39da1a){return function(_0x15e80e){if(_0x15e80e){return _0x15e80e[_0xf44a('0x25')](_0x26ddf9)[_0xf44a('0x26')](function(_0x3b0e79){return _0x3b0e79;});}return null;};}function removeEntity(_0x468dbb,_0x541e14){return function(_0x449a71){if(_0x449a71){return _0x449a71[_0xf44a('0x27')]()[_0xf44a('0x26')](function(){var _0x5723d8=_0x449a71['get']({'plain':!![]});var _0x4256ce=_0xf44a('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x4256ce,'resourceId':_0x5723d8['id']}})[_0xf44a('0x26')](function(){return _0x449a71;});})[_0xf44a('0x26')](function(){_0x468dbb[_0xf44a('0x1d')](0xcc)[_0xf44a('0x1c')]();});}};}function handleEntityNotFound(_0x5a2990,_0x1ed08e){return function(_0x18d048){if(!_0x18d048){_0x5a2990[_0xf44a('0x1b')](0x194);}return _0x18d048;};}function handleError(_0xee5f2c,_0x37a040){_0x37a040=_0x37a040||0x1f4;return function(_0x17c69c){logger[_0xf44a('0x29')](_0x17c69c['stack']);if(_0x17c69c[_0xf44a('0x2a')]){delete _0x17c69c[_0xf44a('0x2a')];}_0xee5f2c[_0xf44a('0x1d')](_0x37a040)[_0xf44a('0x2b')](_0x17c69c);};}exports['index']=function(_0xdbb86e,_0x3d21b3){var _0x5a8f7a={},_0xa743d1={},_0x40c5b6={'count':0x0,'rows':[]};var _0x306b9c=_[_0xf44a('0x2c')](db[_0xf44a('0x2d')][_0xf44a('0x2e')],function(_0xe27092){return{'name':_0xe27092[_0xf44a('0x2f')],'type':_0xe27092['type'][_0xf44a('0x30')]};});_0xa743d1['model']=_[_0xf44a('0x2c')](_0x306b9c,_0xf44a('0x2a'));_0xa743d1[_0xf44a('0x31')]=_[_0xf44a('0x32')](_0xdbb86e[_0xf44a('0x31')]);_0xa743d1['filters']=_[_0xf44a('0x33')](_0xa743d1['model'],_0xa743d1[_0xf44a('0x31')]);_0x5a8f7a[_0xf44a('0x34')]=_[_0xf44a('0x33')](_0xa743d1[_0xf44a('0x35')],qs[_0xf44a('0x36')](_0xdbb86e['query'][_0xf44a('0x36')]));_0x5a8f7a[_0xf44a('0x34')]=_0x5a8f7a[_0xf44a('0x34')][_0xf44a('0x37')]?_0x5a8f7a['attributes']:_0xa743d1[_0xf44a('0x35')];if(!_0xdbb86e[_0xf44a('0x31')][_0xf44a('0x38')]('nolimit')){_0x5a8f7a[_0xf44a('0x21')]=qs[_0xf44a('0x21')](_0xdbb86e[_0xf44a('0x31')][_0xf44a('0x21')]);_0x5a8f7a[_0xf44a('0x1f')]=qs[_0xf44a('0x1f')](_0xdbb86e[_0xf44a('0x31')][_0xf44a('0x1f')]);}_0x5a8f7a[_0xf44a('0x39')]=qs[_0xf44a('0x3a')](_0xdbb86e['query'][_0xf44a('0x3a')]);_0x5a8f7a[_0xf44a('0x3b')]=qs[_0xf44a('0x3c')](_[_0xf44a('0x3d')](_0xdbb86e[_0xf44a('0x31')],_0xa743d1['filters']),_0x306b9c);if(_0xdbb86e[_0xf44a('0x31')][_0xf44a('0x3e')]){_0x5a8f7a[_0xf44a('0x3b')]=_[_0xf44a('0x3f')](_0x5a8f7a['where'],{'$or':_[_0xf44a('0x2c')](_0x306b9c,function(_0x281058){if(_0x281058[_0xf44a('0x40')]!=='VIRTUAL'){var _0x580ad0={};_0x580ad0[_0x281058[_0xf44a('0x2a')]]={'$like':'%'+_0xdbb86e[_0xf44a('0x31')][_0xf44a('0x3e')]+'%'};return _0x580ad0;}})});}_0x5a8f7a=_['merge']({},_0x5a8f7a,_0xdbb86e[_0xf44a('0x41')]);var _0x2e8fe0={'where':_0x5a8f7a[_0xf44a('0x3b')]};return db[_0xf44a('0x2d')][_0xf44a('0x22')](_0x2e8fe0)[_0xf44a('0x26')](function(_0x4d6039){_0x40c5b6[_0xf44a('0x22')]=_0x4d6039;if(_0xdbb86e['query']['includeAll']){_0x5a8f7a[_0xf44a('0x42')]=[{'all':!![]}];}return db[_0xf44a('0x2d')][_0xf44a('0x43')](_0x5a8f7a);})[_0xf44a('0x26')](function(_0x38c83f){_0x40c5b6['rows']=_0x38c83f;return _0x40c5b6;})['then'](respondWithFilteredResult(_0x3d21b3,_0x5a8f7a))['catch'](handleError(_0x3d21b3,null));};exports[_0xf44a('0x44')]=function(_0xe6dad6,_0x4e39a1){var _0x463f4e={'raw':!![],'where':{'id':_0xe6dad6[_0xf44a('0x45')]['id']}},_0xf9b9d0={};_0xf9b9d0[_0xf44a('0x35')]=_['keys'](db[_0xf44a('0x2d')][_0xf44a('0x2e')]);_0xf9b9d0[_0xf44a('0x31')]=_[_0xf44a('0x32')](_0xe6dad6['query']);_0xf9b9d0[_0xf44a('0x3c')]=_[_0xf44a('0x33')](_0xf9b9d0[_0xf44a('0x35')],_0xf9b9d0[_0xf44a('0x31')]);_0x463f4e[_0xf44a('0x34')]=_['intersection'](_0xf9b9d0[_0xf44a('0x35')],qs[_0xf44a('0x36')](_0xe6dad6['query'][_0xf44a('0x36')]));_0x463f4e[_0xf44a('0x34')]=_0x463f4e['attributes'][_0xf44a('0x37')]?_0x463f4e[_0xf44a('0x34')]:_0xf9b9d0['model'];if(_0xe6dad6[_0xf44a('0x31')]['includeAll']){_0x463f4e[_0xf44a('0x42')]=[{'all':!![]}];}_0x463f4e=_[_0xf44a('0x3f')]({},_0x463f4e,_0xe6dad6[_0xf44a('0x41')]);return db[_0xf44a('0x2d')]['find'](_0x463f4e)['then'](handleEntityNotFound(_0x4e39a1,null))['then'](respondWithResult(_0x4e39a1,null))[_0xf44a('0x46')](handleError(_0x4e39a1,null));};exports[_0xf44a('0x47')]=function(_0x16b1d4,_0x566ef7,_0x57ba70){return db[_0xf44a('0x2d')][_0xf44a('0x48')]({'where':{'id':_0x16b1d4[_0xf44a('0x45')]['id']},'attributes':[_0xf44a('0x2a'),_0xf44a('0x5')],'raw':!![]})[_0xf44a('0x26')](handleEntityNotFound(_0x566ef7,null))[_0xf44a('0x26')](function(_0x4b9735){if(_0x4b9735){var _0x4ace94=path[_0xf44a('0x49')](config[_0xf44a('0x4a')],_0xf44a('0x4b'),util[_0xf44a('0x4c')](_0xf44a('0x4d'),path['basename'](_0x4b9735['path'])));var _0x1f6133=fs[_0xf44a('0x4e')](_0x4ace94);var _0x29358f=archiver(_0xf44a('0x4f'),{'zlib':{'level':0x9}});_0x29358f['on'](_0xf44a('0x50'),function(_0x9900bf){if(_0x9900bf[_0xf44a('0x51')]===_0xf44a('0x52')){logger['error'](_0x9900bf);}else{throw new db['Sequelize'][(_0xf44a('0x53'))](_0xf44a('0x54'));}});_0x29358f['on']('error',function(_0x58abcc){throw new db[(_0xf44a('0x55'))]['Error'](_0xf44a('0x54'));});_0x29358f[_0xf44a('0x56')](_0x1f6133);_0x29358f[_0xf44a('0x57')]('**/*',{'cwd':path[_0xf44a('0x49')](config[_0xf44a('0x4a')],_0xf44a('0x4b'),path[_0xf44a('0x58')](_0x4b9735[_0xf44a('0x5')])),'ignore':[path[_0xf44a('0x49')](path[_0xf44a('0x59')](_0x4b9735[_0xf44a('0x5')]),_0xf44a('0x5a')),path[_0xf44a('0x49')](path[_0xf44a('0x59')](_0x4b9735[_0xf44a('0x5')]),_0xf44a('0x5b'))],'nodir':!![]})[_0xf44a('0x5c')]();_0x1f6133['on'](_0xf44a('0x5d'),function(){if(!fs[_0xf44a('0x5e')](_0x4ace94)){throw new db['Sequelize']['Error'](_0xf44a('0x5f'));}return _0x566ef7[_0xf44a('0x47')](_0x4ace94,util[_0xf44a('0x4c')](_0xf44a('0x4d'),path[_0xf44a('0x59')](_0x4b9735[_0xf44a('0x5')])),function(_0x1e0c58){if(_0x1e0c58){throw new db[(_0xf44a('0x55'))]['Error'](_0xf44a('0x60'));}fs[_0xf44a('0x61')](_0x4ace94);logger['info']('Download\x20completed');logger[_0xf44a('0x62')](_0xf44a('0x63'));});});}return null;})[_0xf44a('0x46')](handleError(_0x566ef7,null));};exports[_0xf44a('0x64')]=function(_0x1de3bb,_0x2c9083,_0x232940){var _0x520f94=path['basename'](_0x1de3bb[_0xf44a('0x65')][_0xf44a('0x66')],path[_0xf44a('0x67')](_0x1de3bb[_0xf44a('0x65')][_0xf44a('0x66')]));var _0x37e361=path[_0xf44a('0x49')](config[_0xf44a('0x4a')],_0xf44a('0x4b'),_0x1de3bb[_0xf44a('0x65')][_0xf44a('0x66')]);var _0x314d5d=path['join'](config[_0xf44a('0x4a')],'server/files/plugins',_0x520f94);logger[_0xf44a('0x62')]('Plugin\x20upload\x20filepath:\x20%s',_0x37e361);logger['info'](_0xf44a('0x68'),_0x314d5d);try{fs[_0xf44a('0x69')](_0x37e361,parseInt('0777',0x8));extract(_0x37e361,{'dir':_0x314d5d},function(_0x4f8bc7){if(_0x4f8bc7){logger[_0xf44a('0x29')](_0x4f8bc7);handleError(_0x4f8bc7,!![]);};var _0x5874bd=fs[_0xf44a('0x6a')](_0x314d5d);if(_0x5874bd['length']>0x1){removeReferences(_0x37e361,_0x314d5d);logger['error'](_0xf44a('0x6b'));return _0x232940(new Error(_0xf44a('0x6b')));}var _0x5f190d=fs['lstatSync'](path['join'](_0x314d5d,_0x5874bd[0x0]));if(_0x5f190d[_0xf44a('0x6c')]()){removeReferences(_0x37e361,_0x314d5d);logger[_0xf44a('0x29')](_0xf44a('0x6b'));return _0x232940(new Error(_0xf44a('0x6b')));}if(_0x5f190d[_0xf44a('0x6d')]()){var _0x6067d6=fs['readdirSync'](path[_0xf44a('0x49')](_0x314d5d,_0x5874bd[0x0]));if(_0x6067d6[_0xf44a('0x37')]===0x0){removeReferences(_0x37e361,_0x314d5d);logger[_0xf44a('0x29')](_0xf44a('0x6b'));return _0x232940(new Error(_0xf44a('0x6b')));}var _0x59e3a9=_0x6067d6[_0xf44a('0x6e')](function(_0x591f85){return _0x591f85===_0xf44a('0x6f');});if(!_0x59e3a9){return _0x232940(new Error(_0xf44a('0x70')));}var _0xfdcebf=fs[_0xf44a('0x71')](path[_0xf44a('0x49')](_0x314d5d,_0x5874bd[0x0],'manifest.json'));var _0x53db1e=JSON[_0xf44a('0x72')](_0xfdcebf);if(_0xf44a('0x20')==typeof _0x53db1e['name']){return _0x232940(new Error(_0xf44a('0x73')));}if(_0xf44a('0x20')==typeof _0x53db1e[_0xf44a('0x40')]){return _0x232940(new Error(_0xf44a('0x74')));}if('undefined'==typeof _0x53db1e[_0xf44a('0x75')]){return _0x232940(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xf44a('0x20')==typeof _0x53db1e[_0xf44a('0x76')]){return _0x232940(new Error(_0xf44a('0x77')));}if(_0x53db1e['type']==='html'){if(_0xf44a('0x20')==typeof _0x53db1e[_0xf44a('0x76')][_0xf44a('0x78')]){return _0x232940(new Error(_0xf44a('0x79')));}if('undefined'==typeof _0x53db1e[_0xf44a('0x76')]['views'][_0xf44a('0x7a')]&&'undefined'==typeof _0x53db1e[_0xf44a('0x76')][_0xf44a('0x78')][_0xf44a('0x7b')]){return _0x232940(new Error(_0xf44a('0x7c')));}}else if(_0x53db1e['type']==='script'){if(_0xf44a('0x20')==typeof _0x53db1e[_0xf44a('0x76')][_0xf44a('0x7d')]){return _0x232940(new Error(_0xf44a('0x7e')));}if('undefined'==typeof _0x53db1e[_0xf44a('0x76')][_0xf44a('0x7f')]){return _0x232940(new Error(_0xf44a('0x80')));}}else{return _0x232940(new Error(_0xf44a('0x81')));}var _0x1ae87f=_0x53db1e[_0xf44a('0x2a')];var _0x15ead7=_0x53db1e[_0xf44a('0x82')];var _0x393e72=_0x53db1e['type'];var _0x1f4f79=_0x53db1e[_0xf44a('0x83')]?_0x53db1e[_0xf44a('0x83')]:_0xf44a('0x84');var _0xf7fe9f=_0x53db1e[_0xf44a('0x85')]?_0x53db1e[_0xf44a('0x85')]:_0xf44a('0x86');var _0x434409='';var _0x232915='';var _0x124f02='';var _0x4047e6='';var _0x527497=_0x53db1e[_0xf44a('0x75')];if(_0x393e72===_0xf44a('0x87')){if(_0xf44a('0x20')!=typeof _0x53db1e['parameters'][_0xf44a('0x78')][_0xf44a('0x7a')]){var _0x3de82c=_0x53db1e[_0xf44a('0x76')]['views'][_0xf44a('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0xf44a('0x88')](_0x3de82c)){_0x434409=path[_0xf44a('0x49')](_0xf44a('0x89'),_0x520f94,_0x5874bd[0x0],_0x3de82c);}else{_0x434409=_0x3de82c;}}else{logger[_0xf44a('0x62')](_0xf44a('0x8a'));}if(_0xf44a('0x20')!=typeof _0x53db1e['parameters']['views'][_0xf44a('0x7b')]){var _0x722b4e=_0x53db1e[_0xf44a('0x76')][_0xf44a('0x78')][_0xf44a('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xf44a('0x88')](_0x722b4e)){_0x232915=path[_0xf44a('0x49')]('plugins',_0x520f94,_0x5874bd[0x0],_0x722b4e);}else{_0x232915=_0x722b4e;}}else{logger[_0xf44a('0x62')](_0xf44a('0x8b'));}}else if(_0x393e72===_0xf44a('0x8c')){_0x124f02=_0x53db1e[_0xf44a('0x76')][_0xf44a('0x7d')];_0x4047e6=_0x53db1e[_0xf44a('0x76')][_0xf44a('0x7f')];if(_0xf44a('0x20')!=typeof _0x53db1e[_0xf44a('0x76')][_0xf44a('0x78')]){if('undefined'!=typeof _0x53db1e['parameters']['views'][_0xf44a('0x7a')]){var _0x3de82c=_0x53db1e[_0xf44a('0x76')][_0xf44a('0x78')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xf44a('0x88')](_0x3de82c)){_0x434409=path[_0xf44a('0x49')](_0xf44a('0x89'),_0x520f94,_0x5874bd[0x0],_0x3de82c);}else{_0x434409=_0x3de82c;}}if('undefined'!=typeof _0x53db1e['parameters'][_0xf44a('0x78')][_0xf44a('0x7b')]){var _0x722b4e=_0x53db1e['parameters'][_0xf44a('0x78')][_0xf44a('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xf44a('0x88')](_0x722b4e)){_0x232915=path[_0xf44a('0x49')](_0xf44a('0x89'),_0x520f94,_0x5874bd[0x0],_0x722b4e);}else{_0x232915=_0x722b4e;}}}}var _0x777126={'name':_0x1ae87f,'description':_0x15ead7,'path':path[_0xf44a('0x49')](_0x520f94,_0x5874bd[0x0]),'type':_0x393e72,'sidebar':_0x1f4f79,'icon':_0xf7fe9f,'adminUrl':_0x434409,'agentUrl':_0x232915,'scriptName':_0x124f02,'scriptPath':_0x4047e6,'version':_0x527497};removeReferences(_0x37e361,null);return db['Plugin'][_0xf44a('0x8d')](_0x777126)[_0xf44a('0x26')](function(_0x5cbcf5){var _0x598e57={'role':_0x1de3bb['body'][_0xf44a('0x8e')],'userProfileId':_0x1de3bb['body'][_0xf44a('0x8f')]};if(!_0x598e57)throw new Error(_0xf44a('0x90'));if(_0x598e57[_0xf44a('0x8e')]===_0xf44a('0x91')){var _0x5d0018=_0x5cbcf5[_0xf44a('0x92')]({'plain':!![]});return db['UserProfileSection'][_0xf44a('0x48')]({'where':{'name':_0xf44a('0x28'),'userProfileId':_0x598e57[_0xf44a('0x8f')]},'raw':!![]})[_0xf44a('0x26')](function(_0x467457){if(_0x467457&&_0x467457[_0xf44a('0x93')]===0x0){return db[_0xf44a('0x94')][_0xf44a('0x8d')]({'name':_0x5d0018[_0xf44a('0x2a')],'resourceId':_0x5d0018['id'],'type':_0x467457[_0xf44a('0x2a')],'sectionId':_0x467457['id']},{})[_0xf44a('0x26')](function(){return _0x5cbcf5;});}else{return _0x5cbcf5;}})[_0xf44a('0x46')](function(_0x5c05b0){logger[_0xf44a('0x29')](_0xf44a('0x95'),_0x5c05b0);throw _0x5c05b0;});}return _0x5cbcf5;})['then'](respondWithResult(_0x2c9083,null))[_0xf44a('0x46')](handleError(_0x2c9083,null));}});}catch(_0x3fe66e){_0x2c9083['status'](0x1f4)['send'](_0x3fe66e);}};function removeReferences(_0x11d67c,_0x567b92){try{if(_0x11d67c){fs[_0xf44a('0x61')](_0x11d67c);logger[_0xf44a('0x62')](_0xf44a('0x96'));}if(_0x567b92){rimraf(_0x567b92,function(){});logger[_0xf44a('0x62')](_0xf44a('0x97'));}}catch(_0xae778b){logger[_0xf44a('0x29')](_0xae778b);}}exports['update']=function(_0x58fff1,_0x241b9d,_0x5336d6){return db[_0xf44a('0x2d')][_0xf44a('0x48')]({'where':{'id':_0x58fff1[_0xf44a('0x45')]['id']}})[_0xf44a('0x26')](handleEntityNotFound(_0x241b9d,null))['then'](saveUpdates(_0x58fff1[_0xf44a('0x98')],null))['then'](respondWithResult(_0x241b9d,null))[_0xf44a('0x46')](handleError(_0x241b9d,null));};exports[_0xf44a('0x99')]=function(_0x59daf4,_0x3ec389,_0x1b3ef6){return db['Plugin'][_0xf44a('0x48')]({'where':{'id':_0x59daf4['params']['id']}})['then'](function(_0x4942fe){if(_0x4942fe){return _0x4942fe[_0xf44a('0x27')]();}})[_0xf44a('0x26')](function(_0x58242e){rimraf(path[_0xf44a('0x49')](config[_0xf44a('0x4a')],_0xf44a('0x4b'),path[_0xf44a('0x58')](_0x58242e[_0xf44a('0x5')])),function(){});return _0x58242e;})[_0xf44a('0x26')](handleEntityNotFound(_0x3ec389,null))[_0xf44a('0x26')](respondWithStatusCode(_0x3ec389,null))[_0xf44a('0x46')](handleError(_0x3ec389,null));};exports['webhookGet']=function(_0x5e52d8,_0x4be93f,_0x103b64){return BPromise[_0xf44a('0x9a')]()[_0xf44a('0x26')](function(){if(!_0x5e52d8['query'][_0xf44a('0x5')]){throw new Error(_0xf44a('0x9b'));}if(!_0x5e52d8[_0xf44a('0x31')][_0xf44a('0x9c')]){throw new Error(_0xf44a('0x9d'));}var _0x55c6c1=_0x5e52d8[_0xf44a('0x31')][_0xf44a('0x9e')]?_0x5e52d8[_0xf44a('0x31')][_0xf44a('0x9e')]+':'+_0x5e52d8[_0xf44a('0x31')][_0xf44a('0x9c')]:'http://localhost:'+_0x5e52d8[_0xf44a('0x31')][_0xf44a('0x9c')];var _0x447598=_0x5e52d8['query'][_0xf44a('0x1e')]?_0x5e52d8[_0xf44a('0x31')][_0xf44a('0x1e')]:!![];var _0x895724=_0x5e52d8[_0xf44a('0x31')][_0xf44a('0x9f')]?_0x5e52d8[_0xf44a('0x31')]['encoding']:null;var _0x1524c9={'method':_0x5e52d8[_0xf44a('0xa0')],'uri':util[_0xf44a('0x4c')](_0xf44a('0xa1'),_0x55c6c1,_0x5e52d8[_0xf44a('0x31')][_0xf44a('0x5')]),'json':_0x447598,'resolveWithFullResponse':!![],'encoding':_0x895724,'qs':_0x5e52d8[_0xf44a('0x31')]};if(_0x5e52d8[_0xf44a('0xa2')]){_0x1524c9[_0xf44a('0xa2')]=_0x5e52d8[_0xf44a('0xa2')];if(_0x1524c9[_0xf44a('0xa2')][_0xf44a('0xa3')]){delete _0x1524c9[_0xf44a('0xa2')][_0xf44a('0xa3')];}}if(_0x1524c9[_0xf44a('0xa2')]['content-type']){delete _0x1524c9[_0xf44a('0xa2')][_0xf44a('0xa4')];}return rp(_0x1524c9);})[_0xf44a('0x26')](function(_0x5df85a){if(_0x5df85a){_0x4be93f[_0xf44a('0x23')](_0x5df85a[_0xf44a('0xa2')]);logger[_0xf44a('0x62')](_0x5df85a[_0xf44a('0x98')]);if(_[_0xf44a('0xa5')](_0x5e52d8[_0xf44a('0x31')][_0xf44a('0x5')],'download')&&_0x5df85a[_0xf44a('0xa6')]==0x1f4){return _0x4be93f['sendStatus'](_0x5df85a[_0xf44a('0xa6')]);}else{return _0x4be93f['status'](_0x5df85a['statusCode'])['send'](_0x5df85a['body']);}}else{return _0x4be93f[_0xf44a('0x1b')](0xc8);}})[_0xf44a('0x46')](handleError(_0x4be93f,null));};exports[_0xf44a('0xa7')]=function(_0x39d8b8,_0xaaa565,_0x3b93e9){return BPromise[_0xf44a('0x9a')]()['then'](function(){if(!_0x39d8b8[_0xf44a('0x31')][_0xf44a('0x5')]){throw new Error(_0xf44a('0x9b'));}if(!_0x39d8b8[_0xf44a('0x31')][_0xf44a('0x9c')]){throw new Error(_0xf44a('0x9d'));}var _0x396a07=_0x39d8b8[_0xf44a('0x31')][_0xf44a('0x9e')]?_0x39d8b8[_0xf44a('0x31')][_0xf44a('0x9e')]+':'+_0x39d8b8[_0xf44a('0x31')][_0xf44a('0x9c')]:_0xf44a('0xa8')+_0x39d8b8[_0xf44a('0x31')][_0xf44a('0x9c')];var _0xf28713=_0x39d8b8[_0xf44a('0x31')][_0xf44a('0x1e')]?_0x39d8b8['query'][_0xf44a('0x1e')]:!![];var _0x1a4163=_0x39d8b8['query'][_0xf44a('0x9f')]?_0x39d8b8[_0xf44a('0x31')][_0xf44a('0x9f')]:null;var _0x53f4bb={'method':_0x39d8b8[_0xf44a('0xa0')],'uri':util[_0xf44a('0x4c')](_0xf44a('0xa1'),_0x396a07,_0x39d8b8['query'][_0xf44a('0x5')]),'json':_0xf28713,'resolveWithFullResponse':!![],'encoding':_0x1a4163,'body':_0x39d8b8[_0xf44a('0x98')]};if(_0x39d8b8['headers']){_0x53f4bb[_0xf44a('0xa2')]=_0x39d8b8[_0xf44a('0xa2')];if(_0x53f4bb[_0xf44a('0xa2')][_0xf44a('0xa3')]){delete _0x53f4bb[_0xf44a('0xa2')][_0xf44a('0xa3')];}}if(_0x53f4bb['headers'][_0xf44a('0xa4')]){delete _0x53f4bb[_0xf44a('0xa2')][_0xf44a('0xa4')];}return rp(_0x53f4bb);})[_0xf44a('0x26')](function(_0x1f70a2){if(_0x1f70a2){_0xaaa565[_0xf44a('0x23')](_0x1f70a2[_0xf44a('0xa2')]);logger['info'](_0x1f70a2['body']);return _0xaaa565[_0xf44a('0x1d')](_0x1f70a2[_0xf44a('0xa6')])[_0xf44a('0x2b')](_0x1f70a2['body']);}else{return _0xaaa565[_0xf44a('0x1b')](0xc8);}})[_0xf44a('0x46')](handleError(_0xaaa565,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index b1da46f..1ee5a8f 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 _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 +var _0xbb67=['hook','../../mysqldb','Plugin','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0xbb67,0x161));var _0x7bb6=function(_0x4ae14f,_0x13c217){_0x4ae14f=_0x4ae14f-0x0;var _0x23631b=_0xbb67[_0x4ae14f];return _0x23631b;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x7bb6('0x0'))['db'][_0x7bb6('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x7bb6('0x2')](0x0);var events={'afterCreate':_0x7bb6('0x3'),'afterUpdate':_0x7bb6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x33a5c4){return function(_0x2c1ddb,_0x1f527c,_0x7fb7c9){PluginEvents[_0x7bb6('0x5')](_0x33a5c4+':'+_0x2c1ddb['id'],_0x2c1ddb);PluginEvents[_0x7bb6('0x5')](_0x33a5c4,_0x2c1ddb);_0x7fb7c9(null);};}for(var e in events){if(events[_0x7bb6('0x6')](e)){var event=events[e];Plugin[_0x7bb6('0x7')](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 159863a..38c436f 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 _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 +var _0x92d2=['exports','define','Plugin','plugins','lodash','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes'];(function(_0x3d05d0,_0xf4f18f){var _0x4b1f5a=function(_0x1f759f){while(--_0x1f759f){_0x3d05d0['push'](_0x3d05d0['shift']());}};_0x4b1f5a(++_0xf4f18f);}(_0x92d2,0x67));var _0x292d=function(_0x4a95a2,_0x1bc2a5){_0x4a95a2=_0x4a95a2-0x0;var _0x509a3a=_0x92d2[_0x4a95a2];return _0x509a3a;};'use strict';var _=require(_0x292d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x292d('0x1'));var rp=require(_0x292d('0x2'));var fs=require('fs');var path=require(_0x292d('0x3'));var rimraf=require(_0x292d('0x4'));var config=require(_0x292d('0x5'));var attributes=require(_0x292d('0x6'));module[_0x292d('0x7')]=function(_0x1bc3cb,_0x2f8387){return _0x1bc3cb[_0x292d('0x8')](_0x292d('0x9'),attributes,{'tableName':_0x292d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 67273c6..8559496 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 _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 +var _0x95ba=['stringify','error','code','message','result','CreatePlugin','Plugin','create','body','options','raw','info','catch','lodash','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x95ba,0x70));var _0xa95b=function(_0x3f8e9f,_0x5e58da){_0x3f8e9f=_0x3f8e9f-0x0;var _0x4777a3=_0x95ba[_0x3f8e9f];return _0x4777a3;};'use strict';var _=require(_0xa95b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa95b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa95b('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa95b('0x3'))(_0xa95b('0x4'));var config=require('../../config/environment');var jayson=require(_0xa95b('0x5'));var client=jayson[_0xa95b('0x6')][_0xa95b('0x7')]({'port':0x232a});config[_0xa95b('0x8')]=_[_0xa95b('0x9')](config[_0xa95b('0x8')],{'host':_0xa95b('0xa'),'port':0x18eb});var socket=require(_0xa95b('0xb'))(new Redis(config[_0xa95b('0x8')]));require(_0xa95b('0xc'))[_0xa95b('0xd')](socket);function respondWithRpcPromise(_0x237c23,_0x2a03bd,_0x4c2b12){return new BPromise(function(_0x445dbf,_0x46cab3){return client[_0xa95b('0xe')](_0x237c23,_0x4c2b12)[_0xa95b('0xf')](function(_0x50c1c8){logger['info'](_0xa95b('0x10'),_0x2a03bd,_0xa95b('0x11'));logger[_0xa95b('0x12')](_0xa95b('0x13'),_0x2a03bd,_0xa95b('0x11'),JSON[_0xa95b('0x14')](_0x50c1c8));if(_0x50c1c8['error']){if(_0x50c1c8[_0xa95b('0x15')][_0xa95b('0x16')]===0x1f4){logger[_0xa95b('0x15')](_0xa95b('0x10'),_0x2a03bd,_0x50c1c8['error']['message']);return _0x46cab3(_0x50c1c8[_0xa95b('0x15')][_0xa95b('0x17')]);}logger[_0xa95b('0x15')](_0xa95b('0x10'),_0x2a03bd,_0x50c1c8[_0xa95b('0x15')][_0xa95b('0x17')]);return _0x445dbf(_0x50c1c8[_0xa95b('0x15')][_0xa95b('0x17')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x2a03bd,_0xa95b('0x11'));_0x445dbf(_0x50c1c8[_0xa95b('0x18')][_0xa95b('0x17')]);}})['catch'](function(_0x30caa2){logger[_0xa95b('0x15')]('Plugin,\x20%s,\x20%s',_0x2a03bd,_0x30caa2);_0x46cab3(_0x30caa2);});});}exports[_0xa95b('0x19')]=function(_0x46d0ce){var _0xd3ef6f=this;return new Promise(function(_0x307d8c,_0x11fb02){return db[_0xa95b('0x1a')][_0xa95b('0x1b')](_0x46d0ce[_0xa95b('0x1c')],{'raw':_0x46d0ce['options']?_0x46d0ce[_0xa95b('0x1d')][_0xa95b('0x1e')]===undefined?!![]:![]:!![]})[_0xa95b('0xf')](function(_0xc32f8e){logger[_0xa95b('0x1f')](_0xa95b('0x19'),_0x46d0ce);logger[_0xa95b('0x12')](_0xa95b('0x19'),_0x46d0ce,JSON[_0xa95b('0x14')](_0xc32f8e));_0x307d8c(_0xc32f8e);})[_0xa95b('0x20')](function(_0x35c582){logger[_0xa95b('0x15')](_0xa95b('0x19'),_0x35c582['message'],_0x46d0ce);_0x11fb02(_0xd3ef6f[_0xa95b('0x15')](0x1f4,_0x35c582['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index dc1599e..3729f9c 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 _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 +var _0x3519=['update','emit','removeListener','length','save','remove'];(function(_0x3add58,_0x49ee99){var _0x3d655e=function(_0x186437){while(--_0x186437){_0x3add58['push'](_0x3add58['shift']());}};_0x3d655e(++_0x49ee99);}(_0x3519,0x1b4));var _0x9351=function(_0x5184d5,_0x57e7e9){_0x5184d5=_0x5184d5-0x0;var _0x21f67b=_0x3519[_0x5184d5];return _0x21f67b;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x9351('0x0'),_0x9351('0x1'),_0x9351('0x2')];function createListener(_0x4d01b3,_0x5c7ef5){return function(_0x2dde47){_0x5c7ef5[_0x9351('0x3')](_0x4d01b3,_0x2dde47);};}function removeListener(_0x511ffc,_0x23d55){return function(){PluginEvents[_0x9351('0x4')](_0x511ffc,_0x23d55);};}exports['register']=function(_0x1ffe42){for(var _0x31b219=0x0,_0x3776f0=events[_0x9351('0x5')];_0x31b219<_0x3776f0;_0x31b219++){var _0x2dd0d1=events[_0x31b219];var _0x5769de=createListener('plugin:'+_0x2dd0d1,_0x1ffe42);PluginEvents['on'](_0x2dd0d1,_0x5769de);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index f88fb79..824064f 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(_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 +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x64ce40,_0x21507d){var _0x41a783=function(_0xc2fcef){while(--_0xc2fcef){_0x64ce40['push'](_0x64ce40['shift']());}};_0x41a783(++_0x21507d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 f57040f..6072c9c 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 _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 +var _0xbfcc=['exec','sendStatus','json','stack','name','status','send','npm\x20install','info','error','index','list','then','reject','express','motion2','catch','show','params','create','body','script','../../files/plugins','start','dump','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','api','path','child_process'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x23c6f2,_0x4e033c){_0x23c6f2=_0x23c6f2-0x0;var _0x4c270b=_0xbfcc[_0x23c6f2];return _0x4c270b;};'use strict';var _=require(_0xcbfc('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0xcbfc('0x1'));var path=require(_0xcbfc('0x2'));var exec=require(_0xcbfc('0x3'))[_0xcbfc('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x59b1de,_0x54f81b){return function(_0x4b8361){if(!_0x4b8361){_0x59b1de[_0xcbfc('0x5')](0x194);;}return _0x4b8361;};}function respondWithResult(_0x2dbb05,_0x537813){_0x537813=_0x537813||0xc8;return function(_0x1b3917){if(_0x1b3917){return _0x2dbb05['status'](_0x537813)[_0xcbfc('0x6')](_0x1b3917);}return null;};}function handleError(_0x1f8b71,_0x1b1377){_0x1b1377=_0x1b1377||0x1f4;return function(_0xa1c83b){logger['error'](_0xa1c83b[_0xcbfc('0x7')]);if(_0xa1c83b[_0xcbfc('0x8')]){delete _0xa1c83b[_0xcbfc('0x8')];}_0x1f8b71[_0xcbfc('0x9')](_0x1b1377)[_0xcbfc('0xa')](_0xa1c83b);};}function execChildProcess(){return new BPromise(function(_0x3498c7,_0x4b34aa){exec(_0xcbfc('0xb'),function(_0x376a4c,_0x1e0d79,_0xbbb176){logger[_0xcbfc('0xc')](_0x1e0d79);logger['info'](_0xbbb176);if(_0x376a4c){logger[_0xcbfc('0xd')](_0x376a4c);return _0x4b34aa(_0x376a4c);}return _0x3498c7(_0x1e0d79);});});}exports[_0xcbfc('0xe')]=function(_0x80d08d,_0x5ba249){return pm2[_0xcbfc('0xf')]()[_0xcbfc('0x10')](function(_0x2f2bdd){if(_0x2f2bdd){var _0x45a5cc=_[_0xcbfc('0x11')](_0x2f2bdd,function(_0x53a7ea){return _0x53a7ea[_0xcbfc('0x8')]===_0xcbfc('0x12')||_0x53a7ea[_0xcbfc('0x8')]===_0xcbfc('0x13');});return{'rows':_0x45a5cc,'count':_0x45a5cc['length']};}return null;})['then'](respondWithResult(_0x5ba249,null))[_0xcbfc('0x14')](handleError(_0x5ba249,null));};exports[_0xcbfc('0x15')]=function(_0xa65368,_0x4d6946){return pm2['describe'](_0xa65368[_0xcbfc('0x16')]['id'])[_0xcbfc('0x10')](respondWithResult(_0x4d6946,null))[_0xcbfc('0x10')](handleEntityNotFound(_0x4d6946,null))['catch'](handleError(_0x4d6946,null));};exports[_0xcbfc('0x17')]=function(_0x552777,_0x28f7fb){if(_0x552777[_0xcbfc('0x18')][_0xcbfc('0x8')]&&_0x552777[_0xcbfc('0x18')][_0xcbfc('0x19')]){var _0x2653b1=path['join'](__dirname,_0xcbfc('0x1a'),_0x552777[_0xcbfc('0x18')]['script']);var _0x1da958=process['cwd']();process['chdir'](path['dirname'](_0x2653b1));return execChildProcess()[_0xcbfc('0x10')](function(_0x4a0fcb){process['chdir'](_0x1da958);return pm2[_0xcbfc('0x1b')]({'name':_0x552777[_0xcbfc('0x18')][_0xcbfc('0x8')],'script':_0x2653b1});})[_0xcbfc('0x10')](function(_0x49f5bf){pm2[_0xcbfc('0x1c')]();return _0x49f5bf[0x0];})['then'](respondWithResult(_0x28f7fb,0xc9))[_0xcbfc('0x14')](handleError(_0x28f7fb,null));}else{return _0x28f7fb[_0xcbfc('0x9')](0x1f4)['send']({'message':_0xcbfc('0x1d')});}};exports[_0xcbfc('0x1e')]=function(_0x4ab48e,_0x1b2c01){if(_0x4ab48e[_0xcbfc('0x18')]['id']){delete _0x4ab48e[_0xcbfc('0x18')]['id'];}var _0x41f3b8={'online':'restart','stopped':_0xcbfc('0x1f')};if(_0x41f3b8[_0xcbfc('0x20')](_0x4ab48e['body'][_0xcbfc('0x9')])){return pm2[_0x41f3b8[_0x4ab48e[_0xcbfc('0x18')][_0xcbfc('0x9')]]](_0x4ab48e[_0xcbfc('0x16')]['id'])[_0xcbfc('0x10')](respondWithResult(_0x1b2c01,0xc8))[_0xcbfc('0x14')](handleError(_0x1b2c01,null));}else{return _0x1b2c01[_0xcbfc('0x9')](0x1f4)['send']({'message':_0xcbfc('0x21')});}};exports[_0xcbfc('0x22')]=function(_0x3f9d20,_0x20a378){if(_0x3f9d20['body']['id']){delete _0x3f9d20[_0xcbfc('0x18')]['id'];}if(_0x3f9d20[_0xcbfc('0x16')]['id']){return pm2[_0xcbfc('0x23')](_0x3f9d20[_0xcbfc('0x16')]['id'])[_0xcbfc('0x10')](function(_0x34baa6){pm2[_0xcbfc('0x1c')]();return _0x34baa6[0x0];})['then'](respondWithResult(_0x20a378,null))[_0xcbfc('0x14')](handleError(_0x20a378,null));}else{return _0x20a378[_0xcbfc('0x9')](0x1f4)['send']({'message':_0xcbfc('0x24')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 784af6d..e2bb1c6 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 _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 +var _0x15ef=['./realtime.controller','get','/agents','isAuthenticated','getAgents','exports','express','Router','../../components/auth/service'];(function(_0x122983,_0x3a9e38){var _0x596f84=function(_0x3e46ee){while(--_0x3e46ee){_0x122983['push'](_0x122983['shift']());}};_0x596f84(++_0x3a9e38);}(_0x15ef,0x1b6));var _0xf15e=function(_0x4f2631,_0x88cbf7){_0x4f2631=_0x4f2631-0x0;var _0x2d2f74=_0x15ef[_0x4f2631];return _0x2d2f74;};'use strict';var express=require(_0xf15e('0x0'));var router=express[_0xf15e('0x1')]();var auth=require(_0xf15e('0x2'));var controller=require(_0xf15e('0x3'));router[_0xf15e('0x4')](_0xf15e('0x5'),auth[_0xf15e('0x6')](),controller[_0xf15e('0x7')]);router[_0xf15e('0x4')]('/queues',auth[_0xf15e('0x6')](),controller['getQueues']);module[_0xf15e('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index b2ed8d2..fca7118 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 _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 +var _0xf917=['join','getAgentIdsByQueues','getRealtimeAgents','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','User','rawAttributes','fieldName','type','key','role','agent','online','getOptions','raw','push','sequelize','literal','FIELD(id,','order','forEach','Pause','merge','where','user','Agents','assign','UserProfile','findAndCountAll','rows','map','find','getAgentStatus','sortAgentsByStatus','fields','split','pick','getQueues','format','Channel\x20parameter\x20%s\x20is\x20invalid','startCase','Queue','name','outbound','dialActive','userProfileId','voice','QueueCampaigns','Queues','filter','getResources','getRealtimeQueues','util','../../components/parsers/qs','../../config/utils','../../mysqldb','APIBadRequestError','../../errors/api','handleError','undefined','count','offset','limit','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','then','channel','isValidChannel','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions'];(function(_0x24f053,_0x2c4af1){var _0x3674f4=function(_0x28c615){while(--_0x28c615){_0x24f053['push'](_0x24f053['shift']());}};_0x3674f4(++_0x2c4af1);}(_0xf917,0x8b));var _0x7f91=function(_0x73ba1f,_0x588ccb){_0x73ba1f=_0x73ba1f-0x0;var _0x2e2725=_0xf917[_0x73ba1f];return _0x2e2725;};'use strict';var _=require('lodash');var util=require(_0x7f91('0x0'));var rta=require('../../components/realtime/agents');var rtq=require('../../components/realtime/queues');var qs=require(_0x7f91('0x1'));var utils=require(_0x7f91('0x2'));var db=require(_0x7f91('0x3'))['db'];var APIBadRequestError=require('../../errors/api')[_0x7f91('0x4')];var APIHandleError=require(_0x7f91('0x5'))[_0x7f91('0x6')];function respondWithFilteredResult(_0x2729bf,_0x165c24){return function(_0x572853){if(_0x572853){var _0x20c416=typeof _0x165c24['offset']===_0x7f91('0x7')&&typeof _0x165c24['limit']==='undefined';var _0x5e757a=_0x572853[_0x7f91('0x8')];var _0xb80de5=_0x20c416?0x0:_0x165c24[_0x7f91('0x9')];var _0x4dee95=_0x20c416?_0x572853[_0x7f91('0x8')]:_0x165c24[_0x7f91('0x9')]+_0x165c24[_0x7f91('0xa')];var _0x359079;if(_0x4dee95>=_0x5e757a){_0x4dee95=_0x5e757a;_0x359079=0xc8;}else{_0x359079=0xce;}_0x2729bf[_0x7f91('0xb')](_0x359079);return _0x2729bf[_0x7f91('0xc')](_0x7f91('0xd'),_0xb80de5+'-'+_0x4dee95+'/'+_0x5e757a)[_0x7f91('0xe')](_0x572853);}return null;};}exports[_0x7f91('0xf')]=function(_0x3d0959,_0x5603d1){var _0x4f1a85={'count':0x0,'rows':[]};var _0x3e6416={};var _0x547918;var _0x318a26=utils[_0x7f91('0x10')]();var _0x2c9295;var _0x133a88;var _0x3e1314=_0x3d0959[_0x7f91('0x11')][_0x7f91('0x12')];var _0x165f0a=_0x3d0959['query'][_0x7f91('0x13')];var _0x4a4848=_0x3d0959[_0x7f91('0x11')][_0x7f91('0x14')];var _0x4dbbc0=_0x165f0a===_0x7f91('0x15')||_0x165f0a===_0x7f91('0x16')?!![]:![];var _0x417b67=[];var _0x3c6da7;var _0x438b0a;Promise[_0x7f91('0x17')]()[_0x7f91('0x18')](function(){if(_0x3d0959['query'][_0x7f91('0x19')]){if(!utils[_0x7f91('0x1a')](_0x3d0959[_0x7f91('0x11')][_0x7f91('0x19')])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x3d0959[_0x7f91('0x11')][_0x7f91('0x19')]));}_0x547918=_0x3d0959['query']['channel'][_0x7f91('0x1b')]();}if(!_0x3d0959[_0x7f91('0x11')][_0x7f91('0x1c')]||!_0x3d0959[_0x7f91('0x11')][_0x7f91('0x1c')][_0x7f91('0x1d')](_0x7f91('0x1e'))){_0x3d0959[_0x7f91('0x11')][_0x7f91('0x1c')]=rta[_0x7f91('0x1f')](_0x3d0959[_0x7f91('0x11')][_0x7f91('0x1c')]);return;}var _0x528c73=rta[_0x7f91('0x20')](_0x3d0959[_0x7f91('0x11')][_0x7f91('0x1c')]);_0x3d0959['query']['sort']=_0x528c73['fields'][_0x7f91('0x21')](',');_0x3c6da7=_0x528c73['order'];})[_0x7f91('0x18')](function(){if(!_0x3e1314){return[];}return rta[_0x7f91('0x22')](_0x3e1314,_0x547918);})['then'](function(_0xdb541b){_0x417b67=_0xdb541b;return rta[_0x7f91('0x23')]();})[_0x7f91('0x18')](function(_0x4a5340){_0x133a88=_0x4a5340['rows'];if((!_0x165f0a||_0x4dbbc0)&&!_0x3c6da7){return _0x417b67;}if(_0x3c6da7&&!_0x165f0a){return rta[_0x7f91('0x24')](_0x133a88,_0x417b67,_0x3c6da7);}else{return rta[_0x7f91('0x25')](_0x133a88,_0x417b67,_0x165f0a);}})[_0x7f91('0x18')](function(_0x302777){_0x417b67=_0x302777;var _0x44f6a4=![];if(_0x417b67[_0x7f91('0x26')]===0x0){if(_0x3e1314||_0x165f0a){_0x44f6a4=!![];}if(_0x4dbbc0){_0x44f6a4=![];}}if(_0x44f6a4){return _0x4f1a85;}var _0x2e2feb=_['map'](db[_0x7f91('0x27')][_0x7f91('0x28')],function(_0x59842f){return{'name':_0x59842f[_0x7f91('0x29')],'type':_0x59842f[_0x7f91('0x2a')][_0x7f91('0x2b')]};});_0x3d0959[_0x7f91('0x11')][_0x7f91('0x2c')]=_0x7f91('0x2d');_0x3d0959[_0x7f91('0x11')][_0x7f91('0x2e')]=!![];_0x3e6416=qs[_0x7f91('0x2f')](_0x2e2feb,_0x3d0959);_0x3e6416[_0x7f91('0x30')]=!![];var _0x373686=[];if(_0x417b67[_0x7f91('0x26')]>0x0){_0x373686[_0x7f91('0x31')]({'id':{'$in':_0x417b67}});if(_0x3c6da7&&!_0x165f0a){_0x438b0a=[db[_0x7f91('0x32')][_0x7f91('0x33')](_0x7f91('0x34')+_0x417b67+')')];_0x3e6416[_0x7f91('0x35')]=_0x438b0a;}}if(_0x4dbbc0){_0x318a26[_0x7f91('0x36')](function(_0x5f2297){var _0x50e095=!![];if(_0x165f0a===_0x7f91('0x16')&&_0x547918!==_0x5f2297){_0x50e095=![];}_0x373686[_0x7f91('0x31')]({[_0x5f2297+_0x7f91('0x37')]:_0x50e095});});if(_0x4a4848){_0x373686['push']({'pauseType':_0x4a4848});}}else if(_0x165f0a){_0x318a26[_0x7f91('0x36')](function(_0x116954){_0x373686[_0x7f91('0x31')]({[_0x116954+'Pause']:![]});});}_0x3e6416['where']=_[_0x7f91('0x38')](_0x3e6416[_0x7f91('0x39')],{'$and':_0x373686});if(_0x3d0959['user'][_0x7f91('0x2c')]==='user'){var _0x412c61={'params':{'id':_0x3d0959[_0x7f91('0x3a')]['userProfileId']},'query':{'section':_0x7f91('0x3b'),'role':'agent','online':!![],'raw':!![],'ids':_0x417b67,'customSorting':_0x438b0a}};if(_0x4dbbc0){_0x412c61[_0x7f91('0x11')]['extraQueryConditions']=_0x373686;}_0x412c61[_0x7f91('0x11')]=Object[_0x7f91('0x3c')](_0x412c61['query'],_0x3d0959[_0x7f91('0x11')]);delete _0x412c61[_0x7f91('0x11')]['id'];return db[_0x7f91('0x3d')]['getResources'](_0x412c61);}return db[_0x7f91('0x27')][_0x7f91('0x3e')](_0x3e6416);})[_0x7f91('0x18')](function(_0x51638a){_0x4f1a85[_0x7f91('0x8')]=_0x51638a[_0x7f91('0x8')];_0x2c9295=_0x51638a[_0x7f91('0x3f')];return _0x2c9295[_0x7f91('0x40')](function(_0x4c6004){var _0x5b9eb8=_[_0x7f91('0x41')](_0x133a88,['id',_0x4c6004['id']]);if(_0x5b9eb8){var _0x17b8da=rta['filterAgentAttributes'](_0x5b9eb8);_['merge'](_0x4c6004,_0x17b8da);}_0x4c6004[_0x7f91('0x1e')]=rta[_0x7f91('0x42')](_0x4c6004);if(_0x4c6004[_0x7f91('0x1e')]['includes']('pause')){_0x318a26[_0x7f91('0x36')](function(_0x499622){if(_0x4c6004[_0x499622+_0x7f91('0x37')]){_0x4c6004[_0x499622+'Status']='pause';}});}return _0x4c6004;});})[_0x7f91('0x18')](function(_0x1822d4){if(!_0x3c6da7||_0x438b0a){return _0x1822d4;}return rta[_0x7f91('0x43')](_0x1822d4,_0x3c6da7);})['then'](function(_0x50d4e8){var _0x136506=null;if(_0x3d0959[_0x7f91('0x11')][_0x7f91('0x44')]){var _0x2a24a8=_0x3d0959[_0x7f91('0x11')][_0x7f91('0x44')][_0x7f91('0x45')](',');_0x136506=_0x50d4e8[_0x7f91('0x40')](function(_0x5c7914){return _[_0x7f91('0x46')](_0x5c7914,_0x2a24a8);});}_0x4f1a85['rows']=_0x136506||_0x50d4e8;return _0x4f1a85;})[_0x7f91('0x18')](respondWithFilteredResult(_0x5603d1,_0x3e6416))['catch'](APIHandleError(_0x5603d1));};exports[_0x7f91('0x47')]=function(_0x4cdb28,_0x361359){var _0x189ba8={'count':0x0,'rows':[]};var _0x4a424a={};var _0x28a92a;var _0x189051;var _0x480599;Promise['resolve']()[_0x7f91('0x18')](function(){if(_0x4cdb28[_0x7f91('0x11')][_0x7f91('0x19')]){if(!utils[_0x7f91('0x1a')](_0x4cdb28[_0x7f91('0x11')][_0x7f91('0x19')])){throw new APIBadRequestError(util[_0x7f91('0x48')](_0x7f91('0x49'),_0x4cdb28[_0x7f91('0x11')][_0x7f91('0x19')]));}_0x28a92a=_0x4cdb28[_0x7f91('0x11')][_0x7f91('0x19')][_0x7f91('0x1b')]();}var _0x197399=_[_0x7f91('0x4a')](_0x28a92a)+_0x7f91('0x4b');var _0x11ba70=_['map'](db[_0x197399][_0x7f91('0x28')],function(_0x2066f9){return{'name':_0x2066f9[_0x7f91('0x29')],'type':_0x2066f9[_0x7f91('0x2a')][_0x7f91('0x2b')]};});if(!_0x4cdb28[_0x7f91('0x11')][_0x7f91('0x44')]){var _0x2d1c64=['id',_0x7f91('0x4c')];if(_0x28a92a==='voice'){_0x2d1c64[_0x7f91('0x31')](_0x7f91('0x2a'));if(_0x4cdb28[_0x7f91('0x11')][_0x7f91('0x2a')]===_0x7f91('0x4d')){_0x2d1c64['push']([_0x7f91('0x4e'),'dialMethod']);}}_0x4cdb28[_0x7f91('0x11')]['fields']=_0x2d1c64[_0x7f91('0x21')](',');}_0x4a424a=qs[_0x7f91('0x2f')](_0x11ba70,_0x4cdb28);if(_0x4cdb28[_0x7f91('0x3a')]['role']===_0x7f91('0x3a')){var _0x87d495={'params':{'id':_0x4cdb28[_0x7f91('0x3a')][_0x7f91('0x4f')]},'query':{'section':_0x28a92a===_0x7f91('0x50')&&_0x4cdb28[_0x7f91('0x11')][_0x7f91('0x2a')]===_0x7f91('0x4d')?_0x7f91('0x51'):_[_0x7f91('0x4a')](_0x28a92a)+_0x7f91('0x52'),'type':_0x4cdb28[_0x7f91('0x11')][_0x7f91('0x2a')],'nolimit':!![],'sort':_0x7f91('0x4c'),'filter':_0x4cdb28[_0x7f91('0x11')][_0x7f91('0x53')]}};return db[_0x7f91('0x3d')][_0x7f91('0x54')](_0x87d495);}return db[_0x197399][_0x7f91('0x3e')](_0x4a424a);})[_0x7f91('0x18')](function(_0x19fc98){_0x189ba8[_0x7f91('0x8')]=_0x19fc98['count'];_0x189051=_0x19fc98[_0x7f91('0x3f')];return rtq[_0x7f91('0x55')](_0x4cdb28,_0x28a92a);})[_0x7f91('0x18')](function(_0x3147e5){_0x480599=_0x3147e5[_0x7f91('0x3f')];return rtq['initializeQueues'](_0x189051,_0x480599,_0x28a92a,_0x4cdb28[_0x7f91('0x11')]['type']);})[_0x7f91('0x18')](function(_0x4bc284){_0x189ba8[_0x7f91('0x3f')]=_0x4bc284;return _0x189ba8;})[_0x7f91('0x18')](respondWithFilteredResult(_0x361359,_0x4a424a))['catch'](APIHandleError(_0x361359));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 14ec0fc..c197c19 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_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 +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2d604b,_0x4f1748){var _0x504857=function(_0x3c4990){while(--_0x3c4990){_0x2d604b['push'](_0x2d604b['shift']());}};_0x504857(++_0x4f1748);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 125bffe..ac77e49 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 _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 +var _0x5a63=['INTEGER','STRING','sequelize','exports','DATE'];(function(_0x233586,_0x538c59){var _0xb5f65d=function(_0x2eb586){while(--_0x2eb586){_0x233586['push'](_0x233586['shift']());}};_0xb5f65d(++_0x538c59);}(_0x5a63,0xe3));var _0x35a6=function(_0x3ff8df,_0x25bf76){_0x3ff8df=_0x3ff8df-0x0;var _0x4e435e=_0x5a63[_0x3ff8df];return _0x4e435e;};'use strict';var Sequelize=require(_0x35a6('0x0'));module[_0x35a6('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x35a6('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x35a6('0x2')]},'ringtime':{'type':Sequelize[_0x35a6('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x35a6('0x4')]},'campaigntype':{'type':Sequelize[_0x35a6('0x4')]},'membername':{'type':Sequelize[_0x35a6('0x4')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 1d56995..053ddd9 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 _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 +var _0x25ef=['path','rimraf','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','util','../../config/logger','moment'];(function(_0xc0c240,_0x53f03e){var _0x3b97ea=function(_0x2b1bee){while(--_0x2b1bee){_0xc0c240['push'](_0xc0c240['shift']());}};_0x3b97ea(++_0x53f03e);}(_0x25ef,0x9f));var _0xf25e=function(_0x2bd311,_0x43156b){_0x2bd311=_0x2bd311-0x0;var _0x4af1c7=_0x25ef[_0x2bd311];return _0x4af1c7;};'use strict';var _=require('lodash');var util=require(_0xf25e('0x0'));var logger=require(_0xf25e('0x1'))('api');var moment=require(_0xf25e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf25e('0x3'));var rimraf=require(_0xf25e('0x4'));var config=require('../../config/environment');var attributes=require(_0xf25e('0x5'));module['exports']=function(_0x27b46e,_0x59d4f9){return _0x27b46e[_0xf25e('0x6')](_0xf25e('0x7'),attributes,{'tableName':_0xf25e('0x8'),'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 c82227a..af4a4e8 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 _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 +var _0x881c=['body','options','raw','debug','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','catch','CreateReportAgentPreview','ReportAgentPreview','create'];(function(_0x3c172b,_0x5dbd06){var _0x3d06ea=function(_0x1b755a){while(--_0x1b755a){_0x3c172b['push'](_0x3c172b['shift']());}};_0x3d06ea(++_0x5dbd06);}(_0x881c,0xdc));var _0xc881=function(_0x537ddc,_0x4b8246){_0x537ddc=_0x537ddc-0x0;var _0x1691e7=_0x881c[_0x537ddc];return _0x1691e7;};'use strict';var _=require(_0xc881('0x0'));var util=require('util');var moment=require(_0xc881('0x1'));var BPromise=require(_0xc881('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc881('0x3'));var logger=require(_0xc881('0x4'))(_0xc881('0x5'));var config=require(_0xc881('0x6'));var jayson=require(_0xc881('0x7'));var client=jayson[_0xc881('0x8')][_0xc881('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b5a08,_0x54596f,_0x4d3b8e){return new BPromise(function(_0x556503,_0x574f63){return client['request'](_0x5b5a08,_0x4d3b8e)[_0xc881('0xa')](function(_0x15c30d){logger[_0xc881('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x54596f,_0xc881('0xc'));logger['debug'](_0xc881('0xd'),_0x54596f,_0xc881('0xc'),JSON[_0xc881('0xe')](_0x15c30d));if(_0x15c30d[_0xc881('0xf')]){if(_0x15c30d[_0xc881('0xf')][_0xc881('0x10')]===0x1f4){logger['error'](_0xc881('0x11'),_0x54596f,_0x15c30d[_0xc881('0xf')][_0xc881('0x12')]);return _0x574f63(_0x15c30d[_0xc881('0xf')][_0xc881('0x12')]);}logger[_0xc881('0xf')](_0xc881('0x11'),_0x54596f,_0x15c30d[_0xc881('0xf')]['message']);return _0x556503(_0x15c30d['error'][_0xc881('0x12')]);}else{logger['info'](_0xc881('0x11'),_0x54596f,'request\x20sent');_0x556503(_0x15c30d['result'][_0xc881('0x12')]);}})[_0xc881('0x13')](function(_0x1017a){logger[_0xc881('0xf')](_0xc881('0x11'),_0x54596f,_0x1017a);_0x574f63(_0x1017a);});});}exports[_0xc881('0x14')]=function(_0x2caf90){var _0x162319=this;return new Promise(function(_0xcd763b,_0x382f40){return db[_0xc881('0x15')][_0xc881('0x16')](_0x2caf90[_0xc881('0x17')],{'raw':_0x2caf90[_0xc881('0x18')]?_0x2caf90['options'][_0xc881('0x19')]===undefined?!![]:![]:!![]})[_0xc881('0xa')](function(_0x2a882c){logger[_0xc881('0xb')](_0xc881('0x14'),_0x2caf90);logger[_0xc881('0x1a')](_0xc881('0x14'),_0x2caf90,JSON[_0xc881('0xe')](_0x2a882c));_0xcd763b(_0x2a882c);})[_0xc881('0x13')](function(_0x118838){logger[_0xc881('0xf')]('CreateReportAgentPreview',_0x118838[_0xc881('0x12')],_0x2caf90);_0x382f40(_0x162319[_0xc881('0xf')](0x1f4,_0x118838[_0xc881('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index bc7c80d..4e533aa 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 _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 +var _0x3a89=['/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','openchannelQueues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','/voice/queues/:id','showVoiceQueues','/outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x3a89,0x114));var _0x93a8=function(_0x2a56bc,_0x49ba0f){_0x2a56bc=_0x2a56bc-0x0;var _0x76cb14=_0x3a89[_0x2a56bc];return _0x76cb14;};'use strict';var multer=require(_0x93a8('0x0'));var util=require(_0x93a8('0x1'));var path=require(_0x93a8('0x2'));var express=require(_0x93a8('0x3'));var router=express[_0x93a8('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0x93a8('0x5'));router[_0x93a8('0x6')](_0x93a8('0x7'),auth['isAuthenticated'](),controller[_0x93a8('0x8')]);router[_0x93a8('0x6')](_0x93a8('0x9'),auth[_0x93a8('0xa')](),controller[_0x93a8('0xb')]);router[_0x93a8('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0x93a8('0xc')]);router[_0x93a8('0x6')](_0x93a8('0xd'),auth[_0x93a8('0xa')](),controller[_0x93a8('0xe')]);router[_0x93a8('0x6')](_0x93a8('0xf'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x10')]);router[_0x93a8('0x6')](_0x93a8('0x11'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x12')]);router[_0x93a8('0x6')]('/mail/accounts',auth[_0x93a8('0xa')](),controller['mailAccounts']);router[_0x93a8('0x6')]('/openchannel/queues',auth[_0x93a8('0xa')](),controller[_0x93a8('0x13')]);router[_0x93a8('0x6')](_0x93a8('0x14'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x15')]);router[_0x93a8('0x6')]('/whatsapp/queues',auth[_0x93a8('0xa')](),controller['whatsappQueues']);router[_0x93a8('0x6')](_0x93a8('0x16'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x17')]);router[_0x93a8('0x6')](_0x93a8('0x18'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x19')]);router[_0x93a8('0x6')](_0x93a8('0x1a'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x1b')]);router[_0x93a8('0x6')](_0x93a8('0x1c'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0x93a8('0x6')](_0x93a8('0x1d'),auth[_0x93a8('0xa')](),controller['voiceQueuesChannelHangup']);router[_0x93a8('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x93a8('0xa')](),controller['voiceQueuesChannelRedirect']);router[_0x93a8('0x6')](_0x93a8('0x1e'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x1f')]);router['put']('/voice/queues/:id',auth[_0x93a8('0xa')](),controller['updateVoiceQueue']);router[_0x93a8('0x6')](_0x93a8('0x20'),auth[_0x93a8('0xa')](),controller['outbound']);router['get'](_0x93a8('0x21'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x22')]);router[_0x93a8('0x6')](_0x93a8('0x23'),auth['isAuthenticated'](),controller[_0x93a8('0x24')]);router[_0x93a8('0x25')](_0x93a8('0x26'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x27')]);router[_0x93a8('0x6')](_0x93a8('0x28'),auth[_0x93a8('0xa')](),controller['telephones']);router['get'](_0x93a8('0x29'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x2a')]);router['get'](_0x93a8('0x2b'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x2c')]);router[_0x93a8('0x6')](_0x93a8('0x2d'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x2e')]);router['get'](_0x93a8('0x2f'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x30')]);router['get']('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x93a8('0x31')]);router[_0x93a8('0x6')](_0x93a8('0x32'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x33')]);router[_0x93a8('0x6')](_0x93a8('0x34'),auth['isAuthenticated'](),controller[_0x93a8('0x35')]);router['get'](_0x93a8('0x36'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x37')]);router['get'](_0x93a8('0x38'),auth[_0x93a8('0xa')](),controller['whatsappQueuesWaitingInteractions']);router[_0x93a8('0x6')](_0x93a8('0x39'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x3a')]);router[_0x93a8('0x3b')]('/mail/queues/:id/notify',auth['isAuthenticated'](),controller[_0x93a8('0x3c')]('mail'));router['get'](_0x93a8('0x3d'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x3e')]);router[_0x93a8('0x3b')](_0x93a8('0x3f'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x3c')](_0x93a8('0x40')));router[_0x93a8('0x6')](_0x93a8('0x41'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x42')]);router[_0x93a8('0x3b')]('/fax/queues/:id/notify',auth[_0x93a8('0xa')](),controller[_0x93a8('0x3c')](_0x93a8('0x43')));router['get'](_0x93a8('0x44'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x45')]);router[_0x93a8('0x3b')](_0x93a8('0x46'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x3c')](_0x93a8('0x47')));router[_0x93a8('0x6')](_0x93a8('0x48'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x49')]);router[_0x93a8('0x3b')]('/sms/queues/:id/notify',auth[_0x93a8('0xa')](),controller[_0x93a8('0x3c')](_0x93a8('0x4a')));router[_0x93a8('0x3b')](_0x93a8('0x4b'),auth['isAuthenticated'](),controller[_0x93a8('0x3c')](_0x93a8('0x4c')));router[_0x93a8('0x6')]('/sms/queues/:id',auth[_0x93a8('0xa')](),controller[_0x93a8('0x4d')]);router['get'](_0x93a8('0x4e'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x4f')]);router['post'](_0x93a8('0x50'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x51')]);module[_0x93a8('0x52')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index c77d870..33e319b 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 _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 +var _0x8958=['faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','TransferReport','create','agentNotify','channel','Agent\x20not\x20found','Message','Start','agentTransferTimeout','*,*,*,*','moment','api','client','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','interaction','MemberReport','findAll','user','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','WhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions'];(function(_0x143a39,_0x33be87){var _0xeef454=function(_0x3b4ff7){while(--_0x3b4ff7){_0x143a39['push'](_0x143a39['shift']());}};_0xeef454(++_0x33be87);}(_0x8958,0x93));var _0x8895=function(_0x1d0499,_0x23e22f){_0x1d0499=_0x1d0499-0x0;var _0x153fb3=_0x8958[_0x1d0499];return _0x153fb3;};'use strict';var BPromise=require('bluebird');var moment=require(_0x8895('0x0'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x8895('0x1'));var jayson=require('jayson/promise');var amiClient=jayson[_0x8895('0x2')][_0x8895('0x3')]({'port':0x232a});var mailClient=jayson[_0x8895('0x2')]['http']({'port':0x232b});var routingClient=jayson[_0x8895('0x2')][_0x8895('0x3')]({'port':0x232c});function respondWithRpcPromise(_0x124e1e,_0x40cec6,_0x33013a){return new BPromise(function(_0x51376b,_0xe018b8){var _0xc2be9f=_0x33013a?_0x33013a:amiClient;return _0xc2be9f[_0x8895('0x4')](_0x124e1e,_0x40cec6)[_0x8895('0x5')](function(_0x6eab1e){if(_0x6eab1e[_0x8895('0x6')]){if(_0x6eab1e[_0x8895('0x6')][_0x8895('0x7')]===0x1f4){return _0xe018b8(_0x6eab1e[_0x8895('0x6')][_0x8895('0x8')]);}return _0x51376b(_0x6eab1e['error'][_0x8895('0x8')]);}else{_0x51376b(_0x6eab1e[_0x8895('0x9')]);}})[_0x8895('0xa')](function(_0x301bec){_0xe018b8(_0x301bec);});});}function respondWithResult(_0x446e1a,_0xaf93bc){_0xaf93bc=_0xaf93bc||0xc8;return function(_0x5af0ef){if(_0x5af0ef){return _0x446e1a[_0x8895('0xb')](_0xaf93bc)[_0x8895('0xc')](_0x5af0ef);}return _0x446e1a[_0x8895('0xd')](0x194);};}function handleError(_0x57d40a,_0x47b9fe){_0x47b9fe=_0x47b9fe||0x1f4;return function(_0x9191b8){logger['error'](_0x9191b8[_0x8895('0xe')]);if(_0x9191b8[_0x8895('0xf')]){delete _0x9191b8[_0x8895('0xf')];}_0x57d40a[_0x8895('0xb')](_0x47b9fe)[_0x8895('0x10')](_0x9191b8);};}function findById(_0x5b4c2e){return function(_0x4128e2){if(!_[_0x8895('0x11')](_0x5b4c2e)&&!_[_0x8895('0x11')](_0x4128e2)&&!_[_0x8895('0x11')](_0x4128e2[_0x8895('0x12')])){return _[_0x8895('0x13')](_0x4128e2[_0x8895('0x12')],function(_0x26cee0){return _0x26cee0['id']==_0x5b4c2e;});}return null;};}exports[_0x8895('0x14')]=function(_0x2da618,_0x24fef0){return respondWithRpcPromise(_0x8895('0x15'),_0x2da618[_0x8895('0x16')])['then'](respondWithResult(_0x24fef0,null))['catch'](handleError(_0x24fef0,null));};exports['voiceChannelMixMonitor']=function(_0x3daf43,_0x456282){return respondWithRpcPromise(_0x8895('0x17'),_[_0x8895('0x18')](_0x3daf43[_0x8895('0x16')],_0x3daf43[_0x8895('0x19')]))[_0x8895('0x5')](respondWithResult(_0x456282,null))[_0x8895('0xa')](handleError(_0x456282,null));};exports['voiceChannelStopMixMonitor']=function(_0x1a4c5b,_0x5db3a0){return respondWithRpcPromise(_0x8895('0x1a'),_[_0x8895('0x18')](_0x1a4c5b[_0x8895('0x16')],_0x1a4c5b['params']))['then'](respondWithResult(_0x5db3a0,null))[_0x8895('0xa')](handleError(_0x5db3a0,null));};exports[_0x8895('0x1b')]=function(_0x38f7ad,_0x24a376){return respondWithRpcPromise('VoiceQueues',_0x38f7ad[_0x8895('0x16')])[_0x8895('0x5')](respondWithResult(_0x24a376,null))[_0x8895('0xa')](handleError(_0x24a376,null));};exports['showVoiceQueues']=function(_0x4aee03,_0x78b57){return respondWithRpcPromise('VoiceQueues',_0x4aee03[_0x8895('0x16')])[_0x8895('0x5')](findById(_0x4aee03[_0x8895('0x19')]['id']))[_0x8895('0x5')](respondWithResult(_0x78b57,null))[_0x8895('0xa')](handleError(_0x78b57,null));};exports['updateVoiceQueue']=function(_0x4d567a,_0x6e449d){return respondWithRpcPromise(_0x8895('0x1c'),_[_0x8895('0x18')](_0x4d567a[_0x8895('0x1d')],_0x4d567a[_0x8895('0x19')]))['then'](respondWithResult(_0x6e449d,null))['catch'](handleError(_0x6e449d,null));};exports[_0x8895('0x1e')]=function(_0x848a11,_0x1c16f6){return respondWithRpcPromise(_0x8895('0x1f'),_[_0x8895('0x18')](_0x848a11['query'],_0x848a11[_0x8895('0x19')]))['then'](respondWithResult(_0x1c16f6,null))[_0x8895('0xa')](handleError(_0x1c16f6,null));};exports['voiceQueuesChannels']=function(_0x40ba14,_0x1a3fe5){return respondWithRpcPromise(_0x8895('0x20'),_0x40ba14[_0x8895('0x16')])[_0x8895('0x5')](respondWithResult(_0x1a3fe5,null))['catch'](handleError(_0x1a3fe5,null));};exports[_0x8895('0x21')]=function(_0xcba076,_0x1b5359){return respondWithRpcPromise(_0x8895('0x22'),_[_0x8895('0x18')](_0xcba076['query'],_0xcba076[_0x8895('0x19')]))['then'](respondWithResult(_0x1b5359,null))[_0x8895('0xa')](handleError(_0x1b5359,null));};exports['voiceQueuesChannelHangup']=function(_0x21c22b,_0x15a865){return respondWithRpcPromise(_0x8895('0x23'),_[_0x8895('0x18')](_0x21c22b[_0x8895('0x16')],_0x21c22b['params']))[_0x8895('0x5')](respondWithResult(_0x15a865,null))['catch'](handleError(_0x15a865,null));};exports[_0x8895('0x24')]=function(_0xcc735f,_0x36e13b){return respondWithRpcPromise(_0x8895('0x25'),_[_0x8895('0x18')](_0xcc735f[_0x8895('0x16')],_0xcc735f['params']))[_0x8895('0x5')](respondWithResult(_0x36e13b,null))[_0x8895('0xa')](handleError(_0x36e13b,null));};exports['outbound']=function(_0x2557fc,_0x54ca09){return respondWithRpcPromise(_0x8895('0x26'),_0x2557fc[_0x8895('0x16')])['then'](respondWithResult(_0x54ca09,null))[_0x8895('0xa')](handleError(_0x54ca09,null));};exports[_0x8895('0x27')]=function(_0x5b7204,_0x58751a){return respondWithRpcPromise(_0x8895('0x28'),_0x5b7204[_0x8895('0x16')])[_0x8895('0x5')](respondWithResult(_0x58751a,null))[_0x8895('0xa')](handleError(_0x58751a,null));};exports[_0x8895('0x29')]=function(_0x4917d1,_0x42ed1f){var _0x25c854;return respondWithRpcPromise(_0x8895('0x2a'),_0x4917d1[_0x8895('0x16')])[_0x8895('0x5')](function(_0x534876){_0x25c854=_0x534876;return respondWithRpcPromise('Agents',_0x4917d1[_0x8895('0x16')],routingClient);})['then'](function(_0x20a521){return _[_0x8895('0x18')]({},_0x20a521,_0x25c854);})['then'](respondWithResult(_0x42ed1f,null))[_0x8895('0xa')](handleError(_0x42ed1f,null));};exports['agentCapacity']=function(_0x1e6395,_0x5e6413){if(_0x1e6395['body']&&_0x1e6395['body']['interaction']&&_0x1e6395['user']&&_0x1e6395['user'][_0x8895('0xf')]){for(var _0x206f57 in _0x1e6395['body']['interaction']){if(_0x1e6395[_0x8895('0x1d')][_0x8895('0x2b')]['hasOwnProperty'](_0x206f57)){db[_0x8895('0x2c')][_0x8895('0x2d')]({'where':{'channel':_0x206f57,'membername':_0x1e6395[_0x8895('0x2e')][_0x8895('0xf')],'type':_0x8895('0x2f'),'exitAt':null,'uniqueid':_0x1e6395['body']['interaction'][_0x206f57]&&_0x1e6395['body'][_0x8895('0x2b')][_0x206f57]['length']?{'$notIn':_0x1e6395[_0x8895('0x1d')][_0x8895('0x2b')][_0x206f57]}:{'$ne':null}}})[_0x8895('0x5')](function(_0x28aaa9){var _0x587ccb=moment()[_0x8895('0x30')](_0x8895('0x31'));for(var _0x3413cd=0x0,_0x167302=_0x28aaa9[_0x8895('0x32')];_0x3413cd<_0x167302;_0x3413cd+=0x1){_0x28aaa9[_0x3413cd][_0x8895('0x33')]({'exitAt':_0x587ccb});}});for(var _0x14295a=0x0;_0x14295a<_0x1e6395[_0x8895('0x1d')]['interaction'][_0x206f57][_0x8895('0x32')];_0x14295a+=0x1){db[_0x8895('0x2c')]['findOrCreate']({'where':{'channel':_0x206f57,'membername':_0x1e6395[_0x8895('0x2e')]['name'],'type':'INTERACTION','uniqueid':_0x1e6395[_0x8895('0x1d')][_0x8895('0x2b')][_0x206f57][_0x14295a],'exitAt':null},'defaults':{'channel':_0x206f57,'membername':_0x1e6395[_0x8895('0x2e')]['name'],'interface':_[_0x8895('0x11')](_0x1e6395['user'][_0x8895('0x34')])?util[_0x8895('0x30')](_0x8895('0x35'),_0x1e6395[_0x8895('0x2e')][_0x8895('0xf')]):_0x1e6395[_0x8895('0x2e')][_0x8895('0x34')],'type':'INTERACTION','enterAt':moment()['format'](_0x8895('0x31')),'role':_0x8895('0x36'),'internal':_0x1e6395['user'][_0x8895('0x37')],'uniqueid':_0x1e6395['body']['interaction'][_0x206f57][_0x14295a]}});}}}}return respondWithRpcPromise(_0x8895('0x38'),{'id':_0x1e6395['params']['id'],'capacity':_0x1e6395[_0x8895('0x1d')][_0x8895('0x39')]},routingClient)[_0x8895('0x5')](respondWithResult(_0x5e6413,null))[_0x8895('0xa')](handleError(_0x5e6413,null));};exports[_0x8895('0x3a')]=function(_0x39a1d9,_0x306481){return respondWithRpcPromise(_0x8895('0x3b'),_0x39a1d9['query'])[_0x8895('0x5')](respondWithResult(_0x306481,null))[_0x8895('0xa')](handleError(_0x306481,null));};exports[_0x8895('0x3c')]=function(_0x5a5bc6,_0x1935aa){return respondWithRpcPromise(_0x8895('0x3d'),_0x5a5bc6[_0x8895('0x16')])[_0x8895('0x5')](respondWithResult(_0x1935aa,null))[_0x8895('0xa')](handleError(_0x1935aa,null));};exports[_0x8895('0x3e')]=function(_0x434ab8,_0x216e6e){return respondWithRpcPromise(_0x8895('0x3f'),_0x434ab8[_0x8895('0x16')])['then'](respondWithResult(_0x216e6e,null))[_0x8895('0xa')](handleError(_0x216e6e,null));};exports[_0x8895('0x40')]=function(_0xb3d1ab,_0x10560a){return respondWithRpcPromise(_0x8895('0x41'),_0xb3d1ab['query'],routingClient)[_0x8895('0x5')](respondWithResult(_0x10560a,null))[_0x8895('0xa')](handleError(_0x10560a,null));};exports[_0x8895('0x42')]=function(_0x3d17bd,_0x37a7b4){return respondWithRpcPromise('ChatQueues',_0x3d17bd[_0x8895('0x16')],routingClient)[_0x8895('0x5')](findById(_0x3d17bd[_0x8895('0x19')]['id']))['then'](respondWithResult(_0x37a7b4,null))[_0x8895('0xa')](handleError(_0x37a7b4,null));};exports[_0x8895('0x43')]=function(_0x2c777b,_0x4ec8eb){return respondWithRpcPromise(_0x8895('0x44'),_0x2c777b[_0x8895('0x16')],routingClient)['then'](respondWithResult(_0x4ec8eb,null))[_0x8895('0xa')](handleError(_0x4ec8eb,null));};exports[_0x8895('0x45')]=function(_0x5198f8,_0x2f990a){return respondWithRpcPromise(_0x8895('0x44'),_0x5198f8[_0x8895('0x16')],routingClient)[_0x8895('0x5')](findById(_0x5198f8['params']['id']))['then'](respondWithResult(_0x2f990a,null))[_0x8895('0xa')](handleError(_0x2f990a,null));};exports[_0x8895('0x46')]=function(_0x49877,_0x51eb9c){return respondWithRpcPromise(_0x8895('0x47'),_0x49877[_0x8895('0x16')],mailClient)['then'](respondWithResult(_0x51eb9c,null))[_0x8895('0xa')](handleError(_0x51eb9c,null));};exports['openchannelQueues']=function(_0x435e36,_0x2bd955){return respondWithRpcPromise(_0x8895('0x48'),_0x435e36[_0x8895('0x16')],routingClient)[_0x8895('0x5')](respondWithResult(_0x2bd955,null))['catch'](handleError(_0x2bd955,null));};exports['showOpenchannelQueues']=function(_0x239401,_0x216abb){return respondWithRpcPromise('OpenchannelQueues',_0x239401[_0x8895('0x16')],routingClient)[_0x8895('0x5')](findById(_0x239401[_0x8895('0x19')]['id']))[_0x8895('0x5')](respondWithResult(_0x216abb,null))['catch'](handleError(_0x216abb,null));};exports[_0x8895('0x49')]=function(_0x2d2bf9,_0x1b1bc0){return respondWithRpcPromise(_0x8895('0x4a'),_0x2d2bf9[_0x8895('0x16')],routingClient)[_0x8895('0x5')](respondWithResult(_0x1b1bc0,null))[_0x8895('0xa')](handleError(_0x1b1bc0,null));};exports[_0x8895('0x4b')]=function(_0x2bffd7,_0x21c7bb){return respondWithRpcPromise(_0x8895('0x4a'),_0x2bffd7[_0x8895('0x16')],routingClient)[_0x8895('0x5')](findById(_0x2bffd7[_0x8895('0x19')]['id']))[_0x8895('0x5')](respondWithResult(_0x21c7bb,null))['catch'](handleError(_0x21c7bb,null));};exports['whatsappQueues']=function(_0x5b96fe,_0x13b143){return respondWithRpcPromise(_0x8895('0x4c'),_0x5b96fe[_0x8895('0x16')],routingClient)[_0x8895('0x5')](respondWithResult(_0x13b143,null))[_0x8895('0xa')](handleError(_0x13b143,null));};exports['showWhatsappQueues']=function(_0x816803,_0xc6af80){return respondWithRpcPromise('WhatsappQueues',_0x816803[_0x8895('0x16')],routingClient)[_0x8895('0x5')](findById(_0x816803[_0x8895('0x19')]['id']))[_0x8895('0x5')](respondWithResult(_0xc6af80,null))[_0x8895('0xa')](handleError(_0xc6af80,null));};exports['faxQueues']=function(_0x6440ea,_0x3c318c){return respondWithRpcPromise(_0x8895('0x4d'),_0x6440ea[_0x8895('0x16')],routingClient)[_0x8895('0x5')](respondWithResult(_0x3c318c,null))[_0x8895('0xa')](handleError(_0x3c318c,null));};exports[_0x8895('0x4e')]=function(_0x5e7048,_0x10d395){return respondWithRpcPromise(_0x8895('0x4d'),_0x5e7048['query'],routingClient)[_0x8895('0x5')](findById(_0x5e7048[_0x8895('0x19')]['id']))[_0x8895('0x5')](respondWithResult(_0x10d395,null))[_0x8895('0xa')](handleError(_0x10d395,null));};exports[_0x8895('0x4f')]=function(_0x560381,_0x16cd17){return respondWithRpcPromise('FaxAccounts',_0x560381[_0x8895('0x16')])[_0x8895('0x5')](respondWithResult(_0x16cd17,null))['catch'](handleError(_0x16cd17,null));};exports[_0x8895('0x50')]=function(_0x24f1c5,_0x140b2a){return respondWithRpcPromise(_0x8895('0x51'),_0x24f1c5['query'],routingClient)[_0x8895('0x5')](respondWithResult(_0x140b2a,null))['catch'](handleError(_0x140b2a,null));};exports['mailQueuesWaitingInteractions']=function(_0x1a198d,_0x185351){return respondWithRpcPromise(_0x8895('0x52'),_0x1a198d['query'],routingClient)[_0x8895('0x5')](respondWithResult(_0x185351,null))['catch'](handleError(_0x185351,null));};exports[_0x8895('0x53')]=function(_0x930a13,_0x3893fb){return respondWithRpcPromise(_0x8895('0x54'),_0x930a13[_0x8895('0x16')],routingClient)['then'](respondWithResult(_0x3893fb,null))['catch'](handleError(_0x3893fb,null));};exports[_0x8895('0x55')]=function(_0x5517a2,_0x3707a6){return respondWithRpcPromise(_0x8895('0x54'),_0x5517a2['query'],routingClient)[_0x8895('0x5')](function(_0xd9637a){if(_0x5517a2[_0x8895('0x16')][_0x8895('0x56')]!==undefined){var _0x166e9a=_(_0xd9637a['rows'])[_0x8895('0x57')]([_0x5517a2['query']['type'],_0x5517a2[_0x8895('0x19')]['id']])['map'](_0x8895('0x58'))[_0x8895('0x59')]()[_0x8895('0x5a')]();return _0xd9637a[_0x8895('0x12')]['filter'](function(_0x4d802e){return _0x166e9a['indexOf'](_0x4d802e[_0x8895('0x58')])>-0x1;});}else{return _0xd9637a[_0x8895('0x12')][_0x8895('0x57')](function(_0x14fd1f){return _0x14fd1f[_0x8895('0x58')]===parseInt(_0x5517a2[_0x8895('0x19')]['id']);});}})['then'](respondWithResult(_0x3707a6,null))[_0x8895('0xa')](handleError(_0x3707a6,null));};exports[_0x8895('0x5b')]=function(_0x4deccc,_0x584a1f){return respondWithRpcPromise(_0x8895('0x5c'),_0x4deccc['query'],routingClient)[_0x8895('0x5')](respondWithResult(_0x584a1f,null))['catch'](handleError(_0x584a1f,null));};exports[_0x8895('0x5d')]=function(_0x452756,_0x553437){return respondWithRpcPromise(_0x8895('0x5e'),_0x452756[_0x8895('0x16')],routingClient)['then'](respondWithResult(_0x553437,null))[_0x8895('0xa')](handleError(_0x553437,null));};exports[_0x8895('0x5f')]=function(_0x2af98f,_0xef59db){return respondWithRpcPromise(_0x8895('0x60'),_0x2af98f[_0x8895('0x16')],routingClient)[_0x8895('0x5')](respondWithResult(_0xef59db,null))['catch'](handleError(_0xef59db,null));};exports[_0x8895('0x61')]=function(_0x5ada19){return function(_0x330506,_0x1f583a){var _0x32d52c,_0x325597;var _0x4e6691=_[_0x8895('0x62')](_0x5ada19);var _0x1d50f6=_0x5ada19===_0x8895('0x63')?_0x8895('0x64'):_0x8895('0x65');return db[_0x4e6691+_0x8895('0x66')][_0x8895('0x67')]({'raw':!![],'where':{'id':_0x330506[_0x8895('0x19')]['id']}})['then'](function(_0x3b4092){if(_[_0x8895('0x11')](_0x3b4092)){throw new Error(_0x4e6691+'\x20Queue\x20not\x20found');}_0x32d52c=_0x3b4092;return db[_0x4e6691+'Message'][_0x8895('0x67')]({'where':{'id':_0x330506[_0x8895('0x1d')][_0x8895('0x68')]},'include':[{'model':db[_0x4e6691+_0x8895('0x69')],'as':'Interaction'},{'model':db[_0x4e6691+_0x1d50f6],'as':'Account'}]});})[_0x8895('0x5')](function(_0x42ebe2){if(_[_0x8895('0x11')](_0x42ebe2)){throw new Error(_0x4e6691+_0x8895('0x6a'));}_0x325597=_0x42ebe2;return _0x42ebe2[_0x8895('0x6b')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2cd8b0={'uniqueid':_0x5ada19+'.'+_0x325597['id']+'.'+_0x325597[_0x8895('0x69')]['id'],'FromUserId':_0x330506['user']['id'],'type':_0x8895('0x6c')};_0x2cd8b0[_0x4e6691+_0x8895('0x6d')]=_0x325597['id'];_0x2cd8b0[_0x4e6691+_0x8895('0x6e')]=_0x325597[_0x8895('0x69')]['id'];_0x2cd8b0[_0x8895('0x6f')+_0x4e6691+_0x1d50f6+'Id']=_0x325597[_0x8895('0x65')]['id'];_0x2cd8b0['To'+_0x4e6691+'QueueId']=_0x32d52c['id'];return db[_0x4e6691+_0x8895('0x70')][_0x8895('0x71')](_0x2cd8b0);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x5ada19,'interaction':_0x325597['Interaction'],'message':_0x325597,'account':_0x325597[_0x8895('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8895('0x6c'),'appdata':_0x32d52c['name']+','+(_0x325597[_0x8895('0x65')]['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x1f583a,null))[_0x8895('0xa')](handleError(_0x1f583a,null));};};exports[_0x8895('0x72')]=function(_0x28d7ab,_0x20b607){var _0x605f47,_0x54cf18;if(_[_0x8895('0x11')](_0x28d7ab[_0x8895('0x1d')][_0x8895('0x73')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x4a4d4b=_0x28d7ab['body'][_0x8895('0x73')];var _0x1d796a=_[_0x8895('0x62')](_0x4a4d4b);var _0x2084b1=_0x4a4d4b===_0x8895('0x63')?_0x8895('0x64'):_0x8895('0x65');return db['User'][_0x8895('0x67')]({'raw':!![],'where':{'id':_0x28d7ab['params']['id'],'role':_0x8895('0x36')}})['then'](function(_0x2f2908){if(_[_0x8895('0x11')](_0x2f2908)){throw new Error(_0x8895('0x74'));}_0x605f47=_0x2f2908;return db[_0x1d796a+_0x8895('0x75')][_0x8895('0x67')]({'where':{'id':_0x28d7ab[_0x8895('0x1d')][_0x8895('0x68')]},'include':[{'model':db[_0x1d796a+'Interaction'],'as':_0x8895('0x69')},{'model':db[_0x1d796a+_0x2084b1],'as':_0x8895('0x65')}]});})[_0x8895('0x5')](function(_0x3ce240){if(_[_0x8895('0x11')](_0x3ce240)){throw new Error(_0x1d796a+'\x20Message\x20not\x20found');}_0x54cf18=_0x3ce240;return _0x3ce240[_0x8895('0x6b')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x20f574={'uniqueid':_0x4a4d4b+'.'+_0x54cf18['id']+'.'+_0x54cf18[_0x8895('0x69')]['id'],'FromUserId':_0x28d7ab[_0x8895('0x2e')]['id'],'type':_0x8895('0x6c'),'ToUserId':_0x605f47['id']};_0x20f574[_0x1d796a+_0x8895('0x6d')]=_0x54cf18['id'];_0x20f574[_0x1d796a+_0x8895('0x6e')]=_0x54cf18[_0x8895('0x69')]['id'];_0x20f574[_0x8895('0x6f')+_0x1d796a+_0x2084b1+'Id']=_0x54cf18[_0x8895('0x65')]['id'];return db[_0x1d796a+'TransferReport'][_0x8895('0x71')](_0x20f574);})['then'](function(){return respondWithRpcPromise(_0x8895('0x76'),{'channel':_0x4a4d4b,'interaction':_0x54cf18[_0x8895('0x69')],'message':_0x54cf18,'account':_0x54cf18[_0x8895('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x605f47[_0x8895('0xf')]+','+(_0x54cf18['Account'][_0x8895('0x77')]||0x12c),'interval':_0x8895('0x78')}]},routingClient);})[_0x8895('0x5')](respondWithResult(_0x20b607,null))[_0x8895('0xa')](handleError(_0x20b607,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index d95a236..23f02cd 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 _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 +var _0x962e=['get','isAuthenticated','index','show','/:id/run','run','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x38b2e7,_0x2f605b){var _0x308d09=function(_0x5ad923){while(--_0x5ad923){_0x38b2e7['push'](_0x38b2e7['shift']());}};_0x308d09(++_0x2f605b);}(_0x962e,0x1da));var _0xe962=function(_0xa65ffb,_0x53dd5b){_0xa65ffb=_0xa65ffb-0x0;var _0x491769=_0x962e[_0xa65ffb];return _0x491769;};'use strict';var multer=require(_0xe962('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe962('0x1'));var express=require(_0xe962('0x2'));var router=express[_0xe962('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe962('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe962('0x5'));var controller=require('./schedule.controller');router[_0xe962('0x6')]('/',auth[_0xe962('0x7')](),controller[_0xe962('0x8')]);router['get']('/:id',auth[_0xe962('0x7')](),controller[_0xe962('0x9')]);router[_0xe962('0x6')](_0xe962('0xa'),auth[_0xe962('0x7')](),controller[_0xe962('0xb')]);router[_0xe962('0xc')]('/',auth[_0xe962('0x7')](),controller[_0xe962('0xd')]);router[_0xe962('0xe')](_0xe962('0xf'),auth[_0xe962('0x7')](),controller[_0xe962('0x10')]);router[_0xe962('0x11')]('/:id',auth[_0xe962('0x7')](),controller[_0xe962('0x12')]);module[_0xe962('0x13')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 84c210c..a9e92d9 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 _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 +var _0x56dd=['weeks','hours','minutes','days','pdf','xlsx','csv','default','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','ENUM','months'];(function(_0x444781,_0x4c1340){var _0x3d87af=function(_0x4bb7ac){while(--_0x4bb7ac){_0x444781['push'](_0x444781['shift']());}};_0x3d87af(++_0x4c1340);}(_0x56dd,0x1b2));var _0xd56d=function(_0xb6e43,_0x1568fc){_0xb6e43=_0xb6e43-0x0;var _0x47c40f=_0x56dd[_0xb6e43];return _0x47c40f;};'use strict';var Sequelize=require(_0xd56d('0x0'));module[_0xd56d('0x1')]={'name':{'type':Sequelize[_0xd56d('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xd56d('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xd56d('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xd56d('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xd56d('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xd56d('0x6')]('years','quarters',_0xd56d('0x7'),_0xd56d('0x8'),'days',_0xd56d('0x9'),_0xd56d('0xa')),'allowNull':![],'defaultValue':_0xd56d('0xb')},'output':{'type':Sequelize['ENUM']('csv',_0xd56d('0xc'),_0xd56d('0xd')),'allowNull':![],'defaultValue':_0xd56d('0xe')},'type':{'type':Sequelize[_0xd56d('0x6')]('custom',_0xd56d('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xd56d('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xd56d('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xd56d('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xd56d('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 fe286cb..0c3c402 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 _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 +var _0xa33f=['sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','destroy','then','Scheduler','error','stack','name','index','map','Schedule','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path'];(function(_0x175abe,_0x205ebe){var _0x2bd805=function(_0x4e93e9){while(--_0x4e93e9){_0x175abe['push'](_0x175abe['shift']());}};_0x2bd805(++_0x205ebe);}(_0xa33f,0xfb));var _0xfa33=function(_0xb4fd1,_0x42375f){_0xb4fd1=_0xb4fd1-0x0;var _0xf69a8c=_0xa33f[_0xb4fd1];return _0xf69a8c;};'use strict';var emlformat=require(_0xfa33('0x0'));var rimraf=require(_0xfa33('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa33('0x2'));var rp=require(_0xfa33('0x3'));var moment=require(_0xfa33('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfa33('0x5'));var path=require(_0xfa33('0x6'));var sox=require(_0xfa33('0x7'));var csv=require('to-csv');var ejs=require(_0xfa33('0x8'));var fs=require('fs');var fs_extra=require(_0xfa33('0x9'));var _=require(_0xfa33('0xa'));var squel=require(_0xfa33('0xb'));var crypto=require(_0xfa33('0xc'));var jsforce=require(_0xfa33('0xd'));var deskjs=require(_0xfa33('0xe'));var toCsv=require(_0xfa33('0xf'));var querystring=require(_0xfa33('0x10'));var Papa=require(_0xfa33('0x11'));var Redis=require(_0xfa33('0x12'));var authService=require(_0xfa33('0x13'));var qs=require(_0xfa33('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfa33('0x15'));var logger=require(_0xfa33('0x16'))(_0xfa33('0x17'));var utils=require(_0xfa33('0x18'));var config=require(_0xfa33('0x19'));var licenseUtil=require(_0xfa33('0x1a'));var db=require(_0xfa33('0x1b'))['db'];function respondWithStatusCode(_0x13b1ae,_0x230b73){_0x230b73=_0x230b73||0xcc;return function(_0xe4b3ec){if(_0xe4b3ec){return _0x13b1ae[_0xfa33('0x1c')](_0x230b73);}return _0x13b1ae[_0xfa33('0x1d')](_0x230b73)[_0xfa33('0x1e')]();};}function respondWithResult(_0x269518,_0x245d2b){_0x245d2b=_0x245d2b||0xc8;return function(_0x4a5002){if(_0x4a5002){return _0x269518[_0xfa33('0x1d')](_0x245d2b)[_0xfa33('0x1f')](_0x4a5002);}};}function respondWithFilteredResult(_0x45955d,_0x2d14df){return function(_0x6fad0){if(_0x6fad0){var _0x2c5317=typeof _0x2d14df[_0xfa33('0x20')]===_0xfa33('0x21')&&typeof _0x2d14df[_0xfa33('0x22')]===_0xfa33('0x21');var _0x59df54=_0x6fad0[_0xfa33('0x23')];var _0x300632=_0x2c5317?0x0:_0x2d14df['offset'];var _0x29625f=_0x2c5317?_0x6fad0[_0xfa33('0x23')]:_0x2d14df[_0xfa33('0x20')]+_0x2d14df[_0xfa33('0x22')];var _0x3bbb90;if(_0x29625f>=_0x59df54){_0x29625f=_0x59df54;_0x3bbb90=0xc8;}else{_0x3bbb90=0xce;}_0x45955d[_0xfa33('0x1d')](_0x3bbb90);return _0x45955d[_0xfa33('0x24')]('Content-Range',_0x300632+'-'+_0x29625f+'/'+_0x59df54)[_0xfa33('0x1f')](_0x6fad0);}return null;};}function patchUpdates(_0x28ee65){return function(_0x551c15){try{jsonpatch['apply'](_0x551c15,_0x28ee65,!![]);}catch(_0x399916){return BPromise['reject'](_0x399916);}return _0x551c15[_0xfa33('0x25')]();};}function saveUpdates(_0x909fb4,_0x582839){return function(_0x1c7bc3){if(_0x1c7bc3){return _0x1c7bc3[_0xfa33('0x26')](_0x909fb4)['then'](function(_0x4c75f1){return _0x4c75f1;});}return null;};}function removeEntity(_0x377b94,_0x5504a5){return function(_0x58c84c){if(_0x58c84c){return _0x58c84c[_0xfa33('0x27')]()[_0xfa33('0x28')](function(){var _0xe1cad0=_0x58c84c['get']({'plain':!![]});var _0x13bc5c=_0xfa33('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x13bc5c,'resourceId':_0xe1cad0['id']}})['then'](function(){return _0x58c84c;});})[_0xfa33('0x28')](function(){_0x377b94[_0xfa33('0x1d')](0xcc)[_0xfa33('0x1e')]();});}};}function handleEntityNotFound(_0x2e4556,_0x2f7adb){return function(_0x1a39ff){if(!_0x1a39ff){_0x2e4556[_0xfa33('0x1c')](0x194);}return _0x1a39ff;};}function handleError(_0x26b3f5,_0x3f53d4){_0x3f53d4=_0x3f53d4||0x1f4;return function(_0x1c03a9){logger[_0xfa33('0x2a')](_0x1c03a9[_0xfa33('0x2b')]);if(_0x1c03a9[_0xfa33('0x2c')]){delete _0x1c03a9[_0xfa33('0x2c')];}_0x26b3f5[_0xfa33('0x1d')](_0x3f53d4)['send'](_0x1c03a9);};}exports[_0xfa33('0x2d')]=function(_0x192bfa,_0x58f456){var _0x11a9fb={},_0xb74ab5={},_0x2118c8={'count':0x0,'rows':[]};var _0x18ef0a=_[_0xfa33('0x2e')](db[_0xfa33('0x2f')][_0xfa33('0x30')],function(_0x42714d){return{'name':_0x42714d[_0xfa33('0x31')],'type':_0x42714d[_0xfa33('0x32')]['key']};});_0xb74ab5[_0xfa33('0x33')]=_['map'](_0x18ef0a,'name');_0xb74ab5[_0xfa33('0x34')]=_[_0xfa33('0x35')](_0x192bfa[_0xfa33('0x34')]);_0xb74ab5['filters']=_['intersection'](_0xb74ab5['model'],_0xb74ab5[_0xfa33('0x34')]);_0x11a9fb[_0xfa33('0x36')]=_[_0xfa33('0x37')](_0xb74ab5[_0xfa33('0x33')],qs[_0xfa33('0x38')](_0x192bfa[_0xfa33('0x34')]['fields']));_0x11a9fb[_0xfa33('0x36')]=_0x11a9fb['attributes'][_0xfa33('0x39')]?_0x11a9fb[_0xfa33('0x36')]:_0xb74ab5[_0xfa33('0x33')];if(!_0x192bfa[_0xfa33('0x34')][_0xfa33('0x3a')](_0xfa33('0x3b'))){_0x11a9fb[_0xfa33('0x22')]=qs[_0xfa33('0x22')](_0x192bfa[_0xfa33('0x34')][_0xfa33('0x22')]);_0x11a9fb['offset']=qs['offset'](_0x192bfa[_0xfa33('0x34')][_0xfa33('0x20')]);}_0x11a9fb[_0xfa33('0x3c')]=qs['sort'](_0x192bfa[_0xfa33('0x34')]['sort']);_0x11a9fb['where']=qs[_0xfa33('0x3d')](_[_0xfa33('0x3e')](_0x192bfa[_0xfa33('0x34')],_0xb74ab5['filters']),_0x18ef0a);if(_0x192bfa['query'][_0xfa33('0x3f')]){_0x11a9fb[_0xfa33('0x40')]=_[_0xfa33('0x41')](_0x11a9fb[_0xfa33('0x40')],{'$or':_[_0xfa33('0x2e')](_0x18ef0a,function(_0x57a727){if(_0x57a727[_0xfa33('0x32')]!=='VIRTUAL'){var _0x4e75ea={};_0x4e75ea[_0x57a727[_0xfa33('0x2c')]]={'$like':'%'+_0x192bfa['query'][_0xfa33('0x3f')]+'%'};return _0x4e75ea;}})});}_0x11a9fb=_['merge']({},_0x11a9fb,_0x192bfa[_0xfa33('0x42')]);var _0xf1b1fb={'where':_0x11a9fb[_0xfa33('0x40')]};return db[_0xfa33('0x2f')][_0xfa33('0x23')](_0xf1b1fb)[_0xfa33('0x28')](function(_0x179b50){_0x2118c8['count']=_0x179b50;if(_0x192bfa[_0xfa33('0x34')][_0xfa33('0x43')]){_0x11a9fb[_0xfa33('0x44')]=[{'all':!![]}];}return db[_0xfa33('0x2f')][_0xfa33('0x45')](_0x11a9fb);})[_0xfa33('0x28')](function(_0x4ed255){_0x2118c8[_0xfa33('0x46')]=_0x4ed255;return _0x2118c8;})[_0xfa33('0x28')](respondWithFilteredResult(_0x58f456,_0x11a9fb))[_0xfa33('0x47')](handleError(_0x58f456,null));};exports['show']=function(_0x126ee7,_0x573a3d){var _0xb2613a={'raw':![],'where':{'id':_0x126ee7[_0xfa33('0x48')]['id']}},_0x392b67={};_0x392b67[_0xfa33('0x33')]=_[_0xfa33('0x35')](db[_0xfa33('0x2f')][_0xfa33('0x30')]);_0x392b67[_0xfa33('0x34')]=_['keys'](_0x126ee7[_0xfa33('0x34')]);_0x392b67['filters']=_['intersection'](_0x392b67[_0xfa33('0x33')],_0x392b67['query']);_0xb2613a[_0xfa33('0x36')]=_['intersection'](_0x392b67[_0xfa33('0x33')],qs[_0xfa33('0x38')](_0x126ee7[_0xfa33('0x34')][_0xfa33('0x38')]));_0xb2613a['attributes']=_0xb2613a[_0xfa33('0x36')][_0xfa33('0x39')]?_0xb2613a[_0xfa33('0x36')]:_0x392b67[_0xfa33('0x33')];if(_0x126ee7[_0xfa33('0x34')]['includeAll']){_0xb2613a[_0xfa33('0x44')]=[{'all':!![]}];}_0xb2613a=_['merge']({},_0xb2613a,_0x126ee7[_0xfa33('0x42')]);return db[_0xfa33('0x2f')][_0xfa33('0x49')](_0xb2613a)[_0xfa33('0x28')](handleEntityNotFound(_0x573a3d,null))['then'](respondWithResult(_0x573a3d,null))['catch'](handleError(_0x573a3d,null));};exports[_0xfa33('0x4a')]=function(_0x168653,_0x40f507){return db[_0xfa33('0x2f')][_0xfa33('0x4a')](_0x168653[_0xfa33('0x4b')],{})[_0xfa33('0x28')](function(_0x37e637){var _0xbb026c=_0x168653[_0xfa33('0x4c')]['get']({'plain':!![]});if(!_0xbb026c)throw new Error(_0xfa33('0x4d'));if(_0xbb026c[_0xfa33('0x4e')]===_0xfa33('0x4c')){var _0x2f4ec5=_0x37e637[_0xfa33('0x4f')]({'plain':!![]});var _0x223bae=_0xfa33('0x29');return db[_0xfa33('0x50')]['find']({'where':{'name':_0x223bae,'userProfileId':_0xbb026c['userProfileId']},'raw':!![]})[_0xfa33('0x28')](function(_0x2b1969){if(_0x2b1969&&_0x2b1969[_0xfa33('0x51')]===0x0){return db[_0xfa33('0x52')][_0xfa33('0x4a')]({'name':_0x2f4ec5[_0xfa33('0x2c')],'resourceId':_0x2f4ec5['id'],'type':_0x2b1969[_0xfa33('0x2c')],'sectionId':_0x2b1969['id']},{})[_0xfa33('0x28')](function(){return _0x37e637;});}else{return _0x37e637;}})[_0xfa33('0x47')](function(_0x42674f){logger['error'](_0xfa33('0x53'),_0x42674f);throw _0x42674f;});}return _0x37e637;})[_0xfa33('0x28')](respondWithResult(_0x40f507,0xc9))[_0xfa33('0x47')](handleError(_0x40f507,null));};exports[_0xfa33('0x26')]=function(_0x161556,_0x2fda6f){if(_0x161556[_0xfa33('0x4b')]['id']){delete _0x161556['body']['id'];}return db['Schedule'][_0xfa33('0x49')]({'where':{'id':_0x161556[_0xfa33('0x48')]['id']}})['then'](handleEntityNotFound(_0x2fda6f,null))['then'](saveUpdates(_0x161556[_0xfa33('0x4b')],null))[_0xfa33('0x28')](respondWithResult(_0x2fda6f,null))[_0xfa33('0x47')](handleError(_0x2fda6f,null));};exports['destroy']=function(_0x5b35c7,_0x38b70c){return db[_0xfa33('0x2f')]['find']({'where':{'id':_0x5b35c7[_0xfa33('0x48')]['id']}})['then'](handleEntityNotFound(_0x38b70c,null))[_0xfa33('0x28')](removeEntity(_0x38b70c,null))[_0xfa33('0x47')](handleError(_0x38b70c,null));};exports[_0xfa33('0x54')]=function(_0x44375d,_0x1b18ce,_0x56888c){var _0x28b52a=require(_0xfa33('0x55'));return db[_0xfa33('0x2f')][_0xfa33('0x49')]({'where':{'id':_0x44375d[_0xfa33('0x48')]['id']},'raw':!![]})[_0xfa33('0x28')](handleEntityNotFound(_0x1b18ce,null))[_0xfa33('0x28')](function(){_0x28b52a[_0xfa33('0x54')](_0x44375d[_0xfa33('0x48')]['id']);})[_0xfa33('0x28')](respondWithStatusCode(_0x1b18ce,null))['catch'](handleError(_0x1b18ce,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 4054e93..5f39ca5 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 _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 +var _0x1134=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','define','Schedule','tools_schedules'];(function(_0x47bd60,_0x22f024){var _0x523729=function(_0x9b333a){while(--_0x9b333a){_0x47bd60['push'](_0x47bd60['shift']());}};_0x523729(++_0x22f024);}(_0x1134,0x8f));var _0x4113=function(_0x269282,_0x202e94){_0x269282=_0x269282-0x0;var _0x366654=_0x1134[_0x269282];return _0x366654;};'use strict';var _=require('lodash');var util=require(_0x4113('0x0'));var logger=require(_0x4113('0x1'))(_0x4113('0x2'));var moment=require(_0x4113('0x3'));var BPromise=require(_0x4113('0x4'));var rp=require(_0x4113('0x5'));var fs=require('fs');var path=require(_0x4113('0x6'));var rimraf=require(_0x4113('0x7'));var config=require(_0x4113('0x8'));var attributes=require(_0x4113('0x9'));module['exports']=function(_0x583b75,_0xd76955){return _0x583b75[_0x4113('0xa')](_0x4113('0xb'),attributes,{'tableName':_0x4113('0xc'),'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 643056d..e170af2 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 _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 +var _0x9d27=['jayson/promise','client','http','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4020bf,_0x4fa223){var _0x49bf21=function(_0x1656d4){while(--_0x1656d4){_0x4020bf['push'](_0x4020bf['shift']());}};_0x49bf21(++_0x4fa223);}(_0x9d27,0x16e));var _0x79d2=function(_0x17b47d,_0x3136fb){_0x17b47d=_0x17b47d-0x0;var _0x3c643e=_0x9d27[_0x17b47d];return _0x3c643e;};'use strict';var _=require(_0x79d2('0x0'));var util=require(_0x79d2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x79d2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x79d2('0x3'))['db'];var utils=require(_0x79d2('0x4'));var logger=require(_0x79d2('0x5'))(_0x79d2('0x6'));var config=require(_0x79d2('0x7'));var jayson=require(_0x79d2('0x8'));var client=jayson[_0x79d2('0x9')][_0x79d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x490099,_0x315a18,_0x509b86){return new BPromise(function(_0x105a67,_0x17722b){return client[_0x79d2('0xb')](_0x490099,_0x509b86)['then'](function(_0xd71750){logger[_0x79d2('0xc')](_0x79d2('0xd'),_0x315a18,_0x79d2('0xe'));logger[_0x79d2('0xf')](_0x79d2('0x10'),_0x315a18,_0x79d2('0xe'),JSON[_0x79d2('0x11')](_0xd71750));if(_0xd71750[_0x79d2('0x12')]){if(_0xd71750[_0x79d2('0x12')]['code']===0x1f4){logger['error'](_0x79d2('0xd'),_0x315a18,_0xd71750[_0x79d2('0x12')]['message']);return _0x17722b(_0xd71750[_0x79d2('0x12')][_0x79d2('0x13')]);}logger[_0x79d2('0x12')](_0x79d2('0xd'),_0x315a18,_0xd71750['error'][_0x79d2('0x13')]);return _0x105a67(_0xd71750[_0x79d2('0x12')][_0x79d2('0x13')]);}else{logger[_0x79d2('0xc')](_0x79d2('0xd'),_0x315a18,_0x79d2('0xe'));_0x105a67(_0xd71750[_0x79d2('0x14')][_0x79d2('0x13')]);}})[_0x79d2('0x15')](function(_0x5480b4){logger[_0x79d2('0x12')](_0x79d2('0xd'),_0x315a18,_0x5480b4);_0x17722b(_0x5480b4);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index e8dd063..ba802b9 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 _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 +var _0x9425=['/:id/download','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./screenRecording.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x5700ae,_0x1388b9){var _0x3a7e1e=function(_0x42eaef){while(--_0x42eaef){_0x5700ae['push'](_0x5700ae['shift']());}};_0x3a7e1e(++_0x1388b9);}(_0x9425,0x91));var _0x5942=function(_0x57f9a6,_0x474e88){_0x57f9a6=_0x57f9a6-0x0;var _0x436487=_0x9425[_0x57f9a6];return _0x436487;};'use strict';var multer=require('multer');var util=require(_0x5942('0x0'));var path=require(_0x5942('0x1'));var timeout=require(_0x5942('0x2'));var express=require(_0x5942('0x3'));var router=express[_0x5942('0x4')]();var fs_extra=require(_0x5942('0x5'));var auth=require(_0x5942('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5942('0x7'));var controller=require(_0x5942('0x8'));router['get']('/',auth[_0x5942('0x9')](),controller['index']);router[_0x5942('0xa')](_0x5942('0xb'),auth[_0x5942('0x9')](),controller[_0x5942('0xc')]);router['get'](_0x5942('0xd'),auth[_0x5942('0x9')](),controller[_0x5942('0xe')]);router[_0x5942('0xa')](_0x5942('0xf'),auth[_0x5942('0x9')](),controller['download']);router['post']('/',auth[_0x5942('0x9')](),controller['create']);router[_0x5942('0x10')](_0x5942('0xd'),auth[_0x5942('0x9')](),controller[_0x5942('0x11')]);router[_0x5942('0x12')](_0x5942('0xd'),auth[_0x5942('0x9')](),controller[_0x5942('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 55e5019..3a75e24 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 _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 +var _0xb5fa=['DATE','MM-DD-YYYY\x20HH:mm','toString','format','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','INTEGER','setDataValue','subtract','closedAt','duration'];(function(_0x3822ab,_0x4a4dd2){var _0x5e4d2c=function(_0xab8e45){while(--_0xab8e45){_0x3822ab['push'](_0x3822ab['shift']());}};_0x5e4d2c(++_0x4a4dd2);}(_0xb5fa,0xf8));var _0xab5f=function(_0x548f5d,_0x3b4c43){_0x548f5d=_0x548f5d-0x0;var _0x40e907=_0xb5fa[_0x548f5d];return _0x40e907;};'use strict';var Sequelize=require(_0xab5f('0x0'));var moment=require(_0xab5f('0x1'));var path=require(_0xab5f('0x2'));var config=require(_0xab5f('0x3'));module[_0xab5f('0x4')]={'format':{'type':Sequelize[_0xab5f('0x5')],'get':function(){return this[_0xab5f('0x6')](_0xab5f('0x7'))?path[_0xab5f('0x8')](this[_0xab5f('0x6')](_0xab5f('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0xab5f('0x9')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x489cd2){var _0x1e5941=_0x489cd2[_0xab5f('0xa')](/\\/g,'/');this['setDataValue'](_0xab5f('0x7'),_0x1e5941);}},'rating':{'type':Sequelize[_0xab5f('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xab5f('0xb')],'set':function(_0x177190){this[_0xab5f('0xc')]('startedAt',moment()[_0xab5f('0xd')](_0x177190,'ms'));this['setDataValue'](_0xab5f('0xe'),moment());this['setDataValue'](_0xab5f('0xf'),_0x177190);}},'startedAt':{'type':Sequelize[_0xab5f('0x10')],'get':function(){return moment(this['getDataValue']('startedAt'))['format'](_0xab5f('0x11'))[_0xab5f('0x12')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xab5f('0x6')](_0xab5f('0xe')))[_0xab5f('0x13')](_0xab5f('0x11'))[_0xab5f('0x12')]();}},'createdAt':{'type':Sequelize[_0xab5f('0x10')],'get':function(){return moment(this[_0xab5f('0x6')](_0xab5f('0x14')))[_0xab5f('0x13')](_0xab5f('0x11'))[_0xab5f('0x12')]();}},'updatedAt':{'type':Sequelize[_0xab5f('0x10')],'get':function(){return moment(this[_0xab5f('0x6')](_0xab5f('0x15')))[_0xab5f('0x13')](_0xab5f('0x11'))[_0xab5f('0x12')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 611e1a9..309f20b 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 _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 +var _0x46ed=['intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','keys','include','options','find','create','body','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','params','value','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','recording','existsSync','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','end','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','format','query','filters'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x46ed,0x168));var _0xd46e=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x46ed[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];function respondWithStatusCode(_0x5bc1da,_0x48550b){_0x48550b=_0x48550b||0xcc;return function(_0xf3048c){if(_0xf3048c){return _0x5bc1da[_0xd46e('0x1a')](_0x48550b);}return _0x5bc1da['status'](_0x48550b)['end']();};}function respondWithResult(_0xacd799,_0x4688ae){_0x4688ae=_0x4688ae||0xc8;return function(_0x1e9aae){if(_0x1e9aae){return _0xacd799[_0xd46e('0x1b')](_0x4688ae)['json'](_0x1e9aae);}};}function respondWithFilteredResult(_0x3b6d25,_0x44a620){return function(_0x417402){if(_0x417402){var _0x3d72ce=typeof _0x44a620[_0xd46e('0x1c')]==='undefined'&&typeof _0x44a620[_0xd46e('0x1d')]===_0xd46e('0x1e');var _0x3583a5=_0x417402['count'];var _0x5ddd04=_0x3d72ce?0x0:_0x44a620[_0xd46e('0x1c')];var _0x1bd574=_0x3d72ce?_0x417402['count']:_0x44a620['offset']+_0x44a620[_0xd46e('0x1d')];var _0x2f2571;if(_0x1bd574>=_0x3583a5){_0x1bd574=_0x3583a5;_0x2f2571=0xc8;}else{_0x2f2571=0xce;}_0x3b6d25[_0xd46e('0x1b')](_0x2f2571);return _0x3b6d25[_0xd46e('0x1f')](_0xd46e('0x20'),_0x5ddd04+'-'+_0x1bd574+'/'+_0x3583a5)[_0xd46e('0x21')](_0x417402);}return null;};}function patchUpdates(_0x3b5fa4){return function(_0x327b7e){try{jsonpatch[_0xd46e('0x22')](_0x327b7e,_0x3b5fa4,!![]);}catch(_0x3c7e91){return BPromise[_0xd46e('0x23')](_0x3c7e91);}return _0x327b7e['save']();};}function saveUpdates(_0x259072,_0x1c83fa){return function(_0x79aa51){if(_0x79aa51){return _0x79aa51[_0xd46e('0x24')](_0x259072)[_0xd46e('0x25')](function(_0xc1af7f){return _0xc1af7f;});}return null;};}function removeEntity(_0x33c2e0,_0x8a1be){return function(_0x62dea5){if(_0x62dea5){return _0x62dea5['destroy']()[_0xd46e('0x25')](function(){_0x33c2e0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x371054,_0x2a5271){return function(_0x21135f){if(!_0x21135f){_0x371054[_0xd46e('0x1a')](0x194);}return _0x21135f;};}function handleError(_0x247b9f,_0x180851){_0x180851=_0x180851||0x1f4;return function(_0x1740d1){logger['error'](_0x1740d1[_0xd46e('0x26')]);if(_0x1740d1[_0xd46e('0x27')]){delete _0x1740d1[_0xd46e('0x27')];}_0x247b9f[_0xd46e('0x1b')](_0x180851)[_0xd46e('0x28')](_0x1740d1);};}exports[_0xd46e('0x29')]=function(_0x58aeef,_0x465d54){var _0x3a1ced={},_0x2d1afe={},_0xa716ce={'count':0x0,'rows':[]};var _0x106edc=_[_0xd46e('0x2a')](db[_0xd46e('0x2b')][_0xd46e('0x2c')],function(_0x18f060){return{'name':_0x18f060[_0xd46e('0x2d')],'type':_0x18f060[_0xd46e('0x2e')][_0xd46e('0x2f')]};});_0x2d1afe[_0xd46e('0x30')]=_['differenceBy'](_[_0xd46e('0x2a')](_0x106edc,_0xd46e('0x27')),[_0xd46e('0x31')]);_0x2d1afe[_0xd46e('0x32')]=_['keys'](_0x58aeef[_0xd46e('0x32')]);_0x2d1afe[_0xd46e('0x33')]=_['intersection'](_0x2d1afe[_0xd46e('0x30')],_0x2d1afe[_0xd46e('0x32')]);_0x3a1ced['attributes']=_[_0xd46e('0x34')](_0x2d1afe[_0xd46e('0x30')],qs[_0xd46e('0x35')](_0x58aeef['query']['fields']));_0x3a1ced[_0xd46e('0x36')]=_0x3a1ced[_0xd46e('0x36')][_0xd46e('0x37')]?_0x3a1ced[_0xd46e('0x36')]:_0x2d1afe[_0xd46e('0x30')];if(!_0x58aeef[_0xd46e('0x32')][_0xd46e('0x38')](_0xd46e('0x39'))){_0x3a1ced['limit']=qs[_0xd46e('0x1d')](_0x58aeef[_0xd46e('0x32')][_0xd46e('0x1d')]);_0x3a1ced[_0xd46e('0x1c')]=qs[_0xd46e('0x1c')](_0x58aeef[_0xd46e('0x32')][_0xd46e('0x1c')]);}_0x3a1ced['order']=qs[_0xd46e('0x3a')](_0x58aeef[_0xd46e('0x32')]['sort']);_0x3a1ced[_0xd46e('0x3b')]=qs[_0xd46e('0x33')](_[_0xd46e('0x3c')](_0x58aeef[_0xd46e('0x32')],_0x2d1afe['filters']),_0x106edc);if(_0x58aeef[_0xd46e('0x32')][_0xd46e('0x3d')]){_0x3a1ced[_0xd46e('0x3b')]=_[_0xd46e('0x3e')](_0x3a1ced[_0xd46e('0x3b')],{'$or':_[_0xd46e('0x2a')](_0x106edc,function(_0x220c57){if(_0x220c57[_0xd46e('0x2e')]!=='VIRTUAL'){var _0x232e6f={};_0x232e6f[_0x220c57[_0xd46e('0x27')]]={'$like':'%'+_0x58aeef[_0xd46e('0x32')][_0xd46e('0x3d')]+'%'};return _0x232e6f;}})});}_0x3a1ced=_[_0xd46e('0x3e')]({},_0x3a1ced,_0x58aeef['options']);var _0x964c66={'where':_0x3a1ced['where']};return db['ScreenRecording']['count'](_0x964c66)['then'](function(_0x17c3d9){_0xa716ce['count']=_0x17c3d9;if(_0x58aeef[_0xd46e('0x32')][_0xd46e('0x3f')]){_0x3a1ced['include']=[{'all':!![]}];}return db[_0xd46e('0x2b')][_0xd46e('0x40')](_0x3a1ced);})[_0xd46e('0x25')](function(_0x31ba12){_0xa716ce[_0xd46e('0x41')]=_0x31ba12;return _0xa716ce;})[_0xd46e('0x25')](respondWithFilteredResult(_0x465d54,_0x3a1ced))[_0xd46e('0x42')](handleError(_0x465d54,null));};exports[_0xd46e('0x43')]=function(_0x3a98e4,_0xec367d){var _0x259e2={'raw':![],'where':{'id':_0x3a98e4['params']['id']}},_0x5ea048={};_0x5ea048['model']=_[_0xd46e('0x44')](db['ScreenRecording'][_0xd46e('0x2c')]);_0x5ea048[_0xd46e('0x32')]=_[_0xd46e('0x44')](_0x3a98e4[_0xd46e('0x32')]);_0x5ea048[_0xd46e('0x33')]=_[_0xd46e('0x34')](_0x5ea048[_0xd46e('0x30')],_0x5ea048[_0xd46e('0x32')]);_0x259e2['attributes']=_[_0xd46e('0x34')](_0x5ea048['model'],qs[_0xd46e('0x35')](_0x3a98e4[_0xd46e('0x32')][_0xd46e('0x35')]));_0x259e2[_0xd46e('0x36')]=_0x259e2[_0xd46e('0x36')]['length']?_0x259e2[_0xd46e('0x36')]:_0x5ea048[_0xd46e('0x30')];if(_0x3a98e4[_0xd46e('0x32')][_0xd46e('0x3f')]){_0x259e2[_0xd46e('0x45')]=[{'all':!![]}];}_0x259e2=_['merge']({},_0x259e2,_0x3a98e4[_0xd46e('0x46')]);return db[_0xd46e('0x2b')][_0xd46e('0x47')](_0x259e2)[_0xd46e('0x25')](handleEntityNotFound(_0xec367d,null))[_0xd46e('0x25')](respondWithResult(_0xec367d,null))['catch'](handleError(_0xec367d,null));};exports[_0xd46e('0x48')]=function(_0x3ea9e6,_0x45baf1){return db[_0xd46e('0x2b')][_0xd46e('0x48')](_0x3ea9e6[_0xd46e('0x49')],{})[_0xd46e('0x25')](respondWithResult(_0x45baf1,0xc9))[_0xd46e('0x42')](handleError(_0x45baf1,null));};exports['update']=function(_0xf9dab,_0x71a8dc){if(_0xf9dab[_0xd46e('0x49')]['id']){delete _0xf9dab[_0xd46e('0x49')]['id'];}delete _0xf9dab[_0xd46e('0x49')]['duration'];delete _0xf9dab['body'][_0xd46e('0x4a')];delete _0xf9dab[_0xd46e('0x49')][_0xd46e('0x4b')];delete _0xf9dab['body']['value'];return db[_0xd46e('0x2b')][_0xd46e('0x47')]({'where':{'id':_0xf9dab['params']['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x71a8dc,null))[_0xd46e('0x25')](saveUpdates(_0xf9dab[_0xd46e('0x49')],null))[_0xd46e('0x25')](respondWithResult(_0x71a8dc,null))[_0xd46e('0x42')](handleError(_0x71a8dc,null));};exports[_0xd46e('0x4c')]=function(_0x80ed51,_0x16ca0e){return db['ScreenRecording'][_0xd46e('0x4c')]()[_0xd46e('0x25')](respondWithResult(_0x16ca0e,null))[_0xd46e('0x42')](handleError(_0x16ca0e,null));};exports[_0xd46e('0x4d')]=function(_0x4ec295,_0x56dd9a,_0xced102){var _0x5a4a44=require(_0xd46e('0x4e'));var _0x2af20b=![];var _0x393cb9={};if(_0x4ec295[_0xd46e('0x32')][_0xd46e('0x2e')]&&_0x4ec295[_0xd46e('0x32')]['type']===_0xd46e('0x4f')){_0x393cb9[_0xd46e('0x4f')]=_0x4ec295[_0xd46e('0x50')]['id'];}else{_0x393cb9['id']=_0x4ec295['params']['id'];}return db[_0xd46e('0x2b')][_0xd46e('0x47')]({'where':_0x393cb9,'attributes':['id',_0xd46e('0x51')],'raw':!![]})[_0xd46e('0x25')](handleEntityNotFound(_0x56dd9a,null))[_0xd46e('0x25')](function(_0x2cc676){if(_0x2cc676){var _0x2760ef=path[_0xd46e('0x52')](config[_0xd46e('0x53')],_0xd46e('0x54'),_0x2cc676[_0xd46e('0x51')]);var _0x411b19=util[_0xd46e('0x31')](_0xd46e('0x55'),_0x2760ef);if(fs['existsSync'](_0x411b19)){_0x2af20b=!![];return _0x5a4a44[_0xd46e('0x56')](_0x411b19,_0x2760ef,config[_0xd46e('0x57')][_0xd46e('0x58')])[_0xd46e('0x25')](function(){return _0x2cc676;});}return _0x2cc676;}})['then'](function(_0x636f15){if(_0x636f15){var _0x36e18a=path[_0xd46e('0x52')](config[_0xd46e('0x53')],'server/files/screen_recordings',_0x636f15[_0xd46e('0x51')]);if(!fs[_0xd46e('0x59')](_0x36e18a)){throw new db['Sequelize']['ValidationError'](_0xd46e('0x5a'));}if(_0x636f15[_0xd46e('0x5b')]){return _0x56dd9a[_0xd46e('0x4d')](_0x36e18a,_0x636f15['filename']+path['extname'](_0x36e18a),function(){if(_0x2af20b){fs[_0xd46e('0x5c')](_0x36e18a);}});}else{return _0x56dd9a[_0xd46e('0x4d')](_0x36e18a,function(_0x1f310d){if(_0x2af20b){fs[_0xd46e('0x5c')](_0x36e18a);}});}}})[_0xd46e('0x42')](function(_0x2f9fcb){if(_0x2f9fcb[_0xd46e('0x5d')]===_0xd46e('0x5a')){_0x56dd9a[_0xd46e('0x1b')](0x194)[_0xd46e('0x28')](_0xd46e('0x5e'));}else{return handleError(_0x56dd9a,null);}});};exports[_0xd46e('0x5f')]=function(_0x272514,_0x329204){return db[_0xd46e('0x2b')][_0xd46e('0x47')]({'where':{'id':_0x272514['params']['id']}})[_0xd46e('0x25')](function(_0x1a3771){if(_[_0xd46e('0x60')](_0x1a3771)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1a3771;})[_0xd46e('0x25')](function(_0x313c7e){var _0x4dec29=path[_0xd46e('0x52')](config[_0xd46e('0x53')],_0xd46e('0x54'),_0x313c7e['value']);logger[_0xd46e('0x61')](_0xd46e('0x62'),_0x4dec29);if(!_[_0xd46e('0x60')](_0x313c7e['value'])&&fs[_0xd46e('0x59')](_0x4dec29)){logger['info'](_0xd46e('0x63')+_0x4dec29+_0xd46e('0x64'));fs[_0xd46e('0x65')](_0x4dec29);}_0x4dec29=_0x4dec29+'.cypher';if(!_[_0xd46e('0x60')](_0x313c7e[_0xd46e('0x51')])&&fs[_0xd46e('0x59')](_0x4dec29)){logger[_0xd46e('0x61')](_0xd46e('0x63')+_0x4dec29+_0xd46e('0x64'));fs[_0xd46e('0x65')](_0x4dec29);}return _0x313c7e;})[_0xd46e('0x25')](function(_0x300ee9){if(!_0x300ee9)throw new InternalError();return _0x300ee9[_0xd46e('0x5f')]();})[_0xd46e('0x25')](function(){_0x329204[_0xd46e('0x1b')](0xcc)[_0xd46e('0x66')]();})[_0xd46e('0x42')](handleError(_0x329204,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 5c644f7..0bcf70d 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 _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 +var _0x0e80=['rimraf','./screenRecording.attributes','exports','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xd0f423,_0x18dd7f){var _0x50f469=function(_0x185921){while(--_0x185921){_0xd0f423['push'](_0xd0f423['shift']());}};_0x50f469(++_0x18dd7f);}(_0x0e80,0x172));var _0x00e8=function(_0x1fc89c,_0x50c6f9){_0x1fc89c=_0x1fc89c-0x0;var _0x23533d=_0x0e80[_0x1fc89c];return _0x23533d;};'use strict';var _=require(_0x00e8('0x0'));var util=require(_0x00e8('0x1'));var logger=require(_0x00e8('0x2'))(_0x00e8('0x3'));var moment=require(_0x00e8('0x4'));var BPromise=require(_0x00e8('0x5'));var rp=require(_0x00e8('0x6'));var fs=require('fs');var path=require(_0x00e8('0x7'));var rimraf=require(_0x00e8('0x8'));var config=require('../../config/environment');var attributes=require(_0x00e8('0x9'));module[_0x00e8('0xa')]=function(_0x2d42d6,_0x3af631){return _0x2d42d6['define'](_0x00e8('0xb'),attributes,{'tableName':_0x00e8('0xc'),'paranoid':![],'indexes':[{'name':_0x00e8('0xd'),'fields':[_0x00e8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 0ba8418..e3f5e97 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 _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 +var _0xe997=['message','result','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x190323,_0x4e67dd){var _0x1f0899=function(_0x72e018){while(--_0x72e018){_0x190323['push'](_0x190323['shift']());}};_0x1f0899(++_0x4e67dd);}(_0xe997,0x8e));var _0x7e99=function(_0x6420ed,_0x1c652b){_0x6420ed=_0x6420ed-0x0;var _0x244d3a=_0xe997[_0x6420ed];return _0x244d3a;};'use strict';var _=require(_0x7e99('0x0'));var util=require(_0x7e99('0x1'));var moment=require('moment');var BPromise=require(_0x7e99('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e99('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e99('0x4'));var logger=require(_0x7e99('0x5'))(_0x7e99('0x6'));var config=require('../../config/environment');var jayson=require(_0x7e99('0x7'));var client=jayson[_0x7e99('0x8')][_0x7e99('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x306408,_0x30a140,_0x375d32){return new BPromise(function(_0x1e29e7,_0x5d5b55){return client[_0x7e99('0xa')](_0x306408,_0x375d32)[_0x7e99('0xb')](function(_0x2a263d){logger[_0x7e99('0xc')](_0x7e99('0xd'),_0x30a140,'request\x20sent');logger['debug'](_0x7e99('0xe'),_0x30a140,_0x7e99('0xf'),JSON[_0x7e99('0x10')](_0x2a263d));if(_0x2a263d[_0x7e99('0x11')]){if(_0x2a263d[_0x7e99('0x11')]['code']===0x1f4){logger[_0x7e99('0x11')](_0x7e99('0xd'),_0x30a140,_0x2a263d['error'][_0x7e99('0x12')]);return _0x5d5b55(_0x2a263d[_0x7e99('0x11')]['message']);}logger[_0x7e99('0x11')](_0x7e99('0xd'),_0x30a140,_0x2a263d[_0x7e99('0x11')][_0x7e99('0x12')]);return _0x1e29e7(_0x2a263d[_0x7e99('0x11')][_0x7e99('0x12')]);}else{logger[_0x7e99('0xc')](_0x7e99('0xd'),_0x30a140,_0x7e99('0xf'));_0x1e29e7(_0x2a263d[_0x7e99('0x13')]['message']);}})['catch'](function(_0x1c3da7){logger[_0x7e99('0x11')](_0x7e99('0xd'),_0x30a140,_0x1c3da7);_0x5d5b55(_0x1c3da7);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index d3d32a1..b6b17db 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 _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 +var _0xc282=['root','logologin','post','addLogoLogin','preferred','/:id/preferred','addPreferred','favicon','addFavicon','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./setting.controller','index','get','getDate','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','getPreferred','/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','format','%s%s','extname','originalname','single','file','addLogo'];(function(_0x2b0cc5,_0x357db5){var _0x48dac6=function(_0x2eacd5){while(--_0x2eacd5){_0x2b0cc5['push'](_0x2b0cc5['shift']());}};_0x48dac6(++_0x357db5);}(_0xc282,0x139));var _0x2c28=function(_0x1afd42,_0x45613a){_0x1afd42=_0x1afd42-0x0;var _0x41d885=_0xc282[_0x1afd42];return _0x41d885;};'use strict';var multer=require(_0x2c28('0x0'));var util=require(_0x2c28('0x1'));var path=require(_0x2c28('0x2'));var timeout=require(_0x2c28('0x3'));var express=require(_0x2c28('0x4'));var router=express[_0x2c28('0x5')]();var fs_extra=require(_0x2c28('0x6'));var auth=require(_0x2c28('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2c28('0x8'));var controller=require(_0x2c28('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x2c28('0xa')]);router[_0x2c28('0xb')]('/now',controller[_0x2c28('0xc')]);router['get']('/:id',controller[_0x2c28('0xd')]);router['get'](_0x2c28('0xe'),controller['getLogo']);router['get'](_0x2c28('0xf'),controller[_0x2c28('0x10')]);router[_0x2c28('0xb')](_0x2c28('0x11'),controller['gdpr']);router[_0x2c28('0xb')]('/:id/preferred',controller[_0x2c28('0x12')]);router[_0x2c28('0xb')](_0x2c28('0x13'),controller[_0x2c28('0x14')]);var upload=multer({'storage':multer[_0x2c28('0x15')]({'destination':function(_0x482f03,_0x34c564,_0x2b339e){_0x2b339e(null,path[_0x2c28('0x16')](config['root'],_0x2c28('0x17')));},'filename':function(_0x14099c,_0x1aa40a,_0x4b3feb){_0x4b3feb(null,util[_0x2c28('0x18')](_0x2c28('0x19'),'logo',path[_0x2c28('0x1a')](_0x1aa40a[_0x2c28('0x1b')])));}})});router['post'](_0x2c28('0xe'),upload[_0x2c28('0x1c')](_0x2c28('0x1d')),controller[_0x2c28('0x1e')]);var upload=multer({'storage':multer[_0x2c28('0x15')]({'destination':function(_0x1e7e94,_0x535372,_0xefc3f7){_0xefc3f7(null,path[_0x2c28('0x16')](config[_0x2c28('0x1f')],_0x2c28('0x17')));},'filename':function(_0x5d1bd4,_0x552a28,_0x2b6543){_0x2b6543(null,util[_0x2c28('0x18')](_0x2c28('0x19'),_0x2c28('0x20'),path['extname'](_0x552a28[_0x2c28('0x1b')])));}})});router[_0x2c28('0x21')](_0x2c28('0xf'),upload[_0x2c28('0x1c')]('file'),controller[_0x2c28('0x22')]);var upload=multer({'storage':multer[_0x2c28('0x15')]({'destination':function(_0x46bd80,_0x4be112,_0x129d94){_0x129d94(null,path['join'](config[_0x2c28('0x1f')],_0x2c28('0x17')));},'filename':function(_0x427c15,_0x43c41d,_0x39e040){_0x39e040(null,util[_0x2c28('0x18')]('%s%s',_0x2c28('0x23'),path[_0x2c28('0x1a')](_0x43c41d[_0x2c28('0x1b')])));}})});router[_0x2c28('0x21')](_0x2c28('0x24'),upload['single'](_0x2c28('0x1d')),controller[_0x2c28('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x520a01,_0x66aa44,_0xb4c8b5){_0xb4c8b5(null,path[_0x2c28('0x16')](config['root'],'server/files/images/logos/'));},'filename':function(_0x5f2567,_0x1a934b,_0x287339){_0x287339(null,util[_0x2c28('0x18')](_0x2c28('0x19'),_0x2c28('0x26'),path[_0x2c28('0x1a')](_0x1a934b[_0x2c28('0x1b')])));}})});router[_0x2c28('0x21')](_0x2c28('0x13'),upload[_0x2c28('0x1c')](_0x2c28('0x1d')),controller[_0x2c28('0x27')]);router[_0x2c28('0x28')]('/:id',auth['isAuthenticated'](),controller[_0x2c28('0x29')]);module[_0x2c28('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 9be33d0..8a4fa27 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(_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 +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x3ca1e6,_0x1f1d8c){var _0x16760b=function(_0x243836){while(--_0x243836){_0x3ca1e6['push'](_0x3ca1e6['shift']());}};_0x16760b(++_0x1f1d8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 7c9c263..9873707 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 _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 +var _0x5ebe=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','info','request\x20sent','result','catch','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','Setting','findAll','params','find','body','file','logo','filename','loginLogo','server/files/images/logos','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','custom','existsSync','Sequelize','upperFirst','download','getLogoLogin','default_loginLogo.svg','default','addPreferred','preferred','getPreferred','default_preferred.png','\x20not\x20found','addFavicon','getFavicon','default_favicon.ico','ValidationError','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0xdb5b68,_0x1303ee){var _0x5a441d=function(_0xa01d04){while(--_0xa01d04){_0xdb5b68['push'](_0xdb5b68['shift']());}};_0x5a441d(++_0x1303ee);}(_0x5ebe,0x69));var _0xe5eb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5ebe[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe5eb('0x0'));var zipdir=require(_0xe5eb('0x1'));var jsonpatch=require(_0xe5eb('0x2'));var rp=require(_0xe5eb('0x3'));var moment=require(_0xe5eb('0x4'));var BPromise=require(_0xe5eb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe5eb('0x6'));var sox=require(_0xe5eb('0x7'));var csv=require(_0xe5eb('0x8'));var ejs=require(_0xe5eb('0x9'));var fs=require('fs');var fs_extra=require(_0xe5eb('0xa'));var _=require(_0xe5eb('0xb'));var squel=require(_0xe5eb('0xc'));var crypto=require(_0xe5eb('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe5eb('0xe'));var Redis=require('ioredis');var authService=require(_0xe5eb('0xf'));var qs=require(_0xe5eb('0x10'));var as=require(_0xe5eb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5eb('0x12'))(_0xe5eb('0x13'));var utils=require(_0xe5eb('0x14'));var config=require(_0xe5eb('0x15'));var licenseUtil=require(_0xe5eb('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0xe5eb('0x17'));var client=jayson[_0xe5eb('0x18')][_0xe5eb('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x53fda0,_0x4c32d1,_0x28e90c,_0xe91be9){return new BPromise(function(_0x22e644,_0x531940){var _0x40ae36=_0xe91be9||client;return _0x40ae36[_0xe5eb('0x1a')](_0x53fda0,_0x28e90c)['then'](function(_0x425747){logger['info']('Setting,\x20%s,\x20%s',_0x4c32d1,'request\x20sent');logger[_0xe5eb('0x1b')](_0xe5eb('0x1c'),_0x4c32d1,'request\x20sent',JSON[_0xe5eb('0x1d')](_0x425747));if(_0x425747['error']){if(_0x425747[_0xe5eb('0x1e')][_0xe5eb('0x1f')]===0x1f4){logger[_0xe5eb('0x1e')](_0xe5eb('0x20'),_0x4c32d1,_0x425747['error'][_0xe5eb('0x21')]);return _0x531940(_0x425747[_0xe5eb('0x1e')][_0xe5eb('0x21')]);}logger[_0xe5eb('0x1e')](_0xe5eb('0x20'),_0x4c32d1,_0x425747[_0xe5eb('0x1e')][_0xe5eb('0x21')]);return _0x22e644(_0x425747['error']['message']);}else{logger[_0xe5eb('0x22')]('Setting,\x20%s,\x20%s',_0x4c32d1,_0xe5eb('0x23'));_0x22e644(_0x425747[_0xe5eb('0x24')]['message']);}})[_0xe5eb('0x25')](function(_0x3e49a4){logger[_0xe5eb('0x1e')]('Setting,\x20%s,\x20%s',_0x4c32d1,_0x3e49a4);_0x531940(_0x3e49a4);});});}function respondWithStatusCode(_0x1cb938,_0x430836){_0x430836=_0x430836||0xcc;return function(_0x41fda4){if(_0x41fda4){return _0x1cb938['sendStatus'](_0x430836);}return _0x1cb938[_0xe5eb('0x26')](_0x430836)[_0xe5eb('0x27')]();};}function respondWithResult(_0x5d5348,_0x2cd698){_0x2cd698=_0x2cd698||0xc8;return function(_0x3c7e15){if(_0x3c7e15){return _0x5d5348[_0xe5eb('0x26')](_0x2cd698)['json'](_0x3c7e15);}};}function respondWithFilteredResult(_0x52b62e,_0x1bc160){return function(_0x40ecb1){if(_0x40ecb1){var _0x1234c6=typeof _0x1bc160[_0xe5eb('0x28')]==='undefined'&&typeof _0x1bc160[_0xe5eb('0x29')]===_0xe5eb('0x2a');var _0x137350=_0x40ecb1[_0xe5eb('0x2b')];var _0x49cb02=_0x1234c6?0x0:_0x1bc160['offset'];var _0x4ff77a=_0x1234c6?_0x40ecb1[_0xe5eb('0x2b')]:_0x1bc160['offset']+_0x1bc160[_0xe5eb('0x29')];var _0x225010;if(_0x4ff77a>=_0x137350){_0x4ff77a=_0x137350;_0x225010=0xc8;}else{_0x225010=0xce;}_0x52b62e['status'](_0x225010);return _0x52b62e[_0xe5eb('0x2c')](_0xe5eb('0x2d'),_0x49cb02+'-'+_0x4ff77a+'/'+_0x137350)[_0xe5eb('0x2e')](_0x40ecb1);}return null;};}function patchUpdates(_0x56c5bc){return function(_0x39b546){try{jsonpatch[_0xe5eb('0x2f')](_0x39b546,_0x56c5bc,!![]);}catch(_0x398938){return BPromise['reject'](_0x398938);}return _0x39b546[_0xe5eb('0x30')]();};}function saveUpdates(_0x439148,_0x32f5a5){return function(_0xd9a667){if(_0xd9a667){return _0xd9a667[_0xe5eb('0x31')](_0x439148)['then'](function(_0x5aa9f8){return _0x5aa9f8;});}return null;};}function removeEntity(_0x4db989,_0x36db77){return function(_0x1e51ce){if(_0x1e51ce){return _0x1e51ce[_0xe5eb('0x32')]()[_0xe5eb('0x33')](function(){_0x4db989[_0xe5eb('0x26')](0xcc)[_0xe5eb('0x27')]();});}};}function handleEntityNotFound(_0x344310,_0x5ad3f7){return function(_0x56eaa4){if(!_0x56eaa4){_0x344310['sendStatus'](0x194);}return _0x56eaa4;};}function handleError(_0x5654b2,_0x2ac7e4){_0x2ac7e4=_0x2ac7e4||0x1f4;return function(_0x56d6f8){logger[_0xe5eb('0x1e')](_0x56d6f8[_0xe5eb('0x34')]);if(_0x56d6f8[_0xe5eb('0x35')]){delete _0x56d6f8['name'];}_0x5654b2[_0xe5eb('0x26')](_0x2ac7e4)[_0xe5eb('0x36')](_0x56d6f8);};}exports[_0xe5eb('0x37')]=function(_0x50eb30,_0x635b21){var _0x21f91b={},_0x4b749c={},_0x4e9113={'count':0x0,'rows':[]};var _0x5e87c7=_[_0xe5eb('0x38')](db['Setting'][_0xe5eb('0x39')],function(_0x37f19e){return{'name':_0x37f19e[_0xe5eb('0x3a')],'type':_0x37f19e['type'][_0xe5eb('0x3b')]};});_0x4b749c[_0xe5eb('0x3c')]=_['map'](_0x5e87c7,_0xe5eb('0x35'));_0x4b749c[_0xe5eb('0x3d')]=_[_0xe5eb('0x3e')](_0x50eb30[_0xe5eb('0x3d')]);_0x4b749c['filters']=_[_0xe5eb('0x3f')](_0x4b749c[_0xe5eb('0x3c')],_0x4b749c[_0xe5eb('0x3d')]);_0x21f91b[_0xe5eb('0x40')]=_[_0xe5eb('0x3f')](_0x4b749c[_0xe5eb('0x3c')],qs[_0xe5eb('0x41')](_0x50eb30[_0xe5eb('0x3d')]['fields']));_0x21f91b[_0xe5eb('0x40')]=_0x21f91b['attributes'][_0xe5eb('0x42')]?_0x21f91b[_0xe5eb('0x40')]:_0x4b749c[_0xe5eb('0x3c')];if(!_0x50eb30[_0xe5eb('0x3d')][_0xe5eb('0x43')](_0xe5eb('0x44'))){_0x21f91b[_0xe5eb('0x29')]=qs[_0xe5eb('0x29')](_0x50eb30['query'][_0xe5eb('0x29')]);_0x21f91b[_0xe5eb('0x28')]=qs[_0xe5eb('0x28')](_0x50eb30[_0xe5eb('0x3d')]['offset']);}_0x21f91b[_0xe5eb('0x45')]=qs[_0xe5eb('0x46')](_0x50eb30[_0xe5eb('0x3d')][_0xe5eb('0x46')]);_0x21f91b[_0xe5eb('0x47')]=qs['filters'](_[_0xe5eb('0x48')](_0x50eb30[_0xe5eb('0x3d')],_0x4b749c[_0xe5eb('0x49')]),_0x5e87c7);if(_0x50eb30[_0xe5eb('0x3d')][_0xe5eb('0x4a')]){_0x21f91b[_0xe5eb('0x47')]=_[_0xe5eb('0x4b')](_0x21f91b[_0xe5eb('0x47')],{'$or':_[_0xe5eb('0x38')](_0x5e87c7,function(_0x1be3fc){if(_0x1be3fc[_0xe5eb('0x4c')]!==_0xe5eb('0x4d')){var _0x2a72cf={};_0x2a72cf[_0x1be3fc[_0xe5eb('0x35')]]={'$like':'%'+_0x50eb30['query']['filter']+'%'};return _0x2a72cf;}})});}_0x21f91b=_[_0xe5eb('0x4b')]({},_0x21f91b,_0x50eb30[_0xe5eb('0x4e')]);var _0x403490={'where':_0x21f91b[_0xe5eb('0x47')]};return db['Setting']['count'](_0x403490)[_0xe5eb('0x33')](function(_0x2e3e39){_0x4e9113['count']=_0x2e3e39;if(_0x50eb30[_0xe5eb('0x3d')][_0xe5eb('0x4f')]){_0x21f91b[_0xe5eb('0x50')]=[{'all':!![]}];}return db[_0xe5eb('0x51')][_0xe5eb('0x52')](_0x21f91b);})['then'](function(_0x36a2b6){_0x4e9113['rows']=_0x36a2b6;return _0x4e9113;})[_0xe5eb('0x33')](respondWithFilteredResult(_0x635b21,_0x21f91b))[_0xe5eb('0x25')](handleError(_0x635b21,null));};exports['show']=function(_0x51e2e1,_0x39b523){var _0x306830={'raw':![],'where':{'id':_0x51e2e1[_0xe5eb('0x53')]['id']}},_0x32ee6e={};_0x32ee6e[_0xe5eb('0x3c')]=_[_0xe5eb('0x3e')](db[_0xe5eb('0x51')][_0xe5eb('0x39')]);_0x32ee6e['query']=_['keys'](_0x51e2e1[_0xe5eb('0x3d')]);_0x32ee6e[_0xe5eb('0x49')]=_['intersection'](_0x32ee6e[_0xe5eb('0x3c')],_0x32ee6e[_0xe5eb('0x3d')]);_0x306830['attributes']=_[_0xe5eb('0x3f')](_0x32ee6e[_0xe5eb('0x3c')],qs[_0xe5eb('0x41')](_0x51e2e1[_0xe5eb('0x3d')][_0xe5eb('0x41')]));_0x306830[_0xe5eb('0x40')]=_0x306830[_0xe5eb('0x40')][_0xe5eb('0x42')]?_0x306830[_0xe5eb('0x40')]:_0x32ee6e[_0xe5eb('0x3c')];if(_0x51e2e1[_0xe5eb('0x3d')]['includeAll']){_0x306830[_0xe5eb('0x50')]=[{'all':!![]}];}_0x306830=_[_0xe5eb('0x4b')]({},_0x306830,_0x51e2e1[_0xe5eb('0x4e')]);return db[_0xe5eb('0x51')][_0xe5eb('0x54')](_0x306830)[_0xe5eb('0x33')](handleEntityNotFound(_0x39b523,null))[_0xe5eb('0x33')](respondWithResult(_0x39b523,null))[_0xe5eb('0x25')](handleError(_0x39b523,null));};exports[_0xe5eb('0x31')]=function(_0x115eb7,_0x6e8a1b){if(_0x115eb7[_0xe5eb('0x55')]['id']){delete _0x115eb7['body']['id'];}return db[_0xe5eb('0x51')]['find']({'where':{'id':_0x115eb7['params']['id']}})[_0xe5eb('0x33')](handleEntityNotFound(_0x6e8a1b,null))[_0xe5eb('0x33')](saveUpdates(_0x115eb7[_0xe5eb('0x55')],null))[_0xe5eb('0x33')](respondWithResult(_0x6e8a1b,null))[_0xe5eb('0x25')](handleError(_0x6e8a1b,null));};exports['addLogo']=function(_0x38fb49,_0x22c2bf,_0x23a029){if(_0x38fb49[_0xe5eb('0x56')]&&_0x38fb49['file']['filename']){_0x38fb49[_0xe5eb('0x55')][_0xe5eb('0x57')]=_0x38fb49[_0xe5eb('0x56')][_0xe5eb('0x58')];}return db[_0xe5eb('0x51')][_0xe5eb('0x54')]({'where':{'id':_0x38fb49['params']['id']}})[_0xe5eb('0x33')](handleEntityNotFound(_0x22c2bf,null))[_0xe5eb('0x33')](saveUpdates(_0x38fb49[_0xe5eb('0x55')],null))['then'](respondWithResult(_0x22c2bf,null))[_0xe5eb('0x25')](handleError(_0x22c2bf,null));};exports['addLogoLogin']=function(_0x434a29,_0x29bd69,_0x2cc5d0){if(_0x434a29['file']&&_0x434a29[_0xe5eb('0x56')][_0xe5eb('0x58')]){_0x434a29[_0xe5eb('0x55')][_0xe5eb('0x59')]=_0x434a29[_0xe5eb('0x56')][_0xe5eb('0x58')];}return db[_0xe5eb('0x51')][_0xe5eb('0x54')]({'where':{'id':_0x434a29[_0xe5eb('0x53')]['id']}})[_0xe5eb('0x33')](handleEntityNotFound(_0x29bd69,null))[_0xe5eb('0x33')](saveUpdates(_0x434a29[_0xe5eb('0x55')],null))[_0xe5eb('0x33')](respondWithResult(_0x29bd69,null))[_0xe5eb('0x25')](handleError(_0x29bd69,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x22e831,_0x3e86f6,_0x305b0e){var _0x354122=_0xe5eb('0x5a');var _0x2ea551={'custom':![]};return utilLicense[_0xe5eb('0x5b')]()[_0xe5eb('0x33')](function(_0x41ac4a){if(_0x41ac4a){_0x2ea551=_0x41ac4a;}return db[_0xe5eb('0x51')][_0xe5eb('0x54')]({'where':{'id':_0x22e831[_0xe5eb('0x53')]['id']},'attributes':[_0xe5eb('0x57'),_0xe5eb('0x59'),'preferred',_0xe5eb('0x5c'),_0xe5eb('0x5d'),_0xe5eb('0x5e'),_0xe5eb('0x5f'),_0xe5eb('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0x3e86f6,null))[_0xe5eb('0x33')](function(_0x38363){if(_0x38363){var _0x347871=_0x38363[_0xe5eb('0x57')]&&fs['existsSync'](path[_0xe5eb('0x61')](config[_0xe5eb('0x62')],_0x354122,_[_0xe5eb('0x63')](_0x38363[_0xe5eb('0x57')])))?path[_0xe5eb('0x61')](config[_0xe5eb('0x62')],_0x354122,_[_0xe5eb('0x63')](_0x38363['logo'])):path[_0xe5eb('0x61')](config[_0xe5eb('0x62')],_0x354122,_[_0xe5eb('0x63')](_0xe5eb('0x64')));var _0x3c055c='default'+_['upperFirst'](_0xe5eb('0x57'));if(_0x38363[_0x3c055c]||!_0x2ea551[_0xe5eb('0x65')]){_0x347871=path[_0xe5eb('0x61')](config[_0xe5eb('0x62')],_0x354122,_[_0xe5eb('0x63')]('default_logo.svg'));}if(!fs[_0xe5eb('0x66')](_0x347871)){throw new db[(_0xe5eb('0x67'))]['ValidationError'](_[_0xe5eb('0x68')](_0xe5eb('0x57'))+'\x20not\x20found');}return _0x3e86f6[_0xe5eb('0x69')](_0x347871);}})['catch'](handleError(_0x3e86f6,null));};var utilLicense=require('../../config/license/util');exports[_0xe5eb('0x6a')]=function(_0x18604b,_0x391881,_0x1803e3){var _0x58d00f=_0xe5eb('0x5a');var _0x51ff8c={'custom':![]};return utilLicense[_0xe5eb('0x5b')]()['then'](function(_0x3ee7e5){if(_0x3ee7e5){_0x51ff8c=_0x3ee7e5;}return db[_0xe5eb('0x51')][_0xe5eb('0x54')]({'where':{'id':_0x18604b[_0xe5eb('0x53')]['id']},'attributes':[_0xe5eb('0x57'),_0xe5eb('0x59'),'preferred','favicon','defaultLogo','defaultLoginLogo',_0xe5eb('0x5f'),_0xe5eb('0x60')],'raw':!![]});})[_0xe5eb('0x33')](handleEntityNotFound(_0x391881,null))['then'](function(_0x24a2f9){if(_0x24a2f9){var _0x1743a0=_0x24a2f9['loginLogo']&&fs[_0xe5eb('0x66')](path[_0xe5eb('0x61')](config[_0xe5eb('0x62')],_0x58d00f,_[_0xe5eb('0x63')](_0x24a2f9[_0xe5eb('0x59')])))?path[_0xe5eb('0x61')](config[_0xe5eb('0x62')],_0x58d00f,_[_0xe5eb('0x63')](_0x24a2f9[_0xe5eb('0x59')])):path[_0xe5eb('0x61')](config[_0xe5eb('0x62')],_0x58d00f,_['toLower'](_0xe5eb('0x6b')));var _0x236376=_0xe5eb('0x6c')+_['upperFirst'](_0xe5eb('0x59'));if(_0x24a2f9[_0x236376]||!_0x51ff8c['custom']){_0x1743a0=path[_0xe5eb('0x61')](config['root'],_0x58d00f,_[_0xe5eb('0x63')]('default_loginLogo.svg'));}if(!fs[_0xe5eb('0x66')](_0x1743a0)){throw new db[(_0xe5eb('0x67'))]['ValidationError'](_['upperFirst'](_0xe5eb('0x59'))+'\x20not\x20found');}return _0x391881[_0xe5eb('0x69')](_0x1743a0);}})[_0xe5eb('0x25')](handleError(_0x391881,null));};exports['gdpr']=function(_0xc3af8f,_0x5a03d1){return db[_0xe5eb('0x51')][_0xe5eb('0x54')]({'where':{'id':_0xc3af8f[_0xe5eb('0x53')]['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x5a03d1,null))['catch'](handleError(_0x5a03d1,null));};exports[_0xe5eb('0x6d')]=function(_0x298135,_0xba502d,_0x15490e){if(_0x298135[_0xe5eb('0x56')]&&_0x298135[_0xe5eb('0x56')]['filename']){_0x298135[_0xe5eb('0x55')][_0xe5eb('0x6e')]=_0x298135[_0xe5eb('0x56')][_0xe5eb('0x58')];}return db[_0xe5eb('0x51')]['find']({'where':{'id':_0x298135[_0xe5eb('0x53')]['id']}})[_0xe5eb('0x33')](handleEntityNotFound(_0xba502d,null))[_0xe5eb('0x33')](saveUpdates(_0x298135[_0xe5eb('0x55')],null))[_0xe5eb('0x33')](respondWithResult(_0xba502d,null))[_0xe5eb('0x25')](handleError(_0xba502d,null));};var utilLicense=require('../../config/license/util');exports[_0xe5eb('0x6f')]=function(_0x4e8f5c,_0x477a11,_0x3e3ce7){var _0x10ef75='server/files/images/logos';var _0x1b92dc={'custom':![]};return utilLicense[_0xe5eb('0x5b')]()[_0xe5eb('0x33')](function(_0xad490a){if(_0xad490a){_0x1b92dc=_0xad490a;}return db[_0xe5eb('0x51')]['find']({'where':{'id':_0x4e8f5c[_0xe5eb('0x53')]['id']},'attributes':['logo',_0xe5eb('0x59'),_0xe5eb('0x6e'),_0xe5eb('0x5c'),_0xe5eb('0x5d'),_0xe5eb('0x5e'),_0xe5eb('0x5f'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x477a11,null))[_0xe5eb('0x33')](function(_0x762892){if(_0x762892){var _0x39f578=_0x762892[_0xe5eb('0x6e')]&&fs[_0xe5eb('0x66')](path['join'](config[_0xe5eb('0x62')],_0x10ef75,_['toLower'](_0x762892[_0xe5eb('0x6e')])))?path[_0xe5eb('0x61')](config[_0xe5eb('0x62')],_0x10ef75,_['toLower'](_0x762892[_0xe5eb('0x6e')])):path['join'](config[_0xe5eb('0x62')],_0x10ef75,_[_0xe5eb('0x63')](_0xe5eb('0x70')));var _0x282f1a=_0xe5eb('0x6c')+_[_0xe5eb('0x68')](_0xe5eb('0x6e'));if(_0x762892[_0x282f1a]||!_0x1b92dc[_0xe5eb('0x65')]||!_0x1b92dc[_0xe5eb('0x6e')]){_0x39f578=path[_0xe5eb('0x61')](config[_0xe5eb('0x62')],_0x10ef75,_[_0xe5eb('0x63')]('default_preferred.png'));}if(!fs[_0xe5eb('0x66')](_0x39f578)){throw new db['Sequelize']['ValidationError'](_[_0xe5eb('0x68')]('preferred')+_0xe5eb('0x71'));}return _0x477a11[_0xe5eb('0x69')](_0x39f578);}})['catch'](handleError(_0x477a11,null));};exports[_0xe5eb('0x72')]=function(_0x246902,_0xf0d6b5,_0x7f37bc){if(_0x246902['file']&&_0x246902[_0xe5eb('0x56')][_0xe5eb('0x58')]){_0x246902[_0xe5eb('0x55')][_0xe5eb('0x5c')]=_0x246902['file'][_0xe5eb('0x58')];}return db[_0xe5eb('0x51')][_0xe5eb('0x54')]({'where':{'id':_0x246902['params']['id']}})['then'](handleEntityNotFound(_0xf0d6b5,null))[_0xe5eb('0x33')](saveUpdates(_0x246902['body'],null))[_0xe5eb('0x33')](respondWithResult(_0xf0d6b5,null))[_0xe5eb('0x25')](handleError(_0xf0d6b5,null));};var utilLicense=require(_0xe5eb('0x16'));exports[_0xe5eb('0x73')]=function(_0x2c9532,_0x29bed7,_0x3e1340){var _0x24a550=_0xe5eb('0x5a');var _0x17a362={'custom':![]};return utilLicense[_0xe5eb('0x5b')]()[_0xe5eb('0x33')](function(_0x38eb76){if(_0x38eb76){_0x17a362=_0x38eb76;}return db[_0xe5eb('0x51')][_0xe5eb('0x54')]({'where':{'id':_0x2c9532[_0xe5eb('0x53')]['id']},'attributes':[_0xe5eb('0x57'),_0xe5eb('0x59'),'preferred',_0xe5eb('0x5c'),'defaultLogo',_0xe5eb('0x5e'),_0xe5eb('0x5f'),_0xe5eb('0x60')],'raw':!![]});})[_0xe5eb('0x33')](handleEntityNotFound(_0x29bed7,null))[_0xe5eb('0x33')](function(_0x17a45a){if(_0x17a45a){var _0x1a7b43=_0x17a45a['favicon']&&fs['existsSync'](path['join'](config[_0xe5eb('0x62')],_0x24a550,_[_0xe5eb('0x63')](_0x17a45a[_0xe5eb('0x5c')])))?path[_0xe5eb('0x61')](config[_0xe5eb('0x62')],_0x24a550,_[_0xe5eb('0x63')](_0x17a45a[_0xe5eb('0x5c')])):path[_0xe5eb('0x61')](config['root'],_0x24a550,_[_0xe5eb('0x63')](_0xe5eb('0x74')));var _0x2e8ec7=_0xe5eb('0x6c')+_[_0xe5eb('0x68')](_0xe5eb('0x5c'));if(_0x17a45a[_0x2e8ec7]||!_0x17a362['custom']){_0x1a7b43=path[_0xe5eb('0x61')](config['root'],_0x24a550,_['toLower'](_0xe5eb('0x74')));}if(!fs[_0xe5eb('0x66')](_0x1a7b43)){throw new db[(_0xe5eb('0x67'))][(_0xe5eb('0x75'))](_['upperFirst']('favicon')+_0xe5eb('0x71'));}return _0x29bed7[_0xe5eb('0x69')](_0x1a7b43);}})[_0xe5eb('0x25')](handleError(_0x29bed7,null));};exports[_0xe5eb('0x76')]=function(_0x45ffef,_0x5b5205){var _0x421000={'offset':moment()[_0xe5eb('0x77')]()};_0x421000['now']=moment()[_0xe5eb('0x77')](_0x421000[_0xe5eb('0x28')])[_0xe5eb('0x78')](_0xe5eb('0x79'));return _0x5b5205[_0xe5eb('0x26')](0xc8)[_0xe5eb('0x36')](_0x421000);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 72c8765..9f1d3d5 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_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 +var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x550156,_0x58b99f){var _0x132e92=function(_0x54e413){while(--_0x54e413){_0x550156['push'](_0x550156['shift']());}};_0x132e92(++_0x58b99f);}(_0x34e8,0x12c));var _0x834e=function(_0xfcd53b,_0x4468f1){_0xfcd53b=_0xfcd53b-0x0;var _0x57fc82=_0x34e8[_0xfcd53b];return _0x57fc82;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 465bcea..c6dd8d7 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 _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 +var _0x8832=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','stringify','error','message','Setting,\x20%s,\x20%s','result','catch','Setting','options','raw','attributes','include','model','map','ShowSetting','debug','lodash'];(function(_0x2aaec6,_0x291a6f){var _0x179e5b=function(_0x164f34){while(--_0x164f34){_0x2aaec6['push'](_0x2aaec6['shift']());}};_0x179e5b(++_0x291a6f);}(_0x8832,0x77));var _0x2883=function(_0x26cefd,_0x53e737){_0x26cefd=_0x26cefd-0x0;var _0x2b1b1c=_0x8832[_0x26cefd];return _0x2b1b1c;};'use strict';var _=require(_0x2883('0x0'));var util=require('util');var moment=require(_0x2883('0x1'));var BPromise=require(_0x2883('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2883('0x3'));var db=require(_0x2883('0x4'))['db'];var utils=require(_0x2883('0x5'));var logger=require(_0x2883('0x6'))(_0x2883('0x7'));var config=require(_0x2883('0x8'));var jayson=require(_0x2883('0x9'));var client=jayson[_0x2883('0xa')][_0x2883('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1179f1,_0x1a5466,_0x5e152c){return new BPromise(function(_0x33f0d0,_0x4b8f5e){return client[_0x2883('0xc')](_0x1179f1,_0x5e152c)['then'](function(_0x4e14be){logger[_0x2883('0xd')]('Setting,\x20%s,\x20%s',_0x1a5466,_0x2883('0xe'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x1a5466,_0x2883('0xe'),JSON[_0x2883('0xf')](_0x4e14be));if(_0x4e14be[_0x2883('0x10')]){if(_0x4e14be['error']['code']===0x1f4){logger[_0x2883('0x10')]('Setting,\x20%s,\x20%s',_0x1a5466,_0x4e14be[_0x2883('0x10')][_0x2883('0x11')]);return _0x4b8f5e(_0x4e14be['error'][_0x2883('0x11')]);}logger[_0x2883('0x10')](_0x2883('0x12'),_0x1a5466,_0x4e14be[_0x2883('0x10')]['message']);return _0x33f0d0(_0x4e14be['error']['message']);}else{logger[_0x2883('0xd')](_0x2883('0x12'),_0x1a5466,_0x2883('0xe'));_0x33f0d0(_0x4e14be[_0x2883('0x13')]['message']);}})[_0x2883('0x14')](function(_0x24b33a){logger[_0x2883('0x10')](_0x2883('0x12'),_0x1a5466,_0x24b33a);_0x4b8f5e(_0x24b33a);});});}exports['ShowSetting']=function(_0x1bba69){var _0x39c5d2=this;return new Promise(function(_0x460851,_0x13d764){return db[_0x2883('0x15')]['find']({'raw':_0x1bba69[_0x2883('0x16')]?_0x1bba69[_0x2883('0x16')][_0x2883('0x17')]===undefined?!![]:![]:!![],'where':_0x1bba69[_0x2883('0x16')]?_0x1bba69[_0x2883('0x16')]['where']||null:null,'attributes':_0x1bba69[_0x2883('0x16')]?_0x1bba69[_0x2883('0x16')][_0x2883('0x18')]||null:null,'include':_0x1bba69[_0x2883('0x16')]?_0x1bba69[_0x2883('0x16')][_0x2883('0x19')]?_['map'](_0x1bba69[_0x2883('0x16')][_0x2883('0x19')],function(_0x505967){return{'model':db[_0x505967[_0x2883('0x1a')]],'as':_0x505967['as'],'attributes':_0x505967[_0x2883('0x18')],'include':_0x505967[_0x2883('0x19')]?_['map'](_0x505967[_0x2883('0x19')],function(_0x2b1f48){return{'model':db[_0x2b1f48[_0x2883('0x1a')]],'as':_0x2b1f48['as'],'attributes':_0x2b1f48[_0x2883('0x18')],'include':_0x2b1f48[_0x2883('0x19')]?_[_0x2883('0x1b')](_0x2b1f48[_0x2883('0x19')],function(_0xd415c){return{'model':db[_0xd415c[_0x2883('0x1a')]],'as':_0xd415c['as'],'attributes':_0xd415c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x243858){logger[_0x2883('0xd')](_0x2883('0x1c'),_0x1bba69);logger[_0x2883('0x1d')]('ShowSetting',_0x1bba69,JSON['stringify'](_0x243858));_0x460851(_0x243858);})[_0x2883('0x14')](function(_0x58c265){logger[_0x2883('0x10')]('ShowSetting',_0x58c265[_0x2883('0x11')],_0x1bba69);_0x13d764(_0x39c5d2[_0x2883('0x10')](0x1f4,_0x58c265[_0x2883('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index ff3807e..946f4be 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 _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 +var _0xe14b=['./smsAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','/:id','destroy','removeDispositions','delete','/:id/users','removeAgents','multer','util','express','Router','../../components/auth/service'];(function(_0x3e25bc,_0x1b01f3){var _0x345958=function(_0x289e7e){while(--_0x289e7e){_0x3e25bc['push'](_0x3e25bc['shift']());}};_0x345958(++_0x1b01f3);}(_0xe14b,0x93));var _0xbe14=function(_0x40be86,_0x3d790b){_0x40be86=_0x40be86-0x0;var _0x1c8c33=_0xe14b[_0x40be86];return _0x1c8c33;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x6')](_0xbe14('0x10'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x6')](_0xbe14('0x12'),controller[_0xbe14('0x13')]);router[_0xbe14('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x15')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x16')]);router['post'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x15')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);router['post'](_0xbe14('0x19'),controller[_0xbe14('0x1a')]);router[_0xbe14('0x15')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1b')]);router['post'](_0xbe14('0x1c'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1d')]);router[_0xbe14('0x15')](_0xbe14('0x12'),controller['status']);router[_0xbe14('0x15')]('/:id/users',auth[_0xbe14('0x7')](),controller['addAgents']);router[_0xbe14('0x1e')]('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0x1f')]);router['delete'](_0xbe14('0x20'),auth['isAuthenticated'](),controller[_0xbe14('0x21')]);router['delete'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x22')]);router[_0xbe14('0x23')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeAnswers']);router[_0xbe14('0x23')](_0xbe14('0x24'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x25')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index f2a7357..6751d50 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 _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 +var _0xeba7=['exports','STRING','name','generate','ENUM','skebby','connectel','clicksend','plivo','clickatell','csc','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring'];(function(_0x21130b,_0x519278){var _0x5babb1=function(_0x12a5ad){while(--_0x12a5ad){_0x21130b['push'](_0x21130b['shift']());}};_0x5babb1(++_0x519278);}(_0xeba7,0xae));var _0x7eba=function(_0x522039,_0x39a20a){_0x522039=_0x522039-0x0;var _0x1e8f33=_0xeba7[_0x522039];return _0x1e8f33;};'use strict';var Sequelize=require(_0x7eba('0x0'));var rs=require(_0x7eba('0x1'));module[_0x7eba('0x2')]={'name':{'type':Sequelize[_0x7eba('0x3')],'unique':_0x7eba('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x7eba('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x7eba('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x7eba('0x3')],'defaultValue':function(){return rs[_0x7eba('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7eba('0x6')]('twilio',_0x7eba('0x7'),_0x7eba('0x8'),_0x7eba('0x9'),_0x7eba('0xa'),_0x7eba('0xb'),'bandwidth',_0x7eba('0xc'),'infobip',_0x7eba('0xd'))},'accountSid':{'type':Sequelize[_0x7eba('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x7eba('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x7eba('0x3')]},'apiKey':{'type':Sequelize[_0x7eba('0x3')]},'applicationId':{'type':Sequelize[_0x7eba('0x3')]},'accountId':{'type':Sequelize[_0x7eba('0x3')]},'senderString':{'type':Sequelize[_0x7eba('0x3')]},'deliveryReport':{'type':Sequelize[_0x7eba('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x7eba('0x3')]},'notificationTemplate':{'type':Sequelize[_0x7eba('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x7eba('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7eba('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x7eba('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7eba('0x10')],'comment':_0x7eba('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x7eba('0xe')],'defaultValue':![],'comment':_0x7eba('0x12'),'set':function(_0x5959df){if(!_0x5959df)this[_0x7eba('0x13')](_0x7eba('0x14'),null);this[_0x7eba('0x13')](_0x7eba('0x15'),_0x5959df);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 8979026..3e571ee 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 _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 +var _0xd100=['merge','VIRTUAL','filter','include','rows','catch','show','params','keys','fields','length','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','SmsAccounts','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','findOne','Disposition','SmsAccountId','findAll','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','twilio','from','From','messageId','skebby','sender','text','clicksend','plivo','MessageUUID','infobip','results','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','ValidationError','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','SmsInteraction','interaction','created','autoclose','push','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','Content-Type','text/xml','\x0a','addApplications','sequelize','Transaction','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','nolimit','Contact','fullname','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','connectel','requestid','status_code','message_id','groupName','inspect','error_code','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','csc','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','User','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','query','model','attributes','intersection','hasOwnProperty','order','sort','where','pick','filters'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd100,0x178));var _0x0d10=function(_0x5353ba,_0x3f2a00){_0x5353ba=_0x5353ba-0x0;var _0x4efd8c=_0xd100[_0x5353ba];return _0x4efd8c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0d10('0x0'));var jsonpatch=require(_0x0d10('0x1'));var rp=require(_0x0d10('0x2'));var moment=require(_0x0d10('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0d10('0x4'));var util=require(_0x0d10('0x5'));var path=require(_0x0d10('0x6'));var sox=require(_0x0d10('0x7'));var csv=require(_0x0d10('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d10('0x9'));var _=require(_0x0d10('0xa'));var squel=require(_0x0d10('0xb'));var crypto=require(_0x0d10('0xc'));var jsforce=require(_0x0d10('0xd'));var deskjs=require(_0x0d10('0xe'));var toCsv=require(_0x0d10('0x8'));var querystring=require(_0x0d10('0xf'));var Papa=require(_0x0d10('0x10'));var Redis=require(_0x0d10('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0d10('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0d10('0x13'));var utils=require('../../config/utils');var config=require(_0x0d10('0x14'));var licenseUtil=require(_0x0d10('0x15'));var db=require(_0x0d10('0x16'))['db'];config[_0x0d10('0x17')]=_[_0x0d10('0x18')](config[_0x0d10('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x0d10('0x19'))(new Redis(config['redis']));require(_0x0d10('0x1a'))['register'](socket);var jayson=require(_0x0d10('0x1b'));var client=jayson[_0x0d10('0x1c')][_0x0d10('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x339811,_0x4afc77,_0x48f8b5,_0x48fa7e){return new BPromise(function(_0x2d6c88,_0x2e3cf8){var _0x28c755=_0x48fa7e||client;return _0x28c755[_0x0d10('0x1e')](_0x339811,_0x48f8b5)[_0x0d10('0x1f')](function(_0x2b3bef){logger[_0x0d10('0x20')](_0x0d10('0x21'),_0x4afc77,_0x0d10('0x22'));logger[_0x0d10('0x23')](_0x0d10('0x24'),_0x4afc77,_0x0d10('0x22'),JSON[_0x0d10('0x25')](_0x2b3bef));if(_0x2b3bef[_0x0d10('0x26')]){if(_0x2b3bef[_0x0d10('0x26')][_0x0d10('0x27')]===0x1f4){logger[_0x0d10('0x26')](_0x0d10('0x21'),_0x4afc77,_0x2b3bef['error'][_0x0d10('0x28')]);return _0x2e3cf8(_0x2b3bef[_0x0d10('0x26')]['message']);}logger['error'](_0x0d10('0x21'),_0x4afc77,_0x2b3bef[_0x0d10('0x26')][_0x0d10('0x28')]);return _0x2d6c88(_0x2b3bef[_0x0d10('0x26')]['message']);}else{logger[_0x0d10('0x20')](_0x0d10('0x21'),_0x4afc77,_0x0d10('0x22'));_0x2d6c88(_0x2b3bef[_0x0d10('0x29')][_0x0d10('0x28')]);}})['catch'](function(_0x56abf3){logger[_0x0d10('0x26')](_0x0d10('0x21'),_0x4afc77,_0x56abf3);_0x2e3cf8(_0x56abf3);});});}function respondWithStatusCode(_0x4bbce7,_0x4fb557){_0x4fb557=_0x4fb557||0xcc;return function(_0x47a26d){if(_0x47a26d){return _0x4bbce7[_0x0d10('0x2a')](_0x4fb557);}return _0x4bbce7[_0x0d10('0x2b')](_0x4fb557)['end']();};}function respondWithResult(_0x2a664b,_0x3f1f50){_0x3f1f50=_0x3f1f50||0xc8;return function(_0x54df46){if(_0x54df46){return _0x2a664b[_0x0d10('0x2b')](_0x3f1f50)[_0x0d10('0x2c')](_0x54df46);}};}function respondWithFilteredResult(_0x520a90,_0xfafe3c){return function(_0x325f0f){if(_0x325f0f){var _0x375bf4=typeof _0xfafe3c['offset']===_0x0d10('0x2d')&&typeof _0xfafe3c[_0x0d10('0x2e')]==='undefined';var _0x3f30e7=_0x325f0f[_0x0d10('0x2f')];var _0x40ff88=_0x375bf4?0x0:_0xfafe3c[_0x0d10('0x30')];var _0xae3030=_0x375bf4?_0x325f0f['count']:_0xfafe3c[_0x0d10('0x30')]+_0xfafe3c[_0x0d10('0x2e')];var _0x552b30;if(_0xae3030>=_0x3f30e7){_0xae3030=_0x3f30e7;_0x552b30=0xc8;}else{_0x552b30=0xce;}_0x520a90['status'](_0x552b30);return _0x520a90[_0x0d10('0x31')](_0x0d10('0x32'),_0x40ff88+'-'+_0xae3030+'/'+_0x3f30e7)[_0x0d10('0x2c')](_0x325f0f);}return null;};}function patchUpdates(_0x263353){return function(_0x2161bb){try{jsonpatch[_0x0d10('0x33')](_0x2161bb,_0x263353,!![]);}catch(_0x82a73a){return BPromise[_0x0d10('0x34')](_0x82a73a);}return _0x2161bb[_0x0d10('0x35')]();};}function saveUpdates(_0xe53356,_0x29cf82){return function(_0x2e30e3){if(_0x2e30e3){return _0x2e30e3[_0x0d10('0x36')](_0xe53356)['then'](function(_0x3eae85){return _0x3eae85;});}return null;};}function removeEntity(_0x199caf,_0x3e33a1){return function(_0x150ae5){if(_0x150ae5){return _0x150ae5[_0x0d10('0x37')]()['then'](function(){var _0x23d237=_0x150ae5['get']({'plain':!![]});var _0x17fa80='SmsAccounts';return db[_0x0d10('0x38')]['destroy']({'where':{'type':_0x17fa80,'resourceId':_0x23d237['id']}})[_0x0d10('0x1f')](function(){return _0x150ae5;});})[_0x0d10('0x1f')](function(){_0x199caf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35fa9a,_0x3e7fef){return function(_0x5cce81){if(!_0x5cce81){_0x35fa9a[_0x0d10('0x2a')](0x194);}return _0x5cce81;};}function handleError(_0x285bdc,_0x24e1a9){_0x24e1a9=_0x24e1a9||0x1f4;return function(_0x153f8b){logger[_0x0d10('0x26')](_0x153f8b['stack']);if(_0x153f8b[_0x0d10('0x39')]){delete _0x153f8b[_0x0d10('0x39')];}_0x285bdc[_0x0d10('0x2b')](_0x24e1a9)[_0x0d10('0x3a')](_0x153f8b);};}exports[_0x0d10('0x3b')]=function(_0x5250af,_0x4475ca){var _0xf0663a={'include':[{'model':db[_0x0d10('0x3c')],'as':_0x0d10('0x3d')}]},_0x3dda53={},_0x4ea2b1={'count':0x0,'rows':[]};var _0x3bc373=_[_0x0d10('0x3e')](db[_0x0d10('0x3f')][_0x0d10('0x40')],function(_0x91ba7a){return{'name':_0x91ba7a[_0x0d10('0x41')],'type':_0x91ba7a[_0x0d10('0x42')][_0x0d10('0x43')]};});_0x3dda53['model']=_[_0x0d10('0x3e')](_0x3bc373,'name');_0x3dda53[_0x0d10('0x44')]=_['keys'](_0x5250af[_0x0d10('0x44')]);_0x3dda53['filters']=_['intersection'](_0x3dda53[_0x0d10('0x45')],_0x3dda53[_0x0d10('0x44')]);_0xf0663a[_0x0d10('0x46')]=_[_0x0d10('0x47')](_0x3dda53['model'],qs['fields'](_0x5250af[_0x0d10('0x44')]['fields']));_0xf0663a[_0x0d10('0x46')]=_0xf0663a[_0x0d10('0x46')]['length']?_0xf0663a[_0x0d10('0x46')]:_0x3dda53[_0x0d10('0x45')];if(!_0x5250af[_0x0d10('0x44')][_0x0d10('0x48')]('nolimit')){_0xf0663a[_0x0d10('0x2e')]=qs['limit'](_0x5250af['query'][_0x0d10('0x2e')]);_0xf0663a[_0x0d10('0x30')]=qs[_0x0d10('0x30')](_0x5250af[_0x0d10('0x44')][_0x0d10('0x30')]);}_0xf0663a[_0x0d10('0x49')]=qs[_0x0d10('0x4a')](_0x5250af['query'][_0x0d10('0x4a')]);_0xf0663a[_0x0d10('0x4b')]=qs['filters'](_[_0x0d10('0x4c')](_0x5250af[_0x0d10('0x44')],_0x3dda53[_0x0d10('0x4d')]),_0x3bc373);if(_0x5250af[_0x0d10('0x44')]['filter']){_0xf0663a[_0x0d10('0x4b')]=_[_0x0d10('0x4e')](_0xf0663a[_0x0d10('0x4b')],{'$or':_[_0x0d10('0x3e')](_0x3bc373,function(_0x73636c){if(_0x73636c['type']!==_0x0d10('0x4f')){var _0x4ad312={};_0x4ad312[_0x73636c['name']]={'$like':'%'+_0x5250af[_0x0d10('0x44')][_0x0d10('0x50')]+'%'};return _0x4ad312;}})});}_0xf0663a=_[_0x0d10('0x4e')]({},_0xf0663a,_0x5250af['options']);var _0x579573={'where':_0xf0663a[_0x0d10('0x4b')]};return db[_0x0d10('0x3f')][_0x0d10('0x2f')](_0x579573)['then'](function(_0x597446){_0x4ea2b1['count']=_0x597446;if(_0x5250af['query']['includeAll']){_0xf0663a[_0x0d10('0x51')]=[{'all':!![]}];}return db[_0x0d10('0x3f')]['findAll'](_0xf0663a);})[_0x0d10('0x1f')](function(_0x2014d4){_0x4ea2b1[_0x0d10('0x52')]=_0x2014d4;return _0x4ea2b1;})['then'](respondWithFilteredResult(_0x4475ca,_0xf0663a))[_0x0d10('0x53')](handleError(_0x4475ca,null));};exports[_0x0d10('0x54')]=function(_0x5b6b6a,_0x40d6b3){var _0x4ec77f={'raw':![],'where':{'id':_0x5b6b6a[_0x0d10('0x55')]['id']},'include':[{'model':db[_0x0d10('0x3c')],'as':_0x0d10('0x3d')}]},_0x21acf4={};_0x21acf4['model']=_[_0x0d10('0x56')](db[_0x0d10('0x3f')][_0x0d10('0x40')]);_0x21acf4[_0x0d10('0x44')]=_[_0x0d10('0x56')](_0x5b6b6a[_0x0d10('0x44')]);_0x21acf4['filters']=_[_0x0d10('0x47')](_0x21acf4[_0x0d10('0x45')],_0x21acf4['query']);_0x4ec77f[_0x0d10('0x46')]=_[_0x0d10('0x47')](_0x21acf4[_0x0d10('0x45')],qs[_0x0d10('0x57')](_0x5b6b6a['query'][_0x0d10('0x57')]));_0x4ec77f[_0x0d10('0x46')]=_0x4ec77f['attributes'][_0x0d10('0x58')]?_0x4ec77f[_0x0d10('0x46')]:_0x21acf4['model'];if(_0x5b6b6a[_0x0d10('0x44')][_0x0d10('0x59')]){_0x4ec77f['include']=[{'all':!![]}];}_0x4ec77f=_[_0x0d10('0x4e')]({},_0x4ec77f,_0x5b6b6a[_0x0d10('0x5a')]);return db[_0x0d10('0x3f')][_0x0d10('0x5b')](_0x4ec77f)[_0x0d10('0x1f')](handleEntityNotFound(_0x40d6b3,null))[_0x0d10('0x1f')](respondWithResult(_0x40d6b3,null))[_0x0d10('0x53')](handleError(_0x40d6b3,null));};exports[_0x0d10('0x5c')]=function(_0x282ec2,_0x519c6b){return db[_0x0d10('0x3f')][_0x0d10('0x5c')](_0x282ec2[_0x0d10('0x5d')],{})['then'](function(_0x520e5b){var _0x5bb588=_0x282ec2[_0x0d10('0x5e')]['get']({'plain':!![]});if(!_0x5bb588)throw new Error(_0x0d10('0x5f'));if(_0x5bb588[_0x0d10('0x60')]===_0x0d10('0x5e')){var _0x1dca10=_0x520e5b[_0x0d10('0x61')]({'plain':!![]});var _0x834db9=_0x0d10('0x62');return db['UserProfileSection']['find']({'where':{'name':_0x834db9,'userProfileId':_0x5bb588['userProfileId']},'raw':!![]})[_0x0d10('0x1f')](function(_0x5161f3){if(_0x5161f3&&_0x5161f3['autoAssociation']===0x0){return db[_0x0d10('0x38')][_0x0d10('0x5c')]({'name':_0x1dca10['name'],'resourceId':_0x1dca10['id'],'type':_0x5161f3['name'],'sectionId':_0x5161f3['id']},{})[_0x0d10('0x1f')](function(){return _0x520e5b;});}else{return _0x520e5b;}})['catch'](function(_0x54a8a1){logger[_0x0d10('0x26')](_0x0d10('0x63'),_0x54a8a1);throw _0x54a8a1;});}return _0x520e5b;})[_0x0d10('0x1f')](respondWithResult(_0x519c6b,0xc9))[_0x0d10('0x53')](handleError(_0x519c6b,null));};exports['update']=function(_0x12fe18,_0x33fd82){if(_0x12fe18['body']['id']){delete _0x12fe18[_0x0d10('0x5d')]['id'];}return db[_0x0d10('0x3f')][_0x0d10('0x5b')]({'where':{'id':_0x12fe18[_0x0d10('0x55')]['id']},'include':[{'model':db[_0x0d10('0x3c')],'as':_0x0d10('0x3d')}]})[_0x0d10('0x1f')](handleEntityNotFound(_0x33fd82,null))[_0x0d10('0x1f')](saveUpdates(_0x12fe18[_0x0d10('0x5d')],null))['then'](respondWithResult(_0x33fd82,null))[_0x0d10('0x53')](handleError(_0x33fd82,null));};exports[_0x0d10('0x37')]=function(_0x4bb2da,_0x483c1e){return db[_0x0d10('0x3f')][_0x0d10('0x5b')]({'where':{'id':_0x4bb2da['params']['id']}})[_0x0d10('0x1f')](handleEntityNotFound(_0x483c1e,null))[_0x0d10('0x1f')](removeEntity(_0x483c1e,null))[_0x0d10('0x53')](handleError(_0x483c1e,null));};exports[_0x0d10('0x64')]=function(_0xa4c65e,_0x3ea691){return db[_0x0d10('0x3f')][_0x0d10('0x64')]()['then'](respondWithResult(_0x3ea691,null))[_0x0d10('0x53')](handleError(_0x3ea691,null));};exports[_0x0d10('0x65')]=function(_0x405a18,_0x566c98,_0x306e7a){if(_0x405a18[_0x0d10('0x5d')]['id']){delete _0x405a18[_0x0d10('0x5d')]['id'];}return db[_0x0d10('0x3f')][_0x0d10('0x5b')]({'where':{'id':_0x405a18[_0x0d10('0x55')]['id']}})[_0x0d10('0x1f')](handleEntityNotFound(_0x566c98,null))[_0x0d10('0x1f')](function(_0x4b223d){if(_0x4b223d){_0x405a18[_0x0d10('0x5d')]['SmsAccountId']=_0x4b223d['id'];return db['Disposition']['create'](_0x405a18[_0x0d10('0x5d')]);}})[_0x0d10('0x1f')](respondWithResult(_0x566c98,null))['catch'](handleError(_0x566c98,null));};exports[_0x0d10('0x66')]=function(_0x4a919d,_0x42d6e2,_0x56e493){var _0x5d5cb6={'raw':![],'where':{}};var _0x24040e={};var _0x13a19d={'count':0x0,'rows':[]};return db[_0x0d10('0x3f')][_0x0d10('0x67')]({'where':{'id':_0x4a919d[_0x0d10('0x55')]['id']}})['then'](handleEntityNotFound(_0x42d6e2,null))[_0x0d10('0x1f')](function(_0x24d284){if(_0x24d284){_0x24040e[_0x0d10('0x45')]=_[_0x0d10('0x56')](db[_0x0d10('0x68')][_0x0d10('0x40')]);_0x24040e['query']=_[_0x0d10('0x56')](_0x4a919d[_0x0d10('0x44')]);_0x24040e[_0x0d10('0x4d')]=_[_0x0d10('0x47')](_0x24040e[_0x0d10('0x45')],_0x24040e[_0x0d10('0x44')]);_0x5d5cb6[_0x0d10('0x46')]=_[_0x0d10('0x47')](_0x24040e['model'],qs['fields'](_0x4a919d[_0x0d10('0x44')][_0x0d10('0x57')]));_0x5d5cb6['attributes']=_0x5d5cb6[_0x0d10('0x46')][_0x0d10('0x58')]?_0x5d5cb6[_0x0d10('0x46')]:_0x24040e['model'];if(!_0x4a919d[_0x0d10('0x44')][_0x0d10('0x48')]('nolimit')){_0x5d5cb6[_0x0d10('0x2e')]=qs['limit'](_0x4a919d[_0x0d10('0x44')][_0x0d10('0x2e')]);_0x5d5cb6[_0x0d10('0x30')]=qs[_0x0d10('0x30')](_0x4a919d[_0x0d10('0x44')]['offset']);}_0x5d5cb6[_0x0d10('0x49')]=qs['sort'](_0x4a919d[_0x0d10('0x44')][_0x0d10('0x4a')]);_0x5d5cb6[_0x0d10('0x4b')]=qs[_0x0d10('0x4d')](_[_0x0d10('0x4c')](_0x4a919d[_0x0d10('0x44')],_0x24040e[_0x0d10('0x4d')]));_0x5d5cb6[_0x0d10('0x4b')][_0x0d10('0x69')]=_0x24d284['id'];if(_0x4a919d[_0x0d10('0x44')][_0x0d10('0x50')]){_0x5d5cb6[_0x0d10('0x4b')]=_['merge'](_0x5d5cb6[_0x0d10('0x4b')],{'$or':_[_0x0d10('0x3e')](_0x5d5cb6[_0x0d10('0x46')],function(_0x2c2c1a){var _0x45b85c={};_0x45b85c[_0x2c2c1a]={'$like':'%'+_0x4a919d[_0x0d10('0x44')][_0x0d10('0x50')]+'%'};return _0x45b85c;})});}_0x5d5cb6=_[_0x0d10('0x4e')]({},_0x5d5cb6,_0x4a919d[_0x0d10('0x5a')]);return db[_0x0d10('0x68')][_0x0d10('0x2f')]({'where':_0x5d5cb6['where']})['then'](function(_0x973fa){_0x13a19d[_0x0d10('0x2f')]=_0x973fa;if(_0x4a919d[_0x0d10('0x44')][_0x0d10('0x59')]){_0x5d5cb6[_0x0d10('0x51')]=[{'all':!![]}];}return db[_0x0d10('0x68')][_0x0d10('0x6a')](_0x5d5cb6);})[_0x0d10('0x1f')](function(_0xcd8219){_0x13a19d[_0x0d10('0x52')]=_0xcd8219;return _0x13a19d;});}})[_0x0d10('0x1f')](respondWithFilteredResult(_0x42d6e2,_0x5d5cb6))[_0x0d10('0x53')](handleError(_0x42d6e2,null));};exports[_0x0d10('0x6b')]=function(_0x40a8eb,_0x9fd9c0,_0x307861){return db['SmsAccount'][_0x0d10('0x5b')]({'where':{'id':_0x40a8eb[_0x0d10('0x55')]['id']}})[_0x0d10('0x1f')](handleEntityNotFound(_0x9fd9c0,null))['then'](function(_0x1dc198){if(_0x1dc198){return _0x1dc198[_0x0d10('0x6b')](_0x40a8eb[_0x0d10('0x44')]['ids']);}})[_0x0d10('0x1f')](respondWithStatusCode(_0x9fd9c0,null))[_0x0d10('0x53')](handleError(_0x9fd9c0,null));};exports['addAnswer']=function(_0x3c0c92,_0x5a71c7,_0x2cfb7c){if(_0x3c0c92[_0x0d10('0x5d')]['id']){delete _0x3c0c92[_0x0d10('0x5d')]['id'];}return db[_0x0d10('0x3f')][_0x0d10('0x5b')]({'where':{'id':_0x3c0c92[_0x0d10('0x55')]['id']}})[_0x0d10('0x1f')](handleEntityNotFound(_0x5a71c7,null))[_0x0d10('0x1f')](function(_0xcb8fd4){if(_0xcb8fd4){_0x3c0c92[_0x0d10('0x5d')]['SmsAccountId']=_0xcb8fd4['id'];return db[_0x0d10('0x6c')][_0x0d10('0x5c')](_0x3c0c92[_0x0d10('0x5d')]);}})[_0x0d10('0x1f')](respondWithResult(_0x5a71c7,null))[_0x0d10('0x53')](handleError(_0x5a71c7,null));};exports[_0x0d10('0x6d')]=function(_0x34fa03,_0x13db3c,_0x2e0937){var _0x2155ef={'raw':![],'where':{}};var _0x2c8b04={};var _0x13945d={'count':0x0,'rows':[]};return db['SmsAccount'][_0x0d10('0x67')]({'where':{'id':_0x34fa03[_0x0d10('0x55')]['id']}})[_0x0d10('0x1f')](handleEntityNotFound(_0x13db3c,null))['then'](function(_0x112ee3){if(_0x112ee3){_0x2c8b04[_0x0d10('0x45')]=_[_0x0d10('0x56')](db[_0x0d10('0x6c')][_0x0d10('0x40')]);_0x2c8b04['query']=_[_0x0d10('0x56')](_0x34fa03[_0x0d10('0x44')]);_0x2c8b04[_0x0d10('0x4d')]=_[_0x0d10('0x47')](_0x2c8b04[_0x0d10('0x45')],_0x2c8b04[_0x0d10('0x44')]);_0x2155ef[_0x0d10('0x46')]=_['intersection'](_0x2c8b04[_0x0d10('0x45')],qs['fields'](_0x34fa03['query'][_0x0d10('0x57')]));_0x2155ef['attributes']=_0x2155ef[_0x0d10('0x46')][_0x0d10('0x58')]?_0x2155ef[_0x0d10('0x46')]:_0x2c8b04[_0x0d10('0x45')];if(!_0x34fa03[_0x0d10('0x44')][_0x0d10('0x48')]('nolimit')){_0x2155ef[_0x0d10('0x2e')]=qs[_0x0d10('0x2e')](_0x34fa03[_0x0d10('0x44')]['limit']);_0x2155ef[_0x0d10('0x30')]=qs[_0x0d10('0x30')](_0x34fa03[_0x0d10('0x44')][_0x0d10('0x30')]);}_0x2155ef[_0x0d10('0x49')]=qs[_0x0d10('0x4a')](_0x34fa03[_0x0d10('0x44')][_0x0d10('0x4a')]);_0x2155ef['where']=qs[_0x0d10('0x4d')](_[_0x0d10('0x4c')](_0x34fa03['query'],_0x2c8b04[_0x0d10('0x4d')]));_0x2155ef[_0x0d10('0x4b')]['SmsAccountId']=_0x112ee3['id'];if(_0x34fa03[_0x0d10('0x44')][_0x0d10('0x50')]){_0x2155ef[_0x0d10('0x4b')]=_[_0x0d10('0x4e')](_0x2155ef['where'],{'$or':_[_0x0d10('0x3e')](_0x2155ef['attributes'],function(_0x15caeb){var _0x3a1681={};_0x3a1681[_0x15caeb]={'$like':'%'+_0x34fa03[_0x0d10('0x44')]['filter']+'%'};return _0x3a1681;})});}_0x2155ef=_[_0x0d10('0x4e')]({},_0x2155ef,_0x34fa03[_0x0d10('0x5a')]);return db[_0x0d10('0x6c')][_0x0d10('0x2f')]({'where':_0x2155ef[_0x0d10('0x4b')]})['then'](function(_0x5b5b9d){_0x13945d[_0x0d10('0x2f')]=_0x5b5b9d;if(_0x34fa03[_0x0d10('0x44')]['includeAll']){_0x2155ef[_0x0d10('0x51')]=[{'all':!![]}];}return db[_0x0d10('0x6c')][_0x0d10('0x6a')](_0x2155ef);})['then'](function(_0x2b5d56){_0x13945d[_0x0d10('0x52')]=_0x2b5d56;return _0x13945d;});}})[_0x0d10('0x1f')](respondWithFilteredResult(_0x13db3c,_0x2155ef))[_0x0d10('0x53')](handleError(_0x13db3c,null));};exports[_0x0d10('0x6e')]=function(_0x4699a2,_0x17ebb0,_0x2293be){return db[_0x0d10('0x3f')][_0x0d10('0x5b')]({'where':{'id':_0x4699a2['params']['id']}})[_0x0d10('0x1f')](handleEntityNotFound(_0x17ebb0,null))[_0x0d10('0x1f')](function(_0x53d0d1){if(_0x53d0d1){return _0x53d0d1[_0x0d10('0x6e')](_0x4699a2[_0x0d10('0x44')][_0x0d10('0x6f')]);}})[_0x0d10('0x1f')](respondWithStatusCode(_0x17ebb0,null))[_0x0d10('0x53')](handleError(_0x17ebb0,null));};exports[_0x0d10('0x70')]=function(_0x380e8d,_0x1b88bf,_0x44ab9b){var _0x54fa60={'channel':_0x0d10('0x71')};var _0x4672e6=[];var _0x43d21b=[];var _0x451109={};return db[_0x0d10('0x3f')][_0x0d10('0x5b')]({'where':{'id':_0x380e8d[_0x0d10('0x55')]['id']},'include':[{'model':db[_0x0d10('0x72')],'as':_0x0d10('0x73')}]})[_0x0d10('0x1f')](handleEntityNotFound(_0x1b88bf,null))['then'](function(_0x5afc20){_0x54fa60[_0x0d10('0x74')]=_0x5afc20;_0x54fa60[_0x0d10('0x75')]=_[_0x0d10('0x76')](_0x5afc20[_0x0d10('0x73')],[_0x0d10('0x77')],[_0x0d10('0x78')]);if(_0x54fa60[_0x0d10('0x74')]['Applications']){delete _0x54fa60['account'][_0x0d10('0x73')];}return db[_0x0d10('0x79')][_0x0d10('0x64')]();})['then'](function(_0x5ae693){if(!_0x5ae693){throw new db[(_0x0d10('0x7a'))]['ValidationError'](_0x0d10('0x7b'));}_0x4672e6=_[_0x0d10('0x7c')](_[_0x0d10('0x56')](_0x5ae693),['createdAt',_0x0d10('0x7d')]);_0x43d21b=_[_0x0d10('0x7c')](_[_0x0d10('0x56')](_0x5ae693),[_0x0d10('0x7e'),_0x0d10('0x7d'),_0x0d10('0x7f'),_0x0d10('0x80')]);_0x54fa60[_0x0d10('0x5d')]={'mapKey':'mobile'};if(_0x54fa60[_0x0d10('0x74')]['type']){switch(_0x54fa60[_0x0d10('0x74')]['type']){case _0x0d10('0x81'):_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x82')]=_0x380e8d[_0x0d10('0x5d')][_0x0d10('0x83')];_0x54fa60[_0x0d10('0x5d')]['body']=_0x380e8d['body']['Body'];_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x84')]=_0x380e8d[_0x0d10('0x5d')]['MessageSid'];break;case _0x0d10('0x85'):_0x54fa60[_0x0d10('0x5d')]['from']='+'+_0x380e8d[_0x0d10('0x5d')][_0x0d10('0x86')];_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x5d')]=_0x380e8d[_0x0d10('0x5d')][_0x0d10('0x87')];break;case'connectel':_0x54fa60['body'][_0x0d10('0x82')]=_0x380e8d[_0x0d10('0x5d')]['from'];_0x54fa60['body'][_0x0d10('0x5d')]=_0x380e8d[_0x0d10('0x5d')]['message'];break;case _0x0d10('0x88'):_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x82')]=_0x380e8d[_0x0d10('0x5d')][_0x0d10('0x82')];_0x54fa60[_0x0d10('0x5d')]['body']=_0x380e8d[_0x0d10('0x5d')][_0x0d10('0x5d')];_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x84')]=_0x380e8d[_0x0d10('0x5d')]['message_id'];break;case _0x0d10('0x89'):_0x54fa60[_0x0d10('0x5d')]['from']=_0x380e8d[_0x0d10('0x5d')][_0x0d10('0x83')];_0x54fa60[_0x0d10('0x5d')]['body']=_0x380e8d[_0x0d10('0x5d')]['Text'];_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x84')]=_0x380e8d[_0x0d10('0x5d')][_0x0d10('0x8a')];break;case _0x0d10('0x8b'):_0x54fa60['body']['from']='+'+_0x380e8d[_0x0d10('0x5d')][_0x0d10('0x8c')][0x0][_0x0d10('0x82')];_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x5d')]=_0x380e8d[_0x0d10('0x5d')]['results'][0x0][_0x0d10('0x87')];_0x54fa60[_0x0d10('0x5d')]['messageId']=_0x380e8d['body'][_0x0d10('0x8c')][0x0][_0x0d10('0x84')];break;case'csc':_0x54fa60['body']['from']=_0x380e8d[_0x0d10('0x5d')][_0x0d10('0x8d')];_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x5d')]=_0x380e8d[_0x0d10('0x5d')][_0x0d10('0x8e')][_0x0d10('0x28')];break;case _0x0d10('0x8f'):_0x54fa60['body'][_0x0d10('0x82')]=_0x380e8d['body'][_0x0d10('0x90')];_0x54fa60[_0x0d10('0x5d')]['body']=_0x380e8d[_0x0d10('0x5d')]['text'];_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x84')]=_0x380e8d[_0x0d10('0x5d')][_0x0d10('0x91')];break;case _0x0d10('0x92'):_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x84')]=_0x380e8d[_0x0d10('0x5d')][0x0][_0x0d10('0x28')]['id'];_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x82')]=_0x380e8d[_0x0d10('0x5d')][0x0][_0x0d10('0x28')]['from'];_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x5d')]=_0x380e8d['body'][0x0]['message'][_0x0d10('0x87')];break;case _0x0d10('0x93'):_0x54fa60['body']['from']=_0x380e8d[_0x0d10('0x5d')]['from'];_0x54fa60[_0x0d10('0x5d')]['body']=_0x380e8d[_0x0d10('0x5d')]['message'];_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x84')]=_0x380e8d[_0x0d10('0x5d')][_0x0d10('0x94')];break;}}if(_0x54fa60['body']['id']){delete _0x54fa60[_0x0d10('0x5d')]['id'];}if(_['isNil'](_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x82')])){throw new db['Sequelize'][(_0x0d10('0x95'))](_0x0d10('0x96'));}if(_[_0x0d10('0x97')](_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x5d')])||_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x5d')]===''){throw new db['Sequelize'][(_0x0d10('0x95'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0d10('0x97')](_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x98')])){throw new db[(_0x0d10('0x7a'))][(_0x0d10('0x95'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x43d21b);}if(!_['includes'](_0x43d21b,_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x98')])){throw new db[(_0x0d10('0x7a'))][(_0x0d10('0x95'))](_0x0d10('0x99')+_0x43d21b);}_0x451109[_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x98')]]=_0x54fa60['body'][_0x0d10('0x82')];return db[_0x0d10('0x9a')]['find']({'where':{'id':_0x54fa60[_0x0d10('0x74')][_0x0d10('0x80')]},'include':[{'model':db['CmContact'],'as':_0x0d10('0x9b'),'where':_0x451109,'limit':0x1,'order':[['updatedAt',_0x0d10('0x9c')]]}]});})[_0x0d10('0x1f')](handleEntityNotFound(_0x1b88bf,null))[_0x0d10('0x1f')](function(_0x18764b){if(_0x18764b){_0x54fa60[_0x0d10('0x9d')]=_[_0x0d10('0x9e')](_0x18764b,['Contacts']);if(_0x18764b[_0x0d10('0x9b')][_0x0d10('0x58')]){return _0x18764b['Contacts'][0x0];}var _0x52d694=_[_0x0d10('0x18')](_0x54fa60['body'],{'firstName':_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x82')],'ListId':_0x18764b['id']});_0x52d694[_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x98')]]=_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x82')];return db[_0x0d10('0x79')][_0x0d10('0x5c')](_0x52d694,{'fields':_0x4672e6,'raw':!![]});}})[_0x0d10('0x1f')](handleEntityNotFound(_0x1b88bf,null))['then'](function(_0x4fc06c){if(_0x4fc06c){_0x54fa60['contact']=_0x4fc06c;var _0x2f14b3={'ContactId':_0x4fc06c['id'],'phone':_0x54fa60['body'][_0x0d10('0x82')],'SmsAccountId':_0x380e8d[_0x0d10('0x55')]['id']};var _0x20dba6={'ContactId':_0x4fc06c['id'],'SmsAccountId':_0x380e8d[_0x0d10('0x55')]['id'],'closed':![]};return db[_0x0d10('0x9f')][_0x0d10('0x5b')]({'where':_0x20dba6})[_0x0d10('0x1f')](function(_0x363240){if(_0x363240){return[_0x363240,![]];}return db[_0x0d10('0x9f')][_0x0d10('0x5c')](_0x2f14b3)[_0x0d10('0x1f')](function(_0x1996dc){return[_0x1996dc,!![]];});});}})['spread'](function(_0x16a2f5,_0x440670){_0x54fa60[_0x0d10('0xa0')]=_0x16a2f5[_0x0d10('0x61')]({'plain':!![]});_0x54fa60[_0x0d10('0xa0')][_0x0d10('0xa1')]=![];if(_0x440670){if(_0x54fa60[_0x0d10('0x74')][_0x0d10('0xa2')]){_0x54fa60[_0x0d10('0x75')][_0x0d10('0xa3')]({'id':0x0,'priority':_0x54fa60[_0x0d10('0x75')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}_0x54fa60['interaction']['created']=!![];}return db[_0x0d10('0xa4')][_0x0d10('0x5c')]({'phone':_0x54fa60[_0x0d10('0x5d')]['from'],'messageId':_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x84')],'body':_0x54fa60[_0x0d10('0x5d')][_0x0d10('0x5d')],'SmsAccountId':_0x380e8d[_0x0d10('0x55')]['id'],'SmsInteractionId':_0x16a2f5['id'],'direction':'in','ContactId':_0x16a2f5[_0x0d10('0xa5')],'AttachmentId':_0x54fa60[_0x0d10('0x5d')][_0x0d10('0xa6')]});})['then'](function(_0x59144b){_0x54fa60[_0x0d10('0x28')]=_0x59144b;if(_0x54fa60[_0x0d10('0xa0')]['UserId']){return db['User'][_0x0d10('0x5b')]({'attributes':['id',_0x0d10('0x39')],'where':{'id':_0x54fa60[_0x0d10('0xa0')][_0x0d10('0xa7')]}})[_0x0d10('0x1f')](function(_0x2a9b25){if(_0x2a9b25){_0x54fa60[_0x0d10('0x75')][_0x0d10('0xa8')]({'id':0x0,'priority':0x0,'app':_0x0d10('0xa9'),'appdata':_0x2a9b25[_0x0d10('0x39')]+','+(_0x54fa60[_0x0d10('0x74')][_0x0d10('0xaa')]||0xa),'interval':_0x0d10('0xab')});}return respondWithRpcPromise(_0x0d10('0xac'),_0x0d10('0xad'),_0x54fa60);});}return respondWithRpcPromise(_0x0d10('0xac'),_0x0d10('0xad'),_0x54fa60);})['then'](function(_0x9f8ba4){if(_0x9f8ba4){var _0x8304f0=0xc8;var _0x188d7d=_0x0d10('0xae');logger[_0x0d10('0x20')](_0x0d10('0x24'),_0x188d7d,_0x8304f0,_0x0d10('0xaf'));logger[_0x0d10('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x188d7d,_0x8304f0,'entity\x20found',JSON[_0x0d10('0x25')](_0x9f8ba4));if(_0x54fa60[_0x0d10('0x74')][_0x0d10('0x42')]==='twilio'){return _0x1b88bf[_0x0d10('0x2b')](_0x8304f0)[_0x0d10('0x31')](_0x0d10('0xb0'),_0x0d10('0xb1'))[_0x0d10('0x3a')](_0x0d10('0xb2'));}else{return _0x1b88bf[_0x0d10('0x2b')](_0x8304f0)[_0x0d10('0x2c')](_0x9f8ba4);}}})[_0x0d10('0x53')](handleError(_0x1b88bf,null));};exports[_0x0d10('0xb3')]=function(_0x50c706,_0x380c76){var _0x40907b=_0x50c706[_0x0d10('0x55')]['id'];var _0x1e2e05=_0x50c706['body'];var _0x5d3043=0xc8;var _0x48cc98=null;return db[_0x0d10('0xb4')]['transaction']({'isolationLevel':db[_0x0d10('0xb4')][_0x0d10('0xb5')]['ISOLATION_LEVELS'][_0x0d10('0xb6')]},function(_0x63558e){return db[_0x0d10('0x3f')][_0x0d10('0x67')]({'where':{'id':_0x40907b},'transaction':_0x63558e})[_0x0d10('0x1f')](function(_0x511161){if(_0x511161){return db[_0x0d10('0x72')][_0x0d10('0x37')]({'where':{'SmsAccountId':_0x40907b},'transaction':_0x63558e})[_0x0d10('0x1f')](function(){var _0x48ae51=_['map'](_0x1e2e05,function(_0xfa7042){_0xfa7042[_0x0d10('0x69')]=_0x40907b;return _0xfa7042;});return db[_0x0d10('0x72')]['bulkCreate'](_0x48ae51,{'transaction':_0x63558e});});}else{_0x5d3043=0x194;_0x48cc98=[];}});})[_0x0d10('0x1f')](function(){if(_0x5d3043!==0x194){return db[_0x0d10('0x72')][_0x0d10('0xb7')]({'where':{'SmsAccountId':_0x40907b},'order':_0x0d10('0x77')})['then'](function(_0x2713ff){_0x48cc98=_0x2713ff;});}})[_0x0d10('0x53')](function(_0xb60599){_0x5d3043=0x1f4;logger['error'](_0xb60599[_0x0d10('0xb8')]);if(_0xb60599[_0x0d10('0x39')]){delete _0xb60599[_0x0d10('0x39')];}_0x48cc98=_0xb60599;})[_0x0d10('0xb9')](function(){if(_0x48cc98===null){_0x380c76['sendStatus'](_0x5d3043);}else{if(_0x5d3043===0x1f4){_0x380c76[_0x0d10('0x2b')](_0x5d3043)[_0x0d10('0x3a')](_0x48cc98);}else{_0x380c76[_0x0d10('0x2b')](_0x5d3043)[_0x0d10('0x2c')](_0x48cc98);}}});};exports[_0x0d10('0xba')]=function(_0xf5f251,_0x7d5f38,_0x20d71b){var _0x218beb={};var _0xb270bc={};var _0x555b6b;var _0x9142f0;return db['SmsAccount'][_0x0d10('0x67')]({'where':{'id':_0xf5f251['params']['id']}})[_0x0d10('0x1f')](handleEntityNotFound(_0x7d5f38,null))[_0x0d10('0x1f')](function(_0x12b628){if(_0x12b628){_0x555b6b=_0x12b628;_0xb270bc[_0x0d10('0x45')]=_[_0x0d10('0x56')](db[_0x0d10('0x72')][_0x0d10('0x40')]);_0xb270bc[_0x0d10('0x44')]=_['keys'](_0xf5f251[_0x0d10('0x44')]);_0xb270bc[_0x0d10('0x4d')]=_[_0x0d10('0x47')](_0xb270bc[_0x0d10('0x45')],_0xb270bc[_0x0d10('0x44')]);_0x218beb[_0x0d10('0x46')]=_[_0x0d10('0x47')](_0xb270bc['model'],qs['fields'](_0xf5f251[_0x0d10('0x44')]['fields']));_0x218beb[_0x0d10('0x46')]=_0x218beb['attributes'][_0x0d10('0x58')]?_0x218beb[_0x0d10('0x46')]:_0xb270bc[_0x0d10('0x45')];_0x218beb[_0x0d10('0x49')]=qs[_0x0d10('0x4a')](_0xf5f251['query'][_0x0d10('0x4a')]);_0x218beb['where']=qs[_0x0d10('0x4d')](_[_0x0d10('0x4c')](_0xf5f251[_0x0d10('0x44')],_0xb270bc[_0x0d10('0x4d')]));if(_0xf5f251['query'][_0x0d10('0x50')]){_0x218beb[_0x0d10('0x4b')]=_[_0x0d10('0x4e')](_0x218beb[_0x0d10('0x4b')],{'$or':_[_0x0d10('0x3e')](_0x218beb[_0x0d10('0x46')],function(_0x35fb18){var _0x5c7d05={};_0x5c7d05[_0x35fb18]={'$like':'%'+_0xf5f251[_0x0d10('0x44')][_0x0d10('0x50')]+'%'};return _0x5c7d05;})});}_0x218beb=_['merge']({},_0x218beb,_0xf5f251[_0x0d10('0x5a')]);return _0x555b6b[_0x0d10('0xba')](_0x218beb);}})[_0x0d10('0x1f')](function(_0x456af4){if(_0x456af4){_0x9142f0=_0x456af4['length'];if(!_0xf5f251[_0x0d10('0x44')][_0x0d10('0x48')](_0x0d10('0xbb'))){_0x218beb['limit']=qs[_0x0d10('0x2e')](_0xf5f251[_0x0d10('0x44')][_0x0d10('0x2e')]);_0x218beb['offset']=qs[_0x0d10('0x30')](_0xf5f251[_0x0d10('0x44')][_0x0d10('0x30')]);}return _0x555b6b[_0x0d10('0xba')](_0x218beb);}})['then'](function(_0x4255aa){if(_0x4255aa){return _0x4255aa?{'count':_0x9142f0,'rows':_0x4255aa}:null;}})['then'](respondWithResult(_0x7d5f38,null))['catch'](handleError(_0x7d5f38,null));};exports['getInteractions']=function(_0x5b3e30,_0x41abca,_0x2961d7){var _0x1c0215={'raw':![],'where':{}};var _0x22a408={};var _0x332fe5={'count':0x0,'rows':[]};return db[_0x0d10('0x3f')][_0x0d10('0x67')]({'where':{'id':_0x5b3e30[_0x0d10('0x55')]['id']}})[_0x0d10('0x1f')](handleEntityNotFound(_0x41abca,null))[_0x0d10('0x1f')](function(_0x13e1b6){if(_0x13e1b6){_0x22a408[_0x0d10('0x45')]=_[_0x0d10('0x56')](db['SmsInteraction'][_0x0d10('0x40')]);_0x22a408[_0x0d10('0x44')]=_[_0x0d10('0x56')](_0x5b3e30[_0x0d10('0x44')]);_0x22a408[_0x0d10('0x4d')]=_[_0x0d10('0x47')](_0x22a408[_0x0d10('0x45')],_0x22a408['query']);_0x1c0215['attributes']=_['intersection'](_0x22a408[_0x0d10('0x45')],qs['fields'](_0x5b3e30['query']['fields']));_0x1c0215[_0x0d10('0x46')]=_0x1c0215[_0x0d10('0x46')][_0x0d10('0x58')]?_0x1c0215['attributes']:_0x22a408['model'];if(!_0x5b3e30[_0x0d10('0x44')][_0x0d10('0x48')]('nolimit')){_0x1c0215['limit']=qs[_0x0d10('0x2e')](_0x5b3e30['query'][_0x0d10('0x2e')]);_0x1c0215[_0x0d10('0x30')]=qs[_0x0d10('0x30')](_0x5b3e30[_0x0d10('0x44')]['offset']);}_0x1c0215[_0x0d10('0x49')]=qs[_0x0d10('0x4a')](_0x5b3e30[_0x0d10('0x44')]['sort']);_0x1c0215[_0x0d10('0x4b')]=qs['filters'](_[_0x0d10('0x4c')](_0x5b3e30[_0x0d10('0x44')],_0x22a408[_0x0d10('0x4d')]));_0x1c0215[_0x0d10('0x4b')][_0x0d10('0x69')]=_0x13e1b6['id'];if(_0x5b3e30[_0x0d10('0x44')][_0x0d10('0x50')]){_0x1c0215['where']=_['merge'](_0x1c0215['where'],{'$or':_[_0x0d10('0x3e')](_0x1c0215[_0x0d10('0x46')],function(_0x5db3c1){var _0x599433={};_0x599433[_0x5db3c1]={'$like':'%'+_0x5b3e30[_0x0d10('0x44')][_0x0d10('0x50')]+'%'};return _0x599433;})});}_0x1c0215=_[_0x0d10('0x4e')]({},_0x1c0215,_0x5b3e30[_0x0d10('0x5a')]);return db[_0x0d10('0x9f')][_0x0d10('0x2f')]({'where':_0x1c0215['where']})[_0x0d10('0x1f')](function(_0x1a0505){_0x332fe5[_0x0d10('0x2f')]=_0x1a0505;if(_0x5b3e30['query'][_0x0d10('0x59')]){_0x1c0215[_0x0d10('0x51')]=[{'model':db[_0x0d10('0x79')],'as':_0x0d10('0xbc'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x0d10('0x39'),_0x0d10('0xbd'),_0x0d10('0xbe')],'required':![]},{'model':db[_0x0d10('0xbf')],'as':_0x0d10('0xc0'),'attributes':['id',_0x0d10('0x39'),_0x0d10('0xc1')],'where':_0x5b3e30[_0x0d10('0x44')]['tag']?{'id':_0x5b3e30[_0x0d10('0x44')][_0x0d10('0xc2')]}:undefined,'required':_0x5b3e30['query'][_0x0d10('0xc2')]?!![]:![]}];}return db[_0x0d10('0x9f')]['findAll'](_0x1c0215);})[_0x0d10('0x1f')](function(_0x5e4007){_0x332fe5[_0x0d10('0x52')]=_0x5e4007;return _0x332fe5;});}})[_0x0d10('0x1f')](respondWithFilteredResult(_0x41abca,_0x1c0215))[_0x0d10('0x53')](handleError(_0x41abca,null));};exports['send']=function(_0x3b41fd,_0x1922dc,_0x105280){var _0x14214b,_0x1344af,_0x2f4a1b;if(_[_0x0d10('0x97')](_0x3b41fd[_0x0d10('0x5d')][_0x0d10('0x5d')])||_0x3b41fd[_0x0d10('0x5d')][_0x0d10('0x5d')]===''){throw new db[(_0x0d10('0x7a'))][(_0x0d10('0x95'))](_0x0d10('0xc3'));}if(_[_0x0d10('0x97')](_0x3b41fd[_0x0d10('0x5d')]['to'])){throw new db['Sequelize'][(_0x0d10('0x95'))]('to\x20is\x20mandatory');}_0x14214b=_0x3b41fd[_0x0d10('0x5d')]['to'];return db[_0x0d10('0x3f')][_0x0d10('0x5b')]({'where':{'id':_0x3b41fd['params']['id']},'include':[{'model':db[_0x0d10('0x9a')],'as':_0x0d10('0xc4'),'include':[{'model':db[_0x0d10('0x79')],'as':'Contacts','where':{'mobile':_0x14214b},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x0d10('0x1f')](handleEntityNotFound(_0x1922dc,null))[_0x0d10('0x1f')](function(_0x463b18){if(_0x463b18&&_0x463b18[_0x0d10('0xc4')]){_0x1344af=_0x463b18[_0x0d10('0x61')]({'plain':!![]});if(_0x1344af[_0x0d10('0xc4')]&&_0x1344af[_0x0d10('0xc4')][_0x0d10('0x9b')]['length']){return _0x1344af[_0x0d10('0xc4')][_0x0d10('0x9b')][0x0];}return db[_0x0d10('0x79')][_0x0d10('0x5c')](_[_0x0d10('0x18')](_0x3b41fd[_0x0d10('0x5d')],{'firstName':_0x14214b,'mobile':_0x14214b,'phone':_0x14214b,'ListId':_0x1344af[_0x0d10('0x80')]}));}})['then'](handleEntityNotFound(_0x1922dc,null))[_0x0d10('0x1f')](function(_0x302da0){if(_0x302da0){_0x2f4a1b=_0x302da0;return db[_0x0d10('0x9f')]['find']({'where':{'ContactId':_0x2f4a1b['id'],'closed':![],'SmsAccountId':_0x1344af['id']}})[_0x0d10('0x1f')](function(_0x1700ed){if(_0x1700ed){return[_0x1700ed,![]];}return db[_0x0d10('0x9f')][_0x0d10('0x5c')]({'UserId':_0x3b41fd['user']['id'],'ContactId':_0x2f4a1b['id'],'SmsAccountId':_0x1344af['id'],'phone':_0x14214b,'firstMsgDirection':_0x0d10('0xc5'),'Messages':[_[_0x0d10('0x4e')](_0x3b41fd['body'],{'read':![],'body':_0x3b41fd[_0x0d10('0x5d')][_0x0d10('0x5d')],'phone':_0x14214b,'SmsAccountId':_0x1344af['id'],'UserId':_0x3b41fd[_0x0d10('0x5e')]['id'],'ContactId':_0x2f4a1b['id']})]},{'include':[{'model':db[_0x0d10('0xa4')],'as':_0x0d10('0xc6')}]})[_0x0d10('0x1f')](function(_0x2366ab){return[_0x2366ab,!![]];});});}})['spread'](function(_0x32bf05,_0x518591){if(_0x518591){return _0x32bf05;}return db[_0x0d10('0xa4')][_0x0d10('0x5c')](_[_0x0d10('0x4e')](_0x3b41fd[_0x0d10('0x5d')],{'read':![],'body':_0x3b41fd[_0x0d10('0x5d')][_0x0d10('0x5d')],'phone':_0x14214b,'SmsAccountId':_0x1344af['id'],'SmsInteractionId':_0x32bf05['id'],'UserId':_0x3b41fd[_0x0d10('0x5e')]['id'],'ContactId':_0x2f4a1b['id']}))['then'](function(_0x29409b){_0x32bf05[_0x0d10('0xc7')][_0x0d10('0xc6')]=[];_0x32bf05['dataValues']['Messages'][_0x0d10('0xa3')](_0x29409b[_0x0d10('0xc7')]);return _0x32bf05;});})[_0x0d10('0x1f')](respondWithResult(_0x1922dc,null))[_0x0d10('0x53')](handleError(_0x1922dc,null));};exports[_0x0d10('0x2b')]=function(_0x316698,_0x39bd5e,_0x5e85dd){if(_0x316698[_0x0d10('0x5d')]['id']){delete _0x316698[_0x0d10('0x5d')]['id'];}var _0x893930,_0x58e09e,_0x331fd8;return db[_0x0d10('0x3f')][_0x0d10('0x5b')]({'where':{'id':_0x316698['params']['id']}})['then'](handleEntityNotFound(_0x39bd5e,null))[_0x0d10('0x1f')](function(_0x906215){if(_0x906215){_0x331fd8=_0x906215;logger[_0x0d10('0x23')](_0x0d10('0x24'),_0x0d10('0x2b'),_0x0d10('0xc8'),_0x906215[_0x0d10('0x42')],util['inspect'](_0x316698[_0x0d10('0x5d')],{'showHidden':![],'depth':null}));switch(_0x906215[_0x0d10('0x42')]){case _0x0d10('0x85'):if(_0x316698[_0x0d10('0x5d')][_0x0d10('0xc9')]&&_0x316698[_0x0d10('0x5d')][_0x0d10('0x2b')]){_0x58e09e=_0x316698['body'][_0x0d10('0x2b')];return db[_0x0d10('0xa4')][_0x0d10('0x5b')]({'where':{'messageId':_0x316698[_0x0d10('0x5d')][_0x0d10('0xc9')]}});}break;case _0x0d10('0xca'):if(_0x316698[_0x0d10('0x5d')][_0x0d10('0xcb')]&&_0x316698['body']['statusInt']){_0x58e09e=_0x316698[_0x0d10('0x5d')]['statusInt'];return db['SmsMessage']['find']({'where':{'messageId':_0x316698[_0x0d10('0x5d')][_0x0d10('0xcb')]}});}break;case _0x0d10('0x88'):if(_0x316698[_0x0d10('0x5d')]['message_id']&&_0x316698['body']['status_code']){_0x58e09e=_0x316698[_0x0d10('0x5d')][_0x0d10('0xcc')];return db['SmsMessage']['find']({'where':{'messageId':_0x316698[_0x0d10('0x5d')][_0x0d10('0xcd')]}});}break;case _0x0d10('0x8b'):var _0x3bf60e=_0x316698[_0x0d10('0x5d')][_0x0d10('0x8c')][0x0];if(_0x3bf60e[_0x0d10('0x84')]&&_0x3bf60e['status'][_0x0d10('0xce')]==='DELIVERED'){_0x58e09e=_0x3bf60e[_0x0d10('0x2b')][_0x0d10('0xce')];return db[_0x0d10('0xa4')][_0x0d10('0x5b')]({'where':{'messageId':_0x3bf60e['messageId']}});}break;case _0x0d10('0x8f'):if(_0x316698[_0x0d10('0x5d')][_0x0d10('0x84')]&&_0x316698['body'][_0x0d10('0x2b')]){_0x58e09e=_0x316698[_0x0d10('0x5d')][_0x0d10('0x2b')];return db[_0x0d10('0xa4')][_0x0d10('0x5b')]({'where':{'messageId':_0x316698[_0x0d10('0x5d')]['messageId']}});}break;case _0x0d10('0x92'):if(_0x316698[_0x0d10('0x5d')][0x0][_0x0d10('0x28')]['id']){_0x58e09e=_0x316698['body'][0x0]['type'];return db[_0x0d10('0xa4')][_0x0d10('0x5b')]({'where':{'messageId':_0x316698[_0x0d10('0x5d')][0x0][_0x0d10('0x28')]['id']}});}break;case _0x0d10('0x93'):if(_0x316698[_0x0d10('0x5d')]['redif']&&_0x316698[_0x0d10('0x5d')][_0x0d10('0x2b')]){_0x58e09e=_0x316698[_0x0d10('0x5d')][_0x0d10('0x2b')];return db['SmsMessage'][_0x0d10('0x5b')]({'where':{'messageId':_0x316698['body']['redif']}});}break;}}})['then'](handleEntityNotFound(_0x39bd5e,null))[_0x0d10('0x1f')](function(_0x27318e){if(_0x27318e){_0x893930=_0x27318e;switch(_0x331fd8[_0x0d10('0x42')]){case _0x0d10('0x85'):if(_0x58e09e==='DELIVERED'){return _0x893930[_0x0d10('0x36')]({'read':!![]});}else{logger[_0x0d10('0x26')](_0x0d10('0x24'),_0x0d10('0x2b'),'skebby',util[_0x0d10('0xcf')](_0x316698[_0x0d10('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x0d10('0xca'):if(_0x58e09e==='1'){return _0x893930['update']({'read':!![]});}else{logger[_0x0d10('0x26')](_0x0d10('0x24'),'status',_0x0d10('0x85'),util[_0x0d10('0xcf')](_0x316698[_0x0d10('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x0d10('0x88'):if(!_0x316698['body'][_0x0d10('0xd0')]&&_0x58e09e>=0xc8&&_0x58e09e<=0xce){return _0x893930['update']({'read':!![]});}else{logger[_0x0d10('0x26')](_0x0d10('0x24'),'status','clicksend',util['inspect'](_0x316698[_0x0d10('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x0d10('0x8b'):var _0x1ba4f8=_0x316698[_0x0d10('0x5d')][_0x0d10('0x8c')][0x0];if(_0x1ba4f8[_0x0d10('0x2b')][_0x0d10('0xce')]===_0x0d10('0xd1')){return _0x893930[_0x0d10('0x36')]({'read':!![]});}else{logger[_0x0d10('0x26')](_0x0d10('0x24'),_0x0d10('0x2b'),_0x0d10('0x8b'),util[_0x0d10('0xcf')](_0x316698['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x58e09e==_0x0d10('0xd2')||_0x58e09e==_0x0d10('0xd3')){return _0x893930['update']({'read':!![]});}else{logger[_0x0d10('0x26')](_0x0d10('0x24'),'status','clickatell',util[_0x0d10('0xcf')](_0x316698[_0x0d10('0x5d')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x58e09e==_0x0d10('0xd4')){return _0x893930['update']({'read':!![]});}else{logger[_0x0d10('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0d10('0x2b'),'bandwidth',util['inspect'](_0x316698['body'],{'showHidden':![],'depth':null}));}break;case _0x0d10('0x93'):if(_0x58e09e===_0x0d10('0xd5')||_0x58e09e===_0x0d10('0xd6')){return _0x893930[_0x0d10('0x36')]({'read':!![]});}else{logger['error'](_0x0d10('0x24'),_0x0d10('0x2b'),_0x0d10('0x93'),util[_0x0d10('0xcf')](_0x316698[_0x0d10('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x893930;}})['then'](respondWithResult(_0x39bd5e,null))[_0x0d10('0x53')](handleError(_0x39bd5e,null));};exports[_0x0d10('0xd7')]=function(_0x16ea31,_0x982f65,_0x278dd8){var _0x476009,_0xb4c05b,_0x2193df;return db[_0x0d10('0x3f')][_0x0d10('0x5b')]({'where':{'id':_0x16ea31[_0x0d10('0x55')]['id']}})[_0x0d10('0x1f')](handleEntityNotFound(_0x982f65,null))[_0x0d10('0x1f')](function(_0x78cdee){if(_0x78cdee){_0x2193df=_0x78cdee;logger[_0x0d10('0x23')](_0x0d10('0x24'),_0x0d10('0x2b'),_0x0d10('0xc8'),_0x78cdee[_0x0d10('0x42')],util[_0x0d10('0xcf')](_0x16ea31['query'],{'showHidden':![],'depth':null}));switch(_0x78cdee[_0x0d10('0x42')]){case _0x0d10('0xd8'):if(_0x16ea31['query'][_0x0d10('0xd9')]&&_0x16ea31[_0x0d10('0x44')][_0x0d10('0xda')]){_0xb4c05b=_0x16ea31['query'][_0x0d10('0xda')];return db[_0x0d10('0xa4')][_0x0d10('0x5b')]({'where':{'messageId':_0x16ea31[_0x0d10('0x44')][_0x0d10('0xd9')]}});}break;}}})[_0x0d10('0x1f')](handleEntityNotFound(_0x982f65,null))[_0x0d10('0x1f')](function(_0x75c2e7){if(_0x75c2e7){_0x476009=_0x75c2e7;switch(_0x2193df['type']){case _0x0d10('0xd8'):if(_0xb4c05b==='2'||_0xb4c05b==='6'){return _0x476009[_0x0d10('0x36')]({'read':!![]});}else{logger['error'](_0x0d10('0x24'),'status','csc',util[_0x0d10('0xcf')](_0x16ea31[_0x0d10('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x476009;}})[_0x0d10('0x1f')](respondWithResult(_0x982f65,null))[_0x0d10('0x53')](handleError(_0x982f65,null));};exports[_0x0d10('0xdb')]=function(_0x15e53e,_0x1dcae5,_0x4ebbdc){return db['SmsAccount'][_0x0d10('0x5b')]({'where':{'id':_0x15e53e[_0x0d10('0x55')]['id']}})[_0x0d10('0x1f')](handleEntityNotFound(_0x1dcae5,null))['then'](function(_0x4b51a2){if(_0x4b51a2){return _0x4b51a2[_0x0d10('0xdb')](_0x15e53e[_0x0d10('0x5d')][_0x0d10('0x6f')],_[_0x0d10('0x9e')](_0x15e53e[_0x0d10('0x5d')],['ids','id'])||{})['spread'](function(_0x3dfb91){for(var _0x22ab52=0x0;_0x22ab52<_0x15e53e[_0x0d10('0x5d')][_0x0d10('0x6f')][_0x0d10('0x58')];_0x22ab52+=0x1){socket[_0x0d10('0xdc')](_0x0d10('0xdd'),{'UserId':Number(_0x15e53e[_0x0d10('0x5d')]['ids'][_0x22ab52]),'SmsAccountId':Number(_0x15e53e[_0x0d10('0x55')]['id'])});}return _0x3dfb91;});}})[_0x0d10('0x1f')](respondWithResult(_0x1dcae5,null))[_0x0d10('0x53')](handleError(_0x1dcae5,null));};exports['removeAgents']=function(_0x186cf4,_0x30ef1d,_0x29f34d){return db[_0x0d10('0x3f')][_0x0d10('0x5b')]({'where':{'id':_0x186cf4[_0x0d10('0x55')]['id']}})[_0x0d10('0x1f')](handleEntityNotFound(_0x30ef1d,null))[_0x0d10('0x1f')](function(_0x5439ff){if(_0x5439ff){return _0x5439ff[_0x0d10('0xde')](_0x186cf4[_0x0d10('0x44')]['ids'])[_0x0d10('0x1f')](function(){if(_[_0x0d10('0xdf')](_0x186cf4['query'][_0x0d10('0x6f')])){for(var _0x24762b=0x0;_0x24762b<_0x186cf4[_0x0d10('0x44')][_0x0d10('0x6f')]['length'];_0x24762b+=0x1){socket[_0x0d10('0xdc')](_0x0d10('0xe0'),{'UserId':Number(_0x186cf4[_0x0d10('0x44')][_0x0d10('0x6f')][_0x24762b]),'SmsAccountId':Number(_0x186cf4[_0x0d10('0x55')]['id'])});}}else{socket[_0x0d10('0xdc')](_0x0d10('0xe0'),{'UserId':Number(_0x186cf4[_0x0d10('0x44')]['ids']),'SmsAccountId':Number(_0x186cf4[_0x0d10('0x55')]['id'])});}});}})[_0x0d10('0x1f')](respondWithStatusCode(_0x30ef1d,null))[_0x0d10('0x53')](handleError(_0x30ef1d,null));};exports[_0x0d10('0xe1')]=function(_0x19204b,_0x2ab7cf,_0x2e2ba8){var _0x24612a={};var _0x553414={};var _0x275298;var _0x58e2b7;return db[_0x0d10('0x3f')][_0x0d10('0x67')]({'where':{'id':_0x19204b['params']['id']}})['then'](handleEntityNotFound(_0x2ab7cf,null))[_0x0d10('0x1f')](function(_0x23b880){if(_0x23b880){_0x275298=_0x23b880;_0x553414[_0x0d10('0x45')]=_[_0x0d10('0x56')](db[_0x0d10('0xe2')]['rawAttributes']);_0x553414[_0x0d10('0x44')]=_[_0x0d10('0x56')](_0x19204b['query']);_0x553414[_0x0d10('0x4d')]=_[_0x0d10('0x47')](_0x553414[_0x0d10('0x45')],_0x553414[_0x0d10('0x44')]);_0x24612a[_0x0d10('0x46')]=_[_0x0d10('0x47')](_0x553414[_0x0d10('0x45')],qs['fields'](_0x19204b[_0x0d10('0x44')][_0x0d10('0x57')]));_0x24612a[_0x0d10('0x46')]=_0x24612a[_0x0d10('0x46')]['length']?_0x24612a[_0x0d10('0x46')]:_0x553414[_0x0d10('0x45')];_0x24612a[_0x0d10('0x49')]=qs[_0x0d10('0x4a')](_0x19204b[_0x0d10('0x44')][_0x0d10('0x4a')]);_0x24612a[_0x0d10('0x4b')]=qs['filters'](_['pick'](_0x19204b[_0x0d10('0x44')],_0x553414[_0x0d10('0x4d')]));if(_0x19204b['query'][_0x0d10('0x50')]){_0x24612a['where']=_['merge'](_0x24612a[_0x0d10('0x4b')],{'$or':_['map'](_0x24612a[_0x0d10('0x46')],function(_0x179e07){var _0x298a71={};_0x298a71[_0x179e07]={'$like':'%'+_0x19204b[_0x0d10('0x44')][_0x0d10('0x50')]+'%'};return _0x298a71;})});}_0x24612a=_[_0x0d10('0x4e')]({},_0x24612a,_0x19204b['options']);return _0x275298[_0x0d10('0xe1')](_0x24612a);}})['then'](function(_0x103cd8){if(_0x103cd8){_0x58e2b7=_0x103cd8['length'];if(!_0x19204b[_0x0d10('0x44')][_0x0d10('0x48')](_0x0d10('0xbb'))){_0x24612a[_0x0d10('0x2e')]=qs[_0x0d10('0x2e')](_0x19204b['query'][_0x0d10('0x2e')]);_0x24612a[_0x0d10('0x30')]=qs[_0x0d10('0x30')](_0x19204b[_0x0d10('0x44')][_0x0d10('0x30')]);}return _0x275298[_0x0d10('0xe1')](_0x24612a);}})['then'](function(_0x222791){if(_0x222791){return _0x222791?{'count':_0x58e2b7,'rows':_0x222791}:null;}})[_0x0d10('0x1f')](respondWithResult(_0x2ab7cf,null))[_0x0d10('0x53')](handleError(_0x2ab7cf,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index ed890ee..e30042a 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 _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 +var _0x0cab=['SmsAccount','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x405657,_0x5d2317){var _0x5e3e84=function(_0x55d8f2){while(--_0x55d8f2){_0x405657['push'](_0x405657['shift']());}};_0x5e3e84(++_0x5d2317);}(_0x0cab,0x166));var _0xb0ca=function(_0x4c5cbe,_0x24fbe5){_0x4c5cbe=_0x4c5cbe-0x0;var _0x52d809=_0x0cab[_0x4c5cbe];return _0x52d809;};'use strict';var EventEmitter=require(_0xb0ca('0x0'));var SmsAccount=require(_0xb0ca('0x1'))['db'][_0xb0ca('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xb0ca('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb0ca('0x4')};function emitEvent(_0x38c5be){return function(_0x1bc472,_0x13d698,_0x595e80){SmsAccountEvents[_0xb0ca('0x5')](_0x38c5be+':'+_0x1bc472['id'],_0x1bc472);SmsAccountEvents['emit'](_0x38c5be,_0x1bc472);_0x595e80(null);};}for(var e in events){if(events[_0xb0ca('0x6')](e)){var event=events[e];SmsAccount[_0xb0ca('0x7')](e,emitEvent(event));}}module[_0xb0ca('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 d488fde..3f49000 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 _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 +var _0x1de5=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts'];(function(_0x16c659,_0x8f7257){var _0x5a08f5=function(_0x2fd0bb){while(--_0x2fd0bb){_0x16c659['push'](_0x16c659['shift']());}};_0x5a08f5(++_0x8f7257);}(_0x1de5,0x118));var _0x51de=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x1de5[_0x45bf86];return _0x1f02b7;};'use strict';var _=require(_0x51de('0x0'));var util=require(_0x51de('0x1'));var logger=require(_0x51de('0x2'))(_0x51de('0x3'));var moment=require(_0x51de('0x4'));var BPromise=require(_0x51de('0x5'));var rp=require(_0x51de('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x51de('0x7'));var config=require(_0x51de('0x8'));var attributes=require(_0x51de('0x9'));module[_0x51de('0xa')]=function(_0x3713ae,_0x4e1a86){return _0x3713ae[_0x51de('0xb')](_0x51de('0xc'),attributes,{'tableName':_0x51de('0xd'),'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 c649578..e35096a 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 _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 +var _0xcac7=['http','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','request\x20sent','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','SmsAccount','find','options','raw','include','map','model','attributes','ShowSmsAccount','debug','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','client'];(function(_0x37ecc2,_0x23573a){var _0x14c2db=function(_0x250e29){while(--_0x250e29){_0x37ecc2['push'](_0x37ecc2['shift']());}};_0x14c2db(++_0x23573a);}(_0xcac7,0x102));var _0x7cac=function(_0x5b6f05,_0x3d7351){_0x5b6f05=_0x5b6f05-0x0;var _0xd814cc=_0xcac7[_0x5b6f05];return _0xd814cc;};'use strict';var _=require(_0x7cac('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7cac('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7cac('0x2'));var db=require(_0x7cac('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7cac('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7cac('0x5')][_0x7cac('0x6')]({'port':0x232a});config[_0x7cac('0x7')]=_['defaults'](config[_0x7cac('0x7')],{'host':_0x7cac('0x8'),'port':0x18eb});var socket=require(_0x7cac('0x9'))(new Redis(config[_0x7cac('0x7')]));require(_0x7cac('0xa'))[_0x7cac('0xb')](socket);function respondWithRpcPromise(_0x52e8d4,_0xf88a3f,_0x3d5956){return new BPromise(function(_0x4499ab,_0x25f18a){return client[_0x7cac('0xc')](_0x52e8d4,_0x3d5956)[_0x7cac('0xd')](function(_0x59c726){logger[_0x7cac('0xe')]('SmsAccount,\x20%s,\x20%s',_0xf88a3f,_0x7cac('0xf'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf88a3f,_0x7cac('0xf'),JSON[_0x7cac('0x10')](_0x59c726));if(_0x59c726[_0x7cac('0x11')]){if(_0x59c726[_0x7cac('0x11')][_0x7cac('0x12')]===0x1f4){logger[_0x7cac('0x11')](_0x7cac('0x13'),_0xf88a3f,_0x59c726[_0x7cac('0x11')][_0x7cac('0x14')]);return _0x25f18a(_0x59c726[_0x7cac('0x11')][_0x7cac('0x14')]);}logger[_0x7cac('0x11')](_0x7cac('0x13'),_0xf88a3f,_0x59c726[_0x7cac('0x11')][_0x7cac('0x14')]);return _0x4499ab(_0x59c726[_0x7cac('0x11')]['message']);}else{logger[_0x7cac('0xe')]('SmsAccount,\x20%s,\x20%s',_0xf88a3f,_0x7cac('0xf'));_0x4499ab(_0x59c726[_0x7cac('0x15')][_0x7cac('0x14')]);}})[_0x7cac('0x16')](function(_0x126a1d){logger[_0x7cac('0x11')](_0x7cac('0x13'),_0xf88a3f,_0x126a1d);_0x25f18a(_0x126a1d);});});}exports['ShowSmsAccount']=function(_0x3f36e5){var _0x52c24b=this;return new Promise(function(_0x354259,_0x55442b){return db[_0x7cac('0x17')][_0x7cac('0x18')]({'raw':_0x3f36e5[_0x7cac('0x19')]?_0x3f36e5[_0x7cac('0x19')][_0x7cac('0x1a')]===undefined?!![]:![]:!![],'where':_0x3f36e5['options']?_0x3f36e5['options']['where']||null:null,'attributes':_0x3f36e5[_0x7cac('0x19')]?_0x3f36e5[_0x7cac('0x19')]['attributes']||null:null,'include':_0x3f36e5['options']?_0x3f36e5[_0x7cac('0x19')][_0x7cac('0x1b')]?_[_0x7cac('0x1c')](_0x3f36e5[_0x7cac('0x19')]['include'],function(_0x42b3ad){return{'model':db[_0x42b3ad[_0x7cac('0x1d')]],'as':_0x42b3ad['as'],'attributes':_0x42b3ad['attributes'],'include':_0x42b3ad['include']?_[_0x7cac('0x1c')](_0x42b3ad['include'],function(_0x1eecf0){return{'model':db[_0x1eecf0[_0x7cac('0x1d')]],'as':_0x1eecf0['as'],'attributes':_0x1eecf0[_0x7cac('0x1e')],'include':_0x1eecf0[_0x7cac('0x1b')]?_['map'](_0x1eecf0[_0x7cac('0x1b')],function(_0x421e0a){return{'model':db[_0x421e0a[_0x7cac('0x1d')]],'as':_0x421e0a['as'],'attributes':_0x421e0a[_0x7cac('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7cac('0xd')](function(_0x1e66c2){logger[_0x7cac('0xe')](_0x7cac('0x1f'),_0x3f36e5);logger[_0x7cac('0x20')](_0x7cac('0x1f'),_0x3f36e5,JSON[_0x7cac('0x10')](_0x1e66c2));_0x354259(_0x1e66c2);})[_0x7cac('0x16')](function(_0x177c18){logger[_0x7cac('0x11')](_0x7cac('0x1f'),_0x177c18['message'],_0x3f36e5);_0x55442b(_0x52c24b[_0x7cac('0x11')](0x1f4,_0x177c18[_0x7cac('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index f49578e..fe44ed7 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(_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 +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 4efda1f..400f2e8 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_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 +var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x3f6f7b,_0x59216f){var _0x59bff8=function(_0x395ef6){while(--_0x395ef6){_0x3f6f7b['push'](_0x3f6f7b['shift']());}};_0x59bff8(++_0x59216f);}(_0x3e74,0x175));var _0x43e7=function(_0x208c29,_0x2bbd43){_0x208c29=_0x208c29-0x0;var _0x25e358=_0x3e74[_0x208c29];return _0x25e358;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index b2c3c85..87aedcf 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 _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 +var _0x040b=['TEXT','*,*,*,*','INTEGER','STRING','noop'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x040b,0xac));var _0xb040=function(_0xa033ca,_0x508188){_0xa033ca=_0xa033ca-0x0;var _0x35a948=_0x040b[_0xa033ca];return _0x35a948;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xb040('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xb040('0x1')],'allowNull':![],'defaultValue':_0xb040('0x2')},'appdata':{'type':Sequelize[_0xb040('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb040('0x1')],'defaultValue':_0xb040('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 3be52a2..8b6dfc1 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 _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 +var _0xcf28=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','VIRTUAL','findAll','rows','show','params','rawAttributes','include','options','find','catch','create','body','eml-format','rimraf','request-promise','mustache','util','path','sox','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','save','update','then','destroy','error','stack','name','send','index','SmsApplication'];(function(_0x2a276d,_0x482b0c){var _0x2914cd=function(_0x452b8b){while(--_0x452b8b){_0x2a276d['push'](_0x2a276d['shift']());}};_0x2914cd(++_0x482b0c);}(_0xcf28,0xab));var _0x8cf2=function(_0x2a4bd9,_0x4731cf){_0x2a4bd9=_0x2a4bd9-0x0;var _0x535c4e=_0xcf28[_0x2a4bd9];return _0x535c4e;};'use strict';var emlformat=require(_0x8cf2('0x0'));var rimraf=require(_0x8cf2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8cf2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8cf2('0x3'));var util=require(_0x8cf2('0x4'));var path=require(_0x8cf2('0x5'));var sox=require(_0x8cf2('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8cf2('0x7'));var squel=require(_0x8cf2('0x8'));var crypto=require(_0x8cf2('0x9'));var jsforce=require(_0x8cf2('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x8cf2('0xb'));var querystring=require('querystring');var Papa=require(_0x8cf2('0xc'));var Redis=require(_0x8cf2('0xd'));var authService=require(_0x8cf2('0xe'));var qs=require(_0x8cf2('0xf'));var as=require(_0x8cf2('0x10'));var hardwareService=require(_0x8cf2('0x11'));var logger=require(_0x8cf2('0x12'))(_0x8cf2('0x13'));var utils=require(_0x8cf2('0x14'));var config=require(_0x8cf2('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8cf2('0x16'))['db'];function respondWithStatusCode(_0x50fd98,_0x19bfd7){_0x19bfd7=_0x19bfd7||0xcc;return function(_0x578864){if(_0x578864){return _0x50fd98[_0x8cf2('0x17')](_0x19bfd7);}return _0x50fd98[_0x8cf2('0x18')](_0x19bfd7)[_0x8cf2('0x19')]();};}function respondWithResult(_0x14f3f6,_0x3e8d64){_0x3e8d64=_0x3e8d64||0xc8;return function(_0x9bb405){if(_0x9bb405){return _0x14f3f6['status'](_0x3e8d64)[_0x8cf2('0x1a')](_0x9bb405);}};}function respondWithFilteredResult(_0x743394,_0x5dc0d0){return function(_0x452cc9){if(_0x452cc9){var _0x454912=typeof _0x5dc0d0[_0x8cf2('0x1b')]==='undefined'&&typeof _0x5dc0d0[_0x8cf2('0x1c')]===_0x8cf2('0x1d');var _0x360c13=_0x452cc9[_0x8cf2('0x1e')];var _0x4c7847=_0x454912?0x0:_0x5dc0d0[_0x8cf2('0x1b')];var _0x304a62=_0x454912?_0x452cc9['count']:_0x5dc0d0['offset']+_0x5dc0d0[_0x8cf2('0x1c')];var _0x5f2522;if(_0x304a62>=_0x360c13){_0x304a62=_0x360c13;_0x5f2522=0xc8;}else{_0x5f2522=0xce;}_0x743394['status'](_0x5f2522);return _0x743394[_0x8cf2('0x1f')]('Content-Range',_0x4c7847+'-'+_0x304a62+'/'+_0x360c13)[_0x8cf2('0x1a')](_0x452cc9);}return null;};}function patchUpdates(_0x457caa){return function(_0x3240c6){try{jsonpatch['apply'](_0x3240c6,_0x457caa,!![]);}catch(_0x515a70){return BPromise['reject'](_0x515a70);}return _0x3240c6[_0x8cf2('0x20')]();};}function saveUpdates(_0x2a2b24,_0x410db0){return function(_0x10a2ea){if(_0x10a2ea){return _0x10a2ea[_0x8cf2('0x21')](_0x2a2b24)[_0x8cf2('0x22')](function(_0x4a04a5){return _0x4a04a5;});}return null;};}function removeEntity(_0x499ec4,_0x1cf948){return function(_0x34265b){if(_0x34265b){return _0x34265b[_0x8cf2('0x23')]()[_0x8cf2('0x22')](function(){_0x499ec4[_0x8cf2('0x18')](0xcc)[_0x8cf2('0x19')]();});}};}function handleEntityNotFound(_0x5985a6,_0x493f11){return function(_0x1b9e67){if(!_0x1b9e67){_0x5985a6[_0x8cf2('0x17')](0x194);}return _0x1b9e67;};}function handleError(_0x5afacd,_0x25be61){_0x25be61=_0x25be61||0x1f4;return function(_0x38a55f){logger[_0x8cf2('0x24')](_0x38a55f[_0x8cf2('0x25')]);if(_0x38a55f[_0x8cf2('0x26')]){delete _0x38a55f['name'];}_0x5afacd['status'](_0x25be61)[_0x8cf2('0x27')](_0x38a55f);};}exports[_0x8cf2('0x28')]=function(_0x35fb5e,_0x5735dc){var _0x3663d1={},_0x4472a4={},_0x4e28af={'count':0x0,'rows':[]};var _0x53a0fc=_['map'](db[_0x8cf2('0x29')]['rawAttributes'],function(_0x42da28){return{'name':_0x42da28['fieldName'],'type':_0x42da28[_0x8cf2('0x2a')][_0x8cf2('0x2b')]};});_0x4472a4[_0x8cf2('0x2c')]=_['map'](_0x53a0fc,_0x8cf2('0x26'));_0x4472a4[_0x8cf2('0x2d')]=_[_0x8cf2('0x2e')](_0x35fb5e[_0x8cf2('0x2d')]);_0x4472a4[_0x8cf2('0x2f')]=_[_0x8cf2('0x30')](_0x4472a4[_0x8cf2('0x2c')],_0x4472a4[_0x8cf2('0x2d')]);_0x3663d1[_0x8cf2('0x31')]=_[_0x8cf2('0x30')](_0x4472a4[_0x8cf2('0x2c')],qs['fields'](_0x35fb5e[_0x8cf2('0x2d')][_0x8cf2('0x32')]));_0x3663d1[_0x8cf2('0x31')]=_0x3663d1['attributes'][_0x8cf2('0x33')]?_0x3663d1['attributes']:_0x4472a4[_0x8cf2('0x2c')];if(!_0x35fb5e['query'][_0x8cf2('0x34')]('nolimit')){_0x3663d1[_0x8cf2('0x1c')]=qs[_0x8cf2('0x1c')](_0x35fb5e[_0x8cf2('0x2d')][_0x8cf2('0x1c')]);_0x3663d1['offset']=qs[_0x8cf2('0x1b')](_0x35fb5e[_0x8cf2('0x2d')]['offset']);}_0x3663d1[_0x8cf2('0x35')]=qs[_0x8cf2('0x36')](_0x35fb5e['query'][_0x8cf2('0x36')]);_0x3663d1[_0x8cf2('0x37')]=qs[_0x8cf2('0x2f')](_['pick'](_0x35fb5e[_0x8cf2('0x2d')],_0x4472a4[_0x8cf2('0x2f')]),_0x53a0fc);if(_0x35fb5e['query'][_0x8cf2('0x38')]){_0x3663d1[_0x8cf2('0x37')]=_[_0x8cf2('0x39')](_0x3663d1['where'],{'$or':_[_0x8cf2('0x3a')](_0x53a0fc,function(_0x12af5c){if(_0x12af5c[_0x8cf2('0x2a')]!==_0x8cf2('0x3b')){var _0x3338f4={};_0x3338f4[_0x12af5c[_0x8cf2('0x26')]]={'$like':'%'+_0x35fb5e[_0x8cf2('0x2d')][_0x8cf2('0x38')]+'%'};return _0x3338f4;}})});}_0x3663d1=_[_0x8cf2('0x39')]({},_0x3663d1,_0x35fb5e['options']);var _0x3f662f={'where':_0x3663d1['where']};return db[_0x8cf2('0x29')][_0x8cf2('0x1e')](_0x3f662f)['then'](function(_0x222eb9){_0x4e28af[_0x8cf2('0x1e')]=_0x222eb9;if(_0x35fb5e[_0x8cf2('0x2d')]['includeAll']){_0x3663d1['include']=[{'all':!![]}];}return db[_0x8cf2('0x29')][_0x8cf2('0x3c')](_0x3663d1);})[_0x8cf2('0x22')](function(_0x349461){_0x4e28af[_0x8cf2('0x3d')]=_0x349461;return _0x4e28af;})[_0x8cf2('0x22')](respondWithFilteredResult(_0x5735dc,_0x3663d1))['catch'](handleError(_0x5735dc,null));};exports[_0x8cf2('0x3e')]=function(_0xa3deeb,_0x11d0c0){var _0x211ca8={'raw':!![],'where':{'id':_0xa3deeb[_0x8cf2('0x3f')]['id']}},_0x19cebb={};_0x19cebb[_0x8cf2('0x2c')]=_['keys'](db[_0x8cf2('0x29')][_0x8cf2('0x40')]);_0x19cebb[_0x8cf2('0x2d')]=_[_0x8cf2('0x2e')](_0xa3deeb[_0x8cf2('0x2d')]);_0x19cebb[_0x8cf2('0x2f')]=_[_0x8cf2('0x30')](_0x19cebb[_0x8cf2('0x2c')],_0x19cebb[_0x8cf2('0x2d')]);_0x211ca8[_0x8cf2('0x31')]=_['intersection'](_0x19cebb[_0x8cf2('0x2c')],qs[_0x8cf2('0x32')](_0xa3deeb['query'][_0x8cf2('0x32')]));_0x211ca8[_0x8cf2('0x31')]=_0x211ca8[_0x8cf2('0x31')][_0x8cf2('0x33')]?_0x211ca8[_0x8cf2('0x31')]:_0x19cebb[_0x8cf2('0x2c')];if(_0xa3deeb[_0x8cf2('0x2d')]['includeAll']){_0x211ca8[_0x8cf2('0x41')]=[{'all':!![]}];}_0x211ca8=_[_0x8cf2('0x39')]({},_0x211ca8,_0xa3deeb[_0x8cf2('0x42')]);return db['SmsApplication'][_0x8cf2('0x43')](_0x211ca8)['then'](handleEntityNotFound(_0x11d0c0,null))['then'](respondWithResult(_0x11d0c0,null))[_0x8cf2('0x44')](handleError(_0x11d0c0,null));};exports['create']=function(_0x4cf8ec,_0x5a374b){return db['SmsApplication'][_0x8cf2('0x45')](_0x4cf8ec[_0x8cf2('0x46')],{})[_0x8cf2('0x22')](respondWithResult(_0x5a374b,0xc9))[_0x8cf2('0x44')](handleError(_0x5a374b,null));};exports[_0x8cf2('0x21')]=function(_0x3fb3bf,_0x31c541){if(_0x3fb3bf['body']['id']){delete _0x3fb3bf[_0x8cf2('0x46')]['id'];}return db['SmsApplication']['find']({'where':{'id':_0x3fb3bf[_0x8cf2('0x3f')]['id']}})[_0x8cf2('0x22')](handleEntityNotFound(_0x31c541,null))['then'](saveUpdates(_0x3fb3bf[_0x8cf2('0x46')],null))[_0x8cf2('0x22')](respondWithResult(_0x31c541,null))[_0x8cf2('0x44')](handleError(_0x31c541,null));};exports['destroy']=function(_0x5992ba,_0x1aadc7){return db[_0x8cf2('0x29')][_0x8cf2('0x43')]({'where':{'id':_0x5992ba[_0x8cf2('0x3f')]['id']}})[_0x8cf2('0x22')](handleEntityNotFound(_0x1aadc7,null))[_0x8cf2('0x22')](removeEntity(_0x1aadc7,null))['catch'](handleError(_0x1aadc7,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index bf72bb0..f651749 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 _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 +var _0xf201=['path','rimraf','../../config/environment','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf201,0x199));var _0x1f20=function(_0xfe3e19,_0x4f9f2f){_0xfe3e19=_0xfe3e19-0x0;var _0x2a3442=_0xf201[_0xfe3e19];return _0x2a3442;};'use strict';var _=require(_0x1f20('0x0'));var util=require(_0x1f20('0x1'));var logger=require(_0x1f20('0x2'))(_0x1f20('0x3'));var moment=require(_0x1f20('0x4'));var BPromise=require(_0x1f20('0x5'));var rp=require(_0x1f20('0x6'));var fs=require('fs');var path=require(_0x1f20('0x7'));var rimraf=require(_0x1f20('0x8'));var config=require(_0x1f20('0x9'));var attributes=require('./smsApplication.attributes');module[_0x1f20('0xa')]=function(_0x5c266b,_0x43741b){return _0x5c266b[_0x1f20('0xb')](_0x1f20('0xc'),attributes,{'tableName':_0x1f20('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1f20('0xe'),'collate':_0x1f20('0xf')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 13e7d40..b209605 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 _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 +var _0xeca8=['../../config/environment','jayson/promise','http','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xeca8,0x1f2));var _0x8eca=function(_0x45a434,_0x1930b7){_0x45a434=_0x45a434-0x0;var _0x45aee1=_0xeca8[_0x45a434];return _0x45aee1;};'use strict';var _=require(_0x8eca('0x0'));var util=require(_0x8eca('0x1'));var moment=require(_0x8eca('0x2'));var BPromise=require(_0x8eca('0x3'));var rs=require(_0x8eca('0x4'));var fs=require('fs');var Redis=require(_0x8eca('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8eca('0x6'));var logger=require('../../config/logger')(_0x8eca('0x7'));var config=require(_0x8eca('0x8'));var jayson=require(_0x8eca('0x9'));var client=jayson['client'][_0x8eca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12c679,_0xe6e3f2,_0x39f40a){return new BPromise(function(_0xedaeca,_0x3b901f){return client['request'](_0x12c679,_0x39f40a)[_0x8eca('0xb')](function(_0x19208c){logger[_0x8eca('0xc')](_0x8eca('0xd'),_0xe6e3f2,_0x8eca('0xe'));logger[_0x8eca('0xf')](_0x8eca('0x10'),_0xe6e3f2,_0x8eca('0xe'),JSON[_0x8eca('0x11')](_0x19208c));if(_0x19208c[_0x8eca('0x12')]){if(_0x19208c['error'][_0x8eca('0x13')]===0x1f4){logger['error'](_0x8eca('0xd'),_0xe6e3f2,_0x19208c[_0x8eca('0x12')]['message']);return _0x3b901f(_0x19208c[_0x8eca('0x12')]['message']);}logger['error']('SmsApplication,\x20%s,\x20%s',_0xe6e3f2,_0x19208c[_0x8eca('0x12')][_0x8eca('0x14')]);return _0xedaeca(_0x19208c[_0x8eca('0x12')][_0x8eca('0x14')]);}else{logger[_0x8eca('0xc')](_0x8eca('0xd'),_0xe6e3f2,_0x8eca('0xe'));_0xedaeca(_0x19208c['result'][_0x8eca('0x14')]);}})[_0x8eca('0x15')](function(_0x4b8c67){logger[_0x8eca('0x12')](_0x8eca('0xd'),_0xe6e3f2,_0x4b8c67);_0x3b901f(_0x4b8c67);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index c366090..36e4160 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 _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 +var _0xea28=['put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','create','post','tracked','sms','smsinteraction:addtags','addTags'];(function(_0x12d58e,_0x1a2c7f){var _0x35d730=function(_0x4741ec){while(--_0x4741ec){_0x12d58e['push'](_0x12d58e['shift']());}};_0x35d730(++_0x1a2c7f);}(_0xea28,0x13a));var _0x8ea2=function(_0x3f4528,_0x1bd907){_0x3f4528=_0x3f4528-0x0;var _0x90a8be=_0xea28[_0x3f4528];return _0x90a8be;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xa')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0xa')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['getMessages']);router['get'](_0x8ea2('0x12'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);router['post']('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x14')]);router[_0x8ea2('0x15')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['addMessage']);router[_0x8ea2('0x15')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x18')),controller[_0x8ea2('0x19')]);router[_0x8ea2('0x1a')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x1b')),controller[_0x8ea2('0x1c')]);router[_0x8ea2('0x1d')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x1e')),controller[_0x8ea2('0x1f')]);router[_0x8ea2('0x1d')](_0x8ea2('0x20'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index e2c8852..48910fc 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 _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 +var _0xf842=['out','DATE','sequelize','moment','exports','BOOLEAN','STRING','ENUM'];(function(_0x5141bb,_0x350625){var _0x6483d2=function(_0x494c4e){while(--_0x494c4e){_0x5141bb['push'](_0x5141bb['shift']());}};_0x6483d2(++_0x350625);}(_0xf842,0x172));var _0x2f84=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xf842[_0x2fc012];return _0x2891f9;};'use strict';var Sequelize=require(_0x2f84('0x0'));var moment=require(_0x2f84('0x1'));module[_0x2f84('0x2')]={'closed':{'type':Sequelize[_0x2f84('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2f84('0x4')]},'secondDisposition':{'type':Sequelize[_0x2f84('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2f84('0x4')]},'note':{'type':Sequelize[_0x2f84('0x4')]},'phone':{'type':Sequelize[_0x2f84('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x2f84('0x5')]('in',_0x2f84('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2f84('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2f84('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2f84('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 5f02a3b..00e80cd 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 _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 +var _0xc553=['Tag','smsInteractionTags:save','removeTags','root','files','tmp','join','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','createdAt','secret','read','Account','Owner','get','N.A.','closed','toString','Messages','direction','out','renderFile','server','views','Sms','download','err','unlinkSync','rimraf','moment','bluebird','util','path','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','error','name','send','index','map','SmsInteraction','rawAttributes','type','getOptions','findAll','user','catch','show','params','model','keys','query','filters','intersection','fields','attributes','length','includeAll','include','options','find','create','body','describe','addMessage','SmsMessage','ids','omit','findOne','hasOwnProperty','nolimit','order','where','pick','merge','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread'];(function(_0x541c36,_0x178566){var _0x39a741=function(_0x3e7a40){while(--_0x3e7a40){_0x541c36['push'](_0x541c36['shift']());}};_0x39a741(++_0x178566);}(_0xc553,0x16c));var _0x3c55=function(_0x21b198,_0x345482){_0x21b198=_0x21b198-0x0;var _0x52ddbc=_0xc553[_0x21b198];return _0x52ddbc;};'use strict';var rimraf=require(_0x3c55('0x0'));var zipdir=require('zip-dir');var moment=require(_0x3c55('0x1'));var BPromise=require(_0x3c55('0x2'));var util=require(_0x3c55('0x3'));var path=require(_0x3c55('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x3c55('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0x3c55('0x6'));var pdf=require(_0x3c55('0x7'));var logger=require(_0x3c55('0x8'))('api');var config=require(_0x3c55('0x9'));var db=require('../../mysqldb')['db'];config[_0x3c55('0xa')]=_[_0x3c55('0xb')](config[_0x3c55('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3c55('0xc'))(new Redis(config['redis']));require(_0x3c55('0xd'))[_0x3c55('0xe')](socket);function respondWithStatusCode(_0x467b44,_0x2c4f1c){_0x2c4f1c=_0x2c4f1c||0xcc;return function(_0x1a65c5){if(_0x1a65c5){return _0x467b44[_0x3c55('0xf')](_0x2c4f1c);}return _0x467b44[_0x3c55('0x10')](_0x2c4f1c)['end']();};}function respondWithResult(_0x1475ba,_0x15d372){_0x15d372=_0x15d372||0xc8;return function(_0x1a6a65){if(_0x1a6a65){return _0x1475ba[_0x3c55('0x10')](_0x15d372)['json'](_0x1a6a65);}};}function respondWithFilteredResult(_0x18b75f,_0x2d6e04){return function(_0x2f19f1){if(_0x2f19f1){var _0xc01377=typeof _0x2d6e04[_0x3c55('0x11')]===_0x3c55('0x12')&&typeof _0x2d6e04[_0x3c55('0x13')]===_0x3c55('0x12');var _0x21506a=_0x2f19f1[_0x3c55('0x14')];var _0x4e6b13=_0xc01377?0x0:_0x2d6e04[_0x3c55('0x11')];var _0x2a9d4b=_0xc01377?_0x2f19f1[_0x3c55('0x14')]:_0x2d6e04[_0x3c55('0x11')]+_0x2d6e04['limit'];var _0x590d87;if(_0x2a9d4b>=_0x21506a){_0x2a9d4b=_0x21506a;_0x590d87=0xc8;}else{_0x590d87=0xce;}_0x18b75f['status'](_0x590d87);return _0x18b75f[_0x3c55('0x15')](_0x3c55('0x16'),_0x4e6b13+'-'+_0x2a9d4b+'/'+_0x21506a)[_0x3c55('0x17')](_0x2f19f1);}return null;};}function saveUpdates(_0x5dc1d7){return function(_0x9c2f53){if(_0x9c2f53){return _0x9c2f53[_0x3c55('0x18')](_0x5dc1d7)[_0x3c55('0x19')](function(_0x349294){return _0x349294;});}return null;};}function removeEntity(_0x5e1be4){return function(_0x3e1781){if(_0x3e1781){return _0x3e1781[_0x3c55('0x1a')]()[_0x3c55('0x19')](function(){_0x5e1be4[_0x3c55('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b9381){return function(_0x4b18f8){if(!_0x4b18f8){_0x3b9381[_0x3c55('0xf')](0x194);}return _0x4b18f8;};}function handleError(_0xab8d4b,_0x280d33){_0x280d33=_0x280d33||0x1f4;return function(_0x447bcb){logger[_0x3c55('0x1b')](_0x447bcb['stack']);if(_0x447bcb[_0x3c55('0x1c')]){delete _0x447bcb[_0x3c55('0x1c')];}_0xab8d4b['status'](_0x280d33)[_0x3c55('0x1d')](_0x447bcb);};}exports[_0x3c55('0x1e')]=function(_0x3af66f,_0x484c37){var _0x4febb0={};var _0x1ecae8=_[_0x3c55('0x1f')](db[_0x3c55('0x20')][_0x3c55('0x21')],function(_0x53e572){return{'name':_0x53e572['fieldName'],'type':_0x53e572[_0x3c55('0x22')]['key']};});_0x4febb0=qs[_0x3c55('0x23')](_0x1ecae8,_0x3af66f);return interaction[_0x3c55('0x24')]('sms',_0x3af66f['query'],_0x3af66f[_0x3c55('0x25')],_0x4febb0,_0x1ecae8)[_0x3c55('0x19')](respondWithFilteredResult(_0x484c37,_0x4febb0))[_0x3c55('0x26')](handleError(_0x484c37,null));};exports[_0x3c55('0x27')]=function(_0x656407,_0x40b4a8){var _0x1a2204={'raw':![],'where':{'id':_0x656407[_0x3c55('0x28')]['id']}},_0x39cfcb={};_0x39cfcb[_0x3c55('0x29')]=_[_0x3c55('0x2a')](db['SmsInteraction']['rawAttributes']);_0x39cfcb[_0x3c55('0x2b')]=_[_0x3c55('0x2a')](_0x656407[_0x3c55('0x2b')]);_0x39cfcb[_0x3c55('0x2c')]=_[_0x3c55('0x2d')](_0x39cfcb[_0x3c55('0x29')],_0x39cfcb['query']);_0x1a2204['attributes']=_[_0x3c55('0x2d')](_0x39cfcb[_0x3c55('0x29')],qs['fields'](_0x656407['query'][_0x3c55('0x2e')]));_0x1a2204[_0x3c55('0x2f')]=_0x1a2204['attributes'][_0x3c55('0x30')]?_0x1a2204['attributes']:_0x39cfcb[_0x3c55('0x29')];if(_0x656407[_0x3c55('0x2b')][_0x3c55('0x31')]){_0x1a2204[_0x3c55('0x32')]=[{'all':!![]}];}_0x1a2204=_['merge']({},_0x1a2204,_0x656407[_0x3c55('0x33')]);return db['SmsInteraction'][_0x3c55('0x34')](_0x1a2204)[_0x3c55('0x19')](handleEntityNotFound(_0x40b4a8,null))[_0x3c55('0x19')](respondWithResult(_0x40b4a8,null))[_0x3c55('0x26')](handleError(_0x40b4a8,null));};exports[_0x3c55('0x35')]=function(_0x4e877d,_0x4be12c){return db[_0x3c55('0x20')]['create'](_0x4e877d[_0x3c55('0x36')],{})[_0x3c55('0x19')](respondWithResult(_0x4be12c,0xc9))[_0x3c55('0x26')](handleError(_0x4be12c,null));};exports['update']=function(_0x2e8de5,_0x8916e9){if(_0x2e8de5[_0x3c55('0x36')]['id']){delete _0x2e8de5[_0x3c55('0x36')]['id'];}return db[_0x3c55('0x20')][_0x3c55('0x34')]({'where':{'id':_0x2e8de5[_0x3c55('0x28')]['id']}})['then'](handleEntityNotFound(_0x8916e9,null))[_0x3c55('0x19')](saveUpdates(_0x2e8de5[_0x3c55('0x36')],null))[_0x3c55('0x19')](respondWithResult(_0x8916e9,null))[_0x3c55('0x26')](handleError(_0x8916e9,null));};exports[_0x3c55('0x1a')]=function(_0xa0e16d,_0x1c2de9){return db[_0x3c55('0x20')]['find']({'where':{'id':_0xa0e16d[_0x3c55('0x28')]['id']}})[_0x3c55('0x19')](handleEntityNotFound(_0x1c2de9,null))[_0x3c55('0x19')](removeEntity(_0x1c2de9,null))[_0x3c55('0x26')](handleError(_0x1c2de9,null));};exports[_0x3c55('0x37')]=function(_0x4933f1,_0x404830){return db[_0x3c55('0x20')][_0x3c55('0x37')]()[_0x3c55('0x19')](respondWithResult(_0x404830,null))[_0x3c55('0x26')](handleError(_0x404830,null));};exports[_0x3c55('0x38')]=function(_0x26092c,_0x307d7a){return db[_0x3c55('0x39')]['find']({'where':{'id':_0x26092c[_0x3c55('0x28')]['id']}})[_0x3c55('0x19')](handleEntityNotFound(_0x307d7a,null))[_0x3c55('0x19')](function(_0x5e6fa2){if(_0x5e6fa2){return _0x5e6fa2[_0x3c55('0x38')](_0x26092c[_0x3c55('0x36')][_0x3c55('0x3a')],_[_0x3c55('0x3b')](_0x26092c[_0x3c55('0x36')],[_0x3c55('0x3a'),'id'])||{});}})['then'](respondWithResult(_0x307d7a,null))[_0x3c55('0x26')](handleError(_0x307d7a,null));};exports['getMessages']=function(_0x10b9b8,_0x2204ad){var _0x1adf50={'raw':![],'where':{}};var _0x6b0d1={};var _0x382920={'count':0x0,'rows':[]};return db[_0x3c55('0x20')][_0x3c55('0x3c')]({'where':{'id':_0x10b9b8[_0x3c55('0x28')]['id']}})[_0x3c55('0x19')](handleEntityNotFound(_0x2204ad,null))['then'](function(_0x5a1f8b){if(_0x5a1f8b){_0x6b0d1[_0x3c55('0x29')]=_[_0x3c55('0x2a')](db['SmsMessage'][_0x3c55('0x21')]);_0x6b0d1['query']=_['keys'](_0x10b9b8[_0x3c55('0x2b')]);_0x6b0d1[_0x3c55('0x2c')]=_[_0x3c55('0x2d')](_0x6b0d1[_0x3c55('0x29')],_0x6b0d1['query']);_0x1adf50['attributes']=_[_0x3c55('0x2d')](_0x6b0d1[_0x3c55('0x29')],qs[_0x3c55('0x2e')](_0x10b9b8[_0x3c55('0x2b')][_0x3c55('0x2e')]));_0x1adf50[_0x3c55('0x2f')]=_0x1adf50[_0x3c55('0x2f')][_0x3c55('0x30')]?_0x1adf50[_0x3c55('0x2f')]:_0x6b0d1[_0x3c55('0x29')];if(!_0x10b9b8['query'][_0x3c55('0x3d')](_0x3c55('0x3e'))){_0x1adf50[_0x3c55('0x13')]=qs[_0x3c55('0x13')](_0x10b9b8[_0x3c55('0x2b')][_0x3c55('0x13')]);_0x1adf50['offset']=qs[_0x3c55('0x11')](_0x10b9b8[_0x3c55('0x2b')][_0x3c55('0x11')]);}_0x1adf50[_0x3c55('0x3f')]=qs['sort'](_0x10b9b8['query']['sort']);_0x1adf50[_0x3c55('0x40')]=qs[_0x3c55('0x2c')](_[_0x3c55('0x41')](_0x10b9b8[_0x3c55('0x2b')],_0x6b0d1[_0x3c55('0x2c')]));_0x1adf50[_0x3c55('0x40')]['SmsInteractionId']=_0x5a1f8b['id'];if(_0x10b9b8[_0x3c55('0x2b')]['filter']){_0x1adf50['where']=_[_0x3c55('0x42')](_0x1adf50[_0x3c55('0x40')],{'$or':_[_0x3c55('0x1f')](_0x1adf50[_0x3c55('0x2f')],function(_0x2c3a02){var _0x2f3285={};_0x2f3285[_0x2c3a02]={'$like':'%'+_0x10b9b8[_0x3c55('0x2b')][_0x3c55('0x43')]+'%'};return _0x2f3285;})});}if(_0x10b9b8[_0x3c55('0x2b')]['$gte']){var _0x5cb4e5=_0x10b9b8[_0x3c55('0x2b')][_0x3c55('0x44')][_0x3c55('0x45')](',');var _0x1845ab={};_0x1845ab[_0x5cb4e5[0x0]]={'$gte':moment(_0x5cb4e5[0x1])[_0x3c55('0x46')](_0x3c55('0x47'))};_0x1adf50[_0x3c55('0x40')]=_[_0x3c55('0x42')](_0x1adf50['where'],_0x1845ab);}_0x1adf50=_[_0x3c55('0x42')]({},_0x1adf50,_0x10b9b8[_0x3c55('0x33')]);return db['SmsMessage']['count']({'where':_0x1adf50['where']})[_0x3c55('0x19')](function(_0x29eae4){_0x382920['count']=_0x29eae4;if(_0x10b9b8['query'][_0x3c55('0x31')]){_0x1adf50[_0x3c55('0x32')]=[{'all':!![]}];}return db['SmsMessage'][_0x3c55('0x24')](_0x1adf50);})[_0x3c55('0x19')](function(_0x1ce214){_0x382920[_0x3c55('0x48')]=_0x1ce214;return _0x382920;});}})[_0x3c55('0x19')](respondWithFilteredResult(_0x2204ad,_0x1adf50))['catch'](handleError(_0x2204ad,null));};exports[_0x3c55('0x49')]=function(_0x3a8d2c,_0x53b360){return db['SmsInteraction'][_0x3c55('0x34')]({'where':{'id':_0x3a8d2c[_0x3c55('0x28')]['id']}})[_0x3c55('0x19')](handleEntityNotFound(_0x53b360,null))['then'](function(_0xab600b){if(_0xab600b){return _0xab600b[_0x3c55('0x4a')](_0x3a8d2c[_0x3c55('0x36')]['ids'],_[_0x3c55('0x3b')](_0x3a8d2c[_0x3c55('0x36')],[_0x3c55('0x3a'),'id'])||{})[_0x3c55('0x4b')](function(){return db[_0x3c55('0x4c')]['findAll']({'attributes':['id',_0x3c55('0x1c'),'color'],'where':{'id':_0x3a8d2c[_0x3c55('0x36')][_0x3c55('0x3a')]}});})[_0x3c55('0x19')](function(_0x3d693a){socket['emit'](_0x3c55('0x4d'),{'id':Number(_0x3a8d2c[_0x3c55('0x28')]['id']),'tags':_0x3d693a||[]});return{'id':Number(_0x3a8d2c[_0x3c55('0x28')]['id']),'tags':_0x3d693a||[]};});}})['then'](respondWithResult(_0x53b360,null))[_0x3c55('0x26')](handleError(_0x53b360,null));};exports[_0x3c55('0x4e')]=function(_0x278069,_0x38cf9c){return db[_0x3c55('0x20')][_0x3c55('0x34')]({'where':{'id':_0x278069[_0x3c55('0x28')]['id']}})['then'](handleEntityNotFound(_0x38cf9c,null))[_0x3c55('0x19')](function(_0x16d3a2){if(_0x16d3a2){return _0x16d3a2[_0x3c55('0x4e')](_0x278069[_0x3c55('0x2b')]['ids']);}})['then'](respondWithStatusCode(_0x38cf9c,null))[_0x3c55('0x26')](handleError(_0x38cf9c,null));};exports['download']=function(_0x520b4b,_0x5e346d){var _0xb2b637=moment()['unix']()['toString']();var _0x413681=path['join'](config[_0x3c55('0x4f')],'server',_0x3c55('0x50'),_0x3c55('0x51'));var _0x18331e=path[_0x3c55('0x52')](_0x413681,_0xb2b637);var _0x35b072=util[_0x3c55('0x46')](_0x3c55('0x53'),_0x520b4b[_0x3c55('0x28')]['id'],_0xb2b637);var _0xb632d6=path[_0x3c55('0x52')](_0x413681,_0x35b072);var _0x391e17=[];_0x391e17[_0x3c55('0x54')]({'model':db[_0x3c55('0x55')],'as':_0x3c55('0x55'),'attributes':['id',_0x3c55('0x56')],'raw':!![]});_0x391e17[_0x3c55('0x54')]({'model':db[_0x3c55('0x57')],'as':_0x3c55('0x58'),'attributes':['id',_0x3c55('0x59'),_0x3c55('0x5a')],'raw':!![]});var _0x2110c3=[{'model':db[_0x3c55('0x39')],'as':'Messages','attributes':['id',_0x3c55('0x36'),_0x3c55('0x5b'),'direction',_0x3c55('0x5c'),_0x3c55('0x5d')],'include':_0x391e17}];_0x2110c3[_0x3c55('0x54')]({'model':db['SmsAccount'],'as':_0x3c55('0x5e'),'attributes':['id','name']});_0x2110c3[_0x3c55('0x54')]({'model':db['User'],'as':_0x3c55('0x5f'),'attributes':['id','fullname']});return db[_0x3c55('0x20')][_0x3c55('0x34')]({'where':{'id':_0x520b4b[_0x3c55('0x28')]['id']},'include':_0x2110c3})[_0x3c55('0x19')](handleEntityNotFound(_0x5e346d,null))['then'](function(_0x489916){if(_0x489916){var _0x26ba76=_0x489916[_0x3c55('0x60')]({'plain':!![]});fs['mkdirSync'](_0x18331e);var _0x41d96a={'channel':'Sms','account':_0x26ba76[_0x3c55('0x5e')][_0x3c55('0x1c')],'agent':_0x26ba76[_0x3c55('0x5f')]?_0x26ba76[_0x3c55('0x5f')][_0x3c55('0x56')]:_0x3c55('0x61'),'createdAt':moment(_0x26ba76[_0x3c55('0x5b')])[_0x3c55('0x46')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x26ba76[_0x3c55('0x62')]?moment(_0x26ba76['closedAt'])[_0x3c55('0x46')](_0x3c55('0x47'))[_0x3c55('0x63')]():'','disposition':_0x26ba76['disposition'],'messages':_(_0x26ba76[_0x3c55('0x64')])[_0x3c55('0x43')]({'secret':![]})[_0x3c55('0x1f')](function(_0x113f4d){return{'date':moment(_0x113f4d['createdAt'])[_0x3c55('0x46')](_0x3c55('0x47'))[_0x3c55('0x63')](),'sender':_0x113f4d[_0x3c55('0x65')]===_0x3c55('0x66')?_0x113f4d[_0x3c55('0x55')]?_0x113f4d['User']['fullname']:'System':_0x113f4d[_0x3c55('0x58')][_0x3c55('0x59')]+(_0x113f4d[_0x3c55('0x58')][_0x3c55('0x5a')]?'\x20'+_0x113f4d['Contact'][_0x3c55('0x5a')]:''),'body':_0x113f4d[_0x3c55('0x36')],'direction':_0x113f4d[_0x3c55('0x65')]===_0x3c55('0x66')?'A':'C','secret':_0x113f4d[_0x3c55('0x5c')],'read':_0x113f4d['read']};})['value']()};return ejs[_0x3c55('0x67')](path[_0x3c55('0x52')](config[_0x3c55('0x4f')],_0x3c55('0x68'),_0x3c55('0x69'),'downloadInteraction.ejs'),{'interaction':_0x41d96a})[_0x3c55('0x19')](function(_0x44948c){var _0x8a49bd=path[_0x3c55('0x52')](_0x18331e,'transcript-'+_0x26ba76['id']+'-'+_0xb2b637+'.pdf');var _0xc31688={'path':_0x8a49bd,'channel':_0x3c55('0x6a'),'interactionId':_0x26ba76['id']};return pdf['createPdfFromHTML'](_0x44948c,_0xc31688);})[_0x3c55('0x19')](function(){return new BPromise(function(_0x538354,_0x557e9a){zipdir(_0x18331e,{'saveTo':_0xb632d6},function(_0x43dfe2,_0x47341f){if(_0x43dfe2)return _0x557e9a(_0x43dfe2);return _0x538354(_0x47341f);});})['then'](function(){return new BPromise(function(_0x252e4e,_0x20e96f){rimraf(_0x18331e,function(_0x533a4f){if(_0x533a4f)_0x20e96f(_0x533a4f);return _0x252e4e();});});})[_0x3c55('0x19')](function(){return _0x5e346d[_0x3c55('0x6b')](_0xb632d6,_0x35b072,function(_0x505ae7){if(_0x505ae7){console['log'](_0x3c55('0x6c'),_0x505ae7);}else{fs[_0x3c55('0x6d')](_0xb632d6);}});});});}else{return _0x5e346d[_0x3c55('0xf')](0xc8);}})[_0x3c55('0x26')](handleError(_0x5e346d,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 7dff1fa..4405734 100644 --- a/server/api/smsInteraction/smsInteraction.events.js +++ b/server/api/smsInteraction/smsInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f0e=['unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','SmsMessage','update','remove','then','setDataValue','map','findAll'];(function(_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 +var _0x4325=['Users','map','findAll','then','setDataValue','length','emit','catch','exports','events','../../mysqldb','SmsMessage','setMaxListeners','remove','getUsers'];(function(_0x2263cc,_0x2e1dc9){var _0x1ba214=function(_0x2c4fe3){while(--_0x2c4fe3){_0x2263cc['push'](_0x2263cc['shift']());}};_0x1ba214(++_0x2e1dc9);}(_0x4325,0x1da));var _0x5432=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4325[_0x4b369d];return _0x571a98;};'use strict';var EventEmitter=require(_0x5432('0x0'));var SmsInteraction=require(_0x5432('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x5432('0x1'))['db'][_0x5432('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x5432('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5432('0x4')};function emitEvent(_0x36ce53){return function(_0xad26e9,_0x4acbe4,_0x209e2e){_0xad26e9[_0x5432('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x106ec9){_0xad26e9['setDataValue'](_0x5432('0x6'),_0x106ec9[_0x5432('0x7')](function(_0x40e756){return{'id':_0x40e756['id']};}));return SmsMessage[_0x5432('0x8')]({'where':{'SmsInteractionId':_0xad26e9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5432('0x9')](function(_0x4a9a51){_0xad26e9[_0x5432('0xa')]('unreadMessages',_0x4a9a51[_0x5432('0xb')]);SmsInteractionEvents[_0x5432('0xc')](_0x36ce53+':'+_0xad26e9['id'],_0xad26e9);SmsInteractionEvents[_0x5432('0xc')](_0x36ce53,_0xad26e9);_0x209e2e(null);})[_0x5432('0xd')](_0x209e2e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x5432('0xe')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 26a8f3a..c3073c4 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 _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 +var _0x6d07=['../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6d07,0x12a));var _0x76d0=function(_0x485381,_0x4713fd){_0x485381=_0x485381-0x0;var _0x1f2550=_0x6d07[_0x485381];return _0x1f2550;};'use strict';var _=require(_0x76d0('0x0'));var util=require(_0x76d0('0x1'));var logger=require(_0x76d0('0x2'))(_0x76d0('0x3'));var moment=require(_0x76d0('0x4'));var BPromise=require(_0x76d0('0x5'));var rp=require(_0x76d0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76d0('0x7'));var config=require(_0x76d0('0x8'));var attributes=require(_0x76d0('0x9'));module[_0x76d0('0xa')]=function(_0x1a5c30,_0x591b53){return _0x1a5c30[_0x76d0('0xb')](_0x76d0('0xc'),attributes,{'tableName':_0x76d0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xba36eb,_0x333530,_0x500070){if(_0xba36eb[_0x76d0('0xe')](_0x76d0('0xf'))){_0xba36eb['closedAt']=moment()[_0x76d0('0x10')](_0x76d0('0x11'));}_0x500070(null,_0xba36eb);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 354b0ea..a29623f 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 _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 +var _0xd64a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateSmsInteraction','update','body','raw','options','where','attributes','then','AddTagsToSmsInteraction','find','addTags','ids','AddTags','util'];(function(_0x36a2eb,_0x452589){var _0x4c9840=function(_0x5a00f2){while(--_0x5a00f2){_0x36a2eb['push'](_0x36a2eb['shift']());}};_0x4c9840(++_0x452589);}(_0xd64a,0x179));var _0xad64=function(_0x4af374,_0x4c7a56){_0x4af374=_0x4af374-0x0;var _0x3cf52d=_0xd64a[_0x4af374];return _0x3cf52d;};'use strict';var _=require('lodash');var util=require(_0xad64('0x0'));var moment=require('moment');var BPromise=require(_0xad64('0x1'));var rs=require(_0xad64('0x2'));var fs=require('fs');var Redis=require(_0xad64('0x3'));var db=require(_0xad64('0x4'))['db'];var utils=require(_0xad64('0x5'));var logger=require(_0xad64('0x6'))(_0xad64('0x7'));var config=require(_0xad64('0x8'));var jayson=require(_0xad64('0x9'));var client=jayson[_0xad64('0xa')][_0xad64('0xb')]({'port':0x232a});config[_0xad64('0xc')]=_[_0xad64('0xd')](config[_0xad64('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xad64('0xe'))(new Redis(config[_0xad64('0xc')]));require(_0xad64('0xf'))[_0xad64('0x10')](socket);function respondWithRpcPromise(_0x6336fd,_0x5e8e56,_0x292ae8){return new BPromise(function(_0x2f9c97,_0x3809cc){return client[_0xad64('0x11')](_0x6336fd,_0x292ae8)['then'](function(_0x57cf4d){logger[_0xad64('0x12')](_0xad64('0x13'),_0x5e8e56,'request\x20sent');logger[_0xad64('0x14')](_0xad64('0x15'),_0x5e8e56,_0xad64('0x16'),JSON[_0xad64('0x17')](_0x57cf4d));if(_0x57cf4d[_0xad64('0x18')]){if(_0x57cf4d[_0xad64('0x18')][_0xad64('0x19')]===0x1f4){logger[_0xad64('0x18')](_0xad64('0x13'),_0x5e8e56,_0x57cf4d[_0xad64('0x18')][_0xad64('0x1a')]);return _0x3809cc(_0x57cf4d[_0xad64('0x18')]['message']);}logger[_0xad64('0x18')](_0xad64('0x13'),_0x5e8e56,_0x57cf4d[_0xad64('0x18')][_0xad64('0x1a')]);return _0x2f9c97(_0x57cf4d[_0xad64('0x18')]['message']);}else{logger[_0xad64('0x12')](_0xad64('0x13'),_0x5e8e56,_0xad64('0x16'));_0x2f9c97(_0x57cf4d[_0xad64('0x1b')][_0xad64('0x1a')]);}})[_0xad64('0x1c')](function(_0x47c807){logger[_0xad64('0x18')]('SmsInteraction,\x20%s,\x20%s',_0x5e8e56,_0x47c807);_0x3809cc(_0x47c807);});});}exports[_0xad64('0x1d')]=function(_0x29ad78){var _0x4def90=this;return new Promise(function(_0x198099,_0x475a3d){return db['SmsInteraction'][_0xad64('0x1e')](_0x29ad78[_0xad64('0x1f')],{'raw':_0x29ad78['options']?_0x29ad78['options'][_0xad64('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29ad78['options']?_0x29ad78[_0xad64('0x21')][_0xad64('0x22')]||null:null,'attributes':_0x29ad78[_0xad64('0x21')]?_0x29ad78['options'][_0xad64('0x23')]||null:null,'limit':_0x29ad78[_0xad64('0x21')]?_0x29ad78[_0xad64('0x21')]['limit']||null:null})[_0xad64('0x24')](function(_0x155e6b){logger[_0xad64('0x12')](_0xad64('0x1d'),_0x29ad78);logger['debug']('UpdateSmsInteraction',_0x29ad78,JSON[_0xad64('0x17')](_0x155e6b));_0x198099(_0x155e6b);})['catch'](function(_0xfdd083){logger[_0xad64('0x18')](_0xad64('0x1d'),_0xfdd083['message'],_0x29ad78);_0x475a3d(_0x4def90['error'](0x1f4,_0xfdd083['message']));});});};exports[_0xad64('0x25')]=function(_0x177724){return new Promise(function(_0x32a933,_0x333ef9){return db['SmsInteraction'][_0xad64('0x26')]({'where':_0x177724['options']?_0x177724[_0xad64('0x21')][_0xad64('0x22')]||null:null})[_0xad64('0x24')](function(_0x47af01){if(_0x47af01){return _0x47af01[_0xad64('0x27')](_0x177724[_0xad64('0x1f')][_0xad64('0x28')],_['omit'](_0x177724[_0xad64('0x1f')],[_0xad64('0x28'),'id'])||{});}})['spread'](function(_0x4c413c){logger[_0xad64('0x12')](_0xad64('0x29'),_0x177724);logger['debug']('AddTags',_0x177724,JSON['stringify'](_0x4c413c));_0x32a933(_0x4c413c);})['catch'](function(_0x5d617e){logger[_0xad64('0x18')]('AddTags',_0x5d617e[_0xad64('0x1a')],_0x177724);_0x333ef9(_this[_0xad64('0x18')](0x1f4,_0x5d617e[_0xad64('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index a8e02ee..d2b38bd 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 _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 +var _0x7b03=['length','smsInteraction:','./smsInteraction.events','save','remove','emit','removeListener'];(function(_0x2c53a3,_0x4f3c2f){var _0x3d80b2=function(_0x2eff88){while(--_0x2eff88){_0x2c53a3['push'](_0x2c53a3['shift']());}};_0x3d80b2(++_0x4f3c2f);}(_0x7b03,0x9c));var _0x37b0=function(_0x56ba92,_0xb3c986){_0x56ba92=_0x56ba92-0x0;var _0x8fe94d=_0x7b03[_0x56ba92];return _0x8fe94d;};'use strict';var SmsInteractionEvents=require(_0x37b0('0x0'));var events=[_0x37b0('0x1'),_0x37b0('0x2'),'update'];function createListener(_0x521551,_0x224d18){return function(_0x5b90a3){_0x224d18[_0x37b0('0x3')](_0x521551,_0x5b90a3);};}function removeListener(_0x249093,_0xf20f58){return function(){SmsInteractionEvents[_0x37b0('0x4')](_0x249093,_0xf20f58);};}exports['register']=function(_0x3fbe72){for(var _0x5da5e3=0x0,_0x7c9095=events[_0x37b0('0x5')];_0x5da5e3<_0x7c9095;_0x5da5e3++){var _0x363216=events[_0x5da5e3];var _0x195fad=createListener(_0x37b0('0x6')+_0x363216,_0x3fbe72);SmsInteractionEvents['on'](_0x363216,_0x195fad);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 7bc5e1c..ee14ec3 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 _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 +var _0x868c=['describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','update','accept','/:id/reject','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsMessage.controller','isAuthenticated','get','/describe'];(function(_0x6b79a5,_0x2eeafb){var _0x4a0fe8=function(_0x2ce863){while(--_0x2ce863){_0x6b79a5['push'](_0x6b79a5['shift']());}};_0x4a0fe8(++_0x2eeafb);}(_0x868c,0x16e));var _0xc868=function(_0x3fb030,_0x12aebe){_0x3fb030=_0x3fb030-0x0;var _0xd6899b=_0x868c[_0x3fb030];return _0xd6899b;};'use strict';var multer=require(_0xc868('0x0'));var util=require(_0xc868('0x1'));var path=require(_0xc868('0x2'));var timeout=require(_0xc868('0x3'));var express=require(_0xc868('0x4'));var router=express[_0xc868('0x5')]();var fs_extra=require(_0xc868('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc868('0x7'));var controller=require(_0xc868('0x8'));router['get']('/',auth[_0xc868('0x9')](),controller['index']);router[_0xc868('0xa')](_0xc868('0xb'),auth[_0xc868('0x9')](),controller[_0xc868('0xc')]);router[_0xc868('0xa')](_0xc868('0xd'),auth[_0xc868('0x9')](),controller[_0xc868('0xe')]);router[_0xc868('0xf')]('/',auth[_0xc868('0x9')](),interaction[_0xc868('0x10')](_0xc868('0x11'),_0xc868('0x12')),controller[_0xc868('0x13')]);router[_0xc868('0xf')](_0xc868('0x14'),controller[_0xc868('0x15')]);router[_0xc868('0x16')](_0xc868('0xd'),auth[_0xc868('0x9')](),controller[_0xc868('0x17')]);router['put']('/:id/accept',auth[_0xc868('0x9')](),controller[_0xc868('0x18')]);router['put'](_0xc868('0x19'),auth[_0xc868('0x9')](),controller['reject']);router['delete'](_0xc868('0xd'),auth[_0xc868('0x9')](),controller[_0xc868('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index afb88f9..529e65b 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 _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 +var _0xb808=['ENUM','out','STRING','DATE','TEXT','sequelize','exports','BOOLEAN'];(function(_0x152961,_0x2d8e71){var _0x302053=function(_0x2f94c2){while(--_0x2f94c2){_0x152961['push'](_0x152961['shift']());}};_0x302053(++_0x2d8e71);}(_0xb808,0x12d));var _0x8b80=function(_0x406ad2,_0x43d82b){_0x406ad2=_0x406ad2-0x0;var _0x49fe60=_0xb808[_0x406ad2];return _0x49fe60;};'use strict';var Sequelize=require(_0x8b80('0x0'));module[_0x8b80('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8b80('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8b80('0x3')]('in',_0x8b80('0x4')),'defaultValue':_0x8b80('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8b80('0x5')](0xbe)},'phone':{'type':Sequelize[_0x8b80('0x5')]},'readAt':{'type':Sequelize[_0x8b80('0x6')]},'secret':{'type':Sequelize[_0x8b80('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8b80('0x5')]},'providerResponse':{'type':Sequelize[_0x8b80('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index a5a5025..0c3801e 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 _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 +var _0xeb0f=['pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','body','find','describe','../../config/logger','sms-interactions','sms','read','readAt','format','UserId','user','agent','get','SmsInteraction','SmsInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','channel','motionChannel','accept','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','rejectmessage','SmsAccountId','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','Status','plivio','infobip','groupName','DELIVERED','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2b4411,_0x28b2f4){var _0x5cefe0=function(_0x12c5e6){while(--_0x12c5e6){_0x2b4411['push'](_0x2b4411['shift']());}};_0x5cefe0(++_0x28b2f4);}(_0xeb0f,0x176));var _0xfeb0=function(_0x3f6c45,_0x3b8c71){_0x3f6c45=_0x3f6c45-0x0;var _0x252282=_0xeb0f[_0x3f6c45];return _0x252282;};'use strict';var emlformat=require(_0xfeb0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfeb0('0x1'));var jsonpatch=require(_0xfeb0('0x2'));var rp=require(_0xfeb0('0x3'));var moment=require(_0xfeb0('0x4'));var BPromise=require(_0xfeb0('0x5'));var Mustache=require(_0xfeb0('0x6'));var util=require('util');var path=require(_0xfeb0('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfeb0('0x8'));var fs=require('fs');var fs_extra=require(_0xfeb0('0x9'));var _=require(_0xfeb0('0xa'));var squel=require(_0xfeb0('0xb'));var crypto=require(_0xfeb0('0xc'));var jsforce=require(_0xfeb0('0xd'));var deskjs=require(_0xfeb0('0xe'));var toCsv=require(_0xfeb0('0xf'));var querystring=require(_0xfeb0('0x10'));var Papa=require(_0xfeb0('0x11'));var Redis=require(_0xfeb0('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfeb0('0x13'));var hardwareService=require(_0xfeb0('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xfeb0('0x15'));var config=require(_0xfeb0('0x16'));var licenseUtil=require(_0xfeb0('0x17'));var db=require(_0xfeb0('0x18'))['db'];config[_0xfeb0('0x19')]=_['defaults'](config[_0xfeb0('0x19')],{'host':_0xfeb0('0x1a'),'port':0x18eb});var socket=require(_0xfeb0('0x1b'))(new Redis(config[_0xfeb0('0x19')]));require(_0xfeb0('0x1c'))[_0xfeb0('0x1d')](socket);var jayson=require(_0xfeb0('0x1e'));var client=jayson[_0xfeb0('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0xfeb0('0x1f')][_0xfeb0('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1d7f72,_0x58662b,_0x4f0c65,_0x4ede0e){return new BPromise(function(_0x1aa982,_0x4714cb){var _0x3428ee=_0x4ede0e||client;return _0x3428ee[_0xfeb0('0x21')](_0x1d7f72,_0x4f0c65)[_0xfeb0('0x22')](function(_0x82a86e){logger[_0xfeb0('0x23')](_0xfeb0('0x24'),_0x58662b,'request\x20sent');logger[_0xfeb0('0x25')](_0xfeb0('0x26'),_0x58662b,'request\x20sent',JSON[_0xfeb0('0x27')](_0x82a86e));if(_0x82a86e[_0xfeb0('0x28')]){if(_0x82a86e[_0xfeb0('0x28')]['code']===0x1f4){logger[_0xfeb0('0x28')]('SmsMessage,\x20%s,\x20%s',_0x58662b,_0x82a86e[_0xfeb0('0x28')][_0xfeb0('0x29')]);return _0x4714cb(_0x82a86e[_0xfeb0('0x28')][_0xfeb0('0x29')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x58662b,_0x82a86e[_0xfeb0('0x28')]['message']);return _0x1aa982(_0x82a86e[_0xfeb0('0x28')][_0xfeb0('0x29')]);}else{logger[_0xfeb0('0x23')](_0xfeb0('0x24'),_0x58662b,'request\x20sent');_0x1aa982(_0x82a86e[_0xfeb0('0x2a')][_0xfeb0('0x29')]);}})['catch'](function(_0x73119e){logger[_0xfeb0('0x28')](_0xfeb0('0x24'),_0x58662b,_0x73119e);_0x4714cb(_0x73119e);});});}function respondWithStatusCode(_0x388c62,_0x2114dc){_0x2114dc=_0x2114dc||0xcc;return function(_0x34ba8f){if(_0x34ba8f){return _0x388c62[_0xfeb0('0x2b')](_0x2114dc);}return _0x388c62[_0xfeb0('0x2c')](_0x2114dc)[_0xfeb0('0x2d')]();};}function respondWithResult(_0x547d4c,_0x44811a){_0x44811a=_0x44811a||0xc8;return function(_0x2f4d02){if(_0x2f4d02){return _0x547d4c['status'](_0x44811a)[_0xfeb0('0x2e')](_0x2f4d02);}};}function respondWithFilteredResult(_0x2f875c,_0x2a2b52){return function(_0x14eed2){if(_0x14eed2){var _0x58cf1=typeof _0x2a2b52['offset']===_0xfeb0('0x2f')&&typeof _0x2a2b52['limit']==='undefined';var _0x4cd828=_0x14eed2[_0xfeb0('0x30')];var _0x40cd34=_0x58cf1?0x0:_0x2a2b52[_0xfeb0('0x31')];var _0x4c4fe6=_0x58cf1?_0x14eed2[_0xfeb0('0x30')]:_0x2a2b52[_0xfeb0('0x31')]+_0x2a2b52[_0xfeb0('0x32')];var _0x266edb;if(_0x4c4fe6>=_0x4cd828){_0x4c4fe6=_0x4cd828;_0x266edb=0xc8;}else{_0x266edb=0xce;}_0x2f875c[_0xfeb0('0x2c')](_0x266edb);return _0x2f875c[_0xfeb0('0x33')]('Content-Range',_0x40cd34+'-'+_0x4c4fe6+'/'+_0x4cd828)['json'](_0x14eed2);}return null;};}function patchUpdates(_0x14bc1b){return function(_0x5d188e){try{jsonpatch[_0xfeb0('0x34')](_0x5d188e,_0x14bc1b,!![]);}catch(_0x1dde16){return BPromise[_0xfeb0('0x35')](_0x1dde16);}return _0x5d188e[_0xfeb0('0x36')]();};}function saveUpdates(_0x45d664,_0x45ba50){return function(_0x11cfe6){if(_0x11cfe6){return _0x11cfe6[_0xfeb0('0x37')](_0x45d664)[_0xfeb0('0x22')](function(_0x37a1d9){return _0x37a1d9;});}return null;};}function removeEntity(_0x41295c,_0x2cb4fb){return function(_0x28d4a6){if(_0x28d4a6){return _0x28d4a6[_0xfeb0('0x38')]()[_0xfeb0('0x22')](function(){_0x41295c[_0xfeb0('0x2c')](0xcc)[_0xfeb0('0x2d')]();});}};}function handleEntityNotFound(_0x4e047d,_0x20b206){return function(_0x33fe82){if(!_0x33fe82){_0x4e047d['sendStatus'](0x194);}return _0x33fe82;};}function handleError(_0xc694d9,_0x11215f){_0x11215f=_0x11215f||0x1f4;return function(_0x369a15){logger[_0xfeb0('0x28')](_0x369a15[_0xfeb0('0x39')]);if(_0x369a15['name']){delete _0x369a15[_0xfeb0('0x3a')];}_0xc694d9['status'](_0x11215f)[_0xfeb0('0x3b')](_0x369a15);};}exports[_0xfeb0('0x3c')]=function(_0x5acd6f,_0x3851fb){var _0x58a729={},_0x2888f2={},_0x2dc8fe={'count':0x0,'rows':[]};var _0x3a545b=_[_0xfeb0('0x3d')](db[_0xfeb0('0x3e')][_0xfeb0('0x3f')],function(_0x27a6ae){return{'name':_0x27a6ae[_0xfeb0('0x40')],'type':_0x27a6ae[_0xfeb0('0x41')]['key']};});_0x2888f2[_0xfeb0('0x42')]=_[_0xfeb0('0x3d')](_0x3a545b,_0xfeb0('0x3a'));_0x2888f2[_0xfeb0('0x43')]=_[_0xfeb0('0x44')](_0x5acd6f['query']);_0x2888f2[_0xfeb0('0x45')]=_[_0xfeb0('0x46')](_0x2888f2[_0xfeb0('0x42')],_0x2888f2[_0xfeb0('0x43')]);_0x58a729['attributes']=_[_0xfeb0('0x46')](_0x2888f2[_0xfeb0('0x42')],qs[_0xfeb0('0x47')](_0x5acd6f[_0xfeb0('0x43')][_0xfeb0('0x47')]));_0x58a729[_0xfeb0('0x48')]=_0x58a729['attributes'][_0xfeb0('0x49')]?_0x58a729['attributes']:_0x2888f2[_0xfeb0('0x42')];if(!_0x5acd6f['query'][_0xfeb0('0x4a')](_0xfeb0('0x4b'))){_0x58a729[_0xfeb0('0x32')]=qs[_0xfeb0('0x32')](_0x5acd6f[_0xfeb0('0x43')][_0xfeb0('0x32')]);_0x58a729[_0xfeb0('0x31')]=qs[_0xfeb0('0x31')](_0x5acd6f[_0xfeb0('0x43')]['offset']);}_0x58a729[_0xfeb0('0x4c')]=qs['sort'](_0x5acd6f[_0xfeb0('0x43')][_0xfeb0('0x4d')]);_0x58a729[_0xfeb0('0x4e')]=qs[_0xfeb0('0x45')](_[_0xfeb0('0x4f')](_0x5acd6f['query'],_0x2888f2['filters']),_0x3a545b);if(_0x5acd6f[_0xfeb0('0x43')][_0xfeb0('0x50')]){_0x58a729[_0xfeb0('0x4e')]=_[_0xfeb0('0x51')](_0x58a729[_0xfeb0('0x4e')],{'$or':_[_0xfeb0('0x3d')](_0x3a545b,function(_0x12d24f){if(_0x12d24f[_0xfeb0('0x41')]!==_0xfeb0('0x52')){var _0x130916={};_0x130916[_0x12d24f['name']]={'$like':'%'+_0x5acd6f[_0xfeb0('0x43')][_0xfeb0('0x50')]+'%'};return _0x130916;}})});}_0x58a729=_['merge']({},_0x58a729,_0x5acd6f[_0xfeb0('0x53')]);var _0x3ee041={'where':_0x58a729[_0xfeb0('0x4e')]};return db['SmsMessage'][_0xfeb0('0x30')](_0x3ee041)[_0xfeb0('0x22')](function(_0x5dfbdb){_0x2dc8fe[_0xfeb0('0x30')]=_0x5dfbdb;if(_0x5acd6f[_0xfeb0('0x43')][_0xfeb0('0x54')]){_0x58a729['include']=[{'all':!![]}];}return db['SmsMessage'][_0xfeb0('0x55')](_0x58a729);})['then'](function(_0x2ab71c){_0x2dc8fe[_0xfeb0('0x56')]=_0x2ab71c;return _0x2dc8fe;})[_0xfeb0('0x22')](respondWithFilteredResult(_0x3851fb,_0x58a729))[_0xfeb0('0x57')](handleError(_0x3851fb,null));};exports[_0xfeb0('0x58')]=function(_0x2bd414,_0x41de77){var _0x5ef8f9={'raw':!![],'where':{'id':_0x2bd414[_0xfeb0('0x59')]['id']}},_0x52ebfd={};_0x52ebfd['model']=_[_0xfeb0('0x44')](db['SmsMessage']['rawAttributes']);_0x52ebfd[_0xfeb0('0x43')]=_[_0xfeb0('0x44')](_0x2bd414[_0xfeb0('0x43')]);_0x52ebfd[_0xfeb0('0x45')]=_[_0xfeb0('0x46')](_0x52ebfd[_0xfeb0('0x42')],_0x52ebfd[_0xfeb0('0x43')]);_0x5ef8f9[_0xfeb0('0x48')]=_[_0xfeb0('0x46')](_0x52ebfd[_0xfeb0('0x42')],qs[_0xfeb0('0x47')](_0x2bd414[_0xfeb0('0x43')][_0xfeb0('0x47')]));_0x5ef8f9[_0xfeb0('0x48')]=_0x5ef8f9[_0xfeb0('0x48')]['length']?_0x5ef8f9['attributes']:_0x52ebfd[_0xfeb0('0x42')];if(_0x2bd414['query'][_0xfeb0('0x54')]){_0x5ef8f9[_0xfeb0('0x5a')]=[{'all':!![]}];}_0x5ef8f9=_[_0xfeb0('0x51')]({},_0x5ef8f9,_0x2bd414[_0xfeb0('0x53')]);return db['SmsMessage']['find'](_0x5ef8f9)['then'](handleEntityNotFound(_0x41de77,null))[_0xfeb0('0x22')](respondWithResult(_0x41de77,null))[_0xfeb0('0x57')](handleError(_0x41de77,null));};exports['create']=function(_0x11e95f,_0x1dc290){return db[_0xfeb0('0x3e')]['create'](_0x11e95f['body'],{})[_0xfeb0('0x22')](respondWithResult(_0x1dc290,0xc9))[_0xfeb0('0x57')](handleError(_0x1dc290,null));};exports[_0xfeb0('0x37')]=function(_0x2fa55b,_0x33c64f){if(_0x2fa55b[_0xfeb0('0x5b')]['id']){delete _0x2fa55b[_0xfeb0('0x5b')]['id'];}return db[_0xfeb0('0x3e')]['find']({'where':{'id':_0x2fa55b[_0xfeb0('0x59')]['id']}})[_0xfeb0('0x22')](handleEntityNotFound(_0x33c64f,null))[_0xfeb0('0x22')](saveUpdates(_0x2fa55b['body'],null))[_0xfeb0('0x22')](respondWithResult(_0x33c64f,null))[_0xfeb0('0x57')](handleError(_0x33c64f,null));};exports['destroy']=function(_0xafb423,_0xf2025b){return db[_0xfeb0('0x3e')][_0xfeb0('0x5c')]({'where':{'id':_0xafb423[_0xfeb0('0x59')]['id']}})['then'](handleEntityNotFound(_0xf2025b,null))[_0xfeb0('0x22')](removeEntity(_0xf2025b,null))[_0xfeb0('0x57')](handleError(_0xf2025b,null));};exports[_0xfeb0('0x5d')]=function(_0x4d02e4,_0x4dd525){return db[_0xfeb0('0x3e')][_0xfeb0('0x5d')]()['then'](respondWithResult(_0x4dd525,null))[_0xfeb0('0x57')](handleError(_0x4dd525,null));};var interaction_log=require(_0xfeb0('0x5e'))(_0xfeb0('0x5f'));exports['accept']=function(_0x351d55,_0xca4e9c,_0x2b6c7b){var _0x3321e7={'agent':{},'channel':_0xfeb0('0x60')};if(_0x351d55[_0xfeb0('0x5b')]['id']){delete _0x351d55[_0xfeb0('0x5b')]['id'];}_0x351d55['body'][_0xfeb0('0x61')]=!![];_0x351d55[_0xfeb0('0x5b')][_0xfeb0('0x62')]=moment()[_0xfeb0('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x351d55['body'][_0xfeb0('0x64')]=_0x351d55[_0xfeb0('0x5b')][_0xfeb0('0x64')]||_0x351d55[_0xfeb0('0x65')]['id'];_0x3321e7[_0xfeb0('0x66')]['id']=_0x351d55[_0xfeb0('0x5b')][_0xfeb0('0x64')];return db[_0xfeb0('0x3e')][_0xfeb0('0x5c')]({'where':{'id':_0x351d55[_0xfeb0('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xca4e9c,null))[_0xfeb0('0x22')](saveUpdates(_0x351d55['body'],null))['then'](function(_0x21a359){if(_0x21a359){_0x3321e7['message']=_0x21a359[_0xfeb0('0x67')]({'plain':!![]});return db[_0xfeb0('0x68')][_0xfeb0('0x5c')]({'where':{'id':_0x21a359[_0xfeb0('0x69')]}});}return null;})[_0xfeb0('0x22')](handleEntityNotFound(_0xca4e9c,null))['then'](function(_0x2ef790){if(_0x2ef790){return _0x2ef790['update']({'UserId':_0x351d55[_0xfeb0('0x5b')]['UserId'],'read1stAt':_['isNil'](_0x2ef790[_0xfeb0('0x6a')])?moment()[_0xfeb0('0x63')](_0xfeb0('0x6b')):undefined});}return null;})[_0xfeb0('0x22')](function(_0x5f51a1){if(_0x5f51a1){_0x3321e7[_0xfeb0('0x6c')]=_0x5f51a1[_0xfeb0('0x67')]({'plain':!![]});interaction_log['info'](_0xfeb0('0x6d'),_0x351d55[_0xfeb0('0x65')]['id'],_0x351d55[_0xfeb0('0x65')][_0xfeb0('0x3a')],_0x351d55[_0xfeb0('0x65')][_0xfeb0('0x6e')],_0x3321e7[_0xfeb0('0x6c')]['id'],_0x351d55['body']?JSON[_0xfeb0('0x27')](_0x351d55[_0xfeb0('0x5b')]):_0xfeb0('0x6f'));return respondWithRpcPromise(_0xfeb0('0x70'),_0xfeb0('0x71'),_0x3321e7);}return null;})['then'](function(_0x43cf8e){var _0x2dd7d3=_0xfeb0('0x72')+_0x43cf8e[_0xfeb0('0x29')][_0xfeb0('0x73')];return db[_0xfeb0('0x74')][_0xfeb0('0x43')](_0x2dd7d3,{'type':db[_0xfeb0('0x75')][_0xfeb0('0x76')][_0xfeb0('0x77')],'raw':!![]})[_0xfeb0('0x22')](function(_0x167532){return _0x167532;});})[_0xfeb0('0x22')](function(_0x438a3a){if(_0x438a3a){_0x3321e7[_0xfeb0('0x29')][_0xfeb0('0x78')]=_0x438a3a[0x0];if(!_0x351d55['body'][_0xfeb0('0x64')])return;return db[_0xfeb0('0x79')][_0xfeb0('0x5c')]({'where':{'id':_0x351d55[_0xfeb0('0x5b')][_0xfeb0('0x64')],'role':_0xfeb0('0x66')},'attributes':['id',_0xfeb0('0x3a'),_0xfeb0('0x7a'),_0xfeb0('0x7b'),_0xfeb0('0x7c')],'raw':!![]});}return null;})[_0xfeb0('0x22')](function(_0x503f8e){if(!_0x503f8e)return null;_0x3321e7[_0xfeb0('0x29')]['agent']=_0x503f8e;return _0x3321e7;})['then'](function(_0x502db6){if(_0x502db6){if(_0x351d55[_0xfeb0('0x5b')]['manual']){_0x3321e7['message'][_0xfeb0('0x7d')]=util[_0xfeb0('0x63')]('SIP/%s',_0x351d55[_0xfeb0('0x65')]['name']);_0x3321e7[_0xfeb0('0x29')][_0xfeb0('0x7e')]=_0x3321e7[_0xfeb0('0x7e')];_0x3321e7['message'][_0xfeb0('0x7f')]=_0x3321e7[_0xfeb0('0x7e')];_0x3321e7[_0xfeb0('0x29')]['event']=_0xfeb0('0x80');return respondWithRpcPromise(_0xfeb0('0x81'),_0xfeb0('0x81'),{'event':_0xfeb0('0x82'),'message':_0x3321e7[_0xfeb0('0x29')]},client9002)['then'](function(){return _0x3321e7;});}return _0x3321e7;}return null;})['then'](respondWithResult(_0xca4e9c,null))['catch'](handleError(_0xca4e9c,null));};var interaction_log=require(_0xfeb0('0x5e'))('sms-interactions');exports[_0xfeb0('0x35')]=function(_0x2a58aa,_0x435dc8,_0x51d242){var _0x4b6a93={'agent':{},'channel':_0xfeb0('0x60')};if(_0x2a58aa[_0xfeb0('0x5b')]['id']){delete _0x2a58aa[_0xfeb0('0x5b')]['id'];}_0x2a58aa[_0xfeb0('0x5b')]['UserId']=_0x2a58aa[_0xfeb0('0x5b')]['UserId']||_0x2a58aa[_0xfeb0('0x65')]['id'];_0x4b6a93[_0xfeb0('0x66')]['id']=_0x2a58aa[_0xfeb0('0x5b')]['UserId'];return db[_0xfeb0('0x3e')]['find']({'where':{'id':_0x2a58aa[_0xfeb0('0x59')]['id'],'UserId':null}})[_0xfeb0('0x22')](handleEntityNotFound(_0x435dc8,null))[_0xfeb0('0x22')](function(_0x41d150){if(_0x41d150){_0x4b6a93[_0xfeb0('0x29')]=_0x41d150[_0xfeb0('0x67')]({'plain':!![]});return db[_0xfeb0('0x68')][_0xfeb0('0x5c')]({'where':{'id':_0x41d150[_0xfeb0('0x69')]}});}return null;})[_0xfeb0('0x22')](handleEntityNotFound(_0x435dc8,null))[_0xfeb0('0x22')](function(_0x40e2f8){if(_0x40e2f8){_0x4b6a93[_0xfeb0('0x6c')]=_0x40e2f8[_0xfeb0('0x67')]({'plain':!![]});interaction_log[_0xfeb0('0x23')](_0xfeb0('0x83'),_0x2a58aa['user']['id'],_0x2a58aa[_0xfeb0('0x65')][_0xfeb0('0x3a')],_0x2a58aa['user'][_0xfeb0('0x6e')],_0x4b6a93[_0xfeb0('0x6c')]['id'],_0x2a58aa['body']?JSON[_0xfeb0('0x27')](_0x2a58aa[_0xfeb0('0x5b')]):_0xfeb0('0x6f'));return respondWithRpcPromise(_0xfeb0('0x84'),_0xfeb0('0x85'),_0x4b6a93);}return null;})[_0xfeb0('0x22')](function(_0x56a2e6){var _0x2ed16c=_0xfeb0('0x72')+_0x56a2e6[_0xfeb0('0x29')][_0xfeb0('0x73')];return db[_0xfeb0('0x74')]['query'](_0x2ed16c,{'type':db[_0xfeb0('0x75')][_0xfeb0('0x76')][_0xfeb0('0x77')],'raw':!![]})[_0xfeb0('0x22')](function(_0x3e275a){return _0x3e275a;});})[_0xfeb0('0x22')](function(_0x727c2d){if(_0x727c2d){_0x4b6a93[_0xfeb0('0x29')][_0xfeb0('0x78')]=_0x727c2d[0x0];if(!_0x2a58aa[_0xfeb0('0x5b')][_0xfeb0('0x64')])return;return db['User'][_0xfeb0('0x5c')]({'where':{'id':_0x2a58aa['body'][_0xfeb0('0x64')],'role':'agent'},'attributes':['id',_0xfeb0('0x3a'),_0xfeb0('0x7a'),_0xfeb0('0x7b'),_0xfeb0('0x7c')],'raw':!![]});}return null;})['then'](function(_0x34fb6d){if(!_0x34fb6d)return null;_0x4b6a93['message'][_0xfeb0('0x66')]=_0x34fb6d;return _0x4b6a93;})[_0xfeb0('0x22')](function(_0x191146){if(_0x191146){_0x191146[_0xfeb0('0x29')][_0xfeb0('0x7d')]=util[_0xfeb0('0x63')]('SIP/%s',_0x2a58aa[_0xfeb0('0x65')][_0xfeb0('0x3a')]);_0x191146['message'][_0xfeb0('0x7e')]=_0x4b6a93[_0xfeb0('0x7e')];_0x191146[_0xfeb0('0x29')]['motionChannel']=_0x4b6a93[_0xfeb0('0x7e')];_0x191146[_0xfeb0('0x29')][_0xfeb0('0x86')]='reject';respondWithRpcPromise('EventManager',_0xfeb0('0x81'),{'event':_0xfeb0('0x87'),'message':_0x191146[_0xfeb0('0x29')]},client9002);return _0x4b6a93;}return null;})['then'](respondWithResult(_0x435dc8,null))[_0xfeb0('0x57')](handleError(_0x435dc8,null));};exports[_0xfeb0('0x2c')]=function(_0x58cdde,_0xd59620,_0x57acc7){if(_0x58cdde['body']['id']){delete _0x58cdde[_0xfeb0('0x5b')]['id'];}var _0x56a191;return db['SmsMessage']['find']({'where':{'id':_0x58cdde[_0xfeb0('0x59')]['id']}})[_0xfeb0('0x22')](handleEntityNotFound(_0xd59620,null))['then'](function(_0x5d4a02){if(_0x5d4a02){_0x56a191=_0x5d4a02;return db['SmsAccount']['find']({'where':{'id':_0x5d4a02[_0xfeb0('0x88')]}});}})[_0xfeb0('0x22')](handleEntityNotFound(_0xd59620,null))[_0xfeb0('0x22')](function(_0x3902d7){if(_0x3902d7){logger[_0xfeb0('0x25')](_0xfeb0('0x26'),_0xfeb0('0x2c'),'received\x20delivery\x20report\x20from',_0x3902d7[_0xfeb0('0x41')],util['inspect'](_0x58cdde[_0xfeb0('0x5b')],{'showHidden':![],'depth':null}));switch(_0x3902d7[_0xfeb0('0x41')]){case _0xfeb0('0x89'):if(_0x58cdde['body'][_0xfeb0('0x8a')]&&_0x58cdde['body'][_0xfeb0('0x8a')]===_0x56a191[_0xfeb0('0x8b')]){return _0x56a191[_0xfeb0('0x37')]({'read':!![]});}else{logger[_0xfeb0('0x28')](_0xfeb0('0x8c'),_0xfeb0('0x2c'),'twilio',util[_0xfeb0('0x8d')](_0x58cdde[_0xfeb0('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xfeb0('0x8e'):if(_0x58cdde[_0xfeb0('0x5b')]['MessageUUID']&&_0x58cdde['body'][_0xfeb0('0x8f')]===_0x56a191['messageId']&&_[_0xfeb0('0x90')]([_0xfeb0('0x91'),'delivered'],_0x58cdde['body'][_0xfeb0('0x92')])>=0x0){return _0x56a191[_0xfeb0('0x37')]({'read':!![]});}else{logger[_0xfeb0('0x28')](_0xfeb0('0x8c'),_0xfeb0('0x2c'),_0xfeb0('0x93'),util['inspect'](_0x58cdde['body'],{'showHidden':![],'depth':null}));}break;case _0xfeb0('0x94'):var _0x36e26e=_0x58cdde[_0xfeb0('0x5b')]['results'][0x0];if(_0x36e26e['status'][_0xfeb0('0x95')]===_0xfeb0('0x96')){return _0x56a191[_0xfeb0('0x37')]({'read':!![]});}else{logger[_0xfeb0('0x28')](_0xfeb0('0x8c'),_0xfeb0('0x2c'),_0xfeb0('0x94'),util[_0xfeb0('0x8d')](_0x58cdde[_0xfeb0('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x56a191;}})['then'](respondWithResult(_0xd59620,null))['catch'](handleError(_0xd59620,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 929ee13..52297b3 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 _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 +var _0x6995=['setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','SmsMessage'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0x6995,0x1a6));var _0x5699=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6995[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x5699('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x5699('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x5699('0x2')](0x0);var events={'afterCreate':_0x5699('0x3'),'afterUpdate':'update','afterDestroy':_0x5699('0x4')};function emitEvent(_0x5e073b){return function(_0x4fc27b,_0x2482fc,_0x4e3a4f){SmsMessageEvents[_0x5699('0x5')](_0x5e073b+':'+_0x4fc27b['id'],_0x4fc27b);SmsMessageEvents[_0x5699('0x5')](_0x5e073b,_0x4fc27b);_0x4e3a4f(null);};}for(var e in events){if(events[_0x5699('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x5699('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 332968f..12bdcde 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 _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 +var _0x4150=['/status?token=','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','timestamp','keys','sort','length','apiKey','createHash','md5','digest','hex','signature=','id_sms','clickatell','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','accountId','/messages','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','then','update','error','SmsAccount','find','SmsAccountId','type','twilio','authToken','accountSid','messages','body','phone','/api/sms/messages/','token','sid','afterCreate','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','GET','split','POST','user_key','total_sent','internal_order_id','deliveryReport','read','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','inspect','catch','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','clickSend','plivo','authId','remote'];(function(_0x239b5e,_0x208a3f){var _0x577f3d=function(_0x2880de){while(--_0x2880de){_0x239b5e['push'](_0x239b5e['shift']());}};_0x577f3d(++_0x208a3f);}(_0x4150,0x118));var _0x0415=function(_0x56a154,_0x3cfc02){_0x56a154=_0x56a154-0x0;var _0x66a60=_0x4150[_0x56a154];return _0x66a60;};'use strict';var _=require(_0x0415('0x0'));var util=require(_0x0415('0x1'));var logger=require(_0x0415('0x2'))(_0x0415('0x3'));var moment=require(_0x0415('0x4'));var BPromise=require(_0x0415('0x5'));var rp=require(_0x0415('0x6'));var fs=require('fs');var path=require(_0x0415('0x7'));var rimraf=require(_0x0415('0x8'));var config=require('../../config/environment');var attributes=require(_0x0415('0x9'));module[_0x0415('0xa')]=function(_0x1db742,_0x30f72c){return _0x1db742[_0x0415('0xb')](_0x0415('0xc'),attributes,{'tableName':_0x0415('0xd'),'paranoid':![],'indexes':[{'name':_0x0415('0xe'),'fields':[_0x0415('0xe')]},{'name':'fti_sms_messages','fields':['body'],'type':_0x0415('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xefaa16,_0x49560d,_0x40f0c8){var _0x3f9529=_0x1db742[_0x0415('0x10')];var _0x92aa23=_0xefaa16['get']({'plain':!![]});if(_0x92aa23[_0x0415('0x11')][_0x0415('0x12')]()==='in'||_0x92aa23['direction'][_0x0415('0x12')]()===_0x0415('0x13')&&!_0x92aa23[_0x0415('0x14')]&&!_[_0x0415('0x15')](_0x92aa23[_0x0415('0x16')])&&!_['isNil'](_0x92aa23['SmsInteractionId'])){_0x3f9529[_0x0415('0x17')]['findOne']({'where':{'id':_0x92aa23['SmsInteractionId']}})[_0x0415('0x18')](function(_0x50193e){if(_0x50193e){_0x50193e[_0x0415('0x19')]({'lastMsgAt':_0x92aa23['createdAt'],'lastMsgDirection':_0x92aa23[_0x0415('0x11')][_0x0415('0x12')]()});}})['catch'](function(_0x1c86aa){console[_0x0415('0x1a')](_0x1c86aa);});}if(_0x92aa23[_0x0415('0x11')]===_0x0415('0x13')&&!_0x92aa23[_0x0415('0x14')]){var _0x21677a;_0x3f9529[_0x0415('0x1b')][_0x0415('0x1c')]({'where':{'id':_0x92aa23[_0x0415('0x1d')]},'raw':!![]})['then'](function(_0x5bab9f){_0x21677a=_0x5bab9f;if(_0x21677a&&_0x21677a[_0x0415('0x1e')]){switch(_0x21677a[_0x0415('0x1e')]){case _0x0415('0x1f'):var _0x4fe3fa=require('twilio');if(_0x21677a['accountSid']&&_0x21677a[_0x0415('0x20')]&&_0x21677a['phone']){var _0x4e1d17=new _0x4fe3fa(_0x21677a[_0x0415('0x21')],_0x21677a[_0x0415('0x20')]);_0x4e1d17[_0x0415('0x22')]['create']({'body':_0x92aa23[_0x0415('0x23')],'to':_0x92aa23[_0x0415('0x24')],'from':_0x21677a[_0x0415('0x24')],'statusCallback':_0x21677a['remote']+_0x0415('0x25')+_0x92aa23['id']+'/status?token='+_0x21677a[_0x0415('0x26')]})[_0x0415('0x18')](function(_0x3ad2d9){if(_0x3ad2d9['sid']){return _0xefaa16[_0x0415('0x19')]({'messageId':_0x3ad2d9[_0x0415('0x27')]});}})['catch'](function(_0x2803f0){logger[_0x0415('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0415('0x1f'),util['inspect'](_0x2803f0,{'showHidden':![],'depth':null}));});}else{logger[_0x0415('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0415('0x28'),_0x0415('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x54f79c=_0x0415('0x29');if(_0x21677a[_0x0415('0x2a')]&&_0x21677a[_0x0415('0x2b')]){var _0x53f95f={'recipient':[_0x92aa23['phone']],'message':_0x92aa23[_0x0415('0x23')],'message_type':_0x21677a['smsMethod']};if(_0x21677a[_0x0415('0x2c')]&&_0x21677a['smsMethod']!=='SI'){_0x53f95f[_0x0415('0x2d')]=_0x21677a[_0x0415('0x24')];}var _0x3a39c3={'url':_0x54f79c+'login?username='+_0x21677a['username']+'&password='+_0x21677a[_0x0415('0x2b')],'method':_0x0415('0x2e')};rp(_0x3a39c3)['then'](function(_0x536b5b){var _0x780c86=_0x536b5b[_0x0415('0x2f')](';');var _0x1b4114={'user_key':_0x780c86[0x0],'session_key':_0x780c86[0x1]};_0x3a39c3={'url':_0x54f79c+'sms','method':_0x0415('0x30'),'headers':{'user_key':_0x1b4114[_0x0415('0x31')],'Session_key':_0x1b4114['session_key']},'json':!![],'body':_0x53f95f};return rp(_0x3a39c3);})[_0x0415('0x18')](function(_0x3f795f){if(_0x3f795f[_0x0415('0x32')]>=0x1){var _0x588cbe={'messageId':_0x3f795f[_0x0415('0x33')]};if(_0x21677a[_0x0415('0x2c')]!=='GP'||!_0x21677a[_0x0415('0x34')]){_0x588cbe[_0x0415('0x35')]=!![];}return _0xefaa16[_0x0415('0x19')](_0x588cbe);}else{return logger['error'](_0x0415('0x36'),'afterCreate',_0x0415('0x37'),util[_0x0415('0x38')](_0x3f795f,{'showHidden':![],'depth':null}));}})[_0x0415('0x39')](function(_0x2ff96a){return logger[_0x0415('0x1a')](_0x0415('0x36'),_0x0415('0x28'),_0x0415('0x37'),util[_0x0415('0x38')](_0x2ff96a,{'showHidden':![],'depth':null}));});}else{logger[_0x0415('0x1a')](_0x0415('0x36'),_0x0415('0x28'),_0x0415('0x37'),_0x0415('0x3a'));}break;case _0x0415('0x3b'):if(_0x21677a[_0x0415('0x20')]){var _0x3b8adb={'recipient':_0x92aa23['phone'],'message':_0x92aa23['body'],'sender':_0x21677a[_0x0415('0x3c')]||_0x21677a[_0x0415('0x24')],'authorization':_0x21677a[_0x0415('0x20')]};var _0x49560d={'method':'POST','uri':_0x0415('0x3d'),'body':_0x3b8adb,'json':!![]};rp(_0x49560d)[_0x0415('0x18')](function(_0x20e275){var _0x55d994={'messageId':_0x20e275[_0x0415('0x3e')]};if(!_0x21677a[_0x0415('0x34')]){_0x55d994[_0x0415('0x35')]=!![];}return _0xefaa16[_0x0415('0x19')](_0x55d994);})[_0x0415('0x39')](function(_0x3ac806){logger[_0x0415('0x1a')](_0x0415('0x36'),_0x0415('0x28'),_0x0415('0x3b'),util[_0x0415('0x38')](_0x3ac806,{'showHidden':![],'depth':null}));});}else{logger[_0x0415('0x1a')](_0x0415('0x36'),'afterCreate',_0x0415('0x3b'),'Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x21677a[_0x0415('0x2a')]&&_0x21677a[_0x0415('0x2b')]){var _0x3b8adb={'messages':[{'source':_0x0415('0x3f'),'to':_0x92aa23[_0x0415('0x24')],'body':_0x92aa23['body'],'from':_0x21677a[_0x0415('0x3c')]||_0x21677a['phone']}]};var _0x5918a1=util[_0x0415('0x40')](_0x0415('0x41'),_0x21677a[_0x0415('0x2a')],_0x21677a[_0x0415('0x2b')]);var _0x49560d={'method':_0x0415('0x30'),'uri':_0x0415('0x42'),'body':_0x3b8adb,'headers':{'Authorization':util[_0x0415('0x40')](_0x0415('0x43'),new Buffer(_0x5918a1)[_0x0415('0x44')](_0x0415('0x45')))},'json':!![]};rp(_0x49560d)[_0x0415('0x18')](function(_0x18946b){if(_0x18946b[_0x0415('0x46')]>=0xc8&&_0x18946b[_0x0415('0x46')]<=0xce){if(_0x18946b['data']&&_0x18946b[_0x0415('0x47')][_0x0415('0x48')]>0x0){var _0x426b68=_['head'](_0x18946b[_0x0415('0x47')][_0x0415('0x22')]);var _0x53230b={'messageId':_0x426b68['message_id']};if(!_0x21677a['deliveryReport']){_0x53230b['read']=!![];}return _0xefaa16['update'](_0x53230b);}else{logger[_0x0415('0x1a')](_0x0415('0x36'),_0x0415('0x28'),_0x0415('0x49'),util['inspect'](_0x18946b,{'showHidden':![],'depth':null}));}}else{logger[_0x0415('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0415('0x28'),'clickSend',util[_0x0415('0x38')](_0x18946b,{'showHidden':![],'depth':null}));}})[_0x0415('0x39')](function(_0x4e336c){logger['error'](_0x0415('0x36'),_0x0415('0x28'),'clickSend',util['inspect'](_0x4e336c,{'showHidden':![],'depth':null}));});}else{logger[_0x0415('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0415('0x28'),_0x0415('0x49'),_0x0415('0x3a'));}break;case _0x0415('0x4a'):if(_0x21677a[_0x0415('0x4b')]&&_0x21677a[_0x0415('0x20')]){var _0x3b8adb={'dst':_0x92aa23[_0x0415('0x24')],'text':_0x92aa23['body'],'src':_0x21677a[_0x0415('0x3c')]||_0x21677a['phone'],'url':_0x21677a[_0x0415('0x4c')]+_0x0415('0x25')+_0x92aa23['id']+_0x0415('0x4d')+_0x21677a[_0x0415('0x26')]};var _0x5918a1=util[_0x0415('0x40')](_0x0415('0x41'),_0x21677a['authId'],_0x21677a[_0x0415('0x20')]);var _0x49560d={'method':_0x0415('0x30'),'uri':util[_0x0415('0x40')](_0x0415('0x4e'),_0x21677a[_0x0415('0x4b')]),'body':_0x3b8adb,'headers':{'Authorization':util[_0x0415('0x40')](_0x0415('0x43'),new Buffer(_0x5918a1)[_0x0415('0x44')](_0x0415('0x45')))},'json':!![]};rp(_0x49560d)[_0x0415('0x18')](function(_0x32487b){var _0xfc8a70={'messageId':_0x32487b['message_uuid'][0x0]};return _0xefaa16['update'](_0xfc8a70);})[_0x0415('0x39')](function(_0x44ea39){logger[_0x0415('0x1a')](_0x0415('0x36'),_0x0415('0x28'),'plivo',util[_0x0415('0x38')](_0x44ea39,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0415('0x36'),_0x0415('0x28'),'plivo',_0x0415('0x4f'));}break;case _0x0415('0x50'):if(_0x21677a[_0x0415('0x2a')]&&_0x21677a[_0x0415('0x2b')]){if(_0x21677a[_0x0415('0x51')]){var _0x5c6cda={'method':_0x0415('0x30'),'uri':_0x21677a[_0x0415('0x51')]+_0x0415('0x52'),'body':{'username':_0x21677a[_0x0415('0x2a')],'password':_0x21677a[_0x0415('0x2b')]},'json':!![]};return rp(_0x5c6cda)['then'](function(_0x3af75b){var _0x3d153e={'method':_0x0415('0x30'),'uri':_0x21677a[_0x0415('0x51')]+_0x0415('0x53'),'body':{'messages':[{'from':_0x21677a[_0x0415('0x24')],'destinations':[{'to':_0x92aa23[_0x0415('0x24')]}],'text':_0x92aa23[_0x0415('0x23')],'notifyUrl':_0x21677a[_0x0415('0x4c')]+_0x0415('0x25')+_0x92aa23['id']+'/status?token='+_0x21677a['token'],'notifyContentType':'application/json','callbackData':_0x21677a[_0x0415('0x24')]+';'+_0x92aa23[_0x0415('0x23')]}]},'headers':{'Authorization':_0x0415('0x54')+_0x3af75b[_0x0415('0x26')]},'json':!![]};return rp(_0x3d153e)[_0x0415('0x18')](function(_0x4cb90c){if(_0x4cb90c[_0x0415('0x22')]){var _0x1b1fe8={'messageId':_0x4cb90c[_0x0415('0x22')][0x0][_0x0415('0xe')]};if(!_0x21677a[_0x0415('0x34')]){_0x1b1fe8['read']=!![];}return _0xefaa16['update'](_0x1b1fe8);}else{return logger[_0x0415('0x1a')](_0x0415('0x36'),_0x0415('0x28'),'infobip',util[_0x0415('0x38')](_0x4cb90c,{'showHidden':![],'depth':null}));}});})[_0x0415('0x39')](function(_0x18213f){return logger[_0x0415('0x1a')](_0x0415('0x36'),_0x0415('0x28'),_0x0415('0x50'),util['inspect'](_0x18213f,{'showHidden':![],'depth':null}));});}else{logger[_0x0415('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0415('0x28'),_0x0415('0x50'),_0x0415('0x55'));}}else{logger[_0x0415('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0415('0x28'),'infobip','Missing\x20parameters:\x20username,\x20password');}break;case _0x0415('0x56'):var _0x27a8fb=require(_0x0415('0x57'));if(_0x21677a['apiKey']){var _0x1f9b0a={};_0x1f9b0a[_0x0415('0x58')]=_0x21677a[_0x0415('0x2a')];_0x1f9b0a[_0x0415('0x24')]=_0x92aa23[_0x0415('0x24')];_0x1f9b0a[_0x0415('0x2d')]=_0x21677a[_0x0415('0x24')];_0x1f9b0a['text']=_0x92aa23['body'];_0x1f9b0a[_0x0415('0x59')]=+new Date();var _0x3c06f7='';var _0x18ad20='';var _0x2a20ee=Object[_0x0415('0x5a')](_0x1f9b0a);_0x2a20ee[_0x0415('0x5b')]();for(var _0x213f89=0x0;_0x213f89<_0x2a20ee[_0x0415('0x5c')];_0x213f89++){if(_0x3c06f7!=''){_0x3c06f7+='&';}_0x3c06f7+=_0x2a20ee[_0x213f89]+'='+encodeURIComponent(_0x1f9b0a[_0x2a20ee[_0x213f89]]);_0x18ad20+=_0x1f9b0a[_0x2a20ee[_0x213f89]];}_0x18ad20+=_0x21677a[_0x0415('0x5d')];_0x18ad20=_0x27a8fb[_0x0415('0x5e')](_0x0415('0x5f'))[_0x0415('0x19')](_0x18ad20)[_0x0415('0x60')](_0x0415('0x61'));if(_0x3c06f7!==''){_0x3c06f7+='&';}_0x3c06f7+=_0x0415('0x62')+_0x18ad20;var _0x3a39c3={'method':_0x0415('0x2e'),'uri':_0x21677a[_0x0415('0x51')]+'/external/get/send.php?'+_0x3c06f7,'json':!![]};return rp(_0x3a39c3)[_0x0415('0x18')](function(_0x288993){var _0x18ca04=Object[_0x0415('0x5a')](_0x288993);if(_0x288993[_0x18ca04[0x0]][_0x0415('0x1a')]&&parseInt(_0x288993[_0x18ca04[0x0]]['error'])===0x0){var _0x143dbf={'messageId':_0x288993[_0x18ca04[0x0]][_0x0415('0x63')]};if(!_0x21677a[_0x0415('0x34')]){_0x143dbf[_0x0415('0x35')]=!![];}return _0xefaa16[_0x0415('0x19')](_0x143dbf);}else{return logger[_0x0415('0x1a')](_0x0415('0x36'),_0x0415('0x28'),_0x0415('0x56'),util[_0x0415('0x38')](_0x288993[_0x0415('0x1a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x268690){return logger[_0x0415('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0415('0x28'),_0x0415('0x56'),util[_0x0415('0x38')](_0x268690,{'showHidden':![],'depth':null}));});}else{logger[_0x0415('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0415('0x28'),_0x0415('0x56'),'Missing\x20parameters:\x20apiKey');}break;case _0x0415('0x64'):if(_0x21677a[_0x0415('0x5d')]){var _0x56f1b5={'method':_0x0415('0x30'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x21677a[_0x0415('0x5d')]},'body':{'content':_0x92aa23[_0x0415('0x23')],'to':[_0x92aa23['phone']],'from':_0x21677a['phone'],'binary':![],'clientMessageId':'uuid','charset':_0x0415('0x65')},'json':!![]};rp(_0x56f1b5)['then'](function(_0x406a2b){if(!_0x406a2b[_0x0415('0x1a')]){var _0x3a034b={'messageId':_0x406a2b[_0x0415('0x22')][0x0][_0x0415('0x66')]};if(!_0x21677a[_0x0415('0x34')]){_0x3a034b[_0x0415('0x35')]=!![];}return _0xefaa16[_0x0415('0x19')](_0x3a034b);}else{return logger[_0x0415('0x1a')](_0x0415('0x36'),_0x0415('0x28'),_0x0415('0x64'),util['inspect'](_0x406a2b['error'],{'showHidden':![],'depth':null}));}})[_0x0415('0x39')](function(_0x4dad33){return logger[_0x0415('0x1a')](_0x0415('0x36'),'afterCreate',_0x0415('0x64'),util['inspect'](_0x4dad33,{'showHidden':![],'depth':null}));});}else{logger[_0x0415('0x1a')](_0x0415('0x36'),_0x0415('0x28'),_0x0415('0x64'),_0x0415('0x67'));}break;case _0x0415('0x68'):if(_0x21677a['username']&&_0x21677a['password']){var _0x5918a1=util[_0x0415('0x40')](_0x0415('0x41'),_0x21677a[_0x0415('0x2a')],_0x21677a[_0x0415('0x2b')]);var _0x49560d={'method':_0x0415('0x30'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x21677a[_0x0415('0x69')]+_0x0415('0x6a'),'body':{'to':[_0x92aa23[_0x0415('0x24')]],'text':_0x92aa23['body'],'from':_0x21677a['phone'],'applicationId':_0x21677a[_0x0415('0x6b')]},'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x5918a1)[_0x0415('0x44')](_0x0415('0x45')))},'json':!![]};rp(_0x49560d)[_0x0415('0x18')](function(_0x5deff9){if(_0x5deff9['id']){var _0x286eab={'messageId':_0x5deff9['id']};return _0xefaa16[_0x0415('0x19')](_0x286eab);}else{logger[_0x0415('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','bandwidth',util[_0x0415('0x38')](_0x5deff9,{'showHidden':![],'depth':null}));}})[_0x0415('0x39')](function(_0x5c9b54){logger['error'](_0x0415('0x36'),'afterCreate',_0x0415('0x68'),util['inspect'](_0x5c9b54,{'showHidden':![],'depth':null}));});}else{logger[_0x0415('0x1a')](_0x0415('0x36'),_0x0415('0x28'),_0x0415('0x68'),_0x0415('0x3a'));}break;case'intelepeer':if(_0x21677a['apiKey']){var _0x50c06d={};var _0x3a39c3={'method':_0x0415('0x30'),'uri':_0x0415('0x6c'),'headers':{'Authorization':_0x0415('0x6d')+_0x21677a[_0x0415('0x5d')],'Content-Type':_0x0415('0x6e')},'body':{'from':_0x21677a[_0x0415('0x24')],'to':_0x92aa23['phone'],'text':_0x92aa23[_0x0415('0x23')]},'json':!![]};return rp(_0x3a39c3)[_0x0415('0x18')](function(_0x4b3d3b){if(_0x4b3d3b[_0x0415('0x6f')]==0xca){_0x50c06d[_0x0415('0x70')]=_0x4b3d3b;var _0x1ca1b0={'method':_0x0415('0x30'),'uri':_0x0415('0x71'),'headers':{'Authorization':_0x0415('0x6d')+_0x21677a['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x50c06d[_0x0415('0x70')][_0x0415('0x72')]},'json':!![]};return rp(_0x1ca1b0)[_0x0415('0x18')](function(_0x3b602d){_0x50c06d[_0x0415('0x73')]=_0x3b602d;var _0x350548={'messageId':_0x50c06d['message'][_0x0415('0x72')],'read':!![]};return _0xefaa16['update'](_0x350548);});}else{return logger[_0x0415('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0415('0x28'),_0x0415('0x74'),util[_0x0415('0x38')](_0x4b3d3b,{'showHidden':![],'depth':null}));}})[_0x0415('0x39')](function(_0x359177){return logger[_0x0415('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','intelepeer',util[_0x0415('0x38')](_0x359177,{'showHidden':![],'depth':null}));});}else{return logger[_0x0415('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0415('0x28'),_0x0415('0x74'),'Token\x20not\x20received');}break;}}})[_0x0415('0x75')](function(){_0x40f0c8();});}else{_0x40f0c8();}}},'charset':'utf8mb4','collate':_0x0415('0x76')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 6fc316b..c6f615e 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 _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 +var _0xe63f=['raw','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSmsMessage','SmsMessage','body','options'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0xe63f,0x133));var _0xfe63=function(_0x533aa4,_0x33668a){_0x533aa4=_0x533aa4-0x0;var _0x12a1a4=_0xe63f[_0x533aa4];return _0x12a1a4;};'use strict';var _=require(_0xfe63('0x0'));var util=require(_0xfe63('0x1'));var moment=require(_0xfe63('0x2'));var BPromise=require(_0xfe63('0x3'));var rs=require(_0xfe63('0x4'));var fs=require('fs');var Redis=require(_0xfe63('0x5'));var db=require(_0xfe63('0x6'))['db'];var utils=require(_0xfe63('0x7'));var logger=require(_0xfe63('0x8'))(_0xfe63('0x9'));var config=require(_0xfe63('0xa'));var jayson=require(_0xfe63('0xb'));var client=jayson[_0xfe63('0xc')][_0xfe63('0xd')]({'port':0x232a});config[_0xfe63('0xe')]=_[_0xfe63('0xf')](config[_0xfe63('0xe')],{'host':_0xfe63('0x10'),'port':0x18eb});var socket=require(_0xfe63('0x11'))(new Redis(config[_0xfe63('0xe')]));require(_0xfe63('0x12'))[_0xfe63('0x13')](socket);function respondWithRpcPromise(_0x2d83ce,_0x9fb7be,_0x1022b2){return new BPromise(function(_0x2dfe33,_0x48fd83){return client[_0xfe63('0x14')](_0x2d83ce,_0x1022b2)[_0xfe63('0x15')](function(_0x1417bb){logger[_0xfe63('0x16')](_0xfe63('0x17'),_0x9fb7be,_0xfe63('0x18'));logger['debug'](_0xfe63('0x19'),_0x9fb7be,'request\x20sent',JSON[_0xfe63('0x1a')](_0x1417bb));if(_0x1417bb[_0xfe63('0x1b')]){if(_0x1417bb[_0xfe63('0x1b')][_0xfe63('0x1c')]===0x1f4){logger[_0xfe63('0x1b')](_0xfe63('0x17'),_0x9fb7be,_0x1417bb[_0xfe63('0x1b')]['message']);return _0x48fd83(_0x1417bb[_0xfe63('0x1b')][_0xfe63('0x1d')]);}logger[_0xfe63('0x1b')](_0xfe63('0x17'),_0x9fb7be,_0x1417bb['error'][_0xfe63('0x1d')]);return _0x2dfe33(_0x1417bb[_0xfe63('0x1b')][_0xfe63('0x1d')]);}else{logger[_0xfe63('0x16')]('SmsMessage,\x20%s,\x20%s',_0x9fb7be,'request\x20sent');_0x2dfe33(_0x1417bb[_0xfe63('0x1e')][_0xfe63('0x1d')]);}})['catch'](function(_0x2272e6){logger[_0xfe63('0x1b')]('SmsMessage,\x20%s,\x20%s',_0x9fb7be,_0x2272e6);_0x48fd83(_0x2272e6);});});}exports[_0xfe63('0x1f')]=function(_0x23b6b0){var _0x2e9cbf=this;return new Promise(function(_0x565f67,_0x539f45){return db[_0xfe63('0x20')]['create'](_0x23b6b0[_0xfe63('0x21')],{'raw':_0x23b6b0[_0xfe63('0x22')]?_0x23b6b0[_0xfe63('0x22')][_0xfe63('0x23')]===undefined?!![]:![]:!![]})['then'](function(_0x2e5353){logger[_0xfe63('0x16')](_0xfe63('0x1f'),_0x23b6b0);logger[_0xfe63('0x24')](_0xfe63('0x1f'),_0x23b6b0,JSON['stringify'](_0x2e5353));_0x565f67(_0x2e5353);})[_0xfe63('0x25')](function(_0x257668){logger[_0xfe63('0x1b')]('CreateSmsMessage',_0x257668['message'],_0x23b6b0);_0x539f45(_0x2e9cbf['error'](0x1f4,_0x257668['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index a56bb7a..38df2da 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 _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 +var _0x0c05=['register','length','./smsMessage.events','save','remove','update','removeListener'];(function(_0x3c95f4,_0x4adbfd){var _0x1711fa=function(_0x502f69){while(--_0x502f69){_0x3c95f4['push'](_0x3c95f4['shift']());}};_0x1711fa(++_0x4adbfd);}(_0x0c05,0xfe));var _0x50c0=function(_0x75e2c9,_0x50b412){_0x75e2c9=_0x75e2c9-0x0;var _0x388ddb=_0x0c05[_0x75e2c9];return _0x388ddb;};'use strict';var SmsMessageEvents=require(_0x50c0('0x0'));var events=[_0x50c0('0x1'),_0x50c0('0x2'),_0x50c0('0x3')];function createListener(_0x94ac82,_0x1d21d0){return function(_0x548493){_0x1d21d0['emit'](_0x94ac82,_0x548493);};}function removeListener(_0x45089c,_0x3338f5){return function(){SmsMessageEvents[_0x50c0('0x4')](_0x45089c,_0x3338f5);};}exports[_0x50c0('0x5')]=function(_0x413be4){for(var _0x37aa00=0x0,_0x417f31=events[_0x50c0('0x6')];_0x37aa00<_0x417f31;_0x37aa00++){var _0x570b44=events[_0x37aa00];var _0x14a94b=createListener('smsMessage:'+_0x570b44,_0x413be4);SmsMessageEvents['on'](_0x570b44,_0x14a94b);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 6c1981d..f3a163d 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 _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 +var _0x012f=['removeTeams','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsQueue.controller','get','isAuthenticated','index','/:id','show','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy'];(function(_0x15bc8a,_0x48f2f5){var _0x343080=function(_0x3a07be){while(--_0x3a07be){_0x15bc8a['push'](_0x15bc8a['shift']());}};_0x343080(++_0x48f2f5);}(_0x012f,0xc1));var _0xf012=function(_0x46275a,_0x157c56){_0x46275a=_0x46275a-0x0;var _0x1b6b39=_0x012f[_0x46275a];return _0x1b6b39;};'use strict';var multer=require(_0xf012('0x0'));var util=require('util');var path=require(_0xf012('0x1'));var timeout=require(_0xf012('0x2'));var express=require(_0xf012('0x3'));var router=express[_0xf012('0x4')]();var fs_extra=require(_0xf012('0x5'));var auth=require(_0xf012('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf012('0x7'));router[_0xf012('0x8')]('/',auth[_0xf012('0x9')](),controller[_0xf012('0xa')]);router[_0xf012('0x8')]('/describe',auth[_0xf012('0x9')](),controller['describe']);router[_0xf012('0x8')](_0xf012('0xb'),auth['isAuthenticated'](),controller[_0xf012('0xc')]);router[_0xf012('0x8')]('/:id/members',auth[_0xf012('0x9')](),controller['getMembers']);router[_0xf012('0x8')](_0xf012('0xd'),auth[_0xf012('0x9')](),controller['getTeams']);router[_0xf012('0x8')](_0xf012('0xe'),auth['isAuthenticated'](),controller[_0xf012('0xf')]);router[_0xf012('0x10')]('/',auth[_0xf012('0x9')](),controller[_0xf012('0x11')]);router['post'](_0xf012('0xd'),auth['isAuthenticated'](),controller['addTeams']);router[_0xf012('0x10')]('/:id/users',auth[_0xf012('0x9')](),controller[_0xf012('0x12')]);router[_0xf012('0x13')](_0xf012('0xb'),auth[_0xf012('0x9')](),controller[_0xf012('0x14')]);router[_0xf012('0x15')](_0xf012('0xb'),auth['isAuthenticated'](),controller[_0xf012('0x16')]);router['delete'](_0xf012('0xd'),auth[_0xf012('0x9')](),controller[_0xf012('0x17')]);router[_0xf012('0x15')]('/:id/users',auth[_0xf012('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 5bee8dd..9b3f5d1 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 _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 +var _0x7f99=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x7f99,0x1e2));var _0x97f9=function(_0x3bcfee,_0x411cc7){_0x3bcfee=_0x3bcfee-0x0;var _0x161f14=_0x7f99[_0x3bcfee];return _0x161f14;};'use strict';var Sequelize=require(_0x97f9('0x0'));module[_0x97f9('0x1')]={'name':{'type':Sequelize[_0x97f9('0x2')],'unique':_0x97f9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x97f9('0x2')]},'timeout':{'type':Sequelize[_0x97f9('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x97f9('0x5')](_0x97f9('0x6'),_0x97f9('0x7'),_0x97f9('0x8'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 83fc5e3..188ef24 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 _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 +var _0x2884=['name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','options','SmsQueue','includeAll','include','findAll','show','find','catch','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserSmsQueue','nolimit','pick','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','Team','hasOwnProperty','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','clone','push','toString','SELECT','TeamId','includes','all','union','compact','value','isEmpty','userSmsQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','eml-format','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','end','json','undefined','limit','count','offset','status','set','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','sendStatus','error'];(function(_0x3611d0,_0x315141){var _0x45a5af=function(_0x966173){while(--_0x966173){_0x3611d0['push'](_0x3611d0['shift']());}};_0x45a5af(++_0x315141);}(_0x2884,0xea));var _0x4288=function(_0x39bf66,_0x35c96c){_0x39bf66=_0x39bf66-0x0;var _0x431030=_0x2884[_0x39bf66];return _0x431030;};'use strict';var emlformat=require(_0x4288('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4288('0x1'));var rp=require(_0x4288('0x2'));var moment=require('moment');var BPromise=require(_0x4288('0x3'));var Mustache=require('mustache');var util=require(_0x4288('0x4'));var path=require(_0x4288('0x5'));var sox=require(_0x4288('0x6'));var csv=require(_0x4288('0x7'));var ejs=require(_0x4288('0x8'));var fs=require('fs');var fs_extra=require(_0x4288('0x9'));var _=require(_0x4288('0xa'));var squel=require(_0x4288('0xb'));var crypto=require('crypto');var jsforce=require(_0x4288('0xc'));var deskjs=require(_0x4288('0xd'));var toCsv=require(_0x4288('0x7'));var querystring=require(_0x4288('0xe'));var Papa=require(_0x4288('0xf'));var Redis=require('ioredis');var authService=require(_0x4288('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4288('0x11'));var hardwareService=require(_0x4288('0x12'));var logger=require('../../config/logger')(_0x4288('0x13'));var utils=require(_0x4288('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4288('0x15'))['db'];config[_0x4288('0x16')]=_[_0x4288('0x17')](config[_0x4288('0x16')],{'host':_0x4288('0x18'),'port':0x18eb});var socket=require(_0x4288('0x19'))(new Redis(config[_0x4288('0x16')]));require(_0x4288('0x1a'))['register'](socket);function respondWithStatusCode(_0x25d8e5,_0x3fe827){_0x3fe827=_0x3fe827||0xcc;return function(_0x275acf){if(_0x275acf){return _0x25d8e5['sendStatus'](_0x3fe827);}return _0x25d8e5['status'](_0x3fe827)[_0x4288('0x1b')]();};}function respondWithResult(_0x52d80f,_0x3b192c){_0x3b192c=_0x3b192c||0xc8;return function(_0x4ead58){if(_0x4ead58){return _0x52d80f['status'](_0x3b192c)[_0x4288('0x1c')](_0x4ead58);}};}function respondWithFilteredResult(_0x3445ad,_0x3ffa4d){return function(_0x4564c7){if(_0x4564c7){var _0x1e6e43=typeof _0x3ffa4d['offset']===_0x4288('0x1d')&&typeof _0x3ffa4d[_0x4288('0x1e')]===_0x4288('0x1d');var _0x49724a=_0x4564c7[_0x4288('0x1f')];var _0x1a1153=_0x1e6e43?0x0:_0x3ffa4d[_0x4288('0x20')];var _0x59ac3f=_0x1e6e43?_0x4564c7[_0x4288('0x1f')]:_0x3ffa4d[_0x4288('0x20')]+_0x3ffa4d[_0x4288('0x1e')];var _0x2c68e0;if(_0x59ac3f>=_0x49724a){_0x59ac3f=_0x49724a;_0x2c68e0=0xc8;}else{_0x2c68e0=0xce;}_0x3445ad[_0x4288('0x21')](_0x2c68e0);return _0x3445ad[_0x4288('0x22')]('Content-Range',_0x1a1153+'-'+_0x59ac3f+'/'+_0x49724a)[_0x4288('0x1c')](_0x4564c7);}return null;};}function patchUpdates(_0x160b86){return function(_0x473904){try{jsonpatch[_0x4288('0x23')](_0x473904,_0x160b86,!![]);}catch(_0x49d3d6){return BPromise[_0x4288('0x24')](_0x49d3d6);}return _0x473904[_0x4288('0x25')]();};}function saveUpdates(_0x22f339,_0x24091b){return function(_0x2c1162){if(_0x2c1162){return _0x2c1162[_0x4288('0x26')](_0x22f339)[_0x4288('0x27')](function(_0x5e1c4b){return _0x5e1c4b;});}return null;};}function removeEntity(_0x176b61,_0x1e0434){return function(_0x466d25){if(_0x466d25){return _0x466d25[_0x4288('0x28')]()[_0x4288('0x27')](function(){var _0x30ffc3=_0x466d25[_0x4288('0x29')]({'plain':!![]});var _0x51f041=_0x4288('0x2a');return db[_0x4288('0x2b')][_0x4288('0x28')]({'where':{'type':_0x51f041,'resourceId':_0x30ffc3['id']}})[_0x4288('0x27')](function(){return _0x466d25;});})[_0x4288('0x27')](function(){_0x176b61[_0x4288('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x60e6c6,_0x594f6b){return function(_0x5b4e23){if(!_0x5b4e23){_0x60e6c6[_0x4288('0x2c')](0x194);}return _0x5b4e23;};}function handleError(_0x577ad7,_0x6d02f){_0x6d02f=_0x6d02f||0x1f4;return function(_0x344683){logger[_0x4288('0x2d')](_0x344683['stack']);if(_0x344683[_0x4288('0x2e')]){delete _0x344683[_0x4288('0x2e')];}_0x577ad7['status'](_0x6d02f)[_0x4288('0x2f')](_0x344683);};}exports[_0x4288('0x30')]=function(_0xe1ee33,_0x5a0de4){var _0x59f20a={},_0xfdd444={},_0x566bbf={'count':0x0,'rows':[]};var _0xc626be=_[_0x4288('0x31')](db['SmsQueue'][_0x4288('0x32')],function(_0xd636d7){return{'name':_0xd636d7[_0x4288('0x33')],'type':_0xd636d7[_0x4288('0x34')]['key']};});_0xfdd444[_0x4288('0x35')]=_['map'](_0xc626be,_0x4288('0x2e'));_0xfdd444[_0x4288('0x36')]=_[_0x4288('0x37')](_0xe1ee33[_0x4288('0x36')]);_0xfdd444[_0x4288('0x38')]=_[_0x4288('0x39')](_0xfdd444[_0x4288('0x35')],_0xfdd444['query']);_0x59f20a[_0x4288('0x3a')]=_['intersection'](_0xfdd444[_0x4288('0x35')],qs['fields'](_0xe1ee33[_0x4288('0x36')][_0x4288('0x3b')]));_0x59f20a[_0x4288('0x3a')]=_0x59f20a[_0x4288('0x3a')][_0x4288('0x3c')]?_0x59f20a[_0x4288('0x3a')]:_0xfdd444[_0x4288('0x35')];if(!_0xe1ee33['query']['hasOwnProperty']('nolimit')){_0x59f20a['limit']=qs[_0x4288('0x1e')](_0xe1ee33[_0x4288('0x36')]['limit']);_0x59f20a[_0x4288('0x20')]=qs[_0x4288('0x20')](_0xe1ee33[_0x4288('0x36')][_0x4288('0x20')]);}_0x59f20a[_0x4288('0x3d')]=qs[_0x4288('0x3e')](_0xe1ee33[_0x4288('0x36')][_0x4288('0x3e')]);_0x59f20a[_0x4288('0x3f')]=qs[_0x4288('0x38')](_['pick'](_0xe1ee33['query'],_0xfdd444[_0x4288('0x38')]),_0xc626be);if(_0xe1ee33[_0x4288('0x36')][_0x4288('0x40')]){_0x59f20a[_0x4288('0x3f')]=_[_0x4288('0x41')](_0x59f20a[_0x4288('0x3f')],{'$or':_[_0x4288('0x31')](_0xc626be,function(_0x4e6008){if(_0x4e6008[_0x4288('0x34')]!==_0x4288('0x42')){var _0x44cb99={};_0x44cb99[_0x4e6008['name']]={'$like':'%'+_0xe1ee33[_0x4288('0x36')][_0x4288('0x40')]+'%'};return _0x44cb99;}})});}_0x59f20a=_[_0x4288('0x41')]({},_0x59f20a,_0xe1ee33[_0x4288('0x43')]);var _0x498c9f={'where':_0x59f20a[_0x4288('0x3f')]};return db[_0x4288('0x44')][_0x4288('0x1f')](_0x498c9f)['then'](function(_0x39f2ae){_0x566bbf['count']=_0x39f2ae;if(_0xe1ee33[_0x4288('0x36')][_0x4288('0x45')]){_0x59f20a[_0x4288('0x46')]=[{'all':!![]}];}return db[_0x4288('0x44')][_0x4288('0x47')](_0x59f20a);})['then'](function(_0xf79236){_0x566bbf['rows']=_0xf79236;return _0x566bbf;})[_0x4288('0x27')](respondWithFilteredResult(_0x5a0de4,_0x59f20a))['catch'](handleError(_0x5a0de4,null));};exports[_0x4288('0x48')]=function(_0x16db49,_0x118ba6){var _0x238f74={'raw':!![],'where':{'id':_0x16db49['params']['id']}},_0xec4323={};_0xec4323[_0x4288('0x35')]=_[_0x4288('0x37')](db['SmsQueue'][_0x4288('0x32')]);_0xec4323['query']=_[_0x4288('0x37')](_0x16db49[_0x4288('0x36')]);_0xec4323['filters']=_[_0x4288('0x39')](_0xec4323[_0x4288('0x35')],_0xec4323[_0x4288('0x36')]);_0x238f74['attributes']=_[_0x4288('0x39')](_0xec4323[_0x4288('0x35')],qs['fields'](_0x16db49['query'][_0x4288('0x3b')]));_0x238f74['attributes']=_0x238f74['attributes'][_0x4288('0x3c')]?_0x238f74[_0x4288('0x3a')]:_0xec4323[_0x4288('0x35')];if(_0x16db49['query'][_0x4288('0x45')]){_0x238f74[_0x4288('0x46')]=[{'all':!![]}];}_0x238f74=_[_0x4288('0x41')]({},_0x238f74,_0x16db49[_0x4288('0x43')]);return db[_0x4288('0x44')][_0x4288('0x49')](_0x238f74)[_0x4288('0x27')](handleEntityNotFound(_0x118ba6,null))[_0x4288('0x27')](respondWithResult(_0x118ba6,null))[_0x4288('0x4a')](handleError(_0x118ba6,null));};exports['create']=function(_0x23be6e,_0x12f677){return db[_0x4288('0x44')][_0x4288('0x4b')](_0x23be6e[_0x4288('0x4c')],{})[_0x4288('0x27')](function(_0x5c7e8a){var _0x7e7bce=_0x23be6e[_0x4288('0x4d')]['get']({'plain':!![]});if(!_0x7e7bce)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7e7bce[_0x4288('0x4e')]==='user'){var _0xa287c3=_0x5c7e8a[_0x4288('0x29')]({'plain':!![]});var _0x5ad04f=_0x4288('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x5ad04f,'userProfileId':_0x7e7bce[_0x4288('0x4f')]},'raw':!![]})[_0x4288('0x27')](function(_0xa2ae8e){if(_0xa2ae8e&&_0xa2ae8e[_0x4288('0x50')]===0x0){return db[_0x4288('0x2b')][_0x4288('0x4b')]({'name':_0xa287c3[_0x4288('0x2e')],'resourceId':_0xa287c3['id'],'type':_0xa2ae8e[_0x4288('0x2e')],'sectionId':_0xa2ae8e['id']},{})[_0x4288('0x27')](function(){return _0x5c7e8a;});}else{return _0x5c7e8a;}})[_0x4288('0x4a')](function(_0x232ec5){logger[_0x4288('0x2d')](_0x4288('0x51'),_0x232ec5);throw _0x232ec5;});}return _0x5c7e8a;})['then'](respondWithResult(_0x12f677,0xc9))[_0x4288('0x4a')](handleError(_0x12f677,null));};exports[_0x4288('0x26')]=function(_0x3e4144,_0x13ac75){if(_0x3e4144[_0x4288('0x4c')]['id']){delete _0x3e4144[_0x4288('0x4c')]['id'];}return db[_0x4288('0x44')][_0x4288('0x49')]({'where':{'id':_0x3e4144['params']['id']}})[_0x4288('0x27')](handleEntityNotFound(_0x13ac75,null))['then'](saveUpdates(_0x3e4144[_0x4288('0x4c')],null))[_0x4288('0x27')](respondWithResult(_0x13ac75,null))[_0x4288('0x4a')](handleError(_0x13ac75,null));};exports[_0x4288('0x28')]=function(_0x419e93,_0x473da9){return db[_0x4288('0x44')]['find']({'where':{'id':_0x419e93[_0x4288('0x52')]['id']}})[_0x4288('0x27')](handleEntityNotFound(_0x473da9,null))[_0x4288('0x27')](removeEntity(_0x473da9,null))[_0x4288('0x4a')](handleError(_0x473da9,null));};exports['describe']=function(_0x56363f,_0x3923a7){return db['SmsQueue'][_0x4288('0x53')]()[_0x4288('0x27')](respondWithResult(_0x3923a7,null))[_0x4288('0x4a')](handleError(_0x3923a7,null));};exports[_0x4288('0x54')]=function(_0x122e09,_0x25ab93,_0x256fd9){var _0x932b1c={'raw':!![],'where':{}},_0x2a7579={},_0x431b45;return db[_0x4288('0x44')][_0x4288('0x55')]({'where':{'id':_0x122e09[_0x4288('0x52')]['id']}})[_0x4288('0x27')](handleEntityNotFound(_0x25ab93,null))[_0x4288('0x27')](function(_0x2d69d1){if(_0x2d69d1){_0x431b45=_0x2d69d1[_0x4288('0x29')]({'plain':!![]});_0x2a7579[_0x4288('0x35')]=_[_0x4288('0x37')](db[_0x4288('0x56')][_0x4288('0x32')]);_0x2a7579[_0x4288('0x36')]=_[_0x4288('0x37')](_0x122e09[_0x4288('0x36')]);_0x2a7579[_0x4288('0x38')]=_[_0x4288('0x39')](_0x2a7579[_0x4288('0x35')],_0x2a7579[_0x4288('0x36')]);_0x932b1c[_0x4288('0x3a')]=_['intersection'](_0x2a7579[_0x4288('0x35')],qs['fields'](_0x122e09['query'][_0x4288('0x3b')]));_0x932b1c['attributes']=_0x932b1c[_0x4288('0x3a')][_0x4288('0x3c')]?_0x932b1c[_0x4288('0x3a')]:_0x2a7579['model'];if(!_0x122e09[_0x4288('0x36')]['hasOwnProperty'](_0x4288('0x57'))){_0x932b1c[_0x4288('0x1e')]=qs[_0x4288('0x1e')](_0x122e09['query'][_0x4288('0x1e')]);_0x932b1c[_0x4288('0x20')]=qs[_0x4288('0x20')](_0x122e09[_0x4288('0x36')][_0x4288('0x20')]);}_0x932b1c[_0x4288('0x3d')]=qs[_0x4288('0x3e')](_0x122e09[_0x4288('0x36')]['sort']);_0x932b1c['where']=qs[_0x4288('0x38')](_[_0x4288('0x58')](_0x122e09[_0x4288('0x36')],_0x2a7579[_0x4288('0x38')]));_0x932b1c[_0x4288('0x3f')][_0x4288('0x59')]=_0x2d69d1['id'];if(_0x122e09[_0x4288('0x36')][_0x4288('0x40')]){_0x932b1c[_0x4288('0x3f')]=_[_0x4288('0x41')](_0x932b1c[_0x4288('0x3f')],{'$or':_['map'](_0x932b1c[_0x4288('0x3a')],function(_0x40bb73){var _0x49ff41={};_0x49ff41[_0x40bb73]={'$like':'%'+_0x122e09[_0x4288('0x36')][_0x4288('0x40')]+'%'};return _0x49ff41;})});}_0x932b1c=_[_0x4288('0x41')]({},_0x932b1c,_0x122e09[_0x4288('0x43')]);return db[_0x4288('0x56')]['findAll'](_0x932b1c);}})[_0x4288('0x27')](function(_0x57d8ee){if(_0x57d8ee){return db[_0x4288('0x5a')][_0x4288('0x5b')]({'where':{'id':_[_0x4288('0x31')](_0x57d8ee,_0x4288('0x5c')),'role':_0x4288('0x5d')},'attributes':['id','name',_0x4288('0x5e'),_0x4288('0x5f'),_0x4288('0x60')]});}})[_0x4288('0x27')](function(_0x5f5a67){if(_0x5f5a67){return{'count':_0x5f5a67['count'],'rows':_[_0x4288('0x31')](_0x5f5a67[_0x4288('0x61')],function(_0x35daf2){return{'membername':_0x35daf2[_0x4288('0x2e')],'UserId':_0x35daf2['id'],'queue_name':_0x431b45['name'],'SmsQueueId':_0x431b45['id'],'interface':util[_0x4288('0x62')](_0x4288('0x63'),'SIP',_0x35daf2[_0x4288('0x2e')]),'penalty':0x0,'paused':_0x35daf2[_0x4288('0x5e')],'createdAt':_0x35daf2['createdAt'],'updatedAt':_0x35daf2[_0x4288('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x25ab93,_0x932b1c))[_0x4288('0x4a')](handleError(_0x25ab93,null));};exports[_0x4288('0x64')]=function(_0x5e6b21,_0x56cbb0,_0x1fef76){var _0x171269={};var _0xd0bb73={};var _0xdb1427;var _0x37a6fe;return db[_0x4288('0x44')][_0x4288('0x55')]({'where':{'id':_0x5e6b21[_0x4288('0x52')]['id']}})[_0x4288('0x27')](handleEntityNotFound(_0x56cbb0,null))['then'](function(_0x1a9164){if(_0x1a9164){_0xdb1427=_0x1a9164;_0xd0bb73[_0x4288('0x35')]=_[_0x4288('0x37')](db[_0x4288('0x65')][_0x4288('0x32')]);_0xd0bb73[_0x4288('0x36')]=_[_0x4288('0x37')](_0x5e6b21[_0x4288('0x36')]);_0xd0bb73[_0x4288('0x38')]=_[_0x4288('0x39')](_0xd0bb73[_0x4288('0x35')],_0xd0bb73[_0x4288('0x36')]);_0x171269[_0x4288('0x3a')]=_['intersection'](_0xd0bb73['model'],qs[_0x4288('0x3b')](_0x5e6b21[_0x4288('0x36')][_0x4288('0x3b')]));_0x171269[_0x4288('0x3a')]=_0x171269['attributes'][_0x4288('0x3c')]?_0x171269[_0x4288('0x3a')]:_0xd0bb73[_0x4288('0x35')];_0x171269[_0x4288('0x3d')]=qs['sort'](_0x5e6b21[_0x4288('0x36')][_0x4288('0x3e')]);_0x171269[_0x4288('0x3f')]=qs['filters'](_[_0x4288('0x58')](_0x5e6b21[_0x4288('0x36')],_0xd0bb73[_0x4288('0x38')]));if(_0x5e6b21[_0x4288('0x36')]['filter']){_0x171269[_0x4288('0x3f')]=_['merge'](_0x171269[_0x4288('0x3f')],{'$or':_[_0x4288('0x31')](_0x171269[_0x4288('0x3a')],function(_0x2f2ec9){var _0xed88a7={};_0xed88a7[_0x2f2ec9]={'$like':'%'+_0x5e6b21[_0x4288('0x36')][_0x4288('0x40')]+'%'};return _0xed88a7;})});}_0x171269=_[_0x4288('0x41')]({},_0x171269,_0x5e6b21[_0x4288('0x43')]);return _0xdb1427[_0x4288('0x64')](_0x171269);}})['then'](function(_0x58cde0){if(_0x58cde0){_0x37a6fe=_0x58cde0[_0x4288('0x3c')];if(!_0x5e6b21[_0x4288('0x36')][_0x4288('0x66')]('nolimit')){_0x171269[_0x4288('0x1e')]=qs[_0x4288('0x1e')](_0x5e6b21[_0x4288('0x36')][_0x4288('0x1e')]);_0x171269['offset']=qs[_0x4288('0x20')](_0x5e6b21[_0x4288('0x36')][_0x4288('0x20')]);}return _0xdb1427[_0x4288('0x64')](_0x171269);}})[_0x4288('0x27')](function(_0x41b507){if(_0x41b507){return _0x41b507?{'count':_0x37a6fe,'rows':_0x41b507}:null;}})['then'](respondWithResult(_0x56cbb0,null))[_0x4288('0x4a')](handleError(_0x56cbb0,null));};exports['addTeams']=function(_0x387480,_0x419cac,_0x301214){var _0x385558=_0x387480[_0x4288('0x4c')][_0x4288('0x67')];return db[_0x4288('0x65')][_0x4288('0x47')]({'where':{'id':_0x385558},'attributes':['id'],'include':[{'model':db[_0x4288('0x5a')],'as':_0x4288('0x68'),'attributes':['id',_0x4288('0x2e'),_0x4288('0x69'),_0x4288('0x6a'),_0x4288('0x6b')],'raw':!![]}]})['then'](function(_0xd6a3a1){if(_0xd6a3a1){var _0x505bc6=_[_0x4288('0x6c')](_0xd6a3a1,function(_0xaac934){var _0xa5e3bc=_0xaac934['get']({'plain':!![]});return _0xa5e3bc[_0x4288('0x68')];});return db[_0x4288('0x44')]['find']({'where':{'id':_0x387480[_0x4288('0x52')]['id']}})[_0x4288('0x27')](function(_0x140d8e){return db[_0x4288('0x6d')][_0x4288('0x6e')](function(_0x2f9ddf){return _0x140d8e['addTeams'](_0x385558,{'transaction':_0x2f9ddf})[_0x4288('0x27')](function(){return BPromise[_0x4288('0x6f')](_0x505bc6,function(_0xd581f){return db[_0x4288('0x56')][_0x4288('0x70')]({'where':{'UserId':_0xd581f['id'],'SmsQueueId':_0x387480['params']['id']},'transaction':_0x2f9ddf});});})['then'](function(){_0x505bc6[_0x4288('0x71')](function(_0x13413e){socket[_0x4288('0x72')]('userSmsQueue:save',{'UserId':_0x13413e['id'],'SmsQueueId':_0x140d8e['id']});});});});});}})[_0x4288('0x27')](respondWithStatusCode(_0x419cac,null))[_0x4288('0x4a')](handleError(_0x419cac,null));};exports[_0x4288('0x73')]=function(_0x7a289c,_0x1557fa,_0x54c42b){return db['Team'][_0x4288('0x47')]({'where':{'id':_0x7a289c['query'][_0x4288('0x67')]},'attributes':['id'],'include':[{'model':db[_0x4288('0x5a')],'as':_0x4288('0x68'),'attributes':['id'],'raw':!![]}]})[_0x4288('0x27')](handleEntityNotFound(_0x1557fa,null))[_0x4288('0x27')](function(_0x4963a6){var _0x342cef=_['map'](_0x4963a6,'id');var _0x19cd2d=[];var _0x59eb82=[];var _0x351e24=squel[_0x4288('0x74')]();_0x351e24[_0x4288('0x75')](_0x4288('0x76'))['from'](_0x4288('0x77'),'tq')[_0x4288('0x78')](_0x4288('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x4288('0x3f')](_0x4288('0x7a'),_0x7a289c[_0x4288('0x52')]['id']);for(var _0x53074f=0x0;_0x53074f<_0x4963a6['length'];_0x53074f+=0x1){let _0x24d8a8=_0x4963a6[_0x53074f];for(var _0x3821b5=0x0;_0x3821b5<_0x24d8a8[_0x4288('0x68')]['length'];_0x3821b5+=0x1){let _0x54eed1=_0x24d8a8[_0x4288('0x68')][_0x3821b5];var _0x4abe69=_0x351e24[_0x4288('0x7b')]();_0x4abe69[_0x4288('0x3f')]('ut.UserId\x20=\x20?',_0x54eed1['id']);_0x59eb82[_0x4288('0x7c')](db[_0x4288('0x6d')][_0x4288('0x36')](_0x4abe69[_0x4288('0x7d')](),{'type':db[_0x4288('0x6d')]['QueryTypes'][_0x4288('0x7e')]})[_0x4288('0x27')](function(_0x37d03e){if(_0x37d03e[_0x4288('0x3c')]===0x1){return _0x54eed1['id'];}else{var _0x42bd8a=_['every'](_[_0x4288('0x31')](_0x37d03e,_0x4288('0x7f')),function(_0x2602f2){return _[_0x4288('0x80')](_0x342cef,_0x2602f2);});if(_0x42bd8a){return _0x54eed1['id'];}}}));}}return BPromise[_0x4288('0x81')](_0x59eb82)['then'](function(_0x5038af){_0x19cd2d=_(_0x19cd2d)[_0x4288('0x82')](_0x5038af)[_0x4288('0x83')]()[_0x4288('0x84')]();return db[_0x4288('0x44')][_0x4288('0x49')]({'where':{'id':_0x7a289c[_0x4288('0x52')]['id']}})[_0x4288('0x27')](function(_0xb34932){return db[_0x4288('0x6d')][_0x4288('0x6e')](function(_0x4d0dfb){return _0xb34932[_0x4288('0x73')](_0x7a289c[_0x4288('0x36')][_0x4288('0x67')],{'transaction':_0x4d0dfb})[_0x4288('0x27')](function(){if(!_[_0x4288('0x85')](_0x19cd2d)){return _0xb34932['removeAgents'](_0x19cd2d,{'transaction':_0x4d0dfb});}})[_0x4288('0x27')](function(){_0x19cd2d[_0x4288('0x71')](function(_0x5c8d0b){socket[_0x4288('0x72')](_0x4288('0x86'),{'UserId':_0x5c8d0b,'SmsQueueId':_0xb34932['id']});});});});});});})[_0x4288('0x27')](respondWithStatusCode(_0x1557fa,null))[_0x4288('0x4a')](handleError(_0x1557fa,null));};exports[_0x4288('0x87')]=function(_0x3aacdc,_0x2e63a5,_0x10bff5){return db[_0x4288('0x44')][_0x4288('0x49')]({'where':{'id':_0x3aacdc['params']['id']}})[_0x4288('0x27')](handleEntityNotFound(_0x2e63a5,null))[_0x4288('0x27')](function(_0x1749a9){if(_0x1749a9){return _0x1749a9[_0x4288('0x87')](_0x3aacdc['body'][_0x4288('0x67')],_['omit'](_0x3aacdc[_0x4288('0x4c')],[_0x4288('0x67'),'id'])||{})[_0x4288('0x88')](function(_0x322a86){for(var _0xd8287d=0x0;_0xd8287d<_0x3aacdc[_0x4288('0x4c')]['ids'][_0x4288('0x3c')];_0xd8287d+=0x1){socket[_0x4288('0x72')]('userSmsQueue:save',{'UserId':Number(_0x3aacdc[_0x4288('0x4c')][_0x4288('0x67')][_0xd8287d]),'SmsQueueId':Number(_0x3aacdc[_0x4288('0x52')]['id'])});}return _0x322a86;});}})[_0x4288('0x27')](respondWithResult(_0x2e63a5,null))[_0x4288('0x4a')](handleError(_0x2e63a5,null));};exports['removeAgents']=function(_0x2d03e3,_0x536582,_0x24f0de){return db[_0x4288('0x44')]['find']({'where':{'id':_0x2d03e3[_0x4288('0x52')]['id']}})[_0x4288('0x27')](handleEntityNotFound(_0x536582,null))[_0x4288('0x27')](function(_0x5a218a){if(_0x5a218a){return _0x5a218a[_0x4288('0x89')](_0x2d03e3[_0x4288('0x36')][_0x4288('0x67')])['then'](function(){if(_[_0x4288('0x8a')](_0x2d03e3[_0x4288('0x36')][_0x4288('0x67')])){for(var _0x137610=0x0;_0x137610<_0x2d03e3[_0x4288('0x36')][_0x4288('0x67')][_0x4288('0x3c')];_0x137610+=0x1){socket[_0x4288('0x72')]('userSmsQueue:remove',{'UserId':Number(_0x2d03e3[_0x4288('0x36')][_0x4288('0x67')][_0x137610]),'SmsQueueId':Number(_0x2d03e3[_0x4288('0x52')]['id'])});}}else{socket[_0x4288('0x72')](_0x4288('0x86'),{'UserId':Number(_0x2d03e3[_0x4288('0x36')][_0x4288('0x67')]),'SmsQueueId':Number(_0x2d03e3[_0x4288('0x52')]['id'])});}});}})[_0x4288('0x27')](respondWithStatusCode(_0x536582,null))[_0x4288('0x4a')](handleError(_0x536582,null));};exports[_0x4288('0x8b')]=function(_0x5a7d5b,_0x5babbf,_0x12727e){var _0x401ad0={};var _0x19f364={};var _0x55f018;var _0x246f9b;return db[_0x4288('0x44')][_0x4288('0x55')]({'where':{'id':_0x5a7d5b[_0x4288('0x52')]['id']}})[_0x4288('0x27')](handleEntityNotFound(_0x5babbf,null))[_0x4288('0x27')](function(_0x43c8ae){if(_0x43c8ae){_0x55f018=_0x43c8ae;_0x19f364[_0x4288('0x35')]=_[_0x4288('0x37')](db[_0x4288('0x5a')]['rawAttributes']);_0x19f364[_0x4288('0x36')]=_[_0x4288('0x37')](_0x5a7d5b['query']);_0x19f364[_0x4288('0x38')]=_[_0x4288('0x39')](_0x19f364[_0x4288('0x35')],_0x19f364[_0x4288('0x36')]);_0x401ad0[_0x4288('0x3a')]=_['intersection'](_0x19f364[_0x4288('0x35')],qs[_0x4288('0x3b')](_0x5a7d5b['query'][_0x4288('0x3b')]));_0x401ad0[_0x4288('0x3a')]=_0x401ad0[_0x4288('0x3a')][_0x4288('0x3c')]?_0x401ad0[_0x4288('0x3a')]:_0x19f364['model'];_0x401ad0[_0x4288('0x3d')]=qs['sort'](_0x5a7d5b[_0x4288('0x36')][_0x4288('0x3e')]);_0x401ad0[_0x4288('0x3f')]=qs[_0x4288('0x38')](_['pick'](_0x5a7d5b[_0x4288('0x36')],_0x19f364[_0x4288('0x38')]));if(_0x5a7d5b[_0x4288('0x36')][_0x4288('0x40')]){_0x401ad0[_0x4288('0x3f')]=_[_0x4288('0x41')](_0x401ad0['where'],{'$or':_[_0x4288('0x31')](_0x401ad0['attributes'],function(_0x10decf){var _0x19dae6={};_0x19dae6[_0x10decf]={'$like':'%'+_0x5a7d5b[_0x4288('0x36')][_0x4288('0x40')]+'%'};return _0x19dae6;})});}_0x401ad0=_['merge']({},_0x401ad0,_0x5a7d5b[_0x4288('0x43')]);return _0x55f018[_0x4288('0x8b')](_0x401ad0);}})[_0x4288('0x27')](function(_0x5192d1){if(_0x5192d1){_0x246f9b=_0x5192d1[_0x4288('0x3c')];if(!_0x5a7d5b[_0x4288('0x36')][_0x4288('0x66')](_0x4288('0x57'))){_0x401ad0[_0x4288('0x1e')]=qs[_0x4288('0x1e')](_0x5a7d5b['query'][_0x4288('0x1e')]);_0x401ad0[_0x4288('0x20')]=qs[_0x4288('0x20')](_0x5a7d5b[_0x4288('0x36')][_0x4288('0x20')]);}return _0x55f018[_0x4288('0x8b')](_0x401ad0);}})[_0x4288('0x27')](function(_0x469692){if(_0x469692){return _0x469692?{'count':_0x246f9b,'rows':_0x469692}:null;}})[_0x4288('0x27')](respondWithResult(_0x5babbf,null))[_0x4288('0x4a')](handleError(_0x5babbf,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index e970302..e4da7a4 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 _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 +var _0x3d35=['hook','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit'];(function(_0x1dac7a,_0x1828ce){var _0x4cb363=function(_0x80f6de){while(--_0x80f6de){_0x1dac7a['push'](_0x1dac7a['shift']());}};_0x4cb363(++_0x1828ce);}(_0x3d35,0x17b));var _0x53d3=function(_0x17a28b,_0x5d1465){_0x17a28b=_0x17a28b-0x0;var _0x9cbb5a=_0x3d35[_0x17a28b];return _0x9cbb5a;};'use strict';var EventEmitter=require(_0x53d3('0x0'));var SmsQueue=require(_0x53d3('0x1'))['db'][_0x53d3('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x53d3('0x3')](0x0);var events={'afterCreate':_0x53d3('0x4'),'afterUpdate':_0x53d3('0x5'),'afterDestroy':_0x53d3('0x6')};function emitEvent(_0x2de5f2){return function(_0x5f4e78,_0x573f88,_0xbca937){SmsQueueEvents['emit'](_0x2de5f2+':'+_0x5f4e78['id'],_0x5f4e78);SmsQueueEvents[_0x53d3('0x7')](_0x2de5f2,_0x5f4e78);_0xbca937(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x53d3('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 683ca67..7d3e8a1 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 _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 +var _0x9c21=['moment','bluebird','request-promise','path','exports','define','SmsQueue','sms_queues','../../config/logger','api'];(function(_0x4f8d61,_0x29eff0){var _0x3bc078=function(_0x4c7203){while(--_0x4c7203){_0x4f8d61['push'](_0x4f8d61['shift']());}};_0x3bc078(++_0x29eff0);}(_0x9c21,0xee));var _0x19c2=function(_0x21c799,_0x174965){_0x21c799=_0x21c799-0x0;var _0x1c50a0=_0x9c21[_0x21c799];return _0x1c50a0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x19c2('0x0'))(_0x19c2('0x1'));var moment=require(_0x19c2('0x2'));var BPromise=require(_0x19c2('0x3'));var rp=require(_0x19c2('0x4'));var fs=require('fs');var path=require(_0x19c2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0x19c2('0x6')]=function(_0x448226,_0x1965c5){return _0x448226[_0x19c2('0x7')](_0x19c2('0x8'),attributes,{'tableName':_0x19c2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index e937f0c..f3e771b 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 _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 +var _0xc595=['ShowSmsQueue','SmsQueue','find','where','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetSmsQueue','options','raw','attributes','limit','include','map','model'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xc595,0x9c));var _0x5c59=function(_0x4b564f,_0x33648d){_0x4b564f=_0x4b564f-0x0;var _0x586821=_0xc595[_0x4b564f];return _0x586821;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5c59('0x0'));var BPromise=require(_0x5c59('0x1'));var rs=require(_0x5c59('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c59('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5c59('0x4'))('rpc');var config=require(_0x5c59('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x5c59('0x6')][_0x5c59('0x7')]({'port':0x232a});config[_0x5c59('0x8')]=_[_0x5c59('0x9')](config['redis'],{'host':_0x5c59('0xa'),'port':0x18eb});var socket=require(_0x5c59('0xb'))(new Redis(config['redis']));require(_0x5c59('0xc'))[_0x5c59('0xd')](socket);function respondWithRpcPromise(_0x3d0c2d,_0x29c69d,_0x166bd1){return new BPromise(function(_0x3a75f4,_0x393cf0){return client[_0x5c59('0xe')](_0x3d0c2d,_0x166bd1)[_0x5c59('0xf')](function(_0x1e8888){logger['info'](_0x5c59('0x10'),_0x29c69d,_0x5c59('0x11'));logger[_0x5c59('0x12')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x29c69d,_0x5c59('0x11'),JSON[_0x5c59('0x13')](_0x1e8888));if(_0x1e8888[_0x5c59('0x14')]){if(_0x1e8888[_0x5c59('0x14')][_0x5c59('0x15')]===0x1f4){logger[_0x5c59('0x14')](_0x5c59('0x10'),_0x29c69d,_0x1e8888[_0x5c59('0x14')][_0x5c59('0x16')]);return _0x393cf0(_0x1e8888[_0x5c59('0x14')][_0x5c59('0x16')]);}logger[_0x5c59('0x14')]('SmsQueue,\x20%s,\x20%s',_0x29c69d,_0x1e8888[_0x5c59('0x14')]['message']);return _0x3a75f4(_0x1e8888[_0x5c59('0x14')][_0x5c59('0x16')]);}else{logger[_0x5c59('0x17')](_0x5c59('0x10'),_0x29c69d,'request\x20sent');_0x3a75f4(_0x1e8888[_0x5c59('0x18')][_0x5c59('0x16')]);}})[_0x5c59('0x19')](function(_0x1825f0){logger[_0x5c59('0x14')]('SmsQueue,\x20%s,\x20%s',_0x29c69d,_0x1825f0);_0x393cf0(_0x1825f0);});});}exports[_0x5c59('0x1a')]=function(_0x578528){var _0x1979fc=this;return new Promise(function(_0x4ac658,_0xf239aa){return db['SmsQueue']['findAll']({'raw':_0x578528[_0x5c59('0x1b')]?_0x578528['options'][_0x5c59('0x1c')]===undefined?!![]:![]:!![],'where':_0x578528[_0x5c59('0x1b')]?_0x578528[_0x5c59('0x1b')]['where']||null:null,'attributes':_0x578528[_0x5c59('0x1b')]?_0x578528[_0x5c59('0x1b')][_0x5c59('0x1d')]||null:null,'limit':_0x578528[_0x5c59('0x1b')]?_0x578528[_0x5c59('0x1b')][_0x5c59('0x1e')]||null:null,'include':_0x578528[_0x5c59('0x1b')]?_0x578528[_0x5c59('0x1b')][_0x5c59('0x1f')]?_[_0x5c59('0x20')](_0x578528[_0x5c59('0x1b')][_0x5c59('0x1f')],function(_0x1e2177){return{'model':db[_0x1e2177[_0x5c59('0x21')]],'as':_0x1e2177['as'],'attributes':_0x1e2177[_0x5c59('0x1d')],'include':_0x1e2177[_0x5c59('0x1f')]?_[_0x5c59('0x20')](_0x1e2177[_0x5c59('0x1f')],function(_0x36f4c5){return{'model':db[_0x36f4c5[_0x5c59('0x21')]],'as':_0x36f4c5['as'],'attributes':_0x36f4c5[_0x5c59('0x1d')],'include':_0x36f4c5[_0x5c59('0x1f')]?_[_0x5c59('0x20')](_0x36f4c5[_0x5c59('0x1f')],function(_0x53d9a6){return{'model':db[_0x53d9a6['model']],'as':_0x53d9a6['as'],'attributes':_0x53d9a6[_0x5c59('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xff5880){logger[_0x5c59('0x17')](_0x5c59('0x1a'),_0x578528);logger[_0x5c59('0x12')](_0x5c59('0x1a'),_0x578528,JSON[_0x5c59('0x13')](_0xff5880));_0x4ac658(_0xff5880);})['catch'](function(_0x3e67c7){logger[_0x5c59('0x14')](_0x5c59('0x1a'),_0x3e67c7[_0x5c59('0x16')],_0x578528);_0xf239aa(_0x1979fc['error'](0x1f4,_0x3e67c7['message']));});});};exports[_0x5c59('0x22')]=function(_0x88695c){var _0x2bc33f=this;return new Promise(function(_0x434ae2,_0x425936){return db[_0x5c59('0x23')][_0x5c59('0x24')]({'raw':_0x88695c[_0x5c59('0x1b')]?_0x88695c[_0x5c59('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x88695c['options']?_0x88695c[_0x5c59('0x1b')][_0x5c59('0x25')]||null:null,'attributes':_0x88695c[_0x5c59('0x1b')]?_0x88695c[_0x5c59('0x1b')]['attributes']||null:null,'include':_0x88695c['options']?_0x88695c[_0x5c59('0x1b')][_0x5c59('0x1f')]?_['map'](_0x88695c['options'][_0x5c59('0x1f')],function(_0x3dc3c8){return{'model':db[_0x3dc3c8[_0x5c59('0x21')]],'as':_0x3dc3c8['as'],'attributes':_0x3dc3c8['attributes'],'include':_0x3dc3c8['include']?_[_0x5c59('0x20')](_0x3dc3c8[_0x5c59('0x1f')],function(_0x4d9f1d){return{'model':db[_0x4d9f1d['model']],'as':_0x4d9f1d['as'],'attributes':_0x4d9f1d[_0x5c59('0x1d')],'include':_0x4d9f1d['include']?_['map'](_0x4d9f1d['include'],function(_0xe26b32){return{'model':db[_0xe26b32[_0x5c59('0x21')]],'as':_0xe26b32['as'],'attributes':_0xe26b32[_0x5c59('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b852c){logger[_0x5c59('0x17')](_0x5c59('0x22'),_0x88695c);logger[_0x5c59('0x12')](_0x5c59('0x22'),_0x88695c,JSON['stringify'](_0x3b852c));_0x434ae2(_0x3b852c);})[_0x5c59('0x19')](function(_0x4b03e1){logger[_0x5c59('0x14')]('ShowSmsQueue',_0x4b03e1['message'],_0x88695c);_0x425936(_0x2bc33f[_0x5c59('0x14')](0x1f4,_0x4b03e1['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 3e50fb8..0078545 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 _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 +var _0xc829=['update','emit','register','length','smsQueue:','./smsQueue.events','save','remove'];(function(_0x591d21,_0xca2016){var _0x2dd074=function(_0x445cba){while(--_0x445cba){_0x591d21['push'](_0x591d21['shift']());}};_0x2dd074(++_0xca2016);}(_0xc829,0x10d));var _0x9c82=function(_0x3c0318,_0x32d5af){_0x3c0318=_0x3c0318-0x0;var _0x193e74=_0xc829[_0x3c0318];return _0x193e74;};'use strict';var SmsQueueEvents=require(_0x9c82('0x0'));var events=[_0x9c82('0x1'),_0x9c82('0x2'),_0x9c82('0x3')];function createListener(_0x38a9c5,_0x48a0be){return function(_0x549e4c){_0x48a0be[_0x9c82('0x4')](_0x38a9c5,_0x549e4c);};}function removeListener(_0x582b6a,_0x44e7b0){return function(){SmsQueueEvents['removeListener'](_0x582b6a,_0x44e7b0);};}exports[_0x9c82('0x5')]=function(_0x6eeba4){for(var _0x2717b8=0x0,_0x594ef3=events[_0x9c82('0x6')];_0x2717b8<_0x594ef3;_0x2717b8++){var _0x28dd63=events[_0x2717b8];var _0x494a84=createListener(_0x9c82('0x7')+_0x28dd63,_0x6eeba4);SmsQueueEvents['on'](_0x28dd63,_0x494a84);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index d14b9db..aa1de05 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 _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 +var _0x2a56=['../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','util','connect-timeout','express','Router','fs-extra'];(function(_0x38dcfd,_0x527ade){var _0x25c1b7=function(_0x3a581e){while(--_0x3a581e){_0x38dcfd['push'](_0x38dcfd['shift']());}};_0x25c1b7(++_0x527ade);}(_0x2a56,0xaf));var _0x62a5=function(_0x4ed92d,_0x506288){_0x4ed92d=_0x4ed92d-0x0;var _0x1550f6=_0x2a56[_0x4ed92d];return _0x1550f6;};'use strict';var multer=require('multer');var util=require(_0x62a5('0x0'));var path=require('path');var timeout=require(_0x62a5('0x1'));var express=require(_0x62a5('0x2'));var router=express[_0x62a5('0x3')]();var fs_extra=require(_0x62a5('0x4'));var auth=require(_0x62a5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x62a5('0x6'));var controller=require(_0x62a5('0x7'));router[_0x62a5('0x8')]('/',auth[_0x62a5('0x9')](),controller[_0x62a5('0xa')]);router[_0x62a5('0x8')](_0x62a5('0xb'),auth[_0x62a5('0x9')](),controller['describe']);router[_0x62a5('0x8')](_0x62a5('0xc'),auth[_0x62a5('0x9')](),controller[_0x62a5('0xd')]);router[_0x62a5('0xe')]('/',auth['isAuthenticated'](),controller[_0x62a5('0xf')]);router[_0x62a5('0x10')](_0x62a5('0xc'),auth[_0x62a5('0x9')](),controller[_0x62a5('0x11')]);router[_0x62a5('0x12')](_0x62a5('0xc'),auth[_0x62a5('0x9')](),controller[_0x62a5('0x13')]);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 3d19b8c..f273073 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 _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 +var _0x6d4d=['DATE','STRING','moment','exports'];(function(_0x197683,_0x21df72){var _0x137639=function(_0x46b902){while(--_0x46b902){_0x197683['push'](_0x197683['shift']());}};_0x137639(++_0x21df72);}(_0x6d4d,0x86));var _0xd6d4=function(_0x405778,_0xa4dd3b){_0x405778=_0x405778-0x0;var _0x341735=_0x6d4d[_0x405778];return _0x341735;};'use strict';var moment=require(_0xd6d4('0x0'));var Sequelize=require('sequelize');module[_0xd6d4('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xd6d4('0x2')]},'exitAt':{'type':Sequelize[_0xd6d4('0x2')]},'reason':{'type':Sequelize[_0xd6d4('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 06d0472..a7c8039 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 _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 +var _0xb126=['count','set','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','merge','find','create','update','body','describe','eml-format','rimraf','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit'];(function(_0x420513,_0x30eae3){var _0x1b44ec=function(_0x644f88){while(--_0x644f88){_0x420513['push'](_0x420513['shift']());}};_0x1b44ec(++_0x30eae3);}(_0xb126,0x105));var _0x6b12=function(_0x321876,_0x3c61bb){_0x321876=_0x321876-0x0;var _0x337c75=_0xb126[_0x321876];return _0x337c75;};'use strict';var emlformat=require(_0x6b12('0x0'));var rimraf=require(_0x6b12('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b12('0x2'));var moment=require(_0x6b12('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6b12('0x4'));var util=require(_0x6b12('0x5'));var path=require('path');var sox=require(_0x6b12('0x6'));var csv=require('to-csv');var ejs=require(_0x6b12('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6b12('0x8'));var squel=require(_0x6b12('0x9'));var crypto=require(_0x6b12('0xa'));var jsforce=require(_0x6b12('0xb'));var deskjs=require(_0x6b12('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6b12('0xd'));var authService=require(_0x6b12('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6b12('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b12('0x10'))(_0x6b12('0x11'));var utils=require(_0x6b12('0x12'));var config=require(_0x6b12('0x13'));var licenseUtil=require(_0x6b12('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x387398,_0x4336e3){_0x4336e3=_0x4336e3||0xcc;return function(_0x4dfa09){if(_0x4dfa09){return _0x387398[_0x6b12('0x15')](_0x4336e3);}return _0x387398['status'](_0x4336e3)[_0x6b12('0x16')]();};}function respondWithResult(_0x549aa8,_0x5ee334){_0x5ee334=_0x5ee334||0xc8;return function(_0x4afbcd){if(_0x4afbcd){return _0x549aa8[_0x6b12('0x17')](_0x5ee334)['json'](_0x4afbcd);}};}function respondWithFilteredResult(_0x398310,_0x2ece69){return function(_0x23e439){if(_0x23e439){var _0x45bc4a=typeof _0x2ece69[_0x6b12('0x18')]===_0x6b12('0x19')&&typeof _0x2ece69[_0x6b12('0x1a')]===_0x6b12('0x19');var _0x4878ba=_0x23e439[_0x6b12('0x1b')];var _0x5f5573=_0x45bc4a?0x0:_0x2ece69[_0x6b12('0x18')];var _0x55f7c9=_0x45bc4a?_0x23e439[_0x6b12('0x1b')]:_0x2ece69[_0x6b12('0x18')]+_0x2ece69['limit'];var _0x29f027;if(_0x55f7c9>=_0x4878ba){_0x55f7c9=_0x4878ba;_0x29f027=0xc8;}else{_0x29f027=0xce;}_0x398310[_0x6b12('0x17')](_0x29f027);return _0x398310[_0x6b12('0x1c')](_0x6b12('0x1d'),_0x5f5573+'-'+_0x55f7c9+'/'+_0x4878ba)['json'](_0x23e439);}return null;};}function patchUpdates(_0x509421){return function(_0x4d9cb7){try{jsonpatch[_0x6b12('0x1e')](_0x4d9cb7,_0x509421,!![]);}catch(_0x2342b5){return BPromise[_0x6b12('0x1f')](_0x2342b5);}return _0x4d9cb7['save']();};}function saveUpdates(_0x127053,_0x494233){return function(_0x2e6424){if(_0x2e6424){return _0x2e6424['update'](_0x127053)['then'](function(_0x1e4d05){return _0x1e4d05;});}return null;};}function removeEntity(_0x30ff25,_0x5aa570){return function(_0xbd7147){if(_0xbd7147){return _0xbd7147[_0x6b12('0x20')]()[_0x6b12('0x21')](function(){_0x30ff25['status'](0xcc)[_0x6b12('0x16')]();});}};}function handleEntityNotFound(_0x1f893c,_0x344033){return function(_0x30a593){if(!_0x30a593){_0x1f893c[_0x6b12('0x15')](0x194);}return _0x30a593;};}function handleError(_0x356c35,_0x2c08f4){_0x2c08f4=_0x2c08f4||0x1f4;return function(_0x585600){logger[_0x6b12('0x22')](_0x585600[_0x6b12('0x23')]);if(_0x585600['name']){delete _0x585600[_0x6b12('0x24')];}_0x356c35[_0x6b12('0x17')](_0x2c08f4)[_0x6b12('0x25')](_0x585600);};}exports[_0x6b12('0x26')]=function(_0x25d5a3,_0x1829b9){var _0x5be5d4={},_0x48ec90={},_0x406e47={'count':0x0,'rows':[]};var _0x2385cc=_[_0x6b12('0x27')](db[_0x6b12('0x28')][_0x6b12('0x29')],function(_0xcd3f6e){return{'name':_0xcd3f6e[_0x6b12('0x2a')],'type':_0xcd3f6e[_0x6b12('0x2b')][_0x6b12('0x2c')]};});_0x48ec90[_0x6b12('0x2d')]=_[_0x6b12('0x27')](_0x2385cc,_0x6b12('0x24'));_0x48ec90[_0x6b12('0x2e')]=_['keys'](_0x25d5a3[_0x6b12('0x2e')]);_0x48ec90['filters']=_[_0x6b12('0x2f')](_0x48ec90[_0x6b12('0x2d')],_0x48ec90[_0x6b12('0x2e')]);_0x5be5d4[_0x6b12('0x30')]=_[_0x6b12('0x2f')](_0x48ec90[_0x6b12('0x2d')],qs['fields'](_0x25d5a3[_0x6b12('0x2e')][_0x6b12('0x31')]));_0x5be5d4['attributes']=_0x5be5d4[_0x6b12('0x30')]['length']?_0x5be5d4[_0x6b12('0x30')]:_0x48ec90[_0x6b12('0x2d')];if(!_0x25d5a3[_0x6b12('0x2e')][_0x6b12('0x32')](_0x6b12('0x33'))){_0x5be5d4[_0x6b12('0x1a')]=qs[_0x6b12('0x1a')](_0x25d5a3[_0x6b12('0x2e')][_0x6b12('0x1a')]);_0x5be5d4[_0x6b12('0x18')]=qs['offset'](_0x25d5a3[_0x6b12('0x2e')][_0x6b12('0x18')]);}_0x5be5d4['order']=qs[_0x6b12('0x34')](_0x25d5a3['query'][_0x6b12('0x34')]);_0x5be5d4[_0x6b12('0x35')]=qs['filters'](_[_0x6b12('0x36')](_0x25d5a3[_0x6b12('0x2e')],_0x48ec90[_0x6b12('0x37')]),_0x2385cc);if(_0x25d5a3[_0x6b12('0x2e')][_0x6b12('0x38')]){_0x5be5d4[_0x6b12('0x35')]=_['merge'](_0x5be5d4['where'],{'$or':_[_0x6b12('0x27')](_0x2385cc,function(_0x229558){if(_0x229558['type']!==_0x6b12('0x39')){var _0x275a50={};_0x275a50[_0x229558[_0x6b12('0x24')]]={'$like':'%'+_0x25d5a3[_0x6b12('0x2e')][_0x6b12('0x38')]+'%'};return _0x275a50;}})});}_0x5be5d4=_['merge']({},_0x5be5d4,_0x25d5a3[_0x6b12('0x3a')]);var _0x21524d={'where':_0x5be5d4['where']};return db[_0x6b12('0x28')][_0x6b12('0x1b')](_0x21524d)[_0x6b12('0x21')](function(_0x47a217){_0x406e47[_0x6b12('0x1b')]=_0x47a217;if(_0x25d5a3[_0x6b12('0x2e')][_0x6b12('0x3b')]){_0x5be5d4[_0x6b12('0x3c')]=[{'all':!![]}];}return db[_0x6b12('0x28')]['findAll'](_0x5be5d4);})[_0x6b12('0x21')](function(_0x5e56f2){_0x406e47[_0x6b12('0x3d')]=_0x5e56f2;return _0x406e47;})[_0x6b12('0x21')](respondWithFilteredResult(_0x1829b9,_0x5be5d4))[_0x6b12('0x3e')](handleError(_0x1829b9,null));};exports[_0x6b12('0x3f')]=function(_0x5dca1b,_0x31f737){var _0x1c96c8={'raw':!![],'where':{'id':_0x5dca1b[_0x6b12('0x40')]['id']}},_0x4950c8={};_0x4950c8[_0x6b12('0x2d')]=_[_0x6b12('0x41')](db[_0x6b12('0x28')][_0x6b12('0x29')]);_0x4950c8['query']=_[_0x6b12('0x41')](_0x5dca1b[_0x6b12('0x2e')]);_0x4950c8[_0x6b12('0x37')]=_['intersection'](_0x4950c8[_0x6b12('0x2d')],_0x4950c8[_0x6b12('0x2e')]);_0x1c96c8['attributes']=_[_0x6b12('0x2f')](_0x4950c8['model'],qs[_0x6b12('0x31')](_0x5dca1b[_0x6b12('0x2e')][_0x6b12('0x31')]));_0x1c96c8['attributes']=_0x1c96c8[_0x6b12('0x30')]['length']?_0x1c96c8[_0x6b12('0x30')]:_0x4950c8[_0x6b12('0x2d')];if(_0x5dca1b[_0x6b12('0x2e')][_0x6b12('0x3b')]){_0x1c96c8['include']=[{'all':!![]}];}_0x1c96c8=_[_0x6b12('0x42')]({},_0x1c96c8,_0x5dca1b['options']);return db[_0x6b12('0x28')][_0x6b12('0x43')](_0x1c96c8)[_0x6b12('0x21')](handleEntityNotFound(_0x31f737,null))['then'](respondWithResult(_0x31f737,null))[_0x6b12('0x3e')](handleError(_0x31f737,null));};exports['create']=function(_0x4e8fff,_0x3c4904){return db[_0x6b12('0x28')][_0x6b12('0x44')](_0x4e8fff['body'],{})[_0x6b12('0x21')](respondWithResult(_0x3c4904,0xc9))[_0x6b12('0x3e')](handleError(_0x3c4904,null));};exports[_0x6b12('0x45')]=function(_0x371f68,_0x5ef6bc){if(_0x371f68[_0x6b12('0x46')]['id']){delete _0x371f68['body']['id'];}return db[_0x6b12('0x28')][_0x6b12('0x43')]({'where':{'id':_0x371f68[_0x6b12('0x40')]['id']}})[_0x6b12('0x21')](handleEntityNotFound(_0x5ef6bc,null))[_0x6b12('0x21')](saveUpdates(_0x371f68['body'],null))[_0x6b12('0x21')](respondWithResult(_0x5ef6bc,null))[_0x6b12('0x3e')](handleError(_0x5ef6bc,null));};exports[_0x6b12('0x20')]=function(_0x591a55,_0x3358ee){return db['SmsQueueReport'][_0x6b12('0x43')]({'where':{'id':_0x591a55[_0x6b12('0x40')]['id']}})[_0x6b12('0x21')](handleEntityNotFound(_0x3358ee,null))[_0x6b12('0x21')](removeEntity(_0x3358ee,null))[_0x6b12('0x3e')](handleError(_0x3358ee,null));};exports[_0x6b12('0x47')]=function(_0x2a0206,_0x2aeada){return db[_0x6b12('0x28')][_0x6b12('0x47')]()[_0x6b12('0x21')](respondWithResult(_0x2aeada,null))[_0x6b12('0x3e')](handleError(_0x2aeada,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 2dfecbd..206ca53 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_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 +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x309be0,_0x5704f3){var _0x324e18=function(_0x144a65){while(--_0x144a65){_0x309be0['push'](_0x309be0['shift']());}};_0x324e18(++_0x5704f3);}(_0xe706,0xa3));var _0x6e70=function(_0x3a7bdf,_0x58bdd8){_0x3a7bdf=_0x3a7bdf-0x0;var _0x35a9a8=_0xe706[_0x3a7bdf];return _0x35a9a8;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 8415f7f..6b2305f 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 _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 +var _0xccd9=['catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','then','debug','raw','where','attributes','limit','UpdateSmsQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x60782,_0x49a7cc){var _0x2cc911=function(_0x1db7c8){while(--_0x1db7c8){_0x60782['push'](_0x60782['shift']());}};_0x2cc911(++_0x49a7cc);}(_0xccd9,0xb7));var _0x9ccd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xccd9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9ccd('0x0'));var util=require(_0x9ccd('0x1'));var moment=require(_0x9ccd('0x2'));var BPromise=require('bluebird');var rs=require(_0x9ccd('0x3'));var fs=require('fs');var Redis=require(_0x9ccd('0x4'));var db=require(_0x9ccd('0x5'))['db'];var utils=require(_0x9ccd('0x6'));var logger=require(_0x9ccd('0x7'))(_0x9ccd('0x8'));var config=require(_0x9ccd('0x9'));var jayson=require(_0x9ccd('0xa'));var client=jayson['client'][_0x9ccd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x65cefb,_0x47be35,_0x53108e){return new BPromise(function(_0x3e25e9,_0x23a349){return client[_0x9ccd('0xc')](_0x65cefb,_0x53108e)['then'](function(_0x280939){logger[_0x9ccd('0xd')](_0x9ccd('0xe'),_0x47be35,_0x9ccd('0xf'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x47be35,_0x9ccd('0xf'),JSON[_0x9ccd('0x10')](_0x280939));if(_0x280939[_0x9ccd('0x11')]){if(_0x280939[_0x9ccd('0x11')][_0x9ccd('0x12')]===0x1f4){logger[_0x9ccd('0x11')](_0x9ccd('0xe'),_0x47be35,_0x280939[_0x9ccd('0x11')][_0x9ccd('0x13')]);return _0x23a349(_0x280939[_0x9ccd('0x11')]['message']);}logger[_0x9ccd('0x11')](_0x9ccd('0xe'),_0x47be35,_0x280939['error'][_0x9ccd('0x13')]);return _0x3e25e9(_0x280939['error'][_0x9ccd('0x13')]);}else{logger[_0x9ccd('0xd')](_0x9ccd('0xe'),_0x47be35,'request\x20sent');_0x3e25e9(_0x280939[_0x9ccd('0x14')][_0x9ccd('0x13')]);}})[_0x9ccd('0x15')](function(_0x63254){logger['error'](_0x9ccd('0xe'),_0x47be35,_0x63254);_0x23a349(_0x63254);});});}exports[_0x9ccd('0x16')]=function(_0x4bb260){var _0x41b80c=this;return new Promise(function(_0x46db0c,_0x87f0e){return db[_0x9ccd('0x17')][_0x9ccd('0x18')](_0x4bb260[_0x9ccd('0x19')],{'raw':_0x4bb260[_0x9ccd('0x1a')]?_0x4bb260[_0x9ccd('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x9ccd('0x1b')](function(_0x836652){logger[_0x9ccd('0xd')](_0x9ccd('0x16'),_0x4bb260);logger[_0x9ccd('0x1c')](_0x9ccd('0x16'),_0x4bb260,JSON['stringify'](_0x836652));_0x46db0c(_0x836652);})[_0x9ccd('0x15')](function(_0x11f372){logger[_0x9ccd('0x11')](_0x9ccd('0x16'),_0x11f372['message'],_0x4bb260);_0x87f0e(_0x41b80c[_0x9ccd('0x11')](0x1f4,_0x11f372[_0x9ccd('0x13')]));});});};exports['UpdateSmsQueueReport']=function(_0x25f0c8){var _0x7d9263=this;return new Promise(function(_0x41c5fa,_0x467638){return db[_0x9ccd('0x17')]['update'](_0x25f0c8[_0x9ccd('0x19')],{'raw':_0x25f0c8['options']?_0x25f0c8[_0x9ccd('0x1a')][_0x9ccd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25f0c8[_0x9ccd('0x1a')]?_0x25f0c8['options'][_0x9ccd('0x1e')]||null:null,'attributes':_0x25f0c8[_0x9ccd('0x1a')]?_0x25f0c8[_0x9ccd('0x1a')][_0x9ccd('0x1f')]||null:null,'limit':_0x25f0c8['options']?_0x25f0c8['options'][_0x9ccd('0x20')]||null:null})[_0x9ccd('0x1b')](function(_0x4c6c06){logger[_0x9ccd('0xd')](_0x9ccd('0x21'),_0x25f0c8);logger['debug'](_0x9ccd('0x21'),_0x25f0c8,JSON[_0x9ccd('0x10')](_0x4c6c06));_0x41c5fa(_0x4c6c06);})[_0x9ccd('0x15')](function(_0x3aa404){logger['error']('UpdateSmsQueueReport',_0x3aa404[_0x9ccd('0x13')],_0x25f0c8);_0x467638(_0x7d9263[_0x9ccd('0x11')](0x1f4,_0x3aa404[_0x9ccd('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 4f3fec2..83d7b4a 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 _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 +var _0xa9b1=['exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','destroy'];(function(_0x31b9cf,_0x1a809b){var _0x357b8a=function(_0x50a273){while(--_0x50a273){_0x31b9cf['push'](_0x31b9cf['shift']());}};_0x357b8a(++_0x1a809b);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1a9b('0x0'));var timeout=require(_0x1a9b('0x1'));var express=require(_0x1a9b('0x2'));var router=express[_0x1a9b('0x3')]();var fs_extra=require(_0x1a9b('0x4'));var auth=require(_0x1a9b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsTransferReport.controller');router[_0x1a9b('0x6')]('/',auth[_0x1a9b('0x7')](),controller[_0x1a9b('0x8')]);router[_0x1a9b('0x6')](_0x1a9b('0x9'),auth[_0x1a9b('0x7')](),controller[_0x1a9b('0xa')]);router[_0x1a9b('0x6')](_0x1a9b('0xb'),auth[_0x1a9b('0x7')](),controller[_0x1a9b('0xc')]);router[_0x1a9b('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1a9b('0xe')](_0x1a9b('0xb'),auth[_0x1a9b('0x7')](),controller['update']);router['delete']('/:id',auth[_0x1a9b('0x7')](),controller[_0x1a9b('0xf')]);module[_0x1a9b('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index b16cab7..81f4fdd 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 _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 +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x58c608,_0x16f6df){var _0x4fb8aa=function(_0xcc6b8d){while(--_0xcc6b8d){_0x58c608['push'](_0x58c608['shift']());}};_0x4fb8aa(++_0x16f6df);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 6e8cee8..a35792b 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 _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 +var _0x5bac=['rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','SmsTransferReport','findAll','rows','catch','show','params','find','create','body','describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0x530245,_0x1541ab){var _0x22506d=function(_0x395400){while(--_0x395400){_0x530245['push'](_0x530245['shift']());}};_0x22506d(++_0x1541ab);}(_0x5bac,0x6c));var _0xc5ba=function(_0x349914,_0xfb52b9){_0x349914=_0x349914-0x0;var _0x37c0f1=_0x5bac[_0x349914];return _0x37c0f1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc5ba('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc5ba('0x1'));var moment=require(_0xc5ba('0x2'));var BPromise=require(_0xc5ba('0x3'));var Mustache=require(_0xc5ba('0x4'));var util=require(_0xc5ba('0x5'));var path=require(_0xc5ba('0x6'));var sox=require(_0xc5ba('0x7'));var csv=require(_0xc5ba('0x8'));var ejs=require(_0xc5ba('0x9'));var fs=require('fs');var fs_extra=require(_0xc5ba('0xa'));var _=require('lodash');var squel=require(_0xc5ba('0xb'));var crypto=require(_0xc5ba('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc5ba('0x8'));var querystring=require(_0xc5ba('0xd'));var Papa=require(_0xc5ba('0xe'));var Redis=require(_0xc5ba('0xf'));var authService=require(_0xc5ba('0x10'));var qs=require(_0xc5ba('0x11'));var as=require(_0xc5ba('0x12'));var hardwareService=require(_0xc5ba('0x13'));var logger=require(_0xc5ba('0x14'))(_0xc5ba('0x15'));var utils=require(_0xc5ba('0x16'));var config=require(_0xc5ba('0x17'));var licenseUtil=require(_0xc5ba('0x18'));var db=require(_0xc5ba('0x19'))['db'];function respondWithStatusCode(_0x13d964,_0x3e5e86){_0x3e5e86=_0x3e5e86||0xcc;return function(_0x50a14a){if(_0x50a14a){return _0x13d964[_0xc5ba('0x1a')](_0x3e5e86);}return _0x13d964[_0xc5ba('0x1b')](_0x3e5e86)[_0xc5ba('0x1c')]();};}function respondWithResult(_0x47449d,_0x483037){_0x483037=_0x483037||0xc8;return function(_0x23d70c){if(_0x23d70c){return _0x47449d[_0xc5ba('0x1b')](_0x483037)[_0xc5ba('0x1d')](_0x23d70c);}};}function respondWithFilteredResult(_0x5c37e5,_0x36ab0e){return function(_0x32e040){if(_0x32e040){var _0x8fe95a=typeof _0x36ab0e['offset']==='undefined'&&typeof _0x36ab0e['limit']===_0xc5ba('0x1e');var _0x309621=_0x32e040['count'];var _0x4f3995=_0x8fe95a?0x0:_0x36ab0e[_0xc5ba('0x1f')];var _0x2de556=_0x8fe95a?_0x32e040[_0xc5ba('0x20')]:_0x36ab0e[_0xc5ba('0x1f')]+_0x36ab0e[_0xc5ba('0x21')];var _0x330e5a;if(_0x2de556>=_0x309621){_0x2de556=_0x309621;_0x330e5a=0xc8;}else{_0x330e5a=0xce;}_0x5c37e5[_0xc5ba('0x1b')](_0x330e5a);return _0x5c37e5['set']('Content-Range',_0x4f3995+'-'+_0x2de556+'/'+_0x309621)[_0xc5ba('0x1d')](_0x32e040);}return null;};}function patchUpdates(_0x3d89a4){return function(_0xde1ec3){try{jsonpatch['apply'](_0xde1ec3,_0x3d89a4,!![]);}catch(_0x544b00){return BPromise[_0xc5ba('0x22')](_0x544b00);}return _0xde1ec3[_0xc5ba('0x23')]();};}function saveUpdates(_0x26d73e,_0x14708e){return function(_0x49b6f4){if(_0x49b6f4){return _0x49b6f4[_0xc5ba('0x24')](_0x26d73e)[_0xc5ba('0x25')](function(_0x172283){return _0x172283;});}return null;};}function removeEntity(_0x509475,_0x5001df){return function(_0x718f19){if(_0x718f19){return _0x718f19[_0xc5ba('0x26')]()[_0xc5ba('0x25')](function(){_0x509475[_0xc5ba('0x1b')](0xcc)[_0xc5ba('0x1c')]();});}};}function handleEntityNotFound(_0x2726f3,_0x3dde8e){return function(_0x38930c){if(!_0x38930c){_0x2726f3[_0xc5ba('0x1a')](0x194);}return _0x38930c;};}function handleError(_0x585e4b,_0x5665db){_0x5665db=_0x5665db||0x1f4;return function(_0x5bd6ac){logger[_0xc5ba('0x27')](_0x5bd6ac[_0xc5ba('0x28')]);if(_0x5bd6ac[_0xc5ba('0x29')]){delete _0x5bd6ac[_0xc5ba('0x29')];}_0x585e4b[_0xc5ba('0x1b')](_0x5665db)[_0xc5ba('0x2a')](_0x5bd6ac);};}exports[_0xc5ba('0x2b')]=function(_0x325adf,_0x187bc3){var _0x2746bf={},_0x43b4aa={},_0x358cb4={'count':0x0,'rows':[]};var _0x4a7ae8=_['map'](db['SmsTransferReport'][_0xc5ba('0x2c')],function(_0x13f214){return{'name':_0x13f214[_0xc5ba('0x2d')],'type':_0x13f214[_0xc5ba('0x2e')]['key']};});_0x43b4aa[_0xc5ba('0x2f')]=_[_0xc5ba('0x30')](_0x4a7ae8,'name');_0x43b4aa[_0xc5ba('0x31')]=_[_0xc5ba('0x32')](_0x325adf[_0xc5ba('0x31')]);_0x43b4aa[_0xc5ba('0x33')]=_[_0xc5ba('0x34')](_0x43b4aa[_0xc5ba('0x2f')],_0x43b4aa[_0xc5ba('0x31')]);_0x2746bf[_0xc5ba('0x35')]=_['intersection'](_0x43b4aa[_0xc5ba('0x2f')],qs[_0xc5ba('0x36')](_0x325adf[_0xc5ba('0x31')][_0xc5ba('0x36')]));_0x2746bf['attributes']=_0x2746bf['attributes'][_0xc5ba('0x37')]?_0x2746bf[_0xc5ba('0x35')]:_0x43b4aa[_0xc5ba('0x2f')];if(!_0x325adf[_0xc5ba('0x31')][_0xc5ba('0x38')](_0xc5ba('0x39'))){_0x2746bf['limit']=qs['limit'](_0x325adf[_0xc5ba('0x31')][_0xc5ba('0x21')]);_0x2746bf[_0xc5ba('0x1f')]=qs['offset'](_0x325adf[_0xc5ba('0x31')][_0xc5ba('0x1f')]);}_0x2746bf[_0xc5ba('0x3a')]=qs['sort'](_0x325adf[_0xc5ba('0x31')][_0xc5ba('0x3b')]);_0x2746bf[_0xc5ba('0x3c')]=qs[_0xc5ba('0x33')](_['pick'](_0x325adf[_0xc5ba('0x31')],_0x43b4aa[_0xc5ba('0x33')]),_0x4a7ae8);if(_0x325adf[_0xc5ba('0x31')][_0xc5ba('0x3d')]){_0x2746bf['where']=_[_0xc5ba('0x3e')](_0x2746bf['where'],{'$or':_[_0xc5ba('0x30')](_0x4a7ae8,function(_0x98ffd2){if(_0x98ffd2[_0xc5ba('0x2e')]!==_0xc5ba('0x3f')){var _0xf6159b={};_0xf6159b[_0x98ffd2['name']]={'$like':'%'+_0x325adf[_0xc5ba('0x31')]['filter']+'%'};return _0xf6159b;}})});}_0x2746bf=_['merge']({},_0x2746bf,_0x325adf['options']);var _0x26ea56={'where':_0x2746bf[_0xc5ba('0x3c')]};return db['SmsTransferReport'][_0xc5ba('0x20')](_0x26ea56)['then'](function(_0x306ffe){_0x358cb4[_0xc5ba('0x20')]=_0x306ffe;if(_0x325adf[_0xc5ba('0x31')][_0xc5ba('0x40')]){_0x2746bf[_0xc5ba('0x41')]=[{'all':!![]}];}return db[_0xc5ba('0x42')][_0xc5ba('0x43')](_0x2746bf);})[_0xc5ba('0x25')](function(_0x10801f){_0x358cb4[_0xc5ba('0x44')]=_0x10801f;return _0x358cb4;})['then'](respondWithFilteredResult(_0x187bc3,_0x2746bf))[_0xc5ba('0x45')](handleError(_0x187bc3,null));};exports[_0xc5ba('0x46')]=function(_0x2ae174,_0x2fb30c){var _0x259bdd={'raw':!![],'where':{'id':_0x2ae174[_0xc5ba('0x47')]['id']}},_0x1c4dab={};_0x1c4dab[_0xc5ba('0x2f')]=_[_0xc5ba('0x32')](db[_0xc5ba('0x42')][_0xc5ba('0x2c')]);_0x1c4dab['query']=_[_0xc5ba('0x32')](_0x2ae174[_0xc5ba('0x31')]);_0x1c4dab[_0xc5ba('0x33')]=_[_0xc5ba('0x34')](_0x1c4dab[_0xc5ba('0x2f')],_0x1c4dab[_0xc5ba('0x31')]);_0x259bdd[_0xc5ba('0x35')]=_[_0xc5ba('0x34')](_0x1c4dab[_0xc5ba('0x2f')],qs[_0xc5ba('0x36')](_0x2ae174[_0xc5ba('0x31')][_0xc5ba('0x36')]));_0x259bdd[_0xc5ba('0x35')]=_0x259bdd[_0xc5ba('0x35')][_0xc5ba('0x37')]?_0x259bdd[_0xc5ba('0x35')]:_0x1c4dab[_0xc5ba('0x2f')];if(_0x2ae174['query'][_0xc5ba('0x40')]){_0x259bdd['include']=[{'all':!![]}];}_0x259bdd=_[_0xc5ba('0x3e')]({},_0x259bdd,_0x2ae174['options']);return db[_0xc5ba('0x42')][_0xc5ba('0x48')](_0x259bdd)[_0xc5ba('0x25')](handleEntityNotFound(_0x2fb30c,null))[_0xc5ba('0x25')](respondWithResult(_0x2fb30c,null))[_0xc5ba('0x45')](handleError(_0x2fb30c,null));};exports[_0xc5ba('0x49')]=function(_0x473b17,_0x4339be){return db['SmsTransferReport'][_0xc5ba('0x49')](_0x473b17[_0xc5ba('0x4a')],{})[_0xc5ba('0x25')](respondWithResult(_0x4339be,0xc9))[_0xc5ba('0x45')](handleError(_0x4339be,null));};exports[_0xc5ba('0x24')]=function(_0x523539,_0x301c91){if(_0x523539['body']['id']){delete _0x523539[_0xc5ba('0x4a')]['id'];}return db['SmsTransferReport'][_0xc5ba('0x48')]({'where':{'id':_0x523539[_0xc5ba('0x47')]['id']}})['then'](handleEntityNotFound(_0x301c91,null))['then'](saveUpdates(_0x523539['body'],null))['then'](respondWithResult(_0x301c91,null))[_0xc5ba('0x45')](handleError(_0x301c91,null));};exports[_0xc5ba('0x26')]=function(_0x34278e,_0x3601da){return db['SmsTransferReport'][_0xc5ba('0x48')]({'where':{'id':_0x34278e[_0xc5ba('0x47')]['id']}})[_0xc5ba('0x25')](handleEntityNotFound(_0x3601da,null))[_0xc5ba('0x25')](removeEntity(_0x3601da,null))[_0xc5ba('0x45')](handleError(_0x3601da,null));};exports['describe']=function(_0x2cd02e,_0x1a3e70){return db[_0xc5ba('0x42')][_0xc5ba('0x4b')]()[_0xc5ba('0x25')](respondWithResult(_0x1a3e70,null))[_0xc5ba('0x45')](handleError(_0x1a3e70,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 971b5c0..168064a 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 _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 +var _0x0c6d=['moment','bluebird','request-promise','rimraf','define','report_sms_transfer','uniqueid','util','../../config/logger','api'];(function(_0x480b3d,_0x60d08e){var _0x26047b=function(_0x263e64){while(--_0x263e64){_0x480b3d['push'](_0x480b3d['shift']());}};_0x26047b(++_0x60d08e);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x225081,_0x36d62d){_0x225081=_0x225081-0x0;var _0x7753f1=_0x0c6d[_0x225081];return _0x7753f1;};'use strict';var _=require('lodash');var util=require(_0xd0c6('0x0'));var logger=require(_0xd0c6('0x1'))(_0xd0c6('0x2'));var moment=require(_0xd0c6('0x3'));var BPromise=require(_0xd0c6('0x4'));var rp=require(_0xd0c6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd0c6('0x6'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x2b4c40,_0x41f475){return _0x2b4c40[_0xd0c6('0x7')]('SmsTransferReport',attributes,{'tableName':_0xd0c6('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd0c6('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 0615d24..496d721 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 _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 +var _0x74f3=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x74f3,0x164));var _0x374f=function(_0x3af5d0,_0x1ba303){_0x3af5d0=_0x3af5d0-0x0;var _0x46ebd3=_0x74f3[_0x3af5d0];return _0x46ebd3;};'use strict';var _=require(_0x374f('0x0'));var util=require(_0x374f('0x1'));var moment=require(_0x374f('0x2'));var BPromise=require('bluebird');var rs=require(_0x374f('0x3'));var fs=require('fs');var Redis=require(_0x374f('0x4'));var db=require(_0x374f('0x5'))['db'];var utils=require(_0x374f('0x6'));var logger=require('../../config/logger')(_0x374f('0x7'));var config=require(_0x374f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x374f('0x9')][_0x374f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x405e93,_0x407df1,_0x3bcc86){return new BPromise(function(_0x394073,_0x32861f){return client[_0x374f('0xb')](_0x405e93,_0x3bcc86)['then'](function(_0x2b0d45){logger[_0x374f('0xc')](_0x374f('0xd'),_0x407df1,_0x374f('0xe'));logger[_0x374f('0xf')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x407df1,_0x374f('0xe'),JSON[_0x374f('0x10')](_0x2b0d45));if(_0x2b0d45['error']){if(_0x2b0d45[_0x374f('0x11')][_0x374f('0x12')]===0x1f4){logger[_0x374f('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x407df1,_0x2b0d45[_0x374f('0x11')][_0x374f('0x13')]);return _0x32861f(_0x2b0d45['error'][_0x374f('0x13')]);}logger[_0x374f('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x407df1,_0x2b0d45[_0x374f('0x11')]['message']);return _0x394073(_0x2b0d45[_0x374f('0x11')][_0x374f('0x13')]);}else{logger[_0x374f('0xc')](_0x374f('0xd'),_0x407df1,_0x374f('0xe'));_0x394073(_0x2b0d45[_0x374f('0x14')][_0x374f('0x13')]);}})[_0x374f('0x15')](function(_0x250e33){logger[_0x374f('0x11')](_0x374f('0xd'),_0x407df1,_0x250e33);_0x32861f(_0x250e33);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 0019268..5f1a148 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 _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 +var _0xc1c8=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','show','/:id/download','isAuthenticated','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','post','single','file','create','put','update'];(function(_0x49c4e6,_0x3a001c){var _0x4a7c14=function(_0x469ea2){while(--_0x469ea2){_0x49c4e6['push'](_0x49c4e6['shift']());}};_0x4a7c14(++_0x3a001c);}(_0xc1c8,0x117));var _0x8c1c=function(_0x496980,_0x2bf7de){_0x496980=_0x496980-0x0;var _0xdb0ef8=_0xc1c8[_0x496980];return _0xdb0ef8;};'use strict';var multer=require(_0x8c1c('0x0'));var util=require(_0x8c1c('0x1'));var path=require(_0x8c1c('0x2'));var timeout=require(_0x8c1c('0x3'));var express=require(_0x8c1c('0x4'));var router=express['Router']();var fs_extra=require(_0x8c1c('0x5'));var auth=require(_0x8c1c('0x6'));var interaction=require(_0x8c1c('0x7'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0x8c1c('0x8')]('/',auth['isAuthenticated'](),controller[_0x8c1c('0x9')]);router[_0x8c1c('0x8')](_0x8c1c('0xa'),auth['isAuthenticated'](),controller[_0x8c1c('0xb')]);router[_0x8c1c('0x8')](_0x8c1c('0xc'),auth[_0x8c1c('0xd')](),controller[_0x8c1c('0xe')]);var upload=multer({'storage':multer[_0x8c1c('0xf')]({'destination':function(_0x4eb419,_0x45421a,_0xba667d){_0xba667d(null,path[_0x8c1c('0x10')](config[_0x8c1c('0x11')],_0x8c1c('0x12')));},'filename':function(_0x1ceb86,_0x392121,_0x1fb4fa){_0x392121[_0x8c1c('0x13')]=_0x392121[_0x8c1c('0x13')][_0x8c1c('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1fb4fa(null,util[_0x8c1c('0x15')](_0x8c1c('0x16'),path[_0x8c1c('0x17')](_0x392121[_0x8c1c('0x13')],path[_0x8c1c('0x18')](_0x392121[_0x8c1c('0x13')])),Date['now'](),path[_0x8c1c('0x18')](_0x392121[_0x8c1c('0x13')])));}})});router[_0x8c1c('0x19')]('/',upload[_0x8c1c('0x1a')](_0x8c1c('0x1b')),controller[_0x8c1c('0x1c')]);router[_0x8c1c('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x8c1c('0x1e')]);router['delete'](_0x8c1c('0xa'),auth[_0x8c1c('0xd')](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index f5404d0..ba782af 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 _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 +var _0xc54f=['sequelize','exports','STRING','FLOAT','INTEGER'];(function(_0x463b6a,_0x55f852){var _0xbe1722=function(_0xaed61c){while(--_0xaed61c){_0x463b6a['push'](_0x463b6a['shift']());}};_0xbe1722(++_0x55f852);}(_0xc54f,0x19f));var _0xfc54=function(_0x1d8068,_0x3fef2){_0x1d8068=_0x1d8068-0x0;var _0x3d546f=_0xc54f[_0x1d8068];return _0x3d546f;};'use strict';var Sequelize=require(_0xfc54('0x0'));module[_0xfc54('0x1')]={'name':{'type':Sequelize[_0xfc54('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xfc54('0x2')]},'display_name':{'type':Sequelize[_0xfc54('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xfc54('0x2')]},'original_format':{'type':Sequelize[_0xfc54('0x2')]},'original_duration':{'type':Sequelize[_0xfc54('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xfc54('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xfc54('0x2')]},'converted_duration':{'type':Sequelize[_0xfc54('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xfc54('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xfc54('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index df1b2fe..a47c2c2 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 _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 +var _0x1abe=['eml-format','zip-dir','fast-json-patch','request-promise','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','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','Sounds','UserProfileResource','sendStatus','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','length','include','find','download','save_name','converted_format','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','root','format','%s.%s','create','basename','file','extname','originalname','filename','substring','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','0777','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','channelCount','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','chmodSync','body','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','description','original_format'];(function(_0x287ac2,_0x4541c0){var _0x17074b=function(_0x5b7927){while(--_0x5b7927){_0x287ac2['push'](_0x287ac2['shift']());}};_0x17074b(++_0x4541c0);}(_0x1abe,0x79));var _0xe1ab=function(_0x500704,_0x49d8e1){_0x500704=_0x500704-0x0;var _0x100bb5=_0x1abe[_0x500704];return _0x100bb5;};'use strict';var emlformat=require(_0xe1ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe1ab('0x1'));var jsonpatch=require(_0xe1ab('0x2'));var rp=require(_0xe1ab('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe1ab('0x4'));var path=require(_0xe1ab('0x5'));var sox=require('sox');var csv=require(_0xe1ab('0x6'));var ejs=require(_0xe1ab('0x7'));var fs=require('fs');var fs_extra=require(_0xe1ab('0x8'));var _=require(_0xe1ab('0x9'));var squel=require(_0xe1ab('0xa'));var crypto=require(_0xe1ab('0xb'));var jsforce=require(_0xe1ab('0xc'));var deskjs=require(_0xe1ab('0xd'));var toCsv=require(_0xe1ab('0x6'));var querystring=require('querystring');var Papa=require(_0xe1ab('0xe'));var Redis=require(_0xe1ab('0xf'));var authService=require(_0xe1ab('0x10'));var qs=require(_0xe1ab('0x11'));var as=require(_0xe1ab('0x12'));var hardwareService=require(_0xe1ab('0x13'));var logger=require('../../config/logger')(_0xe1ab('0x14'));var utils=require(_0xe1ab('0x15'));var config=require(_0xe1ab('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe1ab('0x17'))['db'];function respondWithStatusCode(_0xf767c3,_0x4f74c2){_0x4f74c2=_0x4f74c2||0xcc;return function(_0x23feac){if(_0x23feac){return _0xf767c3['sendStatus'](_0x4f74c2);}return _0xf767c3[_0xe1ab('0x18')](_0x4f74c2)[_0xe1ab('0x19')]();};}function respondWithResult(_0x245426,_0x281537){_0x281537=_0x281537||0xc8;return function(_0x1188eb){if(_0x1188eb){return _0x245426[_0xe1ab('0x18')](_0x281537)[_0xe1ab('0x1a')](_0x1188eb);}};}function respondWithFilteredResult(_0x4e5fb5,_0x33a375){return function(_0x517f4a){if(_0x517f4a){var _0x3aba97=typeof _0x33a375[_0xe1ab('0x1b')]===_0xe1ab('0x1c')&&typeof _0x33a375[_0xe1ab('0x1d')]==='undefined';var _0x3dc616=_0x517f4a[_0xe1ab('0x1e')];var _0x4610f9=_0x3aba97?0x0:_0x33a375[_0xe1ab('0x1b')];var _0x77f9e4=_0x3aba97?_0x517f4a[_0xe1ab('0x1e')]:_0x33a375[_0xe1ab('0x1b')]+_0x33a375[_0xe1ab('0x1d')];var _0x5179c7;if(_0x77f9e4>=_0x3dc616){_0x77f9e4=_0x3dc616;_0x5179c7=0xc8;}else{_0x5179c7=0xce;}_0x4e5fb5[_0xe1ab('0x18')](_0x5179c7);return _0x4e5fb5[_0xe1ab('0x1f')](_0xe1ab('0x20'),_0x4610f9+'-'+_0x77f9e4+'/'+_0x3dc616)[_0xe1ab('0x1a')](_0x517f4a);}return null;};}function patchUpdates(_0x2ee594){return function(_0xfd0f64){try{jsonpatch[_0xe1ab('0x21')](_0xfd0f64,_0x2ee594,!![]);}catch(_0x348f00){return BPromise['reject'](_0x348f00);}return _0xfd0f64[_0xe1ab('0x22')]();};}function saveUpdates(_0x3b3335,_0x2e8f14){return function(_0x1731c8){if(_0x1731c8){return _0x1731c8[_0xe1ab('0x23')](_0x3b3335)['then'](function(_0x17705c){return _0x17705c;});}return null;};}function removeEntity(_0x1d4cd2,_0x184c39){return function(_0x24401c){if(_0x24401c){return _0x24401c[_0xe1ab('0x24')]()[_0xe1ab('0x25')](function(){var _0x49e35d=_0x24401c[_0xe1ab('0x26')]({'plain':!![]});var _0x431e35=_0xe1ab('0x27');return db[_0xe1ab('0x28')][_0xe1ab('0x24')]({'where':{'type':_0x431e35,'resourceId':_0x49e35d['id']}})[_0xe1ab('0x25')](function(){return _0x24401c;});})[_0xe1ab('0x25')](function(){_0x1d4cd2[_0xe1ab('0x18')](0xcc)[_0xe1ab('0x19')]();});}};}function handleEntityNotFound(_0x18e2bc,_0x44e254){return function(_0x206ee2){if(!_0x206ee2){_0x18e2bc[_0xe1ab('0x29')](0x194);}return _0x206ee2;};}function handleError(_0x2ef96e,_0x4c0e7d){_0x4c0e7d=_0x4c0e7d||0x1f4;return function(_0x366c8f){logger['error'](_0x366c8f[_0xe1ab('0x2a')]);if(_0x366c8f[_0xe1ab('0x2b')]){delete _0x366c8f[_0xe1ab('0x2b')];}_0x2ef96e['status'](_0x4c0e7d)[_0xe1ab('0x2c')](_0x366c8f);};}exports[_0xe1ab('0x2d')]=function(_0x262e6f,_0x52c3c2){var _0x460f1a={},_0x29c79d={},_0x4f47ca={'count':0x0,'rows':[]};var _0x4bda14=_[_0xe1ab('0x2e')](db[_0xe1ab('0x2f')][_0xe1ab('0x30')],function(_0x5bfcc8){return{'name':_0x5bfcc8[_0xe1ab('0x31')],'type':_0x5bfcc8[_0xe1ab('0x32')]['key']};});_0x29c79d[_0xe1ab('0x33')]=_[_0xe1ab('0x2e')](_0x4bda14,_0xe1ab('0x2b'));_0x29c79d[_0xe1ab('0x34')]=_[_0xe1ab('0x35')](_0x262e6f['query']);_0x29c79d[_0xe1ab('0x36')]=_[_0xe1ab('0x37')](_0x29c79d[_0xe1ab('0x33')],_0x29c79d[_0xe1ab('0x34')]);_0x460f1a[_0xe1ab('0x38')]=_[_0xe1ab('0x37')](_0x29c79d[_0xe1ab('0x33')],qs[_0xe1ab('0x39')](_0x262e6f[_0xe1ab('0x34')][_0xe1ab('0x39')]));_0x460f1a['attributes']=_0x460f1a[_0xe1ab('0x38')]['length']?_0x460f1a['attributes']:_0x29c79d[_0xe1ab('0x33')];if(!_0x262e6f['query'][_0xe1ab('0x3a')](_0xe1ab('0x3b'))){_0x460f1a[_0xe1ab('0x1d')]=qs['limit'](_0x262e6f['query'][_0xe1ab('0x1d')]);_0x460f1a[_0xe1ab('0x1b')]=qs[_0xe1ab('0x1b')](_0x262e6f[_0xe1ab('0x34')][_0xe1ab('0x1b')]);}_0x460f1a[_0xe1ab('0x3c')]=qs[_0xe1ab('0x3d')](_0x262e6f['query'][_0xe1ab('0x3d')]);_0x460f1a['where']=qs[_0xe1ab('0x36')](_['pick'](_0x262e6f[_0xe1ab('0x34')],_0x29c79d['filters']),_0x4bda14);if(_0x262e6f[_0xe1ab('0x34')][_0xe1ab('0x3e')]){_0x460f1a[_0xe1ab('0x3f')]=_[_0xe1ab('0x40')](_0x460f1a[_0xe1ab('0x3f')],{'$or':_[_0xe1ab('0x2e')](_0x4bda14,function(_0x2d20da){if(_0x2d20da[_0xe1ab('0x32')]!==_0xe1ab('0x41')){var _0x1b36f9={};_0x1b36f9[_0x2d20da['name']]={'$like':'%'+_0x262e6f[_0xe1ab('0x34')][_0xe1ab('0x3e')]+'%'};return _0x1b36f9;}})});}_0x460f1a=_['merge']({},_0x460f1a,_0x262e6f[_0xe1ab('0x42')]);var _0x1b1489={'where':_0x460f1a[_0xe1ab('0x3f')]};return db[_0xe1ab('0x2f')][_0xe1ab('0x1e')](_0x1b1489)['then'](function(_0x315e82){_0x4f47ca[_0xe1ab('0x1e')]=_0x315e82;if(_0x262e6f['query'][_0xe1ab('0x43')]){_0x460f1a['include']=[{'all':!![]}];}return db[_0xe1ab('0x2f')][_0xe1ab('0x44')](_0x460f1a);})[_0xe1ab('0x25')](function(_0x40e68c){_0x4f47ca['rows']=_0x40e68c;return _0x4f47ca;})['then'](respondWithFilteredResult(_0x52c3c2,_0x460f1a))[_0xe1ab('0x45')](handleError(_0x52c3c2,null));};exports[_0xe1ab('0x46')]=function(_0x130f82,_0x23d33b){var _0x50eb61={'raw':!![],'where':{'id':_0x130f82[_0xe1ab('0x47')]['id']}},_0x33cf2d={};_0x33cf2d[_0xe1ab('0x33')]=_[_0xe1ab('0x35')](db['Sound'][_0xe1ab('0x30')]);_0x33cf2d[_0xe1ab('0x34')]=_[_0xe1ab('0x35')](_0x130f82[_0xe1ab('0x34')]);_0x33cf2d[_0xe1ab('0x36')]=_['intersection'](_0x33cf2d[_0xe1ab('0x33')],_0x33cf2d[_0xe1ab('0x34')]);_0x50eb61[_0xe1ab('0x38')]=_[_0xe1ab('0x37')](_0x33cf2d[_0xe1ab('0x33')],qs[_0xe1ab('0x39')](_0x130f82[_0xe1ab('0x34')]['fields']));_0x50eb61[_0xe1ab('0x38')]=_0x50eb61[_0xe1ab('0x38')][_0xe1ab('0x48')]?_0x50eb61[_0xe1ab('0x38')]:_0x33cf2d[_0xe1ab('0x33')];if(_0x130f82['query'][_0xe1ab('0x43')]){_0x50eb61[_0xe1ab('0x49')]=[{'all':!![]}];}_0x50eb61=_[_0xe1ab('0x40')]({},_0x50eb61,_0x130f82[_0xe1ab('0x42')]);return db[_0xe1ab('0x2f')][_0xe1ab('0x4a')](_0x50eb61)[_0xe1ab('0x25')](handleEntityNotFound(_0x23d33b,null))[_0xe1ab('0x25')](respondWithResult(_0x23d33b,null))[_0xe1ab('0x45')](handleError(_0x23d33b,null));};exports[_0xe1ab('0x4b')]=function(_0x244a46,_0x5dd921,_0x4b4b1e){return db[_0xe1ab('0x2f')][_0xe1ab('0x4a')]({'where':{'id':_0x244a46[_0xe1ab('0x47')]['id']},'attributes':[_0xe1ab('0x2b'),_0xe1ab('0x4c'),_0xe1ab('0x4d')],'raw':!![]})[_0xe1ab('0x25')](handleEntityNotFound(_0x5dd921,null))['then'](function(_0x33f6ee){if(_0x33f6ee){if(!fs['existsSync'](path[_0xe1ab('0x4e')](config['root'],_0xe1ab('0x4f'),_0x33f6ee[_0xe1ab('0x4c')]+'.'+_0x33f6ee[_0xe1ab('0x4d')]))){throw new db[(_0xe1ab('0x50'))][(_0xe1ab('0x51'))](_0xe1ab('0x52'));}return _0x5dd921[_0xe1ab('0x4b')](path[_0xe1ab('0x4e')](config[_0xe1ab('0x53')],_0xe1ab('0x4f'),util[_0xe1ab('0x54')]('%s.%s',_0x33f6ee[_0xe1ab('0x4c')],_0x33f6ee[_0xe1ab('0x4d')])),util[_0xe1ab('0x54')](_0xe1ab('0x55'),_0x33f6ee[_0xe1ab('0x2b')],_0x33f6ee['converted_format']));}return null;})[_0xe1ab('0x45')](handleError(_0x5dd921,null));};exports[_0xe1ab('0x56')]=function(_0x165b20,_0x3d0cd8,_0x53157c){var _0x357a73={'name':path[_0xe1ab('0x57')](_0x165b20[_0xe1ab('0x58')]['originalname'],path[_0xe1ab('0x59')](_0x165b20['file'][_0xe1ab('0x5a')])),'save_name':path[_0xe1ab('0x57')](_0x165b20[_0xe1ab('0x58')][_0xe1ab('0x5b')],path[_0xe1ab('0x59')](_0x165b20['file'][_0xe1ab('0x5b')])),'original_format':path[_0xe1ab('0x59')](_0x165b20[_0xe1ab('0x58')][_0xe1ab('0x5a')])[_0xe1ab('0x5c')](0x1),'converted_format':_0xe1ab('0x5d')};var _0x43e25f=path[_0xe1ab('0x4e')](config['root'],_0xe1ab('0x5e'),_0x165b20[_0xe1ab('0x58')]['filename']);var _0x4474af=path[_0xe1ab('0x4e')](config[_0xe1ab('0x53')],_0xe1ab('0x4f'),util['format'](_0xe1ab('0x55'),path[_0xe1ab('0x57')](_0x165b20[_0xe1ab('0x58')]['filename'],path[_0xe1ab('0x59')](_0x165b20['file'][_0xe1ab('0x5b')])),_0x357a73[_0xe1ab('0x4d')]));logger['info'](_0xe1ab('0x5f'),_0x43e25f);logger[_0xe1ab('0x60')](_0xe1ab('0x61'),_0x4474af);try{fs['chmodSync'](_0x43e25f,parseInt(_0xe1ab('0x62'),0x8));var _0x411468=sox['transcode'](_0x43e25f,_0x4474af,{'sampleRate':0x1f40,'format':_0xe1ab('0x5d'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x411468['on']('error',function(_0x4d9afa){fs[_0xe1ab('0x63')](_0x43e25f);_0x3d0cd8[_0xe1ab('0x18')](0x1f4)[_0xe1ab('0x2c')](_0x4d9afa);});_0x411468['on']('src',function(_0x5c6cba){_0x357a73[_0xe1ab('0x64')]=isNaN(_0x5c6cba[_0xe1ab('0x65')])?null:_0x5c6cba[_0xe1ab('0x65')]*0x3e8;_0x357a73[_0xe1ab('0x66')]=isNaN(_0x5c6cba[_0xe1ab('0x67')])?null:_0x5c6cba[_0xe1ab('0x67')];_0x357a73['original_channelCount']=isNaN(_0x5c6cba[_0xe1ab('0x68')])?null:_0x5c6cba[_0xe1ab('0x68')];_0x357a73['original_bitRate']=isNaN(_0x5c6cba[_0xe1ab('0x69')])?null:_0x5c6cba[_0xe1ab('0x69')];_0x357a73['original_sampleRate']=isNaN(_0x5c6cba['sampleRate'])?null:_0x5c6cba[_0xe1ab('0x6a')];});_0x411468['on'](_0xe1ab('0x6b'),function(_0x2a2f07){_0x357a73[_0xe1ab('0x6c')]=isNaN(_0x2a2f07[_0xe1ab('0x65')])?null:_0x2a2f07[_0xe1ab('0x65')]*0x3e8;_0x357a73[_0xe1ab('0x6d')]=isNaN(_0x2a2f07[_0xe1ab('0x67')])?null:_0x2a2f07[_0xe1ab('0x67')];_0x357a73[_0xe1ab('0x6e')]=isNaN(_0x2a2f07['channelCount'])?null:_0x2a2f07[_0xe1ab('0x68')];_0x357a73['converted_bitRate']=isNaN(_0x2a2f07['bitRate'])?null:_0x2a2f07[_0xe1ab('0x69')];_0x357a73['converted_sampleRate']=isNaN(_0x2a2f07[_0xe1ab('0x6a')])?null:_0x2a2f07[_0xe1ab('0x6a')];});_0x411468['on'](_0xe1ab('0x19'),function(){fs[_0xe1ab('0x6f')](_0x4474af,parseInt(_0xe1ab('0x62'),0x8));return db[_0xe1ab('0x2f')]['create'](_0x357a73)[_0xe1ab('0x25')](function(_0x3e545a){var _0x217501={'role':_0x165b20[_0xe1ab('0x70')][_0xe1ab('0x71')],'userProfileId':_0x165b20[_0xe1ab('0x70')][_0xe1ab('0x72')]};if(!_0x217501)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x217501[_0xe1ab('0x71')]==='user'){var _0x1d02c7=_0x3e545a['get']({'plain':!![]});return db['UserProfileSection'][_0xe1ab('0x4a')]({'where':{'name':_0xe1ab('0x27'),'userProfileId':_0x217501[_0xe1ab('0x72')]},'raw':!![]})['then'](function(_0x27c21e){if(_0x27c21e&&_0x27c21e[_0xe1ab('0x73')]===0x0){return db[_0xe1ab('0x28')][_0xe1ab('0x56')]({'name':_0x1d02c7[_0xe1ab('0x2b')],'resourceId':_0x1d02c7['id'],'type':_0x27c21e[_0xe1ab('0x2b')],'sectionId':_0x27c21e['id']},{})['then'](function(){return _0x3e545a;});}else{return _0x3e545a;}})[_0xe1ab('0x45')](function(_0x533556){logger[_0xe1ab('0x74')](_0xe1ab('0x75'),_0x533556);throw _0x533556;});}return _0x3e545a;})['then'](respondWithResult(_0x3d0cd8,null))[_0xe1ab('0x45')](handleError(_0x3d0cd8,null));});_0x411468['start']();}catch(_0x3df63a){_0x3d0cd8['status'](0x1f4)['send'](_0x3df63a);}};exports[_0xe1ab('0x23')]=function(_0x53f4bd,_0x357ff8,_0xa5723b){return db[_0xe1ab('0x2f')]['find']({'where':{'id':_0x53f4bd[_0xe1ab('0x47')]['id']}})[_0xe1ab('0x25')](handleEntityNotFound(_0x357ff8,null))[_0xe1ab('0x25')](saveUpdates(_[_0xe1ab('0x76')](_0x53f4bd['body'],['name',_0xe1ab('0x77')]),null))[_0xe1ab('0x25')](respondWithResult(_0x357ff8,null))[_0xe1ab('0x45')](handleError(_0x357ff8,null));};exports['delete']=function(_0x361cec,_0x5b6695,_0x1135b0){return db[_0xe1ab('0x2f')][_0xe1ab('0x4a')]({'where':{'id':_0x361cec[_0xe1ab('0x47')]['id']}})[_0xe1ab('0x25')](function(_0x4af104){if(_0x4af104){return _0x4af104['destroy']();}})[_0xe1ab('0x25')](function(_0x36dae1){var _0xeb8d29=path['join'](config[_0xe1ab('0x53')],_0xe1ab('0x5e'),util[_0xe1ab('0x54')]('%s.%s',_0x36dae1[_0xe1ab('0x4c')],_0x36dae1[_0xe1ab('0x78')]));var _0x21bc4a=path[_0xe1ab('0x4e')](config[_0xe1ab('0x53')],_0xe1ab('0x4f'),util['format'](_0xe1ab('0x55'),_0x36dae1[_0xe1ab('0x4c')],_0x36dae1['converted_format']));fs[_0xe1ab('0x63')](_0xeb8d29);fs[_0xe1ab('0x63')](_0x21bc4a);return _0x36dae1;})[_0xe1ab('0x25')](function(_0x50f109){if(_0x50f109){return _0x5b6695[_0xe1ab('0x18')](0xcc)['end']();}})[_0xe1ab('0x25')](handleEntityNotFound(_0x5b6695,null))[_0xe1ab('0x45')](handleError(_0x5b6695,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index bea9f2e..795b763 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 _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 +var _0xa822=['util','../../config/logger','request-promise','path','../../config/environment','exports','define','Sound','tools_sounds','lodash'];(function(_0x4aecfa,_0x28c3bd){var _0x3659d0=function(_0x1e96ce){while(--_0x1e96ce){_0x4aecfa['push'](_0x4aecfa['shift']());}};_0x3659d0(++_0x28c3bd);}(_0xa822,0x1c1));var _0x2a82=function(_0x3b6f58,_0x5870de){_0x3b6f58=_0x3b6f58-0x0;var _0x987c61=_0xa822[_0x3b6f58];return _0x987c61;};'use strict';var _=require(_0x2a82('0x0'));var util=require(_0x2a82('0x1'));var logger=require(_0x2a82('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2a82('0x3'));var fs=require('fs');var path=require(_0x2a82('0x4'));var rimraf=require('rimraf');var config=require(_0x2a82('0x5'));var attributes=require('./sound.attributes');module[_0x2a82('0x6')]=function(_0x4c404f,_0x1a5a19){return _0x4c404f[_0x2a82('0x7')](_0x2a82('0x8'),attributes,{'tableName':_0x2a82('0x9'),'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 13f6600..e4912f8 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 _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 +var _0xa45b=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x382e63,_0x1cacb8){var _0x535dc7=function(_0xa4ec75){while(--_0xa4ec75){_0x382e63['push'](_0x382e63['shift']());}};_0x535dc7(++_0x1cacb8);}(_0xa45b,0x16f));var _0xba45=function(_0x295b29,_0xaa787d){_0x295b29=_0x295b29-0x0;var _0x16a03b=_0xa45b[_0x295b29];return _0x16a03b;};'use strict';var _=require(_0xba45('0x0'));var util=require(_0xba45('0x1'));var moment=require(_0xba45('0x2'));var BPromise=require(_0xba45('0x3'));var rs=require(_0xba45('0x4'));var fs=require('fs');var Redis=require(_0xba45('0x5'));var db=require(_0xba45('0x6'))['db'];var utils=require(_0xba45('0x7'));var logger=require('../../config/logger')(_0xba45('0x8'));var config=require(_0xba45('0x9'));var jayson=require(_0xba45('0xa'));var client=jayson[_0xba45('0xb')][_0xba45('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb50023,_0x3bee7b,_0x4feceb){return new BPromise(function(_0x257746,_0x388e94){return client[_0xba45('0xd')](_0xb50023,_0x4feceb)[_0xba45('0xe')](function(_0xe035e2){logger[_0xba45('0xf')](_0xba45('0x10'),_0x3bee7b,'request\x20sent');logger[_0xba45('0x11')]('Sound,\x20%s,\x20%s,\x20%s',_0x3bee7b,'request\x20sent',JSON[_0xba45('0x12')](_0xe035e2));if(_0xe035e2[_0xba45('0x13')]){if(_0xe035e2['error'][_0xba45('0x14')]===0x1f4){logger[_0xba45('0x13')](_0xba45('0x10'),_0x3bee7b,_0xe035e2[_0xba45('0x13')]['message']);return _0x388e94(_0xe035e2['error'][_0xba45('0x15')]);}logger['error'](_0xba45('0x10'),_0x3bee7b,_0xe035e2[_0xba45('0x13')][_0xba45('0x15')]);return _0x257746(_0xe035e2[_0xba45('0x13')][_0xba45('0x15')]);}else{logger[_0xba45('0xf')](_0xba45('0x10'),_0x3bee7b,_0xba45('0x16'));_0x257746(_0xe035e2[_0xba45('0x17')][_0xba45('0x15')]);}})['catch'](function(_0x3e1fbb){logger[_0xba45('0x13')](_0xba45('0x10'),_0x3bee7b,_0x3e1fbb);_0x388e94(_0x3e1fbb);});});}exports[_0xba45('0x18')]=function(_0x2a0e8b){var _0x474a4e=this;return new Promise(function(_0x45fdcc,_0x2c8d75){return db[_0xba45('0x19')][_0xba45('0x1a')]({'raw':_0x2a0e8b[_0xba45('0x1b')]?_0x2a0e8b['options'][_0xba45('0x1c')]===undefined?!![]:![]:!![],'where':_0x2a0e8b[_0xba45('0x1b')]?_0x2a0e8b[_0xba45('0x1b')][_0xba45('0x1d')]||null:null,'attributes':_0x2a0e8b[_0xba45('0x1b')]?_0x2a0e8b[_0xba45('0x1b')][_0xba45('0x1e')]||null:null,'include':_0x2a0e8b['options']?_0x2a0e8b[_0xba45('0x1b')][_0xba45('0x1f')]?_[_0xba45('0x20')](_0x2a0e8b[_0xba45('0x1b')][_0xba45('0x1f')],function(_0x1f4f9d){return{'model':db[_0x1f4f9d[_0xba45('0x21')]],'as':_0x1f4f9d['as'],'attributes':_0x1f4f9d[_0xba45('0x1e')],'include':_0x1f4f9d['include']?_[_0xba45('0x20')](_0x1f4f9d[_0xba45('0x1f')],function(_0x33a413){return{'model':db[_0x33a413['model']],'as':_0x33a413['as'],'attributes':_0x33a413[_0xba45('0x1e')],'include':_0x33a413[_0xba45('0x1f')]?_[_0xba45('0x20')](_0x33a413[_0xba45('0x1f')],function(_0x2810bc){return{'model':db[_0x2810bc[_0xba45('0x21')]],'as':_0x2810bc['as'],'attributes':_0x2810bc['attributes']};}):[]};}):[]};}):[]:[]})[_0xba45('0xe')](function(_0x52eda){logger[_0xba45('0xf')](_0xba45('0x18'),_0x2a0e8b);logger[_0xba45('0x11')](_0xba45('0x18'),_0x2a0e8b,JSON[_0xba45('0x12')](_0x52eda));_0x45fdcc(_0x52eda);})['catch'](function(_0x156549){logger[_0xba45('0x13')](_0xba45('0x18'),_0x156549[_0xba45('0x15')],_0x2a0e8b);_0x2c8d75(_0x474a4e[_0xba45('0x13')](0x1f4,_0x156549[_0xba45('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index ec8c237..59a7c67 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 _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 +var _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x39d49f,_0x2d3fd8){_0x39d49f=_0x39d49f-0x0;var _0x45903e=_0x9ffd[_0x39d49f];return _0x45903e;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 5ebf013..798e8d1 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 _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 +var _0x3e91=['TEXT','medium','ENUM','out','sequelize','exports','STRING'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3e91,0x13f));var _0x13e9=function(_0x69188b,_0x550923){_0x69188b=_0x69188b-0x0;var _0x3320f4=_0x3e91[_0x69188b];return _0x3320f4;};'use strict';var Sequelize=require(_0x13e9('0x0'));module[_0x13e9('0x1')]={'uniqueid':{'type':Sequelize[_0x13e9('0x2')]},'body':{'type':Sequelize[_0x13e9('0x3')](_0x13e9('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x13e9('0x5')]('in',_0x13e9('0x6')),'defaultValue':_0x13e9('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0x13e9('0x2')]},'providerResponse':{'type':Sequelize[_0x13e9('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 54bc911..bb61a54 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 _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 +var _0xc8d6=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','params','keys','include','find','create','body','eml-format','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','SquareMessage','rawAttributes','fieldName','type','model','map','query'];(function(_0x5f4edc,_0x3abaad){var _0x4bbcaa=function(_0x1b8299){while(--_0x1b8299){_0x5f4edc['push'](_0x5f4edc['shift']());}};_0x4bbcaa(++_0x3abaad);}(_0xc8d6,0x194));var _0x6c8d=function(_0x1bc445,_0x2d6fe0){_0x1bc445=_0x1bc445-0x0;var _0x589e6b=_0xc8d6[_0x1bc445];return _0x589e6b;};'use strict';var emlformat=require(_0x6c8d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6c8d('0x1'));var rp=require('request-promise');var moment=require(_0x6c8d('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6c8d('0x3'));var path=require(_0x6c8d('0x4'));var sox=require(_0x6c8d('0x5'));var csv=require(_0x6c8d('0x6'));var ejs=require(_0x6c8d('0x7'));var fs=require('fs');var fs_extra=require(_0x6c8d('0x8'));var _=require(_0x6c8d('0x9'));var squel=require(_0x6c8d('0xa'));var crypto=require('crypto');var jsforce=require(_0x6c8d('0xb'));var deskjs=require(_0x6c8d('0xc'));var toCsv=require(_0x6c8d('0x6'));var querystring=require(_0x6c8d('0xd'));var Papa=require(_0x6c8d('0xe'));var Redis=require(_0x6c8d('0xf'));var authService=require(_0x6c8d('0x10'));var qs=require(_0x6c8d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c8d('0x12'));var logger=require(_0x6c8d('0x13'))(_0x6c8d('0x14'));var utils=require(_0x6c8d('0x15'));var config=require(_0x6c8d('0x16'));var licenseUtil=require(_0x6c8d('0x17'));var db=require(_0x6c8d('0x18'))['db'];function respondWithStatusCode(_0x2579a0,_0x3cfc6c){_0x3cfc6c=_0x3cfc6c||0xcc;return function(_0x7036b9){if(_0x7036b9){return _0x2579a0[_0x6c8d('0x19')](_0x3cfc6c);}return _0x2579a0[_0x6c8d('0x1a')](_0x3cfc6c)[_0x6c8d('0x1b')]();};}function respondWithResult(_0x226e99,_0x21187c){_0x21187c=_0x21187c||0xc8;return function(_0xe3b8d1){if(_0xe3b8d1){return _0x226e99[_0x6c8d('0x1a')](_0x21187c)[_0x6c8d('0x1c')](_0xe3b8d1);}};}function respondWithFilteredResult(_0x57b9ee,_0x1a812d){return function(_0x2cf347){if(_0x2cf347){var _0x35b02f=typeof _0x1a812d[_0x6c8d('0x1d')]===_0x6c8d('0x1e')&&typeof _0x1a812d['limit']===_0x6c8d('0x1e');var _0x5837d4=_0x2cf347['count'];var _0x42bab1=_0x35b02f?0x0:_0x1a812d[_0x6c8d('0x1d')];var _0x31b204=_0x35b02f?_0x2cf347[_0x6c8d('0x1f')]:_0x1a812d[_0x6c8d('0x1d')]+_0x1a812d[_0x6c8d('0x20')];var _0x57ac31;if(_0x31b204>=_0x5837d4){_0x31b204=_0x5837d4;_0x57ac31=0xc8;}else{_0x57ac31=0xce;}_0x57b9ee[_0x6c8d('0x1a')](_0x57ac31);return _0x57b9ee[_0x6c8d('0x21')](_0x6c8d('0x22'),_0x42bab1+'-'+_0x31b204+'/'+_0x5837d4)[_0x6c8d('0x1c')](_0x2cf347);}return null;};}function patchUpdates(_0x50738f){return function(_0x5db193){try{jsonpatch[_0x6c8d('0x23')](_0x5db193,_0x50738f,!![]);}catch(_0x1441a8){return BPromise[_0x6c8d('0x24')](_0x1441a8);}return _0x5db193[_0x6c8d('0x25')]();};}function saveUpdates(_0x33baa4,_0x2e416c){return function(_0x2b46b2){if(_0x2b46b2){return _0x2b46b2[_0x6c8d('0x26')](_0x33baa4)[_0x6c8d('0x27')](function(_0x38eb33){return _0x38eb33;});}return null;};}function removeEntity(_0x4c3a43,_0xa81a7e){return function(_0x34be1f){if(_0x34be1f){return _0x34be1f[_0x6c8d('0x28')]()[_0x6c8d('0x27')](function(){_0x4c3a43[_0x6c8d('0x1a')](0xcc)[_0x6c8d('0x1b')]();});}};}function handleEntityNotFound(_0x38d310,_0x577a29){return function(_0x16cbd9){if(!_0x16cbd9){_0x38d310['sendStatus'](0x194);}return _0x16cbd9;};}function handleError(_0xc3dab4,_0x370eb0){_0x370eb0=_0x370eb0||0x1f4;return function(_0x3a37ce){logger[_0x6c8d('0x29')](_0x3a37ce[_0x6c8d('0x2a')]);if(_0x3a37ce[_0x6c8d('0x2b')]){delete _0x3a37ce[_0x6c8d('0x2b')];}_0xc3dab4[_0x6c8d('0x1a')](_0x370eb0)['send'](_0x3a37ce);};}exports[_0x6c8d('0x2c')]=function(_0x35a384,_0x5e8aaa){var _0x362112={},_0x8633cd={},_0x1f0846={'count':0x0,'rows':[]};var _0x400907=_['map'](db[_0x6c8d('0x2d')][_0x6c8d('0x2e')],function(_0x58f91c){return{'name':_0x58f91c[_0x6c8d('0x2f')],'type':_0x58f91c[_0x6c8d('0x30')]['key']};});_0x8633cd[_0x6c8d('0x31')]=_[_0x6c8d('0x32')](_0x400907,_0x6c8d('0x2b'));_0x8633cd[_0x6c8d('0x33')]=_['keys'](_0x35a384[_0x6c8d('0x33')]);_0x8633cd[_0x6c8d('0x34')]=_[_0x6c8d('0x35')](_0x8633cd[_0x6c8d('0x31')],_0x8633cd[_0x6c8d('0x33')]);_0x362112[_0x6c8d('0x36')]=_[_0x6c8d('0x35')](_0x8633cd[_0x6c8d('0x31')],qs[_0x6c8d('0x37')](_0x35a384[_0x6c8d('0x33')]['fields']));_0x362112[_0x6c8d('0x36')]=_0x362112[_0x6c8d('0x36')][_0x6c8d('0x38')]?_0x362112[_0x6c8d('0x36')]:_0x8633cd[_0x6c8d('0x31')];if(!_0x35a384['query'][_0x6c8d('0x39')](_0x6c8d('0x3a'))){_0x362112[_0x6c8d('0x20')]=qs[_0x6c8d('0x20')](_0x35a384[_0x6c8d('0x33')]['limit']);_0x362112['offset']=qs[_0x6c8d('0x1d')](_0x35a384[_0x6c8d('0x33')][_0x6c8d('0x1d')]);}_0x362112[_0x6c8d('0x3b')]=qs[_0x6c8d('0x3c')](_0x35a384['query']['sort']);_0x362112[_0x6c8d('0x3d')]=qs[_0x6c8d('0x34')](_[_0x6c8d('0x3e')](_0x35a384['query'],_0x8633cd['filters']),_0x400907);if(_0x35a384[_0x6c8d('0x33')][_0x6c8d('0x3f')]){_0x362112['where']=_[_0x6c8d('0x40')](_0x362112[_0x6c8d('0x3d')],{'$or':_[_0x6c8d('0x32')](_0x400907,function(_0xcd2f88){if(_0xcd2f88[_0x6c8d('0x30')]!=='VIRTUAL'){var _0x5ea3ea={};_0x5ea3ea[_0xcd2f88[_0x6c8d('0x2b')]]={'$like':'%'+_0x35a384['query'][_0x6c8d('0x3f')]+'%'};return _0x5ea3ea;}})});}_0x362112=_[_0x6c8d('0x40')]({},_0x362112,_0x35a384[_0x6c8d('0x41')]);var _0x197a08={'where':_0x362112[_0x6c8d('0x3d')]};return db[_0x6c8d('0x2d')][_0x6c8d('0x1f')](_0x197a08)[_0x6c8d('0x27')](function(_0x3843ba){_0x1f0846[_0x6c8d('0x1f')]=_0x3843ba;if(_0x35a384[_0x6c8d('0x33')][_0x6c8d('0x42')]){_0x362112['include']=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x362112);})[_0x6c8d('0x27')](function(_0x32dca7){_0x1f0846[_0x6c8d('0x43')]=_0x32dca7;return _0x1f0846;})['then'](respondWithFilteredResult(_0x5e8aaa,_0x362112))[_0x6c8d('0x44')](handleError(_0x5e8aaa,null));};exports[_0x6c8d('0x45')]=function(_0x35b388,_0x449930){var _0x6aade4={'raw':!![],'where':{'id':_0x35b388[_0x6c8d('0x46')]['id']}},_0x512afb={};_0x512afb[_0x6c8d('0x31')]=_[_0x6c8d('0x47')](db[_0x6c8d('0x2d')][_0x6c8d('0x2e')]);_0x512afb['query']=_[_0x6c8d('0x47')](_0x35b388['query']);_0x512afb[_0x6c8d('0x34')]=_[_0x6c8d('0x35')](_0x512afb[_0x6c8d('0x31')],_0x512afb[_0x6c8d('0x33')]);_0x6aade4[_0x6c8d('0x36')]=_[_0x6c8d('0x35')](_0x512afb[_0x6c8d('0x31')],qs[_0x6c8d('0x37')](_0x35b388[_0x6c8d('0x33')][_0x6c8d('0x37')]));_0x6aade4[_0x6c8d('0x36')]=_0x6aade4[_0x6c8d('0x36')]['length']?_0x6aade4[_0x6c8d('0x36')]:_0x512afb['model'];if(_0x35b388[_0x6c8d('0x33')]['includeAll']){_0x6aade4[_0x6c8d('0x48')]=[{'all':!![]}];}_0x6aade4=_[_0x6c8d('0x40')]({},_0x6aade4,_0x35b388[_0x6c8d('0x41')]);return db['SquareMessage'][_0x6c8d('0x49')](_0x6aade4)[_0x6c8d('0x27')](handleEntityNotFound(_0x449930,null))[_0x6c8d('0x27')](respondWithResult(_0x449930,null))[_0x6c8d('0x44')](handleError(_0x449930,null));};exports[_0x6c8d('0x4a')]=function(_0x983977,_0x34cf58){return db[_0x6c8d('0x2d')][_0x6c8d('0x4a')](_0x983977[_0x6c8d('0x4b')],{})[_0x6c8d('0x27')](respondWithResult(_0x34cf58,0xc9))['catch'](handleError(_0x34cf58,null));};exports[_0x6c8d('0x26')]=function(_0x2d4944,_0x598bb3){if(_0x2d4944[_0x6c8d('0x4b')]['id']){delete _0x2d4944['body']['id'];}return db[_0x6c8d('0x2d')]['find']({'where':{'id':_0x2d4944[_0x6c8d('0x46')]['id']}})[_0x6c8d('0x27')](handleEntityNotFound(_0x598bb3,null))[_0x6c8d('0x27')](saveUpdates(_0x2d4944[_0x6c8d('0x4b')],null))[_0x6c8d('0x27')](respondWithResult(_0x598bb3,null))[_0x6c8d('0x44')](handleError(_0x598bb3,null));};exports[_0x6c8d('0x28')]=function(_0x5eecc5,_0x538b9c){return db[_0x6c8d('0x2d')][_0x6c8d('0x49')]({'where':{'id':_0x5eecc5[_0x6c8d('0x46')]['id']}})[_0x6c8d('0x27')](handleEntityNotFound(_0x538b9c,null))[_0x6c8d('0x27')](removeEntity(_0x538b9c,null))[_0x6c8d('0x44')](handleError(_0x538b9c,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 4e8b162..846d80f 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 _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 +var _0x2b55=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','SquareMessage','lodash'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x2b55,0x77));var _0x52b5=function(_0x133440,_0x4cb0b8){_0x133440=_0x133440-0x0;var _0x370f72=_0x2b55[_0x133440];return _0x370f72;};'use strict';var _=require(_0x52b5('0x0'));var util=require('util');var logger=require(_0x52b5('0x1'))(_0x52b5('0x2'));var moment=require(_0x52b5('0x3'));var BPromise=require(_0x52b5('0x4'));var rp=require(_0x52b5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x52b5('0x6'));var config=require(_0x52b5('0x7'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x1fbfe8,_0x1a61f8){return _0x1fbfe8[_0x52b5('0x8')](_0x52b5('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 8270581..856146b 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 _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 +var _0x9bfa=['../../config/environment','jayson/promise','client','http','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareMessage','create','options','raw','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc'];(function(_0x2e6c19,_0x131233){var _0x52885d=function(_0x38f224){while(--_0x38f224){_0x2e6c19['push'](_0x2e6c19['shift']());}};_0x52885d(++_0x131233);}(_0x9bfa,0xa2));var _0xa9bf=function(_0x5797fc,_0x552320){_0x5797fc=_0x5797fc-0x0;var _0x993e9d=_0x9bfa[_0x5797fc];return _0x993e9d;};'use strict';var _=require(_0xa9bf('0x0'));var util=require('util');var moment=require(_0xa9bf('0x1'));var BPromise=require(_0xa9bf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa9bf('0x3'));var logger=require(_0xa9bf('0x4'))(_0xa9bf('0x5'));var config=require(_0xa9bf('0x6'));var jayson=require(_0xa9bf('0x7'));var client=jayson[_0xa9bf('0x8')][_0xa9bf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3756fe,_0x5a25b2,_0x13a48d){return new BPromise(function(_0xa0c724,_0x2a776f){return client['request'](_0x3756fe,_0x13a48d)['then'](function(_0x562b7d){logger[_0xa9bf('0xa')](_0xa9bf('0xb'),_0x5a25b2,_0xa9bf('0xc'));logger[_0xa9bf('0xd')](_0xa9bf('0xe'),_0x5a25b2,'request\x20sent',JSON[_0xa9bf('0xf')](_0x562b7d));if(_0x562b7d['error']){if(_0x562b7d[_0xa9bf('0x10')]['code']===0x1f4){logger[_0xa9bf('0x10')](_0xa9bf('0xb'),_0x5a25b2,_0x562b7d[_0xa9bf('0x10')]['message']);return _0x2a776f(_0x562b7d['error'][_0xa9bf('0x11')]);}logger[_0xa9bf('0x10')]('SquareMessage,\x20%s,\x20%s',_0x5a25b2,_0x562b7d[_0xa9bf('0x10')][_0xa9bf('0x11')]);return _0xa0c724(_0x562b7d[_0xa9bf('0x10')][_0xa9bf('0x11')]);}else{logger[_0xa9bf('0xa')](_0xa9bf('0xb'),_0x5a25b2,'request\x20sent');_0xa0c724(_0x562b7d[_0xa9bf('0x12')][_0xa9bf('0x11')]);}})[_0xa9bf('0x13')](function(_0x4c4257){logger[_0xa9bf('0x10')](_0xa9bf('0xb'),_0x5a25b2,_0x4c4257);_0x2a776f(_0x4c4257);});});}exports[_0xa9bf('0x14')]=function(_0x560a07){var _0x2707b1=this;return new Promise(function(_0x30e617,_0x2f55e7){return db['SquareMessage'][_0xa9bf('0x15')](_0x560a07['body'],{'raw':_0x560a07[_0xa9bf('0x16')]?_0x560a07[_0xa9bf('0x16')][_0xa9bf('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x1dcddf){logger[_0xa9bf('0xa')](_0xa9bf('0x14'),_0x560a07);logger[_0xa9bf('0xd')](_0xa9bf('0x14'),_0x560a07,JSON['stringify'](_0x1dcddf));_0x30e617(_0x1dcddf);})[_0xa9bf('0x13')](function(_0xf680d3){logger[_0xa9bf('0x10')]('CreateSquareMessage',_0xf680d3['message'],_0x560a07);_0x2f55e7(_0x2707b1[_0xa9bf('0x10')](0x1f4,_0xf680d3[_0xa9bf('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 39e52c6..b769fa8 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 _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 +var _0x85e6=['/:id','show','/:id/test','15s','post','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated'];(function(_0x1f0c0c,_0x249572){var _0x3e188e=function(_0x50a31e){while(--_0x50a31e){_0x1f0c0c['push'](_0x1f0c0c['shift']());}};_0x3e188e(++_0x249572);}(_0x85e6,0x8e));var _0x685e=function(_0x230475,_0x11d991){_0x230475=_0x230475-0x0;var _0x441f2c=_0x85e6[_0x230475];return _0x441f2c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x685e('0x0'));var timeout=require(_0x685e('0x1'));var express=require(_0x685e('0x2'));var router=express[_0x685e('0x3')]();var fs_extra=require(_0x685e('0x4'));var auth=require(_0x685e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x685e('0x6'));var controller=require(_0x685e('0x7'));router[_0x685e('0x8')]('/',auth[_0x685e('0x9')](),controller['index']);router[_0x685e('0x8')](_0x685e('0xa'),auth[_0x685e('0x9')](),controller[_0x685e('0xb')]);router[_0x685e('0x8')](_0x685e('0xc'),auth[_0x685e('0x9')](),timeout(_0x685e('0xd')),controller['test']);router[_0x685e('0xe')]('/',auth[_0x685e('0x9')](),controller['create']);router[_0x685e('0xf')](_0x685e('0xa'),auth[_0x685e('0x9')](),controller[_0x685e('0x10')]);router[_0x685e('0x11')](_0x685e('0xa'),auth[_0x685e('0x9')](),controller['destroy']);module[_0x685e('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index b879fbd..f733df9 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 _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 +var _0x239b=['STRING','name','exports'];(function(_0x44eaab,_0x5eca55){var _0x3f6818=function(_0x447ce7){while(--_0x447ce7){_0x44eaab['push'](_0x44eaab['shift']());}};_0x3f6818(++_0x5eca55);}(_0x239b,0xd1));var _0xb239=function(_0x1c4e9c,_0x467ac6){_0x1c4e9c=_0x1c4e9c-0x0;var _0xac45c1=_0x239b[_0x1c4e9c];return _0xac45c1;};'use strict';var Sequelize=require('sequelize');module[_0xb239('0x0')]={'name':{'type':Sequelize[_0xb239('0x1')],'unique':_0xb239('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xb239('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index fac8d22..139ba6a 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 _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 +var _0x39c1=['dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','then','get','destroy','error','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','test'];(function(_0xb9655b,_0x52d5fb){var _0x27ebaa=function(_0xfa5363){while(--_0xfa5363){_0xb9655b['push'](_0xb9655b['shift']());}};_0x27ebaa(++_0x52d5fb);}(_0x39c1,0xac));var _0x139c=function(_0x44bb1d,_0x130b30){_0x44bb1d=_0x44bb1d-0x0;var _0x380ed5=_0x39c1[_0x44bb1d];return _0x380ed5;};'use strict';var emlformat=require(_0x139c('0x0'));var rimraf=require(_0x139c('0x1'));var zipdir=require(_0x139c('0x2'));var jsonpatch=require(_0x139c('0x3'));var rp=require(_0x139c('0x4'));var moment=require(_0x139c('0x5'));var BPromise=require(_0x139c('0x6'));var Mustache=require(_0x139c('0x7'));var util=require(_0x139c('0x8'));var path=require(_0x139c('0x9'));var sox=require(_0x139c('0xa'));var csv=require(_0x139c('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x139c('0xc'));var _=require(_0x139c('0xd'));var squel=require(_0x139c('0xe'));var crypto=require('crypto');var jsforce=require(_0x139c('0xf'));var deskjs=require(_0x139c('0x10'));var toCsv=require(_0x139c('0xb'));var querystring=require(_0x139c('0x11'));var Papa=require(_0x139c('0x12'));var Redis=require('ioredis');var authService=require(_0x139c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x139c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x139c('0x15'))(_0x139c('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x139c('0x17'));var db=require(_0x139c('0x18'))['db'];function respondWithStatusCode(_0x175604,_0x485ca1){_0x485ca1=_0x485ca1||0xcc;return function(_0x5055ca){if(_0x5055ca){return _0x175604[_0x139c('0x19')](_0x485ca1);}return _0x175604[_0x139c('0x1a')](_0x485ca1)[_0x139c('0x1b')]();};}function respondWithResult(_0x1208f4,_0x31c522){_0x31c522=_0x31c522||0xc8;return function(_0x33c8c7){if(_0x33c8c7){return _0x1208f4[_0x139c('0x1a')](_0x31c522)[_0x139c('0x1c')](_0x33c8c7);}};}function respondWithFilteredResult(_0x597953,_0xf55b02){return function(_0x23ab2){if(_0x23ab2){var _0xe7b2b0=typeof _0xf55b02[_0x139c('0x1d')]==='undefined'&&typeof _0xf55b02[_0x139c('0x1e')]==='undefined';var _0x4f382=_0x23ab2[_0x139c('0x1f')];var _0x196d1e=_0xe7b2b0?0x0:_0xf55b02['offset'];var _0x1078ed=_0xe7b2b0?_0x23ab2[_0x139c('0x1f')]:_0xf55b02[_0x139c('0x1d')]+_0xf55b02[_0x139c('0x1e')];var _0x3fc76a;if(_0x1078ed>=_0x4f382){_0x1078ed=_0x4f382;_0x3fc76a=0xc8;}else{_0x3fc76a=0xce;}_0x597953[_0x139c('0x1a')](_0x3fc76a);return _0x597953[_0x139c('0x20')](_0x139c('0x21'),_0x196d1e+'-'+_0x1078ed+'/'+_0x4f382)[_0x139c('0x1c')](_0x23ab2);}return null;};}function patchUpdates(_0xb307ec){return function(_0x55f43d){try{jsonpatch[_0x139c('0x22')](_0x55f43d,_0xb307ec,!![]);}catch(_0x5ec86e){return BPromise['reject'](_0x5ec86e);}return _0x55f43d['save']();};}function saveUpdates(_0x229a75,_0x2e8c62){return function(_0x3cdc94){if(_0x3cdc94){return _0x3cdc94['update'](_0x229a75)[_0x139c('0x23')](function(_0x4b1ab6){return _0x4b1ab6;});}return null;};}function removeEntity(_0x38ac8a,_0x4bf9f4){return function(_0x40f24d){if(_0x40f24d){return _0x40f24d['destroy']()[_0x139c('0x23')](function(){var _0x1a185c=_0x40f24d[_0x139c('0x24')]({'plain':!![]});var _0x35c24a='ODBC';return db['UserProfileResource'][_0x139c('0x25')]({'where':{'type':_0x35c24a,'resourceId':_0x1a185c['id']}})['then'](function(){return _0x40f24d;});})[_0x139c('0x23')](function(){_0x38ac8a[_0x139c('0x1a')](0xcc)[_0x139c('0x1b')]();});}};}function handleEntityNotFound(_0x350365,_0x562025){return function(_0x588c41){if(!_0x588c41){_0x350365['sendStatus'](0x194);}return _0x588c41;};}function handleError(_0x935675,_0x4149c2){_0x4149c2=_0x4149c2||0x1f4;return function(_0x4afdcc){logger[_0x139c('0x26')](_0x4afdcc[_0x139c('0x27')]);if(_0x4afdcc['name']){delete _0x4afdcc[_0x139c('0x28')];}_0x935675[_0x139c('0x1a')](_0x4149c2)[_0x139c('0x29')](_0x4afdcc);};}exports['index']=function(_0x222dca,_0x2b35c4){var _0x30c196={},_0x14b6dd={},_0x207e64={'count':0x0,'rows':[]};var _0x3ac27d=_[_0x139c('0x2a')](db[_0x139c('0x2b')][_0x139c('0x2c')],function(_0x30f911){return{'name':_0x30f911[_0x139c('0x2d')],'type':_0x30f911[_0x139c('0x2e')][_0x139c('0x2f')]};});_0x14b6dd[_0x139c('0x30')]=_[_0x139c('0x2a')](_0x3ac27d,_0x139c('0x28'));_0x14b6dd['query']=_[_0x139c('0x31')](_0x222dca[_0x139c('0x32')]);_0x14b6dd[_0x139c('0x33')]=_[_0x139c('0x34')](_0x14b6dd[_0x139c('0x30')],_0x14b6dd[_0x139c('0x32')]);_0x30c196[_0x139c('0x35')]=_[_0x139c('0x34')](_0x14b6dd[_0x139c('0x30')],qs['fields'](_0x222dca[_0x139c('0x32')]['fields']));_0x30c196[_0x139c('0x35')]=_0x30c196[_0x139c('0x35')][_0x139c('0x36')]?_0x30c196['attributes']:_0x14b6dd['model'];if(!_0x222dca[_0x139c('0x32')][_0x139c('0x37')](_0x139c('0x38'))){_0x30c196['limit']=qs['limit'](_0x222dca[_0x139c('0x32')][_0x139c('0x1e')]);_0x30c196[_0x139c('0x1d')]=qs[_0x139c('0x1d')](_0x222dca['query'][_0x139c('0x1d')]);}_0x30c196['order']=qs[_0x139c('0x39')](_0x222dca[_0x139c('0x32')][_0x139c('0x39')]);_0x30c196[_0x139c('0x3a')]=qs[_0x139c('0x33')](_['pick'](_0x222dca[_0x139c('0x32')],_0x14b6dd['filters']),_0x3ac27d);if(_0x222dca[_0x139c('0x32')][_0x139c('0x3b')]){_0x30c196['where']=_[_0x139c('0x3c')](_0x30c196[_0x139c('0x3a')],{'$or':_['map'](_0x3ac27d,function(_0x4998c5){if(_0x4998c5[_0x139c('0x2e')]!==_0x139c('0x3d')){var _0x41a530={};_0x41a530[_0x4998c5[_0x139c('0x28')]]={'$like':'%'+_0x222dca['query'][_0x139c('0x3b')]+'%'};return _0x41a530;}})});}_0x30c196=_[_0x139c('0x3c')]({},_0x30c196,_0x222dca[_0x139c('0x3e')]);var _0x298098={'where':_0x30c196[_0x139c('0x3a')]};return db['SquareOdbc']['count'](_0x298098)[_0x139c('0x23')](function(_0xa7d402){_0x207e64['count']=_0xa7d402;if(_0x222dca['query'][_0x139c('0x3f')]){_0x30c196[_0x139c('0x40')]=[{'all':!![]}];}return db[_0x139c('0x2b')][_0x139c('0x41')](_0x30c196);})['then'](function(_0x3741de){_0x207e64[_0x139c('0x42')]=_0x3741de;return _0x207e64;})[_0x139c('0x23')](respondWithFilteredResult(_0x2b35c4,_0x30c196))['catch'](handleError(_0x2b35c4,null));};exports[_0x139c('0x43')]=function(_0x44f9bc,_0x49cc68){var _0x1291e7={'raw':!![],'where':{'id':_0x44f9bc[_0x139c('0x44')]['id']}},_0x2e8ef8={};_0x2e8ef8[_0x139c('0x30')]=_[_0x139c('0x31')](db['SquareOdbc'][_0x139c('0x2c')]);_0x2e8ef8['query']=_[_0x139c('0x31')](_0x44f9bc[_0x139c('0x32')]);_0x2e8ef8[_0x139c('0x33')]=_[_0x139c('0x34')](_0x2e8ef8['model'],_0x2e8ef8[_0x139c('0x32')]);_0x1291e7[_0x139c('0x35')]=_[_0x139c('0x34')](_0x2e8ef8[_0x139c('0x30')],qs['fields'](_0x44f9bc[_0x139c('0x32')]['fields']));_0x1291e7[_0x139c('0x35')]=_0x1291e7[_0x139c('0x35')][_0x139c('0x36')]?_0x1291e7['attributes']:_0x2e8ef8[_0x139c('0x30')];if(_0x44f9bc[_0x139c('0x32')][_0x139c('0x3f')]){_0x1291e7['include']=[{'all':!![]}];}_0x1291e7=_[_0x139c('0x3c')]({},_0x1291e7,_0x44f9bc[_0x139c('0x3e')]);return db[_0x139c('0x2b')][_0x139c('0x45')](_0x1291e7)[_0x139c('0x23')](handleEntityNotFound(_0x49cc68,null))[_0x139c('0x23')](respondWithResult(_0x49cc68,null))['catch'](handleError(_0x49cc68,null));};exports[_0x139c('0x46')]=function(_0x2b092d,_0x4c63ea){return db[_0x139c('0x2b')][_0x139c('0x46')](_0x2b092d[_0x139c('0x47')],{})[_0x139c('0x23')](function(_0x45d0c2){var _0x3dd81a=_0x2b092d['user']['get']({'plain':!![]});if(!_0x3dd81a)throw new Error(_0x139c('0x48'));if(_0x3dd81a[_0x139c('0x49')]==='user'){var _0x13a29d=_0x45d0c2[_0x139c('0x24')]({'plain':!![]});var _0x2193e9='ODBC';return db['UserProfileSection']['find']({'where':{'name':_0x2193e9,'userProfileId':_0x3dd81a['userProfileId']},'raw':!![]})[_0x139c('0x23')](function(_0x204194){if(_0x204194&&_0x204194[_0x139c('0x4a')]===0x0){return db[_0x139c('0x4b')]['create']({'name':_0x13a29d['name'],'resourceId':_0x13a29d['id'],'type':_0x204194[_0x139c('0x28')],'sectionId':_0x204194['id']},{})[_0x139c('0x23')](function(){return _0x45d0c2;});}else{return _0x45d0c2;}})['catch'](function(_0x2ff606){logger[_0x139c('0x26')](_0x139c('0x4c'),_0x2ff606);throw _0x2ff606;});}return _0x45d0c2;})[_0x139c('0x23')](respondWithResult(_0x4c63ea,0xc9))[_0x139c('0x4d')](handleError(_0x4c63ea,null));};exports[_0x139c('0x4e')]=function(_0x5c43ba,_0xe4bf4){if(_0x5c43ba['body']['id']){delete _0x5c43ba[_0x139c('0x47')]['id'];}return db[_0x139c('0x2b')]['find']({'where':{'id':_0x5c43ba[_0x139c('0x44')]['id']}})[_0x139c('0x23')](handleEntityNotFound(_0xe4bf4,null))[_0x139c('0x23')](saveUpdates(_0x5c43ba[_0x139c('0x47')],null))[_0x139c('0x23')](respondWithResult(_0xe4bf4,null))[_0x139c('0x4d')](handleError(_0xe4bf4,null));};exports[_0x139c('0x25')]=function(_0x568c58,_0x3ef1e1){return db[_0x139c('0x2b')][_0x139c('0x45')]({'where':{'id':_0x568c58[_0x139c('0x44')]['id']}})[_0x139c('0x23')](handleEntityNotFound(_0x3ef1e1,null))[_0x139c('0x23')](removeEntity(_0x3ef1e1,null))[_0x139c('0x4d')](handleError(_0x3ef1e1,null));};exports[_0x139c('0x4f')]=function(_0x1b76b8,_0x366710,_0x62ea32){var _0x9fece0;return db[_0x139c('0x2b')][_0x139c('0x45')]({'where':{'id':_0x1b76b8[_0x139c('0x44')]['id']},'attributes':['id',_0x139c('0x50')]})['then'](handleEntityNotFound(_0x366710,null))[_0x139c('0x23')](function(_0x17ae51){if(_0x17ae51){var _0x253c41=require(_0x139c('0x51'))();_0x253c41[_0x139c('0x52')](_0x17ae51[_0x139c('0x50')]);_0x253c41[_0x139c('0x53')]();return _0x17ae51;}})[_0x139c('0x23')](respondWithResult(_0x366710,null))[_0x139c('0x4d')](handleError(_0x366710,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index bfca5af..3d869b7 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 _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 +var _0x7207=['define','SquareOdbc','square_odbc','lodash','api','bluebird','request-promise','path','../../config/environment','./squareOdbc.attributes','exports'];(function(_0xed0a68,_0x416fca){var _0x41393a=function(_0x1e9828){while(--_0x1e9828){_0xed0a68['push'](_0xed0a68['shift']());}};_0x41393a(++_0x416fca);}(_0x7207,0x18f));var _0x7720=function(_0x5017d3,_0x37eb90){_0x5017d3=_0x5017d3-0x0;var _0x27db57=_0x7207[_0x5017d3];return _0x27db57;};'use strict';var _=require(_0x7720('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7720('0x1'));var moment=require('moment');var BPromise=require(_0x7720('0x2'));var rp=require(_0x7720('0x3'));var fs=require('fs');var path=require(_0x7720('0x4'));var rimraf=require('rimraf');var config=require(_0x7720('0x5'));var attributes=require(_0x7720('0x6'));module[_0x7720('0x7')]=function(_0x2a2dc3,_0x3b9f76){return _0x2a2dc3[_0x7720('0x8')](_0x7720('0x9'),attributes,{'tableName':_0x7720('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 44fbaea..3d6181e 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 _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 +var _0x8d94=['debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareOdbc','find','options','where','attributes','include','map','model','ShowSquareOdbc','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent'];(function(_0x8b987c,_0x5262e7){var _0x7b8b61=function(_0x3ede04){while(--_0x3ede04){_0x8b987c['push'](_0x8b987c['shift']());}};_0x7b8b61(++_0x5262e7);}(_0x8d94,0x1b1));var _0x48d9=function(_0x4cd424,_0x4d58c7){_0x4cd424=_0x4cd424-0x0;var _0x1962c4=_0x8d94[_0x4cd424];return _0x1962c4;};'use strict';var _=require(_0x48d9('0x0'));var util=require('util');var moment=require(_0x48d9('0x1'));var BPromise=require(_0x48d9('0x2'));var rs=require(_0x48d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x48d9('0x4'))['db'];var utils=require(_0x48d9('0x5'));var logger=require(_0x48d9('0x6'))(_0x48d9('0x7'));var config=require(_0x48d9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x48d9('0x9')][_0x48d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e4711,_0x3934ad,_0xc73126){return new BPromise(function(_0x2f956b,_0x237ad9){return client['request'](_0x1e4711,_0xc73126)[_0x48d9('0xb')](function(_0x19cdac){logger[_0x48d9('0xc')](_0x48d9('0xd'),_0x3934ad,_0x48d9('0xe'));logger[_0x48d9('0xf')](_0x48d9('0x10'),_0x3934ad,_0x48d9('0xe'),JSON[_0x48d9('0x11')](_0x19cdac));if(_0x19cdac[_0x48d9('0x12')]){if(_0x19cdac['error'][_0x48d9('0x13')]===0x1f4){logger[_0x48d9('0x12')](_0x48d9('0xd'),_0x3934ad,_0x19cdac[_0x48d9('0x12')]['message']);return _0x237ad9(_0x19cdac[_0x48d9('0x12')][_0x48d9('0x14')]);}logger[_0x48d9('0x12')](_0x48d9('0xd'),_0x3934ad,_0x19cdac['error'][_0x48d9('0x14')]);return _0x2f956b(_0x19cdac['error']['message']);}else{logger[_0x48d9('0xc')](_0x48d9('0xd'),_0x3934ad,_0x48d9('0xe'));_0x2f956b(_0x19cdac[_0x48d9('0x15')][_0x48d9('0x14')]);}})[_0x48d9('0x16')](function(_0x2c59d9){logger[_0x48d9('0x12')](_0x48d9('0xd'),_0x3934ad,_0x2c59d9);_0x237ad9(_0x2c59d9);});});}exports['ShowSquareOdbc']=function(_0x4d3aae){var _0x1bc4e7=this;return new Promise(function(_0x4aa7ff,_0x2799de){return db[_0x48d9('0x17')][_0x48d9('0x18')]({'raw':_0x4d3aae['options']?_0x4d3aae[_0x48d9('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4d3aae['options']?_0x4d3aae['options'][_0x48d9('0x1a')]||null:null,'attributes':_0x4d3aae[_0x48d9('0x19')]?_0x4d3aae[_0x48d9('0x19')][_0x48d9('0x1b')]||null:null,'include':_0x4d3aae[_0x48d9('0x19')]?_0x4d3aae[_0x48d9('0x19')][_0x48d9('0x1c')]?_[_0x48d9('0x1d')](_0x4d3aae[_0x48d9('0x19')]['include'],function(_0x10f290){return{'model':db[_0x10f290['model']],'as':_0x10f290['as'],'attributes':_0x10f290[_0x48d9('0x1b')],'include':_0x10f290['include']?_[_0x48d9('0x1d')](_0x10f290[_0x48d9('0x1c')],function(_0x5748c3){return{'model':db[_0x5748c3[_0x48d9('0x1e')]],'as':_0x5748c3['as'],'attributes':_0x5748c3[_0x48d9('0x1b')],'include':_0x5748c3[_0x48d9('0x1c')]?_['map'](_0x5748c3[_0x48d9('0x1c')],function(_0x10be54){return{'model':db[_0x10be54[_0x48d9('0x1e')]],'as':_0x10be54['as'],'attributes':_0x10be54['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xa30218){logger['info'](_0x48d9('0x1f'),_0x4d3aae);logger[_0x48d9('0xf')](_0x48d9('0x1f'),_0x4d3aae,JSON[_0x48d9('0x11')](_0xa30218));_0x4aa7ff(_0xa30218);})[_0x48d9('0x16')](function(_0x2ffbe3){logger[_0x48d9('0x12')](_0x48d9('0x1f'),_0x2ffbe3['message'],_0x4d3aae);_0x2799de(_0x1bc4e7[_0x48d9('0x12')](0x1f4,_0x2ffbe3[_0x48d9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index f1f9305..18d2236 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 _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 +var _0x0c61=['update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','index','get','/:id','show','create'];(function(_0x57a01e,_0x446ad1){var _0x2e0a23=function(_0x2fc2f8){while(--_0x2fc2f8){_0x57a01e['push'](_0x57a01e['shift']());}};_0x2e0a23(++_0x446ad1);}(_0x0c61,0x159));var _0x10c6=function(_0x4af01e,_0x543f5c){_0x4af01e=_0x4af01e-0x0;var _0x178c11=_0x0c61[_0x4af01e];return _0x178c11;};'use strict';var multer=require(_0x10c6('0x0'));var util=require(_0x10c6('0x1'));var path=require(_0x10c6('0x2'));var timeout=require(_0x10c6('0x3'));var express=require(_0x10c6('0x4'));var router=express[_0x10c6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x10c6('0x6'));var interaction=require(_0x10c6('0x7'));var config=require(_0x10c6('0x8'));var controller=require(_0x10c6('0x9'));router['get']('/',auth[_0x10c6('0xa')](),controller[_0x10c6('0xb')]);router[_0x10c6('0xc')](_0x10c6('0xd'),auth['isAuthenticated'](),controller[_0x10c6('0xe')]);router['post']('/',auth[_0x10c6('0xa')](),controller[_0x10c6('0xf')]);router['put']('/:id',auth[_0x10c6('0xa')](),controller[_0x10c6('0x10')]);router[_0x10c6('0x11')]('/:id',auth[_0x10c6('0xa')](),controller['destroy']);module[_0x10c6('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 c321bd3..7714445 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 _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 +var _0x2ef3=['production','toString','utf8','DATE','sequelize','exports','STRING','name','TEXT','long','getDataValue','preproduction','BLOB'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2ef3,0xba));var _0x32ef=function(_0x418e6d,_0x4c7a06){_0x418e6d=_0x418e6d-0x0;var _0x42c086=_0x2ef3[_0x418e6d];return _0x42c086;};'use strict';var Sequelize=require(_0x32ef('0x0'));module[_0x32ef('0x1')]={'name':{'type':Sequelize[_0x32ef('0x2')],'unique':_0x32ef('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x32ef('0x2')]},'notes':{'type':Sequelize[_0x32ef('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0x32ef('0x5')),'get':function(){if(this[_0x32ef('0x6')]('preproduction')){return this[_0x32ef('0x6')](_0x32ef('0x7'))['toString']('utf8');}}},'production':{'type':Sequelize[_0x32ef('0x8')](_0x32ef('0x5')),'get':function(){if(this[_0x32ef('0x6')](_0x32ef('0x9'))){return this[_0x32ef('0x6')](_0x32ef('0x9'))[_0x32ef('0xa')](_0x32ef('0xb'));}}},'savedAt':{'type':Sequelize[_0x32ef('0xc')]},'publishedAt':{'type':Sequelize[_0x32ef('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 025acb5..fce4e48 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 _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 +var _0x3db4=['../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./squareProject.socket','status','json','offset','limit','count','set','Content-Range','update','then','destroy','get','UserProfileResource','publish','agi','stringify','end','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','SquareProject','include','findAll','rows','catch','show','params','includeAll','create','user','role','SquareProjects','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','lodash','ioredis','../../components/parsers/qs'];(function(_0x45cbcf,_0xfbdbc2){var _0x52ece8=function(_0x498579){while(--_0x498579){_0x45cbcf['push'](_0x45cbcf['shift']());}};_0x52ece8(++_0xfbdbc2);}(_0x3db4,0x1a1));var _0x43db=function(_0x5cb483,_0x9066c4){_0x5cb483=_0x5cb483-0x0;var _0x40488a=_0x3db4[_0x5cb483];return _0x40488a;};'use strict';var _=require(_0x43db('0x0'));var Redis=require(_0x43db('0x1'));var qs=require(_0x43db('0x2'));var logger=require(_0x43db('0x3'))('api');var config=require(_0x43db('0x4'));var db=require(_0x43db('0x5'))['db'];config[_0x43db('0x6')]=_[_0x43db('0x7')](config[_0x43db('0x6')],{'host':_0x43db('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x43db('0x9'))['register'](socket);function respondWithResult(_0x5e1658,_0x255387){_0x255387=_0x255387||0xc8;return function(_0x38f4a2){if(_0x38f4a2){return _0x5e1658[_0x43db('0xa')](_0x255387)[_0x43db('0xb')](_0x38f4a2);}};}function respondWithFilteredResult(_0x5928c4,_0x12cecf){return function(_0x162350){if(_0x162350){var _0x28a5c9=typeof _0x12cecf[_0x43db('0xc')]==='undefined'&&typeof _0x12cecf[_0x43db('0xd')]==='undefined';var _0x522ef2=_0x162350[_0x43db('0xe')];var _0xc2747d=_0x28a5c9?0x0:_0x12cecf[_0x43db('0xc')];var _0x140a71=_0x28a5c9?_0x162350[_0x43db('0xe')]:_0x12cecf['offset']+_0x12cecf[_0x43db('0xd')];var _0x44ed74;if(_0x140a71>=_0x522ef2){_0x140a71=_0x522ef2;_0x44ed74=0xc8;}else{_0x44ed74=0xce;}_0x5928c4[_0x43db('0xa')](_0x44ed74);return _0x5928c4[_0x43db('0xf')](_0x43db('0x10'),_0xc2747d+'-'+_0x140a71+'/'+_0x522ef2)['json'](_0x162350);}return null;};}function saveUpdates(_0x5afb0c){return function(_0x17e8f5){if(_0x17e8f5){return _0x17e8f5[_0x43db('0x11')](_0x5afb0c)[_0x43db('0x12')](function(_0x41835e){return _0x41835e;});}return null;};}function removeEntity(_0x48c354){return function(_0x176a8c){if(_0x176a8c){return _0x176a8c[_0x43db('0x13')]()[_0x43db('0x12')](function(){var _0x329e2a=_0x176a8c[_0x43db('0x14')]({'plain':!![]});var _0x2731a5='SquareProjects';return db[_0x43db('0x15')][_0x43db('0x13')]({'where':{'type':_0x2731a5,'resourceId':_0x329e2a['id']}})[_0x43db('0x12')](function(){return _0x176a8c;});})[_0x43db('0x12')](function(){var _0x48888b=new Redis(config[_0x43db('0x6')]);_0x48888b[_0x43db('0x16')](_0x43db('0x17'),JSON[_0x43db('0x18')]({'id':_0x176a8c['id'],'deleted':!![]}));})[_0x43db('0x12')](function(){_0x48c354[_0x43db('0xa')](0xcc)[_0x43db('0x19')]();});}};}function handleEntityNotFound(_0x404b27){return function(_0x2a295c){if(!_0x2a295c){_0x404b27[_0x43db('0x1a')](0x194);}return _0x2a295c;};}function handleError(_0x2c1483,_0x964f21){_0x964f21=_0x964f21||0x1f4;return function(_0x45e36b){logger[_0x43db('0x1b')](_0x45e36b[_0x43db('0x1c')]);if(_0x45e36b['name']){delete _0x45e36b[_0x43db('0x1d')];}_0x2c1483[_0x43db('0xa')](_0x964f21)[_0x43db('0x1e')](_0x45e36b);};}exports['index']=function(_0x1590df,_0x58ea91){var _0x286f76={},_0x21b29f={},_0x25c98d={'count':0x0,'rows':[]};var _0x4d7923=_[_0x43db('0x1f')](db['SquareProject'][_0x43db('0x20')],function(_0x27ce16){return{'name':_0x27ce16[_0x43db('0x21')],'type':_0x27ce16[_0x43db('0x22')][_0x43db('0x23')]};});_0x21b29f[_0x43db('0x24')]=_[_0x43db('0x1f')](_0x4d7923,_0x43db('0x1d'));_0x21b29f[_0x43db('0x25')]=_[_0x43db('0x26')](_0x1590df[_0x43db('0x25')]);_0x21b29f['filters']=_[_0x43db('0x27')](_0x21b29f[_0x43db('0x24')],_0x21b29f[_0x43db('0x25')]);_0x286f76['attributes']=_[_0x43db('0x27')](_0x21b29f['model'],qs[_0x43db('0x28')](_0x1590df[_0x43db('0x25')][_0x43db('0x28')]));_0x286f76[_0x43db('0x29')]=_0x286f76[_0x43db('0x29')][_0x43db('0x2a')]?_0x286f76[_0x43db('0x29')]:_0x21b29f['model'];if(!_0x1590df[_0x43db('0x25')][_0x43db('0x2b')](_0x43db('0x2c'))){_0x286f76['limit']=qs[_0x43db('0xd')](_0x1590df[_0x43db('0x25')][_0x43db('0xd')]);_0x286f76[_0x43db('0xc')]=qs[_0x43db('0xc')](_0x1590df[_0x43db('0x25')][_0x43db('0xc')]);}_0x286f76[_0x43db('0x2d')]=qs[_0x43db('0x2e')](_0x1590df[_0x43db('0x25')]['sort']);_0x286f76[_0x43db('0x2f')]=qs[_0x43db('0x30')](_['pick'](_0x1590df[_0x43db('0x25')],_0x21b29f[_0x43db('0x30')]),_0x4d7923);if(_0x1590df[_0x43db('0x25')]['filter']){_0x286f76['where']=_[_0x43db('0x31')](_0x286f76[_0x43db('0x2f')],{'$or':_[_0x43db('0x1f')](_0x4d7923,function(_0x4807b6){if(_0x4807b6[_0x43db('0x22')]!==_0x43db('0x32')){var _0x5d0150={};_0x5d0150[_0x4807b6[_0x43db('0x1d')]]={'$like':'%'+_0x1590df[_0x43db('0x25')][_0x43db('0x33')]+'%'};return _0x5d0150;}})});}_0x286f76=_[_0x43db('0x31')]({},_0x286f76,_0x1590df[_0x43db('0x34')]);var _0x567814={'where':_0x286f76[_0x43db('0x2f')]};return db[_0x43db('0x35')][_0x43db('0xe')](_0x567814)['then'](function(_0xf9114){_0x25c98d[_0x43db('0xe')]=_0xf9114;if(_0x1590df[_0x43db('0x25')]['includeAll']){_0x286f76[_0x43db('0x36')]=[{'all':!![]}];}return db[_0x43db('0x35')][_0x43db('0x37')](_0x286f76);})['then'](function(_0x5b4471){_0x25c98d[_0x43db('0x38')]=_0x5b4471;return _0x25c98d;})[_0x43db('0x12')](respondWithFilteredResult(_0x58ea91,_0x286f76))[_0x43db('0x39')](handleError(_0x58ea91,null));};exports[_0x43db('0x3a')]=function(_0x298fb6,_0x3e02d4){var _0x215af5={'raw':![],'where':{'id':_0x298fb6[_0x43db('0x3b')]['id']}},_0x37dccc={};_0x37dccc[_0x43db('0x24')]=_[_0x43db('0x26')](db['SquareProject'][_0x43db('0x20')]);_0x37dccc[_0x43db('0x25')]=_[_0x43db('0x26')](_0x298fb6[_0x43db('0x25')]);_0x37dccc['filters']=_[_0x43db('0x27')](_0x37dccc[_0x43db('0x24')],_0x37dccc[_0x43db('0x25')]);_0x215af5[_0x43db('0x29')]=_[_0x43db('0x27')](_0x37dccc[_0x43db('0x24')],qs[_0x43db('0x28')](_0x298fb6[_0x43db('0x25')]['fields']));_0x215af5[_0x43db('0x29')]=_0x215af5[_0x43db('0x29')][_0x43db('0x2a')]?_0x215af5[_0x43db('0x29')]:_0x37dccc[_0x43db('0x24')];if(_0x298fb6['query'][_0x43db('0x3c')]){_0x215af5[_0x43db('0x36')]=[{'all':!![]}];}_0x215af5=_[_0x43db('0x31')]({},_0x215af5,_0x298fb6[_0x43db('0x34')]);return db[_0x43db('0x35')]['find'](_0x215af5)[_0x43db('0x12')](handleEntityNotFound(_0x3e02d4,null))[_0x43db('0x12')](respondWithResult(_0x3e02d4,null))[_0x43db('0x39')](handleError(_0x3e02d4,null));};exports['create']=function(_0xbf1018,_0x212c6c){return db[_0x43db('0x35')][_0x43db('0x3d')](_0xbf1018['body'],{})[_0x43db('0x12')](function(_0x3e9980){var _0x45d9e5=_0xbf1018[_0x43db('0x3e')][_0x43db('0x14')]({'plain':!![]});if(!_0x45d9e5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45d9e5[_0x43db('0x3f')]===_0x43db('0x3e')){var _0x4619b8=_0x3e9980[_0x43db('0x14')]({'plain':!![]});var _0xf06c66=_0x43db('0x40');return db[_0x43db('0x41')][_0x43db('0x42')]({'where':{'name':_0xf06c66,'userProfileId':_0x45d9e5[_0x43db('0x43')]},'raw':!![]})[_0x43db('0x12')](function(_0x23cd20){if(_0x23cd20&&_0x23cd20['autoAssociation']===0x0){return db[_0x43db('0x15')][_0x43db('0x3d')]({'name':_0x4619b8[_0x43db('0x1d')],'resourceId':_0x4619b8['id'],'type':_0x23cd20[_0x43db('0x1d')],'sectionId':_0x23cd20['id']},{})['then'](function(){return _0x3e9980;});}else{return _0x3e9980;}})['catch'](function(_0x4e793a){logger[_0x43db('0x1b')](_0x43db('0x44'),_0x4e793a);throw _0x4e793a;});}return _0x3e9980;})[_0x43db('0x12')](respondWithResult(_0x212c6c,0xc9))[_0x43db('0x39')](handleError(_0x212c6c,null));};exports[_0x43db('0x11')]=function(_0x1de97b,_0x29a3ae){if(_0x1de97b[_0x43db('0x45')]['id']){delete _0x1de97b['body']['id'];}return db['SquareProject']['find']({'where':{'id':_0x1de97b[_0x43db('0x3b')]['id']}})['then'](handleEntityNotFound(_0x29a3ae,null))[_0x43db('0x12')](saveUpdates(_0x1de97b[_0x43db('0x45')],null))[_0x43db('0x12')](function(_0x1ed153){if(!_0x1ed153)return;var _0x295b5e=_0x1ed153[_0x43db('0x14')]({'plain':!![]});return _0x295b5e;})[_0x43db('0x12')](function(_0x520475){var _0x43f880=new Redis(config[_0x43db('0x6')]);_0x43f880[_0x43db('0x16')](_0x43db('0x17'),JSON[_0x43db('0x18')](_['pick'](_0x520475,['id',_0x43db('0x1d'),'production'])));return _0x520475;})['then'](respondWithResult(_0x29a3ae,null))['catch'](handleError(_0x29a3ae,null));};exports['destroy']=function(_0xfe978e,_0x458a35){return db['SquareProject'][_0x43db('0x42')]({'where':{'id':_0xfe978e['params']['id']}})[_0x43db('0x12')](handleEntityNotFound(_0x458a35,null))['then'](removeEntity(_0x458a35,null))['catch'](handleError(_0x458a35,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 8458a66..3526c44 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 _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 +var _0x944d=['../../mysqldb','SquareProject','setMaxListeners','remove','emit','hasOwnProperty','hook','events'];(function(_0x19de20,_0x4e6684){var _0x55d051=function(_0x5ce498){while(--_0x5ce498){_0x19de20['push'](_0x19de20['shift']());}};_0x55d051(++_0x4e6684);}(_0x944d,0xbf));var _0xd944=function(_0x1e8c9b,_0x519939){_0x1e8c9b=_0x1e8c9b-0x0;var _0x5ececb=_0x944d[_0x1e8c9b];return _0x5ececb;};'use strict';var EventEmitter=require(_0xd944('0x0'));var SquareProject=require(_0xd944('0x1'))['db'][_0xd944('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xd944('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd944('0x4')};function emitEvent(_0x4ba28f){return function(_0x2cf9ce,_0x507261,_0x3109de){SquareProjectEvents[_0xd944('0x5')](_0x4ba28f+':'+_0x2cf9ce['id'],_0x2cf9ce);SquareProjectEvents[_0xd944('0x5')](_0x4ba28f,_0x2cf9ce);_0x3109de(null);};}for(var e in events){if(events[_0xd944('0x6')](e)){var event=events[e];SquareProject[_0xd944('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 0ac8fb4..55e8cee 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 _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 +var _0x2756=['rimraf','./squareProject.attributes','exports','changed','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','bluebird','request-promise','path'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x2756,0xa4));var _0x6275=function(_0x2d4421,_0x15a84f){_0x2d4421=_0x2d4421-0x0;var _0x2d3b01=_0x2756[_0x2d4421];return _0x2d3b01;};'use strict';var _=require(_0x6275('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6275('0x1'));var rp=require(_0x6275('0x2'));var fs=require('fs');var path=require(_0x6275('0x3'));var rimraf=require(_0x6275('0x4'));var config=require('../../config/environment');var attributes=require(_0x6275('0x5'));module[_0x6275('0x6')]=function(_0x19f3ec,_0x43cb42){return _0x19f3ec['define']('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57e561,_0x2371b6,_0x1fa1e8){if(_0x57e561[_0x6275('0x7')]('preproduction')){_0x57e561['savedAt']=moment()[_0x6275('0x8')](_0x6275('0x9'));}if(_0x57e561['changed'](_0x6275('0xa'))){_0x57e561[_0x6275('0xb')]=moment()[_0x6275('0x8')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1fa1e8(null,_0x57e561);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index fc83b4b..3ec08a8 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 _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 +var _0xd7df=['defaults','localhost','socket.io-emitter','./squareProject.socket','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','limit','map','include','model','info','stringify','error','message','ShowSquareProject','find','then','debug','catch','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis'];(function(_0x2a62ce,_0x41dd6d){var _0xcbbb31=function(_0x28e5db){while(--_0x28e5db){_0x2a62ce['push'](_0x2a62ce['shift']());}};_0xcbbb31(++_0x41dd6d);}(_0xd7df,0x16d));var _0xfd7d=function(_0x165ee2,_0x8630fd){_0x165ee2=_0x165ee2-0x0;var _0x4b3e21=_0xd7df[_0x165ee2];return _0x4b3e21;};'use strict';var _=require(_0xfd7d('0x0'));var Redis=require(_0xfd7d('0x1'));var db=require(_0xfd7d('0x2'))['db'];var logger=require(_0xfd7d('0x3'))(_0xfd7d('0x4'));var config=require(_0xfd7d('0x5'));config[_0xfd7d('0x6')]=_[_0xfd7d('0x7')](config['redis'],{'host':_0xfd7d('0x8'),'port':0x18eb});var socket=require(_0xfd7d('0x9'))(new Redis(config[_0xfd7d('0x6')]));require(_0xfd7d('0xa'))['register'](socket);exports[_0xfd7d('0xb')]=function(_0x1e38e4){var _0x3e833d=this;return new Promise(function(_0x3600db,_0x336b42){return db[_0xfd7d('0xc')][_0xfd7d('0xd')]({'raw':_0x1e38e4[_0xfd7d('0xe')]?_0x1e38e4[_0xfd7d('0xe')][_0xfd7d('0xf')]===undefined?!![]:![]:!![],'where':_0x1e38e4[_0xfd7d('0xe')]?_0x1e38e4[_0xfd7d('0xe')][_0xfd7d('0x10')]||null:null,'attributes':_0x1e38e4[_0xfd7d('0xe')]?_0x1e38e4[_0xfd7d('0xe')][_0xfd7d('0x11')]||null:null,'limit':_0x1e38e4['options']?_0x1e38e4[_0xfd7d('0xe')][_0xfd7d('0x12')]||null:null,'include':_0x1e38e4['options']?_0x1e38e4[_0xfd7d('0xe')]['include']?_[_0xfd7d('0x13')](_0x1e38e4[_0xfd7d('0xe')][_0xfd7d('0x14')],function(_0x3d5ab2){return{'model':db[_0x3d5ab2[_0xfd7d('0x15')]],'as':_0x3d5ab2['as'],'attributes':_0x3d5ab2['attributes'],'include':_0x3d5ab2['include']?_[_0xfd7d('0x13')](_0x3d5ab2['include'],function(_0x5e82e5){return{'model':db[_0x5e82e5['model']],'as':_0x5e82e5['as'],'attributes':_0x5e82e5[_0xfd7d('0x11')],'include':_0x5e82e5[_0xfd7d('0x14')]?_[_0xfd7d('0x13')](_0x5e82e5[_0xfd7d('0x14')],function(_0x4ea511){return{'model':db[_0x4ea511['model']],'as':_0x4ea511['as'],'attributes':_0x4ea511[_0xfd7d('0x11')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a601e){logger[_0xfd7d('0x16')](_0xfd7d('0xb'),_0x1e38e4);logger['debug'](_0xfd7d('0xb'),_0x1e38e4,JSON[_0xfd7d('0x17')](_0x3a601e));_0x3600db(_0x3a601e);})['catch'](function(_0x570a04){logger[_0xfd7d('0x18')](_0xfd7d('0xb'),_0x570a04[_0xfd7d('0x19')],_0x1e38e4);_0x336b42(_0x3e833d[_0xfd7d('0x18')](0x1f4,_0x570a04[_0xfd7d('0x19')]));});});};exports[_0xfd7d('0x1a')]=function(_0x28c63e){var _0x5185da=this;return new Promise(function(_0x217cbf,_0x1765b2){return db[_0xfd7d('0xc')][_0xfd7d('0x1b')]({'raw':_0x28c63e[_0xfd7d('0xe')]?_0x28c63e['options']['raw']===undefined?!![]:![]:!![],'where':_0x28c63e[_0xfd7d('0xe')]?_0x28c63e['options'][_0xfd7d('0x10')]||null:null,'attributes':_0x28c63e[_0xfd7d('0xe')]?_0x28c63e[_0xfd7d('0xe')]['attributes']||null:null,'include':_0x28c63e[_0xfd7d('0xe')]?_0x28c63e[_0xfd7d('0xe')][_0xfd7d('0x14')]?_[_0xfd7d('0x13')](_0x28c63e[_0xfd7d('0xe')][_0xfd7d('0x14')],function(_0x28fc85){return{'model':db[_0x28fc85[_0xfd7d('0x15')]],'as':_0x28fc85['as'],'attributes':_0x28fc85['attributes'],'include':_0x28fc85['include']?_['map'](_0x28fc85[_0xfd7d('0x14')],function(_0x51e844){return{'model':db[_0x51e844[_0xfd7d('0x15')]],'as':_0x51e844['as'],'attributes':_0x51e844['attributes'],'include':_0x51e844[_0xfd7d('0x14')]?_['map'](_0x51e844[_0xfd7d('0x14')],function(_0x2068f5){return{'model':db[_0x2068f5[_0xfd7d('0x15')]],'as':_0x2068f5['as'],'attributes':_0x2068f5[_0xfd7d('0x11')]};}):[]};}):[]};}):[]:[]})[_0xfd7d('0x1c')](function(_0x2befdd){logger[_0xfd7d('0x16')]('ShowSquareProject',_0x28c63e);logger[_0xfd7d('0x1d')]('ShowSquareProject',_0x28c63e,JSON[_0xfd7d('0x17')](_0x2befdd));_0x217cbf(_0x2befdd);})[_0xfd7d('0x1e')](function(_0x1785cf){logger[_0xfd7d('0x18')](_0xfd7d('0x1a'),_0x1785cf['message'],_0x28c63e);_0x1765b2(_0x5185da[_0xfd7d('0x18')](0x1f4,_0x1785cf[_0xfd7d('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index c402818..caf6ade 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 _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 +var _0xa09c=['remove','update','emit','removeListener','length','squareProject:','./squareProject.events','save'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa09c,0x1e6));var _0xca09=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa09c[_0x4709c0];return _0x13348b;};'use strict';var SquareProjectEvents=require(_0xca09('0x0'));var events=[_0xca09('0x1'),_0xca09('0x2'),_0xca09('0x3')];function createListener(_0x2074c7,_0x25673f){return function(_0x3b6af8){_0x25673f[_0xca09('0x4')](_0x2074c7,_0x3b6af8);};}function removeListener(_0x28234b,_0x1b6ee1){return function(){SquareProjectEvents[_0xca09('0x5')](_0x28234b,_0x1b6ee1);};}exports['register']=function(_0x2e0086){for(var _0x1c84a1=0x0,_0x373e64=events[_0xca09('0x6')];_0x1c84a1<_0x373e64;_0x1c84a1++){var _0x113ea0=events[_0x1c84a1];var _0x17a2d3=createListener(_0xca09('0x7')+_0x113ea0,_0x2e0086);SquareProjectEvents['on'](_0x113ea0,_0x17a2d3);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 7742b13..24c7d40 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 _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 +var _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0x1fbbd6,_0x2fd90e){var _0x31acdc=function(_0x50bc3d){while(--_0x50bc3d){_0x1fbbd6['push'](_0x1fbbd6['shift']());}};_0x31acdc(++_0x2fd90e);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x45655c,_0x407b81){_0x45655c=_0x45655c-0x0;var _0x24a8d9=_0x7fbe[_0x45655c];return _0x24a8d9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 6233f20..c639a58 100644 --- a/server/api/squareRecording/squareRecording.attributes.js +++ b/server/api/squareRecording/squareRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb138=['getDataValue','substring','lastIndexOf','sequelize','exports','STRING'];(function(_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 +var _0xd6d6=['substring','sequelize','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x1dd8a3,_0x49a0c2){var _0x185f77=function(_0x2d3427){while(--_0x2d3427){_0x1dd8a3['push'](_0x1dd8a3['shift']());}};_0x185f77(++_0x49a0c2);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x2807cb,_0x152a04){_0x2807cb=_0x2807cb-0x0;var _0xbc50ec=_0xd6d6[_0x2807cb];return _0xbc50ec;};'use strict';var Sequelize=require(_0x6d6d('0x0'));module[_0x6d6d('0x1')]={'uniqueid':{'type':Sequelize[_0x6d6d('0x2')]},'callerid':{'type':Sequelize[_0x6d6d('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6d6d('0x2')]},'extension':{'type':Sequelize[_0x6d6d('0x2')]},'priority':{'type':Sequelize[_0x6d6d('0x2')]},'accountcode':{'type':Sequelize[_0x6d6d('0x2')]},'dnid':{'type':Sequelize[_0x6d6d('0x2')]},'projectName':{'type':Sequelize[_0x6d6d('0x2')]},'saveName':{'type':Sequelize[_0x6d6d('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x6d6d('0x2')]},'format':{'type':Sequelize[_0x6d6d('0x3')],'get':function(){var _0x44f83d='';var _0x18f824=this[_0x6d6d('0x4')](_0x6d6d('0x5'));if(_0x18f824){_0x44f83d=_0x18f824[_0x6d6d('0x6')](_0x18f824['lastIndexOf']('.'));}return _0x44f83d;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index f3d6b69..366fc13 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 _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 +var _0x41d3=['name','send','index','SquareRecording','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','where','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','length','find','catch','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','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','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','error','stack'];(function(_0x26ad0d,_0x383fdd){var _0x19af1a=function(_0x319b08){while(--_0x319b08){_0x26ad0d['push'](_0x26ad0d['shift']());}};_0x19af1a(++_0x383fdd);}(_0x41d3,0x1c6));var _0x341d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x41d3[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x341d('0x0'));var rimraf=require(_0x341d('0x1'));var zipdir=require(_0x341d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x341d('0x3'));var moment=require(_0x341d('0x4'));var BPromise=require(_0x341d('0x5'));var Mustache=require('mustache');var util=require(_0x341d('0x6'));var path=require(_0x341d('0x7'));var sox=require(_0x341d('0x8'));var csv=require('to-csv');var ejs=require(_0x341d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x341d('0xa'));var squel=require(_0x341d('0xb'));var crypto=require(_0x341d('0xc'));var jsforce=require(_0x341d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x341d('0xe'));var querystring=require(_0x341d('0xf'));var Papa=require(_0x341d('0x10'));var Redis=require(_0x341d('0x11'));var authService=require(_0x341d('0x12'));var qs=require(_0x341d('0x13'));var as=require(_0x341d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x341d('0x15'))(_0x341d('0x16'));var utils=require(_0x341d('0x17'));var config=require(_0x341d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x341d('0x19'))['db'];function respondWithStatusCode(_0x280fdb,_0x21f09f){_0x21f09f=_0x21f09f||0xcc;return function(_0x2fe2b1){if(_0x2fe2b1){return _0x280fdb[_0x341d('0x1a')](_0x21f09f);}return _0x280fdb[_0x341d('0x1b')](_0x21f09f)[_0x341d('0x1c')]();};}function respondWithResult(_0x477de0,_0xa85a54){_0xa85a54=_0xa85a54||0xc8;return function(_0x328ad6){if(_0x328ad6){return _0x477de0['status'](_0xa85a54)[_0x341d('0x1d')](_0x328ad6);}};}function respondWithFilteredResult(_0x92d29b,_0x405499){return function(_0x3f802e){if(_0x3f802e){var _0xeb003e=typeof _0x405499[_0x341d('0x1e')]==='undefined'&&typeof _0x405499[_0x341d('0x1f')]===_0x341d('0x20');var _0x3c4a1e=_0x3f802e[_0x341d('0x21')];var _0x2cbe5f=_0xeb003e?0x0:_0x405499[_0x341d('0x1e')];var _0x5e8f37=_0xeb003e?_0x3f802e[_0x341d('0x21')]:_0x405499['offset']+_0x405499['limit'];var _0x48c537;if(_0x5e8f37>=_0x3c4a1e){_0x5e8f37=_0x3c4a1e;_0x48c537=0xc8;}else{_0x48c537=0xce;}_0x92d29b['status'](_0x48c537);return _0x92d29b[_0x341d('0x22')]('Content-Range',_0x2cbe5f+'-'+_0x5e8f37+'/'+_0x3c4a1e)[_0x341d('0x1d')](_0x3f802e);}return null;};}function patchUpdates(_0x451661){return function(_0x5c6f22){try{jsonpatch[_0x341d('0x23')](_0x5c6f22,_0x451661,!![]);}catch(_0x196b66){return BPromise[_0x341d('0x24')](_0x196b66);}return _0x5c6f22['save']();};}function saveUpdates(_0x5c754b,_0x1027c7){return function(_0x59fe2f){if(_0x59fe2f){return _0x59fe2f[_0x341d('0x25')](_0x5c754b)[_0x341d('0x26')](function(_0x274b2c){return _0x274b2c;});}return null;};}function removeEntity(_0x74b2af,_0x776b35){return function(_0x221e79){if(_0x221e79){return _0x221e79['destroy']()[_0x341d('0x26')](function(){_0x74b2af[_0x341d('0x1b')](0xcc)[_0x341d('0x1c')]();});}};}function handleEntityNotFound(_0x46a5d7,_0x3ea150){return function(_0x5072ee){if(!_0x5072ee){_0x46a5d7[_0x341d('0x1a')](0x194);}return _0x5072ee;};}function handleError(_0x4d6647,_0x2e0070){_0x2e0070=_0x2e0070||0x1f4;return function(_0x32cae1){logger[_0x341d('0x27')](_0x32cae1[_0x341d('0x28')]);if(_0x32cae1['name']){delete _0x32cae1[_0x341d('0x29')];}_0x4d6647[_0x341d('0x1b')](_0x2e0070)[_0x341d('0x2a')](_0x32cae1);};}exports[_0x341d('0x2b')]=function(_0x5af585,_0x1bf1b0){var _0x54c4d4={},_0x2044a0={},_0x5e545b={'count':0x0,'rows':[]};var _0x26fb31=_['map'](db[_0x341d('0x2c')]['rawAttributes'],function(_0x235a91){return{'name':_0x235a91[_0x341d('0x2d')],'type':_0x235a91[_0x341d('0x2e')][_0x341d('0x2f')]};});_0x2044a0['model']=_['map'](_0x26fb31,'name');_0x2044a0[_0x341d('0x30')]=_[_0x341d('0x31')](_0x5af585[_0x341d('0x30')]);_0x2044a0['filters']=_[_0x341d('0x32')](_0x2044a0[_0x341d('0x33')],_0x2044a0[_0x341d('0x30')]);_0x54c4d4['attributes']=_[_0x341d('0x32')](_0x2044a0[_0x341d('0x33')],qs['fields'](_0x5af585[_0x341d('0x30')][_0x341d('0x34')]));_0x54c4d4[_0x341d('0x35')]=_0x54c4d4[_0x341d('0x35')]['length']?_0x54c4d4['attributes']:_0x2044a0[_0x341d('0x33')];if(!_0x5af585['query'][_0x341d('0x36')](_0x341d('0x37'))){_0x54c4d4[_0x341d('0x1f')]=qs[_0x341d('0x1f')](_0x5af585[_0x341d('0x30')]['limit']);_0x54c4d4[_0x341d('0x1e')]=qs[_0x341d('0x1e')](_0x5af585[_0x341d('0x30')][_0x341d('0x1e')]);}_0x54c4d4[_0x341d('0x38')]=qs['sort'](_0x5af585[_0x341d('0x30')][_0x341d('0x39')]);_0x54c4d4['where']=qs[_0x341d('0x3a')](_[_0x341d('0x3b')](_0x5af585[_0x341d('0x30')],_0x2044a0[_0x341d('0x3a')]),_0x26fb31);if(_0x5af585[_0x341d('0x30')]['filter']){_0x54c4d4['where']=_['merge'](_0x54c4d4[_0x341d('0x3c')],{'$or':_[_0x341d('0x3d')](_0x26fb31,function(_0x33d6e1){if(_0x33d6e1[_0x341d('0x2e')]!==_0x341d('0x3e')){var _0x13e0c6={};_0x13e0c6[_0x33d6e1['name']]={'$like':'%'+_0x5af585['query'][_0x341d('0x3f')]+'%'};return _0x13e0c6;}})});}_0x54c4d4=_['merge']({},_0x54c4d4,_0x5af585[_0x341d('0x40')]);var _0x3e737a={'where':_0x54c4d4['where']};return db[_0x341d('0x2c')][_0x341d('0x21')](_0x3e737a)['then'](function(_0x5b845f){_0x5e545b['count']=_0x5b845f;if(_0x5af585[_0x341d('0x30')][_0x341d('0x41')]){_0x54c4d4[_0x341d('0x42')]=[{'all':!![]}];}return db[_0x341d('0x2c')][_0x341d('0x43')](_0x54c4d4);})[_0x341d('0x26')](function(_0x2fc9f1){_0x5e545b[_0x341d('0x44')]=_0x2fc9f1;return _0x5e545b;})[_0x341d('0x26')](respondWithFilteredResult(_0x1bf1b0,_0x54c4d4))['catch'](handleError(_0x1bf1b0,null));};exports['show']=function(_0x2c3bef,_0x29456a){var _0x12d211={'raw':!![],'where':{'id':_0x2c3bef[_0x341d('0x45')]['id']}},_0xce236a={};_0xce236a[_0x341d('0x33')]=_[_0x341d('0x31')](db[_0x341d('0x2c')]['rawAttributes']);_0xce236a['query']=_[_0x341d('0x31')](_0x2c3bef[_0x341d('0x30')]);_0xce236a['filters']=_[_0x341d('0x32')](_0xce236a[_0x341d('0x33')],_0xce236a[_0x341d('0x30')]);_0x12d211[_0x341d('0x35')]=_['intersection'](_0xce236a['model'],qs['fields'](_0x2c3bef[_0x341d('0x30')]['fields']));_0x12d211[_0x341d('0x35')]=_0x12d211[_0x341d('0x35')][_0x341d('0x46')]?_0x12d211[_0x341d('0x35')]:_0xce236a[_0x341d('0x33')];if(_0x2c3bef[_0x341d('0x30')]['includeAll']){_0x12d211['include']=[{'all':!![]}];}_0x12d211=_['merge']({},_0x12d211,_0x2c3bef[_0x341d('0x40')]);return db[_0x341d('0x2c')][_0x341d('0x47')](_0x12d211)[_0x341d('0x26')](handleEntityNotFound(_0x29456a,null))['then'](respondWithResult(_0x29456a,null))[_0x341d('0x48')](handleError(_0x29456a,null));};exports['create']=function(_0x1ec103,_0xe1c50c){return db[_0x341d('0x2c')][_0x341d('0x49')](_0x1ec103[_0x341d('0x4a')],{})['then'](respondWithResult(_0xe1c50c,0xc9))[_0x341d('0x48')](handleError(_0xe1c50c,null));};exports['update']=function(_0x3998b2,_0x1ea007){if(_0x3998b2[_0x341d('0x4a')]['id']){delete _0x3998b2[_0x341d('0x4a')]['id'];}return db[_0x341d('0x2c')][_0x341d('0x47')]({'where':{'id':_0x3998b2['params']['id']}})[_0x341d('0x26')](handleEntityNotFound(_0x1ea007,null))['then'](saveUpdates(_0x3998b2[_0x341d('0x4a')],null))[_0x341d('0x26')](respondWithResult(_0x1ea007,null))['catch'](handleError(_0x1ea007,null));};exports[_0x341d('0x4b')]=function(_0xeabd41,_0x5a3cab,_0x3f0899){var _0x33f902=require(_0x341d('0x4c'));var _0x3fa6f1=![];var _0x350225={};if(_0xeabd41[_0x341d('0x30')][_0x341d('0x2e')]&&_0xeabd41[_0x341d('0x30')]['type']===_0x341d('0x4d')){_0x350225[_0x341d('0x4d')]=_0xeabd41[_0x341d('0x45')]['id'];}else{_0x350225['id']=_0xeabd41[_0x341d('0x45')]['id'];}return db['SquareRecording']['find']({'where':_0x350225,'attributes':['id',_0x341d('0x4e'),_0x341d('0x4f')],'raw':!![]})[_0x341d('0x26')](handleEntityNotFound(_0x5a3cab,null))['then'](function(_0x7ae700){if(_0x7ae700){var _0x405e2f=_0x7ae700[_0x341d('0x4e')];var _0x364cfa=util[_0x341d('0x50')](_0x341d('0x51'),_0x405e2f);if(fs['existsSync'](_0x364cfa)){_0x3fa6f1=!![];return _0x33f902[_0x341d('0x52')](_0x364cfa,_0x405e2f,config[_0x341d('0x53')]['recording'])[_0x341d('0x26')](function(){return _0x7ae700;});}return _0x7ae700;}})[_0x341d('0x26')](function(_0x2cc175){if(_0x2cc175){var _0x56dcdf=_0x2cc175[_0x341d('0x4e')];if(!fs[_0x341d('0x54')](_0x56dcdf)){throw new db[(_0x341d('0x55'))][(_0x341d('0x56'))](_0x341d('0x57'));}if(_0x2cc175['filename']){return _0x5a3cab[_0x341d('0x4b')](_0x56dcdf,_0x2cc175[_0x341d('0x4f')]+path[_0x341d('0x58')](_0x56dcdf),function(){if(_0x3fa6f1){fs[_0x341d('0x59')](_0x56dcdf);}});}else{return _0x5a3cab[_0x341d('0x4b')](_0x56dcdf,function(_0x218125){if(_0x3fa6f1){fs['unlink'](_0x56dcdf);}});}}})[_0x341d('0x48')](function(_0x51a06e){if(_0x51a06e['message']===_0x341d('0x57')){_0x5a3cab[_0x341d('0x1b')](0x194)['send']('Not\x20found');}else{return handleError(_0x5a3cab,null);}});};exports[_0x341d('0x5a')]=function(_0x23b022,_0xedd352){return db[_0x341d('0x2c')]['find']({'where':{'id':_0x23b022[_0x341d('0x45')]['id']}})[_0x341d('0x26')](function(_0x4b0797){if(_[_0x341d('0x5b')](_0x4b0797)){throw new ReferenceError(_0x341d('0x5c'));}return _0x4b0797;})[_0x341d('0x26')](function(_0x35abde){var _0x277775=_0x35abde['savePath'];logger[_0x341d('0x5d')](_0x341d('0x5e'),_0x277775);if(!_[_0x341d('0x5b')](_0x35abde[_0x341d('0x4e')])&&fs[_0x341d('0x54')](_0x277775)){logger[_0x341d('0x5d')]('File:\x20\x22'+_0x277775+_0x341d('0x5f'));fs[_0x341d('0x60')](_0x277775);}_0x277775=_0x277775+_0x341d('0x61');if(!_[_0x341d('0x5b')](_0x35abde[_0x341d('0x4e')])&&fs[_0x341d('0x54')](_0x277775)){logger[_0x341d('0x5d')](_0x341d('0x62')+_0x277775+_0x341d('0x5f'));fs['unlinkSync'](_0x277775);}return _0x35abde;})[_0x341d('0x26')](function(_0x2b3b4a){if(!_0x2b3b4a)throw new InternalError();return _0x2b3b4a['destroy']();})[_0x341d('0x26')](function(){_0xedd352['status'](0xcc)['end']();})[_0x341d('0x48')](handleError(_0xedd352,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 0ddbbfd..45a9c28 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 _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 +var _0xb242=['./squareRecording.attributes','exports','define','SquareRecording','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5516a1,_0x215ca4){var _0x4a957b=function(_0x39b0e6){while(--_0x39b0e6){_0x5516a1['push'](_0x5516a1['shift']());}};_0x4a957b(++_0x215ca4);}(_0xb242,0x1f3));var _0x2b24=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0xb242[_0x49d41c];return _0xb64c5f;};'use strict';var _=require('lodash');var util=require(_0x2b24('0x0'));var logger=require(_0x2b24('0x1'))(_0x2b24('0x2'));var moment=require(_0x2b24('0x3'));var BPromise=require(_0x2b24('0x4'));var rp=require(_0x2b24('0x5'));var fs=require('fs');var path=require(_0x2b24('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2b24('0x7'));module[_0x2b24('0x8')]=function(_0x5c1f57,_0x341c66){return _0x5c1f57[_0x2b24('0x9')](_0x2b24('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 7e8e2c8..3f7aac3 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 _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 +var _0x0119=['then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','SquareRecording','create','body','options','raw','CreateSquareRecording','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1c3e53,_0x276928){var _0x3fd2c2=function(_0x2338fa){while(--_0x2338fa){_0x1c3e53['push'](_0x1c3e53['shift']());}};_0x3fd2c2(++_0x276928);}(_0x0119,0x160));var _0x9011=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x0119[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0x9011('0x0'));var moment=require(_0x9011('0x1'));var BPromise=require(_0x9011('0x2'));var rs=require(_0x9011('0x3'));var fs=require('fs');var Redis=require(_0x9011('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9011('0x5'));var logger=require(_0x9011('0x6'))(_0x9011('0x7'));var config=require(_0x9011('0x8'));var jayson=require(_0x9011('0x9'));var client=jayson[_0x9011('0xa')][_0x9011('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x356d9d,_0x5b66af,_0x3f77e3){return new BPromise(function(_0x4bea4f,_0x303203){return client['request'](_0x356d9d,_0x3f77e3)[_0x9011('0xc')](function(_0x27936e){logger[_0x9011('0xd')](_0x9011('0xe'),_0x5b66af,_0x9011('0xf'));logger[_0x9011('0x10')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x5b66af,'request\x20sent',JSON[_0x9011('0x11')](_0x27936e));if(_0x27936e[_0x9011('0x12')]){if(_0x27936e['error']['code']===0x1f4){logger['error'](_0x9011('0xe'),_0x5b66af,_0x27936e[_0x9011('0x12')][_0x9011('0x13')]);return _0x303203(_0x27936e[_0x9011('0x12')]['message']);}logger['error'](_0x9011('0xe'),_0x5b66af,_0x27936e[_0x9011('0x12')]['message']);return _0x4bea4f(_0x27936e[_0x9011('0x12')][_0x9011('0x13')]);}else{logger[_0x9011('0xd')]('SquareRecording,\x20%s,\x20%s',_0x5b66af,'request\x20sent');_0x4bea4f(_0x27936e[_0x9011('0x14')]['message']);}})[_0x9011('0x15')](function(_0x4aa012){logger['error']('SquareRecording,\x20%s,\x20%s',_0x5b66af,_0x4aa012);_0x303203(_0x4aa012);});});}exports['CreateSquareRecording']=function(_0x5abcb1){var _0x27bad3=this;return new Promise(function(_0x26bd08,_0xebff48){return db[_0x9011('0x16')][_0x9011('0x17')](_0x5abcb1[_0x9011('0x18')],{'raw':_0x5abcb1[_0x9011('0x19')]?_0x5abcb1[_0x9011('0x19')][_0x9011('0x1a')]===undefined?!![]:![]:!![]})[_0x9011('0xc')](function(_0x4eb87e){logger[_0x9011('0xd')](_0x9011('0x1b'),_0x5abcb1);logger['debug']('CreateSquareRecording',_0x5abcb1,JSON[_0x9011('0x11')](_0x4eb87e));_0x26bd08(_0x4eb87e);})[_0x9011('0x15')](function(_0x10207e){logger[_0x9011('0x12')](_0x9011('0x1b'),_0x10207e[_0x9011('0x13')],_0x5abcb1);_0xebff48(_0x27bad3[_0x9011('0x12')](0x1f4,_0x10207e[_0x9011('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 6cc74f7..0860f81 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 _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 +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(_0x459d7d,_0x55db19){var _0x26abf1=function(_0x39e5d5){while(--_0x39e5d5){_0x459d7d['push'](_0x459d7d['shift']());}};_0x26abf1(++_0x55db19);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index b59baf7..a1048d8 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 _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 +var _0xd6c1=['STRING','DATE','sequelize','exports'];(function(_0x9a4f5a,_0xc292b0){var _0x3914d7=function(_0xfcc545){while(--_0xfcc545){_0x9a4f5a['push'](_0x9a4f5a['shift']());}};_0x3914d7(++_0xc292b0);}(_0xd6c1,0x196));var _0x1d6c=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xd6c1[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0x1d6c('0x0'));module[_0x1d6c('0x1')]={'network':{'type':Sequelize[_0x1d6c('0x2')]},'network_script':{'type':Sequelize[_0x1d6c('0x2')]},'request':{'type':Sequelize[_0x1d6c('0x2')]},'channel':{'type':Sequelize[_0x1d6c('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1d6c('0x2')]},'uniqueid':{'type':Sequelize[_0x1d6c('0x2')]},'version':{'type':Sequelize[_0x1d6c('0x2')]},'callerid':{'type':Sequelize[_0x1d6c('0x2')]},'calleridname':{'type':Sequelize[_0x1d6c('0x2')]},'callingpres':{'type':Sequelize[_0x1d6c('0x2')]},'callingani2':{'type':Sequelize[_0x1d6c('0x2')]},'callington':{'type':Sequelize[_0x1d6c('0x2')]},'callingtns':{'type':Sequelize[_0x1d6c('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x1d6c('0x2')]},'context':{'type':Sequelize[_0x1d6c('0x2')]},'extension':{'type':Sequelize[_0x1d6c('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x1d6c('0x2')]},'accountcode':{'type':Sequelize[_0x1d6c('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x1d6c('0x2')]},'joinAt':{'type':Sequelize[_0x1d6c('0x3')]},'leaveAt':{'type':Sequelize[_0x1d6c('0x3')]},'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 7c5b0b3..9169304 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 _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 +var _0x92f6=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset','set','save','update','then','end','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','SquareReport','includeAll','findAll','rows','catch','show','params','include','create','body','find','destroy','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x423b18,_0x58fca0){var _0x205922=function(_0x37de6d){while(--_0x37de6d){_0x423b18['push'](_0x423b18['shift']());}};_0x205922(++_0x58fca0);}(_0x92f6,0x1b4));var _0x692f=function(_0x14e049,_0x490cfd){_0x14e049=_0x14e049-0x0;var _0x4a4308=_0x92f6[_0x14e049];return _0x4a4308;};'use strict';var emlformat=require(_0x692f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x692f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x692f('0x2'));var BPromise=require(_0x692f('0x3'));var Mustache=require(_0x692f('0x4'));var util=require(_0x692f('0x5'));var path=require(_0x692f('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x692f('0x7'));var fs=require('fs');var fs_extra=require(_0x692f('0x8'));var _=require(_0x692f('0x9'));var squel=require(_0x692f('0xa'));var crypto=require(_0x692f('0xb'));var jsforce=require(_0x692f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x692f('0xd'));var Papa=require(_0x692f('0xe'));var Redis=require(_0x692f('0xf'));var authService=require(_0x692f('0x10'));var qs=require(_0x692f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x692f('0x12'));var logger=require(_0x692f('0x13'))('api');var utils=require(_0x692f('0x14'));var config=require(_0x692f('0x15'));var licenseUtil=require(_0x692f('0x16'));var db=require(_0x692f('0x17'))['db'];function respondWithStatusCode(_0x45deb3,_0x3fec5e){_0x3fec5e=_0x3fec5e||0xcc;return function(_0x3365bf){if(_0x3365bf){return _0x45deb3['sendStatus'](_0x3fec5e);}return _0x45deb3['status'](_0x3fec5e)['end']();};}function respondWithResult(_0x2cc01b,_0x3679c8){_0x3679c8=_0x3679c8||0xc8;return function(_0x4456d4){if(_0x4456d4){return _0x2cc01b[_0x692f('0x18')](_0x3679c8)[_0x692f('0x19')](_0x4456d4);}};}function respondWithFilteredResult(_0x3d56ce,_0x219d8a){return function(_0x34a784){if(_0x34a784){var _0x263053=typeof _0x219d8a['offset']==='undefined'&&typeof _0x219d8a[_0x692f('0x1a')]===_0x692f('0x1b');var _0x5a88cc=_0x34a784[_0x692f('0x1c')];var _0x56d1ac=_0x263053?0x0:_0x219d8a[_0x692f('0x1d')];var _0x11bd9e=_0x263053?_0x34a784[_0x692f('0x1c')]:_0x219d8a['offset']+_0x219d8a[_0x692f('0x1a')];var _0x415452;if(_0x11bd9e>=_0x5a88cc){_0x11bd9e=_0x5a88cc;_0x415452=0xc8;}else{_0x415452=0xce;}_0x3d56ce[_0x692f('0x18')](_0x415452);return _0x3d56ce[_0x692f('0x1e')]('Content-Range',_0x56d1ac+'-'+_0x11bd9e+'/'+_0x5a88cc)['json'](_0x34a784);}return null;};}function patchUpdates(_0x108b5f){return function(_0x46ff65){try{jsonpatch['apply'](_0x46ff65,_0x108b5f,!![]);}catch(_0x26638c){return BPromise['reject'](_0x26638c);}return _0x46ff65[_0x692f('0x1f')]();};}function saveUpdates(_0x1284fc,_0x4b1628){return function(_0x341479){if(_0x341479){return _0x341479[_0x692f('0x20')](_0x1284fc)[_0x692f('0x21')](function(_0x118f10){return _0x118f10;});}return null;};}function removeEntity(_0x45312c,_0xc9d2ac){return function(_0x500a27){if(_0x500a27){return _0x500a27['destroy']()['then'](function(){_0x45312c[_0x692f('0x18')](0xcc)[_0x692f('0x22')]();});}};}function handleEntityNotFound(_0x4ecd29,_0x567f54){return function(_0x33dc46){if(!_0x33dc46){_0x4ecd29[_0x692f('0x23')](0x194);}return _0x33dc46;};}function handleError(_0x323c5e,_0x1cce18){_0x1cce18=_0x1cce18||0x1f4;return function(_0x2805be){logger[_0x692f('0x24')](_0x2805be[_0x692f('0x25')]);if(_0x2805be[_0x692f('0x26')]){delete _0x2805be[_0x692f('0x26')];}_0x323c5e[_0x692f('0x18')](_0x1cce18)[_0x692f('0x27')](_0x2805be);};}exports['index']=function(_0x3b044a,_0x173f57){var _0x292ae0={},_0x154c30={},_0x3c4592={'count':0x0,'rows':[]};var _0x2942ed=_[_0x692f('0x28')](db['SquareReport'][_0x692f('0x29')],function(_0x30e3ac){return{'name':_0x30e3ac[_0x692f('0x2a')],'type':_0x30e3ac[_0x692f('0x2b')][_0x692f('0x2c')]};});_0x154c30[_0x692f('0x2d')]=_[_0x692f('0x28')](_0x2942ed,'name');_0x154c30['query']=_[_0x692f('0x2e')](_0x3b044a[_0x692f('0x2f')]);_0x154c30[_0x692f('0x30')]=_[_0x692f('0x31')](_0x154c30[_0x692f('0x2d')],_0x154c30[_0x692f('0x2f')]);_0x292ae0['attributes']=_[_0x692f('0x31')](_0x154c30[_0x692f('0x2d')],qs[_0x692f('0x32')](_0x3b044a[_0x692f('0x2f')]['fields']));_0x292ae0[_0x692f('0x33')]=_0x292ae0[_0x692f('0x33')][_0x692f('0x34')]?_0x292ae0[_0x692f('0x33')]:_0x154c30['model'];if(!_0x3b044a['query'][_0x692f('0x35')](_0x692f('0x36'))){_0x292ae0['limit']=qs['limit'](_0x3b044a[_0x692f('0x2f')][_0x692f('0x1a')]);_0x292ae0['offset']=qs[_0x692f('0x1d')](_0x3b044a[_0x692f('0x2f')][_0x692f('0x1d')]);}_0x292ae0[_0x692f('0x37')]=qs[_0x692f('0x38')](_0x3b044a[_0x692f('0x2f')]['sort']);_0x292ae0['where']=qs['filters'](_[_0x692f('0x39')](_0x3b044a[_0x692f('0x2f')],_0x154c30[_0x692f('0x30')]),_0x2942ed);if(_0x3b044a[_0x692f('0x2f')]['filter']){_0x292ae0[_0x692f('0x3a')]=_[_0x692f('0x3b')](_0x292ae0[_0x692f('0x3a')],{'$or':_[_0x692f('0x28')](_0x2942ed,function(_0x312b63){if(_0x312b63[_0x692f('0x2b')]!=='VIRTUAL'){var _0x53a83a={};_0x53a83a[_0x312b63[_0x692f('0x26')]]={'$like':'%'+_0x3b044a[_0x692f('0x2f')][_0x692f('0x3c')]+'%'};return _0x53a83a;}})});}_0x292ae0=_[_0x692f('0x3b')]({},_0x292ae0,_0x3b044a[_0x692f('0x3d')]);var _0x1006bd={'where':_0x292ae0[_0x692f('0x3a')]};return db[_0x692f('0x3e')][_0x692f('0x1c')](_0x1006bd)[_0x692f('0x21')](function(_0x5f5a12){_0x3c4592[_0x692f('0x1c')]=_0x5f5a12;if(_0x3b044a[_0x692f('0x2f')][_0x692f('0x3f')]){_0x292ae0['include']=[{'all':!![]}];}return db[_0x692f('0x3e')][_0x692f('0x40')](_0x292ae0);})[_0x692f('0x21')](function(_0x26043){_0x3c4592[_0x692f('0x41')]=_0x26043;return _0x3c4592;})[_0x692f('0x21')](respondWithFilteredResult(_0x173f57,_0x292ae0))[_0x692f('0x42')](handleError(_0x173f57,null));};exports[_0x692f('0x43')]=function(_0x4397cd,_0x25ba9d){var _0x5432c3={'raw':!![],'where':{'id':_0x4397cd[_0x692f('0x44')]['id']}},_0x17e37d={};_0x17e37d[_0x692f('0x2d')]=_[_0x692f('0x2e')](db['SquareReport'][_0x692f('0x29')]);_0x17e37d[_0x692f('0x2f')]=_[_0x692f('0x2e')](_0x4397cd[_0x692f('0x2f')]);_0x17e37d['filters']=_['intersection'](_0x17e37d[_0x692f('0x2d')],_0x17e37d['query']);_0x5432c3[_0x692f('0x33')]=_[_0x692f('0x31')](_0x17e37d['model'],qs[_0x692f('0x32')](_0x4397cd['query']['fields']));_0x5432c3[_0x692f('0x33')]=_0x5432c3[_0x692f('0x33')][_0x692f('0x34')]?_0x5432c3[_0x692f('0x33')]:_0x17e37d[_0x692f('0x2d')];if(_0x4397cd[_0x692f('0x2f')]['includeAll']){_0x5432c3[_0x692f('0x45')]=[{'all':!![]}];}_0x5432c3=_[_0x692f('0x3b')]({},_0x5432c3,_0x4397cd[_0x692f('0x3d')]);return db[_0x692f('0x3e')]['find'](_0x5432c3)[_0x692f('0x21')](handleEntityNotFound(_0x25ba9d,null))[_0x692f('0x21')](respondWithResult(_0x25ba9d,null))['catch'](handleError(_0x25ba9d,null));};exports['create']=function(_0x3c3f26,_0x58d75c){return db[_0x692f('0x3e')][_0x692f('0x46')](_0x3c3f26['body'],{})[_0x692f('0x21')](respondWithResult(_0x58d75c,0xc9))[_0x692f('0x42')](handleError(_0x58d75c,null));};exports['update']=function(_0x4ddc30,_0x378eab){if(_0x4ddc30[_0x692f('0x47')]['id']){delete _0x4ddc30[_0x692f('0x47')]['id'];}return db['SquareReport'][_0x692f('0x48')]({'where':{'id':_0x4ddc30['params']['id']}})[_0x692f('0x21')](handleEntityNotFound(_0x378eab,null))[_0x692f('0x21')](saveUpdates(_0x4ddc30[_0x692f('0x47')],null))[_0x692f('0x21')](respondWithResult(_0x378eab,null))[_0x692f('0x42')](handleError(_0x378eab,null));};exports[_0x692f('0x49')]=function(_0x1f5149,_0x14ce73){return db[_0x692f('0x3e')][_0x692f('0x48')]({'where':{'id':_0x1f5149[_0x692f('0x44')]['id']}})[_0x692f('0x21')](handleEntityNotFound(_0x14ce73,null))[_0x692f('0x21')](removeEntity(_0x14ce73,null))[_0x692f('0x42')](handleError(_0x14ce73,null));};exports[_0x692f('0x4a')]=function(_0x3cea46,_0x4d4100){return db[_0x692f('0x3e')]['describe']()[_0x692f('0x21')](respondWithResult(_0x4d4100,null))[_0x692f('0x42')](handleError(_0x4d4100,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 0172ff2..1ad72fe 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 _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 +var _0x2f77=['bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','report_square','uniqueid','leaveAt','lodash','util','../../config/logger','api'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x2f77,0x6c));var _0x72f7=function(_0x39e884,_0x4a01e6){_0x39e884=_0x39e884-0x0;var _0x26358e=_0x2f77[_0x39e884];return _0x26358e;};'use strict';var _=require(_0x72f7('0x0'));var util=require(_0x72f7('0x1'));var logger=require(_0x72f7('0x2'))(_0x72f7('0x3'));var moment=require('moment');var BPromise=require(_0x72f7('0x4'));var rp=require(_0x72f7('0x5'));var fs=require('fs');var path=require(_0x72f7('0x6'));var rimraf=require(_0x72f7('0x7'));var config=require(_0x72f7('0x8'));var attributes=require(_0x72f7('0x9'));module[_0x72f7('0xa')]=function(_0x5ba409,_0x2445c2){return _0x5ba409['define']('SquareReport',attributes,{'tableName':_0x72f7('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x72f7('0xc'),'project_name']},{'name':'leaveAt','fields':[_0x72f7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index dd8a686..3a78975 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 _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 +var _0xc29a=['options','raw','then','catch','UpdateSquareReport','update','where','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','CreateSquareReport','SquareReport','create'];(function(_0x593cbd,_0x141c5b){var _0x1ea4aa=function(_0x5d42ba){while(--_0x5d42ba){_0x593cbd['push'](_0x593cbd['shift']());}};_0x1ea4aa(++_0x141c5b);}(_0xc29a,0x11a));var _0xac29=function(_0x58105c,_0x339a6f){_0x58105c=_0x58105c-0x0;var _0x3ff521=_0xc29a[_0x58105c];return _0x3ff521;};'use strict';var _=require(_0xac29('0x0'));var util=require(_0xac29('0x1'));var moment=require(_0xac29('0x2'));var BPromise=require(_0xac29('0x3'));var rs=require(_0xac29('0x4'));var fs=require('fs');var Redis=require(_0xac29('0x5'));var db=require(_0xac29('0x6'))['db'];var utils=require(_0xac29('0x7'));var logger=require(_0xac29('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xac29('0x9'));var client=jayson[_0xac29('0xa')][_0xac29('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34ec21,_0x249ad6,_0x5a7a27){return new BPromise(function(_0x164903,_0x223868){return client[_0xac29('0xc')](_0x34ec21,_0x5a7a27)['then'](function(_0x1b2cf6){logger[_0xac29('0xd')](_0xac29('0xe'),_0x249ad6,_0xac29('0xf'));logger[_0xac29('0x10')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x249ad6,_0xac29('0xf'),JSON['stringify'](_0x1b2cf6));if(_0x1b2cf6[_0xac29('0x11')]){if(_0x1b2cf6[_0xac29('0x11')][_0xac29('0x12')]===0x1f4){logger['error'](_0xac29('0xe'),_0x249ad6,_0x1b2cf6[_0xac29('0x11')]['message']);return _0x223868(_0x1b2cf6[_0xac29('0x11')][_0xac29('0x13')]);}logger[_0xac29('0x11')]('SquareReport,\x20%s,\x20%s',_0x249ad6,_0x1b2cf6['error'][_0xac29('0x13')]);return _0x164903(_0x1b2cf6[_0xac29('0x11')][_0xac29('0x13')]);}else{logger[_0xac29('0xd')](_0xac29('0xe'),_0x249ad6,_0xac29('0xf'));_0x164903(_0x1b2cf6[_0xac29('0x14')][_0xac29('0x13')]);}})['catch'](function(_0x2efb88){logger['error'](_0xac29('0xe'),_0x249ad6,_0x2efb88);_0x223868(_0x2efb88);});});}exports[_0xac29('0x15')]=function(_0x4ad743){var _0x1aa79c=this;return new Promise(function(_0x4b32bc,_0x487c84){return db[_0xac29('0x16')][_0xac29('0x17')](_0x4ad743['body'],{'raw':_0x4ad743[_0xac29('0x18')]?_0x4ad743[_0xac29('0x18')][_0xac29('0x19')]===undefined?!![]:![]:!![]})[_0xac29('0x1a')](function(_0x48e757){logger[_0xac29('0xd')]('CreateSquareReport',_0x4ad743);logger[_0xac29('0x10')]('CreateSquareReport',_0x4ad743,JSON['stringify'](_0x48e757));_0x4b32bc(_0x48e757);})[_0xac29('0x1b')](function(_0x1d381d){logger[_0xac29('0x11')](_0xac29('0x15'),_0x1d381d[_0xac29('0x13')],_0x4ad743);_0x487c84(_0x1aa79c[_0xac29('0x11')](0x1f4,_0x1d381d[_0xac29('0x13')]));});});};exports[_0xac29('0x1c')]=function(_0x246b14){var _0x3a0d5b=this;return new Promise(function(_0x9c77e8,_0x8ae3b1){return db['SquareReport'][_0xac29('0x1d')](_0x246b14['body'],{'raw':_0x246b14[_0xac29('0x18')]?_0x246b14[_0xac29('0x18')][_0xac29('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x246b14[_0xac29('0x18')]?_0x246b14[_0xac29('0x18')][_0xac29('0x1e')]||null:null,'attributes':_0x246b14[_0xac29('0x18')]?_0x246b14[_0xac29('0x18')][_0xac29('0x1f')]||null:null,'limit':_0x246b14['options']?_0x246b14[_0xac29('0x18')][_0xac29('0x20')]||null:null})[_0xac29('0x1a')](function(_0x355495){logger[_0xac29('0xd')](_0xac29('0x1c'),_0x246b14);logger[_0xac29('0x10')](_0xac29('0x1c'),_0x246b14,JSON[_0xac29('0x21')](_0x355495));_0x9c77e8(_0x355495);})[_0xac29('0x1b')](function(_0x2d7024){logger['error'](_0xac29('0x1c'),_0x2d7024['message'],_0x246b14);_0x8ae3b1(_0x3a0d5b[_0xac29('0x11')](0x1f4,_0x2d7024[_0xac29('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index c7c07c8..cd00fef 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 _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 +var _0x3b35=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1cec84,_0x101ec2){var _0x12b7d3=function(_0x9679d8){while(--_0x9679d8){_0x1cec84['push'](_0x1cec84['shift']());}};_0x12b7d3(++_0x101ec2);}(_0x3b35,0x7e));var _0x53b3=function(_0x25bde7,_0x2e30b4){_0x25bde7=_0x25bde7-0x0;var _0x5d6618=_0x3b35[_0x25bde7];return _0x5d6618;};'use strict';var multer=require('multer');var util=require(_0x53b3('0x0'));var path=require(_0x53b3('0x1'));var timeout=require(_0x53b3('0x2'));var express=require(_0x53b3('0x3'));var router=express[_0x53b3('0x4')]();var fs_extra=require(_0x53b3('0x5'));var auth=require(_0x53b3('0x6'));var interaction=require(_0x53b3('0x7'));var config=require(_0x53b3('0x8'));var controller=require(_0x53b3('0x9'));router[_0x53b3('0xa')]('/',auth[_0x53b3('0xb')](),controller[_0x53b3('0xc')]);router[_0x53b3('0xa')](_0x53b3('0xd'),auth[_0x53b3('0xb')](),controller['describe']);router[_0x53b3('0xa')](_0x53b3('0xe'),auth[_0x53b3('0xb')](),controller['show']);router[_0x53b3('0xf')]('/',auth['isAuthenticated'](),controller[_0x53b3('0x10')]);router[_0x53b3('0x11')](_0x53b3('0xe'),auth[_0x53b3('0xb')](),controller[_0x53b3('0x12')]);router[_0x53b3('0x13')](_0x53b3('0xe'),auth[_0x53b3('0xb')](),controller[_0x53b3('0x14')]);module[_0x53b3('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 3375144..c40f8d6 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 _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 +var _0x835c=['exports','STRING','TEXT','sequelize'];(function(_0x1ae005,_0x18f2ba){var _0x2d8df5=function(_0x271009){while(--_0x271009){_0x1ae005['push'](_0x1ae005['shift']());}};_0x2d8df5(++_0x18f2ba);}(_0x835c,0x177));var _0xc835=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x835c[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xc835('0x0'));module[_0xc835('0x1')]={'uniqueid':{'type':Sequelize[_0xc835('0x2')]},'node':{'type':Sequelize[_0xc835('0x2')]},'application':{'type':Sequelize[_0xc835('0x2')]},'data':{'type':Sequelize[_0xc835('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xc835('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 253f4f4..df95915 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 _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 +var _0xecc4=['moment','bluebird','util','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/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','sendStatus','error','stack','send','map','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SquareDetailsReport','includeAll','include','findAll','rows','catch','params','fields','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x1ee1f9,_0x22021d){var _0x357c8d=function(_0x5ba14a){while(--_0x5ba14a){_0x1ee1f9['push'](_0x1ee1f9['shift']());}};_0x357c8d(++_0x22021d);}(_0xecc4,0x181));var _0x4ecc=function(_0xb54ffa,_0x31d47f){_0xb54ffa=_0xb54ffa-0x0;var _0x5294a0=_0xecc4[_0xb54ffa];return _0x5294a0;};'use strict';var emlformat=require(_0x4ecc('0x0'));var rimraf=require(_0x4ecc('0x1'));var zipdir=require(_0x4ecc('0x2'));var jsonpatch=require(_0x4ecc('0x3'));var rp=require(_0x4ecc('0x4'));var moment=require(_0x4ecc('0x5'));var BPromise=require(_0x4ecc('0x6'));var Mustache=require('mustache');var util=require(_0x4ecc('0x7'));var path=require(_0x4ecc('0x8'));var sox=require(_0x4ecc('0x9'));var csv=require(_0x4ecc('0xa'));var ejs=require(_0x4ecc('0xb'));var fs=require('fs');var fs_extra=require(_0x4ecc('0xc'));var _=require('lodash');var squel=require(_0x4ecc('0xd'));var crypto=require(_0x4ecc('0xe'));var jsforce=require(_0x4ecc('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4ecc('0xa'));var querystring=require(_0x4ecc('0x10'));var Papa=require(_0x4ecc('0x11'));var Redis=require(_0x4ecc('0x12'));var authService=require(_0x4ecc('0x13'));var qs=require(_0x4ecc('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ecc('0x15'));var logger=require(_0x4ecc('0x16'))(_0x4ecc('0x17'));var utils=require(_0x4ecc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4ecc('0x19'));var db=require(_0x4ecc('0x1a'))['db'];function respondWithStatusCode(_0xcf686a,_0x5291a5){_0x5291a5=_0x5291a5||0xcc;return function(_0x309fe2){if(_0x309fe2){return _0xcf686a['sendStatus'](_0x5291a5);}return _0xcf686a[_0x4ecc('0x1b')](_0x5291a5)[_0x4ecc('0x1c')]();};}function respondWithResult(_0x5581da,_0x1dd1bc){_0x1dd1bc=_0x1dd1bc||0xc8;return function(_0x31c767){if(_0x31c767){return _0x5581da[_0x4ecc('0x1b')](_0x1dd1bc)[_0x4ecc('0x1d')](_0x31c767);}};}function respondWithFilteredResult(_0x179b2f,_0x40406f){return function(_0x1b7da4){if(_0x1b7da4){var _0x34796d=typeof _0x40406f[_0x4ecc('0x1e')]===_0x4ecc('0x1f')&&typeof _0x40406f[_0x4ecc('0x20')]===_0x4ecc('0x1f');var _0x55dd52=_0x1b7da4['count'];var _0x4f998b=_0x34796d?0x0:_0x40406f[_0x4ecc('0x1e')];var _0x186141=_0x34796d?_0x1b7da4[_0x4ecc('0x21')]:_0x40406f[_0x4ecc('0x1e')]+_0x40406f[_0x4ecc('0x20')];var _0x318829;if(_0x186141>=_0x55dd52){_0x186141=_0x55dd52;_0x318829=0xc8;}else{_0x318829=0xce;}_0x179b2f[_0x4ecc('0x1b')](_0x318829);return _0x179b2f[_0x4ecc('0x22')](_0x4ecc('0x23'),_0x4f998b+'-'+_0x186141+'/'+_0x55dd52)['json'](_0x1b7da4);}return null;};}function patchUpdates(_0x38c9fe){return function(_0x3edd5a){try{jsonpatch['apply'](_0x3edd5a,_0x38c9fe,!![]);}catch(_0x2ac0ae){return BPromise[_0x4ecc('0x24')](_0x2ac0ae);}return _0x3edd5a[_0x4ecc('0x25')]();};}function saveUpdates(_0x1e7ed3,_0x5861f4){return function(_0x2a4456){if(_0x2a4456){return _0x2a4456[_0x4ecc('0x26')](_0x1e7ed3)[_0x4ecc('0x27')](function(_0x523ce0){return _0x523ce0;});}return null;};}function removeEntity(_0x556944,_0x276989){return function(_0x5d1422){if(_0x5d1422){return _0x5d1422['destroy']()[_0x4ecc('0x27')](function(){_0x556944['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d041d,_0x37e730){return function(_0x3bec84){if(!_0x3bec84){_0x4d041d[_0x4ecc('0x28')](0x194);}return _0x3bec84;};}function handleError(_0x4d39df,_0x2479d9){_0x2479d9=_0x2479d9||0x1f4;return function(_0x5ddd4d){logger[_0x4ecc('0x29')](_0x5ddd4d[_0x4ecc('0x2a')]);if(_0x5ddd4d['name']){delete _0x5ddd4d['name'];}_0x4d39df[_0x4ecc('0x1b')](_0x2479d9)[_0x4ecc('0x2b')](_0x5ddd4d);};}exports['index']=function(_0x11dd5a,_0x18f0e9){var _0x268dfd={},_0x3f0a38={},_0x3dbded={'count':0x0,'rows':[]};var _0x1333ef=_[_0x4ecc('0x2c')](db['SquareDetailsReport'][_0x4ecc('0x2d')],function(_0x55cfbc){return{'name':_0x55cfbc['fieldName'],'type':_0x55cfbc[_0x4ecc('0x2e')][_0x4ecc('0x2f')]};});_0x3f0a38[_0x4ecc('0x30')]=_[_0x4ecc('0x2c')](_0x1333ef,_0x4ecc('0x31'));_0x3f0a38[_0x4ecc('0x32')]=_[_0x4ecc('0x33')](_0x11dd5a['query']);_0x3f0a38[_0x4ecc('0x34')]=_[_0x4ecc('0x35')](_0x3f0a38[_0x4ecc('0x30')],_0x3f0a38[_0x4ecc('0x32')]);_0x268dfd[_0x4ecc('0x36')]=_[_0x4ecc('0x35')](_0x3f0a38[_0x4ecc('0x30')],qs['fields'](_0x11dd5a[_0x4ecc('0x32')]['fields']));_0x268dfd[_0x4ecc('0x36')]=_0x268dfd[_0x4ecc('0x36')][_0x4ecc('0x37')]?_0x268dfd[_0x4ecc('0x36')]:_0x3f0a38[_0x4ecc('0x30')];if(!_0x11dd5a[_0x4ecc('0x32')][_0x4ecc('0x38')](_0x4ecc('0x39'))){_0x268dfd[_0x4ecc('0x20')]=qs[_0x4ecc('0x20')](_0x11dd5a[_0x4ecc('0x32')][_0x4ecc('0x20')]);_0x268dfd[_0x4ecc('0x1e')]=qs['offset'](_0x11dd5a[_0x4ecc('0x32')][_0x4ecc('0x1e')]);}_0x268dfd[_0x4ecc('0x3a')]=qs[_0x4ecc('0x3b')](_0x11dd5a[_0x4ecc('0x32')][_0x4ecc('0x3b')]);_0x268dfd[_0x4ecc('0x3c')]=qs[_0x4ecc('0x34')](_[_0x4ecc('0x3d')](_0x11dd5a[_0x4ecc('0x32')],_0x3f0a38[_0x4ecc('0x34')]),_0x1333ef);if(_0x11dd5a[_0x4ecc('0x32')][_0x4ecc('0x3e')]){_0x268dfd['where']=_['merge'](_0x268dfd['where'],{'$or':_[_0x4ecc('0x2c')](_0x1333ef,function(_0x42aceb){if(_0x42aceb['type']!=='VIRTUAL'){var _0x3af0c3={};_0x3af0c3[_0x42aceb[_0x4ecc('0x31')]]={'$like':'%'+_0x11dd5a['query'][_0x4ecc('0x3e')]+'%'};return _0x3af0c3;}})});}_0x268dfd=_[_0x4ecc('0x3f')]({},_0x268dfd,_0x11dd5a[_0x4ecc('0x40')]);var _0x52c0dc={'where':_0x268dfd[_0x4ecc('0x3c')]};return db[_0x4ecc('0x41')][_0x4ecc('0x21')](_0x52c0dc)[_0x4ecc('0x27')](function(_0x35c0bf){_0x3dbded[_0x4ecc('0x21')]=_0x35c0bf;if(_0x11dd5a['query'][_0x4ecc('0x42')]){_0x268dfd[_0x4ecc('0x43')]=[{'all':!![]}];}return db[_0x4ecc('0x41')][_0x4ecc('0x44')](_0x268dfd);})[_0x4ecc('0x27')](function(_0x30ff28){_0x3dbded[_0x4ecc('0x45')]=_0x30ff28;return _0x3dbded;})[_0x4ecc('0x27')](respondWithFilteredResult(_0x18f0e9,_0x268dfd))[_0x4ecc('0x46')](handleError(_0x18f0e9,null));};exports['show']=function(_0x5ea1f0,_0x131324){var _0x394c6e={'raw':!![],'where':{'id':_0x5ea1f0[_0x4ecc('0x47')]['id']}},_0x21ea04={};_0x21ea04[_0x4ecc('0x30')]=_[_0x4ecc('0x33')](db[_0x4ecc('0x41')][_0x4ecc('0x2d')]);_0x21ea04[_0x4ecc('0x32')]=_[_0x4ecc('0x33')](_0x5ea1f0['query']);_0x21ea04[_0x4ecc('0x34')]=_[_0x4ecc('0x35')](_0x21ea04[_0x4ecc('0x30')],_0x21ea04[_0x4ecc('0x32')]);_0x394c6e[_0x4ecc('0x36')]=_['intersection'](_0x21ea04['model'],qs[_0x4ecc('0x48')](_0x5ea1f0[_0x4ecc('0x32')][_0x4ecc('0x48')]));_0x394c6e[_0x4ecc('0x36')]=_0x394c6e['attributes']['length']?_0x394c6e[_0x4ecc('0x36')]:_0x21ea04[_0x4ecc('0x30')];if(_0x5ea1f0[_0x4ecc('0x32')]['includeAll']){_0x394c6e[_0x4ecc('0x43')]=[{'all':!![]}];}_0x394c6e=_[_0x4ecc('0x3f')]({},_0x394c6e,_0x5ea1f0['options']);return db['SquareDetailsReport'][_0x4ecc('0x49')](_0x394c6e)['then'](handleEntityNotFound(_0x131324,null))['then'](respondWithResult(_0x131324,null))[_0x4ecc('0x46')](handleError(_0x131324,null));};exports['create']=function(_0x117457,_0x1bd9cc){return db[_0x4ecc('0x41')][_0x4ecc('0x4a')](_0x117457[_0x4ecc('0x4b')],{})[_0x4ecc('0x27')](respondWithResult(_0x1bd9cc,0xc9))[_0x4ecc('0x46')](handleError(_0x1bd9cc,null));};exports[_0x4ecc('0x26')]=function(_0x3ee67d,_0x5286e9){if(_0x3ee67d[_0x4ecc('0x4b')]['id']){delete _0x3ee67d[_0x4ecc('0x4b')]['id'];}return db[_0x4ecc('0x41')][_0x4ecc('0x49')]({'where':{'id':_0x3ee67d[_0x4ecc('0x47')]['id']}})['then'](handleEntityNotFound(_0x5286e9,null))[_0x4ecc('0x27')](saveUpdates(_0x3ee67d[_0x4ecc('0x4b')],null))['then'](respondWithResult(_0x5286e9,null))['catch'](handleError(_0x5286e9,null));};exports[_0x4ecc('0x4c')]=function(_0x433b71,_0x456b44){return db[_0x4ecc('0x41')][_0x4ecc('0x49')]({'where':{'id':_0x433b71[_0x4ecc('0x47')]['id']}})[_0x4ecc('0x27')](handleEntityNotFound(_0x456b44,null))[_0x4ecc('0x27')](removeEntity(_0x456b44,null))['catch'](handleError(_0x456b44,null));};exports['describe']=function(_0xdf5d12,_0x596fe8){return db[_0x4ecc('0x41')][_0x4ecc('0x4d')]()['then'](respondWithResult(_0x596fe8,null))[_0x4ecc('0x46')](handleError(_0x596fe8,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index cceed0e..0606156 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 _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 +var _0x0f11=['exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x0f11,0x100));var _0x10f1=function(_0x32e69e,_0x5d1c13){_0x32e69e=_0x32e69e-0x0;var _0x27dc49=_0x0f11[_0x32e69e];return _0x27dc49;};'use strict';var _=require(_0x10f1('0x0'));var util=require(_0x10f1('0x1'));var logger=require(_0x10f1('0x2'))(_0x10f1('0x3'));var moment=require(_0x10f1('0x4'));var BPromise=require(_0x10f1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x10f1('0x6'));var rimraf=require(_0x10f1('0x7'));var config=require(_0x10f1('0x8'));var attributes=require(_0x10f1('0x9'));module[_0x10f1('0xa')]=function(_0x363844,_0x40e658){return _0x363844[_0x10f1('0xb')](_0x10f1('0xc'),attributes,{'tableName':_0x10f1('0xd'),'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 5afba07..c2ac27a 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 _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 +var _0x1399=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareDetailsReport','create','options','raw','info','CreateSquareDetailsReport','debug'];(function(_0x5d809f,_0x8934f0){var _0x564557=function(_0x111f4b){while(--_0x111f4b){_0x5d809f['push'](_0x5d809f['shift']());}};_0x564557(++_0x8934f0);}(_0x1399,0x16c));var _0x9139=function(_0x2d72b7,_0x583095){_0x2d72b7=_0x2d72b7-0x0;var _0x9b5296=_0x1399[_0x2d72b7];return _0x9b5296;};'use strict';var _=require(_0x9139('0x0'));var util=require(_0x9139('0x1'));var moment=require('moment');var BPromise=require(_0x9139('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9139('0x3'));var db=require(_0x9139('0x4'))['db'];var utils=require(_0x9139('0x5'));var logger=require(_0x9139('0x6'))(_0x9139('0x7'));var config=require(_0x9139('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9139('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11d2ed,_0x4d5d1e,_0x51832d){return new BPromise(function(_0x11a03f,_0x59aec5){return client['request'](_0x11d2ed,_0x51832d)[_0x9139('0xa')](function(_0x385e2c){logger['info'](_0x9139('0xb'),_0x4d5d1e,_0x9139('0xc'));logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x4d5d1e,_0x9139('0xc'),JSON[_0x9139('0xd')](_0x385e2c));if(_0x385e2c[_0x9139('0xe')]){if(_0x385e2c[_0x9139('0xe')][_0x9139('0xf')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x4d5d1e,_0x385e2c['error'][_0x9139('0x10')]);return _0x59aec5(_0x385e2c['error'][_0x9139('0x10')]);}logger[_0x9139('0xe')](_0x9139('0xb'),_0x4d5d1e,_0x385e2c[_0x9139('0xe')]['message']);return _0x11a03f(_0x385e2c[_0x9139('0xe')]['message']);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x4d5d1e,_0x9139('0xc'));_0x11a03f(_0x385e2c[_0x9139('0x11')][_0x9139('0x10')]);}})[_0x9139('0x12')](function(_0x18801b){logger[_0x9139('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x4d5d1e,_0x18801b);_0x59aec5(_0x18801b);});});}exports['CreateSquareDetailsReport']=function(_0x13cab8){var _0xe39cbc=this;return new Promise(function(_0x5e0a59,_0x56b316){return db[_0x9139('0x13')][_0x9139('0x14')](_0x13cab8['body'],{'raw':_0x13cab8[_0x9139('0x15')]?_0x13cab8[_0x9139('0x15')][_0x9139('0x16')]===undefined?!![]:![]:!![]})[_0x9139('0xa')](function(_0xd2eb33){logger[_0x9139('0x17')](_0x9139('0x18'),_0x13cab8);logger[_0x9139('0x19')](_0x9139('0x18'),_0x13cab8,JSON[_0x9139('0xd')](_0xd2eb33));_0x5e0a59(_0xd2eb33);})[_0x9139('0x12')](function(_0x269f8a){logger[_0x9139('0xe')](_0x9139('0x18'),_0x269f8a[_0x9139('0x10')],_0x13cab8);_0x56b316(_0xe39cbc[_0x9139('0xe')](0x1f4,_0x269f8a[_0x9139('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 41ac22f..1d147cb 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 _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 +var _0xcadb=['/process/:pid/kill','killProcess','express','../../components/auth/service','isAuthenticated','index','get'];(function(_0x448f23,_0x62556f){var _0x545300=function(_0x24e4af){while(--_0x24e4af){_0x448f23['push'](_0x448f23['shift']());}};_0x545300(++_0x62556f);}(_0xcadb,0xdb));var _0xbcad=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xcadb[_0x50aa2e];return _0x5e07f0;};'use strict';var express=require(_0xbcad('0x0'));var router=express['Router']();var auth=require(_0xbcad('0x1'));var controller=require('./system.controller');router['get']('/',auth[_0xbcad('0x2')](),controller[_0xbcad('0x3')]);router[_0xbcad('0x4')](_0xbcad('0x5'),auth['isAuthenticated'](),controller[_0xbcad('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index c86957b..bad3a61 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 _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 +var _0xb685=['send','index','getAllData','then','json','killProcess','components/import/cm','format','pid','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0xb685,0x10d));var _0x5b68=function(_0x1b3d60,_0x51583b){_0x1b3d60=_0x1b3d60-0x0;var _0x4abc3d=_0xb685[_0x1b3d60];return _0x4abc3d;};'use strict';var info=require(_0x5b68('0x0'));var exec=require(_0x5b68('0x1'))['exec'];var logger=require(_0x5b68('0x2'))(_0x5b68('0x3'));var util=require(_0x5b68('0x4'));var BPromise=require(_0x5b68('0x5'));var _=require('lodash');function handleError(_0x3faffe,_0xf2f791,_0x129130){_0xf2f791=_0xf2f791||0x1f4;return function(_0x4653e5){logger[_0x5b68('0x6')](_0x5b68('0x7'),_0x129130,_0xf2f791,util[_0x5b68('0x8')](_0x4653e5,{'showHidden':![],'depth':null}));delete _0x4653e5[_0x5b68('0x9')];_0x3faffe[_0x5b68('0xa')](_0xf2f791)[_0x5b68('0xb')](_0x4653e5);};}exports[_0x5b68('0xc')]=function(_0x1079bf,_0x31ef5f){return info[_0x5b68('0xd')]()[_0x5b68('0xe')](function(_0x224705){return _0x31ef5f['status'](0xc8)[_0x5b68('0xf')](_0x224705);})['catch'](function(_0x39d283){return _0x31ef5f['status'](0x1f4)[_0x5b68('0xf')](_0x39d283);});};exports[_0x5b68('0x10')]=function(_0x20f87e,_0x300620){var _0x39f95b=[_0x5b68('0x11')];return new BPromise(function(_0x621885,_0x486f65){return exec(util[_0x5b68('0x12')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x20f87e['params'][_0x5b68('0x13')]),function(_0x4986f7,_0x8b567b,_0x360fd9){if(_0x4986f7){return _0x486f65(_0x4986f7);}return _0x621885(_0x8b567b);});})[_0x5b68('0xe')](function(_0x387080){var _0x23f68e=![];var _0x3d83cd=_0x387080[_0x5b68('0x14')](/\n/);for(var _0x5d34cc=0x0,_0x6fa9f2=_0x39f95b[_0x5b68('0x15')];_0x5d34cc<_0x6fa9f2,_0x23f68e===![];_0x5d34cc+=0x1){if(_0x387080['indexOf'](_0x39f95b[_0x5d34cc])>=0x0){_0x23f68e=!![];}}if(!_0x23f68e){throw new Error(util['format'](_0x5b68('0x16'),_0x20f87e[_0x5b68('0x17')]['pid']));}process[_0x5b68('0x18')](_0x20f87e[_0x5b68('0x17')]['pid'],_0x5b68('0x19'));return _0x300620['status'](0xc8)[_0x5b68('0xf')]({'message':util[_0x5b68('0x12')](_0x5b68('0x1a'),_0x20f87e['params'][_0x5b68('0x13')])});})[_0x5b68('0x1b')](handleError(_0x300620,null,_0x5b68('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 3e54d20..7e90c2b 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 _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 +var _0xb856=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','/:id','isAuthenticated','create','update','destroy','multer'];(function(_0x4c99c6,_0x25931a){var _0x2da1c3=function(_0x55ba7e){while(--_0x55ba7e){_0x4c99c6['push'](_0x4c99c6['shift']());}};_0x2da1c3(++_0x25931a);}(_0xb856,0xcf));var _0x6b85=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb856[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x6b85('0x0'));var util=require('util');var path=require(_0x6b85('0x1'));var timeout=require(_0x6b85('0x2'));var express=require(_0x6b85('0x3'));var router=express[_0x6b85('0x4')]();var fs_extra=require(_0x6b85('0x5'));var auth=require(_0x6b85('0x6'));var interaction=require(_0x6b85('0x7'));var config=require(_0x6b85('0x8'));var controller=require(_0x6b85('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6b85('0xa')](_0x6b85('0xb'),auth[_0x6b85('0xc')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x6b85('0xd')]);router['put']('/:id',auth[_0x6b85('0xc')](),controller[_0x6b85('0xe')]);router['delete'](_0x6b85('0xb'),auth[_0x6b85('0xc')](),controller[_0x6b85('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 02020ce..0417fb3 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 _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 +var _0x4ffe=['STRING','#0091EA','sequelize','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4ffe,0x172));var _0xe4ff=function(_0x193109,_0x50a9ca){_0x193109=_0x193109-0x0;var _0x4af109=_0x4ffe[_0x193109];return _0x4af109;};'use strict';var Sequelize=require(_0xe4ff('0x0'));module[_0xe4ff('0x1')]={'name':{'type':Sequelize[_0xe4ff('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xe4ff('0x2')],'defaultValue':_0xe4ff('0x3')},'description':{'type':Sequelize[_0xe4ff('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index a85e0a0..ba1f06b 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 _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 +var _0x049e=['map','rawAttributes','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','Tag','includeAll','include','rows','catch','show','params','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','reject','save','update','then','Tags','destroy','end','error','stack','name','send','index'];(function(_0x330141,_0x1dd290){var _0x1b68a2=function(_0x4e7f3c){while(--_0x4e7f3c){_0x330141['push'](_0x330141['shift']());}};_0x1b68a2(++_0x1dd290);}(_0x049e,0x16a));var _0xe049=function(_0x2d982d,_0x121028){_0x2d982d=_0x2d982d-0x0;var _0x4f36b0=_0x049e[_0x2d982d];return _0x4f36b0;};'use strict';var emlformat=require(_0xe049('0x0'));var rimraf=require(_0xe049('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe049('0x2'));var rp=require('request-promise');var moment=require(_0xe049('0x3'));var BPromise=require(_0xe049('0x4'));var Mustache=require(_0xe049('0x5'));var util=require(_0xe049('0x6'));var path=require(_0xe049('0x7'));var sox=require('sox');var csv=require(_0xe049('0x8'));var ejs=require(_0xe049('0x9'));var fs=require('fs');var fs_extra=require(_0xe049('0xa'));var _=require(_0xe049('0xb'));var squel=require(_0xe049('0xc'));var crypto=require(_0xe049('0xd'));var jsforce=require(_0xe049('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe049('0x8'));var querystring=require(_0xe049('0xf'));var Papa=require(_0xe049('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe049('0x11'));var as=require(_0xe049('0x12'));var hardwareService=require(_0xe049('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe049('0x14'));var licenseUtil=require(_0xe049('0x15'));var db=require(_0xe049('0x16'))['db'];function respondWithStatusCode(_0x359931,_0x301c7e){_0x301c7e=_0x301c7e||0xcc;return function(_0x1021e7){if(_0x1021e7){return _0x359931[_0xe049('0x17')](_0x301c7e);}return _0x359931[_0xe049('0x18')](_0x301c7e)['end']();};}function respondWithResult(_0x20c286,_0x3f4a57){_0x3f4a57=_0x3f4a57||0xc8;return function(_0x3924a4){if(_0x3924a4){return _0x20c286[_0xe049('0x18')](_0x3f4a57)['json'](_0x3924a4);}};}function respondWithFilteredResult(_0x3a539b,_0xcc35b6){return function(_0x5c90fd){if(_0x5c90fd){var _0x388be0=typeof _0xcc35b6[_0xe049('0x19')]==='undefined'&&typeof _0xcc35b6[_0xe049('0x1a')]===_0xe049('0x1b');var _0x5d435b=_0x5c90fd[_0xe049('0x1c')];var _0x54c303=_0x388be0?0x0:_0xcc35b6['offset'];var _0x3cbbeb=_0x388be0?_0x5c90fd['count']:_0xcc35b6['offset']+_0xcc35b6[_0xe049('0x1a')];var _0x1092ec;if(_0x3cbbeb>=_0x5d435b){_0x3cbbeb=_0x5d435b;_0x1092ec=0xc8;}else{_0x1092ec=0xce;}_0x3a539b['status'](_0x1092ec);return _0x3a539b['set'](_0xe049('0x1d'),_0x54c303+'-'+_0x3cbbeb+'/'+_0x5d435b)[_0xe049('0x1e')](_0x5c90fd);}return null;};}function patchUpdates(_0x1d2f5b){return function(_0x430421){try{jsonpatch['apply'](_0x430421,_0x1d2f5b,!![]);}catch(_0x572f29){return BPromise[_0xe049('0x1f')](_0x572f29);}return _0x430421[_0xe049('0x20')]();};}function saveUpdates(_0x572a80,_0x36a03b){return function(_0x3f14eb){if(_0x3f14eb){return _0x3f14eb[_0xe049('0x21')](_0x572a80)['then'](function(_0x197358){return _0x197358;});}return null;};}function removeEntity(_0x3b0f54,_0x4c7492){return function(_0x4848c9){if(_0x4848c9){return _0x4848c9['destroy']()[_0xe049('0x22')](function(){var _0x5954c0=_0x4848c9['get']({'plain':!![]});var _0x1aafd1=_0xe049('0x23');return db['UserProfileResource'][_0xe049('0x24')]({'where':{'type':_0x1aafd1,'resourceId':_0x5954c0['id']}})[_0xe049('0x22')](function(){return _0x4848c9;});})[_0xe049('0x22')](function(){_0x3b0f54[_0xe049('0x18')](0xcc)[_0xe049('0x25')]();});}};}function handleEntityNotFound(_0x1843b8,_0x5b0e64){return function(_0x50552d){if(!_0x50552d){_0x1843b8[_0xe049('0x17')](0x194);}return _0x50552d;};}function handleError(_0x542c7c,_0x38ff5b){_0x38ff5b=_0x38ff5b||0x1f4;return function(_0x495d33){logger[_0xe049('0x26')](_0x495d33[_0xe049('0x27')]);if(_0x495d33['name']){delete _0x495d33[_0xe049('0x28')];}_0x542c7c[_0xe049('0x18')](_0x38ff5b)[_0xe049('0x29')](_0x495d33);};}exports[_0xe049('0x2a')]=function(_0x4464b2,_0x4055fc){var _0x123d2e={},_0x44faff={},_0x4038f0={'count':0x0,'rows':[]};var _0x1a4b97=_[_0xe049('0x2b')](db['Tag'][_0xe049('0x2c')],function(_0x1e99c8){return{'name':_0x1e99c8['fieldName'],'type':_0x1e99c8['type']['key']};});_0x44faff['model']=_[_0xe049('0x2b')](_0x1a4b97,_0xe049('0x28'));_0x44faff[_0xe049('0x2d')]=_[_0xe049('0x2e')](_0x4464b2[_0xe049('0x2d')]);_0x44faff['filters']=_[_0xe049('0x2f')](_0x44faff[_0xe049('0x30')],_0x44faff[_0xe049('0x2d')]);_0x123d2e[_0xe049('0x31')]=_[_0xe049('0x2f')](_0x44faff['model'],qs[_0xe049('0x32')](_0x4464b2['query'][_0xe049('0x32')]));_0x123d2e['attributes']=_0x123d2e[_0xe049('0x31')][_0xe049('0x33')]?_0x123d2e[_0xe049('0x31')]:_0x44faff[_0xe049('0x30')];if(!_0x4464b2[_0xe049('0x2d')][_0xe049('0x34')](_0xe049('0x35'))){_0x123d2e[_0xe049('0x1a')]=qs[_0xe049('0x1a')](_0x4464b2[_0xe049('0x2d')][_0xe049('0x1a')]);_0x123d2e['offset']=qs[_0xe049('0x19')](_0x4464b2[_0xe049('0x2d')][_0xe049('0x19')]);}_0x123d2e[_0xe049('0x36')]=qs[_0xe049('0x37')](_0x4464b2[_0xe049('0x2d')][_0xe049('0x37')]);_0x123d2e[_0xe049('0x38')]=qs['filters'](_[_0xe049('0x39')](_0x4464b2[_0xe049('0x2d')],_0x44faff[_0xe049('0x3a')]),_0x1a4b97);if(_0x4464b2[_0xe049('0x2d')][_0xe049('0x3b')]){_0x123d2e[_0xe049('0x38')]=_[_0xe049('0x3c')](_0x123d2e[_0xe049('0x38')],{'$or':_[_0xe049('0x2b')](_0x1a4b97,function(_0x3d6a4b){if(_0x3d6a4b['type']!==_0xe049('0x3d')){var _0x176374={};_0x176374[_0x3d6a4b[_0xe049('0x28')]]={'$like':'%'+_0x4464b2['query'][_0xe049('0x3b')]+'%'};return _0x176374;}})});}_0x123d2e=_['merge']({},_0x123d2e,_0x4464b2['options']);var _0x19dbc4={'where':_0x123d2e['where']};return db[_0xe049('0x3e')][_0xe049('0x1c')](_0x19dbc4)[_0xe049('0x22')](function(_0xe4f184){_0x4038f0[_0xe049('0x1c')]=_0xe4f184;if(_0x4464b2['query'][_0xe049('0x3f')]){_0x123d2e[_0xe049('0x40')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x123d2e);})[_0xe049('0x22')](function(_0x20d264){_0x4038f0[_0xe049('0x41')]=_0x20d264;return _0x4038f0;})[_0xe049('0x22')](respondWithFilteredResult(_0x4055fc,_0x123d2e))[_0xe049('0x42')](handleError(_0x4055fc,null));};exports[_0xe049('0x43')]=function(_0x56a309,_0x1a4707){var _0x3f92ee={'raw':!![],'where':{'id':_0x56a309[_0xe049('0x44')]['id']}},_0x5c04f6={};_0x5c04f6[_0xe049('0x30')]=_[_0xe049('0x2e')](db[_0xe049('0x3e')][_0xe049('0x2c')]);_0x5c04f6['query']=_['keys'](_0x56a309[_0xe049('0x2d')]);_0x5c04f6[_0xe049('0x3a')]=_[_0xe049('0x2f')](_0x5c04f6[_0xe049('0x30')],_0x5c04f6[_0xe049('0x2d')]);_0x3f92ee[_0xe049('0x31')]=_['intersection'](_0x5c04f6[_0xe049('0x30')],qs[_0xe049('0x32')](_0x56a309['query'][_0xe049('0x32')]));_0x3f92ee['attributes']=_0x3f92ee[_0xe049('0x31')]['length']?_0x3f92ee[_0xe049('0x31')]:_0x5c04f6['model'];if(_0x56a309[_0xe049('0x2d')][_0xe049('0x3f')]){_0x3f92ee[_0xe049('0x40')]=[{'all':!![]}];}_0x3f92ee=_[_0xe049('0x3c')]({},_0x3f92ee,_0x56a309[_0xe049('0x45')]);return db['Tag'][_0xe049('0x46')](_0x3f92ee)[_0xe049('0x22')](handleEntityNotFound(_0x1a4707,null))[_0xe049('0x22')](respondWithResult(_0x1a4707,null))[_0xe049('0x42')](handleError(_0x1a4707,null));};exports[_0xe049('0x47')]=function(_0x3c15a2,_0x12f9b8){return db[_0xe049('0x3e')][_0xe049('0x47')](_0x3c15a2['body'],{})['then'](function(_0x478387){var _0xd1beaf=_0x3c15a2[_0xe049('0x48')][_0xe049('0x49')]({'plain':!![]});if(!_0xd1beaf)throw new Error(_0xe049('0x4a'));if(_0xd1beaf[_0xe049('0x4b')]===_0xe049('0x48')){var _0x2e4dce=_0x478387[_0xe049('0x49')]({'plain':!![]});var _0x23da27=_0xe049('0x23');return db['UserProfileSection'][_0xe049('0x46')]({'where':{'name':_0x23da27,'userProfileId':_0xd1beaf[_0xe049('0x4c')]},'raw':!![]})[_0xe049('0x22')](function(_0x4710ae){if(_0x4710ae&&_0x4710ae[_0xe049('0x4d')]===0x0){return db[_0xe049('0x4e')][_0xe049('0x47')]({'name':_0x2e4dce['name'],'resourceId':_0x2e4dce['id'],'type':_0x4710ae['name'],'sectionId':_0x4710ae['id']},{})['then'](function(){return _0x478387;});}else{return _0x478387;}})[_0xe049('0x42')](function(_0x2e508e){logger['error'](_0xe049('0x4f'),_0x2e508e);throw _0x2e508e;});}return _0x478387;})[_0xe049('0x22')](respondWithResult(_0x12f9b8,0xc9))[_0xe049('0x42')](handleError(_0x12f9b8,null));};exports[_0xe049('0x21')]=function(_0x4c3ba3,_0x5b0155){if(_0x4c3ba3[_0xe049('0x50')]['id']){delete _0x4c3ba3[_0xe049('0x50')]['id'];}return db['Tag']['find']({'where':{'id':_0x4c3ba3[_0xe049('0x44')]['id']}})['then'](handleEntityNotFound(_0x5b0155,null))[_0xe049('0x22')](saveUpdates(_0x4c3ba3[_0xe049('0x50')],null))['then'](respondWithResult(_0x5b0155,null))[_0xe049('0x42')](handleError(_0x5b0155,null));};exports['destroy']=function(_0x356605,_0x3ec963){return db['Tag'][_0xe049('0x46')]({'where':{'id':_0x356605[_0xe049('0x44')]['id']}})[_0xe049('0x22')](handleEntityNotFound(_0x3ec963,null))[_0xe049('0x22')](removeEntity(_0x3ec963,null))[_0xe049('0x42')](handleError(_0x3ec963,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 64fdee5..3e5a352 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 _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 +var _0xa490=['request-promise','rimraf','../../config/environment','./tag.attributes','exports','define','tools_tags','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa490,0x11b));var _0x0a49=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa490[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0a49('0x0'));var util=require(_0x0a49('0x1'));var logger=require(_0x0a49('0x2'))(_0x0a49('0x3'));var moment=require(_0x0a49('0x4'));var BPromise=require('bluebird');var rp=require(_0x0a49('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a49('0x6'));var config=require(_0x0a49('0x7'));var attributes=require(_0x0a49('0x8'));module[_0x0a49('0x9')]=function(_0x515bd0,_0xd3340e){return _0x515bd0[_0x0a49('0xa')]('Tag',attributes,{'tableName':_0x0a49('0xb'),'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 17228dd..b868863 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 _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 +var _0x84ab=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','Tag,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1c17e3,_0x5995b9){var _0x54a18b=function(_0x201d78){while(--_0x201d78){_0x1c17e3['push'](_0x1c17e3['shift']());}};_0x54a18b(++_0x5995b9);}(_0x84ab,0x12f));var _0xb84a=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x84ab[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var moment=require(_0xb84a('0x2'));var BPromise=require(_0xb84a('0x3'));var rs=require(_0xb84a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb84a('0x5'))['db'];var utils=require(_0xb84a('0x6'));var logger=require('../../config/logger')(_0xb84a('0x7'));var config=require(_0xb84a('0x8'));var jayson=require(_0xb84a('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc496,_0xd445b5,_0x4fac4d){return new BPromise(function(_0x3e9086,_0x8d9dbe){return client['request'](_0x4dc496,_0x4fac4d)[_0xb84a('0xa')](function(_0x525cb7){logger[_0xb84a('0xb')](_0xb84a('0xc'),_0xd445b5,_0xb84a('0xd'));logger['debug']('Tag,\x20%s,\x20%s,\x20%s',_0xd445b5,'request\x20sent',JSON[_0xb84a('0xe')](_0x525cb7));if(_0x525cb7[_0xb84a('0xf')]){if(_0x525cb7[_0xb84a('0xf')][_0xb84a('0x10')]===0x1f4){logger[_0xb84a('0xf')]('Tag,\x20%s,\x20%s',_0xd445b5,_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);return _0x8d9dbe(_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);}logger[_0xb84a('0xf')](_0xb84a('0xc'),_0xd445b5,_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);return _0x3e9086(_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);}else{logger[_0xb84a('0xb')](_0xb84a('0xc'),_0xd445b5,'request\x20sent');_0x3e9086(_0x525cb7[_0xb84a('0x12')][_0xb84a('0x11')]);}})[_0xb84a('0x13')](function(_0x3c0b54){logger[_0xb84a('0xf')](_0xb84a('0xc'),_0xd445b5,_0x3c0b54);_0x8d9dbe(_0x3c0b54);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index f1163f3..50e18f6 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(_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 +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(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 f25f63f..113fee3 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['name','exports','STRING'];(function(_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 +var _0x757a=['exports','STRING'];(function(_0x13b110,_0xaed0f2){var _0xd52387=function(_0x204138){while(--_0x204138){_0x13b110['push'](_0x13b110['shift']());}};_0xd52387(++_0xaed0f2);}(_0x757a,0xde));var _0xa757=function(_0x123ec9,_0x21a322){_0x123ec9=_0x123ec9-0x0;var _0x4a3146=_0x757a[_0x123ec9];return _0x4a3146;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index dfb3ed2..73e876a 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 _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 +var _0xbb73=['../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./team.socket','sendStatus','end','status','undefined','limit','count','offset','set','json','apply','reject','save','update','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','Team','findAll','catch','show','params','keys','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','autoAssociation','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','UserVoiceQueue','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','destroy','SELECT','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','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','UserProfileResource','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','addQueues','add','Queues','removeQueues','remove','ids','addAgents','Voice','Chat','Sms','Fax','Whatsapp','transaction','through','defaults','penalty','Queue','findOrCreate','emit','Queue:save','User','online','voicePause','UserVoiceQueueRt','isNil','interface','format','SIP/%s','TeamVoiceQueue','all','UserVoicePrefix','upsert','spread','removeAgents','isArray','Mail','Openchannel','getAgents','nolimit','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x4cd14a,_0x3c08b4){var _0x59ac6a=function(_0x5d95ec){while(--_0x5d95ec){_0x4cd14a['push'](_0x4cd14a['shift']());}};_0x59ac6a(++_0x3c08b4);}(_0xbb73,0x1b8));var _0x3bb7=function(_0x5aac5d,_0x17ec74){_0x5aac5d=_0x5aac5d-0x0;var _0xc8395=_0xbb73[_0x5aac5d];return _0xc8395;};'use strict';var emlformat=require(_0x3bb7('0x0'));var rimraf=require(_0x3bb7('0x1'));var zipdir=require(_0x3bb7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3bb7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3bb7('0x4'));var util=require('util');var path=require(_0x3bb7('0x5'));var sox=require(_0x3bb7('0x6'));var csv=require(_0x3bb7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3bb7('0x8'));var _=require(_0x3bb7('0x9'));var squel=require(_0x3bb7('0xa'));var crypto=require(_0x3bb7('0xb'));var jsforce=require(_0x3bb7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3bb7('0x7'));var querystring=require(_0x3bb7('0xd'));var Papa=require(_0x3bb7('0xe'));var Redis=require(_0x3bb7('0xf'));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(_0x3bb7('0x10'))('api');var utils=require(_0x3bb7('0x11'));var config=require(_0x3bb7('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x3bb7('0x13')]=_['defaults'](config[_0x3bb7('0x13')],{'host':_0x3bb7('0x14'),'port':0x18eb});var socket=require(_0x3bb7('0x15'))(new Redis(config[_0x3bb7('0x13')]));require(_0x3bb7('0x16'))['register'](socket);function respondWithStatusCode(_0x4a04db,_0x352638){_0x352638=_0x352638||0xcc;return function(_0x25bb2a){if(_0x25bb2a){return _0x4a04db[_0x3bb7('0x17')](_0x352638);}return _0x4a04db['status'](_0x352638)[_0x3bb7('0x18')]();};}function respondWithResult(_0x3db494,_0x5b7016){_0x5b7016=_0x5b7016||0xc8;return function(_0xe54fb9){if(_0xe54fb9){return _0x3db494[_0x3bb7('0x19')](_0x5b7016)['json'](_0xe54fb9);}};}function respondWithFilteredResult(_0x564855,_0x844240){return function(_0x117281){if(_0x117281){var _0x5a9df0=typeof _0x844240['offset']===_0x3bb7('0x1a')&&typeof _0x844240[_0x3bb7('0x1b')]===_0x3bb7('0x1a');var _0x22f4bf=_0x117281[_0x3bb7('0x1c')];var _0x227605=_0x5a9df0?0x0:_0x844240[_0x3bb7('0x1d')];var _0x13c3d0=_0x5a9df0?_0x117281['count']:_0x844240[_0x3bb7('0x1d')]+_0x844240['limit'];var _0x1504e5;if(_0x13c3d0>=_0x22f4bf){_0x13c3d0=_0x22f4bf;_0x1504e5=0xc8;}else{_0x1504e5=0xce;}_0x564855[_0x3bb7('0x19')](_0x1504e5);return _0x564855[_0x3bb7('0x1e')]('Content-Range',_0x227605+'-'+_0x13c3d0+'/'+_0x22f4bf)[_0x3bb7('0x1f')](_0x117281);}return null;};}function patchUpdates(_0x599a7a){return function(_0x25f2f5){try{jsonpatch[_0x3bb7('0x20')](_0x25f2f5,_0x599a7a,!![]);}catch(_0x502460){return BPromise[_0x3bb7('0x21')](_0x502460);}return _0x25f2f5[_0x3bb7('0x22')]();};}function saveUpdates(_0x5d2eab,_0xdc1804){return function(_0x300ee6){if(_0x300ee6){return _0x300ee6[_0x3bb7('0x23')](_0x5d2eab)[_0x3bb7('0x24')](function(_0x30bf30){return _0x30bf30;});}return null;};}function handleEntityNotFound(_0xedbdff,_0x224bd6){return function(_0x44ecb4){if(!_0x44ecb4){_0xedbdff['sendStatus'](0x194);}return _0x44ecb4;};}function handleError(_0x25d312,_0x21f285){_0x21f285=_0x21f285||0x1f4;return function(_0xb06d70){logger[_0x3bb7('0x25')](_0xb06d70[_0x3bb7('0x26')]);if(_0xb06d70[_0x3bb7('0x27')]){delete _0xb06d70[_0x3bb7('0x27')];}_0x25d312[_0x3bb7('0x19')](_0x21f285)[_0x3bb7('0x28')](_0xb06d70);};}exports['index']=function(_0xda1a4d,_0x143a8d){var _0x179945={},_0x380465={},_0x304da6={'count':0x0,'rows':[]};var _0x142d84=_['map'](db['Team'][_0x3bb7('0x29')],function(_0x40882d){return{'name':_0x40882d[_0x3bb7('0x2a')],'type':_0x40882d[_0x3bb7('0x2b')][_0x3bb7('0x2c')]};});_0x380465[_0x3bb7('0x2d')]=_[_0x3bb7('0x2e')](_0x142d84,_0x3bb7('0x27'));_0x380465[_0x3bb7('0x2f')]=_['keys'](_0xda1a4d['query']);_0x380465[_0x3bb7('0x30')]=_['intersection'](_0x380465[_0x3bb7('0x2d')],_0x380465['query']);_0x179945[_0x3bb7('0x31')]=_[_0x3bb7('0x32')](_0x380465[_0x3bb7('0x2d')],qs[_0x3bb7('0x33')](_0xda1a4d[_0x3bb7('0x2f')][_0x3bb7('0x33')]));_0x179945['attributes']=_0x179945[_0x3bb7('0x31')]['length']?_0x179945[_0x3bb7('0x31')]:_0x380465[_0x3bb7('0x2d')];if(!_0xda1a4d[_0x3bb7('0x2f')][_0x3bb7('0x34')]('nolimit')){_0x179945['limit']=qs[_0x3bb7('0x1b')](_0xda1a4d[_0x3bb7('0x2f')]['limit']);_0x179945[_0x3bb7('0x1d')]=qs[_0x3bb7('0x1d')](_0xda1a4d['query']['offset']);}_0x179945[_0x3bb7('0x35')]=qs['sort'](_0xda1a4d[_0x3bb7('0x2f')][_0x3bb7('0x36')]);_0x179945[_0x3bb7('0x37')]=qs[_0x3bb7('0x30')](_[_0x3bb7('0x38')](_0xda1a4d[_0x3bb7('0x2f')],_0x380465[_0x3bb7('0x30')]),_0x142d84);if(_0xda1a4d[_0x3bb7('0x2f')][_0x3bb7('0x39')]){_0x179945['where']=_[_0x3bb7('0x3a')](_0x179945[_0x3bb7('0x37')],{'$or':_['map'](_0x142d84,function(_0x5d863c){if(_0x5d863c['type']!==_0x3bb7('0x3b')){var _0x1a3383={};_0x1a3383[_0x5d863c[_0x3bb7('0x27')]]={'$like':'%'+_0xda1a4d[_0x3bb7('0x2f')]['filter']+'%'};return _0x1a3383;}})});}_0x179945=_['merge']({},_0x179945,_0xda1a4d[_0x3bb7('0x3c')]);var _0x520f41={'where':_0x179945[_0x3bb7('0x37')]};return db['Team']['count'](_0x520f41)['then'](function(_0x2f0495){_0x304da6['count']=_0x2f0495;if(_0xda1a4d['query'][_0x3bb7('0x3d')]){_0x179945['include']=[{'all':!![]}];}return db[_0x3bb7('0x3e')][_0x3bb7('0x3f')](_0x179945);})[_0x3bb7('0x24')](function(_0x57a499){_0x304da6['rows']=_0x57a499;return _0x304da6;})[_0x3bb7('0x24')](respondWithFilteredResult(_0x143a8d,_0x179945))[_0x3bb7('0x40')](handleError(_0x143a8d,null));};exports[_0x3bb7('0x41')]=function(_0x2155d9,_0x54d222){var _0x4a94ad={'raw':![],'where':{'id':_0x2155d9[_0x3bb7('0x42')]['id']}},_0x3f8f8b={};_0x3f8f8b[_0x3bb7('0x2d')]=_['keys'](db[_0x3bb7('0x3e')][_0x3bb7('0x29')]);_0x3f8f8b[_0x3bb7('0x2f')]=_[_0x3bb7('0x43')](_0x2155d9[_0x3bb7('0x2f')]);_0x3f8f8b[_0x3bb7('0x30')]=_[_0x3bb7('0x32')](_0x3f8f8b[_0x3bb7('0x2d')],_0x3f8f8b[_0x3bb7('0x2f')]);_0x4a94ad['attributes']=_[_0x3bb7('0x32')](_0x3f8f8b[_0x3bb7('0x2d')],qs['fields'](_0x2155d9[_0x3bb7('0x2f')][_0x3bb7('0x33')]));_0x4a94ad[_0x3bb7('0x31')]=_0x4a94ad[_0x3bb7('0x31')][_0x3bb7('0x44')]?_0x4a94ad[_0x3bb7('0x31')]:_0x3f8f8b['model'];if(_0x2155d9[_0x3bb7('0x2f')][_0x3bb7('0x3d')]){_0x4a94ad['include']=[{'all':!![]}];}_0x4a94ad=_[_0x3bb7('0x3a')]({},_0x4a94ad,_0x2155d9[_0x3bb7('0x3c')]);return db[_0x3bb7('0x3e')][_0x3bb7('0x45')](_0x4a94ad)[_0x3bb7('0x24')](handleEntityNotFound(_0x54d222,null))[_0x3bb7('0x24')](respondWithResult(_0x54d222,null))[_0x3bb7('0x40')](handleError(_0x54d222,null));};exports[_0x3bb7('0x46')]=function(_0x3ea931,_0x249ef9){return db[_0x3bb7('0x3e')][_0x3bb7('0x46')](_0x3ea931[_0x3bb7('0x47')],{})[_0x3bb7('0x24')](function(_0xb39978){var _0x23f7d2=_0x3ea931[_0x3bb7('0x48')][_0x3bb7('0x49')]({'plain':!![]});if(!_0x23f7d2)throw new Error(_0x3bb7('0x4a'));if(_0x23f7d2['role']===_0x3bb7('0x48')){var _0x5ea97f=_0xb39978[_0x3bb7('0x49')]({'plain':!![]});var _0x38b2f9=_0x3bb7('0x4b');return db[_0x3bb7('0x4c')][_0x3bb7('0x45')]({'where':{'name':_0x38b2f9,'userProfileId':_0x23f7d2['userProfileId']},'raw':!![]})[_0x3bb7('0x24')](function(_0x34746f){if(_0x34746f&&_0x34746f[_0x3bb7('0x4d')]===0x0){return db['UserProfileResource'][_0x3bb7('0x46')]({'name':_0x5ea97f[_0x3bb7('0x27')],'resourceId':_0x5ea97f['id'],'type':_0x34746f[_0x3bb7('0x27')],'sectionId':_0x34746f['id']},{})[_0x3bb7('0x24')](function(){return _0xb39978;});}else{return _0xb39978;}})[_0x3bb7('0x40')](function(_0x294499){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x294499);throw _0x294499;});}return _0xb39978;})[_0x3bb7('0x24')](respondWithResult(_0x249ef9,0xc9))[_0x3bb7('0x40')](handleError(_0x249ef9,null));};exports[_0x3bb7('0x23')]=function(_0x38685d,_0x493808){if(_0x38685d['body']['id']){delete _0x38685d[_0x3bb7('0x47')]['id'];}return db[_0x3bb7('0x3e')][_0x3bb7('0x45')]({'where':{'id':_0x38685d[_0x3bb7('0x42')]['id']}})['then'](handleEntityNotFound(_0x493808,null))['then'](saveUpdates(_0x38685d[_0x3bb7('0x47')],null))[_0x3bb7('0x24')](respondWithResult(_0x493808,null))[_0x3bb7('0x40')](handleError(_0x493808,null));};exports['destroy']=function(_0x49d0b7,_0x13884a){var _0x4f310c=_0x49d0b7[_0x3bb7('0x42')]['id'];var _0x1573d6=[];return db[_0x3bb7('0x4e')]['transaction'](function(_0x4b34de){var _0x2d178d=_0x3bb7('0x4f')+_0x4f310c;return db['sequelize'][_0x3bb7('0x2f')](_0x2d178d,{'type':db[_0x3bb7('0x50')][_0x3bb7('0x51')]['SELECT'],'raw':!![],'transaction':_0x4b34de})[_0x3bb7('0x24')](function(_0x12e65c){_0x1573d6=_[_0x3bb7('0x2e')](_0x12e65c,function(_0x18f8b0){return Number(_0x18f8b0[_0x3bb7('0x52')]);});})[_0x3bb7('0x24')](function(){var _0x5db2b7=_0x3bb7('0x53')+_0x4f310c;return db[_0x3bb7('0x4e')][_0x3bb7('0x2f')](_0x5db2b7,{'type':db[_0x3bb7('0x50')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x4b34de});})[_0x3bb7('0x24')](function(_0x81f704){var _0xd199ab=_[_0x3bb7('0x2e')](_0x81f704,function(_0x1a13e3){return Number(_0x1a13e3['VoiceQueueId']);});return db[_0x3bb7('0x54')]['destroy']({'where':{'UserId':{'$in':_0x1573d6},'VoiceQueueId':{'$in':_0xd199ab}},'transaction':_0x4b34de});})[_0x3bb7('0x24')](function(){var _0x34fcc2='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4f310c;return db[_0x3bb7('0x4e')][_0x3bb7('0x2f')](_0x34fcc2,{'type':db[_0x3bb7('0x50')][_0x3bb7('0x51')]['SELECT'],'raw':!![],'transaction':_0x4b34de});})[_0x3bb7('0x24')](function(_0x2defa9){var _0xbae0a7=_[_0x3bb7('0x2e')](_0x2defa9,function(_0x40cc76){return Number(_0x40cc76[_0x3bb7('0x55')]);});return db[_0x3bb7('0x56')]['destroy']({'where':{'UserId':{'$in':_0x1573d6},'MailQueueId':{'$in':_0xbae0a7}},'transaction':_0x4b34de});})[_0x3bb7('0x24')](function(){var _0x15533b=_0x3bb7('0x57')+_0x4f310c;return db[_0x3bb7('0x4e')][_0x3bb7('0x2f')](_0x15533b,{'type':db[_0x3bb7('0x50')][_0x3bb7('0x51')]['SELECT'],'raw':!![],'transaction':_0x4b34de});})[_0x3bb7('0x24')](function(_0x1c5e76){var _0x4ba362=_[_0x3bb7('0x2e')](_0x1c5e76,function(_0x7164d2){return Number(_0x7164d2[_0x3bb7('0x58')]);});return db[_0x3bb7('0x59')][_0x3bb7('0x5a')]({'where':{'UserId':{'$in':_0x1573d6},'SmsQueueId':{'$in':_0x4ba362}},'transaction':_0x4b34de});})['then'](function(){var _0x2c6e0d='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4f310c;return db[_0x3bb7('0x4e')][_0x3bb7('0x2f')](_0x2c6e0d,{'type':db[_0x3bb7('0x50')][_0x3bb7('0x51')][_0x3bb7('0x5b')],'raw':!![],'transaction':_0x4b34de});})['then'](function(_0x4c3140){var _0x88334e=_[_0x3bb7('0x2e')](_0x4c3140,function(_0xcf3eb8){return Number(_0xcf3eb8[_0x3bb7('0x5c')]);});return db[_0x3bb7('0x5d')][_0x3bb7('0x5a')]({'where':{'UserId':{'$in':_0x1573d6},'ChatQueueId':{'$in':_0x88334e}},'transaction':_0x4b34de});})['then'](function(){var _0x40b7e0=_0x3bb7('0x5e')+_0x4f310c;return db[_0x3bb7('0x4e')]['query'](_0x40b7e0,{'type':db[_0x3bb7('0x50')][_0x3bb7('0x51')][_0x3bb7('0x5b')],'raw':!![],'transaction':_0x4b34de});})[_0x3bb7('0x24')](function(_0xb8b5a6){var _0x434e8b=_['map'](_0xb8b5a6,function(_0x4d4784){return Number(_0x4d4784[_0x3bb7('0x5f')]);});return db[_0x3bb7('0x60')][_0x3bb7('0x5a')]({'where':{'UserId':{'$in':_0x1573d6},'FaxQueueId':{'$in':_0x434e8b}},'transaction':_0x4b34de});})['then'](function(){var _0x4689c9=_0x3bb7('0x61')+_0x4f310c;return db[_0x3bb7('0x4e')][_0x3bb7('0x2f')](_0x4689c9,{'type':db[_0x3bb7('0x50')][_0x3bb7('0x51')][_0x3bb7('0x5b')],'raw':!![],'transaction':_0x4b34de});})[_0x3bb7('0x24')](function(_0x320908){var _0x22ec97=_[_0x3bb7('0x2e')](_0x320908,function(_0xb78bde){return Number(_0xb78bde[_0x3bb7('0x62')]);});return db[_0x3bb7('0x63')][_0x3bb7('0x5a')]({'where':{'UserId':{'$in':_0x1573d6},'OpenchannelQueueId':{'$in':_0x22ec97}},'transaction':_0x4b34de});})[_0x3bb7('0x24')](function(){var _0x32e83d=_0x3bb7('0x64')+_0x4f310c;return db[_0x3bb7('0x4e')][_0x3bb7('0x2f')](_0x32e83d,{'type':db[_0x3bb7('0x50')][_0x3bb7('0x51')][_0x3bb7('0x5b')],'raw':!![],'transaction':_0x4b34de});})['then'](function(_0x5761c5){var _0x4f57d4=_[_0x3bb7('0x2e')](_0x5761c5,function(_0x24f9ac){return Number(_0x24f9ac['WhatsappQueueId']);});return db[_0x3bb7('0x65')][_0x3bb7('0x5a')]({'where':{'UserId':{'$in':_0x1573d6},'WhatsappQueueId':{'$in':_0x4f57d4}},'transaction':_0x4b34de});})[_0x3bb7('0x24')](function(){return db[_0x3bb7('0x66')][_0x3bb7('0x45')]({'where':{'TeamId':_0x4f310c}});})[_0x3bb7('0x24')](function(_0x4f13c5){if(_0x4f13c5===null){return;}return db['UserVoicePrefix'][_0x3bb7('0x5a')]({'where':{'UserId':{'$in':_0x1573d6},'VoicePrefixId':_0x4f13c5[_0x3bb7('0x67')]},'transaction':_0x4b34de});})['then'](function(){return db['Team']['destroy']({'where':{'id':_0x4f310c},'cascade':!![],'transaction':_0x4b34de});})[_0x3bb7('0x24')](function(_0x5dfe2a){if(_0x5dfe2a===0x0){_0x13884a['sendStatus'](0x194);}else{return db[_0x3bb7('0x68')][_0x3bb7('0x5a')]({'where':{'type':_0x3bb7('0x4b'),'resourceId':_0x4f310c},'cascade':!![],'transaction':_0x4b34de})[_0x3bb7('0x24')](function(){_0x13884a[_0x3bb7('0x19')](0xcc)[_0x3bb7('0x18')]();});}})[_0x3bb7('0x40')](function(_0x1d5985){_0x13884a[_0x3bb7('0x19')](0x1f4)[_0x3bb7('0x28')](_0x1d5985);});});};exports[_0x3bb7('0x69')]=function(_0x577bf5,_0x1b4f52,_0x545b47){return db[_0x3bb7('0x3e')][_0x3bb7('0x6a')]({'where':{'id':_0x577bf5['params']['id']}})[_0x3bb7('0x24')](handleEntityNotFound(_0x1b4f52,null))[_0x3bb7('0x24')](function(_0x13649d){if(!_0x577bf5[_0x3bb7('0x2f')][_0x3bb7('0x6b')]||!utils[_0x3bb7('0x6c')](_0x577bf5[_0x3bb7('0x2f')][_0x3bb7('0x6b')])){throw new db[(_0x3bb7('0x50'))][(_0x3bb7('0x6d'))](_0x3bb7('0x6e'));}var _0x173c97={};var _0x422265={};_0x422265[_0x3bb7('0x2d')]=_[_0x3bb7('0x43')](db[_[_0x3bb7('0x6f')](_0x577bf5[_0x3bb7('0x2f')][_0x3bb7('0x6b')][_0x3bb7('0x70')]())+'Queue'][_0x3bb7('0x29')]);_0x422265[_0x3bb7('0x2f')]=_['keys'](_0x577bf5[_0x3bb7('0x2f')]);_0x422265[_0x3bb7('0x30')]=_[_0x3bb7('0x32')](_0x422265[_0x3bb7('0x2d')],_0x422265[_0x3bb7('0x2f')]);_0x173c97[_0x3bb7('0x31')]=_[_0x3bb7('0x32')](_0x422265['model'],qs[_0x3bb7('0x33')](_0x577bf5[_0x3bb7('0x2f')][_0x3bb7('0x33')]));_0x173c97[_0x3bb7('0x31')]=_0x173c97['attributes'][_0x3bb7('0x44')]?_0x173c97[_0x3bb7('0x31')]:_0x422265[_0x3bb7('0x2d')];_0x173c97[_0x3bb7('0x1b')]=qs[_0x3bb7('0x1b')](_0x577bf5['query'][_0x3bb7('0x1b')]);_0x173c97[_0x3bb7('0x1d')]=qs['offset'](_0x577bf5['query'][_0x3bb7('0x1d')]);_0x173c97['order']=qs[_0x3bb7('0x36')](_0x577bf5[_0x3bb7('0x2f')][_0x3bb7('0x36')]);_0x173c97['where']=qs[_0x3bb7('0x30')](_[_0x3bb7('0x38')](_0x577bf5['query'],_0x422265[_0x3bb7('0x30')]));_0x173c97=_[_0x3bb7('0x3a')]({},_0x173c97,_0x577bf5['options']);return _0x13649d[_0x3bb7('0x49')+_[_0x3bb7('0x6f')](_0x577bf5[_0x3bb7('0x2f')]['channel']['toLowerCase']())+'Queues'](_0x173c97);})[_0x3bb7('0x24')](respondWithResult(_0x1b4f52,null))[_0x3bb7('0x40')](handleError(_0x1b4f52,null));};exports[_0x3bb7('0x71')]=function(_0x36c7f2,_0x25534a,_0x48f0f9){return db[_0x3bb7('0x3e')][_0x3bb7('0x6a')]({'where':{'id':_0x36c7f2[_0x3bb7('0x42')]['id']}})[_0x3bb7('0x24')](function(_0x1e819f){if(_0x1e819f){if(!_0x36c7f2[_0x3bb7('0x47')]['channel']||!utils[_0x3bb7('0x6c')](_0x36c7f2['body'][_0x3bb7('0x6b')])){throw new db['Sequelize'][(_0x3bb7('0x6d'))](_0x3bb7('0x6e'));}return _0x1e819f[_0x3bb7('0x72')+_[_0x3bb7('0x6f')](_0x36c7f2['body'][_0x3bb7('0x6b')][_0x3bb7('0x70')]())+_0x3bb7('0x73')](_0x36c7f2[_0x3bb7('0x47')]['ids']);}return null;})[_0x3bb7('0x24')](handleEntityNotFound(_0x25534a,null))[_0x3bb7('0x24')](respondWithStatusCode(_0x25534a,null))[_0x3bb7('0x40')](handleError(_0x25534a,null));};exports[_0x3bb7('0x74')]=function(_0x1f3849,_0x1de62e,_0x1787ce){return db[_0x3bb7('0x3e')]['findOne']({'where':{'id':_0x1f3849[_0x3bb7('0x42')]['id']}})[_0x3bb7('0x24')](function(_0x31cf60){if(_0x31cf60){if(!_0x1f3849[_0x3bb7('0x2f')][_0x3bb7('0x6b')]||!utils['isValidChannel'](_0x1f3849[_0x3bb7('0x2f')]['channel'])){throw new db['Sequelize'][(_0x3bb7('0x6d'))]('Unknown\x20channel');}return _0x31cf60[_0x3bb7('0x75')+_[_0x3bb7('0x6f')](_0x1f3849[_0x3bb7('0x2f')][_0x3bb7('0x6b')][_0x3bb7('0x70')]())+'Queues'](_0x1f3849[_0x3bb7('0x2f')][_0x3bb7('0x76')]);}return null;})[_0x3bb7('0x24')](handleEntityNotFound(_0x1de62e,null))[_0x3bb7('0x24')](respondWithStatusCode(_0x1de62e,null))[_0x3bb7('0x40')](handleError(_0x1de62e,null));};exports[_0x3bb7('0x77')]=function(_0x225c59,_0x33707c){var _0x297fd5=_['isArray'](_0x225c59['body'][_0x3bb7('0x76')])?_0x225c59[_0x3bb7('0x47')][_0x3bb7('0x76')]:[_0x225c59[_0x3bb7('0x47')][_0x3bb7('0x76')]];var _0x4bac47=_0x225c59['params']['id'];return db[_0x3bb7('0x3e')][_0x3bb7('0x45')]({'where':{'id':_0x4bac47}})[_0x3bb7('0x24')](handleEntityNotFound(_0x33707c,null))['then'](function(_0x3358d8){if(_0x3358d8){var _0x359bf5=[_0x3bb7('0x78'),_0x3bb7('0x79'),'Mail',_0x3bb7('0x7a'),_0x3bb7('0x7b'),'Openchannel',_0x3bb7('0x7c')];return db['sequelize'][_0x3bb7('0x7d')](function(_0x47fb81){var _0xce3bca=_['map'](_0x359bf5,function(_0x9ed5fe){var _0x58133a={'attributes':['id',_0x3bb7('0x27')]};if(_0x9ed5fe===_0x3bb7('0x78')){_0x58133a[_0x3bb7('0x7e')]={'attributes':['penalty']};}return _0x3358d8[_0x3bb7('0x49')+_0x9ed5fe+'Queues'](_0x58133a)[_0x3bb7('0x24')](function(_0x5afc6e){var _0x4b6bed=_[_0x3bb7('0x2e')](_0x5afc6e,function(_0x3538fc){var _0x106f4e=_[_0x3bb7('0x2e')](_0x297fd5,function(_0x5e6d8d){var _0x1ac1b8={'where':{'UserId':_0x5e6d8d,[_0x9ed5fe+'QueueId']:_0x3538fc['id']},'transaction':_0x47fb81};if(_0x9ed5fe===_0x3bb7('0x78')){_0x1ac1b8[_0x3bb7('0x7f')]={'penalty':_0x3538fc['TeamVoiceQueue'][_0x3bb7('0x80')]};}return db['User'+_0x9ed5fe+_0x3bb7('0x81')][_0x3bb7('0x82')](_0x1ac1b8)['then'](function(){socket[_0x3bb7('0x83')](_0x3bb7('0x48')+_0x9ed5fe+_0x3bb7('0x84'),{'UserId':_0x5e6d8d,[_0x9ed5fe+'QueueId']:_0x3538fc['id']});if(_0x9ed5fe!==_0x3bb7('0x78')){return;}return db[_0x3bb7('0x85')][_0x3bb7('0x3f')]({'where':{'id':_0x297fd5,'online':0x1},'attributes':['id',_0x3bb7('0x27'),_0x3bb7('0x86'),_0x3bb7('0x87'),'interface'],'raw':!![]})[_0x3bb7('0x24')](function(_0xe6b93){var _0x49af88=_[_0x3bb7('0x2e')](_0xe6b93,function(_0x51787b){return db[_0x3bb7('0x88')]['upsert']({'membername':_0x51787b[_0x3bb7('0x27')],'UserId':_0x51787b['id'],'queue_name':_0x3538fc['name'],'VoiceQueueId':_0x3538fc['id'],'interface':_[_0x3bb7('0x89')](_0x51787b[_0x3bb7('0x8a')])?util[_0x3bb7('0x8b')](_0x3bb7('0x8c'),_0x51787b[_0x3bb7('0x27')]):_0x51787b[_0x3bb7('0x8a')],'paused':_0x51787b[_0x3bb7('0x87')]||![],'penalty':_0x3538fc[_0x3bb7('0x8d')][_0x3bb7('0x80')]},{'transaction':_0x47fb81});});return Promise[_0x3bb7('0x8e')](_0x49af88);});});});return Promise['all'](_0x106f4e);});return Promise[_0x3bb7('0x8e')](_0x4b6bed);})[_0x3bb7('0x24')](function(){return db[_0x3bb7('0x66')]['findOne']({'where':{'teamId':_0x4bac47}})[_0x3bb7('0x24')](function(_0x5a3e8f){if(_0x5a3e8f){var _0x2c1d81=_[_0x3bb7('0x2e')](_0x297fd5,function(_0x16a274){db[_0x3bb7('0x8f')][_0x3bb7('0x90')]({'UserId':_0x16a274,'VoicePrefixId':_0x5a3e8f[_0x3bb7('0x67')]});});return Promise[_0x3bb7('0x8e')](_0x2c1d81);}});});});return Promise[_0x3bb7('0x8e')](_0xce3bca)['then'](function(){return _0x3358d8[_0x3bb7('0x77')](_0x297fd5,{'transaction':_0x47fb81})[_0x3bb7('0x91')](function(_0x7e9410){return _0x7e9410;});});});}})[_0x3bb7('0x24')](respondWithResult(_0x33707c,null))[_0x3bb7('0x40')](handleError(_0x33707c,null));};exports[_0x3bb7('0x92')]=function(_0x64c42e,_0x3dc4f2){var _0x1b1214=_[_0x3bb7('0x93')](_0x64c42e[_0x3bb7('0x2f')][_0x3bb7('0x76')])?_0x64c42e[_0x3bb7('0x2f')][_0x3bb7('0x76')]:[_0x64c42e[_0x3bb7('0x2f')][_0x3bb7('0x76')]];var _0x1eb5ff=_0x64c42e['params']['id'];return db[_0x3bb7('0x3e')][_0x3bb7('0x45')]({'where':{'id':_0x1eb5ff}})[_0x3bb7('0x24')](handleEntityNotFound(_0x3dc4f2,null))[_0x3bb7('0x24')](function(_0x36f3f5){if(_0x36f3f5){var _0x3ec57b=[_0x3bb7('0x78'),_0x3bb7('0x79'),_0x3bb7('0x94'),_0x3bb7('0x7a'),_0x3bb7('0x7b'),_0x3bb7('0x95'),_0x3bb7('0x7c')];return db['sequelize'][_0x3bb7('0x7d')](function(_0x3c6091){var _0x3a78c6=_['map'](_0x3ec57b,function(_0x30a153){var _0x50ad2f={'attributes':['id',_0x3bb7('0x27')]};return _0x36f3f5[_0x3bb7('0x49')+_0x30a153+'Queues'](_0x50ad2f)['then'](function(_0x40acc1){var _0x53e4d6=_[_0x3bb7('0x2e')](_0x40acc1,function(_0xf90679){return _0xf90679[_0x3bb7('0x92')](_0x1b1214,{'transaction':_0x3c6091})[_0x3bb7('0x24')](function(){var _0x3252cd=_[_0x3bb7('0x2e')](_0x1b1214,function(_0x158f1b){socket[_0x3bb7('0x83')]('user'+_0x30a153+'Queue:remove',{'UserId':Number(_0x158f1b),[_0x30a153+'QueueId']:_0xf90679['id']});if(_0x30a153!=='Voice'){return;}return db[_0x3bb7('0x88')]['destroy']({'where':{'VoiceQueueId':_0xf90679['id'],'UserId':_0x158f1b},'transaction':_0x3c6091});});return Promise[_0x3bb7('0x8e')](_0x3252cd);});});return Promise['all'](_0x53e4d6);});});return Promise[_0x3bb7('0x8e')](_0x3a78c6)[_0x3bb7('0x24')](function(){return _0x36f3f5[_0x3bb7('0x92')](_0x1b1214,{'transaction':_0x3c6091});})[_0x3bb7('0x24')](function(){return db[_0x3bb7('0x66')]['findOne']({'where':{'teamId':_0x1eb5ff}})['then'](function(_0xbfa611){if(_0xbfa611){var _0x3f92b8=_['map'](_0x1b1214,function(_0x1d9311){db[_0x3bb7('0x8f')][_0x3bb7('0x5a')]({'where':{'UserId':_0x1d9311,'VoicePrefixId':_0xbfa611[_0x3bb7('0x67')]}});});return Promise[_0x3bb7('0x8e')](_0x3f92b8);}});});});}})[_0x3bb7('0x24')](respondWithStatusCode(_0x3dc4f2,null))[_0x3bb7('0x40')](handleError(_0x3dc4f2,null));};exports[_0x3bb7('0x96')]=function(_0x2846cf,_0x9800f5,_0x35839d){var _0x347de8={};var _0x46d073={};var _0x2f39ba;var _0x483bee;return db['Team']['findOne']({'where':{'id':_0x2846cf['params']['id']}})[_0x3bb7('0x24')](handleEntityNotFound(_0x9800f5,null))[_0x3bb7('0x24')](function(_0x38ef33){if(_0x38ef33){_0x2f39ba=_0x38ef33;_0x46d073[_0x3bb7('0x2d')]=_[_0x3bb7('0x43')](db[_0x3bb7('0x85')]['rawAttributes']);_0x46d073['query']=_[_0x3bb7('0x43')](_0x2846cf[_0x3bb7('0x2f')]);_0x46d073[_0x3bb7('0x30')]=_[_0x3bb7('0x32')](_0x46d073[_0x3bb7('0x2d')],_0x46d073['query']);_0x347de8[_0x3bb7('0x31')]=_[_0x3bb7('0x32')](_0x46d073['model'],qs[_0x3bb7('0x33')](_0x2846cf[_0x3bb7('0x2f')][_0x3bb7('0x33')]));_0x347de8[_0x3bb7('0x31')]=_0x347de8[_0x3bb7('0x31')]['length']?_0x347de8[_0x3bb7('0x31')]:_0x46d073[_0x3bb7('0x2d')];_0x347de8[_0x3bb7('0x35')]=qs[_0x3bb7('0x36')](_0x2846cf[_0x3bb7('0x2f')][_0x3bb7('0x36')]);_0x347de8[_0x3bb7('0x37')]=qs['filters'](_[_0x3bb7('0x38')](_0x2846cf[_0x3bb7('0x2f')],_0x46d073['filters']));if(_0x2846cf[_0x3bb7('0x2f')]['filter']){_0x347de8[_0x3bb7('0x37')]=_['merge'](_0x347de8['where'],{'$or':_[_0x3bb7('0x2e')](_0x347de8[_0x3bb7('0x31')],function(_0x3bec29){var _0x3509d1={};_0x3509d1[_0x3bec29]={'$like':'%'+_0x2846cf[_0x3bb7('0x2f')][_0x3bb7('0x39')]+'%'};return _0x3509d1;})});}_0x347de8=_['merge']({},_0x347de8,_0x2846cf[_0x3bb7('0x3c')]);return _0x2f39ba[_0x3bb7('0x96')](_0x347de8);}})['then'](function(_0x1e3fcb){if(_0x1e3fcb){_0x483bee=_0x1e3fcb[_0x3bb7('0x44')];if(!_0x2846cf['query']['hasOwnProperty'](_0x3bb7('0x97'))){_0x347de8[_0x3bb7('0x1b')]=qs[_0x3bb7('0x1b')](_0x2846cf[_0x3bb7('0x2f')][_0x3bb7('0x1b')]);_0x347de8[_0x3bb7('0x1d')]=qs[_0x3bb7('0x1d')](_0x2846cf['query'][_0x3bb7('0x1d')]);}return _0x2f39ba['getAgents'](_0x347de8);}})[_0x3bb7('0x24')](function(_0x992d16){if(_0x992d16){return _0x992d16?{'count':_0x483bee,'rows':_0x992d16}:null;}})[_0x3bb7('0x24')](respondWithResult(_0x9800f5,null))[_0x3bb7('0x40')](handleError(_0x9800f5,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index a469047..59e3542 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 _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 +var _0x4e88=['../../mysqldb','Team','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x401d67,_0xeb1592){var _0x25076b=function(_0x233577){while(--_0x233577){_0x401d67['push'](_0x401d67['shift']());}};_0x25076b(++_0xeb1592);}(_0x4e88,0x1cb));var _0x84e8=function(_0x206024,_0xca71f2){_0x206024=_0x206024-0x0;var _0x125ff7=_0x4e88[_0x206024];return _0x125ff7;};'use strict';var EventEmitter=require(_0x84e8('0x0'));var Team=require(_0x84e8('0x1'))['db'][_0x84e8('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x84e8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x84e8('0x4'),'afterDestroy':_0x84e8('0x5')};function emitEvent(_0x38705f){return function(_0x20d2cf,_0x3278f3,_0x39e7a7){TeamEvents[_0x84e8('0x6')](_0x38705f+':'+_0x20d2cf['id'],_0x20d2cf);TeamEvents[_0x84e8('0x6')](_0x38705f,_0x20d2cf);_0x39e7a7(null);};}for(var e in events){if(events[_0x84e8('0x7')](e)){var event=events[e];Team[_0x84e8('0x8')](e,emitEvent(event));}}module[_0x84e8('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 39b0df9..a7eae24 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 _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 +var _0x5ca7=['setDataValue','channel','catch','exports','define','Team','teams','Chat','Fax','Mail','Openchannel','Sms','Voice','Whatsapp','lodash','./team.attributes','Queues','then','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ca7,0xdf));var _0x75ca=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x5ca7[_0x33032e];return _0x13316b;};'use strict';var _=require(_0x75ca('0x0'));var attributes=require(_0x75ca('0x1'));function getQueuesByChannel(_0x4f3988,_0x5e7382){var _0x5b5607='get'+_0x5e7382+_0x75ca('0x2');return _0x4f3988[_0x5b5607]()[_0x75ca('0x3')](function(_0x2dc660){return _[_0x75ca('0x4')](_0x2dc660,function(_0xdde36e){_0xdde36e[_0x75ca('0x5')](_0x75ca('0x6'),_0x5e7382);return _0xdde36e;});})[_0x75ca('0x7')](function(_0x1b21a6){throw _0x1b21a6;});}module[_0x75ca('0x8')]=function(_0x47f612){return _0x47f612[_0x75ca('0x9')](_0x75ca('0xa'),attributes,{'tableName':_0x75ca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x5dc29c=this;var _0x146afb=[_0x75ca('0xc'),_0x75ca('0xd'),_0x75ca('0xe'),_0x75ca('0xf'),_0x75ca('0x10'),_0x75ca('0x11'),_0x75ca('0x12')];return Promise['resolve']()['then'](function(){var _0x17256a=_['map'](_0x146afb,function(_0x163e9f){return getQueuesByChannel(_0x5dc29c,_0x163e9f);});return Promise['all'](_0x17256a);})[_0x75ca('0x7')](function(_0x7c2f6b){throw _0x7c2f6b;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 3edf171..bcc0a35 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 _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 +var _0x73da=['then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','code','error','message','Team,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','request'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x73da,0x142));var _0xa73d=function(_0xb4fe2c,_0x3d2be6){_0xb4fe2c=_0xb4fe2c-0x0;var _0x460a1a=_0x73da[_0xb4fe2c];return _0x460a1a;};'use strict';var _=require(_0xa73d('0x0'));var util=require(_0xa73d('0x1'));var moment=require(_0xa73d('0x2'));var BPromise=require(_0xa73d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa73d('0x4'));var db=require(_0xa73d('0x5'))['db'];var utils=require(_0xa73d('0x6'));var logger=require(_0xa73d('0x7'))(_0xa73d('0x8'));var config=require(_0xa73d('0x9'));var jayson=require(_0xa73d('0xa'));var client=jayson[_0xa73d('0xb')][_0xa73d('0xc')]({'port':0x232a});config[_0xa73d('0xd')]=_[_0xa73d('0xe')](config[_0xa73d('0xd')],{'host':_0xa73d('0xf'),'port':0x18eb});var socket=require(_0xa73d('0x10'))(new Redis(config['redis']));require(_0xa73d('0x11'))['register'](socket);function respondWithRpcPromise(_0x28870e,_0x120f58,_0x4dbdc1){return new BPromise(function(_0x50cd44,_0x37b461){return client[_0xa73d('0x12')](_0x28870e,_0x4dbdc1)[_0xa73d('0x13')](function(_0x35e0c9){logger[_0xa73d('0x14')]('Team,\x20%s,\x20%s',_0x120f58,_0xa73d('0x15'));logger[_0xa73d('0x16')](_0xa73d('0x17'),_0x120f58,_0xa73d('0x15'),JSON[_0xa73d('0x18')](_0x35e0c9));if(_0x35e0c9['error']){if(_0x35e0c9['error'][_0xa73d('0x19')]===0x1f4){logger[_0xa73d('0x1a')]('Team,\x20%s,\x20%s',_0x120f58,_0x35e0c9[_0xa73d('0x1a')][_0xa73d('0x1b')]);return _0x37b461(_0x35e0c9[_0xa73d('0x1a')][_0xa73d('0x1b')]);}logger[_0xa73d('0x1a')](_0xa73d('0x1c'),_0x120f58,_0x35e0c9[_0xa73d('0x1a')][_0xa73d('0x1b')]);return _0x50cd44(_0x35e0c9[_0xa73d('0x1a')][_0xa73d('0x1b')]);}else{logger[_0xa73d('0x14')](_0xa73d('0x1c'),_0x120f58,_0xa73d('0x15'));_0x50cd44(_0x35e0c9[_0xa73d('0x1d')]['message']);}})[_0xa73d('0x1e')](function(_0xe6a4a3){logger[_0xa73d('0x1a')]('Team,\x20%s,\x20%s',_0x120f58,_0xe6a4a3);_0x37b461(_0xe6a4a3);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index c2af166..d1ddc56 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 _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 +var _0xa846=['update','emit','register','length','./team.events','save','remove'];(function(_0x4f4c11,_0xdb6add){var _0x4dfd33=function(_0x163cfe){while(--_0x163cfe){_0x4f4c11['push'](_0x4f4c11['shift']());}};_0x4dfd33(++_0xdb6add);}(_0xa846,0x12a));var _0x6a84=function(_0x4f3dee,_0x46bb90){_0x4f3dee=_0x4f3dee-0x0;var _0x291aad=_0xa846[_0x4f3dee];return _0x291aad;};'use strict';var TeamEvents=require(_0x6a84('0x0'));var events=[_0x6a84('0x1'),_0x6a84('0x2'),_0x6a84('0x3')];function createListener(_0x2a2bcf,_0x27c2d){return function(_0x1760ed){_0x27c2d[_0x6a84('0x4')](_0x2a2bcf,_0x1760ed);};}function removeListener(_0x2522ac,_0x2fea99){return function(){TeamEvents['removeListener'](_0x2522ac,_0x2fea99);};}exports[_0x6a84('0x5')]=function(_0x150d82){for(var _0x4c87f7=0x0,_0x1ca80d=events[_0x6a84('0x6')];_0x4c87f7<_0x1ca80d;_0x4c87f7++){var _0x360827=events[_0x4c87f7];var _0xe79de7=createListener('team:'+_0x360827,_0x150d82);TeamEvents['on'](_0x360827,_0xe79de7);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 5d587dc..6a12f5b 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 _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 +var _0xd5d3=['exports','INTEGER','sequelize'];(function(_0x41993e,_0x4ad3ab){var _0x60093e=function(_0x3edf11){while(--_0x3edf11){_0x41993e['push'](_0x41993e['shift']());}};_0x60093e(++_0x4ad3ab);}(_0xd5d3,0x113));var _0x3d5d=function(_0x15d8a5,_0x83652d){_0x15d8a5=_0x15d8a5-0x0;var _0x13fad4=_0xd5d3[_0x15d8a5];return _0x13fad4;};'use strict';var Sequelize=require(_0x3d5d('0x0'));module[_0x3d5d('0x1')]={'TeamId':{'type':Sequelize[_0x3d5d('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 6f68d01..a390add 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 _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 +var _0xe6d7=['util','api','moment','bluebird','request-promise','rimraf','exports','define','TeamVoicePrefix','team_has_voice_prefixes'];(function(_0x2ee0d6,_0x2562ff){var _0x299d21=function(_0x16cb6c){while(--_0x16cb6c){_0x2ee0d6['push'](_0x2ee0d6['shift']());}};_0x299d21(++_0x2562ff);}(_0xe6d7,0x1ae));var _0x7e6d=function(_0x3d93c6,_0x5b9eaa){_0x3d93c6=_0x3d93c6-0x0;var _0x4c31a6=_0xe6d7[_0x3d93c6];return _0x4c31a6;};'use strict';var _=require('lodash');var util=require(_0x7e6d('0x0'));var logger=require('../../config/logger')(_0x7e6d('0x1'));var moment=require(_0x7e6d('0x2'));var BPromise=require(_0x7e6d('0x3'));var rp=require(_0x7e6d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e6d('0x5'));var config=require('../../config/environment');var attributes=require('./teamVoicePrefix.attributes');module[_0x7e6d('0x6')]=function(_0x23c09e,_0x4faafe){return _0x23c09e[_0x7e6d('0x7')](_0x7e6d('0x8'),attributes,{'tableName':_0x7e6d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 749f462..4aebd67 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_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 +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2710b5,_0x215b7e){var _0x77c06f=function(_0x47c049){while(--_0x47c049){_0x2710b5['push'](_0x2710b5['shift']());}};_0x77c06f(++_0x215b7e);}(_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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 40c3687..e6a6d83 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 _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 +var _0xe1e5=['sequelize','exports','INTEGER'];(function(_0x3e309e,_0x475d41){var _0x2f216f=function(_0x10b2e7){while(--_0x10b2e7){_0x3e309e['push'](_0x3e309e['shift']());}};_0x2f216f(++_0x475d41);}(_0xe1e5,0x156));var _0x5e1e=function(_0x19be52,_0x417078){_0x19be52=_0x19be52-0x0;var _0x42dfd2=_0xe1e5[_0x19be52];return _0x42dfd2;};'use strict';var Sequelize=require(_0x5e1e('0x0'));module[_0x5e1e('0x1')]={'penalty':{'type':Sequelize[_0x5e1e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index ab8253d..6f7f12f 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 _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 +var _0xf4d9=['./teamVoiceQueue.attributes','define','team_has_voice_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x368fc7,_0x405940){var _0x5b0f86=function(_0x49c32c){while(--_0x49c32c){_0x368fc7['push'](_0x368fc7['shift']());}};_0x5b0f86(++_0x405940);}(_0xf4d9,0x7c));var _0x9f4d=function(_0x547b24,_0x420bae){_0x547b24=_0x547b24-0x0;var _0x42f7ee=_0xf4d9[_0x547b24];return _0x42f7ee;};'use strict';var _=require(_0x9f4d('0x0'));var util=require('util');var logger=require(_0x9f4d('0x1'))(_0x9f4d('0x2'));var moment=require(_0x9f4d('0x3'));var BPromise=require(_0x9f4d('0x4'));var rp=require(_0x9f4d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f4d('0x6'));var config=require(_0x9f4d('0x7'));var attributes=require(_0x9f4d('0x8'));module['exports']=function(_0x191f1c,_0x370059){return _0x191f1c[_0x9f4d('0x9')]('TeamVoiceQueue',attributes,{'tableName':_0x9f4d('0xa'),'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 22b20ed..c7dcef5 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 _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 +var _0x9c64=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xe30e17,_0xce02be){var _0x2342c9=function(_0x20b733){while(--_0x20b733){_0xe30e17['push'](_0xe30e17['shift']());}};_0x2342c9(++_0xce02be);}(_0x9c64,0x16a));var _0x49c6=function(_0xa45fa6,_0x340406){_0xa45fa6=_0xa45fa6-0x0;var _0x5b2164=_0x9c64[_0xa45fa6];return _0x5b2164;};'use strict';var _=require('lodash');var util=require(_0x49c6('0x0'));var moment=require(_0x49c6('0x1'));var BPromise=require(_0x49c6('0x2'));var rs=require(_0x49c6('0x3'));var fs=require('fs');var Redis=require(_0x49c6('0x4'));var db=require(_0x49c6('0x5'))['db'];var utils=require(_0x49c6('0x6'));var logger=require(_0x49c6('0x7'))(_0x49c6('0x8'));var config=require(_0x49c6('0x9'));var jayson=require(_0x49c6('0xa'));var client=jayson[_0x49c6('0xb')][_0x49c6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x194b7f,_0x5e65ed,_0x5b648e){return new BPromise(function(_0x31acfe,_0x129d8a){return client[_0x49c6('0xd')](_0x194b7f,_0x5b648e)[_0x49c6('0xe')](function(_0xc23520){logger[_0x49c6('0xf')](_0x49c6('0x10'),_0x5e65ed,'request\x20sent');logger[_0x49c6('0x11')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x5e65ed,_0x49c6('0x12'),JSON[_0x49c6('0x13')](_0xc23520));if(_0xc23520[_0x49c6('0x14')]){if(_0xc23520[_0x49c6('0x14')][_0x49c6('0x15')]===0x1f4){logger[_0x49c6('0x14')](_0x49c6('0x10'),_0x5e65ed,_0xc23520[_0x49c6('0x14')][_0x49c6('0x16')]);return _0x129d8a(_0xc23520[_0x49c6('0x14')]['message']);}logger[_0x49c6('0x14')](_0x49c6('0x10'),_0x5e65ed,_0xc23520[_0x49c6('0x14')][_0x49c6('0x16')]);return _0x31acfe(_0xc23520[_0x49c6('0x14')][_0x49c6('0x16')]);}else{logger[_0x49c6('0xf')](_0x49c6('0x10'),_0x5e65ed,_0x49c6('0x12'));_0x31acfe(_0xc23520['result'][_0x49c6('0x16')]);}})['catch'](function(_0x2bafcd){logger[_0x49c6('0x14')](_0x49c6('0x10'),_0x5e65ed,_0x2bafcd);_0x129d8a(_0x2bafcd);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 9dc36e8..0c0ee80 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 _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 +var _0x531a=['get','index','/:id','isAuthenticated','show','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x77ab7f,_0x28e841){var _0x510d3c=function(_0x2e3ab8){while(--_0x2e3ab8){_0x77ab7f['push'](_0x77ab7f['shift']());}};_0x510d3c(++_0x28e841);}(_0x531a,0x100));var _0xa531=function(_0x32ce20,_0x315ba9){_0x32ce20=_0x32ce20-0x0;var _0x41a705=_0x531a[_0x32ce20];return _0x41a705;};'use strict';var multer=require(_0xa531('0x0'));var util=require(_0xa531('0x1'));var path=require(_0xa531('0x2'));var timeout=require(_0xa531('0x3'));var express=require(_0xa531('0x4'));var router=express[_0xa531('0x5')]();var fs_extra=require(_0xa531('0x6'));var auth=require(_0xa531('0x7'));var interaction=require(_0xa531('0x8'));var config=require(_0xa531('0x9'));var controller=require('./template.controller');router[_0xa531('0xa')]('/',auth['isAuthenticated'](),controller[_0xa531('0xb')]);router[_0xa531('0xa')](_0xa531('0xc'),auth[_0xa531('0xd')](),controller[_0xa531('0xe')]);router['post']('/',auth[_0xa531('0xd')](),controller[_0xa531('0xf')]);router['put'](_0xa531('0xc'),auth[_0xa531('0xd')](),controller[_0xa531('0x10')]);router[_0xa531('0x11')](_0xa531('0xc'),auth['isAuthenticated'](),controller[_0xa531('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 18653ba..b1c0d7b 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 _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 +var _0x47e6=['STRING','TEXT','sequelize'];(function(_0x29da39,_0x4e393a){var _0x348c06=function(_0x2b0451){while(--_0x2b0451){_0x29da39['push'](_0x29da39['shift']());}};_0x348c06(++_0x4e393a);}(_0x47e6,0x164));var _0x647e=function(_0x25a61b,_0x3cef39){_0x25a61b=_0x25a61b-0x0;var _0x468b4d=_0x47e6[_0x25a61b];return _0x468b4d;};'use strict';var Sequelize=require(_0x647e('0x0'));module['exports']={'name':{'type':Sequelize[_0x647e('0x1')]},'description':{'type':Sequelize[_0x647e('0x1')]},'html':{'type':Sequelize[_0x647e('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index af8bae6..a25ba51 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 _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 +var _0xa2a0=['jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','status','save','then','destroy','get','error','name','send','index','map','Template','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Templates','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto'];(function(_0x5ef55a,_0x2a03b1){var _0x20ae40=function(_0x46ce81){while(--_0x46ce81){_0x5ef55a['push'](_0x5ef55a['shift']());}};_0x20ae40(++_0x2a03b1);}(_0xa2a0,0x8c));var _0x0a2a=function(_0x656d83,_0x5b4630){_0x656d83=_0x656d83-0x0;var _0x100db8=_0xa2a0[_0x656d83];return _0x100db8;};'use strict';var emlformat=require(_0x0a2a('0x0'));var rimraf=require(_0x0a2a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0a2a('0x2'));var rp=require(_0x0a2a('0x3'));var moment=require(_0x0a2a('0x4'));var BPromise=require(_0x0a2a('0x5'));var Mustache=require(_0x0a2a('0x6'));var util=require(_0x0a2a('0x7'));var path=require(_0x0a2a('0x8'));var sox=require(_0x0a2a('0x9'));var csv=require('to-csv');var ejs=require(_0x0a2a('0xa'));var fs=require('fs');var fs_extra=require(_0x0a2a('0xb'));var _=require(_0x0a2a('0xc'));var squel=require('squel');var crypto=require(_0x0a2a('0xd'));var jsforce=require(_0x0a2a('0xe'));var deskjs=require(_0x0a2a('0xf'));var toCsv=require(_0x0a2a('0x10'));var querystring=require('querystring');var Papa=require(_0x0a2a('0x11'));var Redis=require(_0x0a2a('0x12'));var authService=require(_0x0a2a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a2a('0x14'));var logger=require(_0x0a2a('0x15'))('api');var utils=require(_0x0a2a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0a2a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x441abc,_0x55cbc7){_0x55cbc7=_0x55cbc7||0xcc;return function(_0xcd224e){if(_0xcd224e){return _0x441abc[_0x0a2a('0x18')](_0x55cbc7);}return _0x441abc['status'](_0x55cbc7)[_0x0a2a('0x19')]();};}function respondWithResult(_0x5983ff,_0x3cc01e){_0x3cc01e=_0x3cc01e||0xc8;return function(_0x120639){if(_0x120639){return _0x5983ff['status'](_0x3cc01e)[_0x0a2a('0x1a')](_0x120639);}};}function respondWithFilteredResult(_0x4e8b80,_0x4f0ad3){return function(_0x26797a){if(_0x26797a){var _0x47265c=typeof _0x4f0ad3[_0x0a2a('0x1b')]==='undefined'&&typeof _0x4f0ad3[_0x0a2a('0x1c')]===_0x0a2a('0x1d');var _0x439df9=_0x26797a[_0x0a2a('0x1e')];var _0x52a3e7=_0x47265c?0x0:_0x4f0ad3[_0x0a2a('0x1b')];var _0x15c2ba=_0x47265c?_0x26797a[_0x0a2a('0x1e')]:_0x4f0ad3[_0x0a2a('0x1b')]+_0x4f0ad3[_0x0a2a('0x1c')];var _0x314e5c;if(_0x15c2ba>=_0x439df9){_0x15c2ba=_0x439df9;_0x314e5c=0xc8;}else{_0x314e5c=0xce;}_0x4e8b80[_0x0a2a('0x1f')](_0x314e5c);return _0x4e8b80['set']('Content-Range',_0x52a3e7+'-'+_0x15c2ba+'/'+_0x439df9)[_0x0a2a('0x1a')](_0x26797a);}return null;};}function patchUpdates(_0x27cb53){return function(_0x4121d4){try{jsonpatch['apply'](_0x4121d4,_0x27cb53,!![]);}catch(_0x5dd2fc){return BPromise['reject'](_0x5dd2fc);}return _0x4121d4[_0x0a2a('0x20')]();};}function saveUpdates(_0x458631,_0x191e7c){return function(_0x26379d){if(_0x26379d){return _0x26379d['update'](_0x458631)[_0x0a2a('0x21')](function(_0xf7d116){return _0xf7d116;});}return null;};}function removeEntity(_0x4062de,_0x5db71e){return function(_0x564210){if(_0x564210){return _0x564210[_0x0a2a('0x22')]()[_0x0a2a('0x21')](function(){var _0x373f1f=_0x564210[_0x0a2a('0x23')]({'plain':!![]});var _0x3a41ba='Templates';return db['UserProfileResource'][_0x0a2a('0x22')]({'where':{'type':_0x3a41ba,'resourceId':_0x373f1f['id']}})[_0x0a2a('0x21')](function(){return _0x564210;});})['then'](function(){_0x4062de[_0x0a2a('0x1f')](0xcc)[_0x0a2a('0x19')]();});}};}function handleEntityNotFound(_0x24cb8b,_0x739ea4){return function(_0x45fa45){if(!_0x45fa45){_0x24cb8b['sendStatus'](0x194);}return _0x45fa45;};}function handleError(_0x101d1d,_0x3ff6d7){_0x3ff6d7=_0x3ff6d7||0x1f4;return function(_0x5ee859){logger[_0x0a2a('0x24')](_0x5ee859['stack']);if(_0x5ee859[_0x0a2a('0x25')]){delete _0x5ee859[_0x0a2a('0x25')];}_0x101d1d[_0x0a2a('0x1f')](_0x3ff6d7)[_0x0a2a('0x26')](_0x5ee859);};}exports[_0x0a2a('0x27')]=function(_0x17b6df,_0x527d90){var _0x15482d={},_0x5a5a04={},_0x4e8882={'count':0x0,'rows':[]};var _0x1e8083=_[_0x0a2a('0x28')](db[_0x0a2a('0x29')][_0x0a2a('0x2a')],function(_0x25d106){return{'name':_0x25d106['fieldName'],'type':_0x25d106['type'][_0x0a2a('0x2b')]};});_0x5a5a04[_0x0a2a('0x2c')]=_[_0x0a2a('0x28')](_0x1e8083,'name');_0x5a5a04[_0x0a2a('0x2d')]=_[_0x0a2a('0x2e')](_0x17b6df[_0x0a2a('0x2d')]);_0x5a5a04[_0x0a2a('0x2f')]=_[_0x0a2a('0x30')](_0x5a5a04['model'],_0x5a5a04[_0x0a2a('0x2d')]);_0x15482d[_0x0a2a('0x31')]=_[_0x0a2a('0x30')](_0x5a5a04[_0x0a2a('0x2c')],qs[_0x0a2a('0x32')](_0x17b6df[_0x0a2a('0x2d')]['fields']));_0x15482d[_0x0a2a('0x31')]=_0x15482d['attributes']['length']?_0x15482d[_0x0a2a('0x31')]:_0x5a5a04[_0x0a2a('0x2c')];if(!_0x17b6df[_0x0a2a('0x2d')][_0x0a2a('0x33')]('nolimit')){_0x15482d[_0x0a2a('0x1c')]=qs[_0x0a2a('0x1c')](_0x17b6df[_0x0a2a('0x2d')][_0x0a2a('0x1c')]);_0x15482d[_0x0a2a('0x1b')]=qs['offset'](_0x17b6df[_0x0a2a('0x2d')]['offset']);}_0x15482d[_0x0a2a('0x34')]=qs[_0x0a2a('0x35')](_0x17b6df[_0x0a2a('0x2d')]['sort']);_0x15482d[_0x0a2a('0x36')]=qs[_0x0a2a('0x2f')](_[_0x0a2a('0x37')](_0x17b6df['query'],_0x5a5a04[_0x0a2a('0x2f')]),_0x1e8083);if(_0x17b6df[_0x0a2a('0x2d')][_0x0a2a('0x38')]){_0x15482d[_0x0a2a('0x36')]=_[_0x0a2a('0x39')](_0x15482d[_0x0a2a('0x36')],{'$or':_['map'](_0x1e8083,function(_0x3eeeb0){if(_0x3eeeb0[_0x0a2a('0x3a')]!==_0x0a2a('0x3b')){var _0x12242c={};_0x12242c[_0x3eeeb0[_0x0a2a('0x25')]]={'$like':'%'+_0x17b6df[_0x0a2a('0x2d')][_0x0a2a('0x38')]+'%'};return _0x12242c;}})});}_0x15482d=_['merge']({},_0x15482d,_0x17b6df[_0x0a2a('0x3c')]);var _0x413e23={'where':_0x15482d['where']};return db[_0x0a2a('0x29')][_0x0a2a('0x1e')](_0x413e23)[_0x0a2a('0x21')](function(_0xdda72c){_0x4e8882[_0x0a2a('0x1e')]=_0xdda72c;if(_0x17b6df['query'][_0x0a2a('0x3d')]){_0x15482d['include']=[{'all':!![]}];}return db['Template'][_0x0a2a('0x3e')](_0x15482d);})['then'](function(_0x5771c0){_0x4e8882[_0x0a2a('0x3f')]=_0x5771c0;return _0x4e8882;})[_0x0a2a('0x21')](respondWithFilteredResult(_0x527d90,_0x15482d))[_0x0a2a('0x40')](handleError(_0x527d90,null));};exports['show']=function(_0x10cfed,_0x3df4b5){var _0x54cb08={'raw':!![],'where':{'id':_0x10cfed[_0x0a2a('0x41')]['id']}},_0x225662={};_0x225662[_0x0a2a('0x2c')]=_[_0x0a2a('0x2e')](db[_0x0a2a('0x29')][_0x0a2a('0x2a')]);_0x225662[_0x0a2a('0x2d')]=_[_0x0a2a('0x2e')](_0x10cfed[_0x0a2a('0x2d')]);_0x225662['filters']=_[_0x0a2a('0x30')](_0x225662[_0x0a2a('0x2c')],_0x225662[_0x0a2a('0x2d')]);_0x54cb08['attributes']=_['intersection'](_0x225662[_0x0a2a('0x2c')],qs[_0x0a2a('0x32')](_0x10cfed['query'][_0x0a2a('0x32')]));_0x54cb08[_0x0a2a('0x31')]=_0x54cb08[_0x0a2a('0x31')][_0x0a2a('0x42')]?_0x54cb08[_0x0a2a('0x31')]:_0x225662['model'];if(_0x10cfed[_0x0a2a('0x2d')][_0x0a2a('0x3d')]){_0x54cb08[_0x0a2a('0x43')]=[{'all':!![]}];}_0x54cb08=_[_0x0a2a('0x39')]({},_0x54cb08,_0x10cfed[_0x0a2a('0x3c')]);return db[_0x0a2a('0x29')][_0x0a2a('0x44')](_0x54cb08)[_0x0a2a('0x21')](handleEntityNotFound(_0x3df4b5,null))[_0x0a2a('0x21')](respondWithResult(_0x3df4b5,null))[_0x0a2a('0x40')](handleError(_0x3df4b5,null));};exports['create']=function(_0x11e087,_0x1b7e6f){return db[_0x0a2a('0x29')][_0x0a2a('0x45')](_0x11e087[_0x0a2a('0x46')],{})['then'](function(_0x1e7081){var _0xf6eef0=_0x11e087['user'][_0x0a2a('0x23')]({'plain':!![]});if(!_0xf6eef0)throw new Error(_0x0a2a('0x47'));if(_0xf6eef0['role']===_0x0a2a('0x48')){var _0x1e4c8a=_0x1e7081[_0x0a2a('0x23')]({'plain':!![]});var _0x57c576=_0x0a2a('0x49');return db[_0x0a2a('0x4a')]['find']({'where':{'name':_0x57c576,'userProfileId':_0xf6eef0[_0x0a2a('0x4b')]},'raw':!![]})[_0x0a2a('0x21')](function(_0x5944c3){if(_0x5944c3&&_0x5944c3[_0x0a2a('0x4c')]===0x0){return db['UserProfileResource'][_0x0a2a('0x45')]({'name':_0x1e4c8a['name'],'resourceId':_0x1e4c8a['id'],'type':_0x5944c3[_0x0a2a('0x25')],'sectionId':_0x5944c3['id']},{})[_0x0a2a('0x21')](function(){return _0x1e7081;});}else{return _0x1e7081;}})['catch'](function(_0x1ea7ea){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ea7ea);throw _0x1ea7ea;});}return _0x1e7081;})[_0x0a2a('0x21')](respondWithResult(_0x1b7e6f,0xc9))[_0x0a2a('0x40')](handleError(_0x1b7e6f,null));};exports['update']=function(_0x79b7f6,_0x610db4){if(_0x79b7f6[_0x0a2a('0x46')]['id']){delete _0x79b7f6['body']['id'];}return db[_0x0a2a('0x29')]['find']({'where':{'id':_0x79b7f6[_0x0a2a('0x41')]['id']}})[_0x0a2a('0x21')](handleEntityNotFound(_0x610db4,null))[_0x0a2a('0x21')](saveUpdates(_0x79b7f6[_0x0a2a('0x46')],null))['then'](respondWithResult(_0x610db4,null))[_0x0a2a('0x40')](handleError(_0x610db4,null));};exports[_0x0a2a('0x22')]=function(_0x4bb884,_0x27b3dd){return db[_0x0a2a('0x29')][_0x0a2a('0x44')]({'where':{'id':_0x4bb884[_0x0a2a('0x41')]['id']}})['then'](handleEntityNotFound(_0x27b3dd,null))['then'](removeEntity(_0x27b3dd,null))[_0x0a2a('0x40')](handleError(_0x27b3dd,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 82b8d67..768120b 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 _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 +var _0x7252=['tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./template.attributes','exports','define'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x7252,0x146));var _0x2725=function(_0x674df3,_0x5abbed){_0x674df3=_0x674df3-0x0;var _0x4fafc5=_0x7252[_0x674df3];return _0x4fafc5;};'use strict';var _=require(_0x2725('0x0'));var util=require(_0x2725('0x1'));var logger=require(_0x2725('0x2'))(_0x2725('0x3'));var moment=require(_0x2725('0x4'));var BPromise=require(_0x2725('0x5'));var rp=require(_0x2725('0x6'));var fs=require('fs');var path=require(_0x2725('0x7'));var rimraf=require('rimraf');var config=require(_0x2725('0x8'));var attributes=require(_0x2725('0x9'));module[_0x2725('0xa')]=function(_0x21ad65,_0x586dcb){return _0x21ad65[_0x2725('0xb')]('Template',attributes,{'tableName':_0x2725('0xc'),'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 7076bcc..f9e7d69 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 _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 +var _0x9803=['model','include','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Template,\x20%s,\x20%s','message','info','catch','GetTemplate','Template','findAll','options','where','attributes','limit','map'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9803,0x113));var _0x3980=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9803[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x3980('0x0'));var util=require(_0x3980('0x1'));var moment=require(_0x3980('0x2'));var BPromise=require(_0x3980('0x3'));var rs=require(_0x3980('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3980('0x5'))['db'];var utils=require(_0x3980('0x6'));var logger=require(_0x3980('0x7'))(_0x3980('0x8'));var config=require(_0x3980('0x9'));var jayson=require(_0x3980('0xa'));var client=jayson['client'][_0x3980('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf59bce,_0x6818f3,_0x1138e7){return new BPromise(function(_0x1f2a6c,_0x3110f5){return client[_0x3980('0xc')](_0xf59bce,_0x1138e7)['then'](function(_0x51631a){logger['info']('Template,\x20%s,\x20%s',_0x6818f3,'request\x20sent');logger[_0x3980('0xd')](_0x3980('0xe'),_0x6818f3,_0x3980('0xf'),JSON[_0x3980('0x10')](_0x51631a));if(_0x51631a[_0x3980('0x11')]){if(_0x51631a[_0x3980('0x11')][_0x3980('0x12')]===0x1f4){logger['error'](_0x3980('0x13'),_0x6818f3,_0x51631a['error']['message']);return _0x3110f5(_0x51631a[_0x3980('0x11')]['message']);}logger[_0x3980('0x11')](_0x3980('0x13'),_0x6818f3,_0x51631a['error'][_0x3980('0x14')]);return _0x1f2a6c(_0x51631a[_0x3980('0x11')][_0x3980('0x14')]);}else{logger[_0x3980('0x15')](_0x3980('0x13'),_0x6818f3,'request\x20sent');_0x1f2a6c(_0x51631a['result'][_0x3980('0x14')]);}})[_0x3980('0x16')](function(_0x5687a1){logger['error'](_0x3980('0x13'),_0x6818f3,_0x5687a1);_0x3110f5(_0x5687a1);});});}exports[_0x3980('0x17')]=function(_0x17fd4a){var _0x15fa05=this;return new Promise(function(_0x1840d7,_0x1c868f){return db[_0x3980('0x18')][_0x3980('0x19')]({'raw':_0x17fd4a[_0x3980('0x1a')]?_0x17fd4a['options']['raw']===undefined?!![]:![]:!![],'where':_0x17fd4a[_0x3980('0x1a')]?_0x17fd4a['options'][_0x3980('0x1b')]||null:null,'attributes':_0x17fd4a[_0x3980('0x1a')]?_0x17fd4a[_0x3980('0x1a')][_0x3980('0x1c')]||null:null,'limit':_0x17fd4a[_0x3980('0x1a')]?_0x17fd4a['options'][_0x3980('0x1d')]||null:null,'include':_0x17fd4a[_0x3980('0x1a')]?_0x17fd4a[_0x3980('0x1a')]['include']?_[_0x3980('0x1e')](_0x17fd4a['options']['include'],function(_0x13807c){return{'model':db[_0x13807c[_0x3980('0x1f')]],'as':_0x13807c['as'],'attributes':_0x13807c['attributes'],'include':_0x13807c[_0x3980('0x20')]?_[_0x3980('0x1e')](_0x13807c[_0x3980('0x20')],function(_0x5260b8){return{'model':db[_0x5260b8['model']],'as':_0x5260b8['as'],'attributes':_0x5260b8[_0x3980('0x1c')],'include':_0x5260b8['include']?_['map'](_0x5260b8[_0x3980('0x20')],function(_0x335d18){return{'model':db[_0x335d18[_0x3980('0x1f')]],'as':_0x335d18['as'],'attributes':_0x335d18[_0x3980('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3980('0x21')](function(_0x2364ed){logger[_0x3980('0x15')](_0x3980('0x17'),_0x17fd4a);logger['debug'](_0x3980('0x17'),_0x17fd4a,JSON[_0x3980('0x10')](_0x2364ed));_0x1840d7(_0x2364ed);})['catch'](function(_0x10f0e8){logger[_0x3980('0x11')](_0x3980('0x17'),_0x10f0e8[_0x3980('0x14')],_0x17fd4a);_0x1c868f(_0x15fa05['error'](0x1f4,_0x10f0e8[_0x3980('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 6c6f644..13f2ae7 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 _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 +var _0x2032=['getActions','create','post','addAction','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions'];(function(_0x304fdf,_0x1c0a90){var _0x354fb4=function(_0x11f111){while(--_0x11f111){_0x304fdf['push'](_0x304fdf['shift']());}};_0x354fb4(++_0x1c0a90);}(_0x2032,0xd9));var _0x2203=function(_0x4ca4fa,_0x5815cd){_0x4ca4fa=_0x4ca4fa-0x0;var _0x4732fc=_0x2032[_0x4ca4fa];return _0x4732fc;};'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/all_conditions',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['post']('/:id/all_conditions',auth['isAuthenticated'](),controller['addAllCondition']);router['post'](_0x2203('0xe'),auth['isAuthenticated'](),controller['addAnyCondition']);router[_0x2203('0x13')](_0x2203('0x10'),auth[_0x2203('0x9')](),controller[_0x2203('0x14')]);router[_0x2203('0x15')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x18')]);module[_0x2203('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 7f0db0f..91627e0 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 _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 +var _0x6a94=['STRING','BOOLEAN','sequelize','exports'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x6a94,0x122));var _0x46a9=function(_0x581649,_0x15ff8e){_0x581649=_0x581649-0x0;var _0x5122b4=_0x6a94[_0x581649];return _0x5122b4;};'use strict';var Sequelize=require(_0x46a9('0x0'));module[_0x46a9('0x1')]={'name':{'type':Sequelize[_0x46a9('0x2')]},'channel':{'type':Sequelize[_0x46a9('0x2')]},'description':{'type':Sequelize[_0x46a9('0x2')]},'status':{'type':Sequelize[_0x46a9('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index e0481c7..4e1d3ef 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 _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 +var _0x9062=['order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','user','find','userProfileId','autoAssociation','error','update','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','then','destroy','get','Triggers','UserProfileResource','stack','name','map','Trigger','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x187203,_0x3ab8bb){var _0x4dc3e4=function(_0x447314){while(--_0x447314){_0x187203['push'](_0x187203['shift']());}};_0x4dc3e4(++_0x3ab8bb);}(_0x9062,0x137));var _0x2906=function(_0x23beac,_0x15437a){_0x23beac=_0x23beac-0x0;var _0x4faad9=_0x9062[_0x23beac];return _0x4faad9;};'use strict';var emlformat=require(_0x2906('0x0'));var rimraf=require(_0x2906('0x1'));var zipdir=require(_0x2906('0x2'));var jsonpatch=require(_0x2906('0x3'));var rp=require(_0x2906('0x4'));var moment=require(_0x2906('0x5'));var BPromise=require(_0x2906('0x6'));var Mustache=require(_0x2906('0x7'));var util=require('util');var path=require(_0x2906('0x8'));var sox=require(_0x2906('0x9'));var csv=require(_0x2906('0xa'));var ejs=require(_0x2906('0xb'));var fs=require('fs');var fs_extra=require(_0x2906('0xc'));var _=require(_0x2906('0xd'));var squel=require('squel');var crypto=require(_0x2906('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2906('0xf'));var toCsv=require(_0x2906('0xa'));var querystring=require('querystring');var Papa=require(_0x2906('0x10'));var Redis=require(_0x2906('0x11'));var authService=require(_0x2906('0x12'));var qs=require(_0x2906('0x13'));var as=require(_0x2906('0x14'));var hardwareService=require(_0x2906('0x15'));var logger=require(_0x2906('0x16'))(_0x2906('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x82481f,_0x59fcf0){_0x59fcf0=_0x59fcf0||0xcc;return function(_0x2158b6){if(_0x2158b6){return _0x82481f[_0x2906('0x18')](_0x59fcf0);}return _0x82481f[_0x2906('0x19')](_0x59fcf0)[_0x2906('0x1a')]();};}function respondWithResult(_0x503ccd,_0x5e341f){_0x5e341f=_0x5e341f||0xc8;return function(_0x511de5){if(_0x511de5){return _0x503ccd[_0x2906('0x19')](_0x5e341f)[_0x2906('0x1b')](_0x511de5);}};}function respondWithFilteredResult(_0xa69c6a,_0x4bc581){return function(_0x33f6bc){if(_0x33f6bc){var _0x4cb025=typeof _0x4bc581['offset']===_0x2906('0x1c')&&typeof _0x4bc581['limit']===_0x2906('0x1c');var _0x55b656=_0x33f6bc['count'];var _0x17833a=_0x4cb025?0x0:_0x4bc581['offset'];var _0x1a14d5=_0x4cb025?_0x33f6bc[_0x2906('0x1d')]:_0x4bc581[_0x2906('0x1e')]+_0x4bc581[_0x2906('0x1f')];var _0x646d85;if(_0x1a14d5>=_0x55b656){_0x1a14d5=_0x55b656;_0x646d85=0xc8;}else{_0x646d85=0xce;}_0xa69c6a[_0x2906('0x19')](_0x646d85);return _0xa69c6a[_0x2906('0x20')]('Content-Range',_0x17833a+'-'+_0x1a14d5+'/'+_0x55b656)[_0x2906('0x1b')](_0x33f6bc);}return null;};}function patchUpdates(_0x3713c7){return function(_0x1ab4bf){try{jsonpatch[_0x2906('0x21')](_0x1ab4bf,_0x3713c7,!![]);}catch(_0x55a583){return BPromise[_0x2906('0x22')](_0x55a583);}return _0x1ab4bf[_0x2906('0x23')]();};}function saveUpdates(_0x4f93cc,_0x1e698d){return function(_0x5a2dbe){if(_0x5a2dbe){return _0x5a2dbe['update'](_0x4f93cc)[_0x2906('0x24')](function(_0x337349){return _0x337349;});}return null;};}function removeEntity(_0x594f32,_0x2bdb4b){return function(_0x14ddc4){if(_0x14ddc4){return _0x14ddc4[_0x2906('0x25')]()['then'](function(){var _0x304742=_0x14ddc4[_0x2906('0x26')]({'plain':!![]});var _0x457a7e=_0x2906('0x27');return db[_0x2906('0x28')]['destroy']({'where':{'type':_0x457a7e,'resourceId':_0x304742['id']}})[_0x2906('0x24')](function(){return _0x14ddc4;});})[_0x2906('0x24')](function(){_0x594f32[_0x2906('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x460aa6,_0x491e13){return function(_0x5dcf11){if(!_0x5dcf11){_0x460aa6[_0x2906('0x18')](0x194);}return _0x5dcf11;};}function handleError(_0x279c43,_0x3b88fc){_0x3b88fc=_0x3b88fc||0x1f4;return function(_0x23906d){logger['error'](_0x23906d[_0x2906('0x29')]);if(_0x23906d[_0x2906('0x2a')]){delete _0x23906d[_0x2906('0x2a')];}_0x279c43['status'](_0x3b88fc)['send'](_0x23906d);};}exports['index']=function(_0x12979a,_0xba9de1){var _0x3804e7={},_0x516d7c={},_0x1a18eb={'count':0x0,'rows':[]};var _0x240aa7=_[_0x2906('0x2b')](db[_0x2906('0x2c')]['rawAttributes'],function(_0x1f5009){return{'name':_0x1f5009[_0x2906('0x2d')],'type':_0x1f5009['type'][_0x2906('0x2e')]};});_0x516d7c[_0x2906('0x2f')]=_[_0x2906('0x2b')](_0x240aa7,_0x2906('0x2a'));_0x516d7c['query']=_[_0x2906('0x30')](_0x12979a[_0x2906('0x31')]);_0x516d7c[_0x2906('0x32')]=_[_0x2906('0x33')](_0x516d7c[_0x2906('0x2f')],_0x516d7c[_0x2906('0x31')]);_0x3804e7[_0x2906('0x34')]=_['intersection'](_0x516d7c[_0x2906('0x2f')],qs[_0x2906('0x35')](_0x12979a['query'][_0x2906('0x35')]));_0x3804e7['attributes']=_0x3804e7[_0x2906('0x34')][_0x2906('0x36')]?_0x3804e7[_0x2906('0x34')]:_0x516d7c['model'];if(!_0x12979a[_0x2906('0x31')][_0x2906('0x37')](_0x2906('0x38'))){_0x3804e7['limit']=qs[_0x2906('0x1f')](_0x12979a[_0x2906('0x31')]['limit']);_0x3804e7[_0x2906('0x1e')]=qs[_0x2906('0x1e')](_0x12979a[_0x2906('0x31')]['offset']);}_0x3804e7[_0x2906('0x39')]=qs[_0x2906('0x3a')](_0x12979a[_0x2906('0x31')][_0x2906('0x3a')]);_0x3804e7[_0x2906('0x3b')]=qs['filters'](_[_0x2906('0x3c')](_0x12979a[_0x2906('0x31')],_0x516d7c[_0x2906('0x32')]),_0x240aa7);if(_0x12979a[_0x2906('0x31')][_0x2906('0x3d')]){_0x3804e7[_0x2906('0x3b')]=_[_0x2906('0x3e')](_0x3804e7['where'],{'$or':_[_0x2906('0x2b')](_0x240aa7,function(_0x5170f1){if(_0x5170f1[_0x2906('0x3f')]!=='VIRTUAL'){var _0x33f06c={};_0x33f06c[_0x5170f1[_0x2906('0x2a')]]={'$like':'%'+_0x12979a[_0x2906('0x31')]['filter']+'%'};return _0x33f06c;}})});}_0x3804e7=_['merge']({},_0x3804e7,_0x12979a[_0x2906('0x40')]);var _0x5b0eaa={'where':_0x3804e7[_0x2906('0x3b')]};return db[_0x2906('0x2c')][_0x2906('0x1d')](_0x5b0eaa)[_0x2906('0x24')](function(_0xcd3427){_0x1a18eb['count']=_0xcd3427;if(_0x12979a[_0x2906('0x31')][_0x2906('0x41')]){_0x3804e7[_0x2906('0x42')]=[{'all':!![]}];}return db[_0x2906('0x2c')]['findAll'](_0x3804e7);})[_0x2906('0x24')](function(_0x5a97bc){_0x1a18eb[_0x2906('0x43')]=_0x5a97bc;return _0x1a18eb;})[_0x2906('0x24')](respondWithFilteredResult(_0xba9de1,_0x3804e7))[_0x2906('0x44')](handleError(_0xba9de1,null));};exports[_0x2906('0x45')]=function(_0x2b62d9,_0x5a18c0){var _0xe1b5c4={'raw':![],'where':{'id':_0x2b62d9[_0x2906('0x46')]['id']}},_0x298bce={};_0x298bce[_0x2906('0x2f')]=_['keys'](db[_0x2906('0x2c')][_0x2906('0x47')]);_0x298bce[_0x2906('0x31')]=_[_0x2906('0x30')](_0x2b62d9['query']);_0x298bce['filters']=_[_0x2906('0x33')](_0x298bce[_0x2906('0x2f')],_0x298bce[_0x2906('0x31')]);_0xe1b5c4[_0x2906('0x34')]=_[_0x2906('0x33')](_0x298bce[_0x2906('0x2f')],qs[_0x2906('0x35')](_0x2b62d9['query'][_0x2906('0x35')]));_0xe1b5c4[_0x2906('0x34')]=_0xe1b5c4[_0x2906('0x34')]['length']?_0xe1b5c4[_0x2906('0x34')]:_0x298bce[_0x2906('0x2f')];if(_0x2b62d9[_0x2906('0x31')][_0x2906('0x41')]){_0xe1b5c4['include']=[{'all':!![]}];}_0xe1b5c4=_[_0x2906('0x3e')]({},_0xe1b5c4,_0x2b62d9[_0x2906('0x40')]);return db['Trigger']['find'](_0xe1b5c4)['then'](handleEntityNotFound(_0x5a18c0,null))[_0x2906('0x24')](respondWithResult(_0x5a18c0,null))[_0x2906('0x44')](handleError(_0x5a18c0,null));};exports[_0x2906('0x48')]=function(_0x492a6c,_0x575428){return db[_0x2906('0x2c')]['create'](_0x492a6c[_0x2906('0x49')],{})[_0x2906('0x24')](function(_0x494dd1){var _0xf192fe=_0x492a6c['user'][_0x2906('0x26')]({'plain':!![]});if(!_0xf192fe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf192fe['role']===_0x2906('0x4a')){var _0x59dc3a=_0x494dd1[_0x2906('0x26')]({'plain':!![]});var _0x39a547=_0x2906('0x27');return db['UserProfileSection'][_0x2906('0x4b')]({'where':{'name':_0x39a547,'userProfileId':_0xf192fe[_0x2906('0x4c')]},'raw':!![]})[_0x2906('0x24')](function(_0x5080cf){if(_0x5080cf&&_0x5080cf[_0x2906('0x4d')]===0x0){return db[_0x2906('0x28')][_0x2906('0x48')]({'name':_0x59dc3a[_0x2906('0x2a')],'resourceId':_0x59dc3a['id'],'type':_0x5080cf['name'],'sectionId':_0x5080cf['id']},{})[_0x2906('0x24')](function(){return _0x494dd1;});}else{return _0x494dd1;}})[_0x2906('0x44')](function(_0x59dee9){logger[_0x2906('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59dee9);throw _0x59dee9;});}return _0x494dd1;})[_0x2906('0x24')](respondWithResult(_0x575428,0xc9))[_0x2906('0x44')](handleError(_0x575428,null));};exports[_0x2906('0x4f')]=function(_0x321f27,_0x15fa03){if(_0x321f27[_0x2906('0x49')]['id']){delete _0x321f27[_0x2906('0x49')]['id'];}return db['Trigger'][_0x2906('0x4b')]({'where':{'id':_0x321f27[_0x2906('0x46')]['id']}})[_0x2906('0x24')](handleEntityNotFound(_0x15fa03,null))[_0x2906('0x24')](saveUpdates(_0x321f27[_0x2906('0x49')],null))[_0x2906('0x24')](respondWithResult(_0x15fa03,null))[_0x2906('0x44')](handleError(_0x15fa03,null));};exports[_0x2906('0x25')]=function(_0x3f857e,_0x5dfac2){return db['Trigger'][_0x2906('0x4b')]({'where':{'id':_0x3f857e[_0x2906('0x46')]['id']}})[_0x2906('0x24')](handleEntityNotFound(_0x5dfac2,null))[_0x2906('0x24')](removeEntity(_0x5dfac2,null))[_0x2906('0x44')](handleError(_0x5dfac2,null));};exports[_0x2906('0x50')]=function(_0x2bbf44,_0x21a4c6,_0x8b0af1){if(_0x2bbf44[_0x2906('0x49')]['id']){delete _0x2bbf44[_0x2906('0x49')]['id'];}return db[_0x2906('0x2c')][_0x2906('0x4b')]({'where':{'id':_0x2bbf44[_0x2906('0x46')]['id']}})[_0x2906('0x24')](handleEntityNotFound(_0x21a4c6,null))[_0x2906('0x24')](function(_0x25d669){if(_0x25d669){_0x2bbf44[_0x2906('0x49')][_0x2906('0x51')]=_0x25d669['id'];return db[_0x2906('0x52')][_0x2906('0x48')](_0x2bbf44[_0x2906('0x49')]);}})['then'](respondWithResult(_0x21a4c6,null))[_0x2906('0x44')](handleError(_0x21a4c6,null));};exports[_0x2906('0x53')]=function(_0x4342bf,_0x346c8a,_0x1c4e53){if(_0x4342bf[_0x2906('0x49')]['id']){delete _0x4342bf[_0x2906('0x49')]['id'];}return db[_0x2906('0x2c')][_0x2906('0x4b')]({'where':{'id':_0x4342bf[_0x2906('0x46')]['id']}})[_0x2906('0x24')](handleEntityNotFound(_0x346c8a,null))['then'](function(_0x3a2572){if(_0x3a2572){_0x4342bf[_0x2906('0x49')][_0x2906('0x54')]=_0x3a2572['id'];return db[_0x2906('0x52')][_0x2906('0x48')](_0x4342bf[_0x2906('0x49')]);}})['then'](respondWithResult(_0x346c8a,null))[_0x2906('0x44')](handleError(_0x346c8a,null));};exports[_0x2906('0x55')]=function(_0x5ba134,_0x24bbe3,_0x224f53){var _0x1f054e={};var _0x2d3a14={};var _0x3430e4;var _0x1122fb;return db[_0x2906('0x2c')][_0x2906('0x56')]({'where':{'id':_0x5ba134['params']['id']}})[_0x2906('0x24')](handleEntityNotFound(_0x24bbe3,null))[_0x2906('0x24')](function(_0x175694){if(_0x175694){_0x3430e4=_0x175694;_0x2d3a14[_0x2906('0x2f')]=_[_0x2906('0x30')](db[_0x2906('0x52')][_0x2906('0x47')]);_0x2d3a14['query']=_[_0x2906('0x30')](_0x5ba134[_0x2906('0x31')]);_0x2d3a14[_0x2906('0x32')]=_[_0x2906('0x33')](_0x2d3a14[_0x2906('0x2f')],_0x2d3a14[_0x2906('0x31')]);_0x1f054e[_0x2906('0x34')]=_[_0x2906('0x33')](_0x2d3a14[_0x2906('0x2f')],qs[_0x2906('0x35')](_0x5ba134['query'][_0x2906('0x35')]));_0x1f054e[_0x2906('0x34')]=_0x1f054e[_0x2906('0x34')]['length']?_0x1f054e[_0x2906('0x34')]:_0x2d3a14['model'];_0x1f054e['order']=qs[_0x2906('0x3a')](_0x5ba134[_0x2906('0x31')]['sort']);_0x1f054e[_0x2906('0x3b')]=qs[_0x2906('0x32')](_[_0x2906('0x3c')](_0x5ba134['query'],_0x2d3a14[_0x2906('0x32')]));if(_0x5ba134[_0x2906('0x31')]['filter']){_0x1f054e[_0x2906('0x3b')]=_[_0x2906('0x3e')](_0x1f054e['where'],{'$or':_[_0x2906('0x2b')](_0x1f054e[_0x2906('0x34')],function(_0x5bebc9){var _0x3cf19e={};_0x3cf19e[_0x5bebc9]={'$like':'%'+_0x5ba134['query']['filter']+'%'};return _0x3cf19e;})});}_0x1f054e=_[_0x2906('0x3e')]({},_0x1f054e,_0x5ba134[_0x2906('0x40')]);return _0x3430e4[_0x2906('0x55')](_0x1f054e);}})['then'](function(_0x5e424b){if(_0x5e424b){_0x1122fb=_0x5e424b[_0x2906('0x36')];if(!_0x5ba134['query'][_0x2906('0x37')](_0x2906('0x38'))){_0x1f054e[_0x2906('0x1f')]=qs[_0x2906('0x1f')](_0x5ba134[_0x2906('0x31')][_0x2906('0x1f')]);_0x1f054e[_0x2906('0x1e')]=qs['offset'](_0x5ba134[_0x2906('0x31')]['offset']);}return _0x3430e4[_0x2906('0x55')](_0x1f054e);}})[_0x2906('0x24')](function(_0x3d5b19){if(_0x3d5b19){return _0x3d5b19?{'count':_0x1122fb,'rows':_0x3d5b19}:null;}})['then'](respondWithResult(_0x24bbe3,null))[_0x2906('0x44')](handleError(_0x24bbe3,null));};exports[_0x2906('0x57')]=function(_0x10eaa2,_0x4dc638,_0x1b7b27){var _0x3cb64c={};var _0x54dd4d={};var _0x15c37d;var _0x1aba51;return db[_0x2906('0x2c')][_0x2906('0x56')]({'where':{'id':_0x10eaa2[_0x2906('0x46')]['id']}})['then'](handleEntityNotFound(_0x4dc638,null))[_0x2906('0x24')](function(_0x2fba60){if(_0x2fba60){_0x15c37d=_0x2fba60;_0x54dd4d['model']=_[_0x2906('0x30')](db[_0x2906('0x52')][_0x2906('0x47')]);_0x54dd4d[_0x2906('0x31')]=_[_0x2906('0x30')](_0x10eaa2[_0x2906('0x31')]);_0x54dd4d[_0x2906('0x32')]=_[_0x2906('0x33')](_0x54dd4d[_0x2906('0x2f')],_0x54dd4d[_0x2906('0x31')]);_0x3cb64c['attributes']=_['intersection'](_0x54dd4d[_0x2906('0x2f')],qs['fields'](_0x10eaa2['query'][_0x2906('0x35')]));_0x3cb64c['attributes']=_0x3cb64c[_0x2906('0x34')][_0x2906('0x36')]?_0x3cb64c[_0x2906('0x34')]:_0x54dd4d[_0x2906('0x2f')];_0x3cb64c['order']=qs['sort'](_0x10eaa2['query']['sort']);_0x3cb64c[_0x2906('0x3b')]=qs[_0x2906('0x32')](_['pick'](_0x10eaa2[_0x2906('0x31')],_0x54dd4d['filters']));if(_0x10eaa2[_0x2906('0x31')][_0x2906('0x3d')]){_0x3cb64c[_0x2906('0x3b')]=_[_0x2906('0x3e')](_0x3cb64c[_0x2906('0x3b')],{'$or':_[_0x2906('0x2b')](_0x3cb64c[_0x2906('0x34')],function(_0x3ba3bd){var _0x211d8c={};_0x211d8c[_0x3ba3bd]={'$like':'%'+_0x10eaa2[_0x2906('0x31')][_0x2906('0x3d')]+'%'};return _0x211d8c;})});}_0x3cb64c=_[_0x2906('0x3e')]({},_0x3cb64c,_0x10eaa2['options']);return _0x15c37d['getAnyConditions'](_0x3cb64c);}})[_0x2906('0x24')](function(_0x36de42){if(_0x36de42){_0x1aba51=_0x36de42[_0x2906('0x36')];if(!_0x10eaa2['query'][_0x2906('0x37')]('nolimit')){_0x3cb64c['limit']=qs[_0x2906('0x1f')](_0x10eaa2[_0x2906('0x31')]['limit']);_0x3cb64c[_0x2906('0x1e')]=qs['offset'](_0x10eaa2[_0x2906('0x31')]['offset']);}return _0x15c37d[_0x2906('0x57')](_0x3cb64c);}})['then'](function(_0x27bd30){if(_0x27bd30){return _0x27bd30?{'count':_0x1aba51,'rows':_0x27bd30}:null;}})['then'](respondWithResult(_0x4dc638,null))['catch'](handleError(_0x4dc638,null));};exports[_0x2906('0x58')]=function(_0x488de4,_0x2e92bc,_0x65a21a){if(_0x488de4[_0x2906('0x49')]['id']){delete _0x488de4[_0x2906('0x49')]['id'];}return db[_0x2906('0x2c')][_0x2906('0x4b')]({'where':{'id':_0x488de4[_0x2906('0x46')]['id']}})[_0x2906('0x24')](handleEntityNotFound(_0x2e92bc,null))[_0x2906('0x24')](function(_0x329889){if(_0x329889){_0x488de4[_0x2906('0x49')][_0x2906('0x59')]=_0x329889['id'];return db[_0x2906('0x5a')][_0x2906('0x48')](_0x488de4[_0x2906('0x49')]);}})[_0x2906('0x24')](respondWithResult(_0x2e92bc,null))[_0x2906('0x44')](handleError(_0x2e92bc,null));};exports['getActions']=function(_0x2727c3,_0x25795f,_0x203e87){var _0x247c1b={};var _0x5ca903={};var _0x413dc2;var _0x314792;return db[_0x2906('0x2c')][_0x2906('0x56')]({'where':{'id':_0x2727c3[_0x2906('0x46')]['id']}})['then'](handleEntityNotFound(_0x25795f,null))['then'](function(_0x5f1509){if(_0x5f1509){_0x413dc2=_0x5f1509;_0x5ca903['model']=_[_0x2906('0x30')](db[_0x2906('0x5a')]['rawAttributes']);_0x5ca903['query']=_[_0x2906('0x30')](_0x2727c3[_0x2906('0x31')]);_0x5ca903[_0x2906('0x32')]=_['intersection'](_0x5ca903[_0x2906('0x2f')],_0x5ca903[_0x2906('0x31')]);_0x247c1b[_0x2906('0x34')]=_[_0x2906('0x33')](_0x5ca903[_0x2906('0x2f')],qs[_0x2906('0x35')](_0x2727c3['query'][_0x2906('0x35')]));_0x247c1b[_0x2906('0x34')]=_0x247c1b[_0x2906('0x34')][_0x2906('0x36')]?_0x247c1b[_0x2906('0x34')]:_0x5ca903['model'];_0x247c1b[_0x2906('0x39')]=qs['sort'](_0x2727c3['query'][_0x2906('0x3a')]);_0x247c1b['where']=qs[_0x2906('0x32')](_[_0x2906('0x3c')](_0x2727c3[_0x2906('0x31')],_0x5ca903[_0x2906('0x32')]));if(_0x2727c3[_0x2906('0x31')][_0x2906('0x3d')]){_0x247c1b[_0x2906('0x3b')]=_[_0x2906('0x3e')](_0x247c1b[_0x2906('0x3b')],{'$or':_[_0x2906('0x2b')](_0x247c1b['attributes'],function(_0xf1150d){var _0x5489e6={};_0x5489e6[_0xf1150d]={'$like':'%'+_0x2727c3[_0x2906('0x31')][_0x2906('0x3d')]+'%'};return _0x5489e6;})});}_0x247c1b=_['merge']({},_0x247c1b,_0x2727c3[_0x2906('0x40')]);return _0x413dc2['getActions'](_0x247c1b);}})[_0x2906('0x24')](function(_0x5c9d2a){if(_0x5c9d2a){_0x314792=_0x5c9d2a[_0x2906('0x36')];if(!_0x2727c3[_0x2906('0x31')][_0x2906('0x37')](_0x2906('0x38'))){_0x247c1b[_0x2906('0x1f')]=qs['limit'](_0x2727c3['query'][_0x2906('0x1f')]);_0x247c1b[_0x2906('0x1e')]=qs['offset'](_0x2727c3['query'][_0x2906('0x1e')]);}return _0x413dc2[_0x2906('0x5b')](_0x247c1b);}})['then'](function(_0x21e2f2){if(_0x21e2f2){return _0x21e2f2?{'count':_0x314792,'rows':_0x21e2f2}:null;}})[_0x2906('0x24')](respondWithResult(_0x25795f,null))[_0x2906('0x44')](handleError(_0x25795f,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 60ac990..1bf5398 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 _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 +var _0xa98d=['moment','bluebird','path','rimraf','../../config/environment','exports','define','Trigger','tools_triggers','lodash','../../config/logger'];(function(_0x19141d,_0x11f5da){var _0x298310=function(_0x2e855b){while(--_0x2e855b){_0x19141d['push'](_0x19141d['shift']());}};_0x298310(++_0x11f5da);}(_0xa98d,0xa3));var _0xda98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa98d[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xda98('0x0'));var util=require('util');var logger=require(_0xda98('0x1'))('api');var moment=require(_0xda98('0x2'));var BPromise=require(_0xda98('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda98('0x4'));var rimraf=require(_0xda98('0x5'));var config=require(_0xda98('0x6'));var attributes=require('./trigger.attributes');module[_0xda98('0x7')]=function(_0x39acbf,_0x218e43){return _0x39acbf[_0xda98('0x8')](_0xda98('0x9'),attributes,{'tableName':_0xda98('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index d8d6c32..9d79e5f 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 _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 +var _0x5729=['rpc','../../config/environment','jayson/promise','http','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetTrigger','Trigger','options','raw','where','attributes','limit','include','model','map','catch','find','ShowTrigger','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x29d7f2,_0x523803){var _0x4295c7=function(_0x3220b9){while(--_0x3220b9){_0x29d7f2['push'](_0x29d7f2['shift']());}};_0x4295c7(++_0x523803);}(_0x5729,0xe8));var _0x9572=function(_0x5da01c,_0x53bf77){_0x5da01c=_0x5da01c-0x0;var _0x1216c2=_0x5729[_0x5da01c];return _0x1216c2;};'use strict';var _=require(_0x9572('0x0'));var util=require(_0x9572('0x1'));var moment=require('moment');var BPromise=require(_0x9572('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9572('0x3'));var db=require(_0x9572('0x4'))['db'];var utils=require(_0x9572('0x5'));var logger=require('../../config/logger')(_0x9572('0x6'));var config=require(_0x9572('0x7'));var jayson=require(_0x9572('0x8'));var client=jayson['client'][_0x9572('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x151301,_0x9e5746,_0x5e823a){return new BPromise(function(_0x33d7fe,_0x60fb4f){return client['request'](_0x151301,_0x5e823a)[_0x9572('0xa')](function(_0x51792d){logger['info'](_0x9572('0xb'),_0x9e5746,_0x9572('0xc'));logger[_0x9572('0xd')](_0x9572('0xe'),_0x9e5746,'request\x20sent',JSON[_0x9572('0xf')](_0x51792d));if(_0x51792d[_0x9572('0x10')]){if(_0x51792d[_0x9572('0x10')][_0x9572('0x11')]===0x1f4){logger[_0x9572('0x10')](_0x9572('0xb'),_0x9e5746,_0x51792d['error'][_0x9572('0x12')]);return _0x60fb4f(_0x51792d[_0x9572('0x10')]['message']);}logger[_0x9572('0x10')](_0x9572('0xb'),_0x9e5746,_0x51792d['error'][_0x9572('0x12')]);return _0x33d7fe(_0x51792d[_0x9572('0x10')][_0x9572('0x12')]);}else{logger[_0x9572('0x13')]('Trigger,\x20%s,\x20%s',_0x9e5746,_0x9572('0xc'));_0x33d7fe(_0x51792d[_0x9572('0x14')][_0x9572('0x12')]);}})['catch'](function(_0x5a99cb){logger['error'](_0x9572('0xb'),_0x9e5746,_0x5a99cb);_0x60fb4f(_0x5a99cb);});});}exports[_0x9572('0x15')]=function(_0x542bb0){var _0x5b219a=this;return new Promise(function(_0x284b43,_0x150566){return db[_0x9572('0x16')]['findAll']({'raw':_0x542bb0[_0x9572('0x17')]?_0x542bb0['options'][_0x9572('0x18')]===undefined?!![]:![]:!![],'where':_0x542bb0['options']?_0x542bb0[_0x9572('0x17')][_0x9572('0x19')]||null:null,'attributes':_0x542bb0['options']?_0x542bb0[_0x9572('0x17')][_0x9572('0x1a')]||null:null,'limit':_0x542bb0[_0x9572('0x17')]?_0x542bb0['options'][_0x9572('0x1b')]||null:null,'include':_0x542bb0[_0x9572('0x17')]?_0x542bb0[_0x9572('0x17')]['include']?_['map'](_0x542bb0['options'][_0x9572('0x1c')],function(_0x5e7b9c){return{'model':db[_0x5e7b9c[_0x9572('0x1d')]],'as':_0x5e7b9c['as'],'attributes':_0x5e7b9c[_0x9572('0x1a')],'include':_0x5e7b9c[_0x9572('0x1c')]?_[_0x9572('0x1e')](_0x5e7b9c[_0x9572('0x1c')],function(_0x2e8c57){return{'model':db[_0x2e8c57[_0x9572('0x1d')]],'as':_0x2e8c57['as'],'attributes':_0x2e8c57[_0x9572('0x1a')],'include':_0x2e8c57[_0x9572('0x1c')]?_[_0x9572('0x1e')](_0x2e8c57[_0x9572('0x1c')],function(_0x5c229f){return{'model':db[_0x5c229f[_0x9572('0x1d')]],'as':_0x5c229f['as'],'attributes':_0x5c229f[_0x9572('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9572('0xa')](function(_0x1c14ba){logger[_0x9572('0x13')](_0x9572('0x15'),_0x542bb0);logger['debug'](_0x9572('0x15'),_0x542bb0,JSON[_0x9572('0xf')](_0x1c14ba));_0x284b43(_0x1c14ba);})[_0x9572('0x1f')](function(_0x23e08){logger['error'](_0x9572('0x15'),_0x23e08[_0x9572('0x12')],_0x542bb0);_0x150566(_0x5b219a[_0x9572('0x10')](0x1f4,_0x23e08[_0x9572('0x12')]));});});};exports['ShowTrigger']=function(_0x391728){var _0x535377=this;return new Promise(function(_0x452cde,_0x1a76e1){return db[_0x9572('0x16')][_0x9572('0x20')]({'raw':_0x391728[_0x9572('0x17')]?_0x391728['options']['raw']===undefined?!![]:![]:!![],'where':_0x391728['options']?_0x391728[_0x9572('0x17')][_0x9572('0x19')]||null:null,'attributes':_0x391728[_0x9572('0x17')]?_0x391728[_0x9572('0x17')][_0x9572('0x1a')]||null:null,'include':_0x391728[_0x9572('0x17')]?_0x391728[_0x9572('0x17')]['include']?_[_0x9572('0x1e')](_0x391728[_0x9572('0x17')][_0x9572('0x1c')],function(_0x31258){return{'model':db[_0x31258[_0x9572('0x1d')]],'as':_0x31258['as'],'attributes':_0x31258[_0x9572('0x1a')],'include':_0x31258[_0x9572('0x1c')]?_[_0x9572('0x1e')](_0x31258['include'],function(_0x1c9825){return{'model':db[_0x1c9825[_0x9572('0x1d')]],'as':_0x1c9825['as'],'attributes':_0x1c9825[_0x9572('0x1a')],'include':_0x1c9825[_0x9572('0x1c')]?_[_0x9572('0x1e')](_0x1c9825[_0x9572('0x1c')],function(_0x48c39b){return{'model':db[_0x48c39b[_0x9572('0x1d')]],'as':_0x48c39b['as'],'attributes':_0x48c39b[_0x9572('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9572('0xa')](function(_0x2a8f8f){logger[_0x9572('0x13')](_0x9572('0x21'),_0x391728);logger[_0x9572('0xd')]('ShowTrigger',_0x391728,JSON[_0x9572('0xf')](_0x2a8f8f));_0x452cde(_0x2a8f8f);})[_0x9572('0x1f')](function(_0xbf8857){logger[_0x9572('0x10')]('ShowTrigger',_0xbf8857[_0x9572('0x12')],_0x391728);_0x1a76e1(_0x535377['error'](0x1f4,_0xbf8857[_0x9572('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 5c1da0d..622c21d 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 _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 +var _0x2e3f=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','get','index','/:id','isAuthenticated','show'];(function(_0x188128,_0xc8a300){var _0x367d22=function(_0x504d1d){while(--_0x504d1d){_0x188128['push'](_0x188128['shift']());}};_0x367d22(++_0xc8a300);}(_0x2e3f,0x8b));var _0xf2e3=function(_0x59a703,_0x248012){_0x59a703=_0x59a703-0x0;var _0x5ad181=_0x2e3f[_0x59a703];return _0x5ad181;};'use strict';var multer=require(_0xf2e3('0x0'));var util=require(_0xf2e3('0x1'));var path=require(_0xf2e3('0x2'));var timeout=require(_0xf2e3('0x3'));var express=require(_0xf2e3('0x4'));var router=express[_0xf2e3('0x5')]();var fs_extra=require(_0xf2e3('0x6'));var auth=require(_0xf2e3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf2e3('0x8'));var controller=require(_0xf2e3('0x9'));router[_0xf2e3('0xa')]('/',auth['isAuthenticated'](),controller[_0xf2e3('0xb')]);router[_0xf2e3('0xa')](_0xf2e3('0xc'),auth[_0xf2e3('0xd')](),controller[_0xf2e3('0xe')]);router[_0xf2e3('0xf')]('/:id/clone',auth[_0xf2e3('0xd')](),controller['clone']);router[_0xf2e3('0xf')]('/',auth[_0xf2e3('0xd')](),controller[_0xf2e3('0x10')]);router[_0xf2e3('0x11')](_0xf2e3('0xc'),auth[_0xf2e3('0xd')](),controller[_0xf2e3('0x12')]);router[_0xf2e3('0x13')](_0xf2e3('0xc'),auth[_0xf2e3('0xd')](),controller[_0xf2e3('0x14')]);module[_0xf2e3('0x15')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 6c65fd3..45cd9be 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 _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 +var _0x1561=['name','ENUM','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','setDataValue','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','\x22\x22\x20<>','INTEGER','accept','refuse','originate','uac','uas','pai','certificate','active','passive','actpass','update,nonat','BOOLEAN','sequelize','exports','STRING'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x1561,0x1c8));var _0x1156=function(_0x90787b,_0x151dfb){_0x90787b=_0x90787b-0x0;var _0xbcbd4e=_0x1561[_0x90787b];return _0xbcbd4e;};'use strict';var Sequelize=require(_0x1156('0x0'));module[_0x1156('0x1')]={'name':{'type':Sequelize[_0x1156('0x2')],'allowNull':![],'unique':_0x1156('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1156('0x4')]('friend',_0x1156('0x5'),_0x1156('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x1156('0x2')],'allowNull':![],'defaultValue':_0x1156('0x7')},'callingpres':{'type':Sequelize[_0x1156('0x4')](_0x1156('0x8'),'ALLOWED_PASSED_SCREEN',_0x1156('0x9'),_0x1156('0xa'),'PROHIB_NOT_SCREENED',_0x1156('0xb'),_0x1156('0xc'),_0x1156('0xd'))},'deny':{'type':Sequelize[_0x1156('0x2')]},'permit':{'type':Sequelize[_0x1156('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x1156('0x2')]},'remotesecret':{'type':Sequelize[_0x1156('0x2')]},'transport':{'type':Sequelize[_0x1156('0x2')],'defaultValue':_0x1156('0xe'),'set':function(_0x20a63a){this['setDataValue'](_0x1156('0xf'),_0x20a63a?_0x20a63a[_0x1156('0x10')](','):null);},'get':function(){return this[_0x1156('0x11')](_0x1156('0xf'))?this['getDataValue']('transport')['split'](','):null;},'comment':_0x1156('0x12')},'dtmfmode':{'type':Sequelize[_0x1156('0x4')]('rfc2833',_0x1156('0x13'),'shortinfo','inband',_0x1156('0x14')),'defaultValue':_0x1156('0x15')},'directmedia':{'type':Sequelize[_0x1156('0x4')](_0x1156('0x16'),'no',_0x1156('0x17'),_0x1156('0x18'),_0x1156('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1156('0x4')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1156('0x2')]},'directmediadeny':{'type':Sequelize[_0x1156('0x2')]},'nat':{'type':Sequelize[_0x1156('0x2')],'defaultValue':_0x1156('0x1a'),'set':function(_0x1db594){this[_0x1156('0x1b')]('nat',_0x1db594?_0x1db594[_0x1156('0x10')](','):null);},'get':function(){return this[_0x1156('0x11')](_0x1156('0x1c'))?this['getDataValue']('nat')[_0x1156('0x1d')](','):null;},'comment':_0x1156('0x1e')},'callgroup':{'type':Sequelize[_0x1156('0x2')]},'namedcallgroup':{'type':Sequelize[_0x1156('0x2')]},'pickupgroup':{'type':Sequelize[_0x1156('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x1156('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1156('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x1156('0x2')],'defaultValue':_0x1156('0x1f')},'allow':{'type':Sequelize[_0x1156('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3a76d3){this[_0x1156('0x1b')]('allow',_0x3a76d3?_0x3a76d3[_0x1156('0x10')](';'):_0x1156('0x20'));},'get':function(){return this[_0x1156('0x11')]('allow')?this[_0x1156('0x11')]('allow')['split'](';'):null;},'comment':_0x1156('0x21')},'autoframing':{'type':Sequelize[_0x1156('0x4')](_0x1156('0x16'),'no')},'insecure':{'type':Sequelize[_0x1156('0x2')],'defaultValue':_0x1156('0x22'),'set':function(_0x5cf590){this['setDataValue'](_0x1156('0x23'),_0x5cf590?_0x5cf590['join'](','):null);},'get':function(){return this[_0x1156('0x11')](_0x1156('0x23'))?this[_0x1156('0x11')](_0x1156('0x23'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1156('0x4')](_0x1156('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1156('0x4')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x1156('0x4')](_0x1156('0x16'),'no',_0x1156('0x24'))},'promiscredir':{'type':Sequelize[_0x1156('0x4')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x1156('0x16'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x1156('0x2')],'defaultValue':_0x1156('0x25')},'amaflags':{'type':Sequelize[_0x1156('0x2')]},'callcounter':{'type':Sequelize[_0x1156('0x4')](_0x1156('0x16'),'no'),'defaultValue':_0x1156('0x16')},'busylevel':{'type':Sequelize[_0x1156('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x1156('0x4')](_0x1156('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x1156('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0x1156('0x4')](_0x1156('0x16'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x1156('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0x1156('0x2')]},'template':{'type':Sequelize[_0x1156('0x2')]},'videosupport':{'type':Sequelize[_0x1156('0x4')](_0x1156('0x16'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x1156('0x4')]('yes','no')},'mailbox':{'type':Sequelize[_0x1156('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x1156('0x27'),_0x1156('0x28'),_0x1156('0x29'))},'session_expires':{'type':Sequelize[_0x1156('0x26')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x1156('0x4')](_0x1156('0x2a'),_0x1156('0x2b')),'defaultValue':_0x1156('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x1156('0x2')]},'regexten':{'type':Sequelize[_0x1156('0x2')]},'fromdomain':{'type':Sequelize[_0x1156('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x1156('0x26')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x1156('0x16'),'no'),'defaultValue':_0x1156('0x16')},'keepalive':{'type':Sequelize[_0x1156('0x26')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x1156('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x1156('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0x1156('0x4')](_0x1156('0x16'),'no',_0x1156('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1156('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x1156('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0x1156('0x26')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x1156('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x1156('0x2')]},'use_q850_reason':{'type':Sequelize[_0x1156('0x2')]},'maxforwards':{'type':Sequelize[_0x1156('0x26')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x1156('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x1156('0x16'),'no')},'force_avp':{'type':Sequelize[_0x1156('0x4')](_0x1156('0x16'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x1156('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0x1156('0x4')](_0x1156('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0x1156('0x4')](_0x1156('0x16'),'no','fingerprint',_0x1156('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x1156('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0x1156('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x1156('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x1156('0x4')](_0x1156('0x2e'),_0x1156('0x2f'),_0x1156('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1156('0x2')]},'usereqphone':{'type':Sequelize[_0x1156('0x4')](_0x1156('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1156('0x2')]},'recordofffeature':{'type':Sequelize[_0x1156('0x2')]},'call_limit':{'type':Sequelize[_0x1156('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x1156('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0x1156('0x4')](_0x1156('0x16'),'no')},'vmexten':{'type':Sequelize[_0x1156('0x2')]},'mohinterpret':{'type':Sequelize[_0x1156('0x2')]},'mohsuggest':{'type':Sequelize[_0x1156('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1156('0x2')]},'host':{'type':Sequelize[_0x1156('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x1156('0x4')](_0x1156('0x16'),'no',_0x1156('0x17'),_0x1156('0x18'),_0x1156('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x1156('0x2')]},'otherFields':{'type':Sequelize[_0x1156('0x2')]},'active':{'type':Sequelize[_0x1156('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x1156('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 6201dd4..4848970 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 _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 +var _0xbec5=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','/etc/asterisk/sip_xcally_trunks.conf','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','Trunks','UserProfileResource','destroy','stack','name','send','map','Trunk','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','attributes','find','clone','get','omit','updatedAt','body','createdAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','join','server/files/templates/trunk.ejs','utf8'];(function(_0x4a21eb,_0x28988d){var _0x5702f4=function(_0xaf4e32){while(--_0xaf4e32){_0x4a21eb['push'](_0x4a21eb['shift']());}};_0x5702f4(++_0x28988d);}(_0xbec5,0xe5));var _0x5bec=function(_0x10dc64,_0x11bb29){_0x10dc64=_0x10dc64-0x0;var _0x9cf98d=_0xbec5[_0x10dc64];return _0x9cf98d;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];var jayson=require(_0x5bec('0x19'));var client=jayson['client'][_0x5bec('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xaa984d,_0x35393a,_0x6888a4,_0x3198e0){return new BPromise(function(_0xcd6d90,_0x24dcd6){var _0x43fd2a=_0x3198e0||client;return _0x43fd2a[_0x5bec('0x1b')](_0xaa984d,_0x6888a4)[_0x5bec('0x1c')](function(_0x31b9e4){logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,'request\x20sent');logger['debug'](_0x5bec('0x1f'),_0x35393a,_0x5bec('0x20'),JSON[_0x5bec('0x21')](_0x31b9e4));if(_0x31b9e4[_0x5bec('0x22')]){if(_0x31b9e4['error']['code']===0x1f4){logger[_0x5bec('0x22')](_0x5bec('0x1e'),_0x35393a,_0x31b9e4['error'][_0x5bec('0x23')]);return _0x24dcd6(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x31b9e4[_0x5bec('0x22')]['message']);return _0xcd6d90(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}else{logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,_0x5bec('0x20'));_0xcd6d90(_0x31b9e4['result'][_0x5bec('0x23')]);}})['catch'](function(_0x2b2d26){logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x2b2d26);_0x24dcd6(_0x2b2d26);});});}function respondWithStatusCode(_0xa414f8,_0xbef70b){_0xbef70b=_0xbef70b||0xcc;return function(_0x4e0ca2){if(_0x4e0ca2){return _0xa414f8[_0x5bec('0x24')](_0xbef70b);}return _0xa414f8[_0x5bec('0x25')](_0xbef70b)[_0x5bec('0x26')]();};}function respondWithResult(_0x20da89,_0x226d55){_0x226d55=_0x226d55||0xc8;return function(_0x131143){if(_0x131143){return _0x20da89[_0x5bec('0x25')](_0x226d55)['json'](_0x131143);}};}function respondWithFilteredResult(_0x5b63ab,_0x5e44b3){return function(_0x2961bd){if(_0x2961bd){var _0x2cdd2f=typeof _0x5e44b3[_0x5bec('0x27')]==='undefined'&&typeof _0x5e44b3[_0x5bec('0x28')]===_0x5bec('0x29');var _0x57331b=_0x2961bd[_0x5bec('0x2a')];var _0x63ac8=_0x2cdd2f?0x0:_0x5e44b3['offset'];var _0x5336b3=_0x2cdd2f?_0x2961bd[_0x5bec('0x2a')]:_0x5e44b3[_0x5bec('0x27')]+_0x5e44b3[_0x5bec('0x28')];var _0x2c7a7b;if(_0x5336b3>=_0x57331b){_0x5336b3=_0x57331b;_0x2c7a7b=0xc8;}else{_0x2c7a7b=0xce;}_0x5b63ab[_0x5bec('0x25')](_0x2c7a7b);return _0x5b63ab[_0x5bec('0x2b')]('Content-Range',_0x63ac8+'-'+_0x5336b3+'/'+_0x57331b)[_0x5bec('0x2c')](_0x2961bd);}return null;};}function patchUpdates(_0x59b5b6){return function(_0x45863b){try{jsonpatch[_0x5bec('0x2d')](_0x45863b,_0x59b5b6,!![]);}catch(_0x3034c9){return BPromise[_0x5bec('0x2e')](_0x3034c9);}return _0x45863b['save']();};}function saveUpdates(_0x2b42c8,_0x1aba46){return function(_0xfc7d41){if(_0xfc7d41){return _0xfc7d41['update'](_0x2b42c8)[_0x5bec('0x1c')](function(_0x4cfb89){return _0x4cfb89;});}return null;};}function removeEntity(_0x14cdbf,_0x207192){return function(_0x29df14){if(_0x29df14){return _0x29df14['destroy']()[_0x5bec('0x1c')](function(){var _0x420ad4=_0x29df14['get']({'plain':!![]});var _0x34b441=_0x5bec('0x2f');return db[_0x5bec('0x30')][_0x5bec('0x31')]({'where':{'type':_0x34b441,'resourceId':_0x420ad4['id']}})[_0x5bec('0x1c')](function(){return _0x29df14;});})['then'](function(){_0x14cdbf[_0x5bec('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3793,_0x384f04){return function(_0x182b86){if(!_0x182b86){_0x2d3793[_0x5bec('0x24')](0x194);}return _0x182b86;};}function handleError(_0x2e421e,_0x1923fc){_0x1923fc=_0x1923fc||0x1f4;return function(_0x49c8ef){logger[_0x5bec('0x22')](_0x49c8ef[_0x5bec('0x32')]);if(_0x49c8ef[_0x5bec('0x33')]){delete _0x49c8ef['name'];}_0x2e421e[_0x5bec('0x25')](_0x1923fc)[_0x5bec('0x34')](_0x49c8ef);};}exports['index']=function(_0xdb0430,_0x58c34e){var _0x400e22={},_0x2c0b08={},_0x402e5d={'count':0x0,'rows':[]};var _0x49cdfa=_[_0x5bec('0x35')](db[_0x5bec('0x36')][_0x5bec('0x37')],function(_0x139859){return{'name':_0x139859[_0x5bec('0x38')],'type':_0x139859[_0x5bec('0x39')][_0x5bec('0x3a')]};});_0x2c0b08['model']=_[_0x5bec('0x35')](_0x49cdfa,_0x5bec('0x33'));_0x2c0b08[_0x5bec('0x3b')]=_[_0x5bec('0x3c')](_0xdb0430['query']);_0x2c0b08[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],_0x2c0b08['query']);_0x400e22['attributes']=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x40')]));_0x400e22['attributes']=_0x400e22['attributes'][_0x5bec('0x41')]?_0x400e22['attributes']:_0x2c0b08[_0x5bec('0x3f')];if(!_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x42')]('nolimit')){_0x400e22[_0x5bec('0x28')]=qs[_0x5bec('0x28')](_0xdb0430['query'][_0x5bec('0x28')]);_0x400e22[_0x5bec('0x27')]=qs[_0x5bec('0x27')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x27')]);}_0x400e22[_0x5bec('0x43')]=qs[_0x5bec('0x44')](_0xdb0430['query']['sort']);_0x400e22[_0x5bec('0x45')]=qs['filters'](_['pick'](_0xdb0430[_0x5bec('0x3b')],_0x2c0b08['filters']),_0x49cdfa);if(_0xdb0430['query']['filter']){_0x400e22[_0x5bec('0x45')]=_[_0x5bec('0x46')](_0x400e22[_0x5bec('0x45')],{'$or':_[_0x5bec('0x35')](_0x49cdfa,function(_0x48858a){if(_0x48858a[_0x5bec('0x39')]!==_0x5bec('0x47')){var _0xa4d32={};_0xa4d32[_0x48858a[_0x5bec('0x33')]]={'$like':'%'+_0xdb0430['query'][_0x5bec('0x48')]+'%'};return _0xa4d32;}})});}_0x400e22=_[_0x5bec('0x46')]({},_0x400e22,_0xdb0430[_0x5bec('0x49')]);var _0x51a3f9={'where':_0x400e22[_0x5bec('0x45')]};return db['Trunk'][_0x5bec('0x2a')](_0x51a3f9)[_0x5bec('0x1c')](function(_0x133d5c){_0x402e5d[_0x5bec('0x2a')]=_0x133d5c;if(_0xdb0430['query'][_0x5bec('0x4a')]){_0x400e22[_0x5bec('0x4b')]=[{'all':!![]}];}return db[_0x5bec('0x36')][_0x5bec('0x4c')](_0x400e22);})[_0x5bec('0x1c')](function(_0x123758){_0x402e5d[_0x5bec('0x4d')]=_0x123758;return _0x402e5d;})['then'](respondWithFilteredResult(_0x58c34e,_0x400e22))[_0x5bec('0x4e')](handleError(_0x58c34e,null));};exports[_0x5bec('0x4f')]=function(_0x5775ca,_0x273e09){var _0x3e6180={'raw':![],'where':{'id':_0x5775ca[_0x5bec('0x50')]['id']}},_0x34ee24={};_0x34ee24[_0x5bec('0x3f')]=_[_0x5bec('0x3c')](db[_0x5bec('0x36')]['rawAttributes']);_0x34ee24[_0x5bec('0x3b')]=_['keys'](_0x5775ca[_0x5bec('0x3b')]);_0x34ee24[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],_0x34ee24[_0x5bec('0x3b')]);_0x3e6180[_0x5bec('0x51')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0x5775ca[_0x5bec('0x3b')]['fields']));_0x3e6180[_0x5bec('0x51')]=_0x3e6180['attributes']['length']?_0x3e6180[_0x5bec('0x51')]:_0x34ee24['model'];if(_0x5775ca['query'][_0x5bec('0x4a')]){_0x3e6180[_0x5bec('0x4b')]=[{'all':!![]}];}_0x3e6180=_[_0x5bec('0x46')]({},_0x3e6180,_0x5775ca['options']);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0x3e6180)[_0x5bec('0x1c')](handleEntityNotFound(_0x273e09,null))[_0x5bec('0x1c')](respondWithResult(_0x273e09,null))['catch'](handleError(_0x273e09,null));};exports[_0x5bec('0x53')]=function(_0x209da3,_0x9cae50){var _0xc8563a={'where':{'id':_0x209da3[_0x5bec('0x50')]['id']}},_0x2f736c={};_0x2f736c[_0x5bec('0x3f')]=_['keys'](db['Trunk'][_0x5bec('0x37')]);_0xc8563a['attributes']=_[_0x5bec('0x3e')](_0x2f736c[_0x5bec('0x3f')],qs['fields'](_0x209da3[_0x5bec('0x3b')]['fields']));_0xc8563a[_0x5bec('0x51')]=_0xc8563a[_0x5bec('0x51')][_0x5bec('0x41')]?_0xc8563a[_0x5bec('0x51')]:_0x2f736c[_0x5bec('0x3f')];if(_0x209da3[_0x5bec('0x3b')][_0x5bec('0x4a')]){_0xc8563a[_0x5bec('0x4b')]=[{'all':!![]}];}_0xc8563a=_[_0x5bec('0x46')]({},_0xc8563a,_0x209da3[_0x5bec('0x49')]);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0xc8563a)[_0x5bec('0x1c')](handleEntityNotFound(_0x9cae50,null))[_0x5bec('0x1c')](function(_0x51b25d){if(_0x51b25d){var _0x2e33a7=_0x51b25d[_0x5bec('0x54')]({'plain':!![]});_0x2e33a7=qs[_0x5bec('0x55')](_0x2e33a7,['id','createdAt',_0x5bec('0x56')]);_0x209da3[_0x5bec('0x57')]=_[_0x5bec('0x55')](_0x209da3[_0x5bec('0x57')],['id',_0x5bec('0x58'),'updatedAt']);return db[_0x5bec('0x36')][_0x5bec('0x59')](_[_0x5bec('0x46')](_0x2e33a7,_0x209da3[_0x5bec('0x57')]),{'include':_0x209da3['query'][_0x5bec('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x2b701f){var _0x38deb0=_0x209da3[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0x38deb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38deb0[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x1b3c40=_0x2b701f[_0x5bec('0x54')]({'plain':!![]});var _0xc3e3df=_0x5bec('0x2f');return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0xc3e3df,'userProfileId':_0x38deb0[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0xfa751f){if(_0xfa751f&&_0xfa751f[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x1b3c40[_0x5bec('0x33')],'resourceId':_0x1b3c40['id'],'type':_0xfa751f['name'],'sectionId':_0xfa751f['id']},{})[_0x5bec('0x1c')](function(){return _0x2b701f;});}else{return _0x2b701f;}})[_0x5bec('0x4e')](function(_0x4e899c){logger[_0x5bec('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e899c);throw _0x4e899c;});}return _0x2b701f;});}})[_0x5bec('0x1c')](respondWithResult(_0x9cae50,0xc9))[_0x5bec('0x4e')](handleError(_0x9cae50,null));};exports['create']=function(_0x5a2a85,_0xd54be0,_0xcac51d){var _0xb6cf85;return db[_0x5bec('0x36')][_0x5bec('0x59')](_0x5a2a85['body'],{'raw':!![]})[_0x5bec('0x1c')](function(_0x39cb06){_0xb6cf85=_0x39cb06;return db['Trunk'][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x44a945){var _0x34f31c=fs['readFileSync'](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),_0x5bec('0x61'));var _0x3ede1d=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x1ee139=ejs[_0x5bec('0x65')](_0x34f31c,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ee139);if(_0xb6cf85['registry']){var _0x3c305e=ejs[_0x5bec('0x65')](_0x3ede1d,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0x3c305e);}})[_0x5bec('0x1c')](function(){return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x59'),{'module':'chan_sip.so'});})['then'](function(){var _0xc81e8f=_0x5a2a85[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0xc81e8f)throw new Error(_0x5bec('0x69'));if(_0xc81e8f[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x17cd00=_0xb6cf85[_0x5bec('0x54')]({'plain':!![]});return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0x5bec('0x2f'),'userProfileId':_0xc81e8f[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0x325044){if(_0x325044&&_0x325044[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x17cd00[_0x5bec('0x33')],'resourceId':_0x17cd00['id'],'type':_0x325044[_0x5bec('0x33')],'sectionId':_0x325044['id']},{})[_0x5bec('0x1c')](function(){return _0xb6cf85;});}else{return _0xb6cf85;}})['catch'](function(_0x2e76c0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e76c0);throw _0x2e76c0;});}return _0xb6cf85;})[_0x5bec('0x1c')](respondWithResult(_0xd54be0,0xc9))['catch'](handleError(_0xd54be0,null));};exports[_0x5bec('0x6a')]=function(_0x5d6af3,_0x5ca280,_0x2e849b){var _0x1b5ec0;return db['Trunk'][_0x5bec('0x52')]({'where':{'id':_0x5d6af3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x5ca280,null))[_0x5bec('0x1c')](saveUpdates(_0x5d6af3[_0x5bec('0x57')],null))[_0x5bec('0x1c')](function(_0xb76af2){if(_0xb76af2){_0x1b5ec0=_0xb76af2;return db[_0x5bec('0x36')]['findAll']({'raw':!![]});}})['then'](function(_0x2e8cd3){if(_0x2e8cd3){var _0x122c7f=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),'utf8');var _0x44ceec=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x38be2d=ejs[_0x5bec('0x65')](_0x122c7f,{'trunks':_0x2e8cd3||[]});fs['writeFileSync'](_0x5bec('0x6b'),_0x38be2d);var _0xe5f9e5=ejs[_0x5bec('0x65')](_0x44ceec,{'trunks':_0x2e8cd3||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0xe5f9e5);return respondWithRpcPromise('Reload',_0x5bec('0x6a'),{'module':_0x5bec('0x6c')});}return null;})['then'](function(_0x195c12){if(_0x195c12){return _0x1b5ec0;}})['then'](respondWithResult(_0x5ca280,null))[_0x5bec('0x4e')](handleError(_0x5ca280,null));};exports[_0x5bec('0x31')]=function(_0x4646a3,_0x313e1c,_0x437c3e){var _0x3d7600;return db[_0x5bec('0x36')][_0x5bec('0x52')]({'where':{'id':_0x4646a3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x313e1c,null))[_0x5bec('0x1c')](removeEntity(_0x313e1c,null))[_0x5bec('0x1c')](function(){return db[_0x5bec('0x36')][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x1eaf2f){var _0x317e2a=fs[_0x5bec('0x62')](path['join'](config[_0x5bec('0x63')],'server/files/templates/trunk.ejs'),_0x5bec('0x61'));var _0xfcef92=fs['readFileSync'](path['join'](config[_0x5bec('0x63')],'server/files/templates/registry.ejs'),_0x5bec('0x61'));var _0x4b70df=ejs[_0x5bec('0x65')](_0x317e2a,{'trunks':_0x1eaf2f});var _0x27b40b=ejs['render'](_0xfcef92,{'trunks':_0x1eaf2f});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4b70df);fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_registers.conf',_0x27b40b);return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x31'),{'module':'chan_sip.so'});})[_0x5bec('0x4e')](handleError(_0x313e1c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index b597f44..fc7de33 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 _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 +var _0xb163=['tools_trunks','lodash','api','moment','bluebird','path','rimraf','./trunk.attributes','exports','define','Trunk'];(function(_0x727b33,_0x684869){var _0xe69eee=function(_0x51da3c){while(--_0x51da3c){_0x727b33['push'](_0x727b33['shift']());}};_0xe69eee(++_0x684869);}(_0xb163,0x135));var _0x3b16=function(_0x1b2414,_0x294d27){_0x1b2414=_0x1b2414-0x0;var _0x2e9886=_0xb163[_0x1b2414];return _0x2e9886;};'use strict';var _=require(_0x3b16('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3b16('0x1'));var moment=require(_0x3b16('0x2'));var BPromise=require(_0x3b16('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b16('0x4'));var rimraf=require(_0x3b16('0x5'));var config=require('../../config/environment');var attributes=require(_0x3b16('0x6'));module[_0x3b16('0x7')]=function(_0xa3f444,_0x29fca8){return _0xa3f444[_0x3b16('0x8')](_0x3b16('0x9'),attributes,{'tableName':_0x3b16('0xa'),'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 277f807..c683e7c 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 _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 +var _0x6682=['then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','include','map','model','find','ShowTrunk','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x4729b6,_0x1ba372){var _0x4ccc0b=function(_0x121280){while(--_0x121280){_0x4729b6['push'](_0x4729b6['shift']());}};_0x4ccc0b(++_0x1ba372);}(_0x6682,0xe2));var _0x2668=function(_0x2148e2,_0x43989c){_0x2148e2=_0x2148e2-0x0;var _0x1de357=_0x6682[_0x2148e2];return _0x1de357;};'use strict';var _=require(_0x2668('0x0'));var util=require(_0x2668('0x1'));var moment=require(_0x2668('0x2'));var BPromise=require(_0x2668('0x3'));var rs=require(_0x2668('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2668('0x5'))['db'];var utils=require(_0x2668('0x6'));var logger=require('../../config/logger')(_0x2668('0x7'));var config=require(_0x2668('0x8'));var jayson=require(_0x2668('0x9'));var client=jayson[_0x2668('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d883e,_0xb425cb,_0x246655){return new BPromise(function(_0x198ebe,_0x3bd5b9){return client[_0x2668('0xb')](_0x5d883e,_0x246655)[_0x2668('0xc')](function(_0x4ab7c8){logger['info'](_0x2668('0xd'),_0xb425cb,_0x2668('0xe'));logger[_0x2668('0xf')](_0x2668('0x10'),_0xb425cb,_0x2668('0xe'),JSON[_0x2668('0x11')](_0x4ab7c8));if(_0x4ab7c8['error']){if(_0x4ab7c8[_0x2668('0x12')]['code']===0x1f4){logger[_0x2668('0x12')](_0x2668('0xd'),_0xb425cb,_0x4ab7c8[_0x2668('0x12')][_0x2668('0x13')]);return _0x3bd5b9(_0x4ab7c8['error'][_0x2668('0x13')]);}logger[_0x2668('0x12')](_0x2668('0xd'),_0xb425cb,_0x4ab7c8[_0x2668('0x12')]['message']);return _0x198ebe(_0x4ab7c8[_0x2668('0x12')][_0x2668('0x13')]);}else{logger[_0x2668('0x14')]('Trunk,\x20%s,\x20%s',_0xb425cb,_0x2668('0xe'));_0x198ebe(_0x4ab7c8['result'][_0x2668('0x13')]);}})[_0x2668('0x15')](function(_0x1ceb5c){logger[_0x2668('0x12')](_0x2668('0xd'),_0xb425cb,_0x1ceb5c);_0x3bd5b9(_0x1ceb5c);});});}exports[_0x2668('0x16')]=function(_0x235756){var _0x56e6ee=this;return new Promise(function(_0x4d898e,_0x36476f){return db[_0x2668('0x17')][_0x2668('0x18')]({'raw':_0x235756[_0x2668('0x19')]?_0x235756[_0x2668('0x19')][_0x2668('0x1a')]===undefined?!![]:![]:!![],'where':_0x235756[_0x2668('0x19')]?_0x235756['options'][_0x2668('0x1b')]||null:null,'attributes':_0x235756['options']?_0x235756['options'][_0x2668('0x1c')]||null:null,'limit':_0x235756[_0x2668('0x19')]?_0x235756['options']['limit']||null:null,'include':_0x235756[_0x2668('0x19')]?_0x235756[_0x2668('0x19')][_0x2668('0x1d')]?_[_0x2668('0x1e')](_0x235756[_0x2668('0x19')][_0x2668('0x1d')],function(_0x57fe7c){return{'model':db[_0x57fe7c[_0x2668('0x1f')]],'as':_0x57fe7c['as'],'attributes':_0x57fe7c[_0x2668('0x1c')],'include':_0x57fe7c[_0x2668('0x1d')]?_[_0x2668('0x1e')](_0x57fe7c['include'],function(_0x44b837){return{'model':db[_0x44b837[_0x2668('0x1f')]],'as':_0x44b837['as'],'attributes':_0x44b837[_0x2668('0x1c')],'include':_0x44b837['include']?_[_0x2668('0x1e')](_0x44b837[_0x2668('0x1d')],function(_0x18a847){return{'model':db[_0x18a847[_0x2668('0x1f')]],'as':_0x18a847['as'],'attributes':_0x18a847[_0x2668('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2668('0xc')](function(_0xf58e09){logger['info']('GetTrunk',_0x235756);logger['debug'](_0x2668('0x16'),_0x235756,JSON[_0x2668('0x11')](_0xf58e09));_0x4d898e(_0xf58e09);})['catch'](function(_0x14f066){logger['error'](_0x2668('0x16'),_0x14f066[_0x2668('0x13')],_0x235756);_0x36476f(_0x56e6ee['error'](0x1f4,_0x14f066[_0x2668('0x13')]));});});};exports['ShowTrunk']=function(_0x50147e){var _0xa42d2e=this;return new Promise(function(_0x45d563,_0x8baafb){return db[_0x2668('0x17')][_0x2668('0x20')]({'raw':_0x50147e['options']?_0x50147e['options'][_0x2668('0x1a')]===undefined?!![]:![]:!![],'where':_0x50147e[_0x2668('0x19')]?_0x50147e[_0x2668('0x19')][_0x2668('0x1b')]||null:null,'attributes':_0x50147e[_0x2668('0x19')]?_0x50147e[_0x2668('0x19')][_0x2668('0x1c')]||null:null,'include':_0x50147e[_0x2668('0x19')]?_0x50147e['options'][_0x2668('0x1d')]?_['map'](_0x50147e['options'][_0x2668('0x1d')],function(_0x628e6b){return{'model':db[_0x628e6b[_0x2668('0x1f')]],'as':_0x628e6b['as'],'attributes':_0x628e6b['attributes'],'include':_0x628e6b['include']?_[_0x2668('0x1e')](_0x628e6b[_0x2668('0x1d')],function(_0x299ad9){return{'model':db[_0x299ad9[_0x2668('0x1f')]],'as':_0x299ad9['as'],'attributes':_0x299ad9[_0x2668('0x1c')],'include':_0x299ad9[_0x2668('0x1d')]?_['map'](_0x299ad9[_0x2668('0x1d')],function(_0x5a07c3){return{'model':db[_0x5a07c3['model']],'as':_0x5a07c3['as'],'attributes':_0x5a07c3[_0x2668('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2668('0xc')](function(_0x25b0df){logger['info']('ShowTrunk',_0x50147e);logger[_0x2668('0xf')](_0x2668('0x21'),_0x50147e,JSON['stringify'](_0x25b0df));_0x45d563(_0x25b0df);})['catch'](function(_0x7854d8){logger['error']('ShowTrunk',_0x7854d8[_0x2668('0x13')],_0x50147e);_0x8baafb(_0xa42d2e['error'](0x1f4,_0x7854d8['message']));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index c4cedc4..b618d36 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 _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 +var _0x487b=['../../components/auth/service','put','/:id','isAuthenticated','update','exports','express'];(function(_0xc2688f,_0x1f2382){var _0x5175b5=function(_0x546bdc){while(--_0x546bdc){_0xc2688f['push'](_0xc2688f['shift']());}};_0x5175b5(++_0x1f2382);}(_0x487b,0x172));var _0xb487=function(_0xb99646,_0x5546f3){_0xb99646=_0xb99646-0x0;var _0x439ed7=_0x487b[_0xb99646];return _0x439ed7;};'use strict';var express=require(_0xb487('0x0'));var router=express['Router']();var auth=require(_0xb487('0x1'));var controller=require('./user-setting.controller');router[_0xb487('0x2')](_0xb487('0x3'),auth[_0xb487('0x4')](),controller[_0xb487('0x5')]);module[_0xb487('0x6')]=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 68a26de..8429577 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 _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 +var _0xa578=['info','exports','ENUM','BOOLEAN','TEXT','DATE','UserId','sequelize','error'];(function(_0x4c750c,_0x3614ab){var _0x5d4cb8=function(_0x175dd1){while(--_0x175dd1){_0x4c750c['push'](_0x4c750c['shift']());}};_0x5d4cb8(++_0x3614ab);}(_0xa578,0x142));var _0x8a57=function(_0x2cc2f7,_0x9a53fd){_0x2cc2f7=_0x2cc2f7-0x0;var _0x17cfcf=_0xa578[_0x2cc2f7];return _0x17cfcf;};'use strict';var Sequelize=require(_0x8a57('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x8a57('0x1'),'warning',_0x8a57('0x2'),'debug'];module[_0x8a57('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0x8a57('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x8a57('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x8a57('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x8a57('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0x8a57('0x8')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 00eca46..712843a 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 _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 +var _0x9bde=['stack','name','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','ioredis','api','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','status','json','update','then','sendStatus','error'];(function(_0x592196,_0x50c878){var _0x54825b=function(_0x42ff0d){while(--_0x42ff0d){_0x592196['push'](_0x592196['shift']());}};_0x54825b(++_0x50c878);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4d2264,_0x70a1a9){_0x4d2264=_0x4d2264-0x0;var _0x3bb64c=_0x9bde[_0x4d2264];return _0x3bb64c;};'use strict';var _=require('lodash');var Redis=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var config=require('../../config/environment');var db=require(_0xe9bd('0x2'))['db'];var socket=require(_0xe9bd('0x3'))(new Redis(config[_0xe9bd('0x4')]));require(_0xe9bd('0x5'))[_0xe9bd('0x6')](socket);config[_0xe9bd('0x4')]=_[_0xe9bd('0x7')](config['redis'],{'host':_0xe9bd('0x8'),'port':0x18eb});function respondWithResult(_0x5f18fe,_0x22a438){_0x22a438=_0x22a438||0xc8;return function(_0xa66ae2){if(_0xa66ae2){return _0x5f18fe[_0xe9bd('0x9')](_0x22a438)[_0xe9bd('0xa')](_0xa66ae2);}};}function saveUpdates(_0x29bc2b){return function(_0xbefddb){if(_0xbefddb){return _0xbefddb[_0xe9bd('0xb')](_0x29bc2b)[_0xe9bd('0xc')](function(_0x581602){return _0x581602;});}return null;};}function handleEntityNotFound(_0x5f36c8){return function(_0x3c8e95){if(!_0x3c8e95){_0x5f36c8[_0xe9bd('0xd')](0x194);}return _0x3c8e95;};}function handleError(_0x2601ac,_0x581ab9){_0x581ab9=_0x581ab9||0x1f4;return function(_0x12c96e){logger[_0xe9bd('0xe')](_0x12c96e[_0xe9bd('0xf')]);if(_0x12c96e[_0xe9bd('0x10')]){delete _0x12c96e['name'];}_0x2601ac[_0xe9bd('0x9')](_0x581ab9)['send'](_0x12c96e);};}exports[_0xe9bd('0xb')]=function(_0x429e88,_0x3435b4){if(_0x429e88['user']['role']!==_0xe9bd('0x11'))throw new Error(_0xe9bd('0x12'));if(isNaN(Number(_0x429e88[_0xe9bd('0x13')]['id'])))throw new Error(_0xe9bd('0x14'));return db[_0xe9bd('0x15')][_0xe9bd('0x16')]({'where':{'id':_0x429e88[_0xe9bd('0x13')]['id']}})['then'](handleEntityNotFound(_0x3435b4,null))[_0xe9bd('0xc')](saveUpdates(_0x429e88[_0xe9bd('0x17')],null))[_0xe9bd('0xc')](respondWithResult(_0x3435b4,null))['catch'](handleError(_0x3435b4,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 d6c7fd2..5edc199 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 _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 +var _0x4ea1=['setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb','UserSetting'];(function(_0x4c207b,_0x59f530){var _0x560c4f=function(_0x289669){while(--_0x289669){_0x4c207b['push'](_0x4c207b['shift']());}};_0x560c4f(++_0x59f530);}(_0x4ea1,0xd5));var _0x14ea=function(_0x126006,_0x29d087){_0x126006=_0x126006-0x0;var _0x4df414=_0x4ea1[_0x126006];return _0x4df414;};'use strict';var EventEmitter=require(_0x14ea('0x0'));var UserSetting=require(_0x14ea('0x1'))['db'][_0x14ea('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x14ea('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x14ea('0x4'),'afterDestroy':_0x14ea('0x5')};function emitEvent(_0x39ca96){return function(_0x2ce945,_0x1669fb,_0xeb4d5c){UserSettingEvents[_0x14ea('0x6')](_0x39ca96+':'+_0x2ce945['id'],_0x2ce945);UserSettingEvents['emit'](_0x39ca96,_0x2ce945);_0xeb4d5c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x14ea('0x7')](e,emitEvent(event));}}module[_0x14ea('0x8')]=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 1da5e08..48706e1 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 _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 +var _0x9348=['exports','define','UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x4578e7,_0x1c72a2){var _0x3db768=function(_0x58a4ed){while(--_0x58a4ed){_0x4578e7['push'](_0x4578e7['shift']());}};_0x3db768(++_0x1c72a2);}(_0x9348,0x10d));var _0x8934=function(_0x398f0d,_0x5150f8){_0x398f0d=_0x398f0d-0x0;var _0x1c9e8f=_0x9348[_0x398f0d];return _0x1c9e8f;};'use strict';var attributes=require(_0x8934('0x0'));module[_0x8934('0x1')]=function(_0x472223){return _0x472223[_0x8934('0x2')](_0x8934('0x3'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x34d032){if(!_0x34d032[_0x8934('0x4')])_0x34d032['clientSideLoggingEnabledSince']=null;else if(_0x34d032[_0x8934('0x5')]===null)_0x34d032[_0x8934('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 8c1473b..a75c9f9 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 _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 +var _0xb583=['UserId','user-setting:','./user-setting.events','save','update','emit','user-setting:update','user-setting:update:user-'];(function(_0x795d1d,_0x2a06df){var _0x260dca=function(_0x12ce5f){while(--_0x12ce5f){_0x795d1d['push'](_0x795d1d['shift']());}};_0x260dca(++_0x2a06df);}(_0xb583,0x1b2));var _0x3b58=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb583[_0x5b644e];return _0x49c6bf;};'use strict';var UserSettingEvents=require(_0x3b58('0x0'));var events=[_0x3b58('0x1'),'remove',_0x3b58('0x2')];function createListener(_0x1b725b,_0x100daf){return function(_0x34cc1b){_0x100daf[_0x3b58('0x3')](_0x1b725b,_0x34cc1b);if(_0x1b725b===_0x3b58('0x4')){_0x100daf[_0x3b58('0x3')](_0x3b58('0x5')+_0x34cc1b[_0x3b58('0x6')],_0x34cc1b);}};}exports['register']=function(_0x35ef44){for(var _0x1deb2e=0x0,_0x57de69=events['length'];_0x1deb2e<_0x57de69;_0x1deb2e++){var _0x1d44ff=events[_0x1deb2e];var _0x1eb9f5=createListener(_0x3b58('0x7')+_0x1d44ff,_0x35ef44);UserSettingEvents['on'](_0x1d44ff,_0x1eb9f5);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 6f00ee1..192a4b6 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 _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 +var _0xfb3f=['removeSmsInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','removeApiKey','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','show','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getLists','/:id/agents','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','addContacts','/create_many','addQueues','join','server/files/images/','format','%s-%s','now','originalname','/:id/avatar','single','file','addAvatar','/:id/login','login','/:id/logout','logout','pause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addMailAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','removeTeams','delete','destroy','removeChatInteractions','/:id/fax_interactions'];(function(_0x223e5,_0x2cfbe8){var _0x49c76f=function(_0x2780b5){while(--_0x2780b5){_0x223e5['push'](_0x223e5['shift']());}};_0x49c76f(++_0x2cfbe8);}(_0xfb3f,0xd9));var _0xffb3=function(_0x4ffd5d,_0x13f96f){_0x4ffd5d=_0x4ffd5d-0x0;var _0x2ff70f=_0xfb3f[_0x4ffd5d];return _0x2ff70f;};'use strict';var multer=require(_0xffb3('0x0'));var util=require(_0xffb3('0x1'));var path=require('path');var timeout=require(_0xffb3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xffb3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xffb3('0x4'));var config=require(_0xffb3('0x5'));var controller=require(_0xffb3('0x6'));router[_0xffb3('0x7')]('/',auth[_0xffb3('0x8')](),controller[_0xffb3('0x9')]);router[_0xffb3('0x7')](_0xffb3('0xa'),auth['isAuthenticated'](),controller[_0xffb3('0xb')]);router[_0xffb3('0x7')](_0xffb3('0xc'),auth[_0xffb3('0x8')](),controller[_0xffb3('0xd')]);router['get'](_0xffb3('0xe'),auth[_0xffb3('0x8')](),controller[_0xffb3('0xf')]);router[_0xffb3('0x7')](_0xffb3('0x10'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x11')]);router[_0xffb3('0x7')]('/:id/avatar',controller[_0xffb3('0x12')]);router[_0xffb3('0x7')]('/:id/open_tabs',auth[_0xffb3('0x8')](),controller[_0xffb3('0x13')]);router[_0xffb3('0x7')](_0xffb3('0x14'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x15')]);router[_0xffb3('0x7')](_0xffb3('0x16'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x17')]);router[_0xffb3('0x7')](_0xffb3('0x18'),auth['isAuthenticated'](),controller[_0xffb3('0x19')]);router[_0xffb3('0x7')](_0xffb3('0x1a'),auth['isAuthenticated'](),controller['getGroups']);router[_0xffb3('0x7')](_0xffb3('0x1b'),auth['isAuthenticated'](),controller[_0xffb3('0x1c')]);router[_0xffb3('0x7')](_0xffb3('0x1d'),auth['isAuthenticated'](),controller[_0xffb3('0x1e')]);router[_0xffb3('0x7')]('/:id/chat/interactions',auth[_0xffb3('0x8')](),controller[_0xffb3('0x1f')]);router[_0xffb3('0x7')](_0xffb3('0x20'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x21')]);router[_0xffb3('0x7')]('/:id/mail/interactions',auth[_0xffb3('0x8')](),controller[_0xffb3('0x22')]);router['get'](_0xffb3('0x23'),auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0xffb3('0x7')](_0xffb3('0x24'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x25')]);router[_0xffb3('0x7')](_0xffb3('0x26'),auth['isAuthenticated'](),controller[_0xffb3('0x27')]);router['get'](_0xffb3('0x28'),auth[_0xffb3('0x8')](),controller['getTeams']);router[_0xffb3('0x7')]('/:id/lists',auth[_0xffb3('0x8')](),controller[_0xffb3('0x29')]);router[_0xffb3('0x7')](_0xffb3('0x2a'),auth['isAuthenticated'](),controller['getAgents']);router['get']('/:id/prefixes',auth[_0xffb3('0x8')](),controller['getVoicePrefixes']);router[_0xffb3('0x7')](_0xffb3('0x2b'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x2c')]);router['get'](_0xffb3('0x2d'),auth[_0xffb3('0x8')](),controller['getMailAccounts']);router[_0xffb3('0x7')](_0xffb3('0x2e'),auth[_0xffb3('0x8')](),controller['getOpenchannelAccounts']);router[_0xffb3('0x7')](_0xffb3('0x2f'),auth[_0xffb3('0x8')](),controller['getSmsAccounts']);router[_0xffb3('0x7')](_0xffb3('0x30'),auth['isAuthenticated'](),controller[_0xffb3('0x31')]);router[_0xffb3('0x7')](_0xffb3('0x32'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x33')]);router['get'](_0xffb3('0x34'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x35')]);router['get'](_0xffb3('0x36'),auth[_0xffb3('0x8')](),controller['getApiKey']);router[_0xffb3('0x37')](_0xffb3('0x14'),auth['isAuthenticated'](),controller[_0xffb3('0x38')]);router[_0xffb3('0x37')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xffb3('0x39'),auth[_0xffb3('0x8')](),controller['bulkCreate']);router[_0xffb3('0x37')]('/:id/queues',auth[_0xffb3('0x8')](),controller[_0xffb3('0x3a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xbe01ca,_0x562740,_0x20a558){_0x20a558(null,path[_0xffb3('0x3b')](config['root'],_0xffb3('0x3c')));},'filename':function(_0x42ef03,_0x2ff1b1,_0x153457){_0x153457(null,util[_0xffb3('0x3d')](_0xffb3('0x3e'),Date[_0xffb3('0x3f')](),_0x2ff1b1[_0xffb3('0x40')]));}})});router[_0xffb3('0x37')](_0xffb3('0x41'),upload[_0xffb3('0x42')](_0xffb3('0x43')),controller[_0xffb3('0x44')]);router['post'](_0xffb3('0x45'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x46')]);router['post'](_0xffb3('0x47'),auth['isAuthenticated'](),controller[_0xffb3('0x48')]);router[_0xffb3('0x37')]('/:id/pause',auth[_0xffb3('0x8')](),controller[_0xffb3('0x49')]);router['post']('/:id/unpause',auth[_0xffb3('0x8')](),controller[_0xffb3('0x4a')]);router['post'](_0xffb3('0x28'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x4b')]);router[_0xffb3('0x37')](_0xffb3('0x4c'),auth['isAuthenticated'](),controller[_0xffb3('0x4d')]);router[_0xffb3('0x37')](_0xffb3('0x4e'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x4f')]);router['post']('/:id/fax_interactions',auth[_0xffb3('0x8')](),controller[_0xffb3('0x50')]);router['post'](_0xffb3('0x51'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x52')]);router[_0xffb3('0x37')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0xffb3('0x53')]);router[_0xffb3('0x37')](_0xffb3('0x54'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x55')]);router[_0xffb3('0x37')]('/:id/fax_accounts',auth[_0xffb3('0x8')](),controller['addFaxAccounts']);router[_0xffb3('0x37')](_0xffb3('0x2d'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x56')]);router['post']('/:id/openchannel_accounts',auth[_0xffb3('0x8')](),controller['addOpenchannelAccounts']);router[_0xffb3('0x37')](_0xffb3('0x2f'),auth[_0xffb3('0x8')](),controller['addSmsAccounts']);router[_0xffb3('0x37')](_0xffb3('0x30'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x57')]);router[_0xffb3('0x37')]('/:id/whatsapp_accounts',auth[_0xffb3('0x8')](),controller[_0xffb3('0x58')]);router[_0xffb3('0x37')]('/:id/api_key',auth[_0xffb3('0x8')](),controller[_0xffb3('0x59')]);router[_0xffb3('0x5a')]('/:id',auth[_0xffb3('0x8')](),controller[_0xffb3('0x5b')]);router[_0xffb3('0x5a')](_0xffb3('0x5c'),auth['isAuthenticated'](),controller['changePassword']);router['delete']('/:id/queues',auth[_0xffb3('0x8')](),controller['removeQueues']);router['delete'](_0xffb3('0x28'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x5d')]);router[_0xffb3('0x5e')](_0xffb3('0x10'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x5f')]);router['delete'](_0xffb3('0x4c'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x60')]);router[_0xffb3('0x5e')](_0xffb3('0x4e'),auth[_0xffb3('0x8')](),controller['removeMailInteractions']);router[_0xffb3('0x5e')](_0xffb3('0x61'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0xffb3('0x5e')]('/:id/sms_interactions',auth[_0xffb3('0x8')](),controller[_0xffb3('0x62')]);router[_0xffb3('0x5e')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0xffb3('0x5e')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router[_0xffb3('0x5e')](_0xffb3('0x2b'),auth[_0xffb3('0x8')](),controller['removeFaxAccounts']);router[_0xffb3('0x5e')]('/:id/mail_accounts',auth[_0xffb3('0x8')](),controller[_0xffb3('0x63')]);router['delete'](_0xffb3('0x2e'),auth[_0xffb3('0x8')](),controller[_0xffb3('0x64')]);router[_0xffb3('0x5e')]('/:id/sms_accounts',auth[_0xffb3('0x8')](),controller[_0xffb3('0x65')]);router[_0xffb3('0x5e')]('/:id/chat_websites',auth['isAuthenticated'](),controller['removeChatWebsites']);router[_0xffb3('0x5e')](_0xffb3('0x32'),auth['isAuthenticated'](),controller[_0xffb3('0x66')]);router[_0xffb3('0x5e')]('/:id/api_key',auth[_0xffb3('0x8')](),controller[_0xffb3('0x67')]);module[_0xffb3('0x68')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 51c898e..e633c7d 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 _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 +var _0x34e8=['isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','avpf','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','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]','rfc2833','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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','actpass','update,nonat','TEXT','showWebBar','get'];(function(_0x59c160,_0x3f143c){var _0x10de43=function(_0x4be0f3){while(--_0x4be0f3){_0x59c160['push'](_0x59c160['shift']());}};_0x10de43(++_0x3f143c);}(_0x34e8,0x12c));var _0x834e=function(_0x5518e9,_0x30ca01){_0x5518e9=_0x5518e9-0x0;var _0x70fbd8=_0x34e8[_0x5518e9];return _0x70fbd8;};'use strict';var Sequelize=require(_0x834e('0x0'));var moment=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var _=require(_0x834e('0x3'));module['exports']={'name':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x472111){this[_0x834e('0x6')](_0x834e('0x5'),_0x472111);this[_0x834e('0x6')](_0x834e('0x7'),_0x472111);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'set':function(_0x52056d){this[_0x834e('0x6')](_0x834e('0x8'),_0x52056d);this[_0x834e('0x6')](_0x834e('0x9'),util[_0x834e('0xa')](_0x834e('0xb'),_0x52056d,this[_0x834e('0xc')](_0x834e('0xd'))));}},'alias':{'type':Sequelize[_0x834e('0x4')]},'email':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0xe'),'validate':{'isEmail':!![]},'set':function(_0x36e124){if(_0x36e124){this[_0x834e('0x6')](_0x834e('0xe'),_0x36e124[_0x834e('0xf')]());}}},'role':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x11'),'user',_0x834e('0x12'),_0x834e('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x834e('0x4')],'defaultValue':_0x834e('0x14')},'internal':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':![],'unique':_0x834e('0xd'),'set':function(_0x50e860){this[_0x834e('0x6')](_0x834e('0xd'),_0x50e860);this['setDataValue'](_0x834e('0x16'),_0x50e860);this['setDataValue'](_0x834e('0x9'),util[_0x834e('0xa')]('\x22%s\x22\x20<%s>',this[_0x834e('0xc')](_0x834e('0x8')),_0x50e860));}},'salt':{'type':Sequelize[_0x834e('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x834e('0x4')]},'address':{'type':Sequelize[_0x834e('0x4')]},'zipcode':{'type':Sequelize[_0x834e('0x4')]},'userpic':{'type':Sequelize[_0x834e('0x4')]},'city':{'type':Sequelize[_0x834e('0x4')]},'country':{'type':Sequelize[_0x834e('0x4')]},'online':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x18')},'lastPauseAt':{'type':Sequelize[_0x834e('0x19')]},'chatCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x834e('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x834e('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user','peer'),'allowNull':!![],'defaultValue':_0x834e('0x1b')},'context':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x834e('0x1d'),_0x834e('0x1e'),_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),_0x834e('0x23'),_0x834e('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x25'),'set':function(_0x2b3418){this[_0x834e('0x6')](_0x834e('0x26'),_0x2b3418?_0x2b3418[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x26'))?this[_0x834e('0xc')]('transport')[_0x834e('0x28')](','):null;},'comment':_0x834e('0x29')},'dtmfmode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2a'),'info',_0x834e('0x2b'),_0x834e('0x2c'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x31'),'set':function(_0x6a3ac){this['setDataValue'](_0x834e('0x32'),_0x6a3ac?_0x6a3ac[_0x834e('0x27')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x834e('0xc')](_0x834e('0x32'))[_0x834e('0x28')](','):null;},'comment':_0x834e('0x33')},'callgroup':{'type':Sequelize[_0x834e('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x834e('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x834e('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x834e('0x34')},'allow':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'defaultValue':_0x834e('0x35'),'set':function(_0x3c59af){this[_0x834e('0x6')]('allow',_0x3c59af?_0x3c59af[_0x834e('0x27')](';'):_0x834e('0x35'));},'get':function(){return this[_0x834e('0xc')]('allow')?this[_0x834e('0xc')](_0x834e('0x36'))['split'](';'):null;},'comment':_0x834e('0x37')},'autoframing':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'set':function(_0x4a18bb){this['setDataValue'](_0x834e('0x38'),_0x4a18bb?_0x4a18bb[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x38'))?this[_0x834e('0xc')](_0x834e('0x38'))[_0x834e('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x834e('0x10')]('yes','no',_0x834e('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x3a')},'amaflags':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3c'),_0x834e('0x3d'),_0x834e('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3f'),_0x834e('0x40')),'allowNull':!![],'defaultValue':_0x834e('0x40')},'t38pt_usertpsource':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x834e('0x10')]('yes','no','fingerprint',_0x834e('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x834e('0x10')]('active',_0x834e('0x42'),_0x834e('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x834e('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x834e('0x19')]},'passwordResetAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x834e('0x45')]},'showWebBar':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0,'set':function(_0x1e4310){this[_0x834e('0x6')](_0x834e('0x46'),_0x1e4310);var _0x1659c8=this[_0x834e('0x47')]({'plain':!![]});switch(_0x1e4310){case 0x0:case 0x1:var _0x17b8e3=_0x1659c8[_0x834e('0x26')]?_[_0x834e('0x48')](_0x1659c8[_0x834e('0x26')])?_0x1659c8[_0x834e('0x26')][_0x834e('0x27')]():_0x1659c8[_0x834e('0x26')]:'udp';if(_0x17b8e3===_0x834e('0x49')){_0x17b8e3=_0x834e('0x25');}this[_0x834e('0x6')](_0x834e('0x26'),_0x17b8e3);this['setDataValue'](_0x834e('0x4a'),'no');this['setDataValue']('avpf',null);this[_0x834e('0x6')](_0x834e('0x4b'),null);this[_0x834e('0x6')](_0x834e('0x4c'),null);this[_0x834e('0x6')](_0x834e('0x4d'),null);this[_0x834e('0x6')](_0x834e('0x4e'),null);this['setDataValue'](_0x834e('0x4f'),null);this['setDataValue'](_0x834e('0x50'),null);this[_0x834e('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x834e('0x51'),'no');break;case 0x2:this[_0x834e('0x6')](_0x834e('0x26'),_0x834e('0x49'));this[_0x834e('0x6')]('encryption',_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x52'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4b'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4c'),_0x834e('0x2d'));this['setDataValue'](_0x834e('0x4d'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4e'),'no');this['setDataValue'](_0x834e('0x4f'),'actpass');this['setDataValue']('dtlscertfile',_0x1659c8[_0x834e('0x50')]||_0x834e('0x53'));this['setDataValue'](_0x834e('0x54'),_0x1659c8[_0x834e('0x54')]||'/etc/pki/tls/private/motion.key');this[_0x834e('0x6')](_0x834e('0x51'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x346be5){this[_0x834e('0x6')](_0x834e('0x55'),_0x346be5?_0x346be5[_0x834e('0x27')](','):[]);},'get':function(){return this[_0x834e('0xc')]('permissions')?_[_0x834e('0x56')](this['getDataValue'](_0x834e('0x55'))[_0x834e('0x28')](','),function(_0x2c758c){return parseInt(_0x2c758c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x834e('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x834e('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0x834e('0xc')](_0x834e('0x57')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x18ddac){if(typeof _0x18ddac===_0x834e('0x58')){var _0x5acf5c=_0x18ddac==='1'?!![]:_0x18ddac==='0'?![]:_0x18ddac===_0x834e('0x59')?!![]:_0x18ddac===_0x834e('0x5a')?![]:![];this[_0x834e('0x6')]('screenrecording',_0x5acf5c);}else{this[_0x834e('0x6')](_0x834e('0x5b'),_0x18ddac);}}},'blocked':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x443633){this[_0x834e('0x6')]('blocked',_0x443633);if(_0x443633===!![]){this['setDataValue'](_0x834e('0x5c'),moment());this[_0x834e('0x6')]('loginAttempts',0x0);}else{this[_0x834e('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x834e('0x15')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'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 816984d..d6bdd6d 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 _0xf45d=['SELECT','from','isNil','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','113','110','104','106','109','100','111','115','create','Unauthorized','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','Agents','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','autoAssociation','compact','changePassword','oldPassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','ValidationError','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','loginInPause','voicePause','interface','capitalize','penalty','spread','toLowerCase','QueueId','Queue:save','voice','VoiceQueue','online','format','UserVoiceQueueRt','removeQueues','isValidChannel','Unknown\x20channel','remove','Queues','isArray','emit','Queue:remove','addAvatar','userpic','filename','join','root','download','existsSync','server/files/images/','sms','ChatOpenTabs','CHAT','createdAt','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','WhatsappOpenTabs','concat','getContacts','order','sort','pick','hasOwnProperty','CmList','List','Tag','Tags','color','tag','Queue','get','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','includeAll','getScreenRecordings','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','intrf','SIP/%s','user:%s','user:forcelogout','headers','x-forwarded-for','connection','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','upsert','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGININPAUSE','MemberReport','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','getChannels','PAUSE','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','faxPause','smsPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','Team','addTeams','transaction','getAssociatedQueues','flattenDeep','Voice','getDataValue','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeAgent','TeamVoicePrefix','VoicePrefixId','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','getChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','CmHopper','$and','$or','$gt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','firstName','CmContact','dialActive','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','createApiKey','iat','nonce','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','getPresence','teams','queues','inbound','flatten','col','toString','asc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unavailable','ringing','voiceStatus','busy','charAt','toUpperCase','slice','select','field','InteractionId','ui.createdAt','user_has_','ui.UserId\x20=\x20?','OpenTabs','util','path','lodash','squel','jayson/promise','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../errors/api','APINotFoundError','handleError','socket.io-emitter','redis','./user.socket','register','defaults','client','http','request','then','info','request\x20sent','User,\x20%s,\x20%s,\x20%s','error','code','User,\x20%s,\x20%s','message','result','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','update','role','agent','userNotification:recalc:','destroy','Users','user','Telephones','telephone','filter','ignore','map','value','includes','find','UserProfileResource','name','send','index','User','rawAttributes','fieldName','type','key','password','salt','getOptions','where','include','query','userSetting','true','attributes','push','openTabs','rows','length','chat','dataValues','fax','mail','openchannel','whatsapp','all','model','differenceBy','keys','filters','intersection','fields','UserSetting','merge','options','catch','body','params','describe','addContacts','ids','omit','internal','Setting','findById','securePassword','validatePasswordPattern','min_internal','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','sequelize','QueryTypes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf45d,0x118));var _0xdf45=function(_0x26373e,_0x291c74){_0x26373e=_0x26373e-0x0;var _0x21d898=_0xf45d[_0x26373e];return _0x21d898;};'use strict';var moment=require('moment');var util=require(_0xdf45('0x0'));var path=require(_0xdf45('0x1'));var fs=require('fs');var _=require(_0xdf45('0x2'));var squel=require(_0xdf45('0x3'));var jayson=require(_0xdf45('0x4'));var Redis=require(_0xdf45('0x5'));var authService=require('../../components/auth/service');var qs=require(_0xdf45('0x6'));var logger=require(_0xdf45('0x7'))(_0xdf45('0x8'));var utils=require('../../config/utils');var config=require(_0xdf45('0x9'));var licenseUtil=require(_0xdf45('0xa'));var APIBadRequestError=require(_0xdf45('0xb'))['APIBadRequestError'];var APINotFoundError=require(_0xdf45('0xb'))[_0xdf45('0xc')];var APIHandleError=require('../../errors/api')[_0xdf45('0xd')];var db=require('../../mysqldb')['db'];var socket=require(_0xdf45('0xe'))(new Redis(config[_0xdf45('0xf')]));require(_0xdf45('0x10'))[_0xdf45('0x11')](socket);config[_0xdf45('0xf')]=_[_0xdf45('0x12')](config['redis'],{'host':'localhost','port':0x18eb});var amiClient=jayson[_0xdf45('0x13')][_0xdf45('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x5f14d9,_0x1d86a9,_0x488ee4,_0x38f29b){return new Promise(function(_0x2755c2,_0x173762){var _0x4eafbd=_0x38f29b||amiClient;return _0x4eafbd[_0xdf45('0x15')](_0x5f14d9,_0x488ee4)[_0xdf45('0x16')](function(_0x3cf261){logger[_0xdf45('0x17')]('User,\x20%s,\x20%s',_0x1d86a9,_0xdf45('0x18'));logger['debug'](_0xdf45('0x19'),_0x1d86a9,_0xdf45('0x18'),JSON['stringify'](_0x3cf261));if(_0x3cf261[_0xdf45('0x1a')]){if(_0x3cf261['error'][_0xdf45('0x1b')]===0x1f4){logger[_0xdf45('0x1a')](_0xdf45('0x1c'),_0x1d86a9,_0x3cf261[_0xdf45('0x1a')]['message']);return _0x173762(_0x3cf261['error'][_0xdf45('0x1d')]);}logger[_0xdf45('0x1a')](_0xdf45('0x1c'),_0x1d86a9,_0x3cf261[_0xdf45('0x1a')][_0xdf45('0x1d')]);return _0x2755c2(_0x3cf261['error']['message']);}else{logger[_0xdf45('0x17')]('User,\x20%s,\x20%s',_0x1d86a9,_0xdf45('0x18'));_0x2755c2(_0x3cf261[_0xdf45('0x1e')][_0xdf45('0x1d')]);}})['catch'](function(_0x15e91c){logger[_0xdf45('0x1a')](_0xdf45('0x1c'),_0x1d86a9,_0x15e91c);_0x173762(_0x15e91c);});});}function respondWithStatusCode(_0x5e732a,_0x344150){_0x344150=_0x344150||0xcc;return function(_0x172e58){if(_0x172e58){return _0x5e732a[_0xdf45('0x1f')](_0x344150);}return _0x5e732a[_0xdf45('0x20')](_0x344150)[_0xdf45('0x21')]();};}function respondWithResult(_0x24c205,_0x2b4dfa){_0x2b4dfa=_0x2b4dfa||0xc8;return function(_0xe82d78){if(_0xe82d78){return _0x24c205[_0xdf45('0x20')](_0x2b4dfa)[_0xdf45('0x22')](_0xe82d78);}};}function respondWithFilteredResult(_0x5cab3a,_0x47e952){return function(_0x2bc06e){if(_0x2bc06e){var _0x584944=typeof _0x47e952['offset']==='undefined'&&typeof _0x47e952['limit']===_0xdf45('0x23');var _0x20655a=_0x2bc06e[_0xdf45('0x24')];var _0x11c260=_0x584944?0x0:_0x47e952[_0xdf45('0x25')];var _0x32a3c1=_0x584944?_0x2bc06e['count']:_0x47e952[_0xdf45('0x25')]+_0x47e952[_0xdf45('0x26')];var _0x38e41c;if(_0x32a3c1>=_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')]=_0xe67132){_0x50906a=_0xe67132;_0x58ab6b=0xc8;}else{_0x58ab6b=0xce;}_0x266b99[_0xacda('0x1b')](_0x58ab6b);return _0x266b99[_0xacda('0x22')](_0xacda('0x23'),_0x2cf117+'-'+_0x50906a+'/'+_0xe67132)[_0xacda('0x1d')](_0x7cc664);}return null;};}function saveUpdates(_0x1b772d){return function(_0x379b15){if(_0x379b15){return _0x379b15[_0xacda('0x24')](_0x1b772d)[_0xacda('0x11')](function(_0x1fdbd9){if(_0x1fdbd9[_0xacda('0x25')]===_0xacda('0x26')){socket[_0xacda('0x27')](_0xacda('0x28')+_0x1fdbd9['id'],_0x1fdbd9);}return _0x1fdbd9;});}return null;};}function removeEntity(_0x20e175){return function(_0x19857a){if(_0x19857a){return _0x19857a[_0xacda('0x29')]()[_0xacda('0x11')](function(){var _0x6eb4c2=_0x19857a[_0xacda('0x2a')]({'plain':!![]});if(_0x6eb4c2['role']===_0xacda('0x2b'))return;var _0x46e3a2=[{'name':_0xacda('0x2c'),'value':'user','ignore':!![]},{'name':_0xacda('0x2d'),'value':_0xacda('0x26'),'ignore':![]},{'name':'Telephones','value':_0xacda('0x2e'),'ignore':![]}];var _0x31273b=_(_0x46e3a2)[_0xacda('0x2f')]('ignore')[_0xacda('0x30')](_0xacda('0x31'))[_0xacda('0x31')]();if(_[_0xacda('0x32')](_0x31273b,_0x6eb4c2[_0xacda('0x25')])){return;}var _0x2e1595=_[_0xacda('0x33')](_0x46e3a2,[_0xacda('0x31'),_0x6eb4c2[_0xacda('0x25')]])[_0xacda('0x34')];return db['UserProfileResource'][_0xacda('0x29')]({'where':{'type':_0x2e1595,'resourceId':_0x6eb4c2['id']}})['then'](function(){return _0x19857a;});})[_0xacda('0x11')](function(){_0x20e175[_0xacda('0x1b')](0xcc)[_0xacda('0x1c')]();});}};}function handleEntityNotFound(_0x41779f){return function(_0x4e04bd){if(!_0x4e04bd){_0x41779f[_0xacda('0x35')](0x194);}return _0x4e04bd;};}function handleError(_0x33c8fe,_0x41dfcd){_0x41dfcd=_0x41dfcd||0x1f4;return function(_0x39d0dd){logger['error'](_0x39d0dd[_0xacda('0x36')]);if(_0x39d0dd['name']){delete _0x39d0dd['name'];}_0x33c8fe[_0xacda('0x1b')](_0x41dfcd)['send'](_0x39d0dd);};}exports['index']=function(_0x14f26b,_0x2a2f81){var _0x3c4cb2={},_0x44e4af={'count':0x0,'rows':[]};var _0x2585c1=_(db[_0xacda('0x37')][_0xacda('0x38')])[_0xacda('0x30')](function(_0x11c812){return{'name':_0x11c812[_0xacda('0x39')],'type':_0x11c812[_0xacda('0x3a')][_0xacda('0x3b')]};})[_0xacda('0x2f')](function(_0x3b5166){return!_[_0xacda('0x32')]([_0xacda('0x3c'),_0xacda('0x3d')],_0x3b5166[_0xacda('0x34')]);})[_0xacda('0x31')]();_0x3c4cb2=qs['getOptions'](_0x2585c1,_0x14f26b);var _0x2e51d0={'where':_0x3c4cb2[_0xacda('0x3e')]};return db[_0xacda('0x37')][_0xacda('0x21')](_0x2e51d0)[_0xacda('0x11')](function(_0x5d177f){_0x44e4af[_0xacda('0x21')]=_0x5d177f;if(_0x14f26b[_0xacda('0x3f')][_0xacda('0x40')]){_0x3c4cb2[_0xacda('0x41')]=[{'all':!![]}];}if(_0x14f26b['query'][_0xacda('0x42')]===_0xacda('0x43')){_0x3c4cb2[_0xacda('0x41')]=[{'model':db[_0xacda('0x44')],'as':_0xacda('0x42')}];}if(!_['includes'](_0x3c4cb2[_0xacda('0x45')],'id')){_0x3c4cb2[_0xacda('0x45')][_0xacda('0x46')]('id');}return db[_0xacda('0x37')]['findAll'](_0x3c4cb2);})[_0xacda('0x11')](function(_0x5a3438){_0x44e4af['rows']=_0x5a3438;if(_0x14f26b[_0xacda('0x3f')]['openTabs']==='true'){var _0x4062b9=[];for(var _0x3dc32f=0x0;_0x3dc32f<_0x44e4af[_0xacda('0x47')][_0xacda('0x48')];_0x3dc32f++){_0x4062b9[_0xacda('0x46')](get_open_tabs(_0xacda('0x49'),_0x44e4af['rows'][_0x3dc32f][_0xacda('0x4a')]));_0x4062b9[_0xacda('0x46')](get_open_tabs('sms',_0x44e4af['rows'][_0x3dc32f][_0xacda('0x4a')]));_0x4062b9['push'](get_open_tabs('fax',_0x44e4af['rows'][_0x3dc32f][_0xacda('0x4a')]));_0x4062b9[_0xacda('0x46')](get_open_tabs(_0xacda('0x4b'),_0x44e4af[_0xacda('0x47')][_0x3dc32f][_0xacda('0x4a')]));_0x4062b9[_0xacda('0x46')](get_open_tabs(_0xacda('0x4c'),_0x44e4af[_0xacda('0x47')][_0x3dc32f][_0xacda('0x4a')]));_0x4062b9[_0xacda('0x46')](get_open_tabs(_0xacda('0x4d'),_0x44e4af[_0xacda('0x47')][_0x3dc32f][_0xacda('0x4a')]));}return Promise['all'](_0x4062b9)['then'](function(){return _0x44e4af;});}else{return _0x44e4af;}})[_0xacda('0x11')](respondWithFilteredResult(_0x2a2f81,_0x3c4cb2))['catch'](handleError(_0x2a2f81,null));};exports[_0xacda('0x4e')]=function(_0x5b3b76,_0x410d00){var _0x16ea53={'raw':![],'where':{'id':_0x5b3b76[_0xacda('0x4f')]['id']}},_0x19240b={};_0x19240b[_0xacda('0x50')]=_[_0xacda('0x51')](_['keys'](db[_0xacda('0x37')][_0xacda('0x38')]),[_0xacda('0x3c'),_0xacda('0x3d')]);_0x19240b[_0xacda('0x3f')]=_[_0xacda('0x52')](_0x5b3b76['query']);_0x19240b[_0xacda('0x53')]=_[_0xacda('0x54')](_0x19240b[_0xacda('0x50')],_0x19240b['query']);_0x16ea53[_0xacda('0x45')]=_['intersection'](_0x19240b[_0xacda('0x50')],qs[_0xacda('0x55')](_0x5b3b76[_0xacda('0x3f')][_0xacda('0x55')]));_0x16ea53[_0xacda('0x45')]=_0x16ea53['attributes'][_0xacda('0x48')]?_0x16ea53[_0xacda('0x45')]:_0x19240b[_0xacda('0x50')];if(_0x5b3b76[_0xacda('0x3f')]['includeAll']){_0x16ea53['include']=[{'all':!![]}];}if(_0x5b3b76[_0xacda('0x3f')][_0xacda('0x42')]==='true'){_0x16ea53['include']=[{'model':db[_0xacda('0x44')],'as':'userSetting'}];}_0x16ea53=_[_0xacda('0x56')]({},_0x16ea53,_0x5b3b76[_0xacda('0x57')]);if(!_[_0xacda('0x32')](_0x16ea53[_0xacda('0x45')],'id')){_0x16ea53[_0xacda('0x45')][_0xacda('0x46')]('id');}return db[_0xacda('0x37')][_0xacda('0x33')](_0x16ea53)[_0xacda('0x11')](handleEntityNotFound(_0x410d00,null))['then'](function(_0x3c28a9){var _0x4e1cb7=[];values=_0x3c28a9;if(_0x5b3b76['query'][_0xacda('0x58')]===_0xacda('0x43')){_0x4e1cb7['push'](get_open_tabs(_0xacda('0x49'),_0x3c28a9[_0xacda('0x4a')]));_0x4e1cb7[_0xacda('0x46')](get_open_tabs(_0xacda('0x59'),_0x3c28a9[_0xacda('0x4a')]));_0x4e1cb7[_0xacda('0x46')](get_open_tabs(_0xacda('0x4c'),_0x3c28a9[_0xacda('0x4a')]));_0x4e1cb7[_0xacda('0x46')](get_open_tabs('whatsapp',_0x3c28a9[_0xacda('0x4a')]));_0x4e1cb7[_0xacda('0x46')](get_open_tabs(_0xacda('0x5a'),_0x3c28a9[_0xacda('0x4a')]));_0x4e1cb7[_0xacda('0x46')](get_open_tabs(_0xacda('0x4b'),_0x3c28a9[_0xacda('0x4a')]));return Promise[_0xacda('0x5b')](_0x4e1cb7);}else{return values;}})[_0xacda('0x11')](function(){return values;})[_0xacda('0x11')](respondWithResult(_0x410d00,null))[_0xacda('0x1a')](handleError(_0x410d00,null));};exports[_0xacda('0x24')]=function(_0x31bcc7,_0x550423){if(_0x31bcc7['body']['id']){delete _0x31bcc7[_0xacda('0x5c')]['id'];}delete _0x31bcc7[_0xacda('0x5c')][_0xacda('0x25')];return db[_0xacda('0x37')][_0xacda('0x33')]({'where':{'id':_0x31bcc7[_0xacda('0x4f')]['id']}})[_0xacda('0x11')](handleEntityNotFound(_0x550423,null))[_0xacda('0x11')](saveUpdates(_0x31bcc7['body'],null))[_0xacda('0x11')](respondWithResult(_0x550423,null))[_0xacda('0x1a')](handleError(_0x550423,null));};exports[_0xacda('0x5d')]=function(_0x347621,_0x229240){return db[_0xacda('0x37')][_0xacda('0x5d')]()[_0xacda('0x11')](respondWithResult(_0x229240,null))[_0xacda('0x1a')](handleError(_0x229240,null));};exports[_0xacda('0x5e')]=function(_0x58a2cc,_0x1ac357){return db[_0xacda('0x37')][_0xacda('0x33')]({'where':{'id':_0x58a2cc['params']['id']}})[_0xacda('0x11')](handleEntityNotFound(_0x1ac357,null))[_0xacda('0x11')](function(_0x249a1b){if(_0x249a1b){return _0x249a1b[_0xacda('0x5e')](_0x58a2cc[_0xacda('0x5c')][_0xacda('0x5f')],_['omit'](_0x58a2cc[_0xacda('0x5c')],[_0xacda('0x5f'),'id'])||{});}})[_0xacda('0x11')](respondWithResult(_0x1ac357,null))[_0xacda('0x1a')](handleError(_0x1ac357,null));};function validateUser(_0x44635d){return new Promise(function(_0x121073,_0x139fcf){if(_0x44635d[_0xacda('0x60')])return _0x121073(_0x44635d);return db[_0xacda('0x61')]['findById'](0x1)['then'](function(_0x4e6e44){if(_0x4e6e44['securePassword'])authService[_0xacda('0x62')](_0x44635d[_0xacda('0x3c')]);db[_0xacda('0x37')][_0xacda('0x63')](_0xacda('0x60'))['then'](function(_0x53f173){if(_['isNil'](_0x53f173)){_0x44635d['internal']=_0x4e6e44[_0xacda('0x64')]||0x1;return;}if(_[_0xacda('0x65')](_0x4e6e44['min_internal'])||_0x4e6e44[_0xacda('0x64')]===_0x53f173){_0x44635d[_0xacda('0x60')]=_0x53f173+0x1;return;}if(_0x4e6e44[_0xacda('0x64')]>_0x53f173){_0x44635d[_0xacda('0x60')]=_0x4e6e44['min_internal'];return;}return db['sequelize'][_0xacda('0x3f')](_0xacda('0x66'),{'type':db[_0xacda('0x67')]['QueryTypes']['SELECT']})[_0xacda('0x11')](function(_0x5c9867){if(_0x5c9867&&_0x5c9867[_0xacda('0x48')]){for(var _0x438b6e=0x0,_0xcfd304=_0x5c9867['length'];_0x438b6e<_0xcfd304&&_[_0xacda('0x65')](_0x44635d[_0xacda('0x60')]);_0x438b6e++){if(_0x4e6e44[_0xacda('0x64')]<=_0x5c9867[_0x438b6e][_0xacda('0x68')]){_0x44635d['internal']=_0x5c9867[_0x438b6e]['from'];}else if(_0x4e6e44[_0xacda('0x64')]>_0x5c9867[_0x438b6e][_0xacda('0x68')]&&_0x4e6e44[_0xacda('0x64')]<=_0x5c9867[_0x438b6e]['to']){_0x44635d[_0xacda('0x60')]=_0x4e6e44[_0xacda('0x64')];}}}if(_[_0xacda('0x65')](_0x44635d['internal'])){_0x44635d[_0xacda('0x60')]=_0x53f173+0x1;}return _0x121073(_0x44635d);});});})[_0xacda('0x1a')](function(_0x564920){_0x139fcf(_0x564920);});});}function updateUser(_0x6bde09){return new Promise(function(_0xcb2349,_0x56adde){try{if(_0x6bde09[_0xacda('0x69')]){_0x6bde09['mailbox']=_0x6bde09[_0xacda('0x60')];_0x6bde09[_0xacda('0x6a')]={'mailbox':_0x6bde09[_0xacda('0x60')],'password':_0x6bde09[_0xacda('0x3c')],'fullname':_0x6bde09[_0xacda('0x6b')],'email':_0x6bde09['email']};}if(_0x6bde09[_0xacda('0x25')]===_0xacda('0x26')){if(!_0x6bde09['permissions'])_0x6bde09[_0xacda('0x6c')]=[_0xacda('0x6d'),_0xacda('0x6e'),_0xacda('0x6f'),_0xacda('0x70'),'110',_0xacda('0x71'),'105',_0xacda('0x72'),_0xacda('0x73'),_0xacda('0x74'),_0xacda('0x75'),_0xacda('0x76'),_0xacda('0x77'),_0xacda('0x78'),_0xacda('0x79')];}_0xcb2349(_0x6bde09);}catch(_0x4c0941){_0x56adde(_0x4c0941);}});}exports[_0xacda('0x7a')]=function(_0x4ea9d3,_0x3f5798){if(_0x4ea9d3[_0xacda('0x7b')][_0xacda('0x25')]===_0xacda('0x26'))throw new Error(_0xacda('0x7c'));if(_0x4ea9d3[_0xacda('0x5c')][_0xacda('0x25')]==='user'&&_0x4ea9d3[_0xacda('0x7b')]['role']!=='admin'){throw new Error(_0xacda('0x7d'));}if(_0x4ea9d3[_0xacda('0x5c')][_0xacda('0x25')]===_0xacda('0x2b')&&_0x4ea9d3[_0xacda('0x7b')][_0xacda('0x25')]!==_0xacda('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0xacda('0x7e')]([_0x4ea9d3['body']])['then'](function(){return validateUser(_0x4ea9d3[_0xacda('0x5c')]);})[_0xacda('0x11')](function(_0x167b77){return updateUser(_0x167b77)[_0xacda('0x11')](function(_0x5d80bc){if(_0x5d80bc[_0xacda('0x25')]===_0xacda('0x2b')){_0x5d80bc[_0xacda('0x7f')]=_0x4ea9d3['user'][_0xacda('0x7f')];delete _0x5d80bc[_0xacda('0x80')];}return _0x5d80bc;});})[_0xacda('0x11')](function(_0x4ae874){return db[_0xacda('0x37')][_0xacda('0x7a')](_0x4ae874,{'include':[{'model':db[_0xacda('0x6a')],'as':'VoiceMail'}]});})[_0xacda('0x11')](function(_0x278518){if(_0x4ea9d3[_0xacda('0x5c')]['role']===_0xacda('0x7b'))return _0x278518;if(_0x4ea9d3[_0xacda('0x7b')]['role']!=='user')return _0x278518;return db[_0xacda('0x81')][_0xacda('0x33')]({'where':{'name':_0x278518[_0xacda('0x25')]===_0xacda('0x26')?_0xacda('0x2d'):_0xacda('0x82'),'userProfileId':_0x4ea9d3['user'][_0xacda('0x80')]},'raw':!![]})['then'](function(_0x5ac43b){if(!_0x5ac43b||_0x5ac43b[_0xacda('0x83')]!=0x0)return _0x278518;return db['UserProfileResource'][_0xacda('0x7a')]({'name':_0x278518[_0xacda('0x34')],'resourceId':_0x278518['id'],'type':_0x5ac43b['name'],'sectionId':_0x5ac43b['id']},{})['then'](function(){return _0x278518;});})[_0xacda('0x1a')](function(_0xd87a95){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd87a95);throw _0xd87a95;});})[_0xacda('0x11')](respondWithResult(_0x3f5798,0xc9))[_0xacda('0x1a')](handleError(_0x3f5798,null));};exports['bulkCreate']=function(_0x224107,_0x5e2375){var _0x138c30=_0x224107['body'];var _0x82a241=[];if(_0x224107[_0xacda('0x7b')]['role']==='agent')throw new Error(_0xacda('0x7c'));if(_[_0xacda('0x84')](_0x138c30,[_0xacda('0x25'),_0xacda('0x7b')])&&_0x224107[_0xacda('0x7b')][_0xacda('0x25')]!==_0xacda('0x2b')){throw new Error(_0xacda('0x7d'));}if(_[_0xacda('0x84')](_0x138c30,[_0xacda('0x25'),'admin'])&&_0x224107[_0xacda('0x7b')]['role']!==_0xacda('0x2b')){throw new Error(_0xacda('0x85'));}return licenseUtil[_0xacda('0x7e')](_0x138c30)[_0xacda('0x11')](function(){return validateUser(_0x138c30[0x0]);})['then'](function(){for(var _0x3a71be=0x1;_0x3a71be<_0x138c30['length'];_0x3a71be++){var _0x34e209=_0x138c30[_0x3a71be-0x1][_0xacda('0x60')];if(!_0x138c30[_0x3a71be][_0xacda('0x60')])_0x138c30[_0x3a71be][_0xacda('0x60')]=_0x34e209+0x1;_0x82a241['push'](validateUser(_0x138c30[_0x3a71be]));}return Promise[_0xacda('0x5b')](_0x82a241);})[_0xacda('0x11')](function(){_0x82a241=[];for(var _0x5d566d=0x0;_0x5d566d<_0x138c30[_0xacda('0x48')];_0x5d566d++){_0x82a241[_0xacda('0x46')](updateUser(_0x138c30[_0x5d566d]));}return Promise[_0xacda('0x5b')](_0x82a241);})[_0xacda('0x11')](function(){_0x82a241=_0x138c30[_0xacda('0x30')](function(_0x5977a2){return db[_0xacda('0x37')]['create'](_0x5977a2,{'include':[{'model':db[_0xacda('0x6a')],'as':_0xacda('0x6a')}]})[_0xacda('0x11')](function(_0x515787){_0x5977a2['id']=_0x515787['id'];return _0x5977a2;});});return Promise[_0xacda('0x5b')](_0x82a241);})[_0xacda('0x11')](function(_0x2caba2){if(_0x224107['body'][_0xacda('0x25')]===_0xacda('0x7b'))return _0x2caba2;if(_0x224107[_0xacda('0x7b')][_0xacda('0x25')]!==_0xacda('0x7b'))return _0x2caba2;var _0x35aab1=_[_0xacda('0x84')](_0x2caba2,function(_0x1469bc){return _0x1469bc['role']==='agent'||_0x1469bc[_0xacda('0x25')]===_0xacda('0x2e');});if(!_0x35aab1)return _0x2caba2;return db[_0xacda('0x81')]['findAll']({'where':{'name':{'$or':[_0xacda('0x2d'),_0xacda('0x82')]},'userProfileId':_0x224107['user'][_0xacda('0x80')]},'raw':!![]})[_0xacda('0x11')](function(_0x1aa72b){if(_[_0xacda('0x86')](_0x1aa72b)||!_[_0xacda('0x84')](_0x1aa72b,['autoAssociation',0x0]))return _0x2caba2;_0x82a241=[];var _0x15c51c=_(_0x1aa72b)[_0xacda('0x30')](function(_0xcced50){if(_0xcced50[_0xacda('0x83')]===0x1)return;return _0xcced50[_0xacda('0x34')]===_0xacda('0x2d')?_0xacda('0x26'):_0xacda('0x2e');})[_0xacda('0x87')]()[_0xacda('0x31')]();for(var _0x261a1e=0x0;_0x261a1e<_0x2caba2[_0xacda('0x48')];_0x261a1e++){if(!_['includes'](_0x15c51c,_0x2caba2[_0x261a1e]['role']))return;var _0x26df7d=_0x2caba2[_0x261a1e][_0xacda('0x25')]===_0xacda('0x26')?'Agents':_0xacda('0x82');_0x82a241[_0xacda('0x46')](db['UserProfileResource']['create']({'name':_0x2caba2[_0x261a1e][_0xacda('0x34')],'resourceId':_0x2caba2[_0x261a1e]['id'],'type':_0x26df7d,'sectionId':_['find'](_0x1aa72b,[_0xacda('0x34'),_0x26df7d])['id']},{}));}return Promise[_0xacda('0x5b')](_0x82a241);});})[_0xacda('0x11')](respondWithResult(_0x5e2375,0xc9))[_0xacda('0x1a')](handleError(_0x5e2375,null));};exports[_0xacda('0x88')]=function(_0x56ba48,_0x550089){if(_0x56ba48['body']['id']){delete _0x56ba48['body']['id'];}return db['User'][_0xacda('0x33')]({'where':{'id':_0x56ba48['params']['id']}})[_0xacda('0x11')](function(_0x23fd00){if(!_0x23fd00)return null;if(_0x23fd00['id']===_0x56ba48[_0xacda('0x7b')]['id']){if(!_0x56ba48[_0xacda('0x5c')]['oldPassword']||!_0x56ba48[_0xacda('0x5c')]['newPassword']){throw new db[(_0xacda('0x89'))][(_0xacda('0x8a'))](_0xacda('0x8b'));}if(!_0x23fd00[_0xacda('0x8c')](_0x56ba48[_0xacda('0x5c')][_0xacda('0x8d')])){throw new db[(_0xacda('0x89'))][(_0xacda('0x8a'))](_0xacda('0x8e'));}if(_0x56ba48[_0xacda('0x5c')]['oldPassword']===_0x56ba48[_0xacda('0x5c')][_0xacda('0x8f')]){throw new db[(_0xacda('0x89'))]['ValidationError'](_0xacda('0x90'));}}else if(_0x56ba48['user'][_0xacda('0x25')]===_0xacda('0x2b')){if(!_0x56ba48[_0xacda('0x5c')][_0xacda('0x8f')]){throw new db[(_0xacda('0x89'))][(_0xacda('0x8a'))](_0xacda('0x91'));}}else if(_0x56ba48[_0xacda('0x7b')][_0xacda('0x25')]==='user'){if(!_0x56ba48[_0xacda('0x5c')]['newPassword']){throw new db[(_0xacda('0x89'))][(_0xacda('0x8a'))](_0xacda('0x91'));}if(_0x23fd00[_0xacda('0x25')]!=='agent'){throw new db['Sequelize']['ValidationError'](_0xacda('0x7c'));}}else{throw new db[(_0xacda('0x89'))][(_0xacda('0x8a'))](_0xacda('0x7c'));}return _0x23fd00;})[_0xacda('0x11')](handleEntityNotFound(_0x550089,null))[_0xacda('0x11')](function(_0x2ef6b2){return db['Setting'][_0xacda('0x92')]({'attributes':['id','securePassword','enforcePasswordHistory','passwordHistoryLimit']})['then'](function(_0x1fa0c8){if(_0x1fa0c8['securePassword'])authService[_0xacda('0x62')](_0x56ba48[_0xacda('0x5c')]['newPassword']);if(!_0x1fa0c8[_0xacda('0x93')]||!_0x2ef6b2['previousPasswords'])return _0x2ef6b2;authService[_0xacda('0x94')](_0x56ba48['body'][_0xacda('0x8f')],_0x2ef6b2['previousPasswords'],_0x1fa0c8['passwordHistoryLimit']);return _0x2ef6b2;})[_0xacda('0x11')](saveUpdates({'password':_0x56ba48['body']['newPassword'],'passwordResetAt':_0x56ba48['user']['id']==_0x56ba48[_0xacda('0x4f')]['id']?moment():null,'previousPasswords':authService[_0xacda('0x95')](_0x56ba48[_0xacda('0x5c')]['newPassword'],_0x2ef6b2['previousPasswords'])},null));})[_0xacda('0x11')](respondWithResult(_0x550089,null))['catch'](handleError(_0x550089,null));};exports['addQueues']=function(_0x337e8f,_0x493d68){var _0x272220=_0x337e8f['body'][_0xacda('0x96')];return db[_0xacda('0x37')]['find']({'where':{'id':_0x337e8f['params']['id']},'attributes':['id',_0xacda('0x34'),'role','online',_0xacda('0x97'),'voicePause','interface']})[_0xacda('0x11')](handleEntityNotFound(_0x493d68,null))[_0xacda('0x11')](function(_0x5162a1){if(_0x5162a1){if(!utils['isValidChannel'](_0x272220)){throw new db[(_0xacda('0x89'))][(_0xacda('0x8a'))](_0xacda('0x98'));}return _0x5162a1[_0xacda('0x99')+_[_0xacda('0x9a')](_0x272220['toLowerCase']())+_0xacda('0x9b')](_0x337e8f['body'][_0xacda('0x5f')],{'penalty':_0x337e8f[_0xacda('0x5c')]['penalty']||0x0})[_0xacda('0x9c')](function(_0x3dc725){for(var _0x16705c=0x0;_0x16705c<_0x337e8f[_0xacda('0x5c')][_0xacda('0x5f')][_0xacda('0x48')];_0x16705c+=0x1){var _0x3bc517={'UserId':Number(_0x337e8f['params']['id'])};_0x3bc517[_['capitalize'](_0x272220[_0xacda('0x9d')]())+_0xacda('0x9e')]=Number(_0x337e8f[_0xacda('0x5c')]['ids'][_0x16705c]);socket[_0xacda('0x27')](_0xacda('0x7b')+_[_0xacda('0x9a')](_0x272220[_0xacda('0x9d')]())+_0xacda('0x9f'),_0x3bc517);}return _0x3dc725;})[_0xacda('0x11')](function(){if(_0x272220===_0xacda('0xa0')){return db['VoiceQueue'][_0xacda('0xa1')]({'where':{'id':_0x337e8f[_0xacda('0x5c')][_0xacda('0x5f')]||[]},'raw':!![],'attributes':['id',_0xacda('0x34')]});}})['then'](function(_0x1e8d6e){var _0x4ece90=_0x5162a1['get']({'plain':!![]});var _0x2e264e=[];if(_0x272220==='voice'&&_0x4ece90[_0xacda('0x25')]===_0xacda('0x26')&&_0x4ece90[_0xacda('0xa2')]){for(let _0x2c3b71=0x0;_0x2c3b71<_0x1e8d6e[_0xacda('0x48')];_0x2c3b71+=0x1){_0x2e264e[_0xacda('0x46')]({'membername':_0x4ece90[_0xacda('0x34')],'UserId':_0x4ece90['id'],'queue_name':_0x1e8d6e[_0x2c3b71]['name'],'VoiceQueueId':_0x1e8d6e[_0x2c3b71]['id'],'interface':_[_0xacda('0x65')](_0x4ece90[_0xacda('0xa3')])?util['format']('SIP/%s',_0x4ece90[_0xacda('0x34')]):_0x4ece90[_0xacda('0xa3')],'paused':_0x4ece90[_0xacda('0xa4')]||![],'penalty':_0x337e8f[_0xacda('0x5c')][_0xacda('0xa5')]||0x0});}return Promise[_0xacda('0x5b')](_0x2e264e[_0xacda('0x30')](function(_0x413193){return db['UserVoiceQueueRt'][_0xacda('0xa6')](_0x413193);}));}return _0x5162a1;});}})['then'](respondWithStatusCode(_0x493d68,null))[_0xacda('0x1a')](handleError(_0x493d68,null));};exports[_0xacda('0xa7')]=function(_0x30f74c,_0x3b4e48){var _0x10030a,_0x17ff8a;return db[_0xacda('0x37')][_0xacda('0x33')]({'where':{'id':_0x30f74c['params']['id']},'attributes':['id',_0xacda('0x34'),_0xacda('0x25')]})[_0xacda('0x11')](handleEntityNotFound(_0x3b4e48,null))[_0xacda('0x11')](function(_0x2f6d89){if(_0x2f6d89){_0x10030a=_0x2f6d89;if(!_0x30f74c['query'][_0xacda('0x96')]||!utils[_0xacda('0xa8')](_0x30f74c[_0xacda('0x3f')][_0xacda('0x96')])){throw new db['Sequelize'][(_0xacda('0x8a'))]('Unknown\x20channel');}return _0x2f6d89[_0xacda('0xa9')+_[_0xacda('0x9a')](_0x30f74c[_0xacda('0x3f')][_0xacda('0x96')]['toLowerCase']())+'Queues'](_0x30f74c[_0xacda('0x3f')][_0xacda('0x5f')]);}})[_0xacda('0x11')](function(_0x5d3581){if(_[_0xacda('0xaa')](_0x30f74c['query']['ids'])){for(var _0x50a912=0x0;_0x50a912<_0x30f74c[_0xacda('0x3f')][_0xacda('0x5f')][_0xacda('0x48')];_0x50a912+=0x1){_0x17ff8a={'UserId':Number(_0x30f74c[_0xacda('0x4f')]['id'])};_0x17ff8a[_[_0xacda('0x9a')](_0x30f74c[_0xacda('0x3f')][_0xacda('0x96')][_0xacda('0x9d')]())+_0xacda('0x9e')]=Number(_0x30f74c[_0xacda('0x3f')]['ids'][_0x50a912]);socket[_0xacda('0x27')](_0xacda('0x7b')+_[_0xacda('0x9a')](_0x30f74c['query'][_0xacda('0x96')]['toLowerCase']())+_0xacda('0xab'),_0x17ff8a);}}else{_0x17ff8a={'UserId':Number(_0x30f74c[_0xacda('0x4f')]['id'])};_0x17ff8a[_['capitalize'](_0x30f74c[_0xacda('0x3f')][_0xacda('0x96')]['toLowerCase']())+_0xacda('0x9e')]=Number(_0x30f74c[_0xacda('0x3f')][_0xacda('0x5f')]);socket[_0xacda('0x27')](_0xacda('0x7b')+_[_0xacda('0x9a')](_0x30f74c['query'][_0xacda('0x96')]['toLowerCase']())+'Queue:remove',_0x17ff8a);}return _0x5d3581;})[_0xacda('0x11')](function(){if(_0x30f74c[_0xacda('0x3f')][_0xacda('0x96')]===_0xacda('0xa0')){return db[_0xacda('0xac')]['destroy']({'where':{'UserId':_0x30f74c['params']['id'],'VoiceQueueId':_0x30f74c[_0xacda('0x3f')][_0xacda('0x5f')]},'individualHooks':!![]})['then'](function(){return _0x10030a;});}return _0x10030a;})[_0xacda('0x11')](respondWithStatusCode(_0x3b4e48,null))[_0xacda('0x1a')](handleError(_0x3b4e48,null));};exports[_0xacda('0xad')]=function(_0x1deb1f,_0x150b5d){_0x1deb1f['body'][_0xacda('0xae')]=_0x1deb1f[_0xacda('0xaf')][_0xacda('0xb0')];return db[_0xacda('0x37')]['find']({'where':{'id':_0x1deb1f['params']['id']}})['then'](handleEntityNotFound(_0x150b5d,null))['then'](saveUpdates(_0x1deb1f[_0xacda('0x5c')],null))['then'](respondWithResult(_0x150b5d,null))['catch'](handleError(_0x150b5d,null));};exports[_0xacda('0xb1')]=function(_0x578e85,_0x17ff75){var _0x40c3ae=path[_0xacda('0xb2')](config[_0xacda('0xb3')],_0xacda('0xb4'));return db['User'][_0xacda('0x33')]({'where':{'id':_0x578e85['params']['id']},'attributes':['id',_0xacda('0xae')],'raw':!![]})['then'](handleEntityNotFound(_0x17ff75,null))['then'](function(_0x57b3eb){if(_0x57b3eb){if(_[_0xacda('0x65')](_0x57b3eb[_0xacda('0xae')])){return _0x17ff75[_0xacda('0xb5')](_0x40c3ae);}else{if(!fs[_0xacda('0xb6')](path[_0xacda('0xb2')](config[_0xacda('0xb3')],_0xacda('0xb7'),_0x57b3eb[_0xacda('0xae')]))){return _0x17ff75['download'](_0x40c3ae);}return _0x17ff75[_0xacda('0xb5')](path[_0xacda('0xb2')](config[_0xacda('0xb3')],_0xacda('0xb7'),_0x57b3eb['userpic']));}}})['catch'](handleError(_0x17ff75,null));};exports['getOpenTabs']=function(_0x5e27f7,_0x57ec6e){return db[_0xacda('0x37')]['find']({'where':{'id':_0x5e27f7[_0xacda('0x4f')]['id']},'attributes':['id']})[_0xacda('0x11')](handleEntityNotFound(_0x57ec6e,null))[_0xacda('0x11')](function(_0x596e3f){var _0x2eea16=[];values=_0x596e3f['dataValues'];_0x2eea16[_0xacda('0x46')](get_open_tabs(_0xacda('0x49'),_0x596e3f['dataValues']));_0x2eea16[_0xacda('0x46')](get_open_tabs(_0xacda('0x59'),_0x596e3f[_0xacda('0x4a')]));_0x2eea16[_0xacda('0x46')](get_open_tabs(_0xacda('0x4c'),_0x596e3f['dataValues']));_0x2eea16[_0xacda('0x46')](get_open_tabs(_0xacda('0x4d'),_0x596e3f[_0xacda('0x4a')]));_0x2eea16[_0xacda('0x46')](get_open_tabs('fax',_0x596e3f['dataValues']));_0x2eea16[_0xacda('0x46')](get_open_tabs(_0xacda('0x4b'),_0x596e3f[_0xacda('0x4a')]));return Promise['all'](_0x2eea16);})[_0xacda('0x11')](function(_0x55746b){if(_0x55746b){var _0x2d5920=_['map'](values[_0xacda('0xb8')],function(_0x2281fb){return{'channel':'CHAT','id':_0x2281fb['id'],'createdAt':_0x2281fb['createdAt']};});var _0x1deacb=_['map'](values['FaxOpenTabs'],function(_0x3b20c0){return{'channel':'FAX','id':_0x3b20c0['id'],'createdAt':_0x3b20c0[_0xacda('0xb9')]};});var _0x54e6a1=_['map'](values[_0xacda('0xba')],function(_0x3a0dd7){return{'channel':_0xacda('0xbb'),'id':_0x3a0dd7['id'],'createdAt':_0x3a0dd7[_0xacda('0xb9')]};});var _0x57eeff=_[_0xacda('0x30')](values[_0xacda('0xbc')],function(_0x3ac0db){return{'channel':_0xacda('0xbd'),'id':_0x3ac0db['id'],'createdAt':_0x3ac0db[_0xacda('0xb9')]};});var _0x291938=_[_0xacda('0x30')](values['SmsOpenTabs'],function(_0x293ad3){return{'channel':_0xacda('0xbe'),'id':_0x293ad3['id'],'createdAt':_0x293ad3['createdAt']};});var _0x41a756=_[_0xacda('0x30')](values[_0xacda('0xbf')],function(_0x4f23d7){return{'channel':_0xacda('0xc0'),'id':_0x4f23d7['id'],'createdAt':_0x4f23d7[_0xacda('0xb9')]};});var _0x3b1b89=_['concat'](_0x2d5920,_0x1deacb,_0x54e6a1,_0x57eeff,_0x291938,_0x41a756);var _0x58c82f={'count':_0x3b1b89[_0xacda('0x48')],'rows':_0x3b1b89};return _0x58c82f;}else return null;})[_0xacda('0x11')](respondWithResult(_0x57ec6e,null))[_0xacda('0x1a')](handleError(_0x57ec6e,null));};exports[_0xacda('0xc1')]=function(_0x54608c,_0x4e1948){var _0x455759={};var _0x4f546c={};var _0x2fd6a2;var _0x4e1b90;return db[_0xacda('0x37')][_0xacda('0x92')]({'where':{'id':_0x54608c[_0xacda('0x4f')]['id']}})[_0xacda('0x11')](handleEntityNotFound(_0x4e1948,null))['then'](function(_0x1304af){if(_0x1304af){_0x2fd6a2=_0x1304af;_0x4f546c[_0xacda('0x50')]=_[_0xacda('0x52')](db[_0xacda('0xc2')][_0xacda('0x38')]);_0x4f546c[_0xacda('0x3f')]=_[_0xacda('0x52')](_0x54608c[_0xacda('0x3f')]);_0x4f546c[_0xacda('0x53')]=_[_0xacda('0x54')](_0x4f546c[_0xacda('0x50')],_0x4f546c[_0xacda('0x3f')]);_0x455759[_0xacda('0x45')]=_[_0xacda('0x54')](_0x4f546c[_0xacda('0x50')],qs[_0xacda('0x55')](_0x54608c['query'][_0xacda('0x55')]));_0x455759[_0xacda('0x45')]=_0x455759[_0xacda('0x45')][_0xacda('0x48')]?_0x455759['attributes']:_0x4f546c[_0xacda('0x50')];_0x455759[_0xacda('0xc3')]=qs[_0xacda('0xc4')](_0x54608c['query'][_0xacda('0xc4')]);_0x455759[_0xacda('0x3e')]=qs[_0xacda('0x53')](_['pick'](_0x54608c['query'],_0x4f546c['filters']));if(_0x54608c[_0xacda('0x3f')][_0xacda('0x2f')]){_0x455759[_0xacda('0x3e')]=_['merge'](_0x455759['where'],{'$or':_[_0xacda('0x30')](_0x455759['attributes'],function(_0x3937b1){var _0x42de3f={};_0x42de3f[_0x3937b1]={'$like':'%'+_0x54608c['query'][_0xacda('0x2f')]+'%'};return _0x42de3f;})});}_0x455759=_[_0xacda('0x56')]({},_0x455759,_0x54608c[_0xacda('0x57')]);return _0x2fd6a2['getContacts'](_0x455759);}})['then'](function(_0x208712){if(_0x208712){_0x4e1b90=_0x208712[_0xacda('0x48')];if(_0x54608c[_0xacda('0x3f')][_0xacda('0xc5')](_0xacda('0x40'))){_0x455759[_0xacda('0x41')]=[{'model':db['CmList'],'as':'List','required':![]},{'model':db[_0xacda('0xc6')],'as':_0xacda('0xc7'),'attributes':['id',_0xacda('0x34'),'color'],'where':_0x54608c['query']['tag']?{'id':_0x54608c[_0xacda('0x3f')][_0xacda('0xc8')]}:undefined,'required':_0x54608c[_0xacda('0x3f')][_0xacda('0xc8')]?!![]:![]}];}if(!_0x54608c[_0xacda('0x3f')][_0xacda('0xc5')](_0xacda('0xc9'))){_0x455759[_0xacda('0x1e')]=qs[_0xacda('0x1e')](_0x54608c['query'][_0xacda('0x1e')]);_0x455759[_0xacda('0x20')]=qs[_0xacda('0x20')](_0x54608c['query'][_0xacda('0x20')]);}return _0x2fd6a2[_0xacda('0xc1')](_0x455759);}})[_0xacda('0x11')](function(_0x4d42e8){if(_0x4d42e8){return _0x4d42e8?{'count':_0x4e1b90,'rows':_0x4d42e8}:null;}})['then'](respondWithResult(_0x4e1948,null))[_0xacda('0x1a')](handleError(_0x4e1948,null));};exports[_0xacda('0xca')]=function(_0x4b9fe4,_0x46e2fb){var _0x1bfd4f;var _0x445592={};var _0xde7f3c;return db[_0xacda('0x37')][_0xacda('0x92')]({'where':{'id':_0x4b9fe4[_0xacda('0x4f')]['id']},'attributes':['id','name',_0xacda('0x25')]})[_0xacda('0x11')](handleEntityNotFound(_0x46e2fb,null))[_0xacda('0x11')](function(_0x35d814){if(!utils[_0xacda('0xa8')](_0x4b9fe4[_0xacda('0x3f')][_0xacda('0x96')])){throw new db[(_0xacda('0x89'))][(_0xacda('0x8a'))](_0xacda('0x98'));}_0x1bfd4f=_0x35d814;var _0x19e9c8={};_0x19e9c8[_0xacda('0x50')]=_[_0xacda('0x52')](db[_['capitalize'](_0x4b9fe4['query'][_0xacda('0x96')])+_0xacda('0xcb')][_0xacda('0x38')]);_0x19e9c8[_0xacda('0x3f')]=_['keys'](_0x4b9fe4[_0xacda('0x3f')]);_0x19e9c8[_0xacda('0x53')]=_[_0xacda('0x54')](_0x19e9c8[_0xacda('0x50')],_0x19e9c8[_0xacda('0x3f')]);_0x445592['attributes']=_[_0xacda('0x54')](_0x19e9c8[_0xacda('0x50')],qs['fields'](_0x4b9fe4[_0xacda('0x3f')][_0xacda('0x55')]));_0x445592[_0xacda('0x45')]=_0x445592['attributes'][_0xacda('0x48')]?_0x445592['attributes']:_0x19e9c8[_0xacda('0x50')];_0x445592['order']=qs[_0xacda('0xc4')](_0x4b9fe4[_0xacda('0x3f')][_0xacda('0xc4')]);_0x445592[_0xacda('0x3e')]=qs[_0xacda('0x53')](_['pick'](_0x4b9fe4[_0xacda('0x3f')],_0x19e9c8[_0xacda('0x53')]));if(_0x4b9fe4['query'][_0xacda('0x2f')]){_0x445592[_0xacda('0x3e')]=_[_0xacda('0x56')](_0x445592['where'],{'$or':_[_0xacda('0x30')](_0x445592[_0xacda('0x45')],function(_0xe27af4){var _0x399027={};_0x399027[_0xe27af4]={'$like':'%'+_0x4b9fe4[_0xacda('0x3f')][_0xacda('0x2f')]+'%'};return _0x399027;})});}_0x445592=_['merge']({},_0x445592,_0x4b9fe4[_0xacda('0x57')]);switch(_0x1bfd4f[_0xacda('0x25')]){case _0xacda('0x2b'):return db[_[_0xacda('0x9a')](_0x4b9fe4['query']['channel'])+_0xacda('0xcb')][_0xacda('0xa1')](_0x445592);case _0xacda('0x7b'):case _0xacda('0x26'):return _0x1bfd4f[_0xacda('0x2a')+_[_0xacda('0x9a')](_0x4b9fe4['query'][_0xacda('0x96')])+'Queues'](_0x445592);default:throw new db[(_0xacda('0x89'))][(_0xacda('0x8a'))](_0xacda('0xcc'));}})[_0xacda('0x11')](function(_0x2ce971){_0xde7f3c=_0x2ce971[_0xacda('0x48')];if(!_0x4b9fe4[_0xacda('0x3f')][_0xacda('0xc5')](_0xacda('0xc9'))){_0x445592['limit']=qs['limit'](_0x4b9fe4['query'][_0xacda('0x1e')]);_0x445592['offset']=qs[_0xacda('0x20')](_0x4b9fe4[_0xacda('0x3f')]['offset']);}switch(_0x1bfd4f['role']){case _0xacda('0x2b'):return db[_[_0xacda('0x9a')](_0x4b9fe4[_0xacda('0x3f')][_0xacda('0x96')])+_0xacda('0xcb')][_0xacda('0xa1')](_0x445592);case _0xacda('0x7b'):case _0xacda('0x26'):return _0x1bfd4f[_0xacda('0x2a')+_[_0xacda('0x9a')](_0x4b9fe4[_0xacda('0x3f')]['channel'])+_0xacda('0x9b')](_0x445592);}})[_0xacda('0x11')](function(_0x26541a){return{'count':_0xde7f3c,'rows':_0x26541a};})[_0xacda('0x11')](respondWithResult(_0x46e2fb,null))[_0xacda('0x1a')](handleError(_0x46e2fb,null));};exports[_0xacda('0xcd')]=function(_0x3f47ed,_0x2f8e64){var _0x1ce495={};var _0x440e6e={};var _0x1c9e01;var _0xaa9f5;return db['User'][_0xacda('0x92')]({'where':{'id':_0x3f47ed[_0xacda('0x4f')]['id']}})[_0xacda('0x11')](handleEntityNotFound(_0x2f8e64,null))['then'](function(_0x166e1d){if(_0x166e1d){_0x1c9e01=_0x166e1d;_0x440e6e[_0xacda('0x50')]=_[_0xacda('0x52')](db['UserVoiceQueueRt'][_0xacda('0x38')]);_0x440e6e[_0xacda('0x3f')]=_[_0xacda('0x52')](_0x3f47ed[_0xacda('0x3f')]);_0x440e6e[_0xacda('0x53')]=_[_0xacda('0x54')](_0x440e6e[_0xacda('0x50')],_0x440e6e[_0xacda('0x3f')]);_0x1ce495[_0xacda('0x45')]=_[_0xacda('0x54')](_0x440e6e['model'],qs[_0xacda('0x55')](_0x3f47ed['query']['fields']));_0x1ce495[_0xacda('0x45')]=_0x1ce495[_0xacda('0x45')][_0xacda('0x48')]?_0x1ce495['attributes']:_0x440e6e['model'];_0x1ce495['order']=qs['sort'](_0x3f47ed[_0xacda('0x3f')][_0xacda('0xc4')]);_0x1ce495[_0xacda('0x3e')]=qs[_0xacda('0x53')](_[_0xacda('0xce')](_0x3f47ed[_0xacda('0x3f')],_0x440e6e[_0xacda('0x53')]));if(_0x3f47ed[_0xacda('0x3f')]['filter']){_0x1ce495[_0xacda('0x3e')]=_[_0xacda('0x56')](_0x1ce495['where'],{'$or':_[_0xacda('0x30')](_0x1ce495['attributes'],function(_0x140f0e){var _0x2922ef={};_0x2922ef[_0x140f0e]={'$like':'%'+_0x3f47ed[_0xacda('0x3f')][_0xacda('0x2f')]+'%'};return _0x2922ef;})});}_0x1ce495=_[_0xacda('0x56')]({},_0x1ce495,_0x3f47ed[_0xacda('0x57')]);return _0x1c9e01['getVoiceQueuesRt'](_0x1ce495);}})[_0xacda('0x11')](function(_0x535257){if(_0x535257){_0xaa9f5=_0x535257[_0xacda('0x48')];if(!_0x3f47ed[_0xacda('0x3f')][_0xacda('0xc5')](_0xacda('0xc9'))){_0x1ce495['limit']=qs[_0xacda('0x1e')](_0x3f47ed[_0xacda('0x3f')][_0xacda('0x1e')]);_0x1ce495[_0xacda('0x20')]=qs[_0xacda('0x20')](_0x3f47ed['query']['offset']);}return _0x1c9e01[_0xacda('0xcd')](_0x1ce495);}})[_0xacda('0x11')](function(_0x407ae0){if(_0x407ae0){return _0x407ae0?{'count':_0xaa9f5,'rows':_0x407ae0}:null;}})[_0xacda('0x11')](respondWithResult(_0x2f8e64,null))[_0xacda('0x1a')](handleError(_0x2f8e64,null));};exports[_0xacda('0xcf')]=function(_0x422c59,_0x24c6b8){var _0x51fe80={};var _0x182eb8={};var _0x7e9fd8;var _0x1e8593;return db[_0xacda('0x37')][_0xacda('0x92')]({'where':{'id':_0x422c59[_0xacda('0x4f')]['id']}})['then'](handleEntityNotFound(_0x24c6b8,null))['then'](function(_0x312e08){if(_0x312e08){_0x7e9fd8=_0x312e08;_0x182eb8[_0xacda('0x50')]=_['keys'](db[_0xacda('0xd0')][_0xacda('0x38')]);_0x182eb8[_0xacda('0x3f')]=_[_0xacda('0x52')](_0x422c59[_0xacda('0x3f')]);_0x182eb8[_0xacda('0x53')]=_[_0xacda('0x54')](_0x182eb8['model'],_0x182eb8['query']);_0x51fe80[_0xacda('0x45')]=_[_0xacda('0x54')](_0x182eb8[_0xacda('0x50')],qs[_0xacda('0x55')](_0x422c59[_0xacda('0x3f')][_0xacda('0x55')]));_0x51fe80[_0xacda('0x45')]=_0x51fe80[_0xacda('0x45')]['length']?_0x51fe80['attributes']:_0x182eb8[_0xacda('0x50')];_0x51fe80['order']=qs[_0xacda('0xc4')](_0x422c59[_0xacda('0x3f')][_0xacda('0xc4')]);_0x51fe80[_0xacda('0x3e')]=qs[_0xacda('0x53')](_[_0xacda('0xce')](_0x422c59['query'],_0x182eb8[_0xacda('0x53')]));if(_0x422c59['query'][_0xacda('0x2f')]){_0x51fe80['where']=_[_0xacda('0x56')](_0x51fe80[_0xacda('0x3e')],{'$or':_[_0xacda('0x30')](_0x51fe80[_0xacda('0x45')],function(_0x35926a){var _0x2247da={};_0x2247da[_0x35926a]={'$like':'%'+_0x422c59[_0xacda('0x3f')][_0xacda('0x2f')]+'%'};return _0x2247da;})});}_0x51fe80=_[_0xacda('0x56')]({},_0x51fe80,_0x422c59['options']);return _0x7e9fd8[_0xacda('0xcf')](_0x51fe80);}})[_0xacda('0x11')](function(_0x55f615){if(_0x55f615){_0x1e8593=_0x55f615['length'];if(!_0x422c59[_0xacda('0x3f')][_0xacda('0xc5')]('nolimit')){_0x51fe80[_0xacda('0x1e')]=qs[_0xacda('0x1e')](_0x422c59[_0xacda('0x3f')][_0xacda('0x1e')]);_0x51fe80[_0xacda('0x20')]=qs[_0xacda('0x20')](_0x422c59[_0xacda('0x3f')][_0xacda('0x20')]);}return _0x7e9fd8[_0xacda('0xcf')](_0x51fe80);}})['then'](function(_0x43fbc4){if(_0x43fbc4){return _0x43fbc4?{'count':_0x1e8593,'rows':_0x43fbc4}:null;}})[_0xacda('0x11')](respondWithResult(_0x24c6b8,null))['catch'](handleError(_0x24c6b8,null));};exports[_0xacda('0xd1')]=function(_0x4a4949,_0x4c9cd0){var _0x4258cf={'raw':!![],'where':{}};var _0x4c1cae={};var _0x8069cb={'count':0x0,'rows':[]};return db[_0xacda('0x37')][_0xacda('0x92')]({'where':{'id':_0x4a4949[_0xacda('0x4f')]['id']}})[_0xacda('0x11')](handleEntityNotFound(_0x4c9cd0,null))[_0xacda('0x11')](function(_0x222460){if(_0x222460){_0x4c1cae[_0xacda('0x50')]=_[_0xacda('0x52')](db[_0xacda('0xd2')]['rawAttributes']);_0x4c1cae[_0xacda('0x3f')]=_['keys'](_0x4a4949[_0xacda('0x3f')]);_0x4c1cae['filters']=_[_0xacda('0x54')](_0x4c1cae['model'],_0x4c1cae[_0xacda('0x3f')]);_0x4258cf['attributes']=_['intersection'](_0x4c1cae['model'],qs[_0xacda('0x55')](_0x4a4949[_0xacda('0x3f')][_0xacda('0x55')]));_0x4258cf['attributes']=_0x4258cf[_0xacda('0x45')][_0xacda('0x48')]?_0x4258cf['attributes']:_0x4c1cae[_0xacda('0x50')];if(!_0x4a4949[_0xacda('0x3f')][_0xacda('0xc5')](_0xacda('0xc9'))){_0x4258cf[_0xacda('0x1e')]=qs[_0xacda('0x1e')](_0x4a4949[_0xacda('0x3f')]['limit']);_0x4258cf[_0xacda('0x20')]=qs[_0xacda('0x20')](_0x4a4949[_0xacda('0x3f')][_0xacda('0x20')]);}_0x4258cf[_0xacda('0xc3')]=qs[_0xacda('0xc4')](_0x4a4949[_0xacda('0x3f')][_0xacda('0xc4')]);_0x4258cf[_0xacda('0x3e')]=qs[_0xacda('0x53')](_[_0xacda('0xce')](_0x4a4949[_0xacda('0x3f')],_0x4c1cae[_0xacda('0x53')]));_0x4258cf[_0xacda('0x3e')][_0xacda('0xd3')]=_0x222460['id'];if(_0x4a4949[_0xacda('0x3f')][_0xacda('0x2f')]){_0x4258cf[_0xacda('0x3e')]=_['merge'](_0x4258cf[_0xacda('0x3e')],{'$or':_[_0xacda('0x30')](_0x4258cf[_0xacda('0x45')],function(_0x5ebe7d){var _0xfbccce={};_0xfbccce[_0x5ebe7d]={'$like':'%'+_0x4a4949[_0xacda('0x3f')][_0xacda('0x2f')]+'%'};return _0xfbccce;})});}_0x4258cf=_[_0xacda('0x56')]({},_0x4258cf,_0x4a4949[_0xacda('0x57')]);return db['VoiceRecording'][_0xacda('0x21')]({'where':_0x4258cf[_0xacda('0x3e')]})['then'](function(_0x40605c){_0x8069cb[_0xacda('0x21')]=_0x40605c;if(_0x4a4949[_0xacda('0x3f')][_0xacda('0x40')]){_0x4258cf[_0xacda('0x41')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x4258cf);})['then'](function(_0x43cbce){_0x8069cb[_0xacda('0x47')]=_0x43cbce;return _0x8069cb;});}})[_0xacda('0x11')](respondWithFilteredResult(_0x4c9cd0,_0x4258cf))[_0xacda('0x1a')](handleError(_0x4c9cd0,null));};exports[_0xacda('0xd4')]=function(_0x145498,_0x143ba8){var _0x4fedae={'raw':!![],'where':{}};var _0x2dbe77={};var _0x4f5968={'count':0x0,'rows':[]};return db[_0xacda('0x37')]['findOne']({'where':{'id':_0x145498[_0xacda('0x4f')]['id']}})[_0xacda('0x11')](handleEntityNotFound(_0x143ba8,null))[_0xacda('0x11')](function(_0x332767){if(_0x332767){_0x2dbe77['model']=_[_0xacda('0x52')](db[_0xacda('0xd5')][_0xacda('0x38')]);_0x2dbe77[_0xacda('0x3f')]=_[_0xacda('0x52')](_0x145498[_0xacda('0x3f')]);_0x2dbe77['filters']=_[_0xacda('0x54')](_0x2dbe77[_0xacda('0x50')],_0x2dbe77['query']);_0x4fedae[_0xacda('0x45')]=_[_0xacda('0x54')](_0x2dbe77[_0xacda('0x50')],qs[_0xacda('0x55')](_0x145498[_0xacda('0x3f')]['fields']));_0x4fedae[_0xacda('0x45')]=_0x4fedae[_0xacda('0x45')][_0xacda('0x48')]?_0x4fedae[_0xacda('0x45')]:_0x2dbe77[_0xacda('0x50')];if(!_0x145498['query'][_0xacda('0xc5')](_0xacda('0xc9'))){_0x4fedae[_0xacda('0x1e')]=qs[_0xacda('0x1e')](_0x145498[_0xacda('0x3f')][_0xacda('0x1e')]);_0x4fedae[_0xacda('0x20')]=qs[_0xacda('0x20')](_0x145498[_0xacda('0x3f')][_0xacda('0x20')]);}_0x4fedae[_0xacda('0xc3')]=qs[_0xacda('0xc4')](_0x145498[_0xacda('0x3f')][_0xacda('0xc4')]);_0x4fedae[_0xacda('0x3e')]=qs[_0xacda('0x53')](_[_0xacda('0xce')](_0x145498[_0xacda('0x3f')],_0x2dbe77[_0xacda('0x53')]));_0x4fedae[_0xacda('0x3e')][_0xacda('0xd3')]=_0x332767['id'];if(_0x145498[_0xacda('0x3f')][_0xacda('0x2f')]){_0x4fedae['where']=_[_0xacda('0x56')](_0x4fedae[_0xacda('0x3e')],{'$or':_['map'](_0x4fedae[_0xacda('0x45')],function(_0x4eeb7f){var _0x1a9cd1={};_0x1a9cd1[_0x4eeb7f]={'$like':'%'+_0x145498['query']['filter']+'%'};return _0x1a9cd1;})});}_0x4fedae=_[_0xacda('0x56')]({},_0x4fedae,_0x145498['options']);return db['ScreenRecording'][_0xacda('0x21')]({'where':_0x4fedae[_0xacda('0x3e')]})[_0xacda('0x11')](function(_0x4112d9){_0x4f5968[_0xacda('0x21')]=_0x4112d9;if(_0x145498[_0xacda('0x3f')]['includeAll']){_0x4fedae[_0xacda('0x41')]=[{'all':!![]}];}return db[_0xacda('0xd5')][_0xacda('0xa1')](_0x4fedae);})['then'](function(_0x8a022d){_0x4f5968[_0xacda('0x47')]=_0x8a022d;return _0x4f5968;});}})[_0xacda('0x11')](respondWithFilteredResult(_0x143ba8,_0x4fedae))[_0xacda('0x1a')](handleError(_0x143ba8,null));};exports[_0xacda('0xd6')]=function(_0x1e256c,_0x38297d){var _0x4f063c={};var _0x2d2f31={};var _0x33c0ef;var _0x25a9ed;return db[_0xacda('0x37')]['findOne']({'where':{'id':_0x1e256c[_0xacda('0x4f')]['id']}})[_0xacda('0x11')](handleEntityNotFound(_0x38297d,null))[_0xacda('0x11')](function(_0x49a674){if(_0x49a674){_0x33c0ef=_0x49a674;_0x2d2f31[_0xacda('0x50')]=_[_0xacda('0x52')](db[_0xacda('0xd7')][_0xacda('0x38')]);_0x2d2f31['query']=_[_0xacda('0x52')](_0x1e256c[_0xacda('0x3f')]);_0x2d2f31[_0xacda('0x53')]=_[_0xacda('0x54')](_0x2d2f31[_0xacda('0x50')],_0x2d2f31[_0xacda('0x3f')]);_0x4f063c['attributes']=_[_0xacda('0x54')](_0x2d2f31[_0xacda('0x50')],qs[_0xacda('0x55')](_0x1e256c[_0xacda('0x3f')]['fields']));_0x4f063c[_0xacda('0x45')]=_0x4f063c[_0xacda('0x45')]['length']?_0x4f063c[_0xacda('0x45')]:_0x2d2f31[_0xacda('0x50')];_0x4f063c[_0xacda('0xc3')]=qs[_0xacda('0xc4')](_0x1e256c[_0xacda('0x3f')][_0xacda('0xc4')]);_0x4f063c['where']=qs['filters'](_[_0xacda('0xce')](_0x1e256c['query'],_0x2d2f31[_0xacda('0x53')]));if(_0x1e256c[_0xacda('0x3f')][_0xacda('0x2f')]){_0x4f063c[_0xacda('0x3e')]=_[_0xacda('0x56')](_0x4f063c[_0xacda('0x3e')],{'$or':_['map'](_0x4f063c[_0xacda('0x45')],function(_0x25aa40){var _0x554aac={};_0x554aac[_0x25aa40]={'$like':'%'+_0x1e256c[_0xacda('0x3f')]['filter']+'%'};return _0x554aac;})});}_0x4f063c=_[_0xacda('0x56')]({},_0x4f063c,_0x1e256c[_0xacda('0x57')]);return _0x33c0ef[_0xacda('0xd6')](_0x4f063c);}})['then'](function(_0x1c48dd){if(_0x1c48dd){_0x25a9ed=_0x1c48dd[_0xacda('0x48')];if(!_0x1e256c[_0xacda('0x3f')][_0xacda('0xc5')](_0xacda('0xc9'))){_0x4f063c[_0xacda('0x1e')]=qs['limit'](_0x1e256c[_0xacda('0x3f')][_0xacda('0x1e')]);_0x4f063c['offset']=qs[_0xacda('0x20')](_0x1e256c['query'][_0xacda('0x20')]);}return _0x33c0ef[_0xacda('0xd6')](_0x4f063c);}})['then'](function(_0x3baa80){if(_0x3baa80){return _0x3baa80?{'count':_0x25a9ed,'rows':_0x3baa80}:null;}})['then'](respondWithResult(_0x38297d,null))[_0xacda('0x1a')](handleError(_0x38297d,null));};exports['getOpenchannelInteractions']=function(_0x528229,_0x12115a){var _0xfdf214={};var _0x9968c8={};var _0xc0d84f;var _0x63a3f7;return db[_0xacda('0x37')][_0xacda('0x92')]({'where':{'id':_0x528229[_0xacda('0x4f')]['id']}})[_0xacda('0x11')](handleEntityNotFound(_0x12115a,null))['then'](function(_0x1e644f){if(_0x1e644f){_0xc0d84f=_0x1e644f;_0x9968c8[_0xacda('0x50')]=_[_0xacda('0x52')](db[_0xacda('0xd8')][_0xacda('0x38')]);_0x9968c8['query']=_[_0xacda('0x52')](_0x528229[_0xacda('0x3f')]);_0x9968c8[_0xacda('0x53')]=_[_0xacda('0x54')](_0x9968c8[_0xacda('0x50')],_0x9968c8['query']);_0xfdf214[_0xacda('0x45')]=_[_0xacda('0x54')](_0x9968c8[_0xacda('0x50')],qs['fields'](_0x528229['query'][_0xacda('0x55')]));_0xfdf214[_0xacda('0x45')]=_0xfdf214['attributes'][_0xacda('0x48')]?_0xfdf214['attributes']:_0x9968c8[_0xacda('0x50')];_0xfdf214['order']=qs[_0xacda('0xc4')](_0x528229[_0xacda('0x3f')][_0xacda('0xc4')]);_0xfdf214[_0xacda('0x3e')]=qs['filters'](_[_0xacda('0xce')](_0x528229[_0xacda('0x3f')],_0x9968c8['filters']));if(_0x528229[_0xacda('0x3f')][_0xacda('0x2f')]){_0xfdf214[_0xacda('0x3e')]=_['merge'](_0xfdf214['where'],{'$or':_[_0xacda('0x30')](_0xfdf214['attributes'],function(_0x14f3ca){var _0x323b6e={};_0x323b6e[_0x14f3ca]={'$like':'%'+_0x528229[_0xacda('0x3f')][_0xacda('0x2f')]+'%'};return _0x323b6e;})});}_0xfdf214=_[_0xacda('0x56')]({},_0xfdf214,_0x528229[_0xacda('0x57')]);return _0xc0d84f[_0xacda('0xd9')](_0xfdf214);}})[_0xacda('0x11')](function(_0x12e1b7){if(_0x12e1b7){_0x63a3f7=_0x12e1b7[_0xacda('0x48')];if(!_0x528229[_0xacda('0x3f')][_0xacda('0xc5')](_0xacda('0xc9'))){_0xfdf214[_0xacda('0x1e')]=qs[_0xacda('0x1e')](_0x528229[_0xacda('0x3f')]['limit']);_0xfdf214[_0xacda('0x20')]=qs['offset'](_0x528229[_0xacda('0x3f')][_0xacda('0x20')]);}return _0xc0d84f['getOpenchannelInteractions'](_0xfdf214);}})[_0xacda('0x11')](function(_0xc4d395){if(_0xc4d395){return _0xc4d395?{'count':_0x63a3f7,'rows':_0xc4d395}:null;}})[_0xacda('0x11')](respondWithResult(_0x12115a,null))[_0xacda('0x1a')](handleError(_0x12115a,null));};exports[_0xacda('0xda')]=function(_0x189de3,_0x40d2ba){var _0x3f91e5={'raw':!![],'where':{}};var _0x360ab2={};var _0x28f87b={'count':0x0,'rows':[]};return db[_0xacda('0x37')][_0xacda('0x92')]({'where':{'id':_0x189de3['params']['id']}})[_0xacda('0x11')](handleEntityNotFound(_0x40d2ba,null))[_0xacda('0x11')](function(_0x4f432a){if(_0x4f432a){_0x360ab2[_0xacda('0x50')]=_[_0xacda('0x52')](db[_0xacda('0xdb')][_0xacda('0x38')]);_0x360ab2[_0xacda('0x3f')]=_[_0xacda('0x52')](_0x189de3[_0xacda('0x3f')]);_0x360ab2[_0xacda('0x53')]=_[_0xacda('0x54')](_0x360ab2['model'],_0x360ab2[_0xacda('0x3f')]);_0x3f91e5[_0xacda('0x45')]=_[_0xacda('0x54')](_0x360ab2[_0xacda('0x50')],qs[_0xacda('0x55')](_0x189de3[_0xacda('0x3f')][_0xacda('0x55')]));_0x3f91e5['attributes']=_0x3f91e5['attributes'][_0xacda('0x48')]?_0x3f91e5['attributes']:_0x360ab2[_0xacda('0x50')];if(!_0x189de3['query']['hasOwnProperty'](_0xacda('0xc9'))){_0x3f91e5[_0xacda('0x1e')]=qs['limit'](_0x189de3[_0xacda('0x3f')]['limit']);_0x3f91e5[_0xacda('0x20')]=qs[_0xacda('0x20')](_0x189de3['query'][_0xacda('0x20')]);}_0x3f91e5[_0xacda('0xc3')]=qs[_0xacda('0xc4')](_0x189de3[_0xacda('0x3f')][_0xacda('0xc4')]);_0x3f91e5['where']=qs['filters'](_[_0xacda('0xce')](_0x189de3['query'],_0x360ab2[_0xacda('0x53')]));_0x3f91e5['where'][_0xacda('0xd3')]=_0x4f432a['id'];if(_0x189de3['query'][_0xacda('0x2f')]){_0x3f91e5[_0xacda('0x3e')]=_[_0xacda('0x56')](_0x3f91e5['where'],{'$or':_[_0xacda('0x30')](_0x3f91e5['attributes'],function(_0x37759c){var _0x2ba46d={};_0x2ba46d[_0x37759c]={'$like':'%'+_0x189de3[_0xacda('0x3f')]['filter']+'%'};return _0x2ba46d;})});}_0x3f91e5=_[_0xacda('0x56')]({},_0x3f91e5,_0x189de3[_0xacda('0x57')]);return db[_0xacda('0xdb')][_0xacda('0x21')]({'where':_0x3f91e5[_0xacda('0x3e')]})[_0xacda('0x11')](function(_0x41fe08){_0x28f87b[_0xacda('0x21')]=_0x41fe08;if(_0x189de3[_0xacda('0x3f')]['includeAll']){_0x3f91e5[_0xacda('0x41')]=[{'all':!![]}];}return db[_0xacda('0xdb')][_0xacda('0xa1')](_0x3f91e5);})[_0xacda('0x11')](function(_0x3f1c48){_0x28f87b[_0xacda('0x47')]=_0x3f1c48;return _0x28f87b;});}})[_0xacda('0x11')](respondWithFilteredResult(_0x40d2ba,_0x3f91e5))[_0xacda('0x1a')](handleError(_0x40d2ba,null));};exports[_0xacda('0xdc')]=function(_0x226808,_0x10be91){var _0x30d9bc={};var _0x534231={};var _0x4d1c0b;var _0x2451d8;return db['User'][_0xacda('0x92')]({'where':{'id':_0x226808['params']['id']}})[_0xacda('0x11')](handleEntityNotFound(_0x10be91,null))[_0xacda('0x11')](function(_0x2cdac1){if(_0x2cdac1){_0x4d1c0b=_0x2cdac1;_0x534231['model']=_['keys'](db['SmsInteraction']['rawAttributes']);_0x534231[_0xacda('0x3f')]=_[_0xacda('0x52')](_0x226808[_0xacda('0x3f')]);_0x534231[_0xacda('0x53')]=_[_0xacda('0x54')](_0x534231[_0xacda('0x50')],_0x534231['query']);_0x30d9bc[_0xacda('0x45')]=_['intersection'](_0x534231['model'],qs[_0xacda('0x55')](_0x226808['query'][_0xacda('0x55')]));_0x30d9bc[_0xacda('0x45')]=_0x30d9bc[_0xacda('0x45')][_0xacda('0x48')]?_0x30d9bc[_0xacda('0x45')]:_0x534231[_0xacda('0x50')];_0x30d9bc['order']=qs[_0xacda('0xc4')](_0x226808[_0xacda('0x3f')][_0xacda('0xc4')]);_0x30d9bc['where']=qs[_0xacda('0x53')](_[_0xacda('0xce')](_0x226808[_0xacda('0x3f')],_0x534231[_0xacda('0x53')]));if(_0x226808['query']['filter']){_0x30d9bc[_0xacda('0x3e')]=_[_0xacda('0x56')](_0x30d9bc[_0xacda('0x3e')],{'$or':_['map'](_0x30d9bc[_0xacda('0x45')],function(_0x342016){var _0x538f8f={};_0x538f8f[_0x342016]={'$like':'%'+_0x226808[_0xacda('0x3f')][_0xacda('0x2f')]+'%'};return _0x538f8f;})});}_0x30d9bc=_[_0xacda('0x56')]({},_0x30d9bc,_0x226808['options']);return _0x4d1c0b[_0xacda('0xdc')](_0x30d9bc);}})[_0xacda('0x11')](function(_0x2d6cba){if(_0x2d6cba){_0x2451d8=_0x2d6cba[_0xacda('0x48')];if(!_0x226808[_0xacda('0x3f')][_0xacda('0xc5')](_0xacda('0xc9'))){_0x30d9bc[_0xacda('0x1e')]=qs[_0xacda('0x1e')](_0x226808[_0xacda('0x3f')][_0xacda('0x1e')]);_0x30d9bc[_0xacda('0x20')]=qs[_0xacda('0x20')](_0x226808[_0xacda('0x3f')][_0xacda('0x20')]);}return _0x4d1c0b['getSmsInteractions'](_0x30d9bc);}})[_0xacda('0x11')](function(_0x4813ad){if(_0x4813ad){return _0x4813ad?{'count':_0x2451d8,'rows':_0x4813ad}:null;}})['then'](respondWithResult(_0x10be91,null))['catch'](handleError(_0x10be91,null));};exports['getFaxInteractions']=function(_0x54d1aa,_0xc60ec3){var _0x244425={};var _0x1a29ab={};var _0x4dc8a1;var _0x352229;return db[_0xacda('0x37')][_0xacda('0x92')]({'where':{'id':_0x54d1aa[_0xacda('0x4f')]['id']}})[_0xacda('0x11')](handleEntityNotFound(_0xc60ec3,null))['then'](function(_0x2c75ee){if(_0x2c75ee){_0x4dc8a1=_0x2c75ee;_0x1a29ab[_0xacda('0x50')]=_[_0xacda('0x52')](db[_0xacda('0xdd')][_0xacda('0x38')]);_0x1a29ab['query']=_['keys'](_0x54d1aa[_0xacda('0x3f')]);_0x1a29ab[_0xacda('0x53')]=_['intersection'](_0x1a29ab[_0xacda('0x50')],_0x1a29ab[_0xacda('0x3f')]);_0x244425[_0xacda('0x45')]=_[_0xacda('0x54')](_0x1a29ab[_0xacda('0x50')],qs[_0xacda('0x55')](_0x54d1aa[_0xacda('0x3f')][_0xacda('0x55')]));_0x244425[_0xacda('0x45')]=_0x244425[_0xacda('0x45')][_0xacda('0x48')]?_0x244425[_0xacda('0x45')]:_0x1a29ab[_0xacda('0x50')];_0x244425[_0xacda('0xc3')]=qs[_0xacda('0xc4')](_0x54d1aa['query'][_0xacda('0xc4')]);_0x244425[_0xacda('0x3e')]=qs[_0xacda('0x53')](_['pick'](_0x54d1aa['query'],_0x1a29ab['filters']));if(_0x54d1aa[_0xacda('0x3f')][_0xacda('0x2f')]){_0x244425[_0xacda('0x3e')]=_['merge'](_0x244425[_0xacda('0x3e')],{'$or':_['map'](_0x244425['attributes'],function(_0x2cbeba){var _0x3b3a69={};_0x3b3a69[_0x2cbeba]={'$like':'%'+_0x54d1aa[_0xacda('0x3f')]['filter']+'%'};return _0x3b3a69;})});}_0x244425=_['merge']({},_0x244425,_0x54d1aa[_0xacda('0x57')]);return _0x4dc8a1[_0xacda('0xde')](_0x244425);}})[_0xacda('0x11')](function(_0x43a4e4){if(_0x43a4e4){_0x352229=_0x43a4e4[_0xacda('0x48')];if(!_0x54d1aa[_0xacda('0x3f')][_0xacda('0xc5')](_0xacda('0xc9'))){_0x244425[_0xacda('0x1e')]=qs[_0xacda('0x1e')](_0x54d1aa['query'][_0xacda('0x1e')]);_0x244425['offset']=qs['offset'](_0x54d1aa[_0xacda('0x3f')]['offset']);}return _0x4dc8a1[_0xacda('0xde')](_0x244425);}})['then'](function(_0x365332){if(_0x365332){return _0x365332?{'count':_0x352229,'rows':_0x365332}:null;}})[_0xacda('0x11')](respondWithResult(_0xc60ec3,null))[_0xacda('0x1a')](handleError(_0xc60ec3,null));};exports[_0xacda('0xdf')]=function(_0x4a0792,_0x591c06){var _0x22c056={};var _0x2359f5={};var _0x3a2563;var _0x4058c8;return db['User'][_0xacda('0x92')]({'where':{'id':_0x4a0792['params']['id']}})[_0xacda('0x11')](handleEntityNotFound(_0x591c06,null))['then'](function(_0x1f48bf){if(_0x1f48bf){_0x3a2563=_0x1f48bf;_0x2359f5[_0xacda('0x50')]=_[_0xacda('0x52')](db[_0xacda('0xe0')][_0xacda('0x38')]);_0x2359f5[_0xacda('0x3f')]=_[_0xacda('0x52')](_0x4a0792[_0xacda('0x3f')]);_0x2359f5['filters']=_[_0xacda('0x54')](_0x2359f5[_0xacda('0x50')],_0x2359f5[_0xacda('0x3f')]);_0x22c056[_0xacda('0x45')]=_['intersection'](_0x2359f5[_0xacda('0x50')],qs[_0xacda('0x55')](_0x4a0792[_0xacda('0x3f')][_0xacda('0x55')]));_0x22c056[_0xacda('0x45')]=_0x22c056[_0xacda('0x45')]['length']?_0x22c056[_0xacda('0x45')]:_0x2359f5[_0xacda('0x50')];_0x22c056[_0xacda('0xc3')]=qs['sort'](_0x4a0792[_0xacda('0x3f')][_0xacda('0xc4')]);_0x22c056['where']=qs[_0xacda('0x53')](_['pick'](_0x4a0792['query'],_0x2359f5['filters']));if(_0x4a0792[_0xacda('0x3f')]['filter']){_0x22c056[_0xacda('0x3e')]=_[_0xacda('0x56')](_0x22c056[_0xacda('0x3e')],{'$or':_[_0xacda('0x30')](_0x22c056[_0xacda('0x45')],function(_0x3f7760){var _0x513c1c={};_0x513c1c[_0x3f7760]={'$like':'%'+_0x4a0792[_0xacda('0x3f')][_0xacda('0x2f')]+'%'};return _0x513c1c;})});}_0x22c056=_[_0xacda('0x56')]({},_0x22c056,_0x4a0792['options']);return _0x3a2563[_0xacda('0xdf')](_0x22c056);}})['then'](function(_0x225aa6){if(_0x225aa6){_0x4058c8=_0x225aa6[_0xacda('0x48')];if(!_0x4a0792[_0xacda('0x3f')][_0xacda('0xc5')](_0xacda('0xc9'))){_0x22c056[_0xacda('0x1e')]=qs[_0xacda('0x1e')](_0x4a0792['query'][_0xacda('0x1e')]);_0x22c056[_0xacda('0x20')]=qs[_0xacda('0x20')](_0x4a0792[_0xacda('0x3f')][_0xacda('0x20')]);}return _0x3a2563[_0xacda('0xdf')](_0x22c056);}})[_0xacda('0x11')](function(_0x530cd0){if(_0x530cd0){return _0x530cd0?{'count':_0x4058c8,'rows':_0x530cd0}:null;}})[_0xacda('0x11')](respondWithResult(_0x591c06,null))[_0xacda('0x1a')](handleError(_0x591c06,null));};exports[_0xacda('0xe1')]=function(_0x26e5ec,_0x2202ad,_0x1f1b88){var _0x389e4a;var _0x356cad;var _0x19b0a5;var _0x162335=!_[_0xacda('0x65')](_0x26e5ec['params']['id'])?_0x26e5ec[_0xacda('0x4f')]['id']:!_['isNil'](_0x26e5ec[_0xacda('0x7b')]['id'])?_0x26e5ec[_0xacda('0x7b')]['id']:null;return db['User'][_0xacda('0x33')]({'where':{'id':_0x162335,'role':{'$or':['admin','user',_0xacda('0x26')]}},'attributes':['id',_0xacda('0x34'),'phone',_0xacda('0xe2'),'role',_0xacda('0x60'),_0xacda('0x97')]})['then'](function(_0x1686b9){if(_0x1686b9){if(_0x1686b9['role']==='agent'){_0x389e4a=_0x1686b9;if(_0x26e5ec[_0xacda('0x5c')]['interface']){_0x19b0a5=util[_0xacda('0xe3')](_0xacda('0xe4'),_0x389e4a[_0x26e5ec[_0xacda('0x5c')][_0xacda('0xa3')]]);}else if(_0x26e5ec[_0xacda('0x5c')][_0xacda('0xe5')]){_0x19b0a5=util[_0xacda('0xe3')](_0xacda('0xe6'),_0x26e5ec[_0xacda('0x5c')][_0xacda('0xe5')]);}else{_0x19b0a5=util[_0xacda('0xe3')](_0xacda('0xe6'),_0x389e4a[_0xacda('0x34')]);}socket['to'](util[_0xacda('0xe3')](_0xacda('0xe7'),_0x389e4a[_0xacda('0x34')]))[_0xacda('0x27')]('user:forcelogout',{'user':{'id':_0x389e4a['id'],'name':_0x389e4a['name']},'ip':_0x26e5ec[_0xacda('0xe8')][_0xacda('0xe9')]||_0x26e5ec[_0xacda('0xea')][_0xacda('0xeb')]||_0x26e5ec[_0xacda('0xec')][_0xacda('0xeb')]||_0x26e5ec[_0xacda('0xea')]['socket']['remoteAddress']});return db[_0xacda('0xac')][_0xacda('0x29')]({'where':{'membername':_0x389e4a[_0xacda('0x34')]},'individualHooks':!![]});}}else{throw new db[(_0xacda('0x89'))][(_0xacda('0x8a'))](_0xacda('0xed'));}})['then'](function(){if(_0x389e4a){return _0x389e4a[_0xacda('0xee')]({'raw':!![]});}})['then'](function(_0x51079f){if(_0x389e4a){if(_0x51079f){_0x356cad=_0x51079f;if(_0x356cad[_0xacda('0x48')]){var _0x46aa47=_0x356cad[_0xacda('0x30')](function(_0x17ee07){var _0x2a9b6d={'membername':_0x389e4a[_0xacda('0x34')],'UserId':_0x389e4a['id'],'queue_name':_0x17ee07[_0xacda('0x34')],'VoiceQueueId':_0x17ee07['id'],'interface':_0x19b0a5,'paused':_0x389e4a[_0xacda('0x97')]||![],'penalty':_0x17ee07['UserVoiceQueue.penalty']||0x0};return db[_0xacda('0xac')]['upsert'](_0x2a9b6d);});return Promise[_0xacda('0x5b')](_0x46aa47);}}}})[_0xacda('0x11')](function(){if(_0x389e4a){return db[_0xacda('0xef')][_0xacda('0xa1')]({'where':{'membername':_0x389e4a[_0xacda('0x34')],'exitAt':null}});}})[_0xacda('0x11')](function(_0x20979b){if(_0x389e4a){var _0x25c89e=[];_0x20979b['forEach'](function(_0x1d6eae){_0x25c89e[_0xacda('0x46')](_0x1d6eae[_0xacda('0x24')]({'exitAt':moment()[_0xacda('0xe3')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise['all'](_0x25c89e);}})[_0xacda('0x11')](function(){if(_0x389e4a){var _0x294db4=[];var _0x4cca48=[];var _0x540d16=utils[_0xacda('0xf0')]();var _0x34e97d={'membername':_0x389e4a[_0xacda('0x34')],'interface':_0x19b0a5,'enterAt':moment()[_0xacda('0xe3')](_0xacda('0xf1')),'role':_0x389e4a[_0xacda('0x25')],'internal':_0x389e4a['internal']};_0x540d16[_0xacda('0xf2')](function(_0x4a4759){_0x294db4['push'](_[_0xacda('0x56')]({'channel':_0x4a4759,'type':_0xacda('0xf3'),'data1':_0x26e5ec[_0xacda('0x5c')]['device'],'data2':_0x19b0a5},_0x34e97d));if(_0x389e4a[_0xacda('0x97')]){_0x4cca48[_0xacda('0x46')](_['merge']({'channel':_0x4a4759,'type':_0xacda('0xf4'),'data1':'LOGININPAUSE'},_0x34e97d));}});return db['MemberReport'][_0xacda('0xf5')](_0x294db4[_0xacda('0xf6')](_0x4cca48),{'individualHooks':!![]});}})[_0xacda('0x11')](function(){if(_0x389e4a){return _0x389e4a['update']({'online':!![],'lastLoginAt':moment()['format'](_0xacda('0xf1')),'voicePause':_0x389e4a[_0xacda('0x97')]||![],'mailPause':_0x389e4a[_0xacda('0x97')]||![],'chatPause':_0x389e4a[_0xacda('0x97')]||![],'faxPause':_0x389e4a[_0xacda('0x97')]||![],'smsPause':_0x389e4a['loginInPause']||![],'openchannelPause':_0x389e4a['loginInPause']||![],'whatsappPause':_0x389e4a[_0xacda('0x97')]||![],'pauseType':_0x389e4a[_0xacda('0x97')]?'LOGININPAUSE':null,'interface':_0x19b0a5,'lastPauseAt':moment()[_0xacda('0xe3')](_0xacda('0xf1'))});}})[_0xacda('0x11')](function(_0x3627ac){if(_0x26e5ec['isMiddleware']){return _0x1f1b88();}else{return Promise[_0xacda('0xf7')](_0x3627ac)[_0xacda('0x11')](respondWithResult(_0x2202ad,null));}})[_0xacda('0x1a')](handleError(_0x2202ad,null));};exports[_0xacda('0xf8')]=function(_0x152abf,_0x1dbf56){var _0x11b68e;return db[_0xacda('0x37')][_0xacda('0x33')]({'where':{'id':_0x152abf[_0xacda('0x4f')]['id'],'role':'agent'},'attributes':['id',_0xacda('0x34'),_0xacda('0x25')]})[_0xacda('0x11')](handleEntityNotFound(_0x1dbf56,null))[_0xacda('0x11')](function(_0x1eb9f9){if(_0x1eb9f9){_0x11b68e=_0x1eb9f9;return db[_0xacda('0xac')][_0xacda('0x29')]({'where':{'membername':_0x11b68e['name']},'individualHooks':!![]});}})[_0xacda('0x11')](function(){return db[_0xacda('0xef')][_0xacda('0xa1')]({'where':{'membername':_0x11b68e[_0xacda('0x34')],'exitAt':null}});})[_0xacda('0x11')](function(_0xf849e9){var _0x3d7ee3=[];_0xf849e9[_0xacda('0xf2')](function(_0x46c69c){_0x3d7ee3[_0xacda('0x46')](_0x46c69c[_0xacda('0x24')]({'exitAt':moment()['format'](_0xacda('0xf1'))}));});return Promise['all'](_0x3d7ee3);})['then'](function(){return _0x11b68e[_0xacda('0x24')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x1dbf56,null))[_0xacda('0x1a')](handleError(_0x1dbf56,null));};exports[_0xacda('0xf9')]=function(_0x56ac86,_0x31634c){var _0x3a27c0;return db[_0xacda('0xac')][_0xacda('0x24')]({'paused':0x1},{'where':{'UserId':_0x56ac86['params']['id']},'individualHooks':!![]})['then'](function(){return db[_0xacda('0x37')][_0xacda('0x33')]({'where':{'id':_0x56ac86['params']['id'],'role':_0xacda('0x26')},'attributes':['id',_0xacda('0x34'),_0xacda('0x25'),_0xacda('0x60'),'interface',_0xacda('0xa2')]});})[_0xacda('0x11')](handleEntityNotFound(_0x31634c,null))[_0xacda('0x11')](function(_0x5eae97){if(_0x5eae97){_0x3a27c0=_0x5eae97;return respondWithRpcPromise(_0xacda('0xfa'),_0xacda('0xf9'),{'id':_0x3a27c0['id'],'name':_0x3a27c0[_0xacda('0x34')],'pause':!![]});}})[_0xacda('0x11')](function(){if(_0x3a27c0){return db[_0xacda('0xef')][_0xacda('0xa1')]({'where':{'membername':_0x3a27c0[_0xacda('0x34')],'type':_0xacda('0xf4'),'exitAt':null}});}})[_0xacda('0x11')](function(_0x33f674){if(_0x33f674[_0xacda('0x48')]){var _0x461f63=moment()['format'](_0xacda('0xf1'));for(var _0x5a501d=0x0,_0x11b185=_0x33f674['length'];_0x5a501d<_0x11b185;_0x5a501d++){_0x33f674[_0x5a501d][_0xacda('0xfb')]({'exitAt':_0x461f63});}}})[_0xacda('0x11')](function(){var _0x18cccf=[];var _0x459ac6=utils[_0xacda('0xf0')]();_0x459ac6[_0xacda('0xf2')](function(_0x336539){_0x18cccf['push']({'channel':_0x336539,'membername':_0x3a27c0[_0xacda('0x34')],'interface':_[_0xacda('0x65')](_0x3a27c0[_0xacda('0xa3')])?util['format']('SIP/%s',_0x3a27c0['name']):_0x3a27c0[_0xacda('0xa3')],'type':_0xacda('0xf4'),'enterAt':moment()[_0xacda('0xe3')](_0xacda('0xf1')),'data1':_0x56ac86['body'][_0xacda('0x3a')]||_0xacda('0xfc'),'role':_0x3a27c0['role'],'internal':_0x3a27c0['internal']});});return db[_0xacda('0xef')][_0xacda('0xf5')](_0x18cccf,{'individualHooks':!![]});})['then'](function(){return _0x3a27c0[_0xacda('0x24')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x56ac86[_0xacda('0x5c')][_0xacda('0x3a')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xacda('0xe3')](_0xacda('0xf1'))});})[_0xacda('0x11')](respondWithResult(_0x31634c,null))[_0xacda('0x1a')](handleError(_0x31634c,null));};exports[_0xacda('0xfd')]=function(_0x5e8a2b,_0x337665){if(_0x5e8a2b[_0xacda('0x5c')][_0xacda('0x96')]&&!utils['isValidChannel'](_0x5e8a2b[_0xacda('0x5c')][_0xacda('0x96')])){throw new APIBadRequestError(util[_0xacda('0xe3')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x5e8a2b[_0xacda('0x5c')]['channel']));}return db[_0xacda('0x37')][_0xacda('0x33')]({'where':{'id':_0x5e8a2b[_0xacda('0x4f')]['id']},'attributes':['id','name','role',_0xacda('0x60'),'interface','online',_0xacda('0xa4'),'mailPause',_0xacda('0xfe'),_0xacda('0xff'),'openchannelPause',_0xacda('0x100'),'whatsappPause',_0xacda('0x101'),'lastPauseAt']})[_0xacda('0x11')](function(_0x273e6e){if(!_0x273e6e){throw new APINotFoundError(util[_0xacda('0xe3')](_0xacda('0x102'),_0x5e8a2b[_0xacda('0x4f')]['id']));}return _0x273e6e[_0xacda('0xfd')](_0x5e8a2b['body'][_0xacda('0x96')]);})['then'](respondWithResult(_0x337665,null))['catch'](APIHandleError(_0x337665));};exports[_0xacda('0x103')]=function(_0xcb8f1e,_0x338b2b){var _0xe48647={};var _0x309c2d={};var _0x4f094f;var _0x1d18ae;return db['User']['findOne']({'where':{'id':_0xcb8f1e[_0xacda('0x4f')]['id']}})[_0xacda('0x11')](handleEntityNotFound(_0x338b2b,null))[_0xacda('0x11')](function(_0x4b25a4){if(_0x4b25a4){_0x4f094f=_0x4b25a4;_0x309c2d[_0xacda('0x50')]=_[_0xacda('0x52')](db[_0xacda('0x104')][_0xacda('0x38')]);_0x309c2d[_0xacda('0x3f')]=_['keys'](_0xcb8f1e[_0xacda('0x3f')]);_0x309c2d['filters']=_[_0xacda('0x54')](_0x309c2d['model'],_0x309c2d[_0xacda('0x3f')]);_0xe48647[_0xacda('0x45')]=_['intersection'](_0x309c2d['model'],qs[_0xacda('0x55')](_0xcb8f1e[_0xacda('0x3f')][_0xacda('0x55')]));_0xe48647[_0xacda('0x45')]=_0xe48647[_0xacda('0x45')][_0xacda('0x48')]?_0xe48647[_0xacda('0x45')]:_0x309c2d[_0xacda('0x50')];_0xe48647['order']=qs[_0xacda('0xc4')](_0xcb8f1e[_0xacda('0x3f')][_0xacda('0xc4')]);_0xe48647[_0xacda('0x3e')]=qs[_0xacda('0x53')](_['pick'](_0xcb8f1e[_0xacda('0x3f')],_0x309c2d[_0xacda('0x53')]));if(_0xcb8f1e[_0xacda('0x3f')][_0xacda('0x2f')]){_0xe48647['where']=_[_0xacda('0x56')](_0xe48647['where'],{'$or':_['map'](_0xe48647[_0xacda('0x45')],function(_0xce70b5){var _0x403a99={};_0x403a99[_0xce70b5]={'$like':'%'+_0xcb8f1e[_0xacda('0x3f')][_0xacda('0x2f')]+'%'};return _0x403a99;})});}_0xe48647=_[_0xacda('0x56')]({},_0xe48647,_0xcb8f1e[_0xacda('0x57')]);return _0x4f094f[_0xacda('0x103')](_0xe48647);}})[_0xacda('0x11')](function(_0x4da4a1){if(_0x4da4a1){_0x1d18ae=_0x4da4a1[_0xacda('0x48')];if(!_0xcb8f1e[_0xacda('0x3f')][_0xacda('0xc5')](_0xacda('0xc9'))){_0xe48647[_0xacda('0x1e')]=qs['limit'](_0xcb8f1e[_0xacda('0x3f')][_0xacda('0x1e')]);_0xe48647[_0xacda('0x20')]=qs[_0xacda('0x20')](_0xcb8f1e['query'][_0xacda('0x20')]);}return _0x4f094f['getTeams'](_0xe48647);}})[_0xacda('0x11')](function(_0xa3331c){if(_0xa3331c){return _0xa3331c?{'count':_0x1d18ae,'rows':_0xa3331c}:null;}})[_0xacda('0x11')](respondWithResult(_0x338b2b,null))['catch'](handleError(_0x338b2b,null));};exports[_0xacda('0x105')]=function(_0x51a334,_0x16c2a7){var _0x1125ec=_0x51a334['params']['id'];var _0x106380=_0x51a334[_0xacda('0x5c')]?_0x51a334['body'][_0xacda('0x5f')]:null;var _0x27adec=[];return Promise[_0xacda('0xf7')]()[_0xacda('0x11')](function(){if(!_0x106380)throw new APIBadRequestError(_0xacda('0x106'));})[_0xacda('0x11')](function(){return db['User'][_0xacda('0x92')]({'where':{'id':_0x1125ec}});})[_0xacda('0x11')](function(_0x41e964){if(!_0x41e964)throw new APINotFoundError(util[_0xacda('0xe3')](_0xacda('0x102'),_0x51a334[_0xacda('0x4f')]['id']));return db[_0xacda('0x67')][_0xacda('0x107')](function(_0x3e7eb8){return _0x41e964[_0xacda('0x105')](_0x106380,{'transaction':_0x3e7eb8})[_0xacda('0x11')](function(){return db[_0xacda('0x104')][_0xacda('0xa1')]({'where':{'id':{'$in':_0x106380}}});})[_0xacda('0x11')](function(_0x54bebe){var _0x5a40a0=_[_0xacda('0x30')](_0x54bebe,function(_0x9630bc){return _0x9630bc['getAssociatedQueues']();});return Promise['all'](_0x5a40a0);})['then'](function(_0x1b4384){_0x27adec=_[_0xacda('0x108')](_0x1b4384);var _0x18478f=_[_0xacda('0x30')](_0x27adec,function(_0x5740b7){return _0x5740b7[_0xacda('0x109')](_0x41e964['id'],{'transaction':_0x3e7eb8});});return Promise[_0xacda('0x5b')](_0x18478f);})[_0xacda('0x11')](function(){if(!_0x41e964['online'])return;var _0x5719e4=_[_0xacda('0x2f')](_0x27adec,function(_0x3c83d6){return _0x3c83d6[_0xacda('0x10a')]('channel')==='Voice';});var _0x13c4a1=_[_0xacda('0x30')](_0x5719e4,function(_0x5d8816){return db['UserVoiceQueueRt'][_0xacda('0xa6')]({'membername':_0x41e964['name'],'UserId':_0x41e964['id'],'queue_name':_0x5d8816[_0xacda('0x34')],'VoiceQueueId':_0x5d8816['id'],'interface':_[_0xacda('0x65')](_0x41e964['interface'])?util[_0xacda('0xe3')](_0xacda('0xe6'),_0x41e964[_0xacda('0x34')]):_0x41e964['interface'],'paused':_0x41e964[_0xacda('0xa4')]||![],'penalty':_0x41e964[_0xacda('0xa5')]},{'transaction':_0x3e7eb8});});return Promise[_0xacda('0x5b')](_0x13c4a1);})[_0xacda('0x11')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x106380}}});})[_0xacda('0x11')](function(_0x51eee4){var _0x3d1092=_[_0xacda('0x30')](_0x51eee4,function(_0x158b5c){return db[_0xacda('0x10b')][_0xacda('0x7a')]({'UserId':_0x41e964['id'],'VoicePrefixId':_0x158b5c[_0xacda('0x10c')]},{'transaction':_0x3e7eb8});});return Promise[_0xacda('0x5b')](_0x3d1092);});});})[_0xacda('0x11')](function(){for(var _0x5d5d36=0x0;_0x5d5d36<_0x27adec['length'];_0x5d5d36++){var _0xaf9abc=_0x27adec[_0x5d5d36]['getDataValue'](_0xacda('0x96'));var _0x1e98c8=_0xaf9abc+_0xacda('0x9e');socket[_0xacda('0x27')](_0xacda('0x7b')+_0xaf9abc+'Queue:save',{'UserId':_0x1125ec,['queueField']:_0x27adec[_0x5d5d36]['id']});}})[_0xacda('0x11')](respondWithStatusCode(_0x16c2a7,null))[_0xacda('0x1a')](APIHandleError(_0x16c2a7));};exports[_0xacda('0x10d')]=function(_0x480b77,_0x28cda4){var _0x3ee307=_0x480b77[_0xacda('0x4f')]['id'];var _0x498ae5=null;if(_0x480b77['query']['ids']){_0x498ae5=_[_0xacda('0xaa')](_0x480b77[_0xacda('0x3f')][_0xacda('0x5f')])?_0x480b77[_0xacda('0x3f')][_0xacda('0x5f')]:[_0x480b77[_0xacda('0x3f')][_0xacda('0x5f')]];}var _0x153c2b=[];return Promise[_0xacda('0xf7')]()[_0xacda('0x11')](function(){if(!_0x498ae5)throw new APIBadRequestError(_0xacda('0x10e'));})['then'](function(){return db[_0xacda('0x37')][_0xacda('0x92')]({'where':{'id':_0x3ee307}});})['then'](function(_0xe1ca55){if(!_0xe1ca55)throw new APINotFoundError(util[_0xacda('0xe3')](_0xacda('0x102'),_0x480b77[_0xacda('0x4f')]['id']));return db['sequelize'][_0xacda('0x107')](function(_0x5ca3f5){return _0xe1ca55[_0xacda('0x10d')](_0x498ae5,{'transaction':_0x5ca3f5})[_0xacda('0x11')](function(){return db['Team']['findAll']({'where':{'id':{'$in':_0x498ae5}}});})[_0xacda('0x11')](function(_0x3b8459){var _0x47e18f=_[_0xacda('0x30')](_0x3b8459,function(_0x1c5b0b){return _0x1c5b0b[_0xacda('0x10f')]();});return Promise[_0xacda('0x5b')](_0x47e18f);})[_0xacda('0x11')](function(_0x4288d2){_0x153c2b=_[_0xacda('0x108')](_0x4288d2);var _0x193ffb=_[_0xacda('0x30')](_0x153c2b,function(_0x1e5d7f){return _0x1e5d7f[_0xacda('0x110')](_0xe1ca55['id'],{'transaction':_0x5ca3f5});});return Promise[_0xacda('0x5b')](_0x193ffb);})[_0xacda('0x11')](function(){if(!_0xe1ca55['online'])return;var _0x191150=_['filter'](_0x153c2b,function(_0xa55f26){return _0xa55f26[_0xacda('0x10a')](_0xacda('0x96'))===_0xacda('0x111');});var _0x314658=_[_0xacda('0x30')](_0x191150,function(_0x4128cd){return db['UserVoiceQueueRt'][_0xacda('0x29')]({'where':{'VoiceQueueId':_0x4128cd['id'],'UserId':_0xe1ca55['id']},'transaction':_0x5ca3f5});});return Promise[_0xacda('0x5b')](_0x314658);})[_0xacda('0x11')](function(){return db[_0xacda('0x112')][_0xacda('0xa1')]({'where':{'teamId':{'$in':_0x498ae5}}});})['then'](function(_0x2d2e92){var _0x308729=_['map'](_0x2d2e92,function(_0x43cb34){return db['UserVoicePrefix'][_0xacda('0x29')]({'where':{'UserId':_0xe1ca55['id'],'VoicePrefixId':_0x43cb34[_0xacda('0x10c')]}},{'transaction':_0x5ca3f5});});return Promise['all'](_0x308729);});});})[_0xacda('0x11')](function(){for(var _0x3785d6=0x0;_0x3785d6<_0x153c2b[_0xacda('0x48')];_0x3785d6++){var _0x138dbb=_0x153c2b[_0x3785d6][_0xacda('0x10a')]('channel');var _0x4eee6e=_0x138dbb+_0xacda('0x9e');socket[_0xacda('0x27')](_0xacda('0x7b')+_0x138dbb+_0xacda('0xab'),{'UserId':_0x3ee307,['queueField']:_0x153c2b[_0x3785d6]['id']});}})[_0xacda('0x11')](respondWithStatusCode(_0x28cda4,null))[_0xacda('0x1a')](APIHandleError(_0x28cda4));};exports[_0xacda('0x113')]=function(_0x173b8d,_0x51e906){var _0x16ed08={};var _0x2a1633={};var _0x5a95f5;var _0x1c14a3;return db[_0xacda('0x37')][_0xacda('0x92')]({'where':{'id':_0x173b8d[_0xacda('0x4f')]['id']}})[_0xacda('0x11')](handleEntityNotFound(_0x51e906,null))[_0xacda('0x11')](function(_0x1dcc15){if(_0x1dcc15){_0x5a95f5=_0x1dcc15;_0x2a1633[_0xacda('0x50')]=_[_0xacda('0x52')](db[_0xacda('0x114')][_0xacda('0x38')]);_0x2a1633[_0xacda('0x3f')]=_['keys'](_0x173b8d['query']);_0x2a1633[_0xacda('0x53')]=_['intersection'](_0x2a1633[_0xacda('0x50')],_0x2a1633[_0xacda('0x3f')]);_0x16ed08[_0xacda('0x45')]=_['intersection'](_0x2a1633[_0xacda('0x50')],qs[_0xacda('0x55')](_0x173b8d['query']['fields']));_0x16ed08[_0xacda('0x45')]=_0x16ed08[_0xacda('0x45')][_0xacda('0x48')]?_0x16ed08[_0xacda('0x45')]:_0x2a1633['model'];_0x16ed08[_0xacda('0xc3')]=qs['sort'](_0x173b8d[_0xacda('0x3f')][_0xacda('0xc4')]);_0x16ed08[_0xacda('0x3e')]=qs[_0xacda('0x53')](_[_0xacda('0xce')](_0x173b8d[_0xacda('0x3f')],_0x2a1633['filters']));if(_0x173b8d[_0xacda('0x3f')][_0xacda('0x2f')]){_0x16ed08[_0xacda('0x3e')]=_[_0xacda('0x56')](_0x16ed08[_0xacda('0x3e')],{'$or':_[_0xacda('0x30')](_0x16ed08[_0xacda('0x45')],function(_0x2f8d0f){var _0x17b6b2={};_0x17b6b2[_0x2f8d0f]={'$like':'%'+_0x173b8d['query']['filter']+'%'};return _0x17b6b2;})});}_0x16ed08=_[_0xacda('0x56')]({},_0x16ed08,_0x173b8d['options']);return _0x5a95f5[_0xacda('0x113')](_0x16ed08);}})[_0xacda('0x11')](function(_0x4bc9d1){if(_0x4bc9d1){_0x1c14a3=_0x4bc9d1[_0xacda('0x48')];if(!_0x173b8d[_0xacda('0x3f')][_0xacda('0xc5')]('nolimit')){_0x16ed08[_0xacda('0x1e')]=qs['limit'](_0x173b8d[_0xacda('0x3f')][_0xacda('0x1e')]);_0x16ed08[_0xacda('0x20')]=qs[_0xacda('0x20')](_0x173b8d['query'][_0xacda('0x20')]);}return _0x5a95f5[_0xacda('0x113')](_0x16ed08);}})[_0xacda('0x11')](function(_0x35badc){if(_0x35badc){return _0x35badc?{'count':_0x1c14a3,'rows':_0x35badc}:null;}})[_0xacda('0x11')](respondWithResult(_0x51e906,null))[_0xacda('0x1a')](handleError(_0x51e906,null));};exports['getAgents']=function(_0x549fd5,_0x56f766){var _0x2145f8={};var _0x58c3f6={};var _0x23f000;return db[_0xacda('0x37')][_0xacda('0x92')]({'where':{'id':_0x549fd5[_0xacda('0x4f')]['id']}})[_0xacda('0x11')](handleEntityNotFound(_0x56f766,null))['then'](function(_0x453ebf){if(_0x453ebf){_0x23f000=_0x453ebf;_0x58c3f6['model']=_[_0xacda('0x52')](db[_0xacda('0x37')][_0xacda('0x38')]);_0x58c3f6['query']=_[_0xacda('0x52')](_0x549fd5[_0xacda('0x3f')]);_0x58c3f6[_0xacda('0x53')]=_[_0xacda('0x54')](_0x58c3f6[_0xacda('0x50')],_0x58c3f6['query']);_0x2145f8[_0xacda('0x45')]=_[_0xacda('0x54')](_0x58c3f6[_0xacda('0x50')],qs[_0xacda('0x55')](_0x549fd5[_0xacda('0x3f')]['fields']));_0x2145f8[_0xacda('0x45')]=_0x2145f8[_0xacda('0x45')][_0xacda('0x48')]?_0x2145f8[_0xacda('0x45')]:_0x58c3f6[_0xacda('0x50')];_0x2145f8[_0xacda('0xc3')]=qs[_0xacda('0xc4')](_0x549fd5['query']['sort']);_0x2145f8['where']=qs[_0xacda('0x53')](_[_0xacda('0xce')](_0x549fd5[_0xacda('0x3f')],_0x58c3f6[_0xacda('0x53')]));if(_0x549fd5[_0xacda('0x3f')][_0xacda('0x2f')]){_0x2145f8['where']=_[_0xacda('0x56')](_0x2145f8['where'],{'$or':_[_0xacda('0x30')](_0x2145f8[_0xacda('0x45')],function(_0x547624){var _0x525b89={};_0x525b89[_0x547624]={'$like':'%'+_0x549fd5[_0xacda('0x3f')][_0xacda('0x2f')]+'%'};return _0x525b89;})});}_0x2145f8[_0xacda('0x50')]=db[_0xacda('0x37')];_0x2145f8['as']='Agents';_0x2145f8=_[_0xacda('0x56')]({},_0x2145f8,_0x549fd5['options']);return _0x23f000[_0xacda('0xee')]({'include':[_0x2145f8]});}})[_0xacda('0x11')](function(_0x356fb3){if(_0x356fb3){var _0x14f958={},_0x2cd5cb=[];for(var _0x4eb7fc=0x0;_0x4eb7fc<_0x356fb3[_0xacda('0x48')];_0x4eb7fc+=0x1){for(var _0x452025=0x0,_0x4cc7a;_0x452025<_0x356fb3[_0x4eb7fc][_0xacda('0x2d')]['length'];_0x452025+=0x1){_0x4cc7a=_0x356fb3[_0x4eb7fc]['Agents'][_0x452025][_0xacda('0x2a')]({'plain':!![]});_0x14f958[_0x4cc7a['id']]=_0x4cc7a;}}_0x14f958=_[_0xacda('0x115')](_0x14f958);for(var _0x100b64=qs['offset'](_0x549fd5[_0xacda('0x3f')][_0xacda('0x20')]);_0x100b64<_0x14f958[_0xacda('0x48')]&&_0x2cd5cb[_0xacda('0x48')]=_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 +var _0x94fd=['body','type','uniqueid','MemberReport','bulkCreate','DEFAULT\x20PAUSE','UnpauseUser','resolve','isValidChannel','channel','Channel\x20parameter\x20%s\x20is\x20invalid','online','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','unpause','LogoutUser','findOne','destroy','forEach','push','all','LoginUser','mobile','loginInPause','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','length','upsert','UserVoiceQueue.penalty','merge','LOGIN','LOGININPAUSE','concat','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','GetUser','User','findAll','raw','options','where','limit','include','map','model','attributes','info','debug','stringify','catch','message','error','ShowUser','find','then','PauseUser','role','internal','interface','format','params','UserVoiceQueueRt','update','name','updateAttributes','isNil','SIP/%s','PAUSE','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5aed5d,_0x26ee01){var _0x4f5949=function(_0x154c81){while(--_0x154c81){_0x5aed5d['push'](_0x5aed5d['shift']());}};_0x4f5949(++_0x26ee01);}(_0x94fd,0x81));var _0xd94f=function(_0x11cb29,_0xdcefe){_0x11cb29=_0x11cb29-0x0;var _0x767a51=_0x94fd[_0x11cb29];return _0x767a51;};'use strict';var _=require('lodash');var util=require(_0xd94f('0x0'));var moment=require(_0xd94f('0x1'));var BPromise=require(_0xd94f('0x2'));var Redis=require(_0xd94f('0x3'));var db=require(_0xd94f('0x4'))['db'];var utils=require(_0xd94f('0x5'));var logger=require(_0xd94f('0x6'))('rpc');var config=require(_0xd94f('0x7'));config[_0xd94f('0x8')]=_[_0xd94f('0x9')](config[_0xd94f('0x8')],{'host':_0xd94f('0xa'),'port':0x18eb});var socket=require(_0xd94f('0xb'))(new Redis(config[_0xd94f('0x8')]));require('./user.socket')[_0xd94f('0xc')](socket);exports[_0xd94f('0xd')]=function(_0x22917d){var _0x18b7e1=this;return new Promise(function(_0x574b2d,_0x10069e){return db[_0xd94f('0xe')][_0xd94f('0xf')]({'raw':_0x22917d['options']?_0x22917d['options'][_0xd94f('0x10')]===undefined?!![]:![]:!![],'where':_0x22917d[_0xd94f('0x11')]?_0x22917d[_0xd94f('0x11')][_0xd94f('0x12')]||null:null,'attributes':_0x22917d[_0xd94f('0x11')]?_0x22917d[_0xd94f('0x11')]['attributes']||null:null,'limit':_0x22917d[_0xd94f('0x11')]?_0x22917d[_0xd94f('0x11')][_0xd94f('0x13')]||null:null,'include':_0x22917d[_0xd94f('0x11')]?_0x22917d[_0xd94f('0x11')][_0xd94f('0x14')]?_[_0xd94f('0x15')](_0x22917d[_0xd94f('0x11')]['include'],function(_0x38c640){return{'model':db[_0x38c640[_0xd94f('0x16')]],'as':_0x38c640['as'],'attributes':_0x38c640[_0xd94f('0x17')],'include':_0x38c640[_0xd94f('0x14')]?_['map'](_0x38c640[_0xd94f('0x14')],function(_0x5d8a48){return{'model':db[_0x5d8a48['model']],'as':_0x5d8a48['as'],'attributes':_0x5d8a48[_0xd94f('0x17')],'include':_0x5d8a48[_0xd94f('0x14')]?_[_0xd94f('0x15')](_0x5d8a48['include'],function(_0x279219){return{'model':db[_0x279219[_0xd94f('0x16')]],'as':_0x279219['as'],'attributes':_0x279219[_0xd94f('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bb4c5){logger[_0xd94f('0x18')]('GetUser',_0x22917d);logger[_0xd94f('0x19')](_0xd94f('0xd'),_0x22917d,JSON[_0xd94f('0x1a')](_0x5bb4c5));_0x574b2d(_0x5bb4c5);})[_0xd94f('0x1b')](function(_0x5bdb76){logger['error'](_0xd94f('0xd'),_0x5bdb76[_0xd94f('0x1c')],_0x22917d);_0x10069e(_0x18b7e1[_0xd94f('0x1d')](0x1f4,_0x5bdb76[_0xd94f('0x1c')]));});});};exports[_0xd94f('0x1e')]=function(_0x5cf3b8){var _0x3bb8d3=this;return new Promise(function(_0x4c311e,_0x29aebb){return db[_0xd94f('0xe')][_0xd94f('0x1f')]({'raw':_0x5cf3b8[_0xd94f('0x11')]?_0x5cf3b8[_0xd94f('0x11')][_0xd94f('0x10')]===undefined?!![]:![]:!![],'where':_0x5cf3b8[_0xd94f('0x11')]?_0x5cf3b8[_0xd94f('0x11')]['where']||null:null,'attributes':_0x5cf3b8[_0xd94f('0x11')]?_0x5cf3b8[_0xd94f('0x11')][_0xd94f('0x17')]||null:null,'include':_0x5cf3b8[_0xd94f('0x11')]?_0x5cf3b8[_0xd94f('0x11')][_0xd94f('0x14')]?_[_0xd94f('0x15')](_0x5cf3b8['options'][_0xd94f('0x14')],function(_0x297d9b){return{'model':db[_0x297d9b[_0xd94f('0x16')]],'as':_0x297d9b['as'],'attributes':_0x297d9b[_0xd94f('0x17')],'include':_0x297d9b[_0xd94f('0x14')]?_['map'](_0x297d9b[_0xd94f('0x14')],function(_0x232c6c){return{'model':db[_0x232c6c[_0xd94f('0x16')]],'as':_0x232c6c['as'],'attributes':_0x232c6c[_0xd94f('0x17')],'include':_0x232c6c[_0xd94f('0x14')]?_[_0xd94f('0x15')](_0x232c6c[_0xd94f('0x14')],function(_0x3fa31e){return{'model':db[_0x3fa31e['model']],'as':_0x3fa31e['as'],'attributes':_0x3fa31e[_0xd94f('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd94f('0x20')](function(_0x396952){logger[_0xd94f('0x18')](_0xd94f('0x1e'),_0x5cf3b8);logger[_0xd94f('0x19')](_0xd94f('0x1e'),_0x5cf3b8,JSON[_0xd94f('0x1a')](_0x396952));_0x4c311e(_0x396952);})['catch'](function(_0x250eb1){logger[_0xd94f('0x1d')](_0xd94f('0x1e'),_0x250eb1[_0xd94f('0x1c')],_0x5cf3b8);_0x29aebb(_0x3bb8d3[_0xd94f('0x1d')](0x1f4,_0x250eb1['message']));});});};exports[_0xd94f('0x21')]=function(_0xb4f55e){var _0x1ea3e2;return db['User'][_0xd94f('0x1f')]({'where':_0xb4f55e[_0xd94f('0x11')]['where']||{},'attributes':['id','name',_0xd94f('0x22'),_0xd94f('0x23'),_0xd94f('0x24')]})['then'](function(_0xaf5835){if(!_0xaf5835){throw new Error(util[_0xd94f('0x25')]('User\x20with\x20id\x20%s\x20not\x20found',_0xb4f55e[_0xd94f('0x26')]['id']));}_0x1ea3e2=_0xaf5835;return db[_0xd94f('0x27')][_0xd94f('0x28')]({'paused':0x1},{'where':{'UserId':_0x1ea3e2['id']},'individualHooks':!![]});})[_0xd94f('0x20')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x1ea3e2[_0xd94f('0x29')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x50d038){if(_0x50d038&&_0x50d038['length']){var _0x119947=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4f02fe=0x0,_0x423054=_0x50d038['length'];_0x4f02fe<_0x423054;_0x4f02fe++){_0x50d038[_0x4f02fe][_0xd94f('0x2a')]({'exitAt':_0x119947});}}})[_0xd94f('0x20')](function(){var _0x100847=[];var _0x8ef4ba=utils['getChannels']();_0x8ef4ba['forEach'](function(_0x50fd61){_0x100847['push']({'channel':_0x50fd61,'membername':_0x1ea3e2['name'],'interface':_[_0xd94f('0x2b')](_0x1ea3e2['interface'])?util['format'](_0xd94f('0x2c'),_0x1ea3e2[_0xd94f('0x29')]):_0x1ea3e2[_0xd94f('0x24')],'type':_0xd94f('0x2d'),'enterAt':moment()[_0xd94f('0x25')](_0xd94f('0x2e')),'data1':_0xb4f55e[_0xd94f('0x2f')][_0xd94f('0x30')]||'DEFAULT\x20PAUSE','role':_0x1ea3e2[_0xd94f('0x22')],'internal':_0x1ea3e2[_0xd94f('0x23')],'uniqueid':_0xb4f55e[_0xd94f('0x2f')][_0xd94f('0x31')]||null});});return db[_0xd94f('0x32')][_0xd94f('0x33')](_0x100847,{'individualHooks':!![]});})['then'](function(){return _0x1ea3e2[_0xd94f('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0xb4f55e['body'][_0xd94f('0x30')]||_0xd94f('0x34'),'lastPauseAt':moment()[_0xd94f('0x25')](_0xd94f('0x2e'))});})[_0xd94f('0x1b')](function(_0x3f3aa4){throw _0x3f3aa4;});};exports[_0xd94f('0x35')]=function(_0x32d8f7){return Promise[_0xd94f('0x36')]()[_0xd94f('0x20')](function(){if(_0x32d8f7[_0xd94f('0x2f')]['channel']&&!utils[_0xd94f('0x37')](_0x32d8f7[_0xd94f('0x2f')][_0xd94f('0x38')])){throw new Error(util['format'](_0xd94f('0x39'),_0x32d8f7['body'][_0xd94f('0x38')]));}return db['User']['findOne']({'where':_0x32d8f7[_0xd94f('0x11')]['where']||{},'attributes':['id',_0xd94f('0x29'),'role','internal',_0xd94f('0x24'),_0xd94f('0x3a'),_0xd94f('0x3b'),_0xd94f('0x3c'),_0xd94f('0x3d'),_0xd94f('0x3e'),_0xd94f('0x3f'),_0xd94f('0x40'),'whatsappPause',_0xd94f('0x41'),_0xd94f('0x42')]});})[_0xd94f('0x20')](function(_0x50e2b9){if(!_0x50e2b9){throw new Error(util[_0xd94f('0x25')](_0xd94f('0x43'),_0x32d8f7[_0xd94f('0x26')]['id']));}return _0x50e2b9[_0xd94f('0x44')](_0x32d8f7[_0xd94f('0x2f')][_0xd94f('0x38')],'system');})[_0xd94f('0x1b')](function(_0x15658e){throw _0x15658e;});};exports[_0xd94f('0x45')]=function(_0x1c7b51){var _0x145e6a=this;return new Promise(function(_0x4caf84,_0x51e766){var _0x3ff8f2;return db[_0xd94f('0xe')][_0xd94f('0x46')]({'where':_0x1c7b51[_0xd94f('0x11')][_0xd94f('0x12')]||{},'attributes':['id',_0xd94f('0x29')]})[_0xd94f('0x20')](function(_0x1c326c){if(_0x1c326c){_0x3ff8f2=_0x1c326c;return db[_0xd94f('0x27')][_0xd94f('0x47')]({'where':{'membername':_0x3ff8f2['name']},'individualHooks':!![]});}})[_0xd94f('0x20')](function(){if(_0x3ff8f2){return db['MemberReport'][_0xd94f('0xf')]({'where':{'membername':_0x3ff8f2[_0xd94f('0x29')],'exitAt':null}});}})[_0xd94f('0x20')](function(_0x161b13){if(_0x3ff8f2){if(_0x161b13&&_0x161b13['length']){var _0x3c4f1b=[];_0x161b13[_0xd94f('0x48')](function(_0x5563a3){_0x3c4f1b[_0xd94f('0x49')](_0x5563a3['update']({'exitAt':moment()['format'](_0xd94f('0x2e'))}));});return BPromise[_0xd94f('0x4a')](_0x3c4f1b);}}})[_0xd94f('0x20')](function(){if(_0x3ff8f2){return _0x3ff8f2['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xd94f('0x20')](function(_0x3d8b56){_0x4caf84(_0x3d8b56);})[_0xd94f('0x1b')](function(_0x5a6115){_0x51e766(_0x145e6a[_0xd94f('0x1d')](0x1f4,_0x5a6115['message']));});});};exports[_0xd94f('0x4b')]=function(_0x3fcc0e){var _0x573b01=this;return new Promise(function(_0x1966c5,_0x919ea9){var _0x1f8984;var _0x48cc49;var _0x50e650;var _0x190c90;return db[_0xd94f('0xe')]['findOne']({'where':_0x3fcc0e[_0xd94f('0x11')][_0xd94f('0x12')]||{},'attributes':['id',_0xd94f('0x29'),_0xd94f('0x22'),_0xd94f('0x4c'),'phone',_0xd94f('0x23'),_0xd94f('0x4d'),_0xd94f('0x24')]})[_0xd94f('0x20')](function(_0x87ab99){if(_0x87ab99){_0x1f8984=_0x87ab99;_0x190c90=_0x3fcc0e['body'][_0xd94f('0x24')]?_0x3fcc0e[_0xd94f('0x2f')][_0xd94f('0x24')]:util[_0xd94f('0x25')](_0xd94f('0x2c'),_0x1f8984[_0xd94f('0x29')]);return db[_0xd94f('0xe')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x1f8984['id']}}});}})[_0xd94f('0x20')](function(_0x45ffdd){if(_0x45ffdd){_0x50e650=_0x45ffdd;return require(_0xd94f('0x4e'))['getLicense']();}})[_0xd94f('0x20')](function(_0x42e9b4){if(_0x42e9b4&&_0x42e9b4[_0xd94f('0x4f')]&&_0x50e650>=_0x42e9b4[_0xd94f('0x4f')]){throw new Error(_0xd94f('0x50'));}})[_0xd94f('0x20')](function(){if(_0x1f8984){return db[_0xd94f('0x27')][_0xd94f('0x47')]({'where':{'membername':_0x1f8984['name']},'individualHooks':!![]});}})['then'](function(){if(_0x1f8984){return _0x1f8984['getVoiceQueues']({'raw':!![]});}})[_0xd94f('0x20')](function(_0x6a2500){if(_0x1f8984){if(_0x6a2500){var _0x459943=[];_0x48cc49=_0x6a2500;if(_0x48cc49[_0xd94f('0x51')]){for(var _0x144c8a=0x0;_0x144c8a<_0x48cc49[_0xd94f('0x51')];_0x144c8a++){_0x459943[_0xd94f('0x49')](db[_0xd94f('0x27')][_0xd94f('0x52')]({'membername':_0x1f8984[_0xd94f('0x29')],'UserId':_0x1f8984['id'],'queue_name':_0x48cc49[_0x144c8a][_0xd94f('0x29')],'VoiceQueueId':_0x48cc49[_0x144c8a]['id'],'interface':_0x190c90,'paused':_0x1f8984[_0xd94f('0x4d')]||![],'penalty':_0x48cc49[_0x144c8a][_0xd94f('0x53')]||0x0}));}return BPromise['all'](_0x459943);}}}})[_0xd94f('0x20')](function(){if(_0x1f8984){return db[_0xd94f('0x32')][_0xd94f('0xf')]({'where':{'membername':_0x1f8984[_0xd94f('0x29')],'exitAt':null}});}})[_0xd94f('0x20')](function(_0x8f5625){if(_0x1f8984){if(_0x8f5625&&_0x8f5625['length']){var _0x26649c=[];_0x8f5625[_0xd94f('0x48')](function(_0xa9eda7){_0x26649c['push'](_0xa9eda7[_0xd94f('0x28')]({'exitAt':moment()[_0xd94f('0x25')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x26649c);}}})[_0xd94f('0x20')](function(){if(_0x1f8984){var _0x141d2d=[];var _0x1288a2=[];var _0x3a8f25=utils['getChannels']();var _0x32e0ae={'membername':_0x1f8984['name'],'interface':_0x190c90,'enterAt':moment()[_0xd94f('0x25')](_0xd94f('0x2e')),'role':_0x1f8984['role'],'internal':_0x1f8984[_0xd94f('0x23')]};_0x3a8f25[_0xd94f('0x48')](function(_0x4a217a){_0x141d2d[_0xd94f('0x49')](_[_0xd94f('0x54')]({'channel':_0x4a217a,'type':_0xd94f('0x55'),'data1':'callysquare','data2':_0x190c90},_0x32e0ae));if(_0x1f8984[_0xd94f('0x4d')]){_0x1288a2[_0xd94f('0x49')](_['merge']({'channel':_0x4a217a,'type':_0xd94f('0x2d'),'data1':_0xd94f('0x56')},_0x32e0ae));}});return db[_0xd94f('0x32')]['bulkCreate'](_0x141d2d[_0xd94f('0x57')](_0x1288a2),{'individualHooks':!![]});}})[_0xd94f('0x20')](function(){if(_0x1f8984){return _0x1f8984['update']({'online':!![],'lastLoginAt':moment()[_0xd94f('0x25')](_0xd94f('0x2e')),'voicePause':_0x1f8984[_0xd94f('0x4d')]||![],'mailPause':_0x1f8984[_0xd94f('0x4d')]||![],'chatPause':_0x1f8984[_0xd94f('0x4d')]||![],'faxPause':_0x1f8984['loginInPause']||![],'smsPause':_0x1f8984[_0xd94f('0x4d')]||![],'openchannelPause':_0x1f8984[_0xd94f('0x4d')]||![],'pauseType':_0x1f8984['loginInPause']?_0xd94f('0x56'):null,'lastPauseAt':moment()[_0xd94f('0x25')](_0xd94f('0x2e')),'interface':_0x190c90});}})['then'](function(_0x536e37){_0x1966c5(_0x536e37);})[_0xd94f('0x1b')](function(_0x1b975c){_0x919ea9(_0x573b01[_0xd94f('0x1d')](0x1f4,_0x1b975c[_0xd94f('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 6182b18..2633ddb 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 _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 +var _0x86b3=['update','emit','removeListener','length','user:','./user.events','save','remove'];(function(_0x18a626,_0x5ee82d){var _0x5d2771=function(_0xdf4b56){while(--_0xdf4b56){_0x18a626['push'](_0x18a626['shift']());}};_0x5d2771(++_0x5ee82d);}(_0x86b3,0x115));var _0x386b=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x86b3[_0x59ee6f];return _0x4c0979;};'use strict';var UserEvents=require(_0x386b('0x0'));var events=[_0x386b('0x1'),_0x386b('0x2'),_0x386b('0x3')];function createListener(_0xcf42cc,_0x394805){return function(_0x1c3cb1){_0x394805[_0x386b('0x4')](_0xcf42cc,_0x1c3cb1);};}function removeListener(_0x53c4fd,_0x1bbea3){return function(){UserEvents[_0x386b('0x5')](_0x53c4fd,_0x1bbea3);};}exports['register']=function(_0x2e9952){for(var _0x2e8d0d=0x0,_0x55f2dc=events[_0x386b('0x6')];_0x2e8d0d<_0x55f2dc;_0x2e8d0d++){var _0x4b27d4=events[_0x2e8d0d];var _0xd71fd7=createListener(_0x386b('0x7')+_0x4b27d4,_0x2e9952);UserEvents['on'](_0x4b27d4,_0xd71fd7);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 858dad4..1908d39 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 _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 +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3ee91e,_0x466a5a){var _0x239405=function(_0x3f2d09){while(--_0x3f2d09){_0x3ee91e['push'](_0x3ee91e['shift']());}};_0x239405(++_0x466a5a);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 00be349..0f24671 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 _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 +var _0xab6f=['exports','INTEGER','sequelize'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xab6f,0x1af));var _0xfab6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab6f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfab6('0x0'));module[_0xfab6('0x1')]={'penalty':{'type':Sequelize[_0xfab6('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 0c29048..3905efe 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 _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 +var _0x792f=['request-promise','../../config/environment','./userChatQueue.attributes','UserChatQueue','lodash','api','moment','bluebird'];(function(_0xee1692,_0x56d5b6){var _0x46a683=function(_0x4a722c){while(--_0x4a722c){_0xee1692['push'](_0xee1692['shift']());}};_0x46a683(++_0x56d5b6);}(_0x792f,0x11c));var _0xf792=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x792f[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xf792('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf792('0x1'));var moment=require(_0xf792('0x2'));var BPromise=require(_0xf792('0x3'));var rp=require(_0xf792('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf792('0x5'));var attributes=require(_0xf792('0x6'));module['exports']=function(_0xf22ed5,_0x44ff55){return _0xf22ed5['define'](_0xf792('0x7'),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 a4e3173..6d377f0 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 _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 +var _0xd0bf=['UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x251b14,_0x410c59){var _0x513ac4=function(_0x1f86b2){while(--_0x1f86b2){_0x251b14['push'](_0x251b14['shift']());}};_0x513ac4(++_0x410c59);}(_0xd0bf,0x1ea));var _0xfd0b=function(_0x5045a2,_0x5757a3){_0x5045a2=_0x5045a2-0x0;var _0x137ee9=_0xd0bf[_0x5045a2];return _0x137ee9;};'use strict';var _=require(_0xfd0b('0x0'));var util=require(_0xfd0b('0x1'));var moment=require(_0xfd0b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd0b('0x3'))['db'];var utils=require(_0xfd0b('0x4'));var logger=require('../../config/logger')(_0xfd0b('0x5'));var config=require(_0xfd0b('0x6'));var jayson=require(_0xfd0b('0x7'));var client=jayson[_0xfd0b('0x8')][_0xfd0b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f4ef3,_0x4d2129,_0x5948b8){return new BPromise(function(_0x553e09,_0x26b8b4){return client[_0xfd0b('0xa')](_0x1f4ef3,_0x5948b8)[_0xfd0b('0xb')](function(_0x6477e){logger[_0xfd0b('0xc')](_0xfd0b('0xd'),_0x4d2129,_0xfd0b('0xe'));logger[_0xfd0b('0xf')](_0xfd0b('0x10'),_0x4d2129,_0xfd0b('0xe'),JSON[_0xfd0b('0x11')](_0x6477e));if(_0x6477e[_0xfd0b('0x12')]){if(_0x6477e['error'][_0xfd0b('0x13')]===0x1f4){logger['error'](_0xfd0b('0xd'),_0x4d2129,_0x6477e[_0xfd0b('0x12')][_0xfd0b('0x14')]);return _0x26b8b4(_0x6477e['error'][_0xfd0b('0x14')]);}logger[_0xfd0b('0x12')](_0xfd0b('0xd'),_0x4d2129,_0x6477e[_0xfd0b('0x12')][_0xfd0b('0x14')]);return _0x553e09(_0x6477e[_0xfd0b('0x12')][_0xfd0b('0x14')]);}else{logger[_0xfd0b('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x4d2129,'request\x20sent');_0x553e09(_0x6477e[_0xfd0b('0x15')]['message']);}})['catch'](function(_0x23b716){logger[_0xfd0b('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x4d2129,_0x23b716);_0x26b8b4(_0x23b716);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index f3e9e87..e20e0db 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 _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 +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x50f158,_0x1b49ef){var _0x380590=function(_0x197041){while(--_0x197041){_0x50f158['push'](_0x50f158['shift']());}};_0x380590(++_0x1b49ef);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index adb28c8..92ef60b 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 _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 +var _0x8b87=['INTEGER','STRING','sequelize','exports'];(function(_0x5e760b,_0xd8ad88){var _0x315791=function(_0x24d2ce){while(--_0x24d2ce){_0x5e760b['push'](_0x5e760b['shift']());}};_0x315791(++_0xd8ad88);}(_0x8b87,0x11e));var _0x78b8=function(_0x1b4c5f,_0x5cffd6){_0x1b4c5f=_0x1b4c5f-0x0;var _0x25c1bd=_0x8b87[_0x1b4c5f];return _0x25c1bd;};'use strict';var Sequelize=require(_0x78b8('0x0'));module[_0x78b8('0x1')]={'penalty':{'type':Sequelize[_0x78b8('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x78b8('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x78b8('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 1633ae9..8e22be5 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 _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 +var _0xae59=['UserFaxQueue','user_has_fax_queues','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x2f7be9,_0x173b28){var _0x22b2ad=function(_0x2f50e4){while(--_0x2f50e4){_0x2f7be9['push'](_0x2f7be9['shift']());}};_0x22b2ad(++_0x173b28);}(_0xae59,0xd3));var _0x9ae5=function(_0x277e1a,_0x2878d0){_0x277e1a=_0x277e1a-0x0;var _0x609da3=_0xae59[_0x277e1a];return _0x609da3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9ae5('0x0'))(_0x9ae5('0x1'));var moment=require(_0x9ae5('0x2'));var BPromise=require('bluebird');var rp=require(_0x9ae5('0x3'));var fs=require('fs');var path=require(_0x9ae5('0x4'));var rimraf=require(_0x9ae5('0x5'));var config=require(_0x9ae5('0x6'));var attributes=require('./userFaxQueue.attributes');module[_0x9ae5('0x7')]=function(_0x54f97c,_0x5b04dc){return _0x54f97c[_0x9ae5('0x8')](_0x9ae5('0x9'),attributes,{'tableName':_0x9ae5('0xa'),'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 ed801cc..f7973ca 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 _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 +var _0x8058=['request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s'];(function(_0x49fb6e,_0x2b1a51){var _0x3c03cc=function(_0x2184ff){while(--_0x2184ff){_0x49fb6e['push'](_0x49fb6e['shift']());}};_0x3c03cc(++_0x2b1a51);}(_0x8058,0x162));var _0x8805=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x8058[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x8805('0x0'));var util=require(_0x8805('0x1'));var moment=require(_0x8805('0x2'));var BPromise=require(_0x8805('0x3'));var rs=require(_0x8805('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8805('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x8805('0x6'));var jayson=require(_0x8805('0x7'));var client=jayson[_0x8805('0x8')][_0x8805('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c3e01,_0x5abf41,_0x20ca0c){return new BPromise(function(_0x33567e,_0xf0c97){return client[_0x8805('0xa')](_0x1c3e01,_0x20ca0c)[_0x8805('0xb')](function(_0x5350eb){logger[_0x8805('0xc')](_0x8805('0xd'),_0x5abf41,_0x8805('0xe'));logger[_0x8805('0xf')](_0x8805('0x10'),_0x5abf41,_0x8805('0xe'),JSON[_0x8805('0x11')](_0x5350eb));if(_0x5350eb[_0x8805('0x12')]){if(_0x5350eb[_0x8805('0x12')][_0x8805('0x13')]===0x1f4){logger[_0x8805('0x12')](_0x8805('0xd'),_0x5abf41,_0x5350eb[_0x8805('0x12')]['message']);return _0xf0c97(_0x5350eb[_0x8805('0x12')]['message']);}logger[_0x8805('0x12')](_0x8805('0xd'),_0x5abf41,_0x5350eb[_0x8805('0x12')][_0x8805('0x14')]);return _0x33567e(_0x5350eb[_0x8805('0x12')]['message']);}else{logger[_0x8805('0xc')](_0x8805('0xd'),_0x5abf41,'request\x20sent');_0x33567e(_0x5350eb[_0x8805('0x15')]['message']);}})[_0x8805('0x16')](function(_0x5368f6){logger[_0x8805('0x12')](_0x8805('0xd'),_0x5abf41,_0x5368f6);_0xf0c97(_0x5368f6);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index f5a53a0..d50c43a 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 _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 +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2c6fc0,_0x9d9592){var _0x4722b9=function(_0x4ac804){while(--_0x4ac804){_0x2c6fc0['push'](_0x2c6fc0['shift']());}};_0x4722b9(++_0x9d9592);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3cf4d3,_0x48065e){_0x3cf4d3=_0x3cf4d3-0x0;var _0x4e547b=_0xcb91[_0x3cf4d3];return _0x4e547b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 27b8e58..2fe1abc 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 _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 +var _0xac2b=['INTEGER','sequelize'];(function(_0x2588e4,_0x470392){var _0x3cd817=function(_0x184b50){while(--_0x184b50){_0x2588e4['push'](_0x2588e4['shift']());}};_0x3cd817(++_0x470392);}(_0xac2b,0x175));var _0xbac2=function(_0x53bf67,_0x4a3559){_0x53bf67=_0x53bf67-0x0;var _0x1a2701=_0xac2b[_0x53bf67];return _0x1a2701;};'use strict';var Sequelize=require(_0xbac2('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbac2('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 68aec86..ed209bf 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 _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 +var _0xaefc=['UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./userMailQueue.attributes','exports','define'];(function(_0x4dbda8,_0xbce830){var _0x1149ed=function(_0x299a39){while(--_0x299a39){_0x4dbda8['push'](_0x4dbda8['shift']());}};_0x1149ed(++_0xbce830);}(_0xaefc,0x154));var _0xcaef=function(_0x41469c,_0x1388a8){_0x41469c=_0x41469c-0x0;var _0x30caa3=_0xaefc[_0x41469c];return _0x30caa3;};'use strict';var _=require(_0xcaef('0x0'));var util=require(_0xcaef('0x1'));var logger=require(_0xcaef('0x2'))(_0xcaef('0x3'));var moment=require(_0xcaef('0x4'));var BPromise=require(_0xcaef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcaef('0x6'));var rimraf=require(_0xcaef('0x7'));var config=require('../../config/environment');var attributes=require(_0xcaef('0x8'));module[_0xcaef('0x9')]=function(_0x7fc236,_0x571eae){return _0x7fc236[_0xcaef('0xa')](_0xcaef('0xb'),attributes,{'tableName':_0xcaef('0xc'),'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 c8973fb..7b535a4 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 _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 +var _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserMailQueue,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x114a45,_0x364722){var _0x121422=function(_0x4dff92){while(--_0x4dff92){_0x114a45['push'](_0x114a45['shift']());}};_0x121422(++_0x364722);}(_0x4b84,0x1cc));var _0x44b8=function(_0x25b4a4,_0x2e081b){_0x25b4a4=_0x25b4a4-0x0;var _0x707267=_0x4b84[_0x25b4a4];return _0x707267;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 9e610b2..a818b6e 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 _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 +var _0x927b=['../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1356fc,_0x4d3b5b){var _0x1772c8=function(_0x5aee2d){while(--_0x5aee2d){_0x1356fc['push'](_0x1356fc['shift']());}};_0x1772c8(++_0x4d3b5b);}(_0x927b,0x159));var _0xb927=function(_0xafdf47,_0x38b5b3){_0xafdf47=_0xafdf47-0x0;var _0x1e6c17=_0x927b[_0xafdf47];return _0x1e6c17;};'use strict';var multer=require(_0xb927('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb927('0x1'));var express=require(_0xb927('0x2'));var router=express[_0xb927('0x3')]();var fs_extra=require(_0xb927('0x4'));var auth=require(_0xb927('0x5'));var interaction=require(_0xb927('0x6'));var config=require(_0xb927('0x7'));var controller=require(_0xb927('0x8'));router[_0xb927('0x9')]('/',auth[_0xb927('0xa')](),controller[_0xb927('0xb')]);module[_0xb927('0xc')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index ce73679..068528e 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 _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 +var _0x3a34=['TEXT','sequelize','exports','STRING'];(function(_0x4c184d,_0x4278ab){var _0x23d997=function(_0x22d068){while(--_0x22d068){_0x4c184d['push'](_0x4c184d['shift']());}};_0x23d997(++_0x4278ab);}(_0x3a34,0x115));var _0x43a3=function(_0x2bfd90,_0x102539){_0x2bfd90=_0x2bfd90-0x0;var _0x33e709=_0x3a34[_0x2bfd90];return _0x33e709;};'use strict';var Sequelize=require(_0x43a3('0x0'));module[_0x43a3('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x43a3('0x2')]},'recipientsId':{'type':Sequelize[_0x43a3('0x3')]},'recipientsDescription':{'type':Sequelize[_0x43a3('0x2')]},'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 8d61ea5..06ee484 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 _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 +var _0x6cff=['User','union','queue','Queue','ids','push','all','map','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','reject','then','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','view','Missing\x20\x27view\x27\x20parameter','recipients','ValidationError','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','user','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','forEach','recipient','emit','userNotification:send','catch','Template','findOne','html','startCase'];(function(_0x3d0b4d,_0x47cd13){var _0x3e57e1=function(_0x39b539){while(--_0x39b539){_0x3d0b4d['push'](_0x3d0b4d['shift']());}};_0x3e57e1(++_0x47cd13);}(_0x6cff,0x116));var _0xf6cf=function(_0x2bcb75,_0x5789a7){_0x2bcb75=_0x2bcb75-0x0;var _0x175345=_0x6cff[_0x2bcb75];return _0x175345;};'use strict';var emlformat=require(_0xf6cf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf6cf('0x1'));var jsonpatch=require(_0xf6cf('0x2'));var rp=require('request-promise');var moment=require(_0xf6cf('0x3'));var BPromise=require(_0xf6cf('0x4'));var Mustache=require(_0xf6cf('0x5'));var util=require(_0xf6cf('0x6'));var path=require(_0xf6cf('0x7'));var sox=require('sox');var csv=require(_0xf6cf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf6cf('0x9'));var squel=require('squel');var crypto=require(_0xf6cf('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf6cf('0xb'));var Papa=require('papaparse');var Redis=require(_0xf6cf('0xc'));var authService=require(_0xf6cf('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf6cf('0xe'));var logger=require(_0xf6cf('0xf'))(_0xf6cf('0x10'));var utils=require(_0xf6cf('0x11'));var config=require(_0xf6cf('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xf6cf('0x13')]=_['defaults'](config[_0xf6cf('0x13')],{'host':_0xf6cf('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf6cf('0x13')]));require(_0xf6cf('0x15'))[_0xf6cf('0x16')](socket);function respondWithStatusCode(_0x75a88a,_0x1825a3){_0x1825a3=_0x1825a3||0xcc;return function(_0x2e8d55){if(_0x2e8d55){return _0x75a88a[_0xf6cf('0x17')](_0x1825a3);}return _0x75a88a[_0xf6cf('0x18')](_0x1825a3)[_0xf6cf('0x19')]();};}function respondWithResult(_0x1e747a,_0x3643bc){_0x3643bc=_0x3643bc||0xc8;return function(_0x523850){if(_0x523850){return _0x1e747a[_0xf6cf('0x18')](_0x3643bc)[_0xf6cf('0x1a')](_0x523850);}};}function respondWithFilteredResult(_0x4ddd29,_0x2449e4){return function(_0x439d27){if(_0x439d27){var _0x4371e0=typeof _0x2449e4[_0xf6cf('0x1b')]===_0xf6cf('0x1c')&&typeof _0x2449e4[_0xf6cf('0x1d')]===_0xf6cf('0x1c');var _0x16c4b3=_0x439d27[_0xf6cf('0x1e')];var _0x1a9e56=_0x4371e0?0x0:_0x2449e4[_0xf6cf('0x1b')];var _0x38b3d7=_0x4371e0?_0x439d27['count']:_0x2449e4[_0xf6cf('0x1b')]+_0x2449e4['limit'];var _0x198bc5;if(_0x38b3d7>=_0x16c4b3){_0x38b3d7=_0x16c4b3;_0x198bc5=0xc8;}else{_0x198bc5=0xce;}_0x4ddd29[_0xf6cf('0x18')](_0x198bc5);return _0x4ddd29['set']('Content-Range',_0x1a9e56+'-'+_0x38b3d7+'/'+_0x16c4b3)[_0xf6cf('0x1a')](_0x439d27);}return null;};}function patchUpdates(_0x4ea0d0){return function(_0x195029){try{jsonpatch['apply'](_0x195029,_0x4ea0d0,!![]);}catch(_0x4492c6){return BPromise[_0xf6cf('0x1f')](_0x4492c6);}return _0x195029['save']();};}function saveUpdates(_0x594624,_0x3fb53b){return function(_0x2da6de){if(_0x2da6de){return _0x2da6de['update'](_0x594624)[_0xf6cf('0x20')](function(_0x2f541b){return _0x2f541b;});}return null;};}function removeEntity(_0x5d26eb,_0x1bc364){return function(_0x472480){if(_0x472480){return _0x472480[_0xf6cf('0x21')]()[_0xf6cf('0x20')](function(){_0x5d26eb[_0xf6cf('0x18')](0xcc)[_0xf6cf('0x19')]();});}};}function handleEntityNotFound(_0x25b40e,_0x2cd10d){return function(_0x58e940){if(!_0x58e940){_0x25b40e[_0xf6cf('0x17')](0x194);}return _0x58e940;};}function handleError(_0x19dd45,_0xab37e3){_0xab37e3=_0xab37e3||0x1f4;return function(_0x3ee446){logger[_0xf6cf('0x22')](_0x3ee446[_0xf6cf('0x23')]);if(_0x3ee446[_0xf6cf('0x24')]){delete _0x3ee446[_0xf6cf('0x24')];}_0x19dd45[_0xf6cf('0x18')](_0xab37e3)[_0xf6cf('0x25')](_0x3ee446);};}exports[_0xf6cf('0x26')]=function(_0x2d0c9c,_0x1c5a57,_0x542229){if(!_0x2d0c9c[_0xf6cf('0x27')][_0xf6cf('0x28')](_0xf6cf('0x29'))&&!_0x2d0c9c[_0xf6cf('0x27')][_0xf6cf('0x28')](_0xf6cf('0x2a'))){throw new db[(_0xf6cf('0x2b'))]['ValidationError']('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x2d0c9c['body'][_0xf6cf('0x28')](_0xf6cf('0x2a'))&&!_0x2d0c9c['body'][_0xf6cf('0x28')](_0xf6cf('0x2c'))){throw new db['Sequelize']['ValidationError'](_0xf6cf('0x2d'));}if(!_0x2d0c9c[_0xf6cf('0x27')][_0xf6cf('0x28')](_0xf6cf('0x2e'))){throw new db[(_0xf6cf('0x2b'))][(_0xf6cf('0x2f'))](_0xf6cf('0x30'));}else{try{var _0x55028a=JSON[_0xf6cf('0x31')](_0x2d0c9c[_0xf6cf('0x27')][_0xf6cf('0x2e')]);}catch(_0x302eac){logger['error'](_0x302eac);throw new db[(_0xf6cf('0x2b'))][(_0xf6cf('0x2f'))](_0xf6cf('0x32'));}var _0x588aee=['chatqueue',_0xf6cf('0x33'),_0xf6cf('0x34'),_0xf6cf('0x35'),_0xf6cf('0x36'),'voicequeue',_0xf6cf('0x37'),_0xf6cf('0x38'),_0xf6cf('0x39')];if(_['some'](_0x55028a,function(_0x1ed731){return!_[_0xf6cf('0x3a')](_0x588aee,_0x1ed731[_0xf6cf('0x3b')]['toLowerCase']());})){throw new db[(_0xf6cf('0x2b'))][(_0xf6cf('0x2f'))](_0xf6cf('0x3c'));}}}var _0x392ca1={};_0x392ca1[_0xf6cf('0x3d')]=_0x2d0c9c[_0xf6cf('0x27')]['hasOwnProperty'](_0xf6cf('0x3d'))?_0x2d0c9c[_0xf6cf('0x27')][_0xf6cf('0x3d')]:_0x2d0c9c[_0xf6cf('0x39')][_0xf6cf('0x3e')];_0x392ca1[_0xf6cf('0x3f')]=_[_0xf6cf('0x40')](_0x2d0c9c['body'][_0xf6cf('0x3f')])?null:_0x2d0c9c['body'][_0xf6cf('0x3f')];_0x392ca1[_0xf6cf('0x41')]=_0x2d0c9c[_0xf6cf('0x27')]['beep']||![];_0x392ca1[_0xf6cf('0x42')]=_0x2d0c9c[_0xf6cf('0x39')]['id'];return getContent(_0x2d0c9c['body'])[_0xf6cf('0x20')](function(_0x2e9963){_0x392ca1[_0xf6cf('0x27')]=_0x2e9963;return getRecipients(_0x55028a);})['then'](function(_0x22ab71){_0x392ca1[_0xf6cf('0x43')]=_[_0xf6cf('0x44')](_0x22ab71)[_0xf6cf('0x45')](',');return db[_0xf6cf('0x46')][_0xf6cf('0x47')](function(_0x5de0a8){return db[_0xf6cf('0x48')]['create'](_0x392ca1,{'raw':!![],'transaction':_0x5de0a8})[_0xf6cf('0x20')](function(_0x5bebac){var _0x2e8a0d={'sender':_0x392ca1['senderName'],'description':_0x392ca1[_0xf6cf('0x3f')],'content':_0x392ca1[_0xf6cf('0x27')],'beep':_0x392ca1[_0xf6cf('0x41')]};_0x22ab71[_0xf6cf('0x49')](function(_0x2956fb){_0x2e8a0d[_0xf6cf('0x4a')]=_0x2956fb;socket[_0xf6cf('0x4b')](_0xf6cf('0x4c'),_0x2e8a0d);});return _0x5bebac;});});})[_0xf6cf('0x20')](respondWithResult(_0x1c5a57,0xc9))[_0xf6cf('0x4d')](handleError(_0x1c5a57,null));};function getContent(_0x591905){return new BPromise(function(_0x30f5e0,_0x2e5749){if(_0x591905['text']){_0x30f5e0(_0x591905[_0xf6cf('0x29')]);return;}return db[_0xf6cf('0x4e')][_0xf6cf('0x4f')]({'attributes':['html'],'where':{'id':_0x591905[_0xf6cf('0x2a')]},'raw':!![]})[_0xf6cf('0x20')](function(_0x1a527c){if(!_0x1a527c)throw new db['Sequelize']['ValidationError']('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x1eb254=Mustache['render'](_0x1a527c[_0xf6cf('0x50')],_0x591905[_0xf6cf('0x2c')]);_0x30f5e0(_0x1eb254);})[_0xf6cf('0x4d')](function(_0x55551d){_0x2e5749(_0x55551d);});});}function getRecipients(_0x3770b5){return new BPromise(function(_0x43842c,_0x3104e7){var _0x5e967f=[];var _0x5500b4=[];_0x3770b5[_0xf6cf('0x49')](function(_0x483b4b){var _0x12fd09=_[_0xf6cf('0x51')](_0x483b4b[_0xf6cf('0x3b')]['toLowerCase']());if(_0x12fd09===_0xf6cf('0x52')){_0x5e967f=_[_0xf6cf('0x53')](_0x5e967f,_0x483b4b['ids']);}else{if(_[_0xf6cf('0x3a')](_0x12fd09,_0xf6cf('0x54')))_0x12fd09=_0x12fd09['replace'](_0xf6cf('0x54'),_0xf6cf('0x55'));_0x483b4b[_0xf6cf('0x56')][_0xf6cf('0x49')](function(_0x77490a){_0x5500b4[_0xf6cf('0x57')](getAgents(_0x12fd09,_0x77490a));});}});return BPromise[_0xf6cf('0x58')](_0x5500b4)[_0xf6cf('0x20')](function(_0x141048){_0x5e967f=_[_0xf6cf('0x53')](_0x5e967f,_['flatten'](_0x141048));_0x43842c(_0x5e967f);})[_0xf6cf('0x4d')](function(_0xa991d3){_0x3104e7(_0xa991d3);});});}function getAgents(_0x1b62c8,_0x27108c){return new BPromise(function(_0x4b6d22,_0x21c420){return db[_0x1b62c8][_0xf6cf('0x4f')]({'where':{'id':_0x27108c}})[_0xf6cf('0x20')](function(_0x3811dd){return _0x3811dd['getAgents']({'attributes':['id'],'raw':!![]})['then'](function(_0x3a556d){var _0x13cb62=_[_0xf6cf('0x59')](_0x3a556d,'id');_0x4b6d22(_0x13cb62);});})[_0xf6cf('0x4d')](function(_0x879956){_0x21c420(_0x879956);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 37f16be..f6c07f9 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 _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 +var _0x7310=['remove','emit','hasOwnProperty','events','../../mysqldb','UserNotification','setMaxListeners','save'];(function(_0x4268eb,_0x79c33b){var _0x98b2e2=function(_0x10e454){while(--_0x10e454){_0x4268eb['push'](_0x4268eb['shift']());}};_0x98b2e2(++_0x79c33b);}(_0x7310,0xbb));var _0x0731=function(_0x5d6eaf,_0x5e8c49){_0x5d6eaf=_0x5d6eaf-0x0;var _0x8ab44b=_0x7310[_0x5d6eaf];return _0x8ab44b;};'use strict';var EventEmitter=require(_0x0731('0x0'));var UserNotification=require(_0x0731('0x1'))['db'][_0x0731('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x0731('0x3')](0x0);var events={'afterCreate':_0x0731('0x4'),'afterUpdate':'update','afterDestroy':_0x0731('0x5')};function emitEvent(_0x58314a){return function(_0x3ac732,_0x214777,_0x1a1214){UserNotificationEvents[_0x0731('0x6')](_0x58314a+':'+_0x3ac732['id'],_0x3ac732);UserNotificationEvents[_0x0731('0x6')](_0x58314a,_0x3ac732);_0x1a1214(null);};}for(var e in events){if(events[_0x0731('0x7')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 924bec4..811c142 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 _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 +var _0x0d4f=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','utf8mb4'];(function(_0x11494b,_0x59e319){var _0x22728d=function(_0x4e11e9){while(--_0x4e11e9){_0x11494b['push'](_0x11494b['shift']());}};_0x22728d(++_0x59e319);}(_0x0d4f,0x169));var _0xf0d4=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0x0d4f[_0x33bc64];return _0x3fdd34;};'use strict';var _=require(_0xf0d4('0x0'));var util=require(_0xf0d4('0x1'));var logger=require(_0xf0d4('0x2'))('api');var moment=require(_0xf0d4('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0d4('0x4'));var rimraf=require(_0xf0d4('0x5'));var config=require(_0xf0d4('0x6'));var attributes=require(_0xf0d4('0x7'));module[_0xf0d4('0x8')]=function(_0x270d1a,_0x364b1){return _0x270d1a[_0xf0d4('0x9')]('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf0d4('0xa'),'collate':_0xf0d4('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index a88c0c1..d93f36b 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 _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 +var _0x0d18=['result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','register','request','then','info','UserNotification,\x20%s,\x20%s','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x0d18,0x12e));var _0x80d1=function(_0x4c9058,_0x445379){_0x4c9058=_0x4c9058-0x0;var _0x309ec6=_0x0d18[_0x4c9058];return _0x309ec6;};'use strict';var _=require(_0x80d1('0x0'));var util=require(_0x80d1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80d1('0x2'));var db=require(_0x80d1('0x3'))['db'];var utils=require(_0x80d1('0x4'));var logger=require(_0x80d1('0x5'))(_0x80d1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x80d1('0x7')][_0x80d1('0x8')]({'port':0x232a});config[_0x80d1('0x9')]=_[_0x80d1('0xa')](config[_0x80d1('0x9')],{'host':_0x80d1('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userNotification.socket')[_0x80d1('0xc')](socket);function respondWithRpcPromise(_0x4daeec,_0x1e3378,_0x3328c6){return new BPromise(function(_0x8e7699,_0x244e9d){return client[_0x80d1('0xd')](_0x4daeec,_0x3328c6)[_0x80d1('0xe')](function(_0x4d999f){logger[_0x80d1('0xf')](_0x80d1('0x10'),_0x1e3378,'request\x20sent');logger['debug'](_0x80d1('0x11'),_0x1e3378,_0x80d1('0x12'),JSON[_0x80d1('0x13')](_0x4d999f));if(_0x4d999f[_0x80d1('0x14')]){if(_0x4d999f[_0x80d1('0x14')][_0x80d1('0x15')]===0x1f4){logger[_0x80d1('0x14')](_0x80d1('0x10'),_0x1e3378,_0x4d999f['error'][_0x80d1('0x16')]);return _0x244e9d(_0x4d999f[_0x80d1('0x14')]['message']);}logger['error'](_0x80d1('0x10'),_0x1e3378,_0x4d999f[_0x80d1('0x14')]['message']);return _0x8e7699(_0x4d999f[_0x80d1('0x14')]['message']);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x1e3378,_0x80d1('0x12'));_0x8e7699(_0x4d999f[_0x80d1('0x17')]['message']);}})[_0x80d1('0x18')](function(_0x311bad){logger[_0x80d1('0x14')]('UserNotification,\x20%s,\x20%s',_0x1e3378,_0x311bad);_0x244e9d(_0x311bad);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 36ca1a9..090ef4f 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 _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 +var _0xe7e0=['register','length','userNotification:','./userNotification.events','save','remove','update','emit'];(function(_0x2e5256,_0x21ed55){var _0xa380ae=function(_0x43dffc){while(--_0x43dffc){_0x2e5256['push'](_0x2e5256['shift']());}};_0xa380ae(++_0x21ed55);}(_0xe7e0,0xd3));var _0x0e7e=function(_0x442a22,_0x22ad39){_0x442a22=_0x442a22-0x0;var _0x427073=_0xe7e0[_0x442a22];return _0x427073;};'use strict';var UserNotificationEvents=require(_0x0e7e('0x0'));var events=[_0x0e7e('0x1'),_0x0e7e('0x2'),_0x0e7e('0x3')];function createListener(_0x28857d,_0x24f1c2){return function(_0x54a69b){_0x24f1c2[_0x0e7e('0x4')](_0x28857d,_0x54a69b);};}function removeListener(_0xb88d07,_0x5c943f){return function(){UserNotificationEvents['removeListener'](_0xb88d07,_0x5c943f);};}exports[_0x0e7e('0x5')]=function(_0x122abd){for(var _0x21d46c=0x0,_0x459194=events[_0x0e7e('0x6')];_0x21d46c<_0x459194;_0x21d46c++){var _0x509af4=events[_0x21d46c];var _0x43b72b=createListener(_0x0e7e('0x7')+_0x509af4,_0x122abd);UserNotificationEvents['on'](_0x509af4,_0x43b72b);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 74e9dbe..fb62558 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_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 +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0xeb4a01,_0xc83300){var _0x39d234=function(_0x585c79){while(--_0x585c79){_0xeb4a01['push'](_0xeb4a01['shift']());}};_0x39d234(++_0xc83300);}(_0xedd9,0xfc));var _0x9edd=function(_0x41430d,_0x45f545){_0x41430d=_0x41430d-0x0;var _0x3167da=_0xedd9[_0x41430d];return _0x3167da;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 79b7319..31bf4a0 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 _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 +var _0xc811=['exports'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xc811,0x182));var _0x1c81=function(_0x536a01,_0x5312d1){_0x536a01=_0x536a01-0x0;var _0x40fd57=_0xc811[_0x536a01];return _0x40fd57;};'use strict';var Sequelize=require('sequelize');module[_0x1c81('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 0c28cc7..736c2dc 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 _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 +var _0xb09b=['../../config/environment','./userOpenchannelQueue.attributes','exports','user_has_openchannel_queues','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xb09b,0x1e4));var _0xbb09=function(_0x199c9b,_0xd6e4c3){_0x199c9b=_0x199c9b-0x0;var _0x2f4c42=_0xb09b[_0x199c9b];return _0x2f4c42;};'use strict';var _=require(_0xbb09('0x0'));var util=require('util');var logger=require(_0xbb09('0x1'))(_0xbb09('0x2'));var moment=require('moment');var BPromise=require(_0xbb09('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb09('0x4'));var rimraf=require(_0xbb09('0x5'));var config=require(_0xbb09('0x6'));var attributes=require(_0xbb09('0x7'));module[_0xbb09('0x8')]=function(_0x3b9d7a,_0x15a213){return _0x3b9d7a['define']('UserOpenchannelQueue',attributes,{'tableName':_0xbb09('0x9'),'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 b2fe848..65fab80 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 _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 +var _0x7966=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5499aa,_0x209ade){var _0x4ce862=function(_0x2b2af4){while(--_0x2b2af4){_0x5499aa['push'](_0x5499aa['shift']());}};_0x4ce862(++_0x209ade);}(_0x7966,0x1cc));var _0x6796=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7966[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x6796('0x0'));var moment=require(_0x6796('0x1'));var BPromise=require(_0x6796('0x2'));var rs=require(_0x6796('0x3'));var fs=require('fs');var Redis=require(_0x6796('0x4'));var db=require(_0x6796('0x5'))['db'];var utils=require(_0x6796('0x6'));var logger=require(_0x6796('0x7'))(_0x6796('0x8'));var config=require(_0x6796('0x9'));var jayson=require(_0x6796('0xa'));var client=jayson[_0x6796('0xb')][_0x6796('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3371ad,_0x7accde,_0x209e25){return new BPromise(function(_0x19e6f5,_0x30701d){return client[_0x6796('0xd')](_0x3371ad,_0x209e25)[_0x6796('0xe')](function(_0x48069c){logger[_0x6796('0xf')](_0x6796('0x10'),_0x7accde,_0x6796('0x11'));logger[_0x6796('0x12')](_0x6796('0x13'),_0x7accde,_0x6796('0x11'),JSON[_0x6796('0x14')](_0x48069c));if(_0x48069c[_0x6796('0x15')]){if(_0x48069c['error'][_0x6796('0x16')]===0x1f4){logger['error'](_0x6796('0x10'),_0x7accde,_0x48069c[_0x6796('0x15')][_0x6796('0x17')]);return _0x30701d(_0x48069c[_0x6796('0x15')][_0x6796('0x17')]);}logger[_0x6796('0x15')](_0x6796('0x10'),_0x7accde,_0x48069c[_0x6796('0x15')][_0x6796('0x17')]);return _0x19e6f5(_0x48069c[_0x6796('0x15')][_0x6796('0x17')]);}else{logger[_0x6796('0xf')](_0x6796('0x10'),_0x7accde,_0x6796('0x11'));_0x19e6f5(_0x48069c[_0x6796('0x18')]['message']);}})[_0x6796('0x19')](function(_0x3093d9){logger[_0x6796('0x15')](_0x6796('0x10'),_0x7accde,_0x3093d9);_0x30701d(_0x3093d9);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 9140007..21fc5dc 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 _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 +var _0x36b2=['util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','/:id/clone','clone','post','addSections','put','update','delete','destroy','removeResources','multer'];(function(_0x13572e,_0x427d52){var _0x5ce115=function(_0x1167c9){while(--_0x1167c9){_0x13572e['push'](_0x13572e['shift']());}};_0x5ce115(++_0x427d52);}(_0x36b2,0x6b));var _0x236b=function(_0x1ec8f9,_0x20e983){_0x1ec8f9=_0x1ec8f9-0x0;var _0x1520ec=_0x36b2[_0x1ec8f9];return _0x1520ec;};'use strict';var multer=require(_0x236b('0x0'));var util=require(_0x236b('0x1'));var path=require(_0x236b('0x2'));var timeout=require('connect-timeout');var express=require(_0x236b('0x3'));var router=express[_0x236b('0x4')]();var fs_extra=require(_0x236b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x236b('0x6'));var config=require(_0x236b('0x7'));var controller=require('./userProfile.controller');router[_0x236b('0x8')]('/',auth[_0x236b('0x9')](),controller[_0x236b('0xa')]);router[_0x236b('0x8')](_0x236b('0xb'),auth[_0x236b('0x9')](),controller['describe']);router[_0x236b('0x8')](_0x236b('0xc'),auth[_0x236b('0x9')](),controller[_0x236b('0xd')]);router['get'](_0x236b('0xe'),auth[_0x236b('0x9')](),controller[_0x236b('0xf')]);router['get'](_0x236b('0x10'),auth[_0x236b('0x9')](),controller[_0x236b('0x11')]);router['post']('/',auth[_0x236b('0x9')](),controller['create']);router['post'](_0x236b('0x12'),auth['isAuthenticated'](),controller[_0x236b('0x13')]);router[_0x236b('0x14')](_0x236b('0xe'),auth[_0x236b('0x9')](),controller[_0x236b('0x15')]);router[_0x236b('0x14')](_0x236b('0x10'),auth['isAuthenticated'](),controller['addResources']);router[_0x236b('0x16')](_0x236b('0xc'),auth[_0x236b('0x9')](),controller[_0x236b('0x17')]);router[_0x236b('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x236b('0x19')]);router['delete'](_0x236b('0xe'),auth[_0x236b('0x9')](),controller['removeSections']);router['delete'](_0x236b('0x10'),auth['isAuthenticated'](),controller[_0x236b('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 23c1e59..dbc65a5 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 _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 +var _0x5daa=['setDataValue','crudPermissions','join','getDataValue','split','STRING','BOOLEAN','exports'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0x5daa,0x18f));var _0xa5da=function(_0x309f06,_0x134bf8){_0x309f06=_0x309f06-0x0;var _0x189309=_0x5daa[_0x309f06];return _0x189309;};'use strict';var Sequelize=require('sequelize');module[_0xa5da('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x5dccf5){this[_0xa5da('0x1')](_0xa5da('0x2'),_0x5dccf5?_0x5dccf5[_0xa5da('0x3')](''):[]);},'get':function(){return this[_0xa5da('0x4')](_0xa5da('0x2'))?this[_0xa5da('0x4')](_0xa5da('0x2'))[_0xa5da('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xa5da('0x6')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xa5da('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xa5da('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xa5da('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xa5da('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xa5da('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xa5da('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xa5da('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 79c10ba..bb7ba07 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 _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 +var _0xc0d3=['query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','params','create','body','catch','clone','includeAll','options','find','get','omit','createdAt','updatedAt','crudPermissions','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','userProfileId','Resources','update','describe','sectionId','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','concat','push','findOne','Dashboard','forEach','resourceId','Plugin','sequelize','bulkCreate','removeResources','getResources','section','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','localhost','socket.io-emitter','redis','./userProfile.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','end','stack','send','index','map','UserProfile','rawAttributes','type','key','model','name'];(function(_0x4eb7e6,_0x451464){var _0x3cf508=function(_0x462471){while(--_0x462471){_0x4eb7e6['push'](_0x4eb7e6['shift']());}};_0x3cf508(++_0x451464);}(_0xc0d3,0x191));var _0x3c0d=function(_0x4717dc,_0x22cbf9){_0x4717dc=_0x4717dc-0x0;var _0x23025b=_0xc0d3[_0x4717dc];return _0x23025b;};'use strict';var emlformat=require(_0x3c0d('0x0'));var rimraf=require(_0x3c0d('0x1'));var zipdir=require(_0x3c0d('0x2'));var jsonpatch=require(_0x3c0d('0x3'));var rp=require(_0x3c0d('0x4'));var moment=require(_0x3c0d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3c0d('0x6'));var util=require('util');var path=require(_0x3c0d('0x7'));var sox=require(_0x3c0d('0x8'));var csv=require(_0x3c0d('0x9'));var ejs=require(_0x3c0d('0xa'));var fs=require('fs');var fs_extra=require(_0x3c0d('0xb'));var _=require(_0x3c0d('0xc'));var squel=require(_0x3c0d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3c0d('0x9'));var querystring=require('querystring');var Papa=require(_0x3c0d('0xe'));var Redis=require(_0x3c0d('0xf'));var authService=require(_0x3c0d('0x10'));var qs=require(_0x3c0d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c0d('0x12'));var logger=require(_0x3c0d('0x13'))(_0x3c0d('0x14'));var utils=require(_0x3c0d('0x15'));var config=require(_0x3c0d('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x3c0d('0x17')](config['redis'],{'host':_0x3c0d('0x18'),'port':0x18eb});var socket=require(_0x3c0d('0x19'))(new Redis(config[_0x3c0d('0x1a')]));require(_0x3c0d('0x1b'))[_0x3c0d('0x1c')](socket);function respondWithStatusCode(_0x448c6f,_0xc249bf){_0xc249bf=_0xc249bf||0xcc;return function(_0x1e4469){if(_0x1e4469){return _0x448c6f[_0x3c0d('0x1d')](_0xc249bf);}return _0x448c6f[_0x3c0d('0x1e')](_0xc249bf)['end']();};}function respondWithResult(_0x22481b,_0x544142){_0x544142=_0x544142||0xc8;return function(_0x4cb4fb){if(_0x4cb4fb){return _0x22481b[_0x3c0d('0x1e')](_0x544142)[_0x3c0d('0x1f')](_0x4cb4fb);}};}function respondWithFilteredResult(_0x49b8dd,_0x1ce0e1){return function(_0x3a31a3){if(_0x3a31a3){var _0x3d6c04=typeof _0x1ce0e1[_0x3c0d('0x20')]===_0x3c0d('0x21')&&typeof _0x1ce0e1[_0x3c0d('0x22')]==='undefined';var _0x1be730=_0x3a31a3[_0x3c0d('0x23')];var _0x46b791=_0x3d6c04?0x0:_0x1ce0e1[_0x3c0d('0x20')];var _0x31a3c3=_0x3d6c04?_0x3a31a3[_0x3c0d('0x23')]:_0x1ce0e1[_0x3c0d('0x20')]+_0x1ce0e1[_0x3c0d('0x22')];var _0xfe1e26;if(_0x31a3c3>=_0x1be730){_0x31a3c3=_0x1be730;_0xfe1e26=0xc8;}else{_0xfe1e26=0xce;}_0x49b8dd['status'](_0xfe1e26);return _0x49b8dd[_0x3c0d('0x24')](_0x3c0d('0x25'),_0x46b791+'-'+_0x31a3c3+'/'+_0x1be730)[_0x3c0d('0x1f')](_0x3a31a3);}return null;};}function patchUpdates(_0x593919){return function(_0x3a6f71){try{jsonpatch['apply'](_0x3a6f71,_0x593919,!![]);}catch(_0x57f5b7){return BPromise['reject'](_0x57f5b7);}return _0x3a6f71['save']();};}function saveUpdates(_0x514bdd,_0x55c956){return function(_0x5c381f){if(_0x5c381f){return _0x5c381f['update'](_0x514bdd)[_0x3c0d('0x26')](function(_0xc32b7a){return _0xc32b7a;});}return null;};}function removeEntity(_0x52438c,_0x46b7ef){return function(_0x4e8a86){if(_0x4e8a86){return _0x4e8a86[_0x3c0d('0x27')]()['then'](function(){_0x52438c[_0x3c0d('0x1e')](0xcc)[_0x3c0d('0x28')]();});}};}function handleEntityNotFound(_0x5dd1eb,_0x8d38bb){return function(_0x4543aa){if(!_0x4543aa){_0x5dd1eb[_0x3c0d('0x1d')](0x194);}return _0x4543aa;};}function handleError(_0x180914,_0x359332){_0x359332=_0x359332||0x1f4;return function(_0x2b34ae){logger['error'](_0x2b34ae[_0x3c0d('0x29')]);if(_0x2b34ae['name']){delete _0x2b34ae['name'];}_0x180914[_0x3c0d('0x1e')](_0x359332)[_0x3c0d('0x2a')](_0x2b34ae);};}exports[_0x3c0d('0x2b')]=function(_0x213452,_0x149b59){var _0x3b0d5c={},_0x2434ae={},_0x2328e7={'count':0x0,'rows':[]};var _0x3f75a3=_[_0x3c0d('0x2c')](db[_0x3c0d('0x2d')][_0x3c0d('0x2e')],function(_0x4d9973){return{'name':_0x4d9973['fieldName'],'type':_0x4d9973[_0x3c0d('0x2f')][_0x3c0d('0x30')]};});_0x2434ae[_0x3c0d('0x31')]=_[_0x3c0d('0x2c')](_0x3f75a3,_0x3c0d('0x32'));_0x2434ae[_0x3c0d('0x33')]=_[_0x3c0d('0x34')](_0x213452[_0x3c0d('0x33')]);_0x2434ae[_0x3c0d('0x35')]=_[_0x3c0d('0x36')](_0x2434ae[_0x3c0d('0x31')],_0x2434ae[_0x3c0d('0x33')]);_0x3b0d5c[_0x3c0d('0x37')]=_[_0x3c0d('0x36')](_0x2434ae['model'],qs['fields'](_0x213452[_0x3c0d('0x33')][_0x3c0d('0x38')]));_0x3b0d5c['attributes']=_0x3b0d5c['attributes'][_0x3c0d('0x39')]?_0x3b0d5c[_0x3c0d('0x37')]:_0x2434ae[_0x3c0d('0x31')];if(!_0x213452[_0x3c0d('0x33')]['hasOwnProperty'](_0x3c0d('0x3a'))){_0x3b0d5c[_0x3c0d('0x22')]=qs[_0x3c0d('0x22')](_0x213452[_0x3c0d('0x33')][_0x3c0d('0x22')]);_0x3b0d5c['offset']=qs[_0x3c0d('0x20')](_0x213452['query'][_0x3c0d('0x20')]);}_0x3b0d5c[_0x3c0d('0x3b')]=qs[_0x3c0d('0x3c')](_0x213452[_0x3c0d('0x33')][_0x3c0d('0x3c')]);_0x3b0d5c['where']=qs[_0x3c0d('0x35')](_[_0x3c0d('0x3d')](_0x213452[_0x3c0d('0x33')],_0x2434ae[_0x3c0d('0x35')]),_0x3f75a3);if(_0x213452[_0x3c0d('0x33')][_0x3c0d('0x3e')]){_0x3b0d5c[_0x3c0d('0x3f')]=_[_0x3c0d('0x40')](_0x3b0d5c[_0x3c0d('0x3f')],{'$or':_[_0x3c0d('0x2c')](_0x3f75a3,function(_0x2893c0){if(_0x2893c0[_0x3c0d('0x2f')]!==_0x3c0d('0x41')){var _0x2283a4={};_0x2283a4[_0x2893c0[_0x3c0d('0x32')]]={'$like':'%'+_0x213452['query'][_0x3c0d('0x3e')]+'%'};return _0x2283a4;}})});}_0x3b0d5c=_[_0x3c0d('0x40')]({},_0x3b0d5c,_0x213452['options']);var _0x1f14c8={'where':_0x3b0d5c[_0x3c0d('0x3f')]};return db[_0x3c0d('0x2d')][_0x3c0d('0x23')](_0x1f14c8)[_0x3c0d('0x26')](function(_0x122bc3){_0x2328e7[_0x3c0d('0x23')]=_0x122bc3;if(_0x213452[_0x3c0d('0x33')]['includeAll']){_0x3b0d5c[_0x3c0d('0x42')]=[{'all':!![]}];}return db['UserProfile'][_0x3c0d('0x43')](_0x3b0d5c);})[_0x3c0d('0x26')](function(_0x4e4938){_0x2328e7[_0x3c0d('0x44')]=_0x4e4938;return _0x2328e7;})[_0x3c0d('0x26')](respondWithFilteredResult(_0x149b59,_0x3b0d5c))['catch'](handleError(_0x149b59,null));};exports['show']=function(_0x2bf81f,_0x1cdd14){var _0x27ee5d={'raw':![],'where':{'id':_0x2bf81f[_0x3c0d('0x45')]['id']}},_0x151b1e={};_0x151b1e[_0x3c0d('0x31')]=_[_0x3c0d('0x34')](db[_0x3c0d('0x2d')]['rawAttributes']);_0x151b1e['query']=_[_0x3c0d('0x34')](_0x2bf81f[_0x3c0d('0x33')]);_0x151b1e['filters']=_[_0x3c0d('0x36')](_0x151b1e['model'],_0x151b1e[_0x3c0d('0x33')]);_0x27ee5d[_0x3c0d('0x37')]=_[_0x3c0d('0x36')](_0x151b1e[_0x3c0d('0x31')],qs[_0x3c0d('0x38')](_0x2bf81f[_0x3c0d('0x33')][_0x3c0d('0x38')]));_0x27ee5d[_0x3c0d('0x37')]=_0x27ee5d[_0x3c0d('0x37')]['length']?_0x27ee5d[_0x3c0d('0x37')]:_0x151b1e[_0x3c0d('0x31')];if(_0x2bf81f[_0x3c0d('0x33')]['includeAll']){_0x27ee5d[_0x3c0d('0x42')]=[{'all':!![]}];}_0x27ee5d=_[_0x3c0d('0x40')]({},_0x27ee5d,_0x2bf81f['options']);return db['UserProfile']['find'](_0x27ee5d)['then'](handleEntityNotFound(_0x1cdd14,null))[_0x3c0d('0x26')](respondWithResult(_0x1cdd14,null))['catch'](handleError(_0x1cdd14,null));};exports[_0x3c0d('0x46')]=function(_0x3ff01d,_0x228f2e){return db[_0x3c0d('0x2d')]['create'](_0x3ff01d[_0x3c0d('0x47')],{})[_0x3c0d('0x26')](respondWithResult(_0x228f2e,0xc9))[_0x3c0d('0x48')](handleError(_0x228f2e,null));};exports[_0x3c0d('0x49')]=function(_0xddedd3,_0x32d140){var _0x1b054b={'where':{'id':_0xddedd3[_0x3c0d('0x45')]['id']}},_0x5184d9={};_0x5184d9['model']=_[_0x3c0d('0x34')](db['UserProfile'][_0x3c0d('0x2e')]);_0x1b054b[_0x3c0d('0x37')]=_[_0x3c0d('0x36')](_0x5184d9[_0x3c0d('0x31')],qs[_0x3c0d('0x38')](_0xddedd3['query'][_0x3c0d('0x38')]));_0x1b054b['attributes']=_0x1b054b['attributes'][_0x3c0d('0x39')]?_0x1b054b[_0x3c0d('0x37')]:_0x5184d9[_0x3c0d('0x31')];if(_0xddedd3[_0x3c0d('0x33')][_0x3c0d('0x4a')]){_0x1b054b['include']=[{'all':!![]}];}_0x1b054b=_['merge']({},_0x1b054b,_0xddedd3[_0x3c0d('0x4b')]);return db[_0x3c0d('0x2d')][_0x3c0d('0x4c')](_0x1b054b)[_0x3c0d('0x26')](handleEntityNotFound(_0x32d140,null))['then'](function(_0x1895d3){if(_0x1895d3){var _0x39b932=_0x1895d3[_0x3c0d('0x4d')]({'plain':!![]});_0x39b932=qs[_0x3c0d('0x4e')](_0x39b932,['id',_0x3c0d('0x4f'),_0x3c0d('0x50'),_0x3c0d('0x51')]);_0xddedd3[_0x3c0d('0x47')]=_['omit'](_0xddedd3[_0x3c0d('0x47')],['id',_0x3c0d('0x4f'),_0x3c0d('0x50')]);return db['sequelize'][_0x3c0d('0x52')](function(_0x38b9d0){return db['UserProfile'][_0x3c0d('0x46')](_[_0x3c0d('0x40')](_0x39b932,_0xddedd3[_0x3c0d('0x47')]),{'include':_0xddedd3['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x38b9d0})[_0x3c0d('0x26')](function(_0x40b043){var _0x4ca187=_0x40b043[_0x3c0d('0x4d')]({'plain':!![]});return db[_0x3c0d('0x53')][_0x3c0d('0x43')]({'where':{'userProfileId':_0xddedd3['params']['id']},'raw':!![]})['then'](function(_0x11a85e){if(_0x11a85e){return BPromise[_0x3c0d('0x54')](_0x11a85e,function(_0x2e961d){return new BPromise(function(_0x997bcb,_0x400ab8){if(_0x2e961d[_0x3c0d('0x55')]===null||_0x2e961d[_0x3c0d('0x55')]===0x1)_0x997bcb(null);return db[_0x3c0d('0x56')][_0x3c0d('0x43')]({'where':{'sectionId':_0x2e961d['id']},'raw':!![]})['then'](function(_0x446e58){var _0x5bb804=_['map'](_0x446e58,function(_0x5b638d){return qs[_0x3c0d('0x4e')](_0x5b638d,['id',_0x3c0d('0x4f'),_0x3c0d('0x50'),'sectionId']);});_0x997bcb(_0x5bb804);})['catch'](function(_0x2a2c7f){_0x400ab8(_0x2a2c7f);});})['then'](function(_0x380c7f){var _0x424749=qs['omit'](_0x2e961d,['id','createdAt',_0x3c0d('0x50')]);_0x424749[_0x3c0d('0x57')]=_0x4ca187['id'];if(_0x380c7f)_0x424749['Resources']=_0x380c7f;return _0x424749;})[_0x3c0d('0x26')](function(_0x13790f){return db['UserProfileSection'][_0x3c0d('0x46')](_0x13790f,{'include':[{'model':db[_0x3c0d('0x56')],'as':_0x3c0d('0x58')}],'raw':!![],'transaction':_0x38b9d0});});})[_0x3c0d('0x26')](function(){return _0x4ca187;});}});});});}})[_0x3c0d('0x26')](respondWithResult(_0x32d140,0xc9))[_0x3c0d('0x48')](handleError(_0x32d140,null));};exports[_0x3c0d('0x59')]=function(_0x3b8fd7,_0xa81fbd){if(_0x3b8fd7[_0x3c0d('0x47')]['id']){delete _0x3b8fd7['body']['id'];}return db[_0x3c0d('0x2d')][_0x3c0d('0x4c')]({'where':{'id':_0x3b8fd7['params']['id']}})[_0x3c0d('0x26')](handleEntityNotFound(_0xa81fbd,null))['then'](saveUpdates(_0x3b8fd7[_0x3c0d('0x47')],null))[_0x3c0d('0x26')](respondWithResult(_0xa81fbd,null))['catch'](handleError(_0xa81fbd,null));};exports[_0x3c0d('0x27')]=function(_0x161d41,_0x44f101){return db[_0x3c0d('0x2d')][_0x3c0d('0x4c')]({'where':{'id':_0x161d41[_0x3c0d('0x45')]['id']}})[_0x3c0d('0x26')](handleEntityNotFound(_0x44f101,null))[_0x3c0d('0x26')](removeEntity(_0x44f101,null))[_0x3c0d('0x48')](handleError(_0x44f101,null));};exports[_0x3c0d('0x5a')]=function(_0x42ade1,_0x51df90){return db['UserProfile'][_0x3c0d('0x5a')]()['then'](respondWithResult(_0x51df90,null))['catch'](handleError(_0x51df90,null));};exports['addSections']=function(_0x4c7f2a,_0x15b0a3){var _0x36c2d6=_0x4c7f2a[_0x3c0d('0x47')];return db[_0x3c0d('0x2d')]['find']({'where':{'id':_0x4c7f2a[_0x3c0d('0x45')]['id']}})[_0x3c0d('0x26')](handleEntityNotFound(_0x15b0a3,null))[_0x3c0d('0x26')](function(_0x2087ef){if(_0x2087ef){return db['sequelize'][_0x3c0d('0x52')](function(_0x11c095){return db[_0x3c0d('0x53')][_0x3c0d('0x27')]({'where':{'userProfileId':_0x4c7f2a[_0x3c0d('0x45')]['id'],'sectionId':_[_0x3c0d('0x2c')](_0x36c2d6,function(_0x2feff1){return _0x2feff1[_0x3c0d('0x5b')];})},'transaction':_0x11c095})['then'](function(){var _0xa150ea=_['map'](_0x36c2d6,function(_0x586feb){_0x586feb[_0x3c0d('0x57')]=_0x4c7f2a['params']['id'];return _0x586feb;});var _0x1753aa=[];return BPromise[_0x3c0d('0x54')](_0xa150ea,function(_0x6311b){return db[_0x3c0d('0x53')][_0x3c0d('0x46')](_0x6311b,{'include':[{'model':db[_0x3c0d('0x56')],'as':'Resources'}],'raw':!![],'transaction':_0x11c095})['then'](function(_0x1d3acf){_0x1753aa['push'](_0x1d3acf['get']({'plain':!![]}));});})[_0x3c0d('0x26')](function(){return _0x1753aa;});});});}})['then'](function(_0x183cf8){return _0x183cf8;})['then'](respondWithResult(_0x15b0a3,null))['catch'](handleError(_0x15b0a3,null));};exports[_0x3c0d('0x5c')]=function(_0x406328,_0x4558c3){var _0x1eddb0;return db[_0x3c0d('0x2d')][_0x3c0d('0x4c')]({'where':{'id':_0x406328['params']['id']},'attributes':['id',_0x3c0d('0x32')]})[_0x3c0d('0x26')](handleEntityNotFound(_0x4558c3,null))[_0x3c0d('0x26')](function(_0x503824){if(_0x503824){_0x1eddb0=_0x503824;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x406328[_0x3c0d('0x45')]['id'],'sectionId':_0x406328[_0x3c0d('0x33')][_0x3c0d('0x5d')]}});}})[_0x3c0d('0x26')](function(){return _0x1eddb0;})['then'](respondWithStatusCode(_0x4558c3,null))['catch'](handleError(_0x4558c3,null));};exports[_0x3c0d('0x5e')]=function(_0x55c2be,_0x54784d){var _0x55d7e9=[];var _0x2930ec=[];return db[_0x3c0d('0x53')]['findAll']({'where':{'userProfileId':_0x55c2be['params']['id']},'raw':!![]})['then'](function(_0x40e8af){_0x55d7e9=_['filter'](_0x40e8af,function(_0x1d8e5f){return _0x1d8e5f[_0x3c0d('0x5f')]===0x1||_[_0x3c0d('0x60')]([0x3eb,0x709],_0x1d8e5f['sectionId']);});if(!_[_0x3c0d('0x61')](_0x55d7e9)){return _[_0x3c0d('0x2c')](_0x55d7e9,function(_0xc35f5f){return _0xc35f5f['sectionId'];});}else{return;}})[_0x3c0d('0x26')](function(_0x3d931f){if(_0x3d931f)_0x2930ec=_0x3d931f;if(_[_0x3c0d('0x60')](_0x2930ec,0x64)){var _0x514d94=_[_0x3c0d('0x4c')](_0x55d7e9,{'sectionId':0x64});return hasDefaultDashboard(_0x514d94)[_0x3c0d('0x26')](function(_0x4b6085){return _[_0x3c0d('0x2c')](_0x55d7e9,function(_0x44a45f){if(_0x44a45f[_0x3c0d('0x5b')]===0x64){_0x44a45f[_0x3c0d('0x62')]=_0x4b6085;}return _0x44a45f;});});}else{return;}})[_0x3c0d('0x26')](function(_0x2c5192){if(_0x2c5192)_0x55d7e9=_0x2c5192;if(_['includes'](_0x2930ec,0x3eb)){var _0x117481=_[_0x3c0d('0x4c')](_0x55d7e9,{'sectionId':0x3eb});return getCustomDashboards(_0x117481)[_0x3c0d('0x26')](function(_0x4200c8){return _[_0x3c0d('0x2c')](_0x55d7e9,function(_0x3ede0c){if(_0x117481['enabled']){if(_0x3ede0c[_0x3c0d('0x5b')]===0x3eb){_0x3ede0c[_0x3c0d('0x62')]=_0x4200c8;}}else{if(_0x3ede0c[_0x3c0d('0x5b')]===0x64){if(!_0x3ede0c[_0x3c0d('0x62')]){_0x3ede0c['subsections']=[];}_0x3ede0c[_0x3c0d('0x62')]=_0x3ede0c['subsections'][_0x3c0d('0x63')](_0x4200c8);}}return _0x3ede0c;});});}else{return;}})[_0x3c0d('0x26')](function(_0x358ef3){if(_0x358ef3)_0x55d7e9=_0x358ef3;if(_[_0x3c0d('0x60')](_0x2930ec,0x709)){var _0x382cf6=_[_0x3c0d('0x4c')](_0x55d7e9,{'sectionId':0x709});return getPlugins(_0x382cf6)['then'](function(_0x190fc2){if(_0x382cf6[_0x3c0d('0x5f')]){return _[_0x3c0d('0x2c')](_0x55d7e9,function(_0x3b5875){if(_0x3b5875['sectionId']===0x709){_0x3b5875[_0x3c0d('0x62')]=_0x190fc2;}return _0x3b5875;});}else{var _0x4175bb={'sectionId':0x76c,'enabled':0x1,'subsections':_0x190fc2};var _0x16f526=_[_0x3c0d('0x2c')](_0x55d7e9);_0x16f526[_0x3c0d('0x64')](_0x4175bb);return _0x16f526;}});}else{return;}})[_0x3c0d('0x26')](function(_0x2c054e){if(_0x2c054e)_0x55d7e9=_0x2c054e;return _[_0x3c0d('0x3e')](_0x55d7e9,[_0x3c0d('0x5f'),0x1]);})[_0x3c0d('0x26')](respondWithResult(_0x54784d,null))[_0x3c0d('0x48')](handleError(_0x54784d,null));};function hasDefaultDashboard(_0x2cf935){var _0x40158b=[0x65];return new BPromise(function(_0x544ec8,_0x22340d){try{if(_0x2cf935[_0x3c0d('0x55')]){_0x544ec8(_0x40158b);}else{return db['UserProfileResource'][_0x3c0d('0x65')]({'where':{'sectionId':_0x2cf935['id']},'raw':!![]})[_0x3c0d('0x26')](function(_0x247dfe){_0x247dfe?_0x544ec8(_0x40158b):_0x544ec8();});}}catch(_0x162e8e){_0x22340d(_0x162e8e);}});}function getCustomDashboards(_0x45f994){var _0x5426a3=[];return new BPromise(function(_0x388e02,_0x52e954){try{if(_0x45f994['autoAssociation']){return db[_0x3c0d('0x66')][_0x3c0d('0x43')]({'raw':!![]})[_0x3c0d('0x26')](function(_0x9576){_0x9576[_0x3c0d('0x67')](function(_0x3697b2){_0x5426a3[_0x3c0d('0x64')](_0x3697b2['id']+0x1869f);});_0x388e02(_0x5426a3);});}else{return db[_0x3c0d('0x56')]['findAll']({'where':{'sectionId':_0x45f994['id']},'raw':!![]})[_0x3c0d('0x26')](function(_0x582fa6){_0x582fa6['forEach'](function(_0x1038c5){_0x5426a3[_0x3c0d('0x64')](_0x1038c5[_0x3c0d('0x68')]+0x1869f);});_0x388e02(_0x5426a3);});}}catch(_0x2349ba){_0x52e954(_0x2349ba);}});}function getPlugins(_0x3b9493){var _0x17c354=[];return new BPromise(function(_0x53592e,_0x57ead2){try{if(_0x3b9493[_0x3c0d('0x55')]){return db[_0x3c0d('0x69')][_0x3c0d('0x43')]({'raw':!![]})['then'](function(_0x48a930){_0x48a930[_0x3c0d('0x67')](function(_0x5765fc){_0x17c354[_0x3c0d('0x64')](_0x5765fc['id']+0x15b38);});_0x53592e(_0x17c354);});}else{return db[_0x3c0d('0x56')][_0x3c0d('0x43')]({'where':{'sectionId':_0x3b9493['id']},'raw':!![]})[_0x3c0d('0x26')](function(_0x3d09e5){_0x3d09e5[_0x3c0d('0x67')](function(_0x13b712){_0x17c354[_0x3c0d('0x64')](_0x13b712[_0x3c0d('0x68')]+0x15b38);});_0x53592e(_0x17c354);});}}catch(_0x353968){_0x57ead2(_0x353968);}});}exports['addResources']=function(_0x564916,_0x3233f9){return db['UserProfile'][_0x3c0d('0x4c')]({'where':{'id':_0x564916['params']['id']}})['then'](handleEntityNotFound(_0x3233f9,null))[_0x3c0d('0x26')](function(_0x4c1003){if(_0x4c1003){return db[_0x3c0d('0x6a')][_0x3c0d('0x52')](function(_0x3fc2d0){return db[_0x3c0d('0x53')][_0x3c0d('0x43')]({'where':{'userProfileId':_0x564916[_0x3c0d('0x45')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x350561){if(_0x350561){return db[_0x3c0d('0x53')][_0x3c0d('0x27')]({'where':{'userProfileId':_0x564916[_0x3c0d('0x45')]['id'],'id':_[_0x3c0d('0x2c')](_0x350561,function(_0x277b5e){return _0x277b5e['id'];})},'transaction':_0x3fc2d0});}})[_0x3c0d('0x26')](function(_0x14a1ec){var _0x3e6722=_['map'](_0x564916['body'],function(_0x1d2f47){_0x1d2f47[_0x3c0d('0x57')]=_0x564916['params']['id'];return _0x1d2f47;});return db[_0x3c0d('0x53')][_0x3c0d('0x6b')](_0x3e6722,{'raw':!![],'transaction':_0x3fc2d0});})[_0x3c0d('0x26')](function(_0x1df7c3){var _0x186cd0=_[_0x3c0d('0x3e')](_[_0x3c0d('0x2c')](_0x1df7c3,function(_0x1aa920){return _0x1aa920[_0x3c0d('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0x186cd0){return db[_0x3c0d('0x53')]['findAll']({'where':{'userProfileId':_0x564916[_0x3c0d('0x45')]['id'],'sectionId':_['map'](_0x186cd0,function(_0x1dd81d){return _0x1dd81d['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0x3c0d('0x26')](function(_0x3ce398){var _0x2bc953=_[_0x3c0d('0x2c')](_0x564916[_0x3c0d('0x47')],function(_0x2230ce){_0x2230ce[_0x3c0d('0x57')]=_0x564916['params']['id'];return _0x2230ce;});return db['UserProfileResource'][_0x3c0d('0x6b')](_0x2bc953,{'raw':!![],'transaction':_0x3fc2d0});});}})['catch'](handleError(_0x3233f9,null));});}})[_0x3c0d('0x26')](function(_0x2596d6){var _0x11da6c=_['map'](_0x2596d6,function(_0x145cab){return _0x145cab['get']({'plain':!![]});});})[_0x3c0d('0x26')](respondWithResult(_0x3233f9,null))[_0x3c0d('0x48')](handleError(_0x3233f9,null));};exports[_0x3c0d('0x6c')]=function(_0x1dfa8a,_0x430268,_0x12f254){return db[_0x3c0d('0x2d')]['find']({'where':{'id':_0x1dfa8a['params']['id']}})[_0x3c0d('0x26')](handleEntityNotFound(_0x430268,null))[_0x3c0d('0x26')](function(_0x15a79a){if(_0x15a79a){return _0x15a79a['removeResources'](_0x1dfa8a['query'][_0x3c0d('0x5d')]);}})['then'](respondWithStatusCode(_0x430268,null))[_0x3c0d('0x48')](handleError(_0x430268,null));};exports[_0x3c0d('0x6d')]=function(_0xdbdd72,_0xeab5e4){var _0x544c11={};if(!_0xdbdd72[_0x3c0d('0x33')][_0x3c0d('0x6e')])throw new Error('Missing\x20section\x20parameter');if(!_0xdbdd72[_0x3c0d('0x33')][_0x3c0d('0x6f')](_0x3c0d('0x3a'))){_0x544c11[_0x3c0d('0x22')]=qs['limit'](_0xdbdd72[_0x3c0d('0x33')][_0x3c0d('0x22')]);_0x544c11[_0x3c0d('0x20')]=qs['offset'](_0xdbdd72[_0x3c0d('0x33')][_0x3c0d('0x20')]);}return db[_0x3c0d('0x2d')]['find']({'where':{'id':_0xdbdd72['params']['id']}})[_0x3c0d('0x26')](function(_0x57e5ee){if(!_0x57e5ee)throw new Error(_0x3c0d('0x70')+_0xdbdd72[_0x3c0d('0x45')]['id']);return db[_0x3c0d('0x2d')][_0x3c0d('0x6d')](_0xdbdd72);})[_0x3c0d('0x26')](respondWithFilteredResult(_0xeab5e4,_0x544c11))['catch'](handleError(_0xeab5e4,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 7a19a64..bc1d303 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 _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 +var _0x13c5=['emit','hasOwnProperty','events'];(function(_0x5ac821,_0x5d6bd3){var _0x1937df=function(_0x120d38){while(--_0x120d38){_0x5ac821['push'](_0x5ac821['shift']());}};_0x1937df(++_0x5d6bd3);}(_0x13c5,0x7a));var _0x513c=function(_0x261ac9,_0x42f3b6){_0x261ac9=_0x261ac9-0x0;var _0x130eb6=_0x13c5[_0x261ac9];return _0x130eb6;};'use strict';var EventEmitter=require(_0x513c('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x432ab7){return function(_0x516e1a,_0x4d46c0,_0x477e2c){UserProfileEvents[_0x513c('0x1')](_0x432ab7+':'+_0x516e1a['id'],_0x516e1a);UserProfileEvents[_0x513c('0x1')](_0x432ab7,_0x516e1a);_0x477e2c(null);};}for(var e in events){if(events[_0x513c('0x2')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 8ca2a54..11bbf37 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 _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 +var _0x3169=['filter','field','value','findAll','then','associatedResources','map','catch','model','resolve','UserProfileResource','toLowerCase','squareprojects','childModel','odbc','SquareOdbc','SquareProjects','name','projectName','contacts','parentSections','Lists','ListId','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','User','role','agent','Telephones','VoiceQueues','queue','inbound','QueueCampaigns','VoiceQueue','type','musiconholds','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','voicequeues','queuecampaigns','agents','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','scheduler','Schedule','sounds','Sound','tags','Tag','templates','triggers','Trigger','trunks','Variable','Plugin','AnalyticExtractedReport','Reports','reportId','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','user_has_','where','sequelize','toString','OpenTabs','define','UserProfile','user_profiles','raw','query','section','mergeResources','isEmpty','length','find','params','all','ignore','union','push','autoAssociation','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','key','foreignKey','forEach','merge','options','includeAll','include','default','DefaultReports','custom','rows','ids','customSorting','extraQueryConditions','count','tag','ThroughTags','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','../../components/parsers/qs','squel','exports'];(function(_0xbec5ca,_0x5b8778){var _0x4d8b96=function(_0x34412f){while(--_0x34412f){_0xbec5ca['push'](_0xbec5ca['shift']());}};_0x4d8b96(++_0x5b8778);}(_0x3169,0x165));var _0x9316=function(_0x10dbf6,_0x3ff964){_0x10dbf6=_0x10dbf6-0x0;var _0x452147=_0x3169[_0x10dbf6];return _0x452147;};'use strict';var _=require('lodash');var attributes=require('./userProfile.attributes');var qs=require(_0x9316('0x0'));var squel=require(_0x9316('0x1'));module[_0x9316('0x2')]=function(_0x2c7521){var _0x3d32a3=_0x2c7521['models'];function _0x352671(_0x2fb109,_0x1f89e4){return new Promise(function(_0x302d08,_0xf7b868){if(!_0x1f89e4)return _0x302d08(null);var _0x5213a1=_0x1f89e4[_0x9316('0x3')]?{[_0x1f89e4[_0x9316('0x3')][_0x9316('0x4')]]:_0x1f89e4['filter'][_0x9316('0x5')]}:undefined;return _0x3d32a3[_0x2fb109][_0x9316('0x6')]({'where':_0x5213a1,'raw':!![]})[_0x9316('0x7')](function(_0x25c60e){_0x1f89e4[_0x9316('0x8')]=_[_0x9316('0x9')](_0x25c60e,'id');_0x302d08(_0x1f89e4);})[_0x9316('0xa')](function(_0x396529){_0xf7b868(_0x396529);});});}function _0xee4b1f(_0x3f715d,_0xfda701){return new Promise(function(_0x11b374,_0x1a76b5){var _0x5335b6=_0x3f715d[_0x9316('0x3')]?{[_0x3f715d['filter'][_0x9316('0x4')]]:_0x3f715d[_0x9316('0x3')][_0x9316('0x5')]}:undefined;return _0x3d32a3[_0x3f715d[_0x9316('0xb')]][_0x9316('0x6')]({'where':_0x5335b6,'raw':!![]})[_0x9316('0x7')](function(_0x5b8ff2){_0xfda701['associatedResources']=_['map'](_0x5b8ff2,function(_0x210b28){return _0x210b28['name'];});_0x11b374(_0xfda701);})['catch'](function(_0x230320){_0x1a76b5(_0x230320);});});}function _0x1229c6(_0x13b10f,_0x49fb37,_0x17686b){if(!_0x49fb37)return Promise[_0x9316('0xc')](null);return new Promise(function(_0x320652,_0x49c000){return _0x3d32a3[_0x9316('0xd')]['findAll']({'where':{'sectionId':_0x49fb37['id']},'raw':!![]})[_0x9316('0x7')](function(_0x22c17d){if(_0x13b10f['field']&&_0x13b10f[_0x9316('0x4')]!=='id'){_0x49fb37[_0x9316('0x8')]=_['map'](_0x22c17d,function(_0x4777b3){return _0x4777b3[_0x13b10f['field']];});}else{if(_0x17686b==='AnalyticExtractedReport'){_0x49fb37[_0x9316('0x8')]=_[_0x9316('0x9')](_0x22c17d,function(_0x4a9249){return{'id':_0x4a9249['resourceId'],'type':_0x4a9249['type']};});}else{_0x49fb37[_0x9316('0x8')]=_[_0x9316('0x9')](_0x22c17d,function(_0x495621){return _0x495621['resourceId'];});}}_0x320652(_0x49fb37);})[_0x9316('0xa')](function(_0x132f7d){_0x49c000(_0x132f7d);});});}function _0x41c75b(_0x44a7e9,_0x2c29b5){var _0x13caf6={'parentSections':[]};switch(_0x44a7e9[_0x9316('0xe')]()){case _0x9316('0xf'):_0x13caf6[_0x9316('0x10')]='SquareProject';break;case _0x9316('0x11'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x12');break;case'squarerecordings':_0x13caf6[_0x9316('0x10')]='SquareRecording';_0x13caf6['parentSections']=[{'name':_0x9316('0x13'),'field':_0x9316('0x14'),'foreignKey':_0x9316('0x15')}];break;case'projects':_0x13caf6[_0x9316('0x10')]='JscriptyProject';break;case _0x9316('0x16'):_0x13caf6['childModel']='CmContact';_0x13caf6[_0x9316('0x17')]=[{'name':_0x9316('0x18'),'field':'id','foreignKey':_0x9316('0x19')}];break;case'lists':_0x13caf6[_0x9316('0x10')]='CmList';break;case _0x9316('0x1a'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x1b');break;case _0x9316('0x1c'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x1d');break;case _0x9316('0x1e'):_0x13caf6[_0x9316('0x10')]='ChatQueue';break;case _0x9316('0x1f'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x20');break;case _0x9316('0x21'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x22');break;case'faxaccounts':_0x13caf6[_0x9316('0x10')]='FaxAccount';break;case _0x9316('0x23'):case _0x9316('0x24'):case _0x9316('0x25'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x26');break;case _0x9316('0x27'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x28');break;case _0x9316('0x29'):_0x13caf6[_0x9316('0x10')]='VoiceMail';break;case _0x9316('0x2a'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x2b');_0x13caf6[_0x9316('0x17')]=[{'name':_0x9316('0x2c'),'field':_0x9316('0x14'),'foreignKey':'membername','model':_0x9316('0x2d'),'filter':{'field':_0x9316('0x2e'),'value':[_0x9316('0x2f')]}},{'name':_0x9316('0x30'),'field':_0x9316('0x14'),'foreignKey':'membername','model':_0x9316('0x2d'),'filter':{'field':'role','value':['telephone']}},{'name':_0x9316('0x31'),'field':_0x9316('0x14'),'foreignKey':_0x9316('0x32'),'model':'VoiceQueue','filter':{'field':'type','value':[_0x9316('0x33')]}},{'name':_0x9316('0x34'),'field':'name','foreignKey':_0x9316('0x32'),'model':_0x9316('0x35'),'filter':{'field':_0x9316('0x36'),'value':['outbound']}}];break;case _0x9316('0x37'):_0x13caf6[_0x9316('0x10')]='VoiceMusicOnHold';break;case'chanspies':_0x13caf6[_0x9316('0x10')]='VoiceChanSpy';break;case _0x9316('0x38'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x39');break;case _0x9316('0x3a'):_0x13caf6['childModel']=_0x9316('0x3b');break;case _0x9316('0x3c'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x3d');break;case'mailaccounts':_0x13caf6[_0x9316('0x10')]=_0x9316('0x3e');break;case _0x9316('0x3f'):_0x13caf6['childModel']=_0x9316('0x40');break;case _0x9316('0x41'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x42');break;case'openchannelaccounts':_0x13caf6[_0x9316('0x10')]=_0x9316('0x43');break;case _0x9316('0x44'):_0x13caf6['childModel']=_0x9316('0x45');break;case _0x9316('0x46'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x47');break;case _0x9316('0x48'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x49');break;case'whatsappaccounts':_0x13caf6[_0x9316('0x10')]=_0x9316('0x4a');break;case'teams':_0x13caf6[_0x9316('0x10')]='Team';break;case _0x9316('0x4b'):case _0x9316('0x4c'):_0x13caf6[_0x9316('0x10')]='VoiceQueue';if(_0x2c29b5){_0x13caf6[_0x9316('0x17')]=[{'name':_0x9316('0x31')},{'name':'QueueCampaigns'}];}break;case'users':case _0x9316('0x4d'):case'telephones':_0x13caf6[_0x9316('0x10')]=_0x9316('0x2d');if(_0x2c29b5){_0x13caf6[_0x9316('0x17')]=[{'name':_0x9316('0x4e'),'filter':{'field':_0x9316('0x2e'),'value':[_0x9316('0x4f'),_0x9316('0x50')]},'ignore':!![]},{'name':_0x9316('0x2c')},{'name':_0x9316('0x30')}];}break;case _0x9316('0x51'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x52');break;case _0x9316('0x53'):_0x13caf6[_0x9316('0x10')]='SalesforceAccount';break;case'freshdeskaccounts':_0x13caf6[_0x9316('0x10')]=_0x9316('0x54');break;case _0x9316('0x55'):_0x13caf6[_0x9316('0x10')]='SugarcrmAccount';break;case _0x9316('0x56'):_0x13caf6['childModel']='DeskAccount';break;case _0x9316('0x57'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x58');break;case _0x9316('0x59'):_0x13caf6['childModel']='User';break;case'cannedanswers':_0x13caf6[_0x9316('0x10')]='CannedAnswer';break;case'dispositions':_0x13caf6['childModel']=_0x9316('0x5a');break;case _0x9316('0x5b'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x5c');break;case _0x9316('0x5d'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x5e');break;case _0x9316('0x5f'):_0x13caf6[_0x9316('0x10')]='Pause';break;case _0x9316('0x60'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x61');break;case _0x9316('0x62'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x63');break;case _0x9316('0x64'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x65');break;case _0x9316('0x66'):_0x13caf6['childModel']='Template';break;case _0x9316('0x67'):_0x13caf6[_0x9316('0x10')]=_0x9316('0x68');break;case _0x9316('0x69'):_0x13caf6['childModel']='Trunk';break;case'variables':_0x13caf6[_0x9316('0x10')]=_0x9316('0x6a');break;case'plugins':_0x13caf6[_0x9316('0x10')]=_0x9316('0x6b');break;case'extractedreports':_0x13caf6[_0x9316('0x10')]=_0x9316('0x6c');_0x13caf6[_0x9316('0x17')]=[{'name':_0x9316('0x6d'),'field':'id','foreignKey':_0x9316('0x6e')}];break;case'metrics':_0x13caf6[_0x9316('0x10')]=_0x9316('0x6f');break;}return _0x13caf6;}function _0x158ecb(_0x55b9d3,_0x20a3e0){var _0x2b4ceb=_0x55b9d3[_0x9316('0x70')](0x0)[_0x9316('0x71')]()+_0x55b9d3[_0x9316('0x72')](0x1);var _0x3da757={'type':_0x3d32a3[_0x9316('0x73')][_0x9316('0x74')][_0x9316('0x75')],'raw':!![]};return new Promise(function(_0x53a1e4,_0x503567){var _0x3eb046=squel['select']()[_0x9316('0x4')](_0x9316('0x76')+_0x2b4ceb+_0x9316('0x77'),'id')[_0x9316('0x4')](_0x9316('0x78'))['from'](_0x9316('0x79')+_0x55b9d3+'_interactions','ui')[_0x9316('0x7a')]('ui.UserId\x20=\x20?',_0x20a3e0['id']);return _0x3d32a3[_0x9316('0x7b')]['query'](_0x3eb046[_0x9316('0x7c')](),_0x3da757)[_0x9316('0x7')](function(_0x45c991){_0x20a3e0[_0x2b4ceb+_0x9316('0x7d')]=_0x45c991;_0x53a1e4(_0x45c991);})[_0x9316('0xa')](function(_0x521280){_0x503567(_0x521280);});});}return _0x2c7521[_0x9316('0x7e')](_0x9316('0x7f'),attributes,{'tableName':_0x9316('0x80'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x24121d){var _0x5e748e={'raw':_0x24121d['query'][_0x9316('0x81')],'where':{}};var _0x1b6f7a={};var _0x53c091={'count':0x0,'rows':[]};var _0x385b02=_0x24121d[_0x9316('0x82')][_0x9316('0x83')];var _0xe57b52=_0x24121d[_0x9316('0x82')][_0x9316('0x84')]||![];var _0x2491f5=_0x41c75b(_0x385b02,_0xe57b52);if(!_0x2491f5[_0x9316('0x10')])throw new Error('Invalid\x20section\x20\x27'+_0x385b02+'\x27');var _0x1174b7=[{'name':_0x385b02}];if(!_[_0x9316('0x85')](_0x2491f5['parentSections']))_0x1174b7=_0x2491f5[_0x9316('0x17')];var _0x46ccfb=[];for(var _0x308447=0x0;_0x308447<_0x1174b7[_0x9316('0x86')];_0x308447++){_0x46ccfb['push'](_0x3d32a3['UserProfileSection'][_0x9316('0x87')]({'where':{'userProfileId':_0x24121d[_0x9316('0x88')]['id'],'name':_0x1174b7[_0x308447][_0x9316('0x14')]},'raw':!![]}));}return Promise[_0x9316('0x89')](_0x46ccfb)[_0x9316('0x7')](function(_0x9af72d){var _0x296a9c=_[_0x9316('0x3')](_0x9af72d,function(_0x9e8402){return _0x9e8402?_0x9e8402:undefined;});var _0xd3df8=_[_0x9316('0x3')](_0x1174b7,[_0x9316('0x8a'),!![]]);var _0x3fb5c5=_['isEmpty'](_0x296a9c)&&_['isEmpty'](_0xd3df8)?null:_[_0x9316('0x8b')](_0xd3df8,_0x296a9c);if(!_0x3fb5c5)return null;var _0x38f343=[];for(var _0x440474=0x0;_0x440474<_0x3fb5c5['length'];_0x440474++){var _0x4470fe=_['find'](_0x1174b7,function(_0x5c4b2c){return _0x3fb5c5[_0x440474]?_0x5c4b2c[_0x9316('0x14')]===_0x3fb5c5[_0x440474][_0x9316('0x14')]:null;});if(_0x4470fe){if(_0x3fb5c5[_0x440474][_0x9316('0x8a')]){_0x38f343[_0x9316('0x8c')](_0x352671(_0x2491f5[_0x9316('0x10')],_0x3fb5c5[_0x440474]));}else{if(!_0x3fb5c5[_0x440474][_0x9316('0x8d')]){_0x38f343[_0x9316('0x8c')](_0x1229c6(_0x4470fe,_0x3fb5c5[_0x440474],_0x2491f5[_0x9316('0x10')]));}else{if(_0x4470fe[_0x9316('0xb')]){_0x38f343[_0x9316('0x8c')](_0xee4b1f(_0x4470fe,_0x3fb5c5[_0x440474]));}}}}}return Promise[_0x9316('0x89')](_0x38f343);})['then'](function(_0x3acc91){var _0x13fa03=_0x3acc91;var _0x5086ac=null;if(_0x13fa03){_0x5086ac=_0x13fa03['length']===0x1?_0x13fa03[0x0]:null;}if(!_0x5086ac&&!_0x13fa03)return _0x53c091;var _0x5e2f34=_0x3d32a3[_0x2491f5[_0x9316('0x10')]][_0x9316('0x8e')];_0x1b6f7a[_0x9316('0xb')]=_[_0x9316('0x8f')](_0x5e2f34);_0x1b6f7a[_0x9316('0x82')]=_[_0x9316('0x8f')](_0x24121d[_0x9316('0x82')]);_0x1b6f7a[_0x9316('0x90')]=_[_0x9316('0x91')](_0x1b6f7a[_0x9316('0xb')],_0x1b6f7a[_0x9316('0x82')]);_0x5e748e['attributes']=_['intersection'](_0x1b6f7a[_0x9316('0xb')],qs[_0x9316('0x92')](_0x24121d['query'][_0x9316('0x92')]));_0x5e748e[_0x9316('0x93')]=_0x5e748e['attributes'][_0x9316('0x86')]?_0x5e748e[_0x9316('0x93')]:_0x1b6f7a['model'];if(!_0x24121d[_0x9316('0x82')][_0x9316('0x94')](_0x9316('0x95'))){_0x5e748e['limit']=qs['limit'](_0x24121d[_0x9316('0x82')][_0x9316('0x96')]);_0x5e748e['offset']=qs[_0x9316('0x97')](_0x24121d['query'][_0x9316('0x97')]);}_0x5e748e[_0x9316('0x98')]=qs[_0x9316('0x99')](_0x24121d['query'][_0x9316('0x99')]);_0x5e748e[_0x9316('0x7a')]=qs[_0x9316('0x90')](_[_0x9316('0x9a')](_0x24121d['query'],_0x1b6f7a[_0x9316('0x90')]));if(_0x24121d[_0x9316('0x82')]['filter']){_0x5e748e[_0x9316('0x7a')]=_['merge'](_0x5e748e[_0x9316('0x7a')],{'$or':_[_0x9316('0x9')](_0x5e2f34,function(_0xfad572){if(_0xfad572[_0x9316('0x36')][_0x9316('0x9b')]!=='VIRTUAL'){var _0x197bd5={};_0x197bd5[_0xfad572[_0x9316('0x4')]]={'$like':'%'+_0x24121d[_0x9316('0x82')]['filter']+'%'};return _0x197bd5;}})});}var _0x5a4528=[];var _0x28a96c=null;var _0x2c17fd={};if(_0x5086ac){_0x28a96c=_[_0x9316('0x87')](_0x1174b7,['name',_0x5086ac[_0x9316('0x14')]]);if(_0x28a96c[_0x9316('0x4')]){_0x2c17fd={};if(_0x2491f5[_0x9316('0x10')]==='AnalyticExtractedReport'){_0x2c17fd[_0x28a96c[_0x9316('0x9c')]]=_['map'](_0x5086ac[_0x9316('0x8')],'id');}else{_0x2c17fd[_0x28a96c[_0x9316('0x9c')]]=_0x5086ac[_0x9316('0x8')];}_0x5a4528[_0x9316('0x8c')](_0x2c17fd);}else{_0x5e748e['where']['id']=_0x5086ac[_0x9316('0x8')];}}else{for(var _0x757df5=0x0;_0x757df5<_0x13fa03['length'];_0x757df5++){_0x28a96c=_[_0x9316('0x87')](_0x1174b7,[_0x9316('0x14'),_0x13fa03[_0x757df5][_0x9316('0x14')]]);if(_0x28a96c[_0x9316('0x4')]){_0x2c17fd={};_0x2c17fd[_0x28a96c[_0x9316('0x9c')]]=_0x13fa03[_0x757df5][_0x9316('0x8')];_0x5a4528[_0x9316('0x8c')](_0x2c17fd);}else{if(!_0x5e748e[_0x9316('0x7a')]['id'])_0x5e748e[_0x9316('0x7a')]['id']=[];_0x13fa03[_0x757df5][_0x9316('0x8')][_0x9316('0x9d')](function(_0x5e784e){_0x5e748e[_0x9316('0x7a')]['id']['push'](_0x5e784e);});}}}if(!_['isEmpty'](_0x5a4528)){_0x5e748e[_0x9316('0x7a')]=_[_0x9316('0x9e')](_0x5e748e[_0x9316('0x7a')],{'$and':{'$or':_0x5a4528}});}_0x5e748e=_[_0x9316('0x9e')]({},_0x5e748e,_0x24121d[_0x9316('0x9f')]);if(_0x5086ac&&!_0x5086ac[_0x9316('0x8d')]&&_0x2491f5[_0x9316('0x10')]===_0x9316('0x6c')){if(_0x24121d['query'][_0x9316('0xa0')]){_0x5e748e[_0x9316('0xa1')]=[{'all':!![]}];}return _0x3d32a3[_0x2491f5[_0x9316('0x10')]][_0x9316('0x6')](_0x5e748e)['then'](function(_0x4ccfb0){var _0x55c3d9=[];_0x4ccfb0[_0x9316('0x9d')](function(_0x206800){var _0x38ac59;switch(_0x206800['reportType']){case _0x9316('0xa2'):_0x38ac59=_[_0x9316('0x87')](_0x5086ac[_0x9316('0x8')],function(_0x35c789){return _0x35c789['id']===_0x206800['reportId']&&_0x35c789[_0x9316('0x36')]===_0x9316('0xa3');});break;case _0x9316('0xa4'):_0x38ac59=_[_0x9316('0x87')](_0x5086ac[_0x9316('0x8')],function(_0x2ba136){return _0x2ba136['id']===_0x206800[_0x9316('0x6e')]&&_0x2ba136[_0x9316('0x36')]==='CustomReports';});break;}if(_0x38ac59)_0x55c3d9[_0x9316('0x8c')](_0x206800);});_0x53c091['count']=_0x55c3d9[_0x9316('0x86')];_0x53c091[_0x9316('0xa5')]=_0x55c3d9;return _0x53c091;});}else{if(!_[_0x9316('0x85')](_0x24121d[_0x9316('0x82')][_0x9316('0xa6')])){_0x5e748e[_0x9316('0x7a')]['id']=_0x5e748e[_0x9316('0x7a')]['id']?_[_0x9316('0x91')](_0x5e748e['where']['id'],_0x24121d['query'][_0x9316('0xa6')]):_0x24121d[_0x9316('0x82')][_0x9316('0xa6')];if(_0x24121d[_0x9316('0x82')][_0x9316('0xa7')]){_0x5e748e['order']=_0x24121d['query'][_0x9316('0xa7')];}}if(_0x24121d['query'][_0x9316('0xa8')]){_0x5e748e[_0x9316('0x7a')]=_[_0x9316('0x9e')](_0x5e748e[_0x9316('0x7a')],{'$and':_0x24121d[_0x9316('0x82')][_0x9316('0xa8')]});}return _0x3d32a3[_0x2491f5[_0x9316('0x10')]][_0x9316('0xa9')]({'where':_0x5e748e[_0x9316('0x7a')]})['then'](function(_0x2ae000){_0x53c091[_0x9316('0xa9')]=_0x2ae000;if(_0x24121d[_0x9316('0x82')][_0x9316('0xa0')]){if(_0x2491f5[_0x9316('0x10')]==='CmContact'){_0x5e748e[_0x9316('0xa1')]=[{'model':_0x3d32a3[_0x9316('0x65')],'as':'Tags','attributes':['id',_0x9316('0x14'),'color'],'required':_0x24121d['query'][_0x9316('0xaa')]?!![]:![]},{'model':_0x3d32a3[_0x9316('0x65')],'as':_0x9316('0xab'),'attributes':['id',_0x9316('0x14'),'color'],'through':_0x24121d[_0x9316('0x82')][_0x9316('0xaa')]?{'attributes':[],'where':{'TagId':_0x24121d[_0x9316('0x82')][_0x9316('0xaa')]||undefined}}:{},'required':_0x24121d[_0x9316('0x82')][_0x9316('0xaa')]?!![]:![]}];}else{_0x5e748e[_0x9316('0xa1')]=[{'all':!![]}];}}return _0x3d32a3[_0x2491f5[_0x9316('0x10')]]['findAll'](_0x5e748e);})[_0x9316('0x7')](function(_0x325fd0){_0x53c091['rows']=_0x325fd0;if(_0x385b02===_0x9316('0x2c')&&_0x24121d[_0x9316('0x82')]['openTabs']===_0x9316('0xac')){var _0x39c0c9=[];for(var _0x5d37e8=0x0;_0x5d37e8<_0x53c091[_0x9316('0xa5')][_0x9316('0x86')];_0x5d37e8++){_0x39c0c9[_0x9316('0x8c')](_0x158ecb(_0x9316('0xad'),_0x53c091[_0x9316('0xa5')][_0x5d37e8][_0x9316('0xae')]));_0x39c0c9['push'](_0x158ecb(_0x9316('0xaf'),_0x53c091[_0x9316('0xa5')][_0x5d37e8][_0x9316('0xae')]));_0x39c0c9[_0x9316('0x8c')](_0x158ecb(_0x9316('0xb0'),_0x53c091['rows'][_0x5d37e8][_0x9316('0xae')]));_0x39c0c9[_0x9316('0x8c')](_0x158ecb(_0x9316('0xb1'),_0x53c091['rows'][_0x5d37e8]['dataValues']));_0x39c0c9[_0x9316('0x8c')](_0x158ecb(_0x9316('0xb2'),_0x53c091[_0x9316('0xa5')][_0x5d37e8][_0x9316('0xae')]));_0x39c0c9[_0x9316('0x8c')](_0x158ecb(_0x9316('0xb3'),_0x53c091['rows'][_0x5d37e8][_0x9316('0xae')]));}return Promise[_0x9316('0x89')](_0x39c0c9)[_0x9316('0x7')](function(){return _0x53c091;});}return _0x53c091;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 75388d9..3931b39 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 _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 +var _0x806d=['client','http','redis','defaults','localhost','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x2dee29,_0x4014f4){var _0xe49090=function(_0x4f932c){while(--_0x4f932c){_0x2dee29['push'](_0x2dee29['shift']());}};_0xe49090(++_0x4014f4);}(_0x806d,0x131));var _0xd806=function(_0x38c494,_0x4cf0f5){_0x38c494=_0x38c494-0x0;var _0x1ab68f=_0x806d[_0x38c494];return _0x1ab68f;};'use strict';var _=require(_0xd806('0x0'));var util=require(_0xd806('0x1'));var moment=require(_0xd806('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd806('0x3'))['db'];var utils=require(_0xd806('0x4'));var logger=require('../../config/logger')(_0xd806('0x5'));var config=require('../../config/environment');var jayson=require(_0xd806('0x6'));var client=jayson[_0xd806('0x7')][_0xd806('0x8')]({'port':0x232a});config[_0xd806('0x9')]=_[_0xd806('0xa')](config[_0xd806('0x9')],{'host':_0xd806('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd806('0x9')]));require(_0xd806('0xc'))[_0xd806('0xd')](socket);function respondWithRpcPromise(_0xf68dd6,_0x55fb02,_0x1b15ca){return new BPromise(function(_0x58d59d,_0x25c6be){return client[_0xd806('0xe')](_0xf68dd6,_0x1b15ca)['then'](function(_0x992b73){logger[_0xd806('0xf')](_0xd806('0x10'),_0x55fb02,_0xd806('0x11'));logger[_0xd806('0x12')](_0xd806('0x13'),_0x55fb02,_0xd806('0x11'),JSON[_0xd806('0x14')](_0x992b73));if(_0x992b73[_0xd806('0x15')]){if(_0x992b73[_0xd806('0x15')][_0xd806('0x16')]===0x1f4){logger['error'](_0xd806('0x10'),_0x55fb02,_0x992b73[_0xd806('0x15')][_0xd806('0x17')]);return _0x25c6be(_0x992b73['error'][_0xd806('0x17')]);}logger['error'](_0xd806('0x10'),_0x55fb02,_0x992b73[_0xd806('0x15')][_0xd806('0x17')]);return _0x58d59d(_0x992b73[_0xd806('0x15')][_0xd806('0x17')]);}else{logger[_0xd806('0xf')](_0xd806('0x10'),_0x55fb02,_0xd806('0x11'));_0x58d59d(_0x992b73[_0xd806('0x18')]['message']);}})[_0xd806('0x19')](function(_0x4321f3){logger[_0xd806('0x15')]('UserProfile,\x20%s,\x20%s',_0x55fb02,_0x4321f3);_0x25c6be(_0x4321f3);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index f036980..f38ce58 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 _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 +var _0x265b=['save','remove','emit','removeListener','register','userProfile:','./userProfile.events'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x265b,0xb5));var _0xb265=function(_0x228700,_0x1b536f){_0x228700=_0x228700-0x0;var _0xcc59ad=_0x265b[_0x228700];return _0xcc59ad;};'use strict';var UserProfileEvents=require(_0xb265('0x0'));var events=[_0xb265('0x1'),_0xb265('0x2'),'update'];function createListener(_0x3e4101,_0x29a250){return function(_0x10b2fd){_0x29a250[_0xb265('0x3')](_0x3e4101,_0x10b2fd);};}function removeListener(_0x470d2a,_0x48e489){return function(){UserProfileEvents[_0xb265('0x4')](_0x470d2a,_0x48e489);};}exports[_0xb265('0x5')]=function(_0x3d350e){for(var _0x59354c=0x0,_0x4d91fc=events['length'];_0x59354c<_0x4d91fc;_0x59354c++){var _0x28fed5=events[_0x59354c];var _0x182e9c=createListener(_0xb265('0x6')+_0x28fed5,_0x3d350e);UserProfileEvents['on'](_0x28fed5,_0x182e9c);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 494a051..9a841f5 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 _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 +var _0x6f75=['put','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x4c6c9d,_0x574fe1){var _0x1eeb1a=function(_0x113cc5){while(--_0x113cc5){_0x4c6c9d['push'](_0x4c6c9d['shift']());}};_0x1eeb1a(++_0x574fe1);}(_0x6f75,0x15a));var _0x56f7=function(_0x330f07,_0x2fb85c){_0x330f07=_0x330f07-0x0;var _0x150d9a=_0x6f75[_0x330f07];return _0x150d9a;};'use strict';var multer=require(_0x56f7('0x0'));var util=require('util');var path=require(_0x56f7('0x1'));var timeout=require('connect-timeout');var express=require(_0x56f7('0x2'));var router=express[_0x56f7('0x3')]();var fs_extra=require(_0x56f7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x56f7('0x5'));var config=require('../../config/environment');var controller=require(_0x56f7('0x6'));router[_0x56f7('0x7')]('/',auth['isAuthenticated'](),controller[_0x56f7('0x8')]);router['get'](_0x56f7('0x9'),auth[_0x56f7('0xa')](),controller[_0x56f7('0xb')]);router[_0x56f7('0x7')](_0x56f7('0xc'),auth[_0x56f7('0xa')](),controller[_0x56f7('0xd')]);router[_0x56f7('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x56f7('0xf')](_0x56f7('0xc'),auth[_0x56f7('0xa')](),controller[_0x56f7('0x10')]);router['delete'](_0x56f7('0xc'),auth[_0x56f7('0xa')](),controller[_0x56f7('0x11')]);module[_0x56f7('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 09fefe0..a3daf29 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 _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 +var _0xb678=['exports','STRING','INTEGER','sequelize'];(function(_0x41891a,_0x17fafa){var _0x1029b8=function(_0x3f78f9){while(--_0x3f78f9){_0x41891a['push'](_0x41891a['shift']());}};_0x1029b8(++_0x17fafa);}(_0xb678,0x15b));var _0x8b67=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xb678[_0x231e16];return _0x570a7c;};'use strict';var Sequelize=require(_0x8b67('0x0'));module[_0x8b67('0x1')]={'name':{'type':Sequelize[_0x8b67('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x8b67('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8b67('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 92ac8e6..340d8a3 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 _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 +var _0x47c5=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','count','includeAll','include','findAll','show','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model'];(function(_0x368a53,_0x6db452){var _0x5c1f8d=function(_0x8ac720){while(--_0x8ac720){_0x368a53['push'](_0x368a53['shift']());}};_0x5c1f8d(++_0x6db452);}(_0x47c5,0x165));var _0x547c=function(_0x297acf,_0x530d6c){_0x297acf=_0x297acf-0x0;var _0x2dd757=_0x47c5[_0x297acf];return _0x2dd757;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var moment=require(_0x547c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x547c('0x6'));var util=require(_0x547c('0x7'));var path=require('path');var sox=require(_0x547c('0x8'));var csv=require(_0x547c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x547c('0xa'));var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x9'));var querystring=require(_0x547c('0x10'));var Papa=require(_0x547c('0x11'));var Redis=require(_0x547c('0x12'));var authService=require(_0x547c('0x13'));var qs=require(_0x547c('0x14'));var as=require(_0x547c('0x15'));var hardwareService=require(_0x547c('0x16'));var logger=require(_0x547c('0x17'))(_0x547c('0x18'));var utils=require(_0x547c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x547c('0x1a'));var db=require(_0x547c('0x1b'))['db'];function respondWithStatusCode(_0x5eea67,_0x436c19){_0x436c19=_0x436c19||0xcc;return function(_0x201d95){if(_0x201d95){return _0x5eea67[_0x547c('0x1c')](_0x436c19);}return _0x5eea67[_0x547c('0x1d')](_0x436c19)[_0x547c('0x1e')]();};}function respondWithResult(_0x150317,_0x2bc289){_0x2bc289=_0x2bc289||0xc8;return function(_0xa3c7b0){if(_0xa3c7b0){return _0x150317[_0x547c('0x1d')](_0x2bc289)[_0x547c('0x1f')](_0xa3c7b0);}};}function respondWithFilteredResult(_0x240243,_0x103455){return function(_0x39f316){if(_0x39f316){var _0x23644b=typeof _0x103455[_0x547c('0x20')]===_0x547c('0x21')&&typeof _0x103455[_0x547c('0x22')]===_0x547c('0x21');var _0x49acca=_0x39f316['count'];var _0x23fa9e=_0x23644b?0x0:_0x103455[_0x547c('0x20')];var _0xeb059e=_0x23644b?_0x39f316['count']:_0x103455[_0x547c('0x20')]+_0x103455[_0x547c('0x22')];var _0x1ddbd3;if(_0xeb059e>=_0x49acca){_0xeb059e=_0x49acca;_0x1ddbd3=0xc8;}else{_0x1ddbd3=0xce;}_0x240243['status'](_0x1ddbd3);return _0x240243[_0x547c('0x23')](_0x547c('0x24'),_0x23fa9e+'-'+_0xeb059e+'/'+_0x49acca)['json'](_0x39f316);}return null;};}function patchUpdates(_0x5453f9){return function(_0x35040a){try{jsonpatch[_0x547c('0x25')](_0x35040a,_0x5453f9,!![]);}catch(_0x4f20c1){return BPromise[_0x547c('0x26')](_0x4f20c1);}return _0x35040a[_0x547c('0x27')]();};}function saveUpdates(_0x592e46,_0x2e317a){return function(_0x17fd97){if(_0x17fd97){return _0x17fd97[_0x547c('0x28')](_0x592e46)['then'](function(_0x3a55a0){return _0x3a55a0;});}return null;};}function removeEntity(_0x361c5c,_0x470694){return function(_0x26823c){if(_0x26823c){return _0x26823c[_0x547c('0x29')]()[_0x547c('0x2a')](function(){_0x361c5c[_0x547c('0x1d')](0xcc)[_0x547c('0x1e')]();});}};}function handleEntityNotFound(_0x507895,_0x39c5f9){return function(_0x4c66b9){if(!_0x4c66b9){_0x507895['sendStatus'](0x194);}return _0x4c66b9;};}function handleError(_0x4855fd,_0x478f04){_0x478f04=_0x478f04||0x1f4;return function(_0x2c725d){logger['error'](_0x2c725d[_0x547c('0x2b')]);if(_0x2c725d['name']){delete _0x2c725d[_0x547c('0x2c')];}_0x4855fd['status'](_0x478f04)[_0x547c('0x2d')](_0x2c725d);};}exports[_0x547c('0x2e')]=function(_0x2389de,_0x30a96c){var _0x198afb={},_0x569924={},_0x575c74={'count':0x0,'rows':[]};var _0x28c282=_['map'](db[_0x547c('0x2f')][_0x547c('0x30')],function(_0x3e7652){return{'name':_0x3e7652[_0x547c('0x31')],'type':_0x3e7652[_0x547c('0x32')][_0x547c('0x33')]};});_0x569924[_0x547c('0x34')]=_['map'](_0x28c282,'name');_0x569924[_0x547c('0x35')]=_[_0x547c('0x36')](_0x2389de[_0x547c('0x35')]);_0x569924[_0x547c('0x37')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],_0x569924[_0x547c('0x35')]);_0x198afb[_0x547c('0x39')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],qs[_0x547c('0x3a')](_0x2389de[_0x547c('0x35')][_0x547c('0x3a')]));_0x198afb[_0x547c('0x39')]=_0x198afb['attributes'][_0x547c('0x3b')]?_0x198afb['attributes']:_0x569924['model'];if(!_0x2389de['query'][_0x547c('0x3c')](_0x547c('0x3d'))){_0x198afb[_0x547c('0x22')]=qs[_0x547c('0x22')](_0x2389de[_0x547c('0x35')][_0x547c('0x22')]);_0x198afb['offset']=qs['offset'](_0x2389de['query'][_0x547c('0x20')]);}_0x198afb[_0x547c('0x3e')]=qs[_0x547c('0x3f')](_0x2389de[_0x547c('0x35')][_0x547c('0x3f')]);_0x198afb[_0x547c('0x40')]=qs['filters'](_[_0x547c('0x41')](_0x2389de['query'],_0x569924[_0x547c('0x37')]),_0x28c282);if(_0x2389de[_0x547c('0x35')]['filter']){_0x198afb[_0x547c('0x40')]=_['merge'](_0x198afb['where'],{'$or':_[_0x547c('0x42')](_0x28c282,function(_0x281d52){if(_0x281d52[_0x547c('0x32')]!==_0x547c('0x43')){var _0x4c36b9={};_0x4c36b9[_0x281d52['name']]={'$like':'%'+_0x2389de[_0x547c('0x35')][_0x547c('0x44')]+'%'};return _0x4c36b9;}})});}_0x198afb=_[_0x547c('0x45')]({},_0x198afb,_0x2389de['options']);var _0x3886ae={'where':_0x198afb[_0x547c('0x40')]};return db[_0x547c('0x2f')]['count'](_0x3886ae)[_0x547c('0x2a')](function(_0x3a6a0a){_0x575c74[_0x547c('0x46')]=_0x3a6a0a;if(_0x2389de['query'][_0x547c('0x47')]){_0x198afb[_0x547c('0x48')]=[{'all':!![]}];}return db['UserProfileResource'][_0x547c('0x49')](_0x198afb);})[_0x547c('0x2a')](function(_0x9c3cb2){_0x575c74['rows']=_0x9c3cb2;return _0x575c74;})[_0x547c('0x2a')](respondWithFilteredResult(_0x30a96c,_0x198afb))['catch'](handleError(_0x30a96c,null));};exports[_0x547c('0x4a')]=function(_0x5393a2,_0xb86f5f){var _0x414b9d={'raw':![],'where':{'id':_0x5393a2[_0x547c('0x4b')]['id']}},_0x3d37d7={};_0x3d37d7[_0x547c('0x34')]=_[_0x547c('0x36')](db['UserProfileResource']['rawAttributes']);_0x3d37d7[_0x547c('0x35')]=_[_0x547c('0x36')](_0x5393a2[_0x547c('0x35')]);_0x3d37d7['filters']=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],_0x3d37d7[_0x547c('0x35')]);_0x414b9d[_0x547c('0x39')]=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],qs['fields'](_0x5393a2[_0x547c('0x35')][_0x547c('0x3a')]));_0x414b9d[_0x547c('0x39')]=_0x414b9d['attributes'][_0x547c('0x3b')]?_0x414b9d[_0x547c('0x39')]:_0x3d37d7[_0x547c('0x34')];if(_0x5393a2[_0x547c('0x35')]['includeAll']){_0x414b9d[_0x547c('0x48')]=[{'all':!![]}];}_0x414b9d=_['merge']({},_0x414b9d,_0x5393a2[_0x547c('0x4c')]);return db['UserProfileResource'][_0x547c('0x4d')](_0x414b9d)[_0x547c('0x2a')](handleEntityNotFound(_0xb86f5f,null))['then'](respondWithResult(_0xb86f5f,null))[_0x547c('0x4e')](handleError(_0xb86f5f,null));};exports[_0x547c('0x4f')]=function(_0xa005cc,_0x1ddf30){return db['UserProfileResource'][_0x547c('0x4f')](_0xa005cc['body'],{})['then'](respondWithResult(_0x1ddf30,0xc9))[_0x547c('0x4e')](handleError(_0x1ddf30,null));};exports[_0x547c('0x28')]=function(_0x3e3f52,_0x11a878){if(_0x3e3f52[_0x547c('0x50')]['id']){delete _0x3e3f52[_0x547c('0x50')]['id'];}return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x3e3f52[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x11a878,null))[_0x547c('0x2a')](saveUpdates(_0x3e3f52[_0x547c('0x50')],null))['then'](respondWithResult(_0x11a878,null))['catch'](handleError(_0x11a878,null));};exports[_0x547c('0x29')]=function(_0x21ea26,_0x48de6e){return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x21ea26[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x48de6e,null))[_0x547c('0x2a')](removeEntity(_0x48de6e,null))[_0x547c('0x4e')](handleError(_0x48de6e,null));};exports['describe']=function(_0x152982,_0x5258cf){return db[_0x547c('0x2f')][_0x547c('0x51')]()[_0x547c('0x2a')](respondWithResult(_0x5258cf,null))['catch'](handleError(_0x5258cf,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index b3b0ae4..5e27668 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 _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 +var _0xf1bd=['define','UserProfileResource','sectionId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x7a2d8b,_0x29c294){var _0x1a3c6c=function(_0x188f2b){while(--_0x188f2b){_0x7a2d8b['push'](_0x7a2d8b['shift']());}};_0x1a3c6c(++_0x29c294);}(_0xf1bd,0x1d7));var _0xdf1b=function(_0x2429b0,_0x240c1e){_0x2429b0=_0x2429b0-0x0;var _0x56e532=_0xf1bd[_0x2429b0];return _0x56e532;};'use strict';var _=require('lodash');var util=require(_0xdf1b('0x0'));var logger=require(_0xdf1b('0x1'))(_0xdf1b('0x2'));var moment=require(_0xdf1b('0x3'));var BPromise=require(_0xdf1b('0x4'));var rp=require(_0xdf1b('0x5'));var fs=require('fs');var path=require(_0xdf1b('0x6'));var rimraf=require(_0xdf1b('0x7'));var config=require(_0xdf1b('0x8'));var attributes=require('./userProfileResource.attributes');module['exports']=function(_0x5f34c0,_0x38968e){return _0x5f34c0[_0xdf1b('0x9')](_0xdf1b('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0xdf1b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 01cd461..7437035 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 _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 +var _0xb3b1=['jayson/promise','client','http','request','then','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','UserProfileResource,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4efdb8,_0x369b59){var _0x3ce171=function(_0x3d782a){while(--_0x3d782a){_0x4efdb8['push'](_0x4efdb8['shift']());}};_0x3ce171(++_0x369b59);}(_0xb3b1,0x160));var _0x1b3b=function(_0xec6cb4,_0x45e2b5){_0xec6cb4=_0xec6cb4-0x0;var _0x50b464=_0xb3b1[_0xec6cb4];return _0x50b464;};'use strict';var _=require(_0x1b3b('0x0'));var util=require('util');var moment=require(_0x1b3b('0x1'));var BPromise=require(_0x1b3b('0x2'));var rs=require(_0x1b3b('0x3'));var fs=require('fs');var Redis=require(_0x1b3b('0x4'));var db=require(_0x1b3b('0x5'))['db'];var utils=require(_0x1b3b('0x6'));var logger=require('../../config/logger')(_0x1b3b('0x7'));var config=require('../../config/environment');var jayson=require(_0x1b3b('0x8'));var client=jayson[_0x1b3b('0x9')][_0x1b3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d752e,_0x1936f5,_0x475e52){return new BPromise(function(_0xa33ec5,_0x14a837){return client[_0x1b3b('0xb')](_0x5d752e,_0x475e52)[_0x1b3b('0xc')](function(_0x2bd953){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x1936f5,'request\x20sent');logger[_0x1b3b('0xd')](_0x1b3b('0xe'),_0x1936f5,_0x1b3b('0xf'),JSON[_0x1b3b('0x10')](_0x2bd953));if(_0x2bd953['error']){if(_0x2bd953[_0x1b3b('0x11')][_0x1b3b('0x12')]===0x1f4){logger[_0x1b3b('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x1936f5,_0x2bd953[_0x1b3b('0x11')][_0x1b3b('0x13')]);return _0x14a837(_0x2bd953['error'][_0x1b3b('0x13')]);}logger[_0x1b3b('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x1936f5,_0x2bd953[_0x1b3b('0x11')][_0x1b3b('0x13')]);return _0xa33ec5(_0x2bd953[_0x1b3b('0x11')]['message']);}else{logger[_0x1b3b('0x14')](_0x1b3b('0x15'),_0x1936f5,_0x1b3b('0xf'));_0xa33ec5(_0x2bd953[_0x1b3b('0x16')][_0x1b3b('0x13')]);}})[_0x1b3b('0x17')](function(_0x47a34b){logger[_0x1b3b('0x11')](_0x1b3b('0x15'),_0x1936f5,_0x47a34b);_0x14a837(_0x47a34b);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 5967e74..23428a0 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 _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 +var _0x1e63=['exports','util','path','connect-timeout','fs-extra','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy'];(function(_0x3dbb2a,_0x54fab8){var _0x3511ce=function(_0x351332){while(--_0x351332){_0x3dbb2a['push'](_0x3dbb2a['shift']());}};_0x3511ce(++_0x54fab8);}(_0x1e63,0x73));var _0x31e6=function(_0x1a87c9,_0x37ed88){_0x1a87c9=_0x1a87c9-0x0;var _0x348509=_0x1e63[_0x1a87c9];return _0x348509;};'use strict';var multer=require('multer');var util=require(_0x31e6('0x0'));var path=require(_0x31e6('0x1'));var timeout=require(_0x31e6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x31e6('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x31e6('0x4'));var controller=require(_0x31e6('0x5'));router[_0x31e6('0x6')]('/',auth[_0x31e6('0x7')](),controller[_0x31e6('0x8')]);router[_0x31e6('0x6')](_0x31e6('0x9'),auth[_0x31e6('0x7')](),controller[_0x31e6('0xa')]);router[_0x31e6('0x6')](_0x31e6('0xb'),auth[_0x31e6('0x7')](),controller[_0x31e6('0xc')]);router[_0x31e6('0xd')]('/',auth[_0x31e6('0x7')](),controller[_0x31e6('0xe')]);router[_0x31e6('0xf')](_0x31e6('0xb'),auth['isAuthenticated'](),controller[_0x31e6('0x10')]);router['delete'](_0x31e6('0xb'),auth[_0x31e6('0x7')](),controller[_0x31e6('0x11')]);module[_0x31e6('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 2226864..c19dd00 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 _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 +var _0xda3f=['join','getDataValue','crudPermissions','split','exports','STRING','BOOLEAN','setDataValue'];(function(_0x3b4802,_0x3f8265){var _0x35d6ad=function(_0x2f90a1){while(--_0x2f90a1){_0x3b4802['push'](_0x3b4802['shift']());}};_0x35d6ad(++_0x3f8265);}(_0xda3f,0xec));var _0xfda3=function(_0x4e4324,_0x2dfac1){_0x4e4324=_0x4e4324-0x0;var _0x4a1fa5=_0xda3f[_0x4e4324];return _0x4a1fa5;};'use strict';var Sequelize=require('sequelize');module[_0xfda3('0x0')]={'name':{'type':Sequelize[_0xfda3('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xfda3('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x36dc71){this[_0xfda3('0x3')]('crudPermissions',_0x36dc71?_0x36dc71[_0xfda3('0x4')](''):[]);},'get':function(){return this[_0xfda3('0x5')]('crudPermissions')?this['getDataValue'](_0xfda3('0x6'))[_0xfda3('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index ca7e5e7..8f29168 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 _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 +var _0xa23a=['squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','name','send','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash'];(function(_0x4a7790,_0x47dead){var _0x37104a=function(_0x14812a){while(--_0x14812a){_0x4a7790['push'](_0x4a7790['shift']());}};_0x37104a(++_0x47dead);}(_0xa23a,0x11f));var _0xaa23=function(_0x114321,_0x1ce445){_0x114321=_0x114321-0x0;var _0x3f070f=_0xa23a[_0x114321];return _0x3f070f;};'use strict';var emlformat=require(_0xaa23('0x0'));var rimraf=require(_0xaa23('0x1'));var zipdir=require(_0xaa23('0x2'));var jsonpatch=require(_0xaa23('0x3'));var rp=require(_0xaa23('0x4'));var moment=require(_0xaa23('0x5'));var BPromise=require(_0xaa23('0x6'));var Mustache=require(_0xaa23('0x7'));var util=require('util');var path=require(_0xaa23('0x8'));var sox=require(_0xaa23('0x9'));var csv=require('to-csv');var ejs=require(_0xaa23('0xa'));var fs=require('fs');var fs_extra=require(_0xaa23('0xb'));var _=require(_0xaa23('0xc'));var squel=require(_0xaa23('0xd'));var crypto=require(_0xaa23('0xe'));var jsforce=require(_0xaa23('0xf'));var deskjs=require(_0xaa23('0x10'));var toCsv=require(_0xaa23('0x11'));var querystring=require(_0xaa23('0x12'));var Papa=require(_0xaa23('0x13'));var Redis=require(_0xaa23('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaa23('0x15'));var hardwareService=require(_0xaa23('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xaa23('0x17'));var licenseUtil=require(_0xaa23('0x18'));var db=require(_0xaa23('0x19'))['db'];function respondWithStatusCode(_0x23de09,_0x79f1fb){_0x79f1fb=_0x79f1fb||0xcc;return function(_0x105a29){if(_0x105a29){return _0x23de09[_0xaa23('0x1a')](_0x79f1fb);}return _0x23de09[_0xaa23('0x1b')](_0x79f1fb)[_0xaa23('0x1c')]();};}function respondWithResult(_0x303b39,_0x4dcb5f){_0x4dcb5f=_0x4dcb5f||0xc8;return function(_0x17c4ba){if(_0x17c4ba){return _0x303b39[_0xaa23('0x1b')](_0x4dcb5f)[_0xaa23('0x1d')](_0x17c4ba);}};}function respondWithFilteredResult(_0x414626,_0x27c756){return function(_0x53459d){if(_0x53459d){var _0x466bae=typeof _0x27c756[_0xaa23('0x1e')]===_0xaa23('0x1f')&&typeof _0x27c756[_0xaa23('0x20')]==='undefined';var _0x5a490f=_0x53459d['count'];var _0x5b4cbb=_0x466bae?0x0:_0x27c756[_0xaa23('0x1e')];var _0x43b91c=_0x466bae?_0x53459d[_0xaa23('0x21')]:_0x27c756[_0xaa23('0x1e')]+_0x27c756[_0xaa23('0x20')];var _0xb0214f;if(_0x43b91c>=_0x5a490f){_0x43b91c=_0x5a490f;_0xb0214f=0xc8;}else{_0xb0214f=0xce;}_0x414626[_0xaa23('0x1b')](_0xb0214f);return _0x414626[_0xaa23('0x22')]('Content-Range',_0x5b4cbb+'-'+_0x43b91c+'/'+_0x5a490f)[_0xaa23('0x1d')](_0x53459d);}return null;};}function patchUpdates(_0x18ee34){return function(_0x456c8b){try{jsonpatch['apply'](_0x456c8b,_0x18ee34,!![]);}catch(_0x382aab){return BPromise[_0xaa23('0x23')](_0x382aab);}return _0x456c8b[_0xaa23('0x24')]();};}function saveUpdates(_0x3a9a29,_0xce5372){return function(_0x1e5f7a){if(_0x1e5f7a){return _0x1e5f7a[_0xaa23('0x25')](_0x3a9a29)[_0xaa23('0x26')](function(_0x4e9354){return _0x4e9354;});}return null;};}function removeEntity(_0x30af73,_0x1141b3){return function(_0x10f31f){if(_0x10f31f){return _0x10f31f[_0xaa23('0x27')]()[_0xaa23('0x26')](function(){_0x30af73[_0xaa23('0x1b')](0xcc)[_0xaa23('0x1c')]();});}};}function handleEntityNotFound(_0x225e7e,_0x39b00e){return function(_0x692e42){if(!_0x692e42){_0x225e7e[_0xaa23('0x1a')](0x194);}return _0x692e42;};}function handleError(_0x4b1f80,_0x307369){_0x307369=_0x307369||0x1f4;return function(_0x12397e){logger[_0xaa23('0x28')](_0x12397e[_0xaa23('0x29')]);if(_0x12397e[_0xaa23('0x2a')]){delete _0x12397e[_0xaa23('0x2a')];}_0x4b1f80['status'](_0x307369)[_0xaa23('0x2b')](_0x12397e);};}exports['index']=function(_0x94506d,_0x487c35){var _0x80f00={},_0x33fdaa={},_0x3f6742={'count':0x0,'rows':[]};var _0x996d9b=_[_0xaa23('0x2c')](db[_0xaa23('0x2d')][_0xaa23('0x2e')],function(_0x9a1259){return{'name':_0x9a1259[_0xaa23('0x2f')],'type':_0x9a1259[_0xaa23('0x30')][_0xaa23('0x31')]};});_0x33fdaa[_0xaa23('0x32')]=_[_0xaa23('0x2c')](_0x996d9b,'name');_0x33fdaa[_0xaa23('0x33')]=_[_0xaa23('0x34')](_0x94506d[_0xaa23('0x33')]);_0x33fdaa[_0xaa23('0x35')]=_['intersection'](_0x33fdaa[_0xaa23('0x32')],_0x33fdaa[_0xaa23('0x33')]);_0x80f00[_0xaa23('0x36')]=_[_0xaa23('0x37')](_0x33fdaa[_0xaa23('0x32')],qs[_0xaa23('0x38')](_0x94506d['query']['fields']));_0x80f00[_0xaa23('0x36')]=_0x80f00[_0xaa23('0x36')]['length']?_0x80f00['attributes']:_0x33fdaa[_0xaa23('0x32')];if(!_0x94506d[_0xaa23('0x33')][_0xaa23('0x39')](_0xaa23('0x3a'))){_0x80f00['limit']=qs[_0xaa23('0x20')](_0x94506d['query'][_0xaa23('0x20')]);_0x80f00[_0xaa23('0x1e')]=qs['offset'](_0x94506d['query'][_0xaa23('0x1e')]);}_0x80f00['order']=qs[_0xaa23('0x3b')](_0x94506d[_0xaa23('0x33')][_0xaa23('0x3b')]);_0x80f00[_0xaa23('0x3c')]=qs['filters'](_[_0xaa23('0x3d')](_0x94506d['query'],_0x33fdaa[_0xaa23('0x35')]),_0x996d9b);if(_0x94506d[_0xaa23('0x33')][_0xaa23('0x3e')]){_0x80f00['where']=_['merge'](_0x80f00[_0xaa23('0x3c')],{'$or':_[_0xaa23('0x2c')](_0x996d9b,function(_0x4aad6d){if(_0x4aad6d[_0xaa23('0x30')]!==_0xaa23('0x3f')){var _0x22a571={};_0x22a571[_0x4aad6d[_0xaa23('0x2a')]]={'$like':'%'+_0x94506d['query'][_0xaa23('0x3e')]+'%'};return _0x22a571;}})});}_0x80f00=_[_0xaa23('0x40')]({},_0x80f00,_0x94506d[_0xaa23('0x41')]);var _0x3b3d1b={'where':_0x80f00[_0xaa23('0x3c')]};return db[_0xaa23('0x2d')][_0xaa23('0x21')](_0x3b3d1b)['then'](function(_0x441d91){_0x3f6742[_0xaa23('0x21')]=_0x441d91;if(_0x94506d[_0xaa23('0x33')]['includeAll']){_0x80f00[_0xaa23('0x42')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x80f00);})['then'](function(_0x2cb309){_0x3f6742[_0xaa23('0x43')]=_0x2cb309;return _0x3f6742;})[_0xaa23('0x26')](respondWithFilteredResult(_0x487c35,_0x80f00))[_0xaa23('0x44')](handleError(_0x487c35,null));};exports[_0xaa23('0x45')]=function(_0x41b452,_0x3cbe7c){var _0x26fca7={'raw':![],'where':{'id':_0x41b452['params']['id']}},_0x484802={};_0x484802[_0xaa23('0x32')]=_['keys'](db[_0xaa23('0x2d')][_0xaa23('0x2e')]);_0x484802[_0xaa23('0x33')]=_[_0xaa23('0x34')](_0x41b452[_0xaa23('0x33')]);_0x484802[_0xaa23('0x35')]=_[_0xaa23('0x37')](_0x484802[_0xaa23('0x32')],_0x484802[_0xaa23('0x33')]);_0x26fca7[_0xaa23('0x36')]=_[_0xaa23('0x37')](_0x484802['model'],qs[_0xaa23('0x38')](_0x41b452['query'][_0xaa23('0x38')]));_0x26fca7['attributes']=_0x26fca7['attributes']['length']?_0x26fca7['attributes']:_0x484802[_0xaa23('0x32')];if(_0x41b452[_0xaa23('0x33')]['includeAll']){_0x26fca7[_0xaa23('0x42')]=[{'all':!![]}];}_0x26fca7=_[_0xaa23('0x40')]({},_0x26fca7,_0x41b452[_0xaa23('0x41')]);return db[_0xaa23('0x2d')][_0xaa23('0x46')](_0x26fca7)['then'](handleEntityNotFound(_0x3cbe7c,null))[_0xaa23('0x26')](respondWithResult(_0x3cbe7c,null))['catch'](handleError(_0x3cbe7c,null));};exports[_0xaa23('0x47')]=function(_0x35cd67,_0x1312b4){return db[_0xaa23('0x2d')][_0xaa23('0x47')](_0x35cd67['body'],{})[_0xaa23('0x26')](respondWithResult(_0x1312b4,0xc9))['catch'](handleError(_0x1312b4,null));};exports['update']=function(_0x349078,_0x5f473f){if(_0x349078[_0xaa23('0x48')]['id']){delete _0x349078['body']['id'];}return db[_0xaa23('0x2d')]['find']({'where':{'id':_0x349078['params']['id']}})[_0xaa23('0x26')](handleEntityNotFound(_0x5f473f,null))[_0xaa23('0x26')](saveUpdates(_0x349078[_0xaa23('0x48')],null))[_0xaa23('0x26')](respondWithResult(_0x5f473f,null))[_0xaa23('0x44')](handleError(_0x5f473f,null));};exports[_0xaa23('0x27')]=function(_0x378ac8,_0x3340c2){return db[_0xaa23('0x2d')][_0xaa23('0x46')]({'where':{'id':_0x378ac8[_0xaa23('0x49')]['id']}})['then'](handleEntityNotFound(_0x3340c2,null))[_0xaa23('0x26')](removeEntity(_0x3340c2,null))[_0xaa23('0x44')](handleError(_0x3340c2,null));};exports[_0xaa23('0x4a')]=function(_0xe0af10,_0x47dd11){return db['UserProfileSection'][_0xaa23('0x4a')]()['then'](respondWithResult(_0x47dd11,null))[_0xaa23('0x44')](handleError(_0x47dd11,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index e75a027..ec8ede5 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 _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 +var _0x9c9c=['rimraf','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x459a0a,_0x25c46f){var _0x4ab46c=function(_0x451a6a){while(--_0x451a6a){_0x459a0a['push'](_0x459a0a['shift']());}};_0x4ab46c(++_0x25c46f);}(_0x9c9c,0x1e4));var _0xc9c9=function(_0x21b95c,_0x35c39e){_0x21b95c=_0x21b95c-0x0;var _0x1ede2f=_0x9c9c[_0x21b95c];return _0x1ede2f;};'use strict';var _=require(_0xc9c9('0x0'));var util=require(_0xc9c9('0x1'));var logger=require(_0xc9c9('0x2'))(_0xc9c9('0x3'));var moment=require('moment');var BPromise=require(_0xc9c9('0x4'));var rp=require(_0xc9c9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc9c9('0x6'));var config=require(_0xc9c9('0x7'));var attributes=require(_0xc9c9('0x8'));module['exports']=function(_0x8f81c,_0x456b6b){return _0x8f81c[_0xc9c9('0x9')](_0xc9c9('0xa'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xc9c9('0xb'),'fields':[_0xc9c9('0xc'),_0xc9c9('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 8c2cfc0..ba3cc52 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 _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 +var _0xca8a=['../../config/environment','client','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x27fa17,_0x59dade){var _0x3c8c82=function(_0x120476){while(--_0x120476){_0x27fa17['push'](_0x27fa17['shift']());}};_0x3c8c82(++_0x59dade);}(_0xca8a,0xca));var _0xaca8=function(_0x3ff936,_0x3bcaab){_0x3ff936=_0x3ff936-0x0;var _0x4f3380=_0xca8a[_0x3ff936];return _0x4f3380;};'use strict';var _=require(_0xaca8('0x0'));var util=require(_0xaca8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaca8('0x2'));var fs=require('fs');var Redis=require(_0xaca8('0x3'));var db=require(_0xaca8('0x4'))['db'];var utils=require(_0xaca8('0x5'));var logger=require(_0xaca8('0x6'))(_0xaca8('0x7'));var config=require(_0xaca8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaca8('0x9')][_0xaca8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3de899,_0x61a3a0,_0x38548c){return new BPromise(function(_0x4ef266,_0x278b21){return client[_0xaca8('0xb')](_0x3de899,_0x38548c)[_0xaca8('0xc')](function(_0x2c640f){logger['info'](_0xaca8('0xd'),_0x61a3a0,_0xaca8('0xe'));logger[_0xaca8('0xf')](_0xaca8('0x10'),_0x61a3a0,_0xaca8('0xe'),JSON[_0xaca8('0x11')](_0x2c640f));if(_0x2c640f[_0xaca8('0x12')]){if(_0x2c640f[_0xaca8('0x12')][_0xaca8('0x13')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x61a3a0,_0x2c640f[_0xaca8('0x12')][_0xaca8('0x14')]);return _0x278b21(_0x2c640f[_0xaca8('0x12')][_0xaca8('0x14')]);}logger['error'](_0xaca8('0xd'),_0x61a3a0,_0x2c640f[_0xaca8('0x12')][_0xaca8('0x14')]);return _0x4ef266(_0x2c640f[_0xaca8('0x12')][_0xaca8('0x14')]);}else{logger['info'](_0xaca8('0xd'),_0x61a3a0,_0xaca8('0xe'));_0x4ef266(_0x2c640f['result']['message']);}})['catch'](function(_0x3706ad){logger[_0xaca8('0x12')](_0xaca8('0xd'),_0x61a3a0,_0x3706ad);_0x278b21(_0x3706ad);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 50afc29..980a604 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(_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 +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3fde44,_0x53f072){var _0x4550c0=function(_0x57af42){while(--_0x57af42){_0x3fde44['push'](_0x3fde44['shift']());}};_0x4550c0(++_0x53f072);}(_0x70e0,0x17b));var _0x070e=function(_0x31277b,_0x32d9c3){_0x31277b=_0x31277b-0x0;var _0x4e6e8d=_0x70e0[_0x31277b];return _0x4e6e8d;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index e9d3d9b..b0f73d7 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 _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 +var _0x9220=['sequelize','exports'];(function(_0x48779a,_0x2afba6){var _0x4af39b=function(_0x3b5d26){while(--_0x3b5d26){_0x48779a['push'](_0x48779a['shift']());}};_0x4af39b(++_0x2afba6);}(_0x9220,0x96));var _0x0922=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x9220[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require(_0x0922('0x0'));module[_0x0922('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 ff62c61..1292509 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 _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 +var _0xa498=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserSmsQueue'];(function(_0x2517bc,_0x2b292c){var _0x57bbc7=function(_0x1431a0){while(--_0x1431a0){_0x2517bc['push'](_0x2517bc['shift']());}};_0x57bbc7(++_0x2b292c);}(_0xa498,0x1d6));var _0x8a49=function(_0x4f8b2b,_0x1dc8dd){_0x4f8b2b=_0x4f8b2b-0x0;var _0x2f230a=_0xa498[_0x4f8b2b];return _0x2f230a;};'use strict';var _=require('lodash');var util=require(_0x8a49('0x0'));var logger=require(_0x8a49('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8a49('0x2'));var rp=require(_0x8a49('0x3'));var fs=require('fs');var path=require(_0x8a49('0x4'));var rimraf=require(_0x8a49('0x5'));var config=require(_0x8a49('0x6'));var attributes=require('./userSmsQueue.attributes');module[_0x8a49('0x7')]=function(_0x5c5df6,_0x366d5b){return _0x5c5df6[_0x8a49('0x8')](_0x8a49('0x9'),attributes,{'tableName':'user_has_sms_queues','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 810b491..2a09d4a 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 _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 +var _0xbdf8=['request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xbdf8,0x67));var _0x8bdf=function(_0x3364fc,_0x559233){_0x3364fc=_0x3364fc-0x0;var _0x10df36=_0xbdf8[_0x3364fc];return _0x10df36;};'use strict';var _=require(_0x8bdf('0x0'));var util=require(_0x8bdf('0x1'));var moment=require(_0x8bdf('0x2'));var BPromise=require(_0x8bdf('0x3'));var rs=require(_0x8bdf('0x4'));var fs=require('fs');var Redis=require(_0x8bdf('0x5'));var db=require(_0x8bdf('0x6'))['db'];var utils=require(_0x8bdf('0x7'));var logger=require(_0x8bdf('0x8'))(_0x8bdf('0x9'));var config=require(_0x8bdf('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8bdf('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a375f,_0x59e0fd,_0x3ea6d3){return new BPromise(function(_0x2a3f1c,_0x393955){return client[_0x8bdf('0xc')](_0x4a375f,_0x3ea6d3)[_0x8bdf('0xd')](function(_0x98212d){logger[_0x8bdf('0xe')](_0x8bdf('0xf'),_0x59e0fd,_0x8bdf('0x10'));logger[_0x8bdf('0x11')](_0x8bdf('0x12'),_0x59e0fd,_0x8bdf('0x10'),JSON['stringify'](_0x98212d));if(_0x98212d['error']){if(_0x98212d[_0x8bdf('0x13')][_0x8bdf('0x14')]===0x1f4){logger[_0x8bdf('0x13')](_0x8bdf('0xf'),_0x59e0fd,_0x98212d['error'][_0x8bdf('0x15')]);return _0x393955(_0x98212d['error'][_0x8bdf('0x15')]);}logger[_0x8bdf('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x59e0fd,_0x98212d[_0x8bdf('0x13')][_0x8bdf('0x15')]);return _0x2a3f1c(_0x98212d[_0x8bdf('0x13')][_0x8bdf('0x15')]);}else{logger[_0x8bdf('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x59e0fd,_0x8bdf('0x10'));_0x2a3f1c(_0x98212d[_0x8bdf('0x16')][_0x8bdf('0x15')]);}})['catch'](function(_0x29507a){logger['error'](_0x8bdf('0xf'),_0x59e0fd,_0x29507a);_0x393955(_0x29507a);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index a5c1c17..2c85250 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 _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 +var _0xd67d=['exports','INTEGER','sequelize'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0xd67d,0x1a9));var _0xdd67=function(_0x121d9e,_0x11b966){_0x121d9e=_0x121d9e-0x0;var _0x5df466=_0xd67d[_0x121d9e];return _0x5df466;};'use strict';var Sequelize=require(_0xdd67('0x0'));module[_0xdd67('0x1')]={'UserId':{'type':Sequelize[_0xdd67('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xdd67('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index de515fa..e1a0a55 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(_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 +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x5d5c3c,_0x400884){var _0x55088d=function(_0x38e2f1){while(--_0x38e2f1){_0x5d5c3c['push'](_0x5d5c3c['shift']());}};_0x55088d(++_0x400884);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 17eedf8..d438f97 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 _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 +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x172f09,_0x38765e){var _0x389c91=function(_0x1c7779){while(--_0x1c7779){_0x172f09['push'](_0x172f09['shift']());}};_0x389c91(++_0x38765e);}(_0x70e0,0x17b));var _0x070e=function(_0xd3eece,_0x4eaff6){_0xd3eece=_0xd3eece-0x0;var _0x50444d=_0x70e0[_0xd3eece];return _0x50444d;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 63cc556..1fc071f 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 _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 +var _0xd4de=['exports','INTEGER','sequelize'];(function(_0x4237d8,_0x13cc54){var _0x1e8caf=function(_0x1b18c5){while(--_0x1b18c5){_0x4237d8['push'](_0x4237d8['shift']());}};_0x1e8caf(++_0x13cc54);}(_0xd4de,0x173));var _0xed4d=function(_0x1433d6,_0x23c7f7){_0x1433d6=_0x1433d6-0x0;var _0x33ae59=_0xd4de[_0x1433d6];return _0x33ae59;};'use strict';var Sequelize=require(_0xed4d('0x0'));module[_0xed4d('0x1')]={'penalty':{'type':Sequelize[_0xed4d('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index d8431fa..c61f45f 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 _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 +var _0x7038=['moment','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','../../config/logger','api'];(function(_0x545b71,_0x4f44eb){var _0x26e587=function(_0x293b81){while(--_0x293b81){_0x545b71['push'](_0x545b71['shift']());}};_0x26e587(++_0x4f44eb);}(_0x7038,0x19c));var _0x8703=function(_0x3ac45a,_0x50eb44){_0x3ac45a=_0x3ac45a-0x0;var _0x2c8ab4=_0x7038[_0x3ac45a];return _0x2c8ab4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8703('0x0'))(_0x8703('0x1'));var moment=require(_0x8703('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8703('0x3'));var config=require(_0x8703('0x4'));var attributes=require(_0x8703('0x5'));module[_0x8703('0x6')]=function(_0x2f89cb,_0x2a506d){return _0x2f89cb['define'](_0x8703('0x7'),attributes,{'tableName':_0x8703('0x8'),'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 7c498cc..ff9dfb5 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 _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 +var _0xe174=['then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0xe174,0x160));var _0x4e17=function(_0x13e31f,_0x14bbc9){_0x13e31f=_0x13e31f-0x0;var _0x5c3161=_0xe174[_0x13e31f];return _0x5c3161;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4e17('0x0'));var rs=require(_0x4e17('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4e17('0x2'));var logger=require(_0x4e17('0x3'))(_0x4e17('0x4'));var config=require(_0x4e17('0x5'));var jayson=require(_0x4e17('0x6'));var client=jayson[_0x4e17('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f6569,_0x32c3de,_0x553468){return new BPromise(function(_0x204a3b,_0x109b05){return client[_0x4e17('0x8')](_0x3f6569,_0x553468)[_0x4e17('0x9')](function(_0x2b0e45){logger[_0x4e17('0xa')](_0x4e17('0xb'),_0x32c3de,_0x4e17('0xc'));logger['debug'](_0x4e17('0xd'),_0x32c3de,'request\x20sent',JSON[_0x4e17('0xe')](_0x2b0e45));if(_0x2b0e45[_0x4e17('0xf')]){if(_0x2b0e45[_0x4e17('0xf')][_0x4e17('0x10')]===0x1f4){logger[_0x4e17('0xf')](_0x4e17('0xb'),_0x32c3de,_0x2b0e45[_0x4e17('0xf')]['message']);return _0x109b05(_0x2b0e45[_0x4e17('0xf')][_0x4e17('0x11')]);}logger[_0x4e17('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x32c3de,_0x2b0e45[_0x4e17('0xf')][_0x4e17('0x11')]);return _0x204a3b(_0x2b0e45['error'][_0x4e17('0x11')]);}else{logger[_0x4e17('0xa')](_0x4e17('0xb'),_0x32c3de,_0x4e17('0xc'));_0x204a3b(_0x2b0e45[_0x4e17('0x12')][_0x4e17('0x11')]);}})['catch'](function(_0xe23839){logger[_0x4e17('0xf')](_0x4e17('0xb'),_0x32c3de,_0xe23839);_0x109b05(_0xe23839);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 2dd53cc..6725d68 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_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 +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x22071a,_0x4bcf62){var _0x5c6c85=function(_0x4c531b){while(--_0x4c531b){_0x22071a['push'](_0x22071a['shift']());}};_0x5c6c85(++_0x4bcf62);}(_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 diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 96c1f2a..25b5a99 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 _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 +var _0xf1d4=['STRING','sequelize','exports','Required\x20by\x20Asterisk','INTEGER'];(function(_0x446140,_0xd9d626){var _0x4e1f09=function(_0xbc1c95){while(--_0xbc1c95){_0x446140['push'](_0x446140['shift']());}};_0x4e1f09(++_0xd9d626);}(_0xf1d4,0x128));var _0x4f1d=function(_0x433398,_0x38762b){_0x433398=_0x433398-0x0;var _0x456e22=_0xf1d4[_0x433398];return _0x456e22;};'use strict';var Sequelize=require(_0x4f1d('0x0'));module[_0x4f1d('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x4f1d('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x4f1d('0x2')},'UserId':{'type':Sequelize[_0x4f1d('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x4f1d('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x4f1d('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x4f1d('0x4')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x4f1d('0x3')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x4f1d('0x3')](0xb),'defaultValue':0x0,'comment':_0x4f1d('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index a13f93f..5088305 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 _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 +var _0x251b=['exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x2bf10c,_0x567a0c){var _0x24091d=function(_0x2bde04){while(--_0x2bde04){_0x2bf10c['push'](_0x2bf10c['shift']());}};_0x24091d(++_0x567a0c);}(_0x251b,0x1b1));var _0xb251=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0x251b[_0x2053ea];return _0x2232c4;};'use strict';var EventEmitter=require(_0xb251('0x0'));var UserVoiceQueueRt=require(_0xb251('0x1'))['db'][_0xb251('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xb251('0x3')](0x0);var events={'afterCreate':_0xb251('0x4'),'afterUpdate':'update','afterDestroy':_0xb251('0x5')};function emitEvent(_0x4c1fbb){return function(_0x14dde6,_0x44ceab,_0x53f631){UserVoiceQueueRtEvents['emit'](_0x4c1fbb+':'+_0x14dde6['id'],_0x14dde6);UserVoiceQueueRtEvents[_0xb251('0x6')](_0x4c1fbb,_0x14dde6);_0x53f631(null);};}for(var e in events){if(events[_0xb251('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xb251('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 708ca72..a2e03ee 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 _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 +var _0x2369=['path','rimraf','../../config/environment','exports','define','user_has_voice_queues_rt','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x6da2fa,_0x11cc7c){var _0x11d07a=function(_0x38548c){while(--_0x38548c){_0x6da2fa['push'](_0x6da2fa['shift']());}};_0x11d07a(++_0x11cc7c);}(_0x2369,0x1f2));var _0x9236=function(_0xd0abf3,_0x261ded){_0xd0abf3=_0xd0abf3-0x0;var _0x4562d3=_0x2369[_0xd0abf3];return _0x4562d3;};'use strict';var _=require(_0x9236('0x0'));var util=require(_0x9236('0x1'));var logger=require(_0x9236('0x2'))('api');var moment=require(_0x9236('0x3'));var BPromise=require(_0x9236('0x4'));var rp=require(_0x9236('0x5'));var fs=require('fs');var path=require(_0x9236('0x6'));var rimraf=require(_0x9236('0x7'));var config=require(_0x9236('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x9236('0x9')]=function(_0x32a3c0,_0x2703ed){return _0x32a3c0[_0x9236('0xa')]('UserVoiceQueueRt',attributes,{'tableName':_0x9236('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 7316357..178e556 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 _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 +var _0x527b=['rpc','../../config/environment','client','redis','defaults','register','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','catch','moment','bluebird','randomstring','../../mysqldb'];(function(_0x485413,_0x39cff6){var _0x281995=function(_0x32c7e5){while(--_0x32c7e5){_0x485413['push'](_0x485413['shift']());}};_0x281995(++_0x39cff6);}(_0x527b,0xb6));var _0xb527=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x527b[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb527('0x0'));var BPromise=require(_0xb527('0x1'));var rs=require(_0xb527('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb527('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb527('0x4'));var config=require(_0xb527('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb527('0x6')]['http']({'port':0x232a});config[_0xb527('0x7')]=_[_0xb527('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb527('0x7')]));require('./userVoiceQueueRt.socket')[_0xb527('0x9')](socket);function respondWithRpcPromise(_0x3ac3a1,_0xdaab10,_0x371aae){return new BPromise(function(_0x484581,_0x13042d){return client['request'](_0x3ac3a1,_0x371aae)[_0xb527('0xa')](function(_0x48d6f6){logger[_0xb527('0xb')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xdaab10,_0xb527('0xc'));logger[_0xb527('0xd')](_0xb527('0xe'),_0xdaab10,'request\x20sent',JSON['stringify'](_0x48d6f6));if(_0x48d6f6[_0xb527('0xf')]){if(_0x48d6f6[_0xb527('0xf')][_0xb527('0x10')]===0x1f4){logger[_0xb527('0xf')](_0xb527('0x11'),_0xdaab10,_0x48d6f6[_0xb527('0xf')]['message']);return _0x13042d(_0x48d6f6['error'][_0xb527('0x12')]);}logger[_0xb527('0xf')](_0xb527('0x11'),_0xdaab10,_0x48d6f6[_0xb527('0xf')][_0xb527('0x12')]);return _0x484581(_0x48d6f6[_0xb527('0xf')][_0xb527('0x12')]);}else{logger[_0xb527('0xb')](_0xb527('0x11'),_0xdaab10,_0xb527('0xc'));_0x484581(_0x48d6f6[_0xb527('0x13')][_0xb527('0x12')]);}})['catch'](function(_0x2e1bb0){logger['error'](_0xb527('0x11'),_0xdaab10,_0x2e1bb0);_0x13042d(_0x2e1bb0);});});}exports[_0xb527('0x14')]=function(_0xd7075){var _0x30820f=this;return new Promise(function(_0x3f0c3f,_0x30d368){return db[_0xb527('0x15')]['findAll']({'raw':_0xd7075['options']?_0xd7075[_0xb527('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xd7075[_0xb527('0x16')]?_0xd7075['options'][_0xb527('0x17')]||null:null,'attributes':[[db[_0xb527('0x18')]['fn'](_0xb527('0x19'),db[_0xb527('0x18')]['fn']('IF',db[_0xb527('0x18')][_0xb527('0x1a')](_0xb527('0x1b')))),_0xb527('0x1c')]]})['then'](function(_0x433ea8){logger[_0xb527('0xb')](_0xb527('0x14'),_0xd7075);logger[_0xb527('0xd')](_0xb527('0x14'),_0xd7075,JSON[_0xb527('0x1d')](_0x433ea8));_0x3f0c3f(_0x433ea8);})[_0xb527('0x1e')](function(_0x587871){logger[_0xb527('0xf')]('GetVoiceQueueRtPauses',_0x587871[_0xb527('0x12')],_0xd7075);_0x30d368(_0x30820f[_0xb527('0xf')](0x1f4,_0x587871['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 8980a28..de39209 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 _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 +var _0x78b7=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','update','emit'];(function(_0x1040ce,_0x4b41b6){var _0x310f73=function(_0x1a05ac){while(--_0x1a05ac){_0x1040ce['push'](_0x1040ce['shift']());}};_0x310f73(++_0x4b41b6);}(_0x78b7,0x194));var _0x778b=function(_0x4cc60f,_0x475f0a){_0x4cc60f=_0x4cc60f-0x0;var _0x25a0ee=_0x78b7[_0x4cc60f];return _0x25a0ee;};'use strict';var UserVoiceQueueRtEvents=require(_0x778b('0x0'));var events=[_0x778b('0x1'),'remove',_0x778b('0x2')];function createListener(_0x3072bd,_0x422fff){return function(_0x3221de){_0x422fff[_0x778b('0x3')](_0x3072bd,_0x3221de);};}function removeListener(_0x4d298d,_0x4c91f3){return function(){UserVoiceQueueRtEvents[_0x778b('0x4')](_0x4d298d,_0x4c91f3);};}exports[_0x778b('0x5')]=function(_0x11b624){for(var _0xb6f0af=0x0,_0x41ca62=events[_0x778b('0x6')];_0xb6f0af<_0x41ca62;_0xb6f0af++){var _0x49a27a=events[_0xb6f0af];var _0x3fba10=createListener(_0x778b('0x7')+_0x49a27a,_0x11b624);UserVoiceQueueRtEvents['on'](_0x49a27a,_0x3fba10);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 09ac297..ac6cc93 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_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 +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x748fb7,_0x59a9f9){var _0xd74bff=function(_0x4effb2){while(--_0x4effb2){_0x748fb7['push'](_0x748fb7['shift']());}};_0xd74bff(++_0x59a9f9);}(_0xe706,0xa3));var _0x6e70=function(_0x109c40,_0x3463fa){_0x109c40=_0x109c40-0x0;var _0x3d5aed=_0xe706[_0x109c40];return _0x3d5aed;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 2271641..112bb53 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 _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 +var _0x08da=['exports','INTEGER'];(function(_0x39479f,_0x822ae4){var _0x4a6d96=function(_0x55bfba){while(--_0x55bfba){_0x39479f['push'](_0x39479f['shift']());}};_0x4a6d96(++_0x822ae4);}(_0x08da,0x180));var _0xa08d=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x08da[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require('sequelize');module[_0xa08d('0x0')]={'penalty':{'type':Sequelize[_0xa08d('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 81d05a8..080d426 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 _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 +var _0x9da1=['exports','define','UserWhatsappQueue','util','moment','request-promise','rimraf','../../config/environment','./userWhatsappQueue.attributes'];(function(_0x48783c,_0x1f986b){var _0x2ce586=function(_0x38e1bd){while(--_0x38e1bd){_0x48783c['push'](_0x48783c['shift']());}};_0x2ce586(++_0x1f986b);}(_0x9da1,0xc0));var _0x19da=function(_0x4776cc,_0x3a715e){_0x4776cc=_0x4776cc-0x0;var _0x427bda=_0x9da1[_0x4776cc];return _0x427bda;};'use strict';var _=require('lodash');var util=require(_0x19da('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x19da('0x1'));var BPromise=require('bluebird');var rp=require(_0x19da('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x19da('0x3'));var config=require(_0x19da('0x4'));var attributes=require(_0x19da('0x5'));module[_0x19da('0x6')]=function(_0x13faad,_0x23b479){return _0x13faad[_0x19da('0x7')](_0x19da('0x8'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 19f74ca..555148e 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 _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 +var _0x90c0=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x5c5b95,_0x3994b4){var _0x26a867=function(_0x4464ee){while(--_0x4464ee){_0x5c5b95['push'](_0x5c5b95['shift']());}};_0x26a867(++_0x3994b4);}(_0x90c0,0xb7));var _0x090c=function(_0x2f90c0,_0x5d162a){_0x2f90c0=_0x2f90c0-0x0;var _0x2e3552=_0x90c0[_0x2f90c0];return _0x2e3552;};'use strict';var _=require(_0x090c('0x0'));var util=require(_0x090c('0x1'));var moment=require(_0x090c('0x2'));var BPromise=require(_0x090c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x090c('0x4'));var db=require(_0x090c('0x5'))['db'];var utils=require(_0x090c('0x6'));var logger=require('../../config/logger')(_0x090c('0x7'));var config=require(_0x090c('0x8'));var jayson=require(_0x090c('0x9'));var client=jayson[_0x090c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a1931,_0x1253a7,_0x341b01){return new BPromise(function(_0x1d751d,_0x4cbcf1){return client['request'](_0x4a1931,_0x341b01)[_0x090c('0xb')](function(_0x314c4d){logger[_0x090c('0xc')](_0x090c('0xd'),_0x1253a7,_0x090c('0xe'));logger[_0x090c('0xf')](_0x090c('0x10'),_0x1253a7,_0x090c('0xe'),JSON[_0x090c('0x11')](_0x314c4d));if(_0x314c4d[_0x090c('0x12')]){if(_0x314c4d['error'][_0x090c('0x13')]===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x1253a7,_0x314c4d['error']['message']);return _0x4cbcf1(_0x314c4d['error']['message']);}logger[_0x090c('0x12')](_0x090c('0xd'),_0x1253a7,_0x314c4d['error']['message']);return _0x1d751d(_0x314c4d[_0x090c('0x12')][_0x090c('0x14')]);}else{logger[_0x090c('0xc')](_0x090c('0xd'),_0x1253a7,_0x090c('0xe'));_0x1d751d(_0x314c4d[_0x090c('0x15')]['message']);}})[_0x090c('0x16')](function(_0x58456a){logger[_0x090c('0x12')](_0x090c('0xd'),_0x1253a7,_0x58456a);_0x4cbcf1(_0x58456a);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 2c8f8ec..11d8571 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 _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 +var _0xaefc=['index','/:id','post','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x210d7f,_0x2abe4f){var _0x42d687=function(_0x46b2ae){while(--_0x46b2ae){_0x210d7f['push'](_0x210d7f['shift']());}};_0x42d687(++_0x2abe4f);}(_0xaefc,0xc8));var _0xcaef=function(_0x3c4087,_0x5c764b){_0x3c4087=_0x3c4087-0x0;var _0x23ad1f=_0xaefc[_0x3c4087];return _0x23ad1f;};'use strict';var multer=require(_0xcaef('0x0'));var util=require(_0xcaef('0x1'));var path=require(_0xcaef('0x2'));var timeout=require('connect-timeout');var express=require(_0xcaef('0x3'));var router=express[_0xcaef('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcaef('0x5'));var config=require(_0xcaef('0x6'));var controller=require('./variable.controller');router['get']('/',auth[_0xcaef('0x7')](),controller[_0xcaef('0x8')]);router['get'](_0xcaef('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xcaef('0xa')]('/',auth[_0xcaef('0x7')](),controller['create']);router[_0xcaef('0xb')](_0xcaef('0x9'),auth['isAuthenticated'](),controller[_0xcaef('0xc')]);router[_0xcaef('0xd')](_0xcaef('0x9'),auth[_0xcaef('0x7')](),controller[_0xcaef('0xe')]);module[_0xcaef('0xf')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 1253a7a..ef15fa7 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 _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 +var _0x9e42=['STRING','exports'];(function(_0x185cde,_0x16f3d3){var _0x15ebad=function(_0x1ba19d){while(--_0x1ba19d){_0x185cde['push'](_0x185cde['shift']());}};_0x15ebad(++_0x16f3d3);}(_0x9e42,0x157));var _0x29e4=function(_0x631a3c,_0x1b61b6){_0x631a3c=_0x631a3c-0x0;var _0x2bdfa3=_0x9e42[_0x631a3c];return _0x2bdfa3;};'use strict';var Sequelize=require('sequelize');module[_0x29e4('0x0')]={'name':{'type':Sequelize[_0x29e4('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x29e4('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index a969792..2dff58b 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 _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 +var _0x2f3c=['findAll','catch','show','keys','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','UserProfileResource','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','Variables','error','name','send','index','map','Variable','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include'];(function(_0x26a293,_0x198770){var _0x4d0bd6=function(_0x38f289){while(--_0x38f289){_0x26a293['push'](_0x26a293['shift']());}};_0x4d0bd6(++_0x198770);}(_0x2f3c,0xfd));var _0xc2f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f3c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc2f3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc2f3('0x1'));var jsonpatch=require(_0xc2f3('0x2'));var rp=require(_0xc2f3('0x3'));var moment=require(_0xc2f3('0x4'));var BPromise=require(_0xc2f3('0x5'));var Mustache=require(_0xc2f3('0x6'));var util=require(_0xc2f3('0x7'));var path=require('path');var sox=require(_0xc2f3('0x8'));var csv=require(_0xc2f3('0x9'));var ejs=require(_0xc2f3('0xa'));var fs=require('fs');var fs_extra=require(_0xc2f3('0xb'));var _=require(_0xc2f3('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc2f3('0xd'));var toCsv=require(_0xc2f3('0x9'));var querystring=require('querystring');var Papa=require(_0xc2f3('0xe'));var Redis=require(_0xc2f3('0xf'));var authService=require(_0xc2f3('0x10'));var qs=require(_0xc2f3('0x11'));var as=require(_0xc2f3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc2f3('0x13'))(_0xc2f3('0x14'));var utils=require(_0xc2f3('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc2f3('0x16'))['db'];function respondWithStatusCode(_0x3f87a7,_0x3ae32c){_0x3ae32c=_0x3ae32c||0xcc;return function(_0xdc7dcb){if(_0xdc7dcb){return _0x3f87a7[_0xc2f3('0x17')](_0x3ae32c);}return _0x3f87a7['status'](_0x3ae32c)[_0xc2f3('0x18')]();};}function respondWithResult(_0x1791df,_0x2d9b87){_0x2d9b87=_0x2d9b87||0xc8;return function(_0x45e531){if(_0x45e531){return _0x1791df[_0xc2f3('0x19')](_0x2d9b87)[_0xc2f3('0x1a')](_0x45e531);}};}function respondWithFilteredResult(_0x579ddc,_0x27f088){return function(_0xa3c358){if(_0xa3c358){var _0xe291b=typeof _0x27f088[_0xc2f3('0x1b')]===_0xc2f3('0x1c')&&typeof _0x27f088[_0xc2f3('0x1d')]===_0xc2f3('0x1c');var _0x100193=_0xa3c358['count'];var _0x59d3ee=_0xe291b?0x0:_0x27f088[_0xc2f3('0x1b')];var _0x1c36f7=_0xe291b?_0xa3c358[_0xc2f3('0x1e')]:_0x27f088[_0xc2f3('0x1b')]+_0x27f088['limit'];var _0x26931e;if(_0x1c36f7>=_0x100193){_0x1c36f7=_0x100193;_0x26931e=0xc8;}else{_0x26931e=0xce;}_0x579ddc[_0xc2f3('0x19')](_0x26931e);return _0x579ddc['set'](_0xc2f3('0x1f'),_0x59d3ee+'-'+_0x1c36f7+'/'+_0x100193)[_0xc2f3('0x1a')](_0xa3c358);}return null;};}function patchUpdates(_0x530cf4){return function(_0xa91b30){try{jsonpatch['apply'](_0xa91b30,_0x530cf4,!![]);}catch(_0x5de9da){return BPromise[_0xc2f3('0x20')](_0x5de9da);}return _0xa91b30['save']();};}function saveUpdates(_0x3b0096,_0x244bbf){return function(_0xb47180){if(_0xb47180){return _0xb47180[_0xc2f3('0x21')](_0x3b0096)[_0xc2f3('0x22')](function(_0x5d877e){return _0x5d877e;});}return null;};}function removeEntity(_0x46b57f,_0xdc6361){return function(_0x5b5eb0){if(_0x5b5eb0){return _0x5b5eb0[_0xc2f3('0x23')]()[_0xc2f3('0x22')](function(){var _0xbbcf59=_0x5b5eb0['get']({'plain':!![]});var _0x26aee9=_0xc2f3('0x24');return db['UserProfileResource'][_0xc2f3('0x23')]({'where':{'type':_0x26aee9,'resourceId':_0xbbcf59['id']}})['then'](function(){return _0x5b5eb0;});})[_0xc2f3('0x22')](function(){_0x46b57f[_0xc2f3('0x19')](0xcc)[_0xc2f3('0x18')]();});}};}function handleEntityNotFound(_0xa7b71f,_0x215f96){return function(_0x108b76){if(!_0x108b76){_0xa7b71f['sendStatus'](0x194);}return _0x108b76;};}function handleError(_0x3b18b8,_0x42eacb){_0x42eacb=_0x42eacb||0x1f4;return function(_0x3d76e6){logger[_0xc2f3('0x25')](_0x3d76e6['stack']);if(_0x3d76e6[_0xc2f3('0x26')]){delete _0x3d76e6[_0xc2f3('0x26')];}_0x3b18b8['status'](_0x42eacb)[_0xc2f3('0x27')](_0x3d76e6);};}exports[_0xc2f3('0x28')]=function(_0x13b305,_0x47c85c){var _0x129b6a={},_0x4ab57b={},_0x18d606={'count':0x0,'rows':[]};var _0x3bda5f=_[_0xc2f3('0x29')](db[_0xc2f3('0x2a')]['rawAttributes'],function(_0x239f05){return{'name':_0x239f05[_0xc2f3('0x2b')],'type':_0x239f05[_0xc2f3('0x2c')][_0xc2f3('0x2d')]};});_0x4ab57b[_0xc2f3('0x2e')]=_['map'](_0x3bda5f,'name');_0x4ab57b[_0xc2f3('0x2f')]=_['keys'](_0x13b305['query']);_0x4ab57b[_0xc2f3('0x30')]=_[_0xc2f3('0x31')](_0x4ab57b[_0xc2f3('0x2e')],_0x4ab57b[_0xc2f3('0x2f')]);_0x129b6a[_0xc2f3('0x32')]=_[_0xc2f3('0x31')](_0x4ab57b[_0xc2f3('0x2e')],qs[_0xc2f3('0x33')](_0x13b305[_0xc2f3('0x2f')][_0xc2f3('0x33')]));_0x129b6a[_0xc2f3('0x32')]=_0x129b6a[_0xc2f3('0x32')][_0xc2f3('0x34')]?_0x129b6a['attributes']:_0x4ab57b[_0xc2f3('0x2e')];if(!_0x13b305[_0xc2f3('0x2f')][_0xc2f3('0x35')](_0xc2f3('0x36'))){_0x129b6a['limit']=qs[_0xc2f3('0x1d')](_0x13b305['query'][_0xc2f3('0x1d')]);_0x129b6a[_0xc2f3('0x1b')]=qs['offset'](_0x13b305['query']['offset']);}_0x129b6a[_0xc2f3('0x37')]=qs['sort'](_0x13b305[_0xc2f3('0x2f')][_0xc2f3('0x38')]);_0x129b6a[_0xc2f3('0x39')]=qs[_0xc2f3('0x30')](_[_0xc2f3('0x3a')](_0x13b305[_0xc2f3('0x2f')],_0x4ab57b[_0xc2f3('0x30')]),_0x3bda5f);if(_0x13b305[_0xc2f3('0x2f')]['filter']){_0x129b6a[_0xc2f3('0x39')]=_['merge'](_0x129b6a['where'],{'$or':_[_0xc2f3('0x29')](_0x3bda5f,function(_0x5d5bec){if(_0x5d5bec['type']!=='VIRTUAL'){var _0x4414fb={};_0x4414fb[_0x5d5bec['name']]={'$like':'%'+_0x13b305[_0xc2f3('0x2f')][_0xc2f3('0x3b')]+'%'};return _0x4414fb;}})});}_0x129b6a=_[_0xc2f3('0x3c')]({},_0x129b6a,_0x13b305[_0xc2f3('0x3d')]);var _0x2d479a={'where':_0x129b6a['where']};return db[_0xc2f3('0x2a')][_0xc2f3('0x1e')](_0x2d479a)[_0xc2f3('0x22')](function(_0x207fc3){_0x18d606[_0xc2f3('0x1e')]=_0x207fc3;if(_0x13b305['query']['includeAll']){_0x129b6a[_0xc2f3('0x3e')]=[{'all':!![]}];}return db[_0xc2f3('0x2a')][_0xc2f3('0x3f')](_0x129b6a);})['then'](function(_0x43c880){_0x18d606['rows']=_0x43c880;return _0x18d606;})[_0xc2f3('0x22')](respondWithFilteredResult(_0x47c85c,_0x129b6a))[_0xc2f3('0x40')](handleError(_0x47c85c,null));};exports[_0xc2f3('0x41')]=function(_0x1ae088,_0x418ef6){var _0x8e707b={'raw':!![],'where':{'id':_0x1ae088['params']['id']}},_0x139851={};_0x139851['model']=_[_0xc2f3('0x42')](db[_0xc2f3('0x2a')]['rawAttributes']);_0x139851['query']=_[_0xc2f3('0x42')](_0x1ae088[_0xc2f3('0x2f')]);_0x139851[_0xc2f3('0x30')]=_[_0xc2f3('0x31')](_0x139851['model'],_0x139851[_0xc2f3('0x2f')]);_0x8e707b[_0xc2f3('0x32')]=_[_0xc2f3('0x31')](_0x139851[_0xc2f3('0x2e')],qs[_0xc2f3('0x33')](_0x1ae088[_0xc2f3('0x2f')]['fields']));_0x8e707b[_0xc2f3('0x32')]=_0x8e707b['attributes'][_0xc2f3('0x34')]?_0x8e707b[_0xc2f3('0x32')]:_0x139851[_0xc2f3('0x2e')];if(_0x1ae088['query'][_0xc2f3('0x43')]){_0x8e707b[_0xc2f3('0x3e')]=[{'all':!![]}];}_0x8e707b=_[_0xc2f3('0x3c')]({},_0x8e707b,_0x1ae088[_0xc2f3('0x3d')]);return db[_0xc2f3('0x2a')]['find'](_0x8e707b)['then'](handleEntityNotFound(_0x418ef6,null))['then'](respondWithResult(_0x418ef6,null))['catch'](handleError(_0x418ef6,null));};exports['create']=function(_0x528224,_0x17404e){return db[_0xc2f3('0x2a')][_0xc2f3('0x44')](_0x528224[_0xc2f3('0x45')],{})[_0xc2f3('0x22')](function(_0x114c3c){var _0xc82ce4=_0x528224[_0xc2f3('0x46')][_0xc2f3('0x47')]({'plain':!![]});if(!_0xc82ce4)throw new Error(_0xc2f3('0x48'));if(_0xc82ce4[_0xc2f3('0x49')]===_0xc2f3('0x46')){var _0x57e859=_0x114c3c[_0xc2f3('0x47')]({'plain':!![]});var _0x5450ce=_0xc2f3('0x24');return db['UserProfileSection'][_0xc2f3('0x4a')]({'where':{'name':_0x5450ce,'userProfileId':_0xc82ce4[_0xc2f3('0x4b')]},'raw':!![]})['then'](function(_0x24cd9a){if(_0x24cd9a&&_0x24cd9a[_0xc2f3('0x4c')]===0x0){return db[_0xc2f3('0x4d')]['create']({'name':_0x57e859[_0xc2f3('0x26')],'resourceId':_0x57e859['id'],'type':_0x24cd9a['name'],'sectionId':_0x24cd9a['id']},{})[_0xc2f3('0x22')](function(){return _0x114c3c;});}else{return _0x114c3c;}})['catch'](function(_0x3cdaba){logger[_0xc2f3('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3cdaba);throw _0x3cdaba;});}return _0x114c3c;})['then'](respondWithResult(_0x17404e,0xc9))[_0xc2f3('0x40')](handleError(_0x17404e,null));};exports[_0xc2f3('0x21')]=function(_0x40cd74,_0x4d4b20){if(_0x40cd74[_0xc2f3('0x45')]['id']){delete _0x40cd74[_0xc2f3('0x45')]['id'];}return db[_0xc2f3('0x2a')][_0xc2f3('0x4a')]({'where':{'id':_0x40cd74['params']['id']}})[_0xc2f3('0x22')](handleEntityNotFound(_0x4d4b20,null))[_0xc2f3('0x22')](saveUpdates(_0x40cd74['body'],null))['then'](respondWithResult(_0x4d4b20,null))[_0xc2f3('0x40')](handleError(_0x4d4b20,null));};exports['destroy']=function(_0x6b7619,_0xcdd50){return db['Variable']['find']({'where':{'id':_0x6b7619[_0xc2f3('0x4e')]['id']}})[_0xc2f3('0x22')](handleEntityNotFound(_0xcdd50,null))[_0xc2f3('0x22')](removeEntity(_0xcdd50,null))[_0xc2f3('0x40')](handleError(_0xcdd50,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 9e21c0e..92a42fe 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 _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 +var _0x41f8=['bluebird','path','rimraf','../../config/environment','./variable.attributes','define','Variable','tools_variables','lodash','../../config/logger','api'];(function(_0x269149,_0x7d2d30){var _0x163361=function(_0x485640){while(--_0x485640){_0x269149['push'](_0x269149['shift']());}};_0x163361(++_0x7d2d30);}(_0x41f8,0x13c));var _0x841f=function(_0x46bf87,_0x2e6dbd){_0x46bf87=_0x46bf87-0x0;var _0x2e6d6e=_0x41f8[_0x46bf87];return _0x2e6d6e;};'use strict';var _=require(_0x841f('0x0'));var util=require('util');var logger=require(_0x841f('0x1'))(_0x841f('0x2'));var moment=require('moment');var BPromise=require(_0x841f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x841f('0x4'));var rimraf=require(_0x841f('0x5'));var config=require(_0x841f('0x6'));var attributes=require(_0x841f('0x7'));module['exports']=function(_0x2ae460,_0x12e4b4){return _0x2ae460[_0x841f('0x8')](_0x841f('0x9'),attributes,{'tableName':_0x841f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index d78bc62..bbeef74 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 _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 +var _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x2111a8,_0x14dc89){var _0xe20384=function(_0x5992ab){while(--_0x5992ab){_0x2111a8['push'](_0x2111a8['shift']());}};_0xe20384(++_0x14dc89);}(_0x6aa7,0x178));var _0x76aa=function(_0x3b3a99,_0x3d4087){_0x3b3a99=_0x3b3a99-0x0;var _0x17f049=_0x6aa7[_0x3b3a99];return _0x17f049;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 3edd2d9..8bffbbd 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 _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 +var _0x5fad=['canUpdate','fetch','isAuthenticated','reset','pull','/restart','restart','/migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch'];(function(_0x32efb5,_0x1b6f42){var _0x5b644c=function(_0x44e59b){while(--_0x44e59b){_0x32efb5['push'](_0x32efb5['shift']());}};_0x5b644c(++_0x1b6f42);}(_0x5fad,0x1e9));var _0xd5fa=function(_0x34f930,_0x597cb0){_0x34f930=_0x34f930-0x0;var _0x55b287=_0x5fad[_0x34f930];return _0x55b287;};'use strict';var express=require(_0xd5fa('0x0'));var router=express[_0xd5fa('0x1')]();var auth=require(_0xd5fa('0x2'));var controller=require(_0xd5fa('0x3'));router[_0xd5fa('0x4')]('/',controller[_0xd5fa('0x5')]);router[_0xd5fa('0x4')](_0xd5fa('0x6'),auth['isAuthenticated'](),auth[_0xd5fa('0x7')](),controller[_0xd5fa('0x8')]);router[_0xd5fa('0x4')]('/reset',auth[_0xd5fa('0x9')](),auth[_0xd5fa('0x7')](),controller[_0xd5fa('0xa')]);router[_0xd5fa('0x4')]('/pull',auth[_0xd5fa('0x9')](),auth['canUpdate'](),controller[_0xd5fa('0xb')]);router['get'](_0xd5fa('0xc'),auth[_0xd5fa('0x9')](),controller[_0xd5fa('0xd')]);router['get'](_0xd5fa('0xe'),controller['migrations']);module[_0xd5fa('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 5f86e90..9015ac2 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 _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 +var _0x569c=['simple-git','exports','query','latest','2.0.0','status','fetch','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','git\x20reset\x20--hard\x20FETCH_HEAD','json','git\x20reset\x20--hard','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','root','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','\x20to\x20','last','join','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update'];(function(_0x53b55f,_0x7980d0){var _0x71d9fa=function(_0x1c30c2){while(--_0x1c30c2){_0x53b55f['push'](_0x53b55f['shift']());}};_0x71d9fa(++_0x7980d0);}(_0x569c,0x133));var _0xc569=function(_0x129fcf,_0x60afbb){_0x129fcf=_0x129fcf-0x0;var _0x23a6d0=_0x569c[_0x129fcf];return _0x23a6d0;};'use strict';var Umzug=require(_0xc569('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xc569('0x1'));var pkginfo=require(_0xc569('0x2'))(module,_0xc569('0x3'));var compareVersions=require(_0xc569('0x4'));var exec=require(_0xc569('0x5'))[_0xc569('0x6')];var db=require(_0xc569('0x7'))['db'];var config=require(_0xc569('0x8'));var pm2=require('../../config/pm2');var logger=require(_0xc569('0x9'))(_0xc569('0xa'));var git=require(_0xc569('0xb'))(config['root']);exports['index']=function(_0x38bb3a,_0x1c39ca){var _0x4906b4={'current':module[_0xc569('0xc')]['version'],'phonebar':0x2};if(_0x38bb3a[_0xc569('0xd')]&&_0x38bb3a[_0xc569('0xd')][_0xc569('0xe')]){return git['fetch']()['tags'](function(_0x1a2311,_0x54bdb7){_0x4906b4[_0xc569('0xe')]=(_0x1a2311?module[_0xc569('0xc')][_0xc569('0x3')]:_0x54bdb7[_0xc569('0xe')])||_0xc569('0xf');return _0x1c39ca[_0xc569('0x10')](0xc8)['json'](_0x4906b4);});}else{return _0x1c39ca['status'](0xc8)['json'](_0x4906b4);}};exports[_0xc569('0x11')]=function(_0x2581f1,_0x51f92b){return git[_0xc569('0x11')]([_0xc569('0x12'),'master'],function(_0x1cf836){if(_0x1cf836){logger[_0xc569('0x13')](_0x1cf836);return _0x51f92b[_0xc569('0x10')](0x1f4)['json'](_0x1cf836);}logger[_0xc569('0x14')](_0xc569('0x15'));return _0x51f92b[_0xc569('0x10')](0xc8)['json']({'output':_0xc569('0x16')});});};exports[_0xc569('0x17')]=function(_0x51cf53,_0x42712b){return git[_0xc569('0x17')](['--hard','FETCH_HEAD'],function(_0x1a692f){if(_0x1a692f){logger['error'](_0x1a692f);return _0x42712b[_0xc569('0x10')](0x1f4)['json'](_0x1a692f);}logger[_0xc569('0x14')](_0xc569('0x18'));return _0x42712b['status'](0xc8)[_0xc569('0x19')]({'output':_0xc569('0x1a')});});};exports['pull']=function(_0x5198fc,_0x189be7){exec('npm\x20install\x20--production',function(_0x222a9b,_0x40fb56,_0x4e7433){logger[_0xc569('0x14')](_0x40fb56);logger[_0xc569('0x14')](_0x4e7433);if(_0x222a9b){logger[_0xc569('0x13')](_0x222a9b);return _0x189be7[_0xc569('0x10')](0x1f4)['json'](_0x222a9b);}return _0x189be7[_0xc569('0x10')](0xc8)['json']({'output':_0x40fb56});});};exports['restart']=function(_0x31aa22,_0x4fa3c4){return pm2[_0xc569('0x1b')](_0xc569('0x1c'))['then'](function(_0x2cf1d7){logger[_0xc569('0x14')](_0xc569('0x1d'),_0x2cf1d7);return _0x4fa3c4[_0xc569('0x10')](0xc8)['json']({'output':_0xc569('0x1e')});})['catch'](function(_0x4cf2fb){logger[_0xc569('0x13')](_0x4cf2fb);return _0x4fa3c4['status'](0x1f4)[_0xc569('0x19')](_0x4cf2fb);});};exports[_0xc569('0x1f')]=function(_0x393691,_0x1fd2a0){var _0x4501b2=fs[_0xc569('0x20')](path['join'](config[_0xc569('0x21')],_0xc569('0x22'),_0xc569('0x1f')));var _0x28e276=[];for(var _0x17510c=0x0;_0x17510c<_0x4501b2[_0xc569('0x23')];_0x17510c++){var _0x3af554=_0x4501b2[_0x17510c][_0xc569('0x24')](_0xc569('0x25'),'');if(compareVersions(module['exports'][_0xc569('0x3')],_0x3af554)===-0x1){_0x28e276[_0xc569('0x26')](_0x3af554);}}if(_0x28e276[_0xc569('0x23')]){var _0x4603e6=_0x28e276[_0xc569('0x27')](compareVersions);var _0x3477c=new Umzug({'storage':_0xc569('0x28'),'storageOptions':{'model':db[_0xc569('0x29')],'modelName':'Migration','columnName':_0xc569('0x3')},'migrations':{'params':[db[_0xc569('0x28')][_0xc569('0x2a')](),db[_0xc569('0x28')][_0xc569('0x2b')],function(){throw new Error(_0xc569('0x2c'));}],'path':path['join'](config['root'],_0xc569('0x22'),_0xc569('0x1f')),'pattern':/\.js$/}});_0x3477c['up']({'migrations':_[_0xc569('0x2d')](_0x4603e6,function(_0x38f440){return _0x38f440+_0xc569('0x25');})})[_0xc569('0x2e')](function(){return _0x1fd2a0['status'](0xc8)[_0xc569('0x19')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xc569('0xc')]['version']+_0xc569('0x2f')+_[_0xc569('0x30')](_0x4603e6),'migrations':_[_0xc569('0x31')](_0x4603e6)});})[_0xc569('0x32')](function(_0x4f8ed4){if(_0x4f8ed4 instanceof db[_0xc569('0x28')][_0xc569('0x33')]){return _0x1fd2a0['status'](0xc8)[_0xc569('0x19')]({'output':_0xc569('0x34')});}else{return _0x1fd2a0[_0xc569('0x10')](0x1f4)[_0xc569('0x19')](_0x4f8ed4);}});}else{return _0x1fd2a0[_0xc569('0x10')](0xc8)[_0xc569('0x19')]({'output':_0xc569('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 2317fe0..d3404e5 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 _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 +var _0x1e94=['../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1e94,0x64));var _0x41e9=function(_0x36dc04,_0x77c234){_0x36dc04=_0x36dc04-0x0;var _0x43d207=_0x1e94[_0x36dc04];return _0x43d207;};'use strict';var multer=require(_0x41e9('0x0'));var util=require('util');var path=require(_0x41e9('0x1'));var timeout=require(_0x41e9('0x2'));var express=require(_0x41e9('0x3'));var router=express[_0x41e9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x41e9('0x5'));var interaction=require(_0x41e9('0x6'));var config=require('../../config/environment');var controller=require(_0x41e9('0x7'));router[_0x41e9('0x8')]('/',auth['isAuthenticated'](),controller[_0x41e9('0x9')]);router[_0x41e9('0x8')](_0x41e9('0xa'),auth['isAuthenticated'](),controller[_0x41e9('0xb')]);router[_0x41e9('0x8')](_0x41e9('0xc'),auth[_0x41e9('0xd')](),controller[_0x41e9('0xe')]);router[_0x41e9('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x41e9('0x10')](_0x41e9('0xc'),auth['isAuthenticated'](),controller[_0x41e9('0x11')]);router[_0x41e9('0x12')](_0x41e9('0xc'),auth[_0x41e9('0xd')](),controller[_0x41e9('0x13')]);module[_0x41e9('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index d4d1c4e..a495ac7 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 _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 +var _0xfef3=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING'];(function(_0x356121,_0x9c3f35){var _0x5d5117=function(_0x6b4349){while(--_0x6b4349){_0x356121['push'](_0x356121['shift']());}};_0x5d5117(++_0x9c3f35);}(_0xfef3,0x118));var _0x3fef=function(_0x3d87c9,_0x19cedd){_0x3d87c9=_0x3d87c9-0x0;var _0x43d3f0=_0xfef3[_0x3d87c9];return _0x43d3f0;};'use strict';var Sequelize=require(_0x3fef('0x0'));module['exports']={'type':{'type':Sequelize[_0x3fef('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3fef('0x1')]},'calleridname':{'type':Sequelize[_0x3fef('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x3fef('0x1')]},'membername':{'type':Sequelize[_0x3fef('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x3fef('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x3fef('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x3fef('0x2')]},'holdtime':{'type':Sequelize[_0x3fef('0x3')]},'agentcomplete':{'type':Sequelize[_0x3fef('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x3fef('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x3fef('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x3fef('0x3')]},'agentacw':{'type':Sequelize[_0x3fef('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x3fef('0x3')]},'reason':{'type':Sequelize[_0x3fef('0x1')]},'lastevent':{'type':Sequelize[_0x3fef('0x1')]},'channel':{'type':Sequelize[_0x3fef('0x1')]},'channelstate':{'type':Sequelize[_0x3fef('0x3')]},'channelstatedesc':{'type':Sequelize[_0x3fef('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3fef('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x3fef('0x1')]},'accountcode':{'type':Sequelize[_0x3fef('0x1')]},'context':{'type':Sequelize[_0x3fef('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x3fef('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x3fef('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x3fef('0x1')]},'destcalleridnum':{'type':Sequelize[_0x3fef('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x3fef('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x3fef('0x1')]},'destaccountcode':{'type':Sequelize[_0x3fef('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x3fef('0x1')]},'destpriority':{'type':Sequelize[_0x3fef('0x1')]},'destuniqueid':{'type':Sequelize[_0x3fef('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x3fef('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x3fef('0x1')]},'transfer':{'type':Sequelize[_0x3fef('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x3fef('0x5')},'transferexten':{'type':Sequelize[_0x3fef('0x1')]},'transferuniqueid':{'type':Sequelize[_0x3fef('0x1')]},'agententerreason':{'type':Sequelize[_0x3fef('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 9ae17e4..e87de4f 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(_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 +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(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 5f6dc28..8085ecc 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 _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 +var _0x6bdc=['define','VoiceAgentReport','report_agent','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x476a7e,_0x1c2720){var _0x1be744=function(_0x3b5485){while(--_0x3b5485){_0x476a7e['push'](_0x476a7e['shift']());}};_0x1be744(++_0x1c2720);}(_0x6bdc,0x14e));var _0xc6bd=function(_0x359cd8,_0x16a552){_0x359cd8=_0x359cd8-0x0;var _0x342065=_0x6bdc[_0x359cd8];return _0x342065;};'use strict';var _=require(_0xc6bd('0x0'));var util=require(_0xc6bd('0x1'));var logger=require(_0xc6bd('0x2'))(_0xc6bd('0x3'));var moment=require(_0xc6bd('0x4'));var BPromise=require(_0xc6bd('0x5'));var rp=require(_0xc6bd('0x6'));var fs=require('fs');var path=require(_0xc6bd('0x7'));var rimraf=require(_0xc6bd('0x8'));var config=require(_0xc6bd('0x9'));var attributes=require('./voiceAgentReport.attributes');module[_0xc6bd('0xa')]=function(_0x26218a,_0x158271){return _0x26218a[_0xc6bd('0xb')](_0xc6bd('0xc'),attributes,{'tableName':_0xc6bd('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xc6bd('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 0699e71..3376a71 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 _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 +var _0x4cdd=['result','CreateVoiceAgentReport','VoiceAgentReport','body','options','catch','UpdateVoiceAgentReport','update','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x9d8112,_0x4ae0c5){var _0x19269c=function(_0x4d1874){while(--_0x4d1874){_0x9d8112['push'](_0x9d8112['shift']());}};_0x19269c(++_0x4ae0c5);}(_0x4cdd,0x94));var _0xd4cd=function(_0x55cd89,_0x576ff8){_0x55cd89=_0x55cd89-0x0;var _0x4eef01=_0x4cdd[_0x55cd89];return _0x4eef01;};'use strict';var _=require(_0xd4cd('0x0'));var util=require(_0xd4cd('0x1'));var moment=require(_0xd4cd('0x2'));var BPromise=require(_0xd4cd('0x3'));var rs=require(_0xd4cd('0x4'));var fs=require('fs');var Redis=require(_0xd4cd('0x5'));var db=require(_0xd4cd('0x6'))['db'];var utils=require(_0xd4cd('0x7'));var logger=require(_0xd4cd('0x8'))(_0xd4cd('0x9'));var config=require(_0xd4cd('0xa'));var jayson=require(_0xd4cd('0xb'));var client=jayson['client'][_0xd4cd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x477d4a,_0x39f2e1,_0x45030a){return new BPromise(function(_0x583a3f,_0x55ab48){return client[_0xd4cd('0xd')](_0x477d4a,_0x45030a)[_0xd4cd('0xe')](function(_0x335bd6){logger[_0xd4cd('0xf')](_0xd4cd('0x10'),_0x39f2e1,_0xd4cd('0x11'));logger['debug'](_0xd4cd('0x12'),_0x39f2e1,'request\x20sent',JSON[_0xd4cd('0x13')](_0x335bd6));if(_0x335bd6['error']){if(_0x335bd6['error']['code']===0x1f4){logger[_0xd4cd('0x14')](_0xd4cd('0x10'),_0x39f2e1,_0x335bd6[_0xd4cd('0x14')][_0xd4cd('0x15')]);return _0x55ab48(_0x335bd6['error'][_0xd4cd('0x15')]);}logger['error'](_0xd4cd('0x10'),_0x39f2e1,_0x335bd6['error'][_0xd4cd('0x15')]);return _0x583a3f(_0x335bd6[_0xd4cd('0x14')][_0xd4cd('0x15')]);}else{logger['info'](_0xd4cd('0x10'),_0x39f2e1,_0xd4cd('0x11'));_0x583a3f(_0x335bd6[_0xd4cd('0x16')][_0xd4cd('0x15')]);}})['catch'](function(_0x2a6b59){logger[_0xd4cd('0x14')](_0xd4cd('0x10'),_0x39f2e1,_0x2a6b59);_0x55ab48(_0x2a6b59);});});}exports[_0xd4cd('0x17')]=function(_0x3dbd5b){var _0x22137f=this;return new Promise(function(_0x39e126,_0x43d2cf){return db[_0xd4cd('0x18')]['create'](_0x3dbd5b[_0xd4cd('0x19')],{'raw':_0x3dbd5b[_0xd4cd('0x1a')]?_0x3dbd5b[_0xd4cd('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3aed7f){logger[_0xd4cd('0xf')](_0xd4cd('0x17'),_0x3dbd5b);logger['debug'](_0xd4cd('0x17'),_0x3dbd5b,JSON[_0xd4cd('0x13')](_0x3aed7f));_0x39e126(_0x3aed7f);})[_0xd4cd('0x1b')](function(_0x215b50){logger['error'](_0xd4cd('0x17'),_0x215b50[_0xd4cd('0x15')],_0x3dbd5b);_0x43d2cf(_0x22137f['error'](0x1f4,_0x215b50['message']));});});};exports[_0xd4cd('0x1c')]=function(_0x5e615e){var _0x5ee8f1=this;return new Promise(function(_0x23c3a8,_0x3654a4){return db[_0xd4cd('0x18')][_0xd4cd('0x1d')](_0x5e615e['body'],{'raw':_0x5e615e[_0xd4cd('0x1a')]?_0x5e615e[_0xd4cd('0x1a')][_0xd4cd('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e615e[_0xd4cd('0x1a')]?_0x5e615e['options'][_0xd4cd('0x1f')]||null:null,'attributes':_0x5e615e[_0xd4cd('0x1a')]?_0x5e615e[_0xd4cd('0x1a')][_0xd4cd('0x20')]||null:null,'limit':_0x5e615e[_0xd4cd('0x1a')]?_0x5e615e[_0xd4cd('0x1a')][_0xd4cd('0x21')]||null:null})[_0xd4cd('0xe')](function(_0x4ca2c6){logger['info'](_0xd4cd('0x1c'),_0x5e615e);logger['debug'](_0xd4cd('0x1c'),_0x5e615e,JSON[_0xd4cd('0x13')](_0x4ca2c6));_0x23c3a8(_0x4ca2c6);})['catch'](function(_0xb9e186){logger[_0xd4cd('0x14')](_0xd4cd('0x1c'),_0xb9e186[_0xd4cd('0x15')],_0x5e615e);_0x3654a4(_0x5ee8f1[_0xd4cd('0x14')](0x1f4,_0xb9e186['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 2a4d63c..8b06f72 100644 --- a/server/api/voiceCallReport/index.js +++ b/server/api/voiceCallReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bc3=['post','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_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 +var _0xdb94=['/describe','/:id','show','post','create','put','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','isAuthenticated','index','get'];(function(_0x3e0feb,_0x30e912){var _0x7e64b1=function(_0x35162c){while(--_0x35162c){_0x3e0feb['push'](_0x3e0feb['shift']());}};_0x7e64b1(++_0x30e912);}(_0xdb94,0xe5));var _0x4db9=function(_0x3430d0,_0x4d9156){_0x3430d0=_0x3430d0-0x0;var _0x39a41e=_0xdb94[_0x3430d0];return _0x39a41e;};'use strict';var multer=require('multer');var util=require(_0x4db9('0x0'));var path=require(_0x4db9('0x1'));var timeout=require('connect-timeout');var express=require(_0x4db9('0x2'));var router=express[_0x4db9('0x3')]();var fs_extra=require(_0x4db9('0x4'));var auth=require(_0x4db9('0x5'));var interaction=require(_0x4db9('0x6'));var config=require('../../config/environment');var controller=require(_0x4db9('0x7'));router['get']('/',auth[_0x4db9('0x8')](),controller[_0x4db9('0x9')]);router[_0x4db9('0xa')](_0x4db9('0xb'),auth[_0x4db9('0x8')](),controller['describe']);router[_0x4db9('0xa')](_0x4db9('0xc'),auth[_0x4db9('0x8')](),controller[_0x4db9('0xd')]);router[_0x4db9('0xe')]('/',auth['isAuthenticated'](),controller[_0x4db9('0xf')]);router[_0x4db9('0x10')](_0x4db9('0xc'),auth[_0x4db9('0x8')](),controller[_0x4db9('0x11')]);router[_0x4db9('0x12')]('/:id',auth[_0x4db9('0x8')](),controller[_0x4db9('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 6c87c2a..1b64123 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 _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 +var _0x23db=['DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound-fax','dialer','TEXT'];(function(_0x2dbebb,_0x20ee63){var _0x55bc32=function(_0x3e852b){while(--_0x3e852b){_0x2dbebb['push'](_0x2dbebb['shift']());}};_0x55bc32(++_0x20ee63);}(_0x23db,0x141));var _0xb23d=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x23db[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0xb23d('0x0'));module[_0xb23d('0x1')]={'uniqueid':{'type':Sequelize[_0xb23d('0x2')]},'type':{'type':Sequelize[_0xb23d('0x3')](_0xb23d('0x4'),_0xb23d('0x5'),'outbound','inbound-fax',_0xb23d('0x6'),_0xb23d('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb23d('0x2')]},'source':{'type':Sequelize[_0xb23d('0x2')]},'destination':{'type':Sequelize[_0xb23d('0x2')]},'destinationcontext':{'type':Sequelize[_0xb23d('0x2')]},'callerid':{'type':Sequelize[_0xb23d('0x2')]},'channel':{'type':Sequelize[_0xb23d('0x2')]},'destinationchannel':{'type':Sequelize[_0xb23d('0x2')]},'lastapplication':{'type':Sequelize[_0xb23d('0x2')]},'lastdata':{'type':Sequelize[_0xb23d('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xb23d('0x9')]},'answertime':{'type':Sequelize[_0xb23d('0x9')]},'endtime':{'type':Sequelize[_0xb23d('0x9')]},'duration':{'type':Sequelize[_0xb23d('0xa')]},'billableseconds':{'type':Sequelize[_0xb23d('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xb23d('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xb23d('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xb23d('0x2')]},'note':{'type':Sequelize[_0xb23d('0x2')]},'prefix':{'type':Sequelize[_0xb23d('0x2')]},'routeid':{'type':Sequelize[_0xb23d('0xa')]},'sipcallid':{'type':Sequelize[_0xb23d('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index e6610b1..35998ff 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 _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 +var _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x34b9c5,_0x42700f){var _0x10b193=function(_0x14df10){while(--_0x14df10){_0x34b9c5['push'](_0x34b9c5['shift']());}};_0x10b193(++_0x42700f);}(_0x0b0e,0x187));var _0xe0b0=function(_0xdb0cc5,_0x33653a){_0xdb0cc5=_0xdb0cc5-0x0;var _0x153aa=_0x0b0e[_0xdb0cc5];return _0x153aa;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 6ed30a9..b0f13eb 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 _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 +var _0x3e27=['VoiceCallReport','report_call','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceCallReport.attributes','exports','define'];(function(_0x29bd36,_0x328301){var _0x379186=function(_0x531f59){while(--_0x531f59){_0x29bd36['push'](_0x29bd36['shift']());}};_0x379186(++_0x328301);}(_0x3e27,0xed));var _0x73e2=function(_0x2fdc6a,_0x537ea1){_0x2fdc6a=_0x2fdc6a-0x0;var _0xa806a6=_0x3e27[_0x2fdc6a];return _0xa806a6;};'use strict';var _=require('lodash');var util=require(_0x73e2('0x0'));var logger=require(_0x73e2('0x1'))(_0x73e2('0x2'));var moment=require(_0x73e2('0x3'));var BPromise=require(_0x73e2('0x4'));var rp=require(_0x73e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x73e2('0x6'));var config=require('../../config/environment');var attributes=require(_0x73e2('0x7'));module[_0x73e2('0x8')]=function(_0x44cac3,_0x239b7c){return _0x44cac3[_0x73e2('0x9')](_0x73e2('0xa'),attributes,{'tableName':_0x73e2('0xb'),'paranoid':![],'indexes':[{'fields':[_0x73e2('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 b619f38..7e61241 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 _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 +var _0x0a5f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','limit','include','model','attributes','map','stringify','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','where'];(function(_0xfe3bc5,_0x2c8bad){var _0x46686a=function(_0x36338f){while(--_0x36338f){_0xfe3bc5['push'](_0xfe3bc5['shift']());}};_0x46686a(++_0x2c8bad);}(_0x0a5f,0x11f));var _0xf0a5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0a5f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf0a5('0x0'));var util=require(_0xf0a5('0x1'));var moment=require(_0xf0a5('0x2'));var BPromise=require(_0xf0a5('0x3'));var rs=require(_0xf0a5('0x4'));var fs=require('fs');var Redis=require(_0xf0a5('0x5'));var db=require(_0xf0a5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0a5('0x7'))(_0xf0a5('0x8'));var config=require(_0xf0a5('0x9'));var jayson=require(_0xf0a5('0xa'));var client=jayson[_0xf0a5('0xb')][_0xf0a5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11f33b,_0x4bf60b,_0xda087a){return new BPromise(function(_0x365253,_0x4c75fc){return client[_0xf0a5('0xd')](_0x11f33b,_0xda087a)[_0xf0a5('0xe')](function(_0x35c382){logger[_0xf0a5('0xf')](_0xf0a5('0x10'),_0x4bf60b,'request\x20sent');logger[_0xf0a5('0x11')](_0xf0a5('0x12'),_0x4bf60b,_0xf0a5('0x13'),JSON['stringify'](_0x35c382));if(_0x35c382[_0xf0a5('0x14')]){if(_0x35c382[_0xf0a5('0x14')][_0xf0a5('0x15')]===0x1f4){logger[_0xf0a5('0x14')]('VoiceCallReport,\x20%s,\x20%s',_0x4bf60b,_0x35c382[_0xf0a5('0x14')][_0xf0a5('0x16')]);return _0x4c75fc(_0x35c382[_0xf0a5('0x14')][_0xf0a5('0x16')]);}logger[_0xf0a5('0x14')](_0xf0a5('0x10'),_0x4bf60b,_0x35c382[_0xf0a5('0x14')][_0xf0a5('0x16')]);return _0x365253(_0x35c382[_0xf0a5('0x14')][_0xf0a5('0x16')]);}else{logger[_0xf0a5('0xf')](_0xf0a5('0x10'),_0x4bf60b,_0xf0a5('0x13'));_0x365253(_0x35c382['result'][_0xf0a5('0x16')]);}})[_0xf0a5('0x17')](function(_0x529fb9){logger[_0xf0a5('0x14')](_0xf0a5('0x10'),_0x4bf60b,_0x529fb9);_0x4c75fc(_0x529fb9);});});}exports[_0xf0a5('0x18')]=function(_0x4846b0){var _0x253fc7=this;return new Promise(function(_0x4e0f42,_0x942225){return db[_0xf0a5('0x19')][_0xf0a5('0x1a')]({'raw':_0x4846b0[_0xf0a5('0x1b')]?_0x4846b0[_0xf0a5('0x1b')][_0xf0a5('0x1c')]===undefined?!![]:![]:!![],'where':_0x4846b0[_0xf0a5('0x1b')]?_0x4846b0[_0xf0a5('0x1b')]['where']||null:null,'attributes':_0x4846b0[_0xf0a5('0x1b')]?_0x4846b0['options']['attributes']||null:null,'limit':_0x4846b0[_0xf0a5('0x1b')]?_0x4846b0[_0xf0a5('0x1b')][_0xf0a5('0x1d')]||null:null,'include':_0x4846b0['options']?_0x4846b0[_0xf0a5('0x1b')]['include']?_['map'](_0x4846b0[_0xf0a5('0x1b')][_0xf0a5('0x1e')],function(_0x2a3d54){return{'model':db[_0x2a3d54[_0xf0a5('0x1f')]],'as':_0x2a3d54['as'],'attributes':_0x2a3d54[_0xf0a5('0x20')],'include':_0x2a3d54[_0xf0a5('0x1e')]?_[_0xf0a5('0x21')](_0x2a3d54['include'],function(_0x366879){return{'model':db[_0x366879[_0xf0a5('0x1f')]],'as':_0x366879['as'],'attributes':_0x366879[_0xf0a5('0x20')],'include':_0x366879['include']?_['map'](_0x366879['include'],function(_0x12c556){return{'model':db[_0x12c556['model']],'as':_0x12c556['as'],'attributes':_0x12c556[_0xf0a5('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e38d0){logger[_0xf0a5('0xf')]('GetVoiceCallReport',_0x4846b0);logger[_0xf0a5('0x11')](_0xf0a5('0x18'),_0x4846b0,JSON[_0xf0a5('0x22')](_0x3e38d0));_0x4e0f42(_0x3e38d0);})[_0xf0a5('0x17')](function(_0x2c220e){logger[_0xf0a5('0x14')]('GetVoiceCallReport',_0x2c220e[_0xf0a5('0x16')],_0x4846b0);_0x942225(_0x253fc7['error'](0x1f4,_0x2c220e[_0xf0a5('0x16')]));});});};exports[_0xf0a5('0x23')]=function(_0x3bc1d3){var _0x159220=this;return new Promise(function(_0x3e3e2d,_0x28f6a8){return db[_0xf0a5('0x19')][_0xf0a5('0x24')](_0x3bc1d3[_0xf0a5('0x25')],{'raw':_0x3bc1d3['options']?_0x3bc1d3[_0xf0a5('0x1b')][_0xf0a5('0x1c')]===undefined?!![]:![]:!![]})[_0xf0a5('0xe')](function(_0x3cdd89){logger['info'](_0xf0a5('0x23'),_0x3bc1d3);logger['debug']('CreateVoiceCallReport',_0x3bc1d3,JSON[_0xf0a5('0x22')](_0x3cdd89));_0x3e3e2d(_0x3cdd89);})[_0xf0a5('0x17')](function(_0x54d3c9){logger['error'](_0xf0a5('0x23'),_0x54d3c9[_0xf0a5('0x16')],_0x3bc1d3);_0x28f6a8(_0x159220[_0xf0a5('0x14')](0x1f4,_0x54d3c9[_0xf0a5('0x16')]));});});};exports[_0xf0a5('0x26')]=function(_0x540504){var _0x2041ae=this;return new Promise(function(_0x5cddde,_0x102f43){return db[_0xf0a5('0x19')][_0xf0a5('0x27')](_0x540504[_0xf0a5('0x25')],{'raw':_0x540504['options']?_0x540504['options'][_0xf0a5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x540504[_0xf0a5('0x1b')]?_0x540504[_0xf0a5('0x1b')][_0xf0a5('0x28')]||null:null,'attributes':_0x540504['options']?_0x540504[_0xf0a5('0x1b')][_0xf0a5('0x20')]||null:null,'limit':_0x540504[_0xf0a5('0x1b')]?_0x540504['options'][_0xf0a5('0x1d')]||null:null})['then'](function(_0x365dc4){logger[_0xf0a5('0xf')](_0xf0a5('0x26'),_0x540504);logger[_0xf0a5('0x11')](_0xf0a5('0x26'),_0x540504,JSON[_0xf0a5('0x22')](_0x365dc4));_0x5cddde(_0x365dc4);})[_0xf0a5('0x17')](function(_0x40e432){logger[_0xf0a5('0x14')](_0xf0a5('0x26'),_0x40e432[_0xf0a5('0x16')],_0x540504);_0x102f43(_0x2041ae['error'](0x1f4,_0x40e432[_0xf0a5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index c0b7feb..7c46515 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 _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 +var _0xdcd5=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceChanSpy.controller','get','isAuthenticated','show','create','put','delete','/:id','util'];(function(_0x46b774,_0x232634){var _0x5773ad=function(_0x62e568){while(--_0x62e568){_0x46b774['push'](_0x46b774['shift']());}};_0x5773ad(++_0x232634);}(_0xdcd5,0x133));var _0x5dcd=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xdcd5[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x5dcd('0x0'));var path=require('path');var timeout=require(_0x5dcd('0x1'));var express=require(_0x5dcd('0x2'));var router=express[_0x5dcd('0x3')]();var fs_extra=require(_0x5dcd('0x4'));var auth=require(_0x5dcd('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5dcd('0x6'));router[_0x5dcd('0x7')]('/',auth[_0x5dcd('0x8')](),controller['index']);router['get']('/:id',auth[_0x5dcd('0x8')](),controller[_0x5dcd('0x9')]);router['post']('/',auth[_0x5dcd('0x8')](),controller[_0x5dcd('0xa')]);router[_0x5dcd('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5dcd('0xc')](_0x5dcd('0xd'),auth[_0x5dcd('0x8')](),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 e5bffde..9ccf80c 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 _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 +var _0xe6b5=['STRING','name','options','join','BOOLEAN','sequelize','exports'];(function(_0x584070,_0x3fae73){var _0x5b36ea=function(_0x1cd483){while(--_0x1cd483){_0x584070['push'](_0x584070['shift']());}};_0x5b36ea(++_0x3fae73);}(_0xe6b5,0xfa));var _0x5e6b=function(_0x3ce3d0,_0x597f99){_0x3ce3d0=_0x3ce3d0-0x0;var _0x23cbe9=_0xe6b5[_0x3ce3d0];return _0x23cbe9;};'use strict';var Sequelize=require(_0x5e6b('0x0'));module[_0x5e6b('0x1')]={'name':{'type':Sequelize[_0x5e6b('0x2')]},'prefix':{'type':Sequelize[_0x5e6b('0x2')],'unique':_0x5e6b('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x184658){this['setDataValue'](_0x5e6b('0x4'),_0x184658?_0x184658[_0x5e6b('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x5e6b('0x4'))?this['getDataValue'](_0x5e6b('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0x5e6b('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0x5e6b('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x5e6b('0x2')]},'description':{'type':Sequelize[_0x5e6b('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index f4b6446..7899946 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 _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 +var _0x97a2=['UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','ChanSpies','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','VIRTUAL','includeAll','include','VoiceChanSpy','findAll','show','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x70fa3,_0x5242af){var _0x55c99f=function(_0x27d035){while(--_0x27d035){_0x70fa3['push'](_0x70fa3['shift']());}};_0x55c99f(++_0x5242af);}(_0x97a2,0x1b1));var _0x297a=function(_0xb91073,_0x5a663c){_0xb91073=_0xb91073-0x0;var _0x1733b1=_0x97a2[_0xb91073];return _0x1733b1;};'use strict';var emlformat=require(_0x297a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x297a('0x1'));var jsonpatch=require(_0x297a('0x2'));var rp=require(_0x297a('0x3'));var moment=require(_0x297a('0x4'));var BPromise=require(_0x297a('0x5'));var Mustache=require(_0x297a('0x6'));var util=require(_0x297a('0x7'));var path=require(_0x297a('0x8'));var sox=require('sox');var csv=require(_0x297a('0x9'));var ejs=require(_0x297a('0xa'));var fs=require('fs');var fs_extra=require(_0x297a('0xb'));var _=require(_0x297a('0xc'));var squel=require(_0x297a('0xd'));var crypto=require(_0x297a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x297a('0xf'));var toCsv=require(_0x297a('0x9'));var querystring=require(_0x297a('0x10'));var Papa=require(_0x297a('0x11'));var Redis=require(_0x297a('0x12'));var authService=require(_0x297a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x297a('0x14'))(_0x297a('0x15'));var utils=require(_0x297a('0x16'));var config=require(_0x297a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x297a('0x18'))['db'];function respondWithStatusCode(_0x3db3e9,_0x278334){_0x278334=_0x278334||0xcc;return function(_0x413bc4){if(_0x413bc4){return _0x3db3e9[_0x297a('0x19')](_0x278334);}return _0x3db3e9[_0x297a('0x1a')](_0x278334)[_0x297a('0x1b')]();};}function respondWithResult(_0x5020b0,_0x4d826d){_0x4d826d=_0x4d826d||0xc8;return function(_0x417def){if(_0x417def){return _0x5020b0['status'](_0x4d826d)[_0x297a('0x1c')](_0x417def);}};}function respondWithFilteredResult(_0x1016ea,_0x53f1e4){return function(_0x188540){if(_0x188540){var _0x40f080=typeof _0x53f1e4['offset']===_0x297a('0x1d')&&typeof _0x53f1e4[_0x297a('0x1e')]===_0x297a('0x1d');var _0x4d6b59=_0x188540[_0x297a('0x1f')];var _0x3af847=_0x40f080?0x0:_0x53f1e4[_0x297a('0x20')];var _0x4d6194=_0x40f080?_0x188540[_0x297a('0x1f')]:_0x53f1e4[_0x297a('0x20')]+_0x53f1e4['limit'];var _0x26b878;if(_0x4d6194>=_0x4d6b59){_0x4d6194=_0x4d6b59;_0x26b878=0xc8;}else{_0x26b878=0xce;}_0x1016ea[_0x297a('0x1a')](_0x26b878);return _0x1016ea[_0x297a('0x21')](_0x297a('0x22'),_0x3af847+'-'+_0x4d6194+'/'+_0x4d6b59)[_0x297a('0x1c')](_0x188540);}return null;};}function patchUpdates(_0xde6d1c){return function(_0x3e42c5){try{jsonpatch[_0x297a('0x23')](_0x3e42c5,_0xde6d1c,!![]);}catch(_0x101583){return BPromise[_0x297a('0x24')](_0x101583);}return _0x3e42c5[_0x297a('0x25')]();};}function saveUpdates(_0x5889c7,_0x481f59){return function(_0x5bb38a){if(_0x5bb38a){return _0x5bb38a['update'](_0x5889c7)[_0x297a('0x26')](function(_0xcebadc){return _0xcebadc;});}return null;};}function removeEntity(_0x4ad883,_0xfbf16a){return function(_0x40919d){if(_0x40919d){return _0x40919d[_0x297a('0x27')]()[_0x297a('0x26')](function(){var _0x519f3b=_0x40919d[_0x297a('0x28')]({'plain':!![]});var _0x3267eb=_0x297a('0x29');return db['UserProfileResource'][_0x297a('0x27')]({'where':{'type':_0x3267eb,'resourceId':_0x519f3b['id']}})[_0x297a('0x26')](function(){return _0x40919d;});})[_0x297a('0x26')](function(){_0x4ad883[_0x297a('0x1a')](0xcc)[_0x297a('0x1b')]();});}};}function handleEntityNotFound(_0x3e257d,_0x399965){return function(_0x36564a){if(!_0x36564a){_0x3e257d[_0x297a('0x19')](0x194);}return _0x36564a;};}function handleError(_0x7dd056,_0x1b9184){_0x1b9184=_0x1b9184||0x1f4;return function(_0x57327a){logger[_0x297a('0x2a')](_0x57327a[_0x297a('0x2b')]);if(_0x57327a[_0x297a('0x2c')]){delete _0x57327a['name'];}_0x7dd056['status'](_0x1b9184)[_0x297a('0x2d')](_0x57327a);};}exports[_0x297a('0x2e')]=function(_0x40cc4d,_0xd9c747){var _0x3eddd8={},_0x1da0e7={},_0x48dc2f={'count':0x0,'rows':[]};var _0x53291d=_[_0x297a('0x2f')](db['VoiceChanSpy'][_0x297a('0x30')],function(_0x97281c){return{'name':_0x97281c[_0x297a('0x31')],'type':_0x97281c[_0x297a('0x32')][_0x297a('0x33')]};});_0x1da0e7['model']=_[_0x297a('0x2f')](_0x53291d,_0x297a('0x2c'));_0x1da0e7[_0x297a('0x34')]=_[_0x297a('0x35')](_0x40cc4d[_0x297a('0x34')]);_0x1da0e7[_0x297a('0x36')]=_[_0x297a('0x37')](_0x1da0e7[_0x297a('0x38')],_0x1da0e7[_0x297a('0x34')]);_0x3eddd8['attributes']=_[_0x297a('0x37')](_0x1da0e7['model'],qs[_0x297a('0x39')](_0x40cc4d[_0x297a('0x34')][_0x297a('0x39')]));_0x3eddd8[_0x297a('0x3a')]=_0x3eddd8['attributes'][_0x297a('0x3b')]?_0x3eddd8['attributes']:_0x1da0e7[_0x297a('0x38')];if(!_0x40cc4d[_0x297a('0x34')]['hasOwnProperty'](_0x297a('0x3c'))){_0x3eddd8[_0x297a('0x1e')]=qs[_0x297a('0x1e')](_0x40cc4d['query']['limit']);_0x3eddd8[_0x297a('0x20')]=qs[_0x297a('0x20')](_0x40cc4d[_0x297a('0x34')]['offset']);}_0x3eddd8[_0x297a('0x3d')]=qs[_0x297a('0x3e')](_0x40cc4d[_0x297a('0x34')][_0x297a('0x3e')]);_0x3eddd8[_0x297a('0x3f')]=qs[_0x297a('0x36')](_['pick'](_0x40cc4d[_0x297a('0x34')],_0x1da0e7['filters']),_0x53291d);if(_0x40cc4d[_0x297a('0x34')]['filter']){_0x3eddd8[_0x297a('0x3f')]=_['merge'](_0x3eddd8[_0x297a('0x3f')],{'$or':_['map'](_0x53291d,function(_0x2f3a87){if(_0x2f3a87[_0x297a('0x32')]!==_0x297a('0x40')){var _0x5c5273={};_0x5c5273[_0x2f3a87['name']]={'$like':'%'+_0x40cc4d[_0x297a('0x34')]['filter']+'%'};return _0x5c5273;}})});}_0x3eddd8=_['merge']({},_0x3eddd8,_0x40cc4d['options']);var _0x86eb2f={'where':_0x3eddd8[_0x297a('0x3f')]};return db['VoiceChanSpy'][_0x297a('0x1f')](_0x86eb2f)[_0x297a('0x26')](function(_0x195789){_0x48dc2f['count']=_0x195789;if(_0x40cc4d[_0x297a('0x34')][_0x297a('0x41')]){_0x3eddd8[_0x297a('0x42')]=[{'all':!![]}];}return db[_0x297a('0x43')][_0x297a('0x44')](_0x3eddd8);})['then'](function(_0x441cdf){_0x48dc2f['rows']=_0x441cdf;return _0x48dc2f;})['then'](respondWithFilteredResult(_0xd9c747,_0x3eddd8))['catch'](handleError(_0xd9c747,null));};exports[_0x297a('0x45')]=function(_0x3461dd,_0x239329){var _0x52e7dc={'raw':![],'where':{'id':_0x3461dd['params']['id']}},_0x18eb2b={};_0x18eb2b[_0x297a('0x38')]=_[_0x297a('0x35')](db[_0x297a('0x43')][_0x297a('0x30')]);_0x18eb2b[_0x297a('0x34')]=_[_0x297a('0x35')](_0x3461dd['query']);_0x18eb2b[_0x297a('0x36')]=_[_0x297a('0x37')](_0x18eb2b['model'],_0x18eb2b[_0x297a('0x34')]);_0x52e7dc[_0x297a('0x3a')]=_[_0x297a('0x37')](_0x18eb2b[_0x297a('0x38')],qs[_0x297a('0x39')](_0x3461dd['query'][_0x297a('0x39')]));_0x52e7dc[_0x297a('0x3a')]=_0x52e7dc[_0x297a('0x3a')][_0x297a('0x3b')]?_0x52e7dc[_0x297a('0x3a')]:_0x18eb2b[_0x297a('0x38')];if(_0x3461dd[_0x297a('0x34')][_0x297a('0x41')]){_0x52e7dc['include']=[{'all':!![]}];}_0x52e7dc=_['merge']({},_0x52e7dc,_0x3461dd[_0x297a('0x46')]);return db[_0x297a('0x43')]['find'](_0x52e7dc)['then'](handleEntityNotFound(_0x239329,null))[_0x297a('0x26')](respondWithResult(_0x239329,null))[_0x297a('0x47')](handleError(_0x239329,null));};exports[_0x297a('0x48')]=function(_0x3ea7a8,_0x4baed0){return db[_0x297a('0x43')][_0x297a('0x48')](_0x3ea7a8[_0x297a('0x49')],{})[_0x297a('0x26')](function(_0x392ec3){var _0x173eb8=_0x3ea7a8[_0x297a('0x4a')][_0x297a('0x28')]({'plain':!![]});if(!_0x173eb8)throw new Error(_0x297a('0x4b'));if(_0x173eb8[_0x297a('0x4c')]==='user'){var _0x356f34=_0x392ec3[_0x297a('0x28')]({'plain':!![]});var _0x46ccf9=_0x297a('0x29');return db[_0x297a('0x4d')]['find']({'where':{'name':_0x46ccf9,'userProfileId':_0x173eb8[_0x297a('0x4e')]},'raw':!![]})[_0x297a('0x26')](function(_0x348414){if(_0x348414&&_0x348414[_0x297a('0x4f')]===0x0){return db[_0x297a('0x50')][_0x297a('0x48')]({'name':_0x356f34[_0x297a('0x2c')],'resourceId':_0x356f34['id'],'type':_0x348414[_0x297a('0x2c')],'sectionId':_0x348414['id']},{})[_0x297a('0x26')](function(){return _0x392ec3;});}else{return _0x392ec3;}})['catch'](function(_0x3d1bfd){logger[_0x297a('0x2a')](_0x297a('0x51'),_0x3d1bfd);throw _0x3d1bfd;});}return _0x392ec3;})[_0x297a('0x26')](respondWithResult(_0x4baed0,0xc9))[_0x297a('0x47')](handleError(_0x4baed0,null));};exports[_0x297a('0x52')]=function(_0x56ddff,_0x5f32f5){if(_0x56ddff[_0x297a('0x49')]['id']){delete _0x56ddff[_0x297a('0x49')]['id'];}return db[_0x297a('0x43')][_0x297a('0x53')]({'where':{'id':_0x56ddff['params']['id']}})['then'](handleEntityNotFound(_0x5f32f5,null))[_0x297a('0x26')](saveUpdates(_0x56ddff[_0x297a('0x49')],null))[_0x297a('0x26')](respondWithResult(_0x5f32f5,null))[_0x297a('0x47')](handleError(_0x5f32f5,null));};exports[_0x297a('0x27')]=function(_0x411664,_0x1a62b9){return db['VoiceChanSpy']['find']({'where':{'id':_0x411664[_0x297a('0x54')]['id']}})['then'](handleEntityNotFound(_0x1a62b9,null))['then'](removeEntity(_0x1a62b9,null))['catch'](handleError(_0x1a62b9,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 4bc06d2..21e4340 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 _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 +var _0xa0b5=['record','push','MixMonitor','${UNIQUEID}.%s,a','auth','Authenticate','password','ChanSpy','name','options','StopMixMonitor','concat','internal','User','findAll','agent','catch','exports','models','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','length','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','merge','Set'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xa0b5,0x14b));var _0x5a0b=function(_0x1664a6,_0x54efde){_0x1664a6=_0x1664a6-0x0;var _0x1be33a=_0xa0b5[_0x1664a6];return _0x1be33a;};'use strict';var _=require(_0x5a0b('0x0'));var util=require(_0x5a0b('0x1'));var BPromise=require(_0x5a0b('0x2'));var attributes=require(_0x5a0b('0x3'));var getUserApplications=function(_0x38f4a3,_0x1ed7ab,_0x6db3a1){var _0x1dbb23=0x1;var _0x26ad68=[];var _0x234212={'context':_0x1ed7ab[_0x5a0b('0x4')]||_0x5a0b('0x5'),'exten':util[_0x5a0b('0x6')]('%s%s',_0x38f4a3[_0x5a0b('0x7')],_0x6db3a1),'type':_0x5a0b('0x8'),'isApp':![],'ChanSpyId':_0x38f4a3['id'],'UserId':_0x1ed7ab['id']};_0x26ad68['push'](_[_0x5a0b('0x9')]({'app':_0x5a0b('0xa'),'appdata':util['format']('CDR(type)=%s','chanspy'),'priority':_0x1dbb23++},_0x234212));if(_0x38f4a3[_0x5a0b('0xb')]){_0x26ad68[_0x5a0b('0xc')](_['merge']({'app':_0x5a0b('0xd'),'appdata':util[_0x5a0b('0x6')](_0x5a0b('0xe'),_0x38f4a3['recordingFormat']),'priority':_0x1dbb23++},_0x234212));}if(_0x38f4a3[_0x5a0b('0xf')]){_0x26ad68[_0x5a0b('0xc')](_[_0x5a0b('0x9')]({'app':_0x5a0b('0x10'),'appdata':_0x38f4a3[_0x5a0b('0x11')],'priority':_0x1dbb23++},_0x234212));}_0x26ad68[_0x5a0b('0xc')](_[_0x5a0b('0x9')]({'app':_0x5a0b('0x12'),'appdata':util[_0x5a0b('0x6')]('SIP/%s,%s',_0x1ed7ab[_0x5a0b('0x13')],_0x38f4a3['options']?_0x38f4a3[_0x5a0b('0x14')]['join'](''):''),'priority':_0x1dbb23++},_0x234212));if(_0x38f4a3['record']){_0x26ad68['push'](_[_0x5a0b('0x9')]({'app':_0x5a0b('0x15'),'priority':_0x1dbb23++},_0x234212));}return _0x26ad68;};var getChanSpyApplications=function(_0x2af1cb,_0x4020bc){var _0x434667=[];for(var _0x97d74a=0x0,_0x27634f=0x1;_0x97d74a<_0x4020bc['length'];_0x97d74a++,_0x27634f=0x1){_0x434667=_0x434667[_0x5a0b('0x16')](getUserApplications(_0x2af1cb,_0x4020bc[_0x97d74a],_0x4020bc[_0x97d74a]['internal']));if(_0x4020bc[_0x97d74a][_0x5a0b('0x17')]!=_0x4020bc[_0x97d74a][_0x5a0b('0x13')]){_0x434667=_0x434667[_0x5a0b('0x16')](getUserApplications(_0x2af1cb,_0x4020bc[_0x97d74a],_0x4020bc[_0x97d74a][_0x5a0b('0x13')]));}}return _0x434667;};var getChanSpyPromise=function(_0x7f908,_0x1b78aa){return new BPromise(function(_0x29522b,_0x5871c9){return _0x7f908[_0x5a0b('0x18')][_0x5a0b('0x19')]({'attributes':['id',_0x5a0b('0x13'),'internal'],'where':{'role':_0x5a0b('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x1bbec1){if(_0x1bbec1){return _0x29522b(getChanSpyApplications(_0x1b78aa,_0x1bbec1));}return _0x29522b([]);})[_0x5a0b('0x1b')](function(_0x1ae3e5){_0x5871c9(_0x1ae3e5);});});};module[_0x5a0b('0x1c')]=function(_0x4e40df,_0x38463a){var _0x2a0269=_0x4e40df[_0x5a0b('0x1d')];return _0x4e40df[_0x5a0b('0x1e')](_0x5a0b('0x1f'),attributes,{'tableName':_0x5a0b('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4cd852,_0x2b6628,_0x1ffbfd){return getChanSpyPromise(_0x2a0269,_0x4cd852)[_0x5a0b('0x21')](function(_0x424cb6){if(_0x424cb6&&_0x424cb6['length']){return _0x2a0269[_0x5a0b('0x22')][_0x5a0b('0x23')](_0x424cb6);}})[_0x5a0b('0x21')](function(){_0x1ffbfd();})[_0x5a0b('0x1b')](function(_0x3f8850){_0x1ffbfd(_0x3f8850);});},'afterUpdate':function(_0x2133b2,_0x3724e1,_0x69e71d){return _0x2a0269[_0x5a0b('0x22')][_0x5a0b('0x24')]({'where':{'ChanSpyId':_0x2133b2['id']}})[_0x5a0b('0x21')](function(){return getChanSpyPromise(_0x2a0269,_0x2133b2);})[_0x5a0b('0x21')](function(_0x49efad){if(_0x49efad&&_0x49efad[_0x5a0b('0x25')]){return _0x2a0269[_0x5a0b('0x22')][_0x5a0b('0x23')](_0x49efad);}})[_0x5a0b('0x21')](function(){_0x69e71d();})['catch'](function(_0x4a2624){_0x69e71d(_0x4a2624);});},'afterDestroy':function(_0xfaa879,_0x362371,_0x1cb2a0){return _0x2a0269['VoiceExtension'][_0x5a0b('0x24')]({'where':{'ChanSpyId':_0xfaa879['id']}})[_0x5a0b('0x21')](function(){_0x1cb2a0();})[_0x5a0b('0x1b')](function(_0x3dfcb7){_0x1cb2a0(_0x3dfcb7);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 67706bc..7949dec 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 _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 +var _0x1b32=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x28162b,_0x3e6d88){var _0x3cbfee=function(_0x577aaa){while(--_0x577aaa){_0x28162b['push'](_0x28162b['shift']());}};_0x3cbfee(++_0x3e6d88);}(_0x1b32,0x85));var _0x21b3=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x1b32[_0x5f3f88];return _0xd08119;};'use strict';var _=require('lodash');var util=require(_0x21b3('0x0'));var moment=require(_0x21b3('0x1'));var BPromise=require(_0x21b3('0x2'));var rs=require(_0x21b3('0x3'));var fs=require('fs');var Redis=require(_0x21b3('0x4'));var db=require(_0x21b3('0x5'))['db'];var utils=require(_0x21b3('0x6'));var logger=require(_0x21b3('0x7'))(_0x21b3('0x8'));var config=require(_0x21b3('0x9'));var jayson=require(_0x21b3('0xa'));var client=jayson[_0x21b3('0xb')][_0x21b3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47516a,_0x21e881,_0x5c0f36){return new BPromise(function(_0x45b1b7,_0x5639eb){return client['request'](_0x47516a,_0x5c0f36)['then'](function(_0xd7a981){logger[_0x21b3('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x21e881,'request\x20sent');logger[_0x21b3('0xe')](_0x21b3('0xf'),_0x21e881,_0x21b3('0x10'),JSON['stringify'](_0xd7a981));if(_0xd7a981[_0x21b3('0x11')]){if(_0xd7a981[_0x21b3('0x11')][_0x21b3('0x12')]===0x1f4){logger[_0x21b3('0x11')](_0x21b3('0x13'),_0x21e881,_0xd7a981[_0x21b3('0x11')][_0x21b3('0x14')]);return _0x5639eb(_0xd7a981[_0x21b3('0x11')][_0x21b3('0x14')]);}logger['error'](_0x21b3('0x13'),_0x21e881,_0xd7a981[_0x21b3('0x11')][_0x21b3('0x14')]);return _0x45b1b7(_0xd7a981['error'][_0x21b3('0x14')]);}else{logger['info'](_0x21b3('0x13'),_0x21e881,'request\x20sent');_0x45b1b7(_0xd7a981[_0x21b3('0x15')][_0x21b3('0x14')]);}})[_0x21b3('0x16')](function(_0x4217d6){logger['error'](_0x21b3('0x13'),_0x21e881,_0x4217d6);_0x5639eb(_0x4217d6);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 2eed877..8778dce 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 _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 +var _0x8470=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x8470,0x1d0));var _0x0847=function(_0x10ee67,_0xcc95c3){_0x10ee67=_0x10ee67-0x0;var _0x2536c1=_0x8470[_0x10ee67];return _0x2536c1;};'use strict';var multer=require(_0x0847('0x0'));var util=require(_0x0847('0x1'));var path=require('path');var timeout=require(_0x0847('0x2'));var express=require(_0x0847('0x3'));var router=express[_0x0847('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0847('0x5'));var interaction=require(_0x0847('0x6'));var config=require(_0x0847('0x7'));var controller=require(_0x0847('0x8'));router['get']('/',auth[_0x0847('0x9')](),controller[_0x0847('0xa')]);router['get']('/:id',auth[_0x0847('0x9')](),controller['show']);router[_0x0847('0xb')]('/',auth[_0x0847('0x9')](),controller[_0x0847('0xc')]);router[_0x0847('0xd')](_0x0847('0xe'),auth[_0x0847('0x9')](),controller[_0x0847('0xf')]);router[_0x0847('0x10')](_0x0847('0xe'),auth[_0x0847('0x9')](),controller[_0x0847('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 5be0f3c..540e23f 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 _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 +var _0x90ff=['BOOLEAN','sequelize','STRING','name'];(function(_0xd04139,_0x47094a){var _0x2afb4a=function(_0x4ecce5){while(--_0x4ecce5){_0xd04139['push'](_0xd04139['shift']());}};_0x2afb4a(++_0x47094a);}(_0x90ff,0x1d9));var _0xf90f=function(_0x21d464,_0x17f796){_0x21d464=_0x21d464-0x0;var _0x287666=_0x90ff[_0x21d464];return _0x287666;};'use strict';var Sequelize=require(_0xf90f('0x0'));module['exports']={'name':{'type':Sequelize[_0xf90f('0x1')],'unique':_0xf90f('0x2')},'description':{'type':Sequelize[_0xf90f('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xf90f('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 5494719..373f219 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 _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 +var _0xed5e=['count','set','apply','update','destroy','Contexts','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','VIRTUAL','merge','options','VoiceContext','findAll','rows','params','includeAll','include','find','create','body','join','server/files/templates/context.ejs','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','get','UserProfileSection','userProfileId','autoAssociation','readFileSync','root','render','utf8','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','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','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','result','catch','VoiceContext,\x20%s,\x20%s','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x345612,_0x496133){var _0x1ab8c3=function(_0x219d9f){while(--_0x219d9f){_0x345612['push'](_0x345612['shift']());}};_0x1ab8c3(++_0x496133);}(_0xed5e,0x1ce));var _0xeed5=function(_0x38cec7,_0x2358b2){_0x38cec7=_0x38cec7-0x0;var _0x3e89d7=_0xed5e[_0x38cec7];return _0x3e89d7;};'use strict';var emlformat=require(_0xeed5('0x0'));var rimraf=require(_0xeed5('0x1'));var zipdir=require(_0xeed5('0x2'));var jsonpatch=require(_0xeed5('0x3'));var rp=require(_0xeed5('0x4'));var moment=require(_0xeed5('0x5'));var BPromise=require(_0xeed5('0x6'));var Mustache=require('mustache');var util=require(_0xeed5('0x7'));var path=require(_0xeed5('0x8'));var sox=require(_0xeed5('0x9'));var csv=require('to-csv');var ejs=require(_0xeed5('0xa'));var fs=require('fs');var fs_extra=require(_0xeed5('0xb'));var _=require(_0xeed5('0xc'));var squel=require(_0xeed5('0xd'));var crypto=require(_0xeed5('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xeed5('0xf'));var querystring=require('querystring');var Papa=require(_0xeed5('0x10'));var Redis=require(_0xeed5('0x11'));var authService=require(_0xeed5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xeed5('0x13'));var hardwareService=require(_0xeed5('0x14'));var logger=require(_0xeed5('0x15'))(_0xeed5('0x16'));var utils=require(_0xeed5('0x17'));var config=require(_0xeed5('0x18'));var licenseUtil=require(_0xeed5('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0xeed5('0x1a'));var client=jayson[_0xeed5('0x1b')][_0xeed5('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x479930,_0x149bb5,_0x52d1d4,_0xb9e075){return new BPromise(function(_0x16af75,_0x248573){var _0x1b97ac=_0xb9e075||client;return _0x1b97ac[_0xeed5('0x1d')](_0x479930,_0x52d1d4)[_0xeed5('0x1e')](function(_0x1b5ce7){logger[_0xeed5('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x149bb5,_0xeed5('0x20'));logger[_0xeed5('0x21')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x149bb5,'request\x20sent',JSON[_0xeed5('0x22')](_0x1b5ce7));if(_0x1b5ce7[_0xeed5('0x23')]){if(_0x1b5ce7[_0xeed5('0x23')][_0xeed5('0x24')]===0x1f4){logger[_0xeed5('0x23')]('VoiceContext,\x20%s,\x20%s',_0x149bb5,_0x1b5ce7[_0xeed5('0x23')][_0xeed5('0x25')]);return _0x248573(_0x1b5ce7['error'][_0xeed5('0x25')]);}logger[_0xeed5('0x23')]('VoiceContext,\x20%s,\x20%s',_0x149bb5,_0x1b5ce7[_0xeed5('0x23')][_0xeed5('0x25')]);return _0x16af75(_0x1b5ce7[_0xeed5('0x23')][_0xeed5('0x25')]);}else{logger[_0xeed5('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x149bb5,_0xeed5('0x20'));_0x16af75(_0x1b5ce7[_0xeed5('0x26')][_0xeed5('0x25')]);}})[_0xeed5('0x27')](function(_0x5bc998){logger[_0xeed5('0x23')](_0xeed5('0x28'),_0x149bb5,_0x5bc998);_0x248573(_0x5bc998);});});}function respondWithStatusCode(_0x3a7251,_0xd5b5c5){_0xd5b5c5=_0xd5b5c5||0xcc;return function(_0x78c004){if(_0x78c004){return _0x3a7251[_0xeed5('0x29')](_0xd5b5c5);}return _0x3a7251[_0xeed5('0x2a')](_0xd5b5c5)[_0xeed5('0x2b')]();};}function respondWithResult(_0x4b309e,_0x777359){_0x777359=_0x777359||0xc8;return function(_0x38df5a){if(_0x38df5a){return _0x4b309e['status'](_0x777359)[_0xeed5('0x2c')](_0x38df5a);}};}function respondWithFilteredResult(_0x3fa60b,_0x14e34a){return function(_0xefb7e2){if(_0xefb7e2){var _0xc6eeb7=typeof _0x14e34a[_0xeed5('0x2d')]===_0xeed5('0x2e')&&typeof _0x14e34a[_0xeed5('0x2f')]==='undefined';var _0x4977c0=_0xefb7e2[_0xeed5('0x30')];var _0x3148e0=_0xc6eeb7?0x0:_0x14e34a[_0xeed5('0x2d')];var _0xea677b=_0xc6eeb7?_0xefb7e2[_0xeed5('0x30')]:_0x14e34a[_0xeed5('0x2d')]+_0x14e34a[_0xeed5('0x2f')];var _0x374e70;if(_0xea677b>=_0x4977c0){_0xea677b=_0x4977c0;_0x374e70=0xc8;}else{_0x374e70=0xce;}_0x3fa60b[_0xeed5('0x2a')](_0x374e70);return _0x3fa60b[_0xeed5('0x31')]('Content-Range',_0x3148e0+'-'+_0xea677b+'/'+_0x4977c0)[_0xeed5('0x2c')](_0xefb7e2);}return null;};}function patchUpdates(_0x3c08d9){return function(_0x129473){try{jsonpatch[_0xeed5('0x32')](_0x129473,_0x3c08d9,!![]);}catch(_0x5858c9){return BPromise['reject'](_0x5858c9);}return _0x129473['save']();};}function saveUpdates(_0x2e478e,_0x5be4a6){return function(_0x5be7a4){if(_0x5be7a4){return _0x5be7a4[_0xeed5('0x33')](_0x2e478e)[_0xeed5('0x1e')](function(_0x3b5af0){return _0x3b5af0;});}return null;};}function removeEntity(_0x5aa79e,_0x4b2a9b){return function(_0x3c2c65){if(_0x3c2c65){return _0x3c2c65[_0xeed5('0x34')]()[_0xeed5('0x1e')](function(){var _0x307c01=_0x3c2c65['get']({'plain':!![]});var _0x3f4f98=_0xeed5('0x35');return db[_0xeed5('0x36')][_0xeed5('0x34')]({'where':{'type':_0x3f4f98,'resourceId':_0x307c01['id']}})[_0xeed5('0x1e')](function(){return _0x3c2c65;});})[_0xeed5('0x1e')](function(){_0x5aa79e['status'](0xcc)[_0xeed5('0x2b')]();});}};}function handleEntityNotFound(_0x4df78f,_0x52595a){return function(_0x57b569){if(!_0x57b569){_0x4df78f[_0xeed5('0x29')](0x194);}return _0x57b569;};}function handleError(_0x574237,_0x3344c3){_0x3344c3=_0x3344c3||0x1f4;return function(_0x12b847){logger[_0xeed5('0x23')](_0x12b847[_0xeed5('0x37')]);if(_0x12b847[_0xeed5('0x38')]){delete _0x12b847['name'];}_0x574237[_0xeed5('0x2a')](_0x3344c3)[_0xeed5('0x39')](_0x12b847);};}exports['index']=function(_0x7c6258,_0x19f3dd){var _0x48a18c={},_0x19220f={},_0x4c1df1={'count':0x0,'rows':[]};var _0x1794bc=_[_0xeed5('0x3a')](db['VoiceContext'][_0xeed5('0x3b')],function(_0xbe798c){return{'name':_0xbe798c[_0xeed5('0x3c')],'type':_0xbe798c[_0xeed5('0x3d')][_0xeed5('0x3e')]};});_0x19220f[_0xeed5('0x3f')]=_[_0xeed5('0x3a')](_0x1794bc,_0xeed5('0x38'));_0x19220f['query']=_[_0xeed5('0x40')](_0x7c6258[_0xeed5('0x41')]);_0x19220f[_0xeed5('0x42')]=_['intersection'](_0x19220f[_0xeed5('0x3f')],_0x19220f[_0xeed5('0x41')]);_0x48a18c[_0xeed5('0x43')]=_[_0xeed5('0x44')](_0x19220f[_0xeed5('0x3f')],qs[_0xeed5('0x45')](_0x7c6258[_0xeed5('0x41')][_0xeed5('0x45')]));_0x48a18c[_0xeed5('0x43')]=_0x48a18c[_0xeed5('0x43')]['length']?_0x48a18c[_0xeed5('0x43')]:_0x19220f[_0xeed5('0x3f')];if(!_0x7c6258['query'][_0xeed5('0x46')]('nolimit')){_0x48a18c['limit']=qs[_0xeed5('0x2f')](_0x7c6258[_0xeed5('0x41')]['limit']);_0x48a18c[_0xeed5('0x2d')]=qs[_0xeed5('0x2d')](_0x7c6258[_0xeed5('0x41')][_0xeed5('0x2d')]);}_0x48a18c['order']=qs['sort'](_0x7c6258[_0xeed5('0x41')][_0xeed5('0x47')]);_0x48a18c[_0xeed5('0x48')]=qs[_0xeed5('0x42')](_[_0xeed5('0x49')](_0x7c6258[_0xeed5('0x41')],_0x19220f[_0xeed5('0x42')]),_0x1794bc);if(_0x7c6258[_0xeed5('0x41')]['filter']){_0x48a18c[_0xeed5('0x48')]=_['merge'](_0x48a18c['where'],{'$or':_[_0xeed5('0x3a')](_0x1794bc,function(_0x3d2f24){if(_0x3d2f24[_0xeed5('0x3d')]!==_0xeed5('0x4a')){var _0x3da9c6={};_0x3da9c6[_0x3d2f24[_0xeed5('0x38')]]={'$like':'%'+_0x7c6258[_0xeed5('0x41')]['filter']+'%'};return _0x3da9c6;}})});}_0x48a18c=_[_0xeed5('0x4b')]({},_0x48a18c,_0x7c6258[_0xeed5('0x4c')]);var _0x2b411d={'where':_0x48a18c['where']};return db['VoiceContext'][_0xeed5('0x30')](_0x2b411d)['then'](function(_0x54ee26){_0x4c1df1[_0xeed5('0x30')]=_0x54ee26;if(_0x7c6258[_0xeed5('0x41')]['includeAll']){_0x48a18c['include']=[{'all':!![]}];}return db[_0xeed5('0x4d')][_0xeed5('0x4e')](_0x48a18c);})[_0xeed5('0x1e')](function(_0x46703b){_0x4c1df1[_0xeed5('0x4f')]=_0x46703b;return _0x4c1df1;})[_0xeed5('0x1e')](respondWithFilteredResult(_0x19f3dd,_0x48a18c))[_0xeed5('0x27')](handleError(_0x19f3dd,null));};exports['show']=function(_0x68bfc8,_0x3279c9){var _0x3f82e6={'raw':![],'where':{'id':_0x68bfc8[_0xeed5('0x50')]['id']}},_0x1beb12={};_0x1beb12[_0xeed5('0x3f')]=_['keys'](db[_0xeed5('0x4d')][_0xeed5('0x3b')]);_0x1beb12[_0xeed5('0x41')]=_[_0xeed5('0x40')](_0x68bfc8[_0xeed5('0x41')]);_0x1beb12[_0xeed5('0x42')]=_['intersection'](_0x1beb12[_0xeed5('0x3f')],_0x1beb12[_0xeed5('0x41')]);_0x3f82e6['attributes']=_[_0xeed5('0x44')](_0x1beb12[_0xeed5('0x3f')],qs['fields'](_0x68bfc8[_0xeed5('0x41')][_0xeed5('0x45')]));_0x3f82e6[_0xeed5('0x43')]=_0x3f82e6[_0xeed5('0x43')]['length']?_0x3f82e6['attributes']:_0x1beb12[_0xeed5('0x3f')];if(_0x68bfc8[_0xeed5('0x41')][_0xeed5('0x51')]){_0x3f82e6[_0xeed5('0x52')]=[{'all':!![]}];}_0x3f82e6=_[_0xeed5('0x4b')]({},_0x3f82e6,_0x68bfc8[_0xeed5('0x4c')]);return db[_0xeed5('0x4d')][_0xeed5('0x53')](_0x3f82e6)[_0xeed5('0x1e')](handleEntityNotFound(_0x3279c9,null))[_0xeed5('0x1e')](respondWithResult(_0x3279c9,null))[_0xeed5('0x27')](handleError(_0x3279c9,null));};exports['create']=function(_0x4c13d8,_0x13a05d,_0x22cb10){var _0xfef476;return db[_0xeed5('0x4d')][_0xeed5('0x54')](_0x4c13d8[_0xeed5('0x55')],{'raw':!![]})[_0xeed5('0x1e')](function(_0x44ce5a){_0xfef476=_0x44ce5a;return db[_0xeed5('0x4d')][_0xeed5('0x4e')]({'raw':!![]});})[_0xeed5('0x1e')](function(_0x18c393){var _0x7ae544=fs['readFileSync'](path[_0xeed5('0x56')](config['root'],_0xeed5('0x57')),'utf8');var _0x52e882=ejs['render'](_0x7ae544,{'contexts':_0x18c393||[]});fs[_0xeed5('0x58')](_0xeed5('0x59'),_0x52e882);})[_0xeed5('0x1e')](function(){return respondWithRpcPromise(_0xeed5('0x5a'),_0xeed5('0x54'),{'module':_0xeed5('0x5b')});})['then'](function(){var _0x575892=_0x4c13d8[_0xeed5('0x5c')]['get']({'plain':!![]});if(!_0x575892)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x575892[_0xeed5('0x5d')]===_0xeed5('0x5c')){var _0x14e787=_0xfef476[_0xeed5('0x5e')]({'plain':!![]});return db[_0xeed5('0x5f')][_0xeed5('0x53')]({'where':{'name':_0xeed5('0x35'),'userProfileId':_0x575892[_0xeed5('0x60')]},'raw':!![]})[_0xeed5('0x1e')](function(_0x50476f){if(_0x50476f&&_0x50476f[_0xeed5('0x61')]===0x0){return db['UserProfileResource']['create']({'name':_0x14e787[_0xeed5('0x38')],'resourceId':_0x14e787['id'],'type':_0x50476f['name'],'sectionId':_0x50476f['id']},{})[_0xeed5('0x1e')](function(){return _0xfef476;});}else{return _0xfef476;}})[_0xeed5('0x27')](function(_0xf8e61){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf8e61);throw _0xf8e61;});}return _0xfef476;})[_0xeed5('0x1e')](respondWithResult(_0x13a05d,0xc9))[_0xeed5('0x27')](handleError(_0x13a05d,null));};exports[_0xeed5('0x33')]=function(_0x518d8d,_0x3101f8,_0x30f7dc){var _0x58bf6f;return db['VoiceContext']['find']({'where':{'id':_0x518d8d['params']['id']}})['then'](handleEntityNotFound(_0x3101f8,null))[_0xeed5('0x1e')](saveUpdates(_0x518d8d['body'],null))[_0xeed5('0x1e')](function(_0x3de974){if(_0x3de974){_0x58bf6f=_0x3de974;return db[_0xeed5('0x4d')]['findAll']({'raw':!![]});}})['then'](function(_0x31d757){var _0x4ed77a=fs[_0xeed5('0x62')](path[_0xeed5('0x56')](config[_0xeed5('0x63')],'server/files/templates/context.ejs'),'utf8');var _0x4cbd52=ejs[_0xeed5('0x64')](_0x4ed77a,{'contexts':_0x31d757||[]});fs[_0xeed5('0x58')](_0xeed5('0x59'),_0x4cbd52);})[_0xeed5('0x1e')](function(){return respondWithRpcPromise(_0xeed5('0x5a'),_0xeed5('0x33'),{'module':_0xeed5('0x5b')});})[_0xeed5('0x1e')](function(){return _0x58bf6f;})[_0xeed5('0x1e')](respondWithResult(_0x3101f8,null))[_0xeed5('0x27')](handleError(_0x3101f8,null));};exports[_0xeed5('0x34')]=function(_0x519ee1,_0x2abe0b,_0x4de3b5){var _0x4c63fd;return db[_0xeed5('0x4d')][_0xeed5('0x53')]({'where':{'id':_0x519ee1[_0xeed5('0x50')]['id']}})['then'](handleEntityNotFound(_0x2abe0b,null))[_0xeed5('0x1e')](removeEntity(_0x2abe0b,null))['then'](function(){return db[_0xeed5('0x4d')][_0xeed5('0x4e')]({'raw':!![]});})[_0xeed5('0x1e')](function(_0x341653){var _0x58d7da=fs[_0xeed5('0x62')](path['join'](config[_0xeed5('0x63')],_0xeed5('0x57')),_0xeed5('0x65'));var _0x591a19=ejs[_0xeed5('0x64')](_0x58d7da,{'contexts':_0x341653});fs[_0xeed5('0x58')](_0xeed5('0x59'),_0x591a19);return respondWithRpcPromise(_0xeed5('0x5a'),_0xeed5('0x34'),{'module':_0xeed5('0x5b')});})[_0xeed5('0x27')](handleError(_0x2abe0b,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 72191a7..fc67946 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 _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 +var _0xf534=['exports','define','voice_contexts','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./voiceContext.attributes'];(function(_0x5c7e77,_0x372833){var _0x31e43c=function(_0x26fe61){while(--_0x26fe61){_0x5c7e77['push'](_0x5c7e77['shift']());}};_0x31e43c(++_0x372833);}(_0xf534,0x9f));var _0x4f53=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf534[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4f53('0x0'));var util=require(_0x4f53('0x1'));var logger=require(_0x4f53('0x2'))(_0x4f53('0x3'));var moment=require(_0x4f53('0x4'));var BPromise=require('bluebird');var rp=require(_0x4f53('0x5'));var fs=require('fs');var path=require(_0x4f53('0x6'));var rimraf=require('rimraf');var config=require(_0x4f53('0x7'));var attributes=require(_0x4f53('0x8'));module[_0x4f53('0x9')]=function(_0x33a4df,_0x5b4f16){return _0x33a4df[_0x4f53('0xa')]('VoiceContext',attributes,{'tableName':_0x4f53('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index ebc9fc7..72335d7 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 _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 +var _0xf8ff=['request\x20sent','debug','stringify','error','code','message','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xf8ff,0x127));var _0xff8f=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0xf8ff[_0x1780f8];return _0x33a410;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xff8f('0x0'));var BPromise=require('bluebird');var rs=require(_0xff8f('0x1'));var fs=require('fs');var Redis=require(_0xff8f('0x2'));var db=require(_0xff8f('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xff8f('0x4'));var config=require('../../config/environment');var jayson=require(_0xff8f('0x5'));var client=jayson[_0xff8f('0x6')][_0xff8f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4d1e1b,_0x57a767,_0x10bb20){return new BPromise(function(_0x2898af,_0x5ba0fc){return client[_0xff8f('0x8')](_0x4d1e1b,_0x10bb20)['then'](function(_0x5a090a){logger[_0xff8f('0x9')](_0xff8f('0xa'),_0x57a767,_0xff8f('0xb'));logger[_0xff8f('0xc')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x57a767,_0xff8f('0xb'),JSON[_0xff8f('0xd')](_0x5a090a));if(_0x5a090a[_0xff8f('0xe')]){if(_0x5a090a['error'][_0xff8f('0xf')]===0x1f4){logger['error'](_0xff8f('0xa'),_0x57a767,_0x5a090a[_0xff8f('0xe')][_0xff8f('0x10')]);return _0x5ba0fc(_0x5a090a[_0xff8f('0xe')][_0xff8f('0x10')]);}logger[_0xff8f('0xe')]('VoiceContext,\x20%s,\x20%s',_0x57a767,_0x5a090a[_0xff8f('0xe')][_0xff8f('0x10')]);return _0x2898af(_0x5a090a['error']['message']);}else{logger[_0xff8f('0x9')]('VoiceContext,\x20%s,\x20%s',_0x57a767,_0xff8f('0xb'));_0x2898af(_0x5a090a['result'][_0xff8f('0x10')]);}})['catch'](function(_0x399d55){logger[_0xff8f('0xe')](_0xff8f('0xa'),_0x57a767,_0x399d55);_0x5ba0fc(_0x399d55);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 7b528e9..e9ebcd8 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 _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 +var _0x209f=['/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index'];(function(_0x98e080,_0x2d9a72){var _0x29ba06=function(_0x276fe4){while(--_0x276fe4){_0x98e080['push'](_0x98e080['shift']());}};_0x29ba06(++_0x2d9a72);}(_0x209f,0x199));var _0xf209=function(_0x315a0e,_0x35c0fd){_0x315a0e=_0x315a0e-0x0;var _0x13ef0c=_0x209f[_0x315a0e];return _0x13ef0c;};'use strict';var multer=require(_0xf209('0x0'));var util=require('util');var path=require(_0xf209('0x1'));var timeout=require(_0xf209('0x2'));var express=require('express');var router=express[_0xf209('0x3')]();var fs_extra=require(_0xf209('0x4'));var auth=require(_0xf209('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf209('0x6'));var controller=require(_0xf209('0x7'));router[_0xf209('0x8')]('/',auth[_0xf209('0x9')](),controller[_0xf209('0xa')]);router['get'](_0xf209('0xb'),auth[_0xf209('0x9')](),controller[_0xf209('0xc')]);router[_0xf209('0x8')](_0xf209('0xd'),auth[_0xf209('0x9')](),controller['show']);router[_0xf209('0xe')]('/',auth[_0xf209('0x9')](),controller[_0xf209('0xf')]);router[_0xf209('0x10')]('/:id',auth[_0xf209('0x9')](),controller[_0xf209('0x11')]);router[_0xf209('0x12')](_0xf209('0xd'),auth[_0xf209('0x9')](),controller[_0xf209('0x13')]);module[_0xf209('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 4c3591a..3bbf43e 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 _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 +var _0x6f0d=['STRING','INTEGER','DATE','called,connect,complete','exports'];(function(_0x5b3670,_0x3c0828){var _0x2b609f=function(_0x478406){while(--_0x478406){_0x5b3670['push'](_0x5b3670['shift']());}};_0x2b609f(++_0x3c0828);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x322d85,_0x515de6){_0x322d85=_0x322d85-0x0;var _0x7c2bfc=_0x6f0d[_0x322d85];return _0x7c2bfc;};'use strict';var Sequelize=require('sequelize');module[_0xd6f0('0x0')]={'privilege':{'type':Sequelize[_0xd6f0('0x1')]},'channel':{'type':Sequelize[_0xd6f0('0x1')]},'channelstate':{'type':Sequelize[_0xd6f0('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd6f0('0x1')]},'calleridname':{'type':Sequelize[_0xd6f0('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd6f0('0x1')]},'connectedlinename':{'type':Sequelize[_0xd6f0('0x1')]},'language':{'type':Sequelize[_0xd6f0('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd6f0('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd6f0('0x2')]},'uniqueid':{'type':Sequelize[_0xd6f0('0x1')]},'linkedid':{'type':Sequelize[_0xd6f0('0x1')]},'destchannel':{'type':Sequelize[_0xd6f0('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xd6f0('0x1')]},'destcalleridname':{'type':Sequelize[_0xd6f0('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd6f0('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd6f0('0x1')]},'destlanguage':{'type':Sequelize[_0xd6f0('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xd6f0('0x1')]},'destexten':{'type':Sequelize[_0xd6f0('0x1')]},'destpriority':{'type':Sequelize[_0xd6f0('0x2')]},'destuniqueid':{'type':Sequelize[_0xd6f0('0x1')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0xd6f0('0x1')]},'dialstatus':{'type':Sequelize[_0xd6f0('0x1')]},'starttime':{'type':Sequelize[_0xd6f0('0x3')]},'answertime':{'type':Sequelize[_0xd6f0('0x3')]},'endtime':{'type':Sequelize[_0xd6f0('0x3')]},'lastevent':{'type':Sequelize[_0xd6f0('0x1')],'comment':_0xd6f0('0x4')},'routeId':{'type':Sequelize[_0xd6f0('0x2')]},'duration':{'type':Sequelize[_0xd6f0('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xd6f0('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 53e8868..8c2150a 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 _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 +var _0x072e=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','findAll','rows','show','params','keys','includeAll','include','find','create','catch','body','describe','eml-format'];(function(_0x382c73,_0x199cab){var _0x1dd0bf=function(_0x358747){while(--_0x358747){_0x382c73['push'](_0x382c73['shift']());}};_0x1dd0bf(++_0x199cab);}(_0x072e,0x18f));var _0xe072=function(_0x3f5308,_0x261b8d){_0x3f5308=_0x3f5308-0x0;var _0x574023=_0x072e[_0x3f5308];return _0x574023;};'use strict';var emlformat=require(_0xe072('0x0'));var rimraf=require(_0xe072('0x1'));var zipdir=require(_0xe072('0x2'));var jsonpatch=require(_0xe072('0x3'));var rp=require(_0xe072('0x4'));var moment=require('moment');var BPromise=require(_0xe072('0x5'));var Mustache=require(_0xe072('0x6'));var util=require('util');var path=require(_0xe072('0x7'));var sox=require(_0xe072('0x8'));var csv=require(_0xe072('0x9'));var ejs=require(_0xe072('0xa'));var fs=require('fs');var fs_extra=require(_0xe072('0xb'));var _=require(_0xe072('0xc'));var squel=require(_0xe072('0xd'));var crypto=require(_0xe072('0xe'));var jsforce=require(_0xe072('0xf'));var deskjs=require(_0xe072('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe072('0x11'));var Papa=require(_0xe072('0x12'));var Redis=require(_0xe072('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xe072('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe072('0x15'));var logger=require(_0xe072('0x16'))(_0xe072('0x17'));var utils=require(_0xe072('0x18'));var config=require(_0xe072('0x19'));var licenseUtil=require(_0xe072('0x1a'));var db=require(_0xe072('0x1b'))['db'];function respondWithStatusCode(_0x21f29f,_0x264747){_0x264747=_0x264747||0xcc;return function(_0x464ab8){if(_0x464ab8){return _0x21f29f[_0xe072('0x1c')](_0x264747);}return _0x21f29f[_0xe072('0x1d')](_0x264747)[_0xe072('0x1e')]();};}function respondWithResult(_0x484232,_0x4e3769){_0x4e3769=_0x4e3769||0xc8;return function(_0x431e8e){if(_0x431e8e){return _0x484232[_0xe072('0x1d')](_0x4e3769)[_0xe072('0x1f')](_0x431e8e);}};}function respondWithFilteredResult(_0x5dff28,_0x5c9ce4){return function(_0x162e44){if(_0x162e44){var _0x58f9a3=typeof _0x5c9ce4[_0xe072('0x20')]===_0xe072('0x21')&&typeof _0x5c9ce4[_0xe072('0x22')]===_0xe072('0x21');var _0x6e18f7=_0x162e44[_0xe072('0x23')];var _0x1f09d9=_0x58f9a3?0x0:_0x5c9ce4[_0xe072('0x20')];var _0x22e535=_0x58f9a3?_0x162e44['count']:_0x5c9ce4[_0xe072('0x20')]+_0x5c9ce4[_0xe072('0x22')];var _0x1673d9;if(_0x22e535>=_0x6e18f7){_0x22e535=_0x6e18f7;_0x1673d9=0xc8;}else{_0x1673d9=0xce;}_0x5dff28['status'](_0x1673d9);return _0x5dff28[_0xe072('0x24')]('Content-Range',_0x1f09d9+'-'+_0x22e535+'/'+_0x6e18f7)[_0xe072('0x1f')](_0x162e44);}return null;};}function patchUpdates(_0x45562d){return function(_0x42697e){try{jsonpatch[_0xe072('0x25')](_0x42697e,_0x45562d,!![]);}catch(_0x52ffe9){return BPromise[_0xe072('0x26')](_0x52ffe9);}return _0x42697e['save']();};}function saveUpdates(_0x42eede,_0x2f2e90){return function(_0x13e36e){if(_0x13e36e){return _0x13e36e[_0xe072('0x27')](_0x42eede)[_0xe072('0x28')](function(_0x426b40){return _0x426b40;});}return null;};}function removeEntity(_0x4d0c97,_0x488ebb){return function(_0x476436){if(_0x476436){return _0x476436[_0xe072('0x29')]()[_0xe072('0x28')](function(){_0x4d0c97[_0xe072('0x1d')](0xcc)[_0xe072('0x1e')]();});}};}function handleEntityNotFound(_0x315e95,_0x2b0375){return function(_0x134583){if(!_0x134583){_0x315e95['sendStatus'](0x194);}return _0x134583;};}function handleError(_0x1b5153,_0x13bdf2){_0x13bdf2=_0x13bdf2||0x1f4;return function(_0x5f16c0){logger[_0xe072('0x2a')](_0x5f16c0['stack']);if(_0x5f16c0['name']){delete _0x5f16c0[_0xe072('0x2b')];}_0x1b5153['status'](_0x13bdf2)[_0xe072('0x2c')](_0x5f16c0);};}exports[_0xe072('0x2d')]=function(_0x37058f,_0x4515f6){var _0x3a37c7={},_0x1e4efa={},_0x256242={'count':0x0,'rows':[]};var _0x45ddeb=_[_0xe072('0x2e')](db[_0xe072('0x2f')][_0xe072('0x30')],function(_0x295fa6){return{'name':_0x295fa6[_0xe072('0x31')],'type':_0x295fa6['type'][_0xe072('0x32')]};});_0x1e4efa[_0xe072('0x33')]=_['map'](_0x45ddeb,_0xe072('0x2b'));_0x1e4efa[_0xe072('0x34')]=_['keys'](_0x37058f['query']);_0x1e4efa[_0xe072('0x35')]=_[_0xe072('0x36')](_0x1e4efa['model'],_0x1e4efa['query']);_0x3a37c7[_0xe072('0x37')]=_[_0xe072('0x36')](_0x1e4efa[_0xe072('0x33')],qs[_0xe072('0x38')](_0x37058f[_0xe072('0x34')][_0xe072('0x38')]));_0x3a37c7[_0xe072('0x37')]=_0x3a37c7['attributes'][_0xe072('0x39')]?_0x3a37c7[_0xe072('0x37')]:_0x1e4efa[_0xe072('0x33')];if(!_0x37058f[_0xe072('0x34')][_0xe072('0x3a')](_0xe072('0x3b'))){_0x3a37c7[_0xe072('0x22')]=qs[_0xe072('0x22')](_0x37058f[_0xe072('0x34')][_0xe072('0x22')]);_0x3a37c7[_0xe072('0x20')]=qs['offset'](_0x37058f[_0xe072('0x34')]['offset']);}_0x3a37c7[_0xe072('0x3c')]=qs[_0xe072('0x3d')](_0x37058f[_0xe072('0x34')]['sort']);_0x3a37c7[_0xe072('0x3e')]=qs['filters'](_[_0xe072('0x3f')](_0x37058f[_0xe072('0x34')],_0x1e4efa['filters']),_0x45ddeb);if(_0x37058f[_0xe072('0x34')]['filter']){_0x3a37c7['where']=_[_0xe072('0x40')](_0x3a37c7[_0xe072('0x3e')],{'$or':_[_0xe072('0x2e')](_0x45ddeb,function(_0x3c1fce){if(_0x3c1fce[_0xe072('0x41')]!=='VIRTUAL'){var _0x2ae52d={};_0x2ae52d[_0x3c1fce[_0xe072('0x2b')]]={'$like':'%'+_0x37058f[_0xe072('0x34')][_0xe072('0x42')]+'%'};return _0x2ae52d;}})});}_0x3a37c7=_['merge']({},_0x3a37c7,_0x37058f[_0xe072('0x43')]);var _0x29ae1f={'where':_0x3a37c7[_0xe072('0x3e')]};return db['VoiceDialReport'][_0xe072('0x23')](_0x29ae1f)[_0xe072('0x28')](function(_0x296876){_0x256242['count']=_0x296876;if(_0x37058f[_0xe072('0x34')]['includeAll']){_0x3a37c7['include']=[{'all':!![]}];}return db['VoiceDialReport'][_0xe072('0x44')](_0x3a37c7);})[_0xe072('0x28')](function(_0x33e208){_0x256242[_0xe072('0x45')]=_0x33e208;return _0x256242;})[_0xe072('0x28')](respondWithFilteredResult(_0x4515f6,_0x3a37c7))['catch'](handleError(_0x4515f6,null));};exports[_0xe072('0x46')]=function(_0x38f8bb,_0x515999){var _0x1fcc61={'raw':!![],'where':{'id':_0x38f8bb[_0xe072('0x47')]['id']}},_0xc2abb0={};_0xc2abb0[_0xe072('0x33')]=_[_0xe072('0x48')](db[_0xe072('0x2f')][_0xe072('0x30')]);_0xc2abb0[_0xe072('0x34')]=_[_0xe072('0x48')](_0x38f8bb[_0xe072('0x34')]);_0xc2abb0['filters']=_['intersection'](_0xc2abb0[_0xe072('0x33')],_0xc2abb0[_0xe072('0x34')]);_0x1fcc61[_0xe072('0x37')]=_[_0xe072('0x36')](_0xc2abb0[_0xe072('0x33')],qs[_0xe072('0x38')](_0x38f8bb['query'][_0xe072('0x38')]));_0x1fcc61[_0xe072('0x37')]=_0x1fcc61[_0xe072('0x37')]['length']?_0x1fcc61[_0xe072('0x37')]:_0xc2abb0[_0xe072('0x33')];if(_0x38f8bb[_0xe072('0x34')][_0xe072('0x49')]){_0x1fcc61[_0xe072('0x4a')]=[{'all':!![]}];}_0x1fcc61=_[_0xe072('0x40')]({},_0x1fcc61,_0x38f8bb[_0xe072('0x43')]);return db['VoiceDialReport'][_0xe072('0x4b')](_0x1fcc61)[_0xe072('0x28')](handleEntityNotFound(_0x515999,null))[_0xe072('0x28')](respondWithResult(_0x515999,null))['catch'](handleError(_0x515999,null));};exports[_0xe072('0x4c')]=function(_0x7e418b,_0x26fd1f){return db[_0xe072('0x2f')][_0xe072('0x4c')](_0x7e418b['body'],{})['then'](respondWithResult(_0x26fd1f,0xc9))[_0xe072('0x4d')](handleError(_0x26fd1f,null));};exports[_0xe072('0x27')]=function(_0x419b5b,_0xadadb4){if(_0x419b5b['body']['id']){delete _0x419b5b[_0xe072('0x4e')]['id'];}return db[_0xe072('0x2f')]['find']({'where':{'id':_0x419b5b['params']['id']}})['then'](handleEntityNotFound(_0xadadb4,null))[_0xe072('0x28')](saveUpdates(_0x419b5b[_0xe072('0x4e')],null))[_0xe072('0x28')](respondWithResult(_0xadadb4,null))['catch'](handleError(_0xadadb4,null));};exports[_0xe072('0x29')]=function(_0x276d8c,_0x3df247){return db[_0xe072('0x2f')][_0xe072('0x4b')]({'where':{'id':_0x276d8c[_0xe072('0x47')]['id']}})['then'](handleEntityNotFound(_0x3df247,null))[_0xe072('0x28')](removeEntity(_0x3df247,null))['catch'](handleError(_0x3df247,null));};exports[_0xe072('0x4f')]=function(_0x4ee4f9,_0x460022){return db[_0xe072('0x2f')][_0xe072('0x4f')]()[_0xe072('0x28')](respondWithResult(_0x460022,null))[_0xe072('0x4d')](handleError(_0x460022,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index d605397..f614428 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 _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 +var _0x81bb=['exports','VoiceDialReport','report_dial','uniqueid','lodash','../../config/logger','bluebird','../../config/environment'];(function(_0x595f77,_0x3e383e){var _0x413107=function(_0x438a7c){while(--_0x438a7c){_0x595f77['push'](_0x595f77['shift']());}};_0x413107(++_0x3e383e);}(_0x81bb,0x74));var _0xb81b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81bb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb81b('0x0'));var util=require('util');var logger=require(_0xb81b('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb81b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb81b('0x3'));var attributes=require('./voiceDialReport.attributes');module[_0xb81b('0x4')]=function(_0x31826f,_0x2fe9dc){return _0x31826f['define'](_0xb81b('0x5'),attributes,{'tableName':_0xb81b('0x6'),'paranoid':![],'indexes':[{'fields':[_0xb81b('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index d0fc6d7..bb8b277 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 _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 +var _0xbb46=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','body','options','raw','CreateVoiceDialReport','UpdateVoiceDialReport','where','attributes','limit','lodash','util','moment'];(function(_0x34ebf3,_0x5935c5){var _0x3a634d=function(_0x4f5d92){while(--_0x4f5d92){_0x34ebf3['push'](_0x34ebf3['shift']());}};_0x3a634d(++_0x5935c5);}(_0xbb46,0x1dd));var _0x6bb4=function(_0x90f49b,_0x4085a2){_0x90f49b=_0x90f49b-0x0;var _0xd24569=_0xbb46[_0x90f49b];return _0xd24569;};'use strict';var _=require(_0x6bb4('0x0'));var util=require(_0x6bb4('0x1'));var moment=require(_0x6bb4('0x2'));var BPromise=require(_0x6bb4('0x3'));var rs=require(_0x6bb4('0x4'));var fs=require('fs');var Redis=require(_0x6bb4('0x5'));var db=require(_0x6bb4('0x6'))['db'];var utils=require(_0x6bb4('0x7'));var logger=require(_0x6bb4('0x8'))(_0x6bb4('0x9'));var config=require(_0x6bb4('0xa'));var jayson=require(_0x6bb4('0xb'));var client=jayson[_0x6bb4('0xc')][_0x6bb4('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xde98ed,_0x3085e0,_0x310897){return new BPromise(function(_0x16ff46,_0x234c26){return client['request'](_0xde98ed,_0x310897)[_0x6bb4('0xe')](function(_0xb1576){logger[_0x6bb4('0xf')](_0x6bb4('0x10'),_0x3085e0,_0x6bb4('0x11'));logger['debug']('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x3085e0,_0x6bb4('0x11'),JSON[_0x6bb4('0x12')](_0xb1576));if(_0xb1576[_0x6bb4('0x13')]){if(_0xb1576[_0x6bb4('0x13')][_0x6bb4('0x14')]===0x1f4){logger[_0x6bb4('0x13')](_0x6bb4('0x10'),_0x3085e0,_0xb1576[_0x6bb4('0x13')][_0x6bb4('0x15')]);return _0x234c26(_0xb1576['error']['message']);}logger[_0x6bb4('0x13')](_0x6bb4('0x10'),_0x3085e0,_0xb1576[_0x6bb4('0x13')][_0x6bb4('0x15')]);return _0x16ff46(_0xb1576[_0x6bb4('0x13')]['message']);}else{logger[_0x6bb4('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x3085e0,_0x6bb4('0x11'));_0x16ff46(_0xb1576[_0x6bb4('0x16')]['message']);}})[_0x6bb4('0x17')](function(_0x550095){logger[_0x6bb4('0x13')](_0x6bb4('0x10'),_0x3085e0,_0x550095);_0x234c26(_0x550095);});});}exports['CreateVoiceDialReport']=function(_0x5e968d){var _0x5de6b0=this;return new Promise(function(_0x3b13fa,_0x289b29){return db['VoiceDialReport']['create'](_0x5e968d[_0x6bb4('0x18')],{'raw':_0x5e968d[_0x6bb4('0x19')]?_0x5e968d['options'][_0x6bb4('0x1a')]===undefined?!![]:![]:!![]})[_0x6bb4('0xe')](function(_0x29ed08){logger[_0x6bb4('0xf')]('CreateVoiceDialReport',_0x5e968d);logger['debug'](_0x6bb4('0x1b'),_0x5e968d,JSON[_0x6bb4('0x12')](_0x29ed08));_0x3b13fa(_0x29ed08);})[_0x6bb4('0x17')](function(_0x682504){logger[_0x6bb4('0x13')](_0x6bb4('0x1b'),_0x682504[_0x6bb4('0x15')],_0x5e968d);_0x289b29(_0x5de6b0[_0x6bb4('0x13')](0x1f4,_0x682504[_0x6bb4('0x15')]));});});};exports[_0x6bb4('0x1c')]=function(_0x34f48e){var _0x299f93=this;return new Promise(function(_0x5cb0d3,_0x300964){return db['VoiceDialReport']['update'](_0x34f48e[_0x6bb4('0x18')],{'raw':_0x34f48e['options']?_0x34f48e[_0x6bb4('0x19')][_0x6bb4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34f48e[_0x6bb4('0x19')]?_0x34f48e[_0x6bb4('0x19')][_0x6bb4('0x1d')]||null:null,'attributes':_0x34f48e['options']?_0x34f48e[_0x6bb4('0x19')][_0x6bb4('0x1e')]||null:null,'limit':_0x34f48e[_0x6bb4('0x19')]?_0x34f48e['options'][_0x6bb4('0x1f')]||null:null})[_0x6bb4('0xe')](function(_0x19915d){logger[_0x6bb4('0xf')](_0x6bb4('0x1c'),_0x34f48e);logger['debug']('UpdateVoiceDialReport',_0x34f48e,JSON[_0x6bb4('0x12')](_0x19915d));_0x5cb0d3(_0x19915d);})['catch'](function(_0x1cbd5d){logger[_0x6bb4('0x13')](_0x6bb4('0x1c'),_0x1cbd5d[_0x6bb4('0x15')],_0x34f48e);_0x300964(_0x299f93[_0x6bb4('0x13')](0x1f4,_0x1cbd5d['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index efa9ba6..c7e6e6f 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 _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 +var _0xd3f0=['path','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','index','/:id','isAuthenticated','post','/:id/applications','addApplications','update','delete','destroy','exports'];(function(_0x310be9,_0x354ce){var _0x42d398=function(_0x57b699){while(--_0x57b699){_0x310be9['push'](_0x310be9['shift']());}};_0x42d398(++_0x354ce);}(_0xd3f0,0x177));var _0x0d3f=function(_0x2ba6af,_0x54d419){_0x2ba6af=_0x2ba6af-0x0;var _0x234e00=_0xd3f0[_0x2ba6af];return _0x234e00;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0d3f('0x0'));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(_0x0d3f('0x1'));var config=require(_0x0d3f('0x2'));var controller=require(_0x0d3f('0x3'));router[_0x0d3f('0x4')]('/',auth['isAuthenticated'](),controller[_0x0d3f('0x5')]);router['get'](_0x0d3f('0x6'),auth[_0x0d3f('0x7')](),controller['show']);router[_0x0d3f('0x8')]('/',auth[_0x0d3f('0x7')](),controller['create']);router['post'](_0x0d3f('0x9'),auth[_0x0d3f('0x7')](),controller[_0x0d3f('0xa')]);router['put'](_0x0d3f('0x6'),auth[_0x0d3f('0x7')](),controller[_0x0d3f('0xb')]);router[_0x0d3f('0xc')](_0x0d3f('0x6'),auth[_0x0d3f('0x7')](),controller[_0x0d3f('0xd')]);module[_0x0d3f('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index c5c1a2e..3c3cfbf 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 _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 +var _0x8bc0=['ENUM','inbound','outbound','outbound-fax','system','INTEGER','BOOLEAN','wav','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex','NoOp'];(function(_0x11b1bd,_0x442ad5){var _0x31f533=function(_0x4e4e80){while(--_0x4e4e80){_0x11b1bd['push'](_0x11b1bd['shift']());}};_0x31f533(++_0x442ad5);}(_0x8bc0,0xeb));var _0x08bc=function(_0x41e8bb,_0x4681f1){_0x41e8bb=_0x41e8bb-0x0;var _0x6c9c91=_0x8bc0[_0x41e8bb];return _0x6c9c91;};'use strict';var Sequelize=require(_0x08bc('0x0'));module[_0x08bc('0x1')]={'context':{'type':Sequelize[_0x08bc('0x2')],'allowNull':![],'unique':_0x08bc('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x08bc('0x2')],'allowNull':![],'unique':_0x08bc('0x3')},'priority':{'type':Sequelize[_0x08bc('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x08bc('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x08bc('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x08bc('0x5')](_0x08bc('0x6'),_0x08bc('0x7'),'internal','inbound-fax',_0x08bc('0x8'),_0x08bc('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x08bc('0x2')]},'interval':{'type':Sequelize[_0x08bc('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x08bc('0xa')]},'isApp':{'type':Sequelize[_0x08bc('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x08bc('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x08bc('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x08bc('0xa')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x08bc('0xc')},'answer':{'type':Sequelize[_0x08bc('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x08bc('0xd')],'get':function(_0xad7af0){return this['getDataValue'](_0x08bc('0xe'));}},'alias':{'type':Sequelize[_0x08bc('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 2a0ff7d..1b3e2d3 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 _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 +var _0x21b1=['userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','findOne','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','ioredis','../../config/logger','api','redis','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','destroy','then','get','InboundRoutes','OutboundRoutes','outbound','internal','ignore','map','value','includes','type','find','name','UserProfileResource','error','send','VoiceExtension','fieldName','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','options','includeAll','include','findAll','show','params','rawAttributes','create','body','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x21b1,0xbe));var _0x121b=function(_0x16d9db,_0x151ce0){_0x16d9db=_0x16d9db-0x0;var _0x2942a7=_0x21b1[_0x16d9db];return _0x2942a7;};'use strict';var _=require('lodash');var Redis=require(_0x121b('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x121b('0x1'))(_0x121b('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x121b('0x3')]=_['defaults'](config[_0x121b('0x3')],{'host':_0x121b('0x4'),'port':0x18eb});var socket=require(_0x121b('0x5'))(new Redis(config['redis']));require(_0x121b('0x6'))['register'](socket);function respondWithStatusCode(_0x2c4e24,_0x149075){_0x149075=_0x149075||0xcc;return function(_0x4bd1d0){if(_0x4bd1d0){return _0x2c4e24[_0x121b('0x7')](_0x149075);}return _0x2c4e24[_0x121b('0x8')](_0x149075)[_0x121b('0x9')]();};}function respondWithResult(_0x25dd04,_0x28a6db){_0x28a6db=_0x28a6db||0xc8;return function(_0x4ca365){if(_0x4ca365){return _0x25dd04['status'](_0x28a6db)['json'](_0x4ca365);}};}function respondWithFilteredResult(_0x43f6e5,_0x278d0a){return function(_0x12a445){if(_0x12a445){var _0x59dee6=typeof _0x278d0a[_0x121b('0xa')]===_0x121b('0xb')&&typeof _0x278d0a[_0x121b('0xc')]===_0x121b('0xb');var _0x23174d=_0x12a445['count'];var _0x16bf5c=_0x59dee6?0x0:_0x278d0a[_0x121b('0xa')];var _0x1e4c13=_0x59dee6?_0x12a445[_0x121b('0xd')]:_0x278d0a[_0x121b('0xa')]+_0x278d0a['limit'];var _0x29bc5e;if(_0x1e4c13>=_0x23174d){_0x1e4c13=_0x23174d;_0x29bc5e=0xc8;}else{_0x29bc5e=0xce;}_0x43f6e5['status'](_0x29bc5e);return _0x43f6e5[_0x121b('0xe')](_0x121b('0xf'),_0x16bf5c+'-'+_0x1e4c13+'/'+_0x23174d)[_0x121b('0x10')](_0x12a445);}return null;};}function removeEntity(_0x5a34bc){return function(_0x3d37cf){if(_0x3d37cf){return _0x3d37cf[_0x121b('0x11')]()[_0x121b('0x12')](function(){var _0x361d74=_0x3d37cf[_0x121b('0x13')]({'plain':!![]});var _0x5ef87c=[{'name':_0x121b('0x14'),'value':'inbound','ignore':![]},{'name':_0x121b('0x15'),'value':_0x121b('0x16'),'ignore':![]},{'name':'InternalRoutes','value':_0x121b('0x17'),'ignore':![]}];var _0x355ca7=_(_0x5ef87c)['filter'](_0x121b('0x18'))[_0x121b('0x19')](_0x121b('0x1a'))[_0x121b('0x1a')]();if(_[_0x121b('0x1b')](_0x355ca7,_0x361d74[_0x121b('0x1c')])){return;}var _0x35a1f4=_[_0x121b('0x1d')](_0x5ef87c,[_0x121b('0x1a'),_0x361d74[_0x121b('0x1c')]])[_0x121b('0x1e')];return db[_0x121b('0x1f')][_0x121b('0x11')]({'where':{'type':_0x35a1f4,'resourceId':_0x361d74['id']}})[_0x121b('0x12')](function(){return _0x3d37cf;});})['then'](function(){_0x5a34bc[_0x121b('0x8')](0xcc)[_0x121b('0x9')]();});}};}function handleEntityNotFound(_0x5a0c41){return function(_0x3e71b7){if(!_0x3e71b7){_0x5a0c41[_0x121b('0x7')](0x194);}return _0x3e71b7;};}function handleError(_0x3acedc,_0x500c0c){_0x500c0c=_0x500c0c||0x1f4;return function(_0x3233bc){logger[_0x121b('0x20')](_0x3233bc['stack']);if(_0x3233bc[_0x121b('0x1e')]){delete _0x3233bc[_0x121b('0x1e')];}_0x3acedc[_0x121b('0x8')](_0x500c0c)[_0x121b('0x21')](_0x3233bc);};}exports['index']=function(_0x5eb692,_0x461b92){var _0x579132={},_0x135fac={},_0x1f964f={'count':0x0,'rows':[]};var _0x511306=_[_0x121b('0x19')](db[_0x121b('0x22')]['rawAttributes'],function(_0x2edb3d){return{'name':_0x2edb3d[_0x121b('0x23')],'type':_0x2edb3d['type'][_0x121b('0x24')]};});_0x135fac[_0x121b('0x25')]=_[_0x121b('0x19')](_0x511306,'name');_0x135fac['query']=_[_0x121b('0x26')](_0x5eb692[_0x121b('0x27')]);_0x135fac['filters']=_['intersection'](_0x135fac[_0x121b('0x25')],_0x135fac[_0x121b('0x27')]);_0x579132[_0x121b('0x28')]=_['intersection'](_0x135fac[_0x121b('0x25')],qs[_0x121b('0x29')](_0x5eb692['query'][_0x121b('0x29')]));_0x579132[_0x121b('0x28')]=_0x579132['attributes']['length']?_0x579132[_0x121b('0x28')]:_0x135fac['model'];if(!_0x5eb692[_0x121b('0x27')][_0x121b('0x2a')](_0x121b('0x2b'))){_0x579132[_0x121b('0xc')]=qs[_0x121b('0xc')](_0x5eb692[_0x121b('0x27')][_0x121b('0xc')]);_0x579132[_0x121b('0xa')]=qs[_0x121b('0xa')](_0x5eb692['query'][_0x121b('0xa')]);}_0x579132[_0x121b('0x2c')]=qs['sort'](_0x5eb692['query']['sort']);_0x579132[_0x121b('0x2d')]=qs['filters'](_[_0x121b('0x2e')](_0x5eb692[_0x121b('0x27')],_0x135fac[_0x121b('0x2f')]),_0x511306);if(_0x5eb692[_0x121b('0x27')][_0x121b('0x30')]){_0x579132[_0x121b('0x2d')]=_[_0x121b('0x31')](_0x579132['where'],{'$or':_[_0x121b('0x19')](_0x511306,function(_0x1d049d){if(_0x1d049d[_0x121b('0x1c')]!=='VIRTUAL'){var _0xc0cc5b={};_0xc0cc5b[_0x1d049d['name']]={'$like':'%'+_0x5eb692[_0x121b('0x27')]['filter']+'%'};return _0xc0cc5b;}})});}_0x579132=_[_0x121b('0x31')]({},_0x579132,_0x5eb692[_0x121b('0x32')]);var _0x51beca={'where':_0x579132['where']};return db[_0x121b('0x22')][_0x121b('0xd')](_0x51beca)[_0x121b('0x12')](function(_0x389d01){_0x1f964f[_0x121b('0xd')]=_0x389d01;if(_0x5eb692[_0x121b('0x27')][_0x121b('0x33')]){_0x579132[_0x121b('0x34')]=[{'all':!![]}];}return db[_0x121b('0x22')][_0x121b('0x35')](_0x579132);})['then'](function(_0x685742){_0x1f964f['rows']=_0x685742;return _0x1f964f;})[_0x121b('0x12')](respondWithFilteredResult(_0x461b92,_0x579132))['catch'](handleError(_0x461b92,null));};exports[_0x121b('0x36')]=function(_0x489a4e,_0x2aa6b0){var _0x477acd={'raw':![],'where':{'id':_0x489a4e[_0x121b('0x37')]['id']}},_0x4700e={};_0x4700e['model']=_[_0x121b('0x26')](db[_0x121b('0x22')][_0x121b('0x38')]);_0x4700e[_0x121b('0x27')]=_['keys'](_0x489a4e[_0x121b('0x27')]);_0x4700e[_0x121b('0x2f')]=_['intersection'](_0x4700e[_0x121b('0x25')],_0x4700e[_0x121b('0x27')]);_0x477acd[_0x121b('0x28')]=_['intersection'](_0x4700e['model'],qs['fields'](_0x489a4e[_0x121b('0x27')][_0x121b('0x29')]));_0x477acd[_0x121b('0x28')]=_0x477acd[_0x121b('0x28')]['length']?_0x477acd[_0x121b('0x28')]:_0x4700e['model'];if(_0x489a4e[_0x121b('0x27')][_0x121b('0x33')]){_0x477acd['include']=[{'all':!![]}];}_0x477acd=_[_0x121b('0x31')]({},_0x477acd,_0x489a4e[_0x121b('0x32')]);return db[_0x121b('0x22')][_0x121b('0x1d')](_0x477acd)['then'](handleEntityNotFound(_0x2aa6b0,null))['then'](respondWithResult(_0x2aa6b0,null))['catch'](handleError(_0x2aa6b0,null));};exports[_0x121b('0x11')]=function(_0x4b8e15,_0x5eed84){return db[_0x121b('0x22')]['find']({'where':{'id':_0x4b8e15[_0x121b('0x37')]['id']}})[_0x121b('0x12')](handleEntityNotFound(_0x5eed84,null))[_0x121b('0x12')](removeEntity(_0x5eed84,null))['catch'](handleError(_0x5eed84,null));};exports[_0x121b('0x39')]=function(_0xdbf292,_0x40ae69){if(_0xdbf292[_0x121b('0x3a')][_0x121b('0x1c')]==='outbound'&&!_[_0x121b('0x3b')](_0xdbf292['body']['exten'],'_')){_0xdbf292[_0x121b('0x3a')][_0x121b('0x3c')]='_'['concat'](_0xdbf292['body'][_0x121b('0x3c')]);}return db[_0x121b('0x22')][_0x121b('0x39')](_0xdbf292['body'],{'raw':![]})[_0x121b('0x12')](function(_0x155370){var _0x1dd225=_0xdbf292[_0x121b('0x3d')][_0x121b('0x13')]({'plain':!![]});if(!_0x1dd225)throw new Error(_0x121b('0x3e'));if(_0x1dd225[_0x121b('0x3f')]==='user'){var _0x136f0e=_0x155370['get']({'plain':!![]});var _0x5223c1=[{'name':_0x121b('0x14'),'value':'inbound'},{'name':_0x121b('0x15'),'value':_0x121b('0x16')},{'name':'InternalRoutes','value':'internal'}];var _0x1c0647=_[_0x121b('0x1d')](_0x5223c1,[_0x121b('0x1a'),_0x136f0e[_0x121b('0x1c')]])[_0x121b('0x1e')];return db[_0x121b('0x40')]['find']({'where':{'name':_0x1c0647,'userProfileId':_0x1dd225[_0x121b('0x41')]},'raw':!![]})[_0x121b('0x12')](function(_0x46494d){if(_0x46494d&&_0x46494d[_0x121b('0x42')]===0x0){return db[_0x121b('0x1f')]['create']({'name':_0x136f0e[_0x121b('0x1e')],'resourceId':_0x136f0e['id'],'type':_0x46494d[_0x121b('0x1e')],'sectionId':_0x46494d['id']},{})['then'](function(){return _0x155370;});}else{return _0x155370;}})[_0x121b('0x43')](function(_0x44140f){logger['error'](_0x121b('0x44'),_0x44140f);throw _0x44140f;});}return _0x155370;})[_0x121b('0x12')](respondWithResult(_0x40ae69,0xc9))['catch'](handleError(_0x40ae69,null));};exports['update']=function(_0x313822,_0x586152){if(_0x313822[_0x121b('0x3a')]['id']){delete _0x313822[_0x121b('0x3a')]['id'];}return db[_0x121b('0x22')][_0x121b('0x1d')]({'where':{'id':_0x313822[_0x121b('0x37')]['id']}})[_0x121b('0x12')](handleEntityNotFound(_0x586152,null))[_0x121b('0x12')](function(_0x2ce90d){if(_0x2ce90d){return db[_0x121b('0x22')][_0x121b('0x45')](_[_0x121b('0x2e')](_0x313822[_0x121b('0x3a')],[_0x121b('0x3c'),_0x121b('0x46'),_0x121b('0x47'),_0x121b('0x48'),'cutdigits',_0x121b('0x49'),_0x121b('0x4a')]),{'where':{'context':_0x2ce90d[_0x121b('0x46')],'exten':_0x2ce90d[_0x121b('0x3c')]},'individualHooks':!![]})[_0x121b('0x12')](function(_0x4f889b){return _0x4f889b;});}return null;})[_0x121b('0x12')](respondWithStatusCode(_0x586152,null))[_0x121b('0x43')](handleError(_0x586152,null));};exports[_0x121b('0x4b')]=function(_0x381e0b,_0x436597){var _0x2c4e78=_0x381e0b[_0x121b('0x37')]['id'];var _0x17d741=_0x381e0b['body'];var _0x2c3304=0xc8;var _0x13f9fb=null;return db[_0x121b('0x4c')][_0x121b('0x4d')]({'isolationLevel':db['sequelize'][_0x121b('0x4e')][_0x121b('0x4f')]['READ_COMMITTED']},function(_0xb82b3a){return db[_0x121b('0x22')][_0x121b('0x50')]({'where':{'id':_0x2c4e78},'transaction':_0xb82b3a})[_0x121b('0x12')](function(_0x23f4d4){if(_0x23f4d4){return db[_0x121b('0x22')][_0x121b('0x11')]({'where':{'VoiceExtensionId':_0x2c4e78},'transaction':_0xb82b3a})[_0x121b('0x12')](function(){var _0xd628e4=_['map'](_0x17d741,function(_0x50a5be){_0x50a5be['VoiceExtensionId']=_0x2c4e78;_0x50a5be['isApp']=!![];return _0x50a5be;});return _0x23f4d4['createRouting'](_0xd628e4);})[_0x121b('0x12')](function(_0x58e023){return db[_0x121b('0x22')][_0x121b('0x51')](_0x58e023,{'transaction':_0xb82b3a});});}else{_0x2c3304=0x194;_0x13f9fb=[];}});})['then'](function(){if(_0x2c3304!==0x194){return db[_0x121b('0x22')][_0x121b('0x52')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2c4e78},'order':_0x121b('0x53')})['then'](function(_0xc33272){_0x13f9fb=_0xc33272;});}})[_0x121b('0x43')](function(_0x1822f1){_0x2c3304=0x1f4;logger[_0x121b('0x20')](_0x1822f1['stack']);if(_0x1822f1[_0x121b('0x1e')]){delete _0x1822f1[_0x121b('0x1e')];}_0x13f9fb=_0x1822f1;})[_0x121b('0x54')](function(){if(_0x13f9fb===null){_0x436597[_0x121b('0x7')](_0x2c3304);}else{if(_0x2c3304===0x1f4){_0x436597[_0x121b('0x8')](_0x2c3304)[_0x121b('0x21')](_0x13f9fb);}else{_0x436597[_0x121b('0x8')](_0x2c3304)[_0x121b('0x10')](_0x13f9fb);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 57e7895..7961e4d 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 _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 +var _0x952e=['setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x552f0d,_0x2fbe51){var _0x5dfe61=function(_0x33a88d){while(--_0x33a88d){_0x552f0d['push'](_0x552f0d['shift']());}};_0x5dfe61(++_0x2fbe51);}(_0x952e,0x13a));var _0xe952=function(_0x1c47e3,_0x152257){_0x1c47e3=_0x1c47e3-0x0;var _0x464435=_0x952e[_0x1c47e3];return _0x464435;};'use strict';var EventEmitter=require(_0xe952('0x0'));var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xe952('0x1')](0x0);var events={'afterCreate':_0xe952('0x2'),'afterUpdate':_0xe952('0x3'),'afterDestroy':_0xe952('0x4')};function emitEvent(_0x4551bd){return function(_0x23eb74,_0xbe3dc4,_0x364fa9){VoiceExtensionEvents[_0xe952('0x5')](_0x4551bd+':'+_0x23eb74['id'],_0x23eb74);VoiceExtensionEvents[_0xe952('0x5')](_0x4551bd,_0x23eb74);_0x364fa9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xe952('0x6')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index dbbcfe8..76c446d 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 _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 +var _0x1560=['splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','Hangup','lodash','exports','models','type','Set','CDR(type)=','context','exten','alias','CDR(routeAlias)=','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','NoOp','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','split','length','name','param','phone','prefix','SIP','join','U(xcally-mixmonitor-context)','replace','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1'];(function(_0x372aa1,_0x3d3204){var _0x527665=function(_0x5989fc){while(--_0x5989fc){_0x372aa1['push'](_0x372aa1['shift']());}};_0x527665(++_0x3d3204);}(_0x1560,0x155));var _0x0156=function(_0x595f7d,_0x46f9ef){_0x595f7d=_0x595f7d-0x0;var _0x4110e4=_0x1560[_0x595f7d];return _0x4110e4;};'use strict';var _=require(_0x0156('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x0156('0x1')]=function(_0x4289b2){var _0x267300=_0x4289b2[_0x0156('0x2')];function _0x4bce82(_0x10f15e){var _0x27218f=0x2;var _0x2f8610=[{'type':_0x10f15e[_0x0156('0x3')],'app':_0x0156('0x4'),'appdata':_0x0156('0x5')+_0x10f15e[_0x0156('0x3')],'context':_0x10f15e[_0x0156('0x6')],'exten':_0x10f15e[_0x0156('0x7')],'priority':_0x27218f++,'VoiceExtensionId':_0x10f15e['id']},{'type':_0x10f15e[_0x0156('0x3')],'app':_0x10f15e[_0x0156('0x8')]?_0x0156('0x4'):'NoOp','appdata':_0x10f15e[_0x0156('0x8')]?_0x0156('0x9')+_0x10f15e[_0x0156('0x8')]:'No\x20alias\x20set','context':_0x10f15e[_0x0156('0x6')],'exten':_0x10f15e['exten'],'priority':_0x27218f++,'VoiceExtensionId':_0x10f15e['id']}];if(_0x10f15e['type']===_0x0156('0xa')){_0x2f8610[_0x0156('0xb')]({'type':_0x0156('0xa'),'app':_0x0156('0x4'),'appdata':_0x0156('0xc')+_0x10f15e['id'],'context':_0x10f15e[_0x0156('0x6')],'exten':_0x10f15e[_0x0156('0x7')],'priority':_0x27218f++,'VoiceExtensionId':_0x10f15e['id']});}_0x2f8610[_0x0156('0xb')]({'type':_0x10f15e[_0x0156('0x3')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x10f15e[_0x0156('0x6')],'exten':_0x10f15e[_0x0156('0x7')],'priority':_0x27218f++,'VoiceExtensionId':_0x10f15e['id']},{'type':_0x10f15e['type'],'app':_0x0156('0x4'),'appdata':_0x0156('0xd'),'context':_0x10f15e[_0x0156('0x6')],'exten':_0x10f15e['exten'],'priority':_0x27218f++,'VoiceExtensionId':_0x10f15e['id']},{'type':_0x10f15e['type'],'app':_0x0156('0x4'),'appdata':_0x0156('0xe'),'context':_0x10f15e[_0x0156('0x6')],'exten':_0x10f15e['exten'],'priority':_0x27218f++,'VoiceExtensionId':_0x10f15e['id']});return _0x2f8610;}function _0x435684(_0x58208a){var _0x266451=0x2;var _0x413472=[{'type':_0x0156('0xf'),'app':_0x0156('0x4'),'appdata':'CDR(type)=outbound','context':_0x58208a[_0x0156('0x6')],'exten':_0x58208a[_0x0156('0x7')],'priority':_0x266451++,'VoiceExtensionId':_0x58208a['id']},{'type':_0x0156('0xf'),'app':_0x58208a[_0x0156('0x8')]?_0x0156('0x4'):_0x0156('0x10'),'appdata':_0x58208a['alias']?_0x0156('0x9')+_0x58208a['alias']:'No\x20alias\x20set','context':_0x58208a[_0x0156('0x6')],'exten':_0x58208a[_0x0156('0x7')],'priority':_0x266451++,'VoiceExtensionId':_0x58208a['id']},{'type':_0x0156('0xf'),'app':'Set','appdata':_0x0156('0x11')+(_0x58208a[_0x0156('0x12')]?_0x0156('0x13')+_0x58208a['cutdigits']+'}':_0x0156('0x14')),'context':_0x58208a['context'],'exten':_0x58208a[_0x0156('0x7')],'priority':_0x266451++,'VoiceExtensionId':_0x58208a['id']},{'type':_0x0156('0xf'),'app':_0x0156('0x4'),'appdata':_0x0156('0xc')+_0x58208a['id'],'context':_0x58208a['context'],'exten':_0x58208a[_0x0156('0x7')],'priority':_0x266451++,'VoiceExtensionId':_0x58208a['id']},{'type':_0x0156('0xf'),'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x266451+0x2)+_0x0156('0x15')+(_0x266451+0x1)+')','context':_0x58208a['context'],'exten':_0x58208a['exten'],'priority':_0x266451++,'VoiceExtensionId':_0x58208a['id']},{'type':_0x0156('0xf'),'app':'Set','appdata':_0x58208a['cutdigits']?_0x0156('0x16')+_0x58208a[_0x0156('0x12')]+'}':_0x0156('0x17'),'context':_0x58208a[_0x0156('0x6')],'exten':_0x58208a['exten'],'priority':_0x266451++,'VoiceExtensionId':_0x58208a['id']},{'type':_0x0156('0xf'),'app':_0x0156('0x4'),'appdata':_0x0156('0x18'),'context':_0x58208a[_0x0156('0x6')],'exten':_0x58208a[_0x0156('0x7')],'priority':_0x266451++,'VoiceExtensionId':_0x58208a['id']},{'type':_0x0156('0xf'),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x58208a[_0x0156('0x6')],'exten':_0x58208a[_0x0156('0x7')],'priority':_0x266451++,'VoiceExtensionId':_0x58208a['id']},{'type':_0x0156('0xf'),'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x58208a['context'],'exten':_0x58208a[_0x0156('0x7')],'priority':_0x266451++,'VoiceExtensionId':_0x58208a['id']},{'type':'outbound','app':_0x0156('0x4'),'appdata':_0x0156('0x19')+_0x58208a['id'],'context':_0x58208a[_0x0156('0x6')],'exten':_0x58208a[_0x0156('0x7')],'priority':_0x266451++,'VoiceExtensionId':_0x58208a['id']}];if(_0x58208a['hasOwnProperty'](_0x0156('0x1a'))&&_0x58208a[_0x0156('0x1a')]!==_0x0156('0x1b')){_0x413472[_0x0156('0xb')]({'type':_0x0156('0xf'),'app':_0x0156('0x4'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x58208a[_0x0156('0x6')],'exten':_0x58208a[_0x0156('0x7')],'priority':_0x266451++,'VoiceExtensionId':_0x58208a['id']},{'type':_0x0156('0xf'),'app':'Set','appdata':_0x0156('0x1c')+_0x58208a[_0x0156('0x1a')]||_0x0156('0x1d'),'context':_0x58208a[_0x0156('0x6')],'exten':_0x58208a['exten'],'priority':_0x266451++,'VoiceExtensionId':_0x58208a['id']});}return _0x413472;}function _0x240e31(_0xcd74b8,_0x3dabd3){var _0x31a307=[{'name':_0x0156('0x1e'),'param':0x0},{'name':_0x0156('0x1f'),'param':0x1},{'name':_0x0156('0x20'),'param':0x2},{'name':'url','param':0x3}];var _0x8b4197={};var _0xa13028=_0x3dabd3[_0x0156('0x21')](',');var _0x19e714=[];for(var _0x5df9da=0x0;_0x5df9da<_0x31a307[_0x0156('0x22')];_0x5df9da++){switch(_0x31a307[_0x5df9da][_0x0156('0x23')]){case _0x0156('0x1e'):_0x8b4197[_0x0156('0x1e')]=_0xa13028[_0x31a307[_0x5df9da][_0x0156('0x24')]][_0x0156('0x21')]('/')[0x1];_0x8b4197[_0x0156('0x25')]=_0xa13028[_0x31a307[_0x5df9da][_0x0156('0x24')]][_0x0156('0x21')]('/')[0x2];_0x8b4197[_0x0156('0x26')]=_0x8b4197[_0x0156('0x25')]?_0x8b4197[_0x0156('0x25')]['split']('$')[0x0]:undefined;_0x8b4197['phone']=_0xcd74b8['cutdigits']?(_0x8b4197['prefix']||'')+_0x0156('0x13')+_0xcd74b8['cutdigits']+'}':(_0x8b4197['prefix']||'')+_0x0156('0x14');_0x19e714[_0x31a307[_0x5df9da][_0x0156('0x24')]]=[_0x0156('0x27'),_0x8b4197[_0x0156('0x1e')],_0x8b4197[_0x0156('0x25')]][_0x0156('0x28')]('/');break;case _0x0156('0x20'):_0x8b4197[_0x0156('0x20')]=_0xa13028[_0x31a307[_0x5df9da][_0x0156('0x24')]];if(_0xcd74b8[_0x0156('0x1a')]!=='none'){if(_0x8b4197[_0x0156('0x20')]['indexOf'](_0x0156('0x29'))<0x0){_0x8b4197[_0x0156('0x20')]+=_0x0156('0x29');}}else{_0x8b4197['options']=_0x8b4197[_0x0156('0x20')][_0x0156('0x2a')](_0x0156('0x29'),'');}_0x19e714[_0x31a307[_0x5df9da][_0x0156('0x24')]]=_0x8b4197[_0x0156('0x20')];break;default:_0x19e714[_0x31a307[_0x5df9da][_0x0156('0x24')]]=_0xa13028[_0x31a307[_0x5df9da][_0x0156('0x24')]];}}return _0x19e714[_0x0156('0x28')](',');}function _0x546a09(_0x52cfd3,_0x55d2f4,_0xc5a539){return new Promise(function(_0x5b3db5,_0x445c14){var _0x4e06ab=[];if(_['isEmpty'](_0x55d2f4))return _0x5b3db5(_0x4e06ab);_0x267300[_0x0156('0x2b')][_0x0156('0x2c')]({'attributes':['id',_0x0156('0x2d'),_0x0156('0x2e')],'raw':!![]})[_0x0156('0x2f')](function(_0x3bb06c){for(var _0xe8e27f=0x0,_0x15c881=0x0;_0xe8e27f<_0x55d2f4[_0x0156('0x22')];_0xe8e27f++,_0x15c881=0x0){var _0x44e2c6=_0x55d2f4[_0xe8e27f];var _0x1fea57=[];var _0x49fb80=[];delete _0x44e2c6['id'];if(_0x44e2c6['interval']!==_0x0156('0x30')){_0x44e2c6[_0x0156('0x31')]=[_0x44e2c6[_0x0156('0x2d')]];}else{_0x44e2c6[_0x0156('0x31')]=_0x44e2c6[_0x0156('0x2e')]?_['map'](_[_0x0156('0x32')](_0x3bb06c,{'IntervalId':_0x44e2c6[_0x0156('0x2e')]}),'interval'):[];}_0x44e2c6[_0x0156('0x6')]=_0x52cfd3[_0x0156('0x6')];_0x44e2c6[_0x0156('0x7')]=_0x52cfd3[_0x0156('0x7')];if(_0x44e2c6[_0x0156('0x3')])_0x44e2c6['type']=_0x44e2c6[_0x0156('0x3')][_0x0156('0x33')]();if(_0x52cfd3['type']===_0x0156('0xf')){if(_0x44e2c6[_0x0156('0x34')](_0x0156('0x35'))&&_0x44e2c6[_0x0156('0x35')]&&_0x44e2c6[_0x0156('0x35')]!=='--'){_0x1fea57['push']({'type':_0x44e2c6[_0x0156('0x3')][_0x0156('0x33')](),'app':_0x0156('0x4'),'appdata':_0x0156('0x36')+_0x44e2c6[_0x0156('0x35')],'context':_0x52cfd3[_0x0156('0x6')],'exten':_0x52cfd3[_0x0156('0x7')],'priority':_0x44e2c6['intervals'][_0x0156('0x22')]+_0xc5a539+_0x15c881++,'VoiceExtensionId':_0x52cfd3['id']});}_0x1fea57['push']({'type':_0x44e2c6[_0x0156('0x3')][_0x0156('0x33')](),'app':_0x0156('0x37'),'appdata':_0x0156('0x38')+(_0x44e2c6[_0x0156('0x39')]?'Set(CALLERID(all)='+_0x44e2c6['callerID']+')':_0x0156('0x3a')),'context':_0x52cfd3[_0x0156('0x6')],'exten':_0x52cfd3['exten'],'priority':_0x44e2c6[_0x0156('0x31')][_0x0156('0x22')]+_0xc5a539+_0x15c881++,'VoiceExtensionId':_0x52cfd3['id']});}else{if(_0x44e2c6[_0x0156('0x34')](_0x0156('0x3b'))){if([_0x0156('0x3c'),_0x0156('0x3d')][_0x0156('0x3e')](_0x44e2c6[_0x0156('0x3f')][_0x0156('0x33')]())&&_0x44e2c6[_0x0156('0x40')]!=='custom'){if(_0x44e2c6['answer']){_0x1fea57[_0x0156('0xb')]({'type':_0x44e2c6[_0x0156('0x3')][_0x0156('0x33')](),'app':_0x0156('0x37'),'appdata':_0x0156('0x41'),'context':_0x52cfd3['context'],'exten':_0x52cfd3['exten'],'priority':_0x44e2c6[_0x0156('0x31')]['length']+_0xc5a539+_0x15c881++,'VoiceExtensionId':_0x52cfd3['id']});_0x1fea57[_0x0156('0xb')]({'type':_0x44e2c6[_0x0156('0x3')]['toLowerCase'](),'app':'Set','appdata':_0x0156('0x42'),'context':_0x52cfd3[_0x0156('0x6')],'exten':_0x52cfd3[_0x0156('0x7')],'priority':_0x44e2c6[_0x0156('0x31')][_0x0156('0x22')]+_0xc5a539+_0x15c881++,'VoiceExtensionId':_0x52cfd3['id']});}else{_0x1fea57[_0x0156('0xb')]({'type':_0x44e2c6[_0x0156('0x3')][_0x0156('0x33')](),'app':_0x0156('0x37'),'appdata':_0x0156('0x43'),'context':_0x52cfd3[_0x0156('0x6')],'exten':_0x52cfd3[_0x0156('0x7')],'priority':_0x44e2c6[_0x0156('0x31')]['length']+_0xc5a539+_0x15c881++,'VoiceExtensionId':_0x52cfd3['id']});_0x1fea57[_0x0156('0xb')]({'type':_0x44e2c6[_0x0156('0x3')]['toLowerCase'](),'app':_0x0156('0x4'),'appdata':_0x0156('0x44'),'context':_0x52cfd3['context'],'exten':_0x52cfd3[_0x0156('0x7')],'priority':_0x44e2c6['intervals'][_0x0156('0x22')]+_0xc5a539+_0x15c881++,'VoiceExtensionId':_0x52cfd3['id']});}}}}for(var _0x116036=0x0;_0x116036<_0x44e2c6[_0x0156('0x31')][_0x0156('0x22')];_0x116036++){var _0x6bfd5f=_0xc5a539+_0x44e2c6[_0x0156('0x31')][_0x0156('0x22')];var _0x1304db=_0x116036===_0x44e2c6[_0x0156('0x31')]['length']-0x1?_0xc5a539+_0x1fea57[_0x0156('0x22')]+_0x49fb80[_0x0156('0x22')]+0x2:_0xc5a539+_0x116036+0x1;_0x1fea57[_0x0156('0x45')](_0x116036,0x0,{'type':_0x52cfd3['type'],'app':_0x0156('0x46'),'appdata':_0x44e2c6['intervals'][_0x116036]+'?'+_0x52cfd3[_0x0156('0x6')]+_0x0156('0x47')+_0x6bfd5f+':'+_0x52cfd3[_0x0156('0x6')]+',${EXTEN},'+_0x1304db,'exten':_0x52cfd3[_0x0156('0x7')],'context':_0x52cfd3['context'],'priority':_0xc5a539+_0x116036,'VoiceExtensionId':_0x52cfd3['id']});}if(_0x44e2c6['appType']===_0x0156('0x48'))_0x44e2c6[_0x0156('0x49')]=_0x240e31(_0x52cfd3,_0x44e2c6[_0x0156('0x49')]);_0x44e2c6[_0x0156('0x4a')]=_0x1fea57[_0x0156('0x22')]?_[_0x0156('0x4b')](_0x1fea57)[_0x0156('0x4a')]+0x1:_0xc5a539;_0x4e06ab=_[_0x0156('0x4c')](_0x4e06ab,_0x1fea57,[_0x44e2c6],_0x49fb80);_0xc5a539=_[_0x0156('0x4b')](_0x4e06ab)[_0x0156('0x4a')]+0x1;}return _0x5b3db5(_0x4e06ab);})[_0x0156('0x4d')](function(_0x185a88){_0x445c14(_0x185a88);});});}return _0x4289b2[_0x0156('0x4e')](_0x0156('0x4f'),attributes,{'tableName':_0x0156('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x2ebaf8){var _0x551972=this['get']({'plain':!![]});var _0x3042c0=_0x551972['type']===_0x0156('0xf')?_0x435684(_0x551972):_0x4bce82(_0x551972);return _0x546a09(_0x551972,_0x2ebaf8,_[_0x0156('0x4b')](_0x3042c0)['priority']+0x1)[_0x0156('0x2f')](function(_0x5c3429){var _0x5a4233=_[_0x0156('0x4c')](_0x3042c0,_0x5c3429);_0x5a4233[_0x0156('0xb')]({'type':_0x551972[_0x0156('0x3')],'app':_0x0156('0x51'),'exten':_0x551972[_0x0156('0x7')],'context':_0x551972[_0x0156('0x6')],'priority':_[_0x0156('0x4b')](_0x5a4233)[_0x0156('0x4a')]+0x1,'VoiceExtensionId':_0x551972['id']});return _0x5a4233;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 981bd53..10ee005 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 _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 +var _0x7f27=['result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','debug','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','VoiceExtension,\x20%s,\x20%s','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x35aebb,_0x5d8503){var _0x326b32=function(_0x16f7c5){while(--_0x16f7c5){_0x35aebb['push'](_0x35aebb['shift']());}};_0x326b32(++_0x5d8503);}(_0x7f27,0x12e));var _0x77f2=function(_0x1b7a10,_0x5785cb){_0x1b7a10=_0x1b7a10-0x0;var _0x43d448=_0x7f27[_0x1b7a10];return _0x43d448;};'use strict';var _=require(_0x77f2('0x0'));var util=require(_0x77f2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x77f2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x77f2('0x3'));var logger=require(_0x77f2('0x4'))(_0x77f2('0x5'));var config=require('../../config/environment');var jayson=require(_0x77f2('0x6'));var client=jayson['client'][_0x77f2('0x7')]({'port':0x232a});config[_0x77f2('0x8')]=_['defaults'](config[_0x77f2('0x8')],{'host':_0x77f2('0x9'),'port':0x18eb});var socket=require(_0x77f2('0xa'))(new Redis(config[_0x77f2('0x8')]));require('./voiceExtension.socket')[_0x77f2('0xb')](socket);function respondWithRpcPromise(_0x10c244,_0x5767cb,_0x24e730){return new BPromise(function(_0x10a5fe,_0x265791){return client[_0x77f2('0xc')](_0x10c244,_0x24e730)[_0x77f2('0xd')](function(_0x126dcf){logger['info'](_0x77f2('0xe'),_0x5767cb,'request\x20sent');logger['debug'](_0x77f2('0xf'),_0x5767cb,_0x77f2('0x10'),JSON[_0x77f2('0x11')](_0x126dcf));if(_0x126dcf[_0x77f2('0x12')]){if(_0x126dcf[_0x77f2('0x12')][_0x77f2('0x13')]===0x1f4){logger['error'](_0x77f2('0xe'),_0x5767cb,_0x126dcf[_0x77f2('0x12')][_0x77f2('0x14')]);return _0x265791(_0x126dcf[_0x77f2('0x12')][_0x77f2('0x14')]);}logger[_0x77f2('0x12')](_0x77f2('0xe'),_0x5767cb,_0x126dcf[_0x77f2('0x12')][_0x77f2('0x14')]);return _0x10a5fe(_0x126dcf['error'][_0x77f2('0x14')]);}else{logger[_0x77f2('0x15')](_0x77f2('0xe'),_0x5767cb,_0x77f2('0x10'));_0x10a5fe(_0x126dcf[_0x77f2('0x16')]['message']);}})[_0x77f2('0x17')](function(_0x296900){logger[_0x77f2('0x12')](_0x77f2('0xe'),_0x5767cb,_0x296900);_0x265791(_0x296900);});});}exports[_0x77f2('0x18')]=function(_0x15c7eb){var _0x291633=this;return new Promise(function(_0x171b37,_0x3a8ce2){return db[_0x77f2('0x19')][_0x77f2('0x1a')]({'raw':_0x15c7eb[_0x77f2('0x1b')]?_0x15c7eb[_0x77f2('0x1b')][_0x77f2('0x1c')]===undefined?!![]:![]:!![],'where':_0x15c7eb[_0x77f2('0x1b')]?_0x15c7eb['options'][_0x77f2('0x1d')]||null:null,'attributes':_0x15c7eb[_0x77f2('0x1b')]?_0x15c7eb[_0x77f2('0x1b')][_0x77f2('0x1e')]||null:null,'limit':_0x15c7eb[_0x77f2('0x1b')]?_0x15c7eb['options'][_0x77f2('0x1f')]||null:null,'include':_0x15c7eb[_0x77f2('0x1b')]?_0x15c7eb[_0x77f2('0x1b')][_0x77f2('0x20')]?_[_0x77f2('0x21')](_0x15c7eb[_0x77f2('0x1b')][_0x77f2('0x20')],function(_0x42f510){return{'model':db[_0x42f510['model']],'as':_0x42f510['as'],'attributes':_0x42f510[_0x77f2('0x1e')],'include':_0x42f510[_0x77f2('0x20')]?_[_0x77f2('0x21')](_0x42f510[_0x77f2('0x20')],function(_0x4e4265){return{'model':db[_0x4e4265[_0x77f2('0x22')]],'as':_0x4e4265['as'],'attributes':_0x4e4265[_0x77f2('0x1e')],'include':_0x4e4265[_0x77f2('0x20')]?_[_0x77f2('0x21')](_0x4e4265[_0x77f2('0x20')],function(_0x5a260f){return{'model':db[_0x5a260f['model']],'as':_0x5a260f['as'],'attributes':_0x5a260f['attributes']};}):[]};}):[]};}):[]:[]})[_0x77f2('0xd')](function(_0x4c173e){logger[_0x77f2('0x15')](_0x77f2('0x18'),_0x15c7eb);logger[_0x77f2('0x23')](_0x77f2('0x18'),_0x15c7eb,JSON['stringify'](_0x4c173e));_0x171b37(_0x4c173e);})['catch'](function(_0x1f89e5){logger['error'](_0x77f2('0x18'),_0x1f89e5[_0x77f2('0x14')],_0x15c7eb);_0x3a8ce2(_0x291633[_0x77f2('0x12')](0x1f4,_0x1f89e5[_0x77f2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 3a3ade9..83b3546 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 _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 +var _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x5d9d7b,_0x463267){var _0x33fe6b=function(_0x1e0838){while(--_0x1e0838){_0x5d9d7b['push'](_0x5d9d7b['shift']());}};_0x33fe6b(++_0x463267);}(_0x4975,0x86));var _0x5497=function(_0x2207e2,_0x539a27){_0x2207e2=_0x2207e2-0x0;var _0x2c617f=_0x4975[_0x2207e2];return _0x2c617f;};'use strict';var VoiceExtensionEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){VoiceExtensionEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('voiceExtension:'+_0x674a2a,_0x539a27);VoiceExtensionEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 6922200..8e31e73 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 _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 +var _0xb145=['show','/:id/messages','getMessages','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','/:id'];(function(_0x2f36e2,_0x17699f){var _0x3de763=function(_0x4d02f4){while(--_0x4d02f4){_0x2f36e2['push'](_0x2f36e2['shift']());}};_0x3de763(++_0x17699f);}(_0xb145,0xa3));var _0x5b14=function(_0x49b8db,_0x344f3e){_0x49b8db=_0x49b8db-0x0;var _0x4792c9=_0xb145[_0x49b8db];return _0x4792c9;};'use strict';var multer=require('multer');var util=require(_0x5b14('0x0'));var path=require(_0x5b14('0x1'));var timeout=require(_0x5b14('0x2'));var express=require(_0x5b14('0x3'));var router=express[_0x5b14('0x4')]();var fs_extra=require(_0x5b14('0x5'));var auth=require(_0x5b14('0x6'));var interaction=require(_0x5b14('0x7'));var config=require('../../config/environment');var controller=require(_0x5b14('0x8'));router[_0x5b14('0x9')]('/',auth[_0x5b14('0xa')](),controller[_0x5b14('0xb')]);router['get'](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0xd')]);router[_0x5b14('0x9')](_0x5b14('0xe'),auth['isAuthenticated'](),controller[_0x5b14('0xf')]);router[_0x5b14('0x10')]('/',auth['isAuthenticated'](),controller[_0x5b14('0x11')]);router[_0x5b14('0x12')](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0x13')]);router['delete'](_0x5b14('0xc'),auth['isAuthenticated'](),controller[_0x5b14('0x14')]);module[_0x5b14('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index fc7458f..1358297 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 _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 +var _0xb5c5=['STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','\x20-\x20','sequelize','exports'];(function(_0x39dc31,_0x1224b9){var _0x8da6fe=function(_0xc94e8e){while(--_0xc94e8e){_0x39dc31['push'](_0x39dc31['shift']());}};_0x8da6fe(++_0x1224b9);}(_0xb5c5,0xa8));var _0x5b5c=function(_0x52a193,_0x27ee04){_0x52a193=_0x52a193-0x0;var _0x54ecdf=_0xb5c5[_0x52a193];return _0x54ecdf;};'use strict';var Sequelize=require(_0x5b5c('0x0'));module[_0x5b5c('0x1')]={'customer_id':{'type':Sequelize[_0x5b5c('0x2')]},'context':{'type':Sequelize[_0x5b5c('0x2')],'defaultValue':_0x5b5c('0x3'),'unique':_0x5b5c('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x5b5c('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x5b5c('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x9fee){this[_0x5b5c('0x5')](_0x5b5c('0x6'),typeof _0x9fee===_0x5b5c('0x7')&&_0x9fee[_0x5b5c('0x8')]()?_0x9fee[_0x5b5c('0x8')]():null);}},'pager':{'type':Sequelize[_0x5b5c('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x5b5c('0x9')},'attach':{'type':Sequelize['ENUM'](_0x5b5c('0xa'),'no'),'defaultValue':_0x5b5c('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x5b5c('0xb')](_0x5b5c('0xa'),'no'),'defaultValue':_0x5b5c('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x5b5c('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x5b5c('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x5b5c('0xb')](_0x5b5c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x5b5c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x5b5c('0xb')](_0x5b5c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x5b5c('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x5b5c('0xb')](_0x5b5c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x5b5c('0xb')](_0x5b5c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x5b5c('0xb')](_0x5b5c('0xa'),'no'),'defaultValue':_0x5b5c('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x5b5c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x5b5c('0xb')](_0x5b5c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x5b5c('0xb')](_0x5b5c('0xa'),'no'),'defaultValue':_0x5b5c('0xa'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x5b5c('0x2')]},'emailbody':{'type':Sequelize[_0x5b5c('0x2')]},'maxsecs':{'type':Sequelize[_0x5b5c('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x5b5c('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x5b5c('0xe')],'get':function(){return this[_0x5b5c('0xf')]('fullname')+_0x5b5c('0x10')+this[_0x5b5c('0xf')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index b46f3c2..b1aa0b5 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 _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 +var _0x96cc=['find','userProfileId','UserProfileResource','getMessages','findOne','mailbox','VoiceMailMessage','findAndCountAll','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Voicemails','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMail','includeAll','include','rows','catch','params','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection'];(function(_0x7791d5,_0xdab65f){var _0x5ce288=function(_0x2b818d){while(--_0x2b818d){_0x7791d5['push'](_0x7791d5['shift']());}};_0x5ce288(++_0xdab65f);}(_0x96cc,0x16c));var _0xc96c=function(_0x77e7e8,_0x5a319f){_0x77e7e8=_0x77e7e8-0x0;var _0x205a3e=_0x96cc[_0x77e7e8];return _0x205a3e;};'use strict';var emlformat=require(_0xc96c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc96c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc96c('0x2'));var moment=require(_0xc96c('0x3'));var BPromise=require(_0xc96c('0x4'));var Mustache=require(_0xc96c('0x5'));var util=require(_0xc96c('0x6'));var path=require(_0xc96c('0x7'));var sox=require(_0xc96c('0x8'));var csv=require(_0xc96c('0x9'));var ejs=require(_0xc96c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc96c('0xb'));var squel=require(_0xc96c('0xc'));var crypto=require(_0xc96c('0xd'));var jsforce=require(_0xc96c('0xe'));var deskjs=require(_0xc96c('0xf'));var toCsv=require(_0xc96c('0x9'));var querystring=require(_0xc96c('0x10'));var Papa=require('papaparse');var Redis=require(_0xc96c('0x11'));var authService=require(_0xc96c('0x12'));var qs=require(_0xc96c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc96c('0x14'));var logger=require('../../config/logger')(_0xc96c('0x15'));var utils=require('../../config/utils');var config=require(_0xc96c('0x16'));var licenseUtil=require(_0xc96c('0x17'));var db=require(_0xc96c('0x18'))['db'];function respondWithStatusCode(_0x246a95,_0x5f27f3){_0x5f27f3=_0x5f27f3||0xcc;return function(_0x3fe3d5){if(_0x3fe3d5){return _0x246a95[_0xc96c('0x19')](_0x5f27f3);}return _0x246a95[_0xc96c('0x1a')](_0x5f27f3)[_0xc96c('0x1b')]();};}function respondWithResult(_0x48de8d,_0x35da94){_0x35da94=_0x35da94||0xc8;return function(_0xbed0c9){if(_0xbed0c9){return _0x48de8d[_0xc96c('0x1a')](_0x35da94)[_0xc96c('0x1c')](_0xbed0c9);}};}function respondWithFilteredResult(_0x377dbc,_0x46455a){return function(_0x1765d9){if(_0x1765d9){var _0x23e357=typeof _0x46455a[_0xc96c('0x1d')]===_0xc96c('0x1e')&&typeof _0x46455a[_0xc96c('0x1f')]==='undefined';var _0x509376=_0x1765d9[_0xc96c('0x20')];var _0x99c402=_0x23e357?0x0:_0x46455a[_0xc96c('0x1d')];var _0x2ae19a=_0x23e357?_0x1765d9['count']:_0x46455a[_0xc96c('0x1d')]+_0x46455a[_0xc96c('0x1f')];var _0x2a361c;if(_0x2ae19a>=_0x509376){_0x2ae19a=_0x509376;_0x2a361c=0xc8;}else{_0x2a361c=0xce;}_0x377dbc[_0xc96c('0x1a')](_0x2a361c);return _0x377dbc[_0xc96c('0x21')](_0xc96c('0x22'),_0x99c402+'-'+_0x2ae19a+'/'+_0x509376)[_0xc96c('0x1c')](_0x1765d9);}return null;};}function patchUpdates(_0x41daba){return function(_0x28d762){try{jsonpatch[_0xc96c('0x23')](_0x28d762,_0x41daba,!![]);}catch(_0x2bb397){return BPromise[_0xc96c('0x24')](_0x2bb397);}return _0x28d762[_0xc96c('0x25')]();};}function saveUpdates(_0x45edee,_0x325c54){return function(_0x3b5c6c){if(_0x3b5c6c){return _0x3b5c6c[_0xc96c('0x26')](_0x45edee)['then'](function(_0xd63951){return _0xd63951;});}return null;};}function removeEntity(_0x4be783,_0x4456bf){return function(_0x10ae21){if(_0x10ae21){return _0x10ae21[_0xc96c('0x27')]()[_0xc96c('0x28')](function(){var _0x40f23d=_0x10ae21[_0xc96c('0x29')]({'plain':!![]});var _0x1a77df=_0xc96c('0x2a');return db['UserProfileResource'][_0xc96c('0x27')]({'where':{'type':_0x1a77df,'resourceId':_0x40f23d['id']}})[_0xc96c('0x28')](function(){return _0x10ae21;});})[_0xc96c('0x28')](function(){_0x4be783[_0xc96c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c00b6,_0x39c191){return function(_0x12c293){if(!_0x12c293){_0x5c00b6[_0xc96c('0x19')](0x194);}return _0x12c293;};}function handleError(_0x1ef845,_0x3c0eb1){_0x3c0eb1=_0x3c0eb1||0x1f4;return function(_0x5e1727){logger[_0xc96c('0x2b')](_0x5e1727[_0xc96c('0x2c')]);if(_0x5e1727[_0xc96c('0x2d')]){delete _0x5e1727[_0xc96c('0x2d')];}_0x1ef845[_0xc96c('0x1a')](_0x3c0eb1)[_0xc96c('0x2e')](_0x5e1727);};}exports[_0xc96c('0x2f')]=function(_0x328ee4,_0x556108){var _0x3aa436={},_0x53c994={},_0x3f4b0e={'count':0x0,'rows':[]};var _0x442c7f=_[_0xc96c('0x30')](db['VoiceMail'][_0xc96c('0x31')],function(_0x3240ba){return{'name':_0x3240ba[_0xc96c('0x32')],'type':_0x3240ba[_0xc96c('0x33')]['key']};});_0x53c994['model']=_[_0xc96c('0x30')](_0x442c7f,_0xc96c('0x2d'));_0x53c994[_0xc96c('0x34')]=_['keys'](_0x328ee4[_0xc96c('0x34')]);_0x53c994[_0xc96c('0x35')]=_[_0xc96c('0x36')](_0x53c994[_0xc96c('0x37')],_0x53c994['query']);_0x3aa436[_0xc96c('0x38')]=_[_0xc96c('0x36')](_0x53c994['model'],qs[_0xc96c('0x39')](_0x328ee4[_0xc96c('0x34')][_0xc96c('0x39')]));_0x3aa436[_0xc96c('0x38')]=_0x3aa436[_0xc96c('0x38')][_0xc96c('0x3a')]?_0x3aa436['attributes']:_0x53c994[_0xc96c('0x37')];if(!_0x328ee4[_0xc96c('0x34')][_0xc96c('0x3b')](_0xc96c('0x3c'))){_0x3aa436[_0xc96c('0x1f')]=qs[_0xc96c('0x1f')](_0x328ee4['query']['limit']);_0x3aa436[_0xc96c('0x1d')]=qs[_0xc96c('0x1d')](_0x328ee4['query']['offset']);}_0x3aa436[_0xc96c('0x3d')]=qs[_0xc96c('0x3e')](_0x328ee4[_0xc96c('0x34')][_0xc96c('0x3e')]);_0x3aa436[_0xc96c('0x3f')]=qs[_0xc96c('0x35')](_[_0xc96c('0x40')](_0x328ee4[_0xc96c('0x34')],_0x53c994[_0xc96c('0x35')]),_0x442c7f);if(_0x328ee4[_0xc96c('0x34')][_0xc96c('0x41')]){_0x3aa436['where']=_[_0xc96c('0x42')](_0x3aa436[_0xc96c('0x3f')],{'$or':_[_0xc96c('0x30')](_0x442c7f,function(_0x16b1f1){if(_0x16b1f1['type']!==_0xc96c('0x43')){var _0x3a0848={};_0x3a0848[_0x16b1f1[_0xc96c('0x2d')]]={'$like':'%'+_0x328ee4['query']['filter']+'%'};return _0x3a0848;}})});}_0x3aa436=_[_0xc96c('0x42')]({},_0x3aa436,_0x328ee4[_0xc96c('0x44')]);var _0x2e3bc3={'where':_0x3aa436['where']};return db[_0xc96c('0x45')][_0xc96c('0x20')](_0x2e3bc3)[_0xc96c('0x28')](function(_0x2a8ea7){_0x3f4b0e[_0xc96c('0x20')]=_0x2a8ea7;if(_0x328ee4[_0xc96c('0x34')][_0xc96c('0x46')]){_0x3aa436[_0xc96c('0x47')]=[{'all':!![]}];}return db[_0xc96c('0x45')]['findAll'](_0x3aa436);})['then'](function(_0x30b3ac){_0x3f4b0e[_0xc96c('0x48')]=_0x30b3ac;return _0x3f4b0e;})[_0xc96c('0x28')](respondWithFilteredResult(_0x556108,_0x3aa436))[_0xc96c('0x49')](handleError(_0x556108,null));};exports['show']=function(_0x5ee6ac,_0x14b712){var _0x1c18c1={'raw':!![],'where':{'id':_0x5ee6ac[_0xc96c('0x4a')]['id']}},_0x44eb20={};_0x44eb20[_0xc96c('0x37')]=_[_0xc96c('0x4b')](db[_0xc96c('0x45')]['rawAttributes']);_0x44eb20[_0xc96c('0x34')]=_[_0xc96c('0x4b')](_0x5ee6ac[_0xc96c('0x34')]);_0x44eb20[_0xc96c('0x35')]=_['intersection'](_0x44eb20['model'],_0x44eb20[_0xc96c('0x34')]);_0x1c18c1[_0xc96c('0x38')]=_[_0xc96c('0x36')](_0x44eb20[_0xc96c('0x37')],qs[_0xc96c('0x39')](_0x5ee6ac[_0xc96c('0x34')][_0xc96c('0x39')]));_0x1c18c1[_0xc96c('0x38')]=_0x1c18c1[_0xc96c('0x38')][_0xc96c('0x3a')]?_0x1c18c1[_0xc96c('0x38')]:_0x44eb20[_0xc96c('0x37')];if(_0x5ee6ac[_0xc96c('0x34')]['includeAll']){_0x1c18c1[_0xc96c('0x47')]=[{'all':!![]}];}_0x1c18c1=_[_0xc96c('0x42')]({},_0x1c18c1,_0x5ee6ac[_0xc96c('0x44')]);return db[_0xc96c('0x45')]['find'](_0x1c18c1)[_0xc96c('0x28')](handleEntityNotFound(_0x14b712,null))['then'](respondWithResult(_0x14b712,null))[_0xc96c('0x49')](handleError(_0x14b712,null));};exports[_0xc96c('0x4c')]=function(_0x565812,_0x2581ae){return db[_0xc96c('0x45')][_0xc96c('0x4c')](_0x565812[_0xc96c('0x4d')],{})[_0xc96c('0x28')](function(_0x1bd694){var _0x57e699=_0x565812['user']['get']({'plain':!![]});if(!_0x57e699)throw new Error(_0xc96c('0x4e'));if(_0x57e699['role']===_0xc96c('0x4f')){var _0x22b2e3=_0x1bd694[_0xc96c('0x29')]({'plain':!![]});var _0x17c764=_0xc96c('0x2a');return db[_0xc96c('0x50')][_0xc96c('0x51')]({'where':{'name':_0x17c764,'userProfileId':_0x57e699[_0xc96c('0x52')]},'raw':!![]})[_0xc96c('0x28')](function(_0xd78e10){if(_0xd78e10&&_0xd78e10['autoAssociation']===0x0){return db[_0xc96c('0x53')][_0xc96c('0x4c')]({'name':_0x22b2e3[_0xc96c('0x2d')],'resourceId':_0x22b2e3['id'],'type':_0xd78e10[_0xc96c('0x2d')],'sectionId':_0xd78e10['id']},{})[_0xc96c('0x28')](function(){return _0x1bd694;});}else{return _0x1bd694;}})[_0xc96c('0x49')](function(_0xad88c3){logger[_0xc96c('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xad88c3);throw _0xad88c3;});}return _0x1bd694;})['then'](respondWithResult(_0x2581ae,0xc9))['catch'](handleError(_0x2581ae,null));};exports['update']=function(_0x356ef3,_0x46c6fb){if(_0x356ef3[_0xc96c('0x4d')]['id']){delete _0x356ef3[_0xc96c('0x4d')]['id'];}return db[_0xc96c('0x45')][_0xc96c('0x51')]({'where':{'id':_0x356ef3[_0xc96c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x46c6fb,null))[_0xc96c('0x28')](saveUpdates(_0x356ef3[_0xc96c('0x4d')],null))[_0xc96c('0x28')](respondWithResult(_0x46c6fb,null))[_0xc96c('0x49')](handleError(_0x46c6fb,null));};exports[_0xc96c('0x27')]=function(_0x1dbea5,_0x3aa216){return db['VoiceMail'][_0xc96c('0x51')]({'where':{'id':_0x1dbea5[_0xc96c('0x4a')]['id']}})[_0xc96c('0x28')](handleEntityNotFound(_0x3aa216,null))[_0xc96c('0x28')](removeEntity(_0x3aa216,null))[_0xc96c('0x49')](handleError(_0x3aa216,null));};exports[_0xc96c('0x54')]=function(_0x258f79,_0x34bb98,_0x10b1b8){return db[_0xc96c('0x45')][_0xc96c('0x55')]({'where':{'id':_0x258f79[_0xc96c('0x4a')]['id']}})[_0xc96c('0x28')](handleEntityNotFound(_0x34bb98,null))[_0xc96c('0x28')](function(_0x5a6e3e){var _0xb1629c;var _0x183211={},_0x3d879a={};_0x3d879a[_0xc96c('0x37')]=_[_0xc96c('0x4b')](db['VoiceMailMessage'][_0xc96c('0x31')]);_0x3d879a[_0xc96c('0x34')]=_[_0xc96c('0x4b')](_0x258f79[_0xc96c('0x34')]);_0x3d879a['filters']=_[_0xc96c('0x36')](_0x3d879a[_0xc96c('0x37')],_0x3d879a['query']);_0x183211['attributes']=_['intersection'](_0x3d879a[_0xc96c('0x37')],qs[_0xc96c('0x39')](_0x258f79[_0xc96c('0x34')][_0xc96c('0x39')]));_0x183211[_0xc96c('0x38')]=_0x183211['attributes']['length']?_0x183211[_0xc96c('0x38')]:_0x3d879a[_0xc96c('0x37')];if(!_0x258f79[_0xc96c('0x34')][_0xc96c('0x3b')](_0xc96c('0x3c'))){_0x183211['limit']=qs[_0xc96c('0x1f')](_0x258f79[_0xc96c('0x34')][_0xc96c('0x1f')]);_0x183211[_0xc96c('0x1d')]=qs['offset'](_0x258f79['query'][_0xc96c('0x1d')]);}_0x183211[_0xc96c('0x3d')]=qs['sort'](_0x258f79[_0xc96c('0x34')]['sort']);_0x183211[_0xc96c('0x3f')]=qs[_0xc96c('0x35')](_[_0xc96c('0x40')](_0x258f79[_0xc96c('0x34')],_0x3d879a[_0xc96c('0x35')]));if(_0x258f79[_0xc96c('0x34')][_0xc96c('0x41')]){_0x183211[_0xc96c('0x3f')]=_[_0xc96c('0x42')](_0x183211[_0xc96c('0x3f')],{'$or':_['map'](_0x183211[_0xc96c('0x38')],function(_0x5e94fa){var _0xe34ef={};_0xe34ef[_0x5e94fa]={'$like':'%'+_0x258f79[_0xc96c('0x34')]['filter']+'%'};return _0xe34ef;})});}_0x183211[_0xc96c('0x3f')]=_['merge'](_0x183211[_0xc96c('0x3f')],{'mailboxuser':_0x5a6e3e[_0xc96c('0x56')]});_0x183211=_[_0xc96c('0x42')]({},_0x183211,_0x258f79[_0xc96c('0x44')]);return db[_0xc96c('0x57')][_0xc96c('0x58')](_0x183211)[_0xc96c('0x28')](respondWithFilteredResult(_0x34bb98,_0x183211));})[_0xc96c('0x49')](handleError(_0x34bb98,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 3b2c9c2..3844101 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 _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 +var _0x3a34=['bluebird','path','../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox','lodash','util','../../config/logger','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3a34,0x70));var _0x43a3=function(_0x30526f,_0x55a4ec){_0x30526f=_0x30526f-0x0;var _0x4b7be7=_0x3a34[_0x30526f];return _0x4b7be7;};'use strict';var _=require(_0x43a3('0x0'));var util=require(_0x43a3('0x1'));var logger=require(_0x43a3('0x2'))(_0x43a3('0x3'));var moment=require(_0x43a3('0x4'));var BPromise=require(_0x43a3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x43a3('0x6'));var rimraf=require('rimraf');var config=require(_0x43a3('0x7'));var attributes=require(_0x43a3('0x8'));module[_0x43a3('0x9')]=function(_0xa8b291,_0x5e0025){return _0xa8b291['define'](_0x43a3('0xa'),attributes,{'tableName':_0x43a3('0xb'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x43a3('0xc'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 4779a41..4fae4e7 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 _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 +var _0x5f31=['../../config/utils','../../config/logger','../../config/environment','client','then','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5c9f56,_0x42c9ad){var _0x2a726b=function(_0x4a13cd){while(--_0x4a13cd){_0x5c9f56['push'](_0x5c9f56['shift']());}};_0x2a726b(++_0x42c9ad);}(_0x5f31,0x1dc));var _0x15f3=function(_0x401ccd,_0x140815){_0x401ccd=_0x401ccd-0x0;var _0x5a57ad=_0x5f31[_0x401ccd];return _0x5a57ad;};'use strict';var _=require(_0x15f3('0x0'));var util=require(_0x15f3('0x1'));var moment=require(_0x15f3('0x2'));var BPromise=require(_0x15f3('0x3'));var rs=require(_0x15f3('0x4'));var fs=require('fs');var Redis=require(_0x15f3('0x5'));var db=require(_0x15f3('0x6'))['db'];var utils=require(_0x15f3('0x7'));var logger=require(_0x15f3('0x8'))('rpc');var config=require(_0x15f3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x15f3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49555c,_0x19476f,_0x2f092b){return new BPromise(function(_0x813f90,_0x431eb9){return client['request'](_0x49555c,_0x2f092b)[_0x15f3('0xb')](function(_0x31cea0){logger[_0x15f3('0xc')]('VoiceMail,\x20%s,\x20%s',_0x19476f,_0x15f3('0xd'));logger[_0x15f3('0xe')](_0x15f3('0xf'),_0x19476f,_0x15f3('0xd'),JSON[_0x15f3('0x10')](_0x31cea0));if(_0x31cea0['error']){if(_0x31cea0[_0x15f3('0x11')][_0x15f3('0x12')]===0x1f4){logger[_0x15f3('0x11')](_0x15f3('0x13'),_0x19476f,_0x31cea0[_0x15f3('0x11')]['message']);return _0x431eb9(_0x31cea0[_0x15f3('0x11')][_0x15f3('0x14')]);}logger[_0x15f3('0x11')](_0x15f3('0x13'),_0x19476f,_0x31cea0['error']['message']);return _0x813f90(_0x31cea0[_0x15f3('0x11')]['message']);}else{logger[_0x15f3('0xc')](_0x15f3('0x13'),_0x19476f,'request\x20sent');_0x813f90(_0x31cea0['result'][_0x15f3('0x14')]);}})['catch'](function(_0xf0d0c8){logger['error'](_0x15f3('0x13'),_0x19476f,_0xf0d0c8);_0x431eb9(_0xf0d0c8);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 9a09dab..17a6d04 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 _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 +var _0x891e=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','/:id','isAuthenticated','show','download','create'];(function(_0x4666fe,_0x2a868e){var _0x5a2611=function(_0x106117){while(--_0x106117){_0x4666fe['push'](_0x4666fe['shift']());}};_0x5a2611(++_0x2a868e);}(_0x891e,0x1bd));var _0xe891=function(_0x104112,_0x342eb6){_0x104112=_0x104112-0x0;var _0x394ab4=_0x891e[_0x104112];return _0x394ab4;};'use strict';var multer=require(_0xe891('0x0'));var util=require(_0xe891('0x1'));var path=require(_0xe891('0x2'));var timeout=require(_0xe891('0x3'));var express=require(_0xe891('0x4'));var router=express[_0xe891('0x5')]();var fs_extra=require(_0xe891('0x6'));var auth=require(_0xe891('0x7'));var interaction=require(_0xe891('0x8'));var config=require(_0xe891('0x9'));var controller=require(_0xe891('0xa'));router[_0xe891('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe891('0xc'),auth[_0xe891('0xd')](),controller[_0xe891('0xe')]);router['get']('/:id/download',auth[_0xe891('0xd')](),controller[_0xe891('0xf')]);router['post']('/',auth[_0xe891('0xd')](),controller[_0xe891('0x10')]);router['put'](_0xe891('0xc'),auth[_0xe891('0xd')](),controller[_0xe891('0x11')]);router[_0xe891('0x12')](_0xe891('0xc'),auth[_0xe891('0xd')](),controller[_0xe891('0x13')]);module[_0xe891('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index bd6cfe4..01cbc4f 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 _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 +var _0x0b9b=['getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x0b9b,0x18e));var _0xb0b9=function(_0xf124a2,_0x11ad05){_0xf124a2=_0xf124a2-0x0;var _0x40cb40=_0x0b9b[_0xf124a2];return _0x40cb40;};'use strict';var Sequelize=require('sequelize');module[_0xb0b9('0x0')]={'name':{'type':Sequelize[_0xb0b9('0x1')],'get':function(_0x425697){return this[_0xb0b9('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xb0b9('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xb0b9('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xb0b9('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb0b9('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xb0b9('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xb0b9('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xb0b9('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xb0b9('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb0b9('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xb0b9('0x5')](_0xb0b9('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xb0b9('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb0b9('0x4')],'defaultValue':''},'stamp':{'type':_0xb0b9('0x7'),'defaultValue':Sequelize[_0xb0b9('0x8')](_0xb0b9('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index b153b9f..79db310 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 _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 +var _0xa0b9=['querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','count','limit','set','reject','update','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','intersection','fields','length','attributes','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','VoiceMailMessage','include','findAll','rows','catch','show','params','keys','includeAll','options','find','create','body','destroy','download','recording','msg_id','Sequelize','ValidationError','Content-Disposition','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x1ee938,_0x22267f){var _0x3ebf3b=function(_0x10611e){while(--_0x10611e){_0x1ee938['push'](_0x1ee938['shift']());}};_0x3ebf3b(++_0x22267f);}(_0xa0b9,0x92));var _0x9a0b=function(_0x5868d2,_0x4ecb9b){_0x5868d2=_0x5868d2-0x0;var _0x2a569c=_0xa0b9[_0x5868d2];return _0x2a569c;};'use strict';var emlformat=require(_0x9a0b('0x0'));var rimraf=require(_0x9a0b('0x1'));var zipdir=require(_0x9a0b('0x2'));var jsonpatch=require(_0x9a0b('0x3'));var rp=require(_0x9a0b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9a0b('0x5'));var util=require('util');var path=require(_0x9a0b('0x6'));var sox=require(_0x9a0b('0x7'));var csv=require(_0x9a0b('0x8'));var ejs=require(_0x9a0b('0x9'));var fs=require('fs');var fs_extra=require(_0x9a0b('0xa'));var _=require(_0x9a0b('0xb'));var squel=require('squel');var crypto=require(_0x9a0b('0xc'));var jsforce=require(_0x9a0b('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9a0b('0xe'));var Papa=require(_0x9a0b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9a0b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a0b('0x11'))(_0x9a0b('0x12'));var utils=require(_0x9a0b('0x13'));var config=require(_0x9a0b('0x14'));var licenseUtil=require(_0x9a0b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40a175,_0x242b56){_0x242b56=_0x242b56||0xcc;return function(_0x2cca3a){if(_0x2cca3a){return _0x40a175[_0x9a0b('0x16')](_0x242b56);}return _0x40a175[_0x9a0b('0x17')](_0x242b56)['end']();};}function respondWithResult(_0xfa463e,_0x2a56bd){_0x2a56bd=_0x2a56bd||0xc8;return function(_0x5ddd55){if(_0x5ddd55){return _0xfa463e[_0x9a0b('0x17')](_0x2a56bd)[_0x9a0b('0x18')](_0x5ddd55);}};}function respondWithFilteredResult(_0x29177f,_0x207b27){return function(_0x15dfef){if(_0x15dfef){var _0x30932a=typeof _0x207b27[_0x9a0b('0x19')]==='undefined'&&typeof _0x207b27['limit']==='undefined';var _0x25f214=_0x15dfef[_0x9a0b('0x1a')];var _0x397b94=_0x30932a?0x0:_0x207b27[_0x9a0b('0x19')];var _0x52a219=_0x30932a?_0x15dfef[_0x9a0b('0x1a')]:_0x207b27[_0x9a0b('0x19')]+_0x207b27[_0x9a0b('0x1b')];var _0x424387;if(_0x52a219>=_0x25f214){_0x52a219=_0x25f214;_0x424387=0xc8;}else{_0x424387=0xce;}_0x29177f[_0x9a0b('0x17')](_0x424387);return _0x29177f[_0x9a0b('0x1c')]('Content-Range',_0x397b94+'-'+_0x52a219+'/'+_0x25f214)['json'](_0x15dfef);}return null;};}function patchUpdates(_0x34d4cb){return function(_0x35db4f){try{jsonpatch['apply'](_0x35db4f,_0x34d4cb,!![]);}catch(_0x3635ab){return BPromise[_0x9a0b('0x1d')](_0x3635ab);}return _0x35db4f['save']();};}function saveUpdates(_0x58809a,_0x38aeb8){return function(_0x5db549){if(_0x5db549){return _0x5db549[_0x9a0b('0x1e')](_0x58809a)[_0x9a0b('0x1f')](function(_0x292a8c){return _0x292a8c;});}return null;};}function removeEntity(_0x403ed2,_0x5f1364){return function(_0x17c843){if(_0x17c843){return _0x17c843['destroy']()[_0x9a0b('0x1f')](function(){_0x403ed2[_0x9a0b('0x17')](0xcc)[_0x9a0b('0x20')]();});}};}function handleEntityNotFound(_0x2ab339,_0x1adebe){return function(_0x41ed89){if(!_0x41ed89){_0x2ab339[_0x9a0b('0x16')](0x194);}return _0x41ed89;};}function handleError(_0x2712dc,_0x3bd39c){_0x3bd39c=_0x3bd39c||0x1f4;return function(_0x22b29f){logger[_0x9a0b('0x21')](_0x22b29f[_0x9a0b('0x22')]);if(_0x22b29f[_0x9a0b('0x23')]){delete _0x22b29f[_0x9a0b('0x23')];}_0x2712dc[_0x9a0b('0x17')](_0x3bd39c)[_0x9a0b('0x24')](_0x22b29f);};}exports[_0x9a0b('0x25')]=function(_0x20c8e2,_0x14ca5e){var _0x4a5854={},_0x2d83fd={},_0x2d0386={'count':0x0,'rows':[]};var _0x584775=_[_0x9a0b('0x26')](db['VoiceMailMessage'][_0x9a0b('0x27')],function(_0x41290f){return{'name':_0x41290f[_0x9a0b('0x28')],'type':_0x41290f[_0x9a0b('0x29')][_0x9a0b('0x2a')]};});_0x2d83fd[_0x9a0b('0x2b')]=_[_0x9a0b('0x2c')](_[_0x9a0b('0x26')](_0x584775,_0x9a0b('0x23')),[_0x9a0b('0x23')]);_0x2d83fd[_0x9a0b('0x2d')]=_['keys'](_0x20c8e2[_0x9a0b('0x2d')]);_0x2d83fd[_0x9a0b('0x2e')]=_[_0x9a0b('0x2f')](_0x2d83fd[_0x9a0b('0x2b')],_0x2d83fd['query']);_0x4a5854['attributes']=_[_0x9a0b('0x2f')](_0x2d83fd[_0x9a0b('0x2b')],qs[_0x9a0b('0x30')](_0x20c8e2[_0x9a0b('0x2d')][_0x9a0b('0x30')]));_0x4a5854['attributes']=_0x4a5854['attributes'][_0x9a0b('0x31')]?_0x4a5854[_0x9a0b('0x32')]:_0x2d83fd['model'];if(!_0x20c8e2[_0x9a0b('0x2d')]['hasOwnProperty'](_0x9a0b('0x33'))){_0x4a5854[_0x9a0b('0x1b')]=qs['limit'](_0x20c8e2[_0x9a0b('0x2d')][_0x9a0b('0x1b')]);_0x4a5854[_0x9a0b('0x19')]=qs['offset'](_0x20c8e2[_0x9a0b('0x2d')]['offset']);}_0x4a5854[_0x9a0b('0x34')]=qs['sort'](_0x20c8e2['query'][_0x9a0b('0x35')]);_0x4a5854['where']=qs[_0x9a0b('0x2e')](_[_0x9a0b('0x36')](_0x20c8e2[_0x9a0b('0x2d')],_0x2d83fd['filters']),_0x584775);if(_0x20c8e2[_0x9a0b('0x2d')][_0x9a0b('0x37')]){_0x4a5854[_0x9a0b('0x38')]=_[_0x9a0b('0x39')](_0x4a5854[_0x9a0b('0x38')],{'$or':_[_0x9a0b('0x26')](_0x584775,function(_0x22ce60){if(_0x22ce60[_0x9a0b('0x29')]!==_0x9a0b('0x3a')){var _0x328957={};_0x328957[_0x22ce60[_0x9a0b('0x23')]]={'$like':'%'+_0x20c8e2[_0x9a0b('0x2d')]['filter']+'%'};return _0x328957;}})});}_0x4a5854=_[_0x9a0b('0x39')]({},_0x4a5854,_0x20c8e2['options']);var _0x16d10a={'where':_0x4a5854[_0x9a0b('0x38')]};return db[_0x9a0b('0x3b')][_0x9a0b('0x1a')](_0x16d10a)[_0x9a0b('0x1f')](function(_0x5418f6){_0x2d0386[_0x9a0b('0x1a')]=_0x5418f6;if(_0x20c8e2[_0x9a0b('0x2d')]['includeAll']){_0x4a5854[_0x9a0b('0x3c')]=[{'all':!![]}];}return db[_0x9a0b('0x3b')][_0x9a0b('0x3d')](_0x4a5854);})['then'](function(_0x3e4858){_0x2d0386[_0x9a0b('0x3e')]=_0x3e4858;return _0x2d0386;})['then'](respondWithFilteredResult(_0x14ca5e,_0x4a5854))[_0x9a0b('0x3f')](handleError(_0x14ca5e,null));};exports[_0x9a0b('0x40')]=function(_0xe24874,_0x221fb4){var _0x136f6a={'raw':!![],'where':{'id':_0xe24874[_0x9a0b('0x41')]['id']}},_0x1b19d7={};_0x1b19d7[_0x9a0b('0x2b')]=_[_0x9a0b('0x42')](db[_0x9a0b('0x3b')][_0x9a0b('0x27')]);_0x1b19d7[_0x9a0b('0x2d')]=_['keys'](_0xe24874[_0x9a0b('0x2d')]);_0x1b19d7[_0x9a0b('0x2e')]=_[_0x9a0b('0x2f')](_0x1b19d7[_0x9a0b('0x2b')],_0x1b19d7[_0x9a0b('0x2d')]);_0x136f6a[_0x9a0b('0x32')]=_[_0x9a0b('0x2f')](_0x1b19d7[_0x9a0b('0x2b')],qs[_0x9a0b('0x30')](_0xe24874['query']['fields']));_0x136f6a[_0x9a0b('0x32')]=_0x136f6a[_0x9a0b('0x32')][_0x9a0b('0x31')]?_0x136f6a[_0x9a0b('0x32')]:_0x1b19d7['model'];if(_0xe24874['query'][_0x9a0b('0x43')]){_0x136f6a[_0x9a0b('0x3c')]=[{'all':!![]}];}_0x136f6a=_[_0x9a0b('0x39')]({},_0x136f6a,_0xe24874[_0x9a0b('0x44')]);return db[_0x9a0b('0x3b')][_0x9a0b('0x45')](_0x136f6a)[_0x9a0b('0x1f')](handleEntityNotFound(_0x221fb4,null))[_0x9a0b('0x1f')](respondWithResult(_0x221fb4,null))[_0x9a0b('0x3f')](handleError(_0x221fb4,null));};exports[_0x9a0b('0x46')]=function(_0x2539d0,_0x19dc88){return db['VoiceMailMessage'][_0x9a0b('0x46')](_0x2539d0[_0x9a0b('0x47')],{})[_0x9a0b('0x1f')](respondWithResult(_0x19dc88,0xc9))[_0x9a0b('0x3f')](handleError(_0x19dc88,null));};exports['update']=function(_0x117534,_0x1f8492){if(_0x117534[_0x9a0b('0x47')]['id']){delete _0x117534[_0x9a0b('0x47')]['id'];}return db[_0x9a0b('0x3b')]['find']({'where':{'id':_0x117534[_0x9a0b('0x41')]['id']}})[_0x9a0b('0x1f')](handleEntityNotFound(_0x1f8492,null))[_0x9a0b('0x1f')](saveUpdates(_0x117534[_0x9a0b('0x47')],null))[_0x9a0b('0x1f')](respondWithResult(_0x1f8492,null))['catch'](handleError(_0x1f8492,null));};exports[_0x9a0b('0x48')]=function(_0x4133ed,_0x5e9e02){return db[_0x9a0b('0x3b')]['find']({'where':{'id':_0x4133ed[_0x9a0b('0x41')]['id']}})[_0x9a0b('0x1f')](handleEntityNotFound(_0x5e9e02,null))[_0x9a0b('0x1f')](removeEntity(_0x5e9e02,null))['catch'](handleError(_0x5e9e02,null));};exports[_0x9a0b('0x49')]=function(_0xb89f57,_0x1205c7,_0x48c7f6){return db[_0x9a0b('0x3b')][_0x9a0b('0x45')]({'where':{'id':_0xb89f57['params']['id']},'attributes':['id',_0x9a0b('0x4a'),_0x9a0b('0x4b')]})[_0x9a0b('0x1f')](handleEntityNotFound(_0x1205c7,null))['then'](function(_0x4aab34){if(_0x4aab34){if(!_0x4aab34['recording']){throw new db[(_0x9a0b('0x4c'))][(_0x9a0b('0x4d'))]('VoiceMailMessage\x20not\x20found');}var _0x131693={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x4aab34[_0x9a0b('0x4b')]){_0x131693[_0x9a0b('0x4e')]='attachment;\x20filename=\x22'+_0x4aab34['msg_id']+_0x9a0b('0x4f');}_0x1205c7[_0x9a0b('0x1c')](_0x131693);return _0x1205c7[_0x9a0b('0x24')](new Buffer(_0x4aab34['recording']));}})[_0x9a0b('0x3f')](handleError(_0x1205c7,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index f2d9bd7..87ab4ad 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 _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 +var _0xe1b9=['rimraf','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','util','api','bluebird','request-promise','path'];(function(_0x382ff2,_0x45ac63){var _0x40f8d8=function(_0x2e9768){while(--_0x2e9768){_0x382ff2['push'](_0x382ff2['shift']());}};_0x40f8d8(++_0x45ac63);}(_0xe1b9,0x1c9));var _0x9e1b=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0xe1b9[_0x119d5a];return _0x15bff4;};'use strict';var _=require('lodash');var util=require(_0x9e1b('0x0'));var logger=require('../../config/logger')(_0x9e1b('0x1'));var moment=require('moment');var BPromise=require(_0x9e1b('0x2'));var rp=require(_0x9e1b('0x3'));var fs=require('fs');var path=require(_0x9e1b('0x4'));var rimraf=require(_0x9e1b('0x5'));var config=require('../../config/environment');var attributes=require(_0x9e1b('0x6'));module[_0x9e1b('0x7')]=function(_0x61f2b,_0x48b22c){return _0x61f2b[_0x9e1b('0x8')](_0x9e1b('0x9'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':[_0x9e1b('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index abb1d69..d552be7 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 _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 +var _0xc2b0=['jayson/promise','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x15482e,_0x25b23c){var _0x4a0651=function(_0x5afab4){while(--_0x5afab4){_0x15482e['push'](_0x15482e['shift']());}};_0x4a0651(++_0x25b23c);}(_0xc2b0,0x148));var _0x0c2b=function(_0x134de4,_0x49c839){_0x134de4=_0x134de4-0x0;var _0xe97f36=_0xc2b0[_0x134de4];return _0xe97f36;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0c2b('0x0'));var BPromise=require('bluebird');var rs=require(_0x0c2b('0x1'));var fs=require('fs');var Redis=require(_0x0c2b('0x2'));var db=require(_0x0c2b('0x3'))['db'];var utils=require(_0x0c2b('0x4'));var logger=require(_0x0c2b('0x5'))(_0x0c2b('0x6'));var config=require(_0x0c2b('0x7'));var jayson=require(_0x0c2b('0x8'));var client=jayson[_0x0c2b('0x9')][_0x0c2b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4383cd,_0x25a1a8,_0x5228c0){return new BPromise(function(_0x11876d,_0x12f177){return client['request'](_0x4383cd,_0x5228c0)[_0x0c2b('0xb')](function(_0x3d8be9){logger[_0x0c2b('0xc')](_0x0c2b('0xd'),_0x25a1a8,_0x0c2b('0xe'));logger[_0x0c2b('0xf')](_0x0c2b('0x10'),_0x25a1a8,'request\x20sent',JSON['stringify'](_0x3d8be9));if(_0x3d8be9['error']){if(_0x3d8be9[_0x0c2b('0x11')][_0x0c2b('0x12')]===0x1f4){logger['error'](_0x0c2b('0xd'),_0x25a1a8,_0x3d8be9[_0x0c2b('0x11')][_0x0c2b('0x13')]);return _0x12f177(_0x3d8be9[_0x0c2b('0x11')][_0x0c2b('0x13')]);}logger[_0x0c2b('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x25a1a8,_0x3d8be9[_0x0c2b('0x11')][_0x0c2b('0x13')]);return _0x11876d(_0x3d8be9[_0x0c2b('0x11')][_0x0c2b('0x13')]);}else{logger[_0x0c2b('0xc')](_0x0c2b('0xd'),_0x25a1a8,_0x0c2b('0xe'));_0x11876d(_0x3d8be9['result']['message']);}})[_0x0c2b('0x14')](function(_0x36162c){logger[_0x0c2b('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x25a1a8,_0x36162c);_0x12f177(_0x36162c);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index e8b5ac3..4139335 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 _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 +var _0xd955=['update','delete','destroy','/:id/sounds/:id2','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','/:id/sounds','getSounds','post','create','addSound'];(function(_0x5348dd,_0x9f2699){var _0x8b36b7=function(_0x1ba48d){while(--_0x1ba48d){_0x5348dd['push'](_0x5348dd['shift']());}};_0x8b36b7(++_0x9f2699);}(_0xd955,0x1d3));var _0x5d95=function(_0xe3d5f0,_0x5edf94){_0xe3d5f0=_0xe3d5f0-0x0;var _0x22835b=_0xd955[_0xe3d5f0];return _0x22835b;};'use strict';var multer=require('multer');var util=require(_0x5d95('0x0'));var path=require(_0x5d95('0x1'));var timeout=require('connect-timeout');var express=require(_0x5d95('0x2'));var router=express[_0x5d95('0x3')]();var fs_extra=require(_0x5d95('0x4'));var auth=require(_0x5d95('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5d95('0x6'));var controller=require(_0x5d95('0x7'));router[_0x5d95('0x8')]('/',auth[_0x5d95('0x9')](),controller['index']);router[_0x5d95('0x8')](_0x5d95('0xa'),auth['isAuthenticated'](),controller[_0x5d95('0xb')]);router[_0x5d95('0x8')](_0x5d95('0xc'),auth[_0x5d95('0x9')](),controller[_0x5d95('0xd')]);router[_0x5d95('0xe')]('/',auth[_0x5d95('0x9')](),controller[_0x5d95('0xf')]);router[_0x5d95('0xe')](_0x5d95('0xc'),auth[_0x5d95('0x9')](),controller[_0x5d95('0x10')]);router['put'](_0x5d95('0xa'),auth[_0x5d95('0x9')](),controller[_0x5d95('0x11')]);router[_0x5d95('0x12')](_0x5d95('0xa'),auth['isAuthenticated'](),controller[_0x5d95('0x13')]);router['delete'](_0x5d95('0x14'),auth['isAuthenticated'](),controller['removeSound']);module[_0x5d95('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index f936ade..c8dacc6 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 _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 +var _0x9375=['TIMESTAMP','BOOLEAN','sequelize','exports','mp3nb','quietmp3nb','mp3','files','STRING','alpha'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9375,0x7a));var _0x5937=function(_0x5355aa,_0x17b3f1){_0x5355aa=_0x5355aa-0x0;var _0x53b9f2=_0x9375[_0x5355aa];return _0x53b9f2;};'use strict';var Sequelize=require(_0x5937('0x0'));module[_0x5937('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM']('custom','files',_0x5937('0x2'),_0x5937('0x3'),'quietmp3',_0x5937('0x4')),'allowNull':!![],'defaultValue':_0x5937('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x5937('0x6')],'allowNull':!![]},'digit':{'type':Sequelize[_0x5937('0x6')],'allowNull':!![]},'sort':{'type':Sequelize[_0x5937('0x6')],'allowNull':!![],'defaultValue':_0x5937('0x7')},'format':{'type':Sequelize[_0x5937('0x6')],'allowNull':!![]},'stamp':{'type':_0x5937('0x8')},'defaultEntry':{'type':Sequelize[_0x5937('0x9')],'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 a9bd46c..576c78c 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 _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 +var _0xac64=['end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','get','destroy','error','stack','name','send','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','body','create','transaction','mode','directory','root','server/files/moh','files','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','readdirSync','forEach','unlinkSync','join','rmdirSync','Sequelize','message','sequelize','addSound','findOne','save_name','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','converted_format','ValidationError','removeSound','id2','Sound','getSounds','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status'];(function(_0x9fb081,_0x48f480){var _0x43f8b0=function(_0x418570){while(--_0x418570){_0x9fb081['push'](_0x9fb081['shift']());}};_0x43f8b0(++_0x48f480);}(_0xac64,0x13d));var _0x4ac6=function(_0x4d6185,_0x1b4910){_0x4d6185=_0x4d6185-0x0;var _0x2e4ac6=_0xac64[_0x4d6185];return _0x2e4ac6;};'use strict';var emlformat=require(_0x4ac6('0x0'));var rimraf=require(_0x4ac6('0x1'));var zipdir=require(_0x4ac6('0x2'));var jsonpatch=require(_0x4ac6('0x3'));var rp=require(_0x4ac6('0x4'));var moment=require('moment');var BPromise=require(_0x4ac6('0x5'));var Mustache=require(_0x4ac6('0x6'));var util=require(_0x4ac6('0x7'));var path=require('path');var sox=require(_0x4ac6('0x8'));var csv=require(_0x4ac6('0x9'));var ejs=require(_0x4ac6('0xa'));var fs=require('fs');var fs_extra=require(_0x4ac6('0xb'));var _=require(_0x4ac6('0xc'));var squel=require('squel');var crypto=require(_0x4ac6('0xd'));var jsforce=require(_0x4ac6('0xe'));var deskjs=require(_0x4ac6('0xf'));var toCsv=require(_0x4ac6('0x9'));var querystring=require(_0x4ac6('0x10'));var Papa=require(_0x4ac6('0x11'));var Redis=require(_0x4ac6('0x12'));var authService=require(_0x4ac6('0x13'));var qs=require(_0x4ac6('0x14'));var as=require(_0x4ac6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4ac6('0x16'))(_0x4ac6('0x17'));var utils=require(_0x4ac6('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4ac6('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1faba2,_0x434481){_0x434481=_0x434481||0xcc;return function(_0x4ffe30){if(_0x4ffe30){return _0x1faba2[_0x4ac6('0x1a')](_0x434481);}return _0x1faba2[_0x4ac6('0x1b')](_0x434481)[_0x4ac6('0x1c')]();};}function respondWithResult(_0x3c75a7,_0x153c19){_0x153c19=_0x153c19||0xc8;return function(_0x172302){if(_0x172302){return _0x3c75a7[_0x4ac6('0x1b')](_0x153c19)['json'](_0x172302);}};}function respondWithFilteredResult(_0x20267c,_0x561d50){return function(_0xa9a92c){if(_0xa9a92c){var _0x1959ae=typeof _0x561d50[_0x4ac6('0x1d')]===_0x4ac6('0x1e')&&typeof _0x561d50[_0x4ac6('0x1f')]===_0x4ac6('0x1e');var _0x5d5d4e=_0xa9a92c['count'];var _0x452378=_0x1959ae?0x0:_0x561d50[_0x4ac6('0x1d')];var _0x63260a=_0x1959ae?_0xa9a92c[_0x4ac6('0x20')]:_0x561d50[_0x4ac6('0x1d')]+_0x561d50[_0x4ac6('0x1f')];var _0x5da250;if(_0x63260a>=_0x5d5d4e){_0x63260a=_0x5d5d4e;_0x5da250=0xc8;}else{_0x5da250=0xce;}_0x20267c[_0x4ac6('0x1b')](_0x5da250);return _0x20267c['set'](_0x4ac6('0x21'),_0x452378+'-'+_0x63260a+'/'+_0x5d5d4e)[_0x4ac6('0x22')](_0xa9a92c);}return null;};}function patchUpdates(_0x385288){return function(_0x3c9fb3){try{jsonpatch[_0x4ac6('0x23')](_0x3c9fb3,_0x385288,!![]);}catch(_0x21ec07){return BPromise[_0x4ac6('0x24')](_0x21ec07);}return _0x3c9fb3[_0x4ac6('0x25')]();};}function saveUpdates(_0x2e3e29,_0x18954b){return function(_0x399bcb){if(_0x399bcb){return _0x399bcb[_0x4ac6('0x26')](_0x2e3e29)['then'](function(_0xd7eeab){return _0xd7eeab;});}return null;};}function removeEntity(_0x3edf31,_0x135fc6){return function(_0x53dbf9){if(_0x53dbf9){return _0x53dbf9['destroy']()[_0x4ac6('0x27')](function(){var _0x492195=_0x53dbf9[_0x4ac6('0x28')]({'plain':!![]});var _0x2b8d44='MusicOnHolds';return db['UserProfileResource'][_0x4ac6('0x29')]({'where':{'type':_0x2b8d44,'resourceId':_0x492195['id']}})['then'](function(){return _0x53dbf9;});})[_0x4ac6('0x27')](function(){_0x3edf31[_0x4ac6('0x1b')](0xcc)[_0x4ac6('0x1c')]();});}};}function handleEntityNotFound(_0xc5b54e,_0x267415){return function(_0x19395d){if(!_0x19395d){_0xc5b54e[_0x4ac6('0x1a')](0x194);}return _0x19395d;};}function handleError(_0x2c1913,_0x3f0e85){_0x3f0e85=_0x3f0e85||0x1f4;return function(_0x106d65){logger[_0x4ac6('0x2a')](_0x106d65[_0x4ac6('0x2b')]);if(_0x106d65[_0x4ac6('0x2c')]){delete _0x106d65[_0x4ac6('0x2c')];}_0x2c1913[_0x4ac6('0x1b')](_0x3f0e85)[_0x4ac6('0x2d')](_0x106d65);};}exports['index']=function(_0x58d604,_0x54479d){var _0x145164={},_0x315d9d={},_0x1d84af={'count':0x0,'rows':[]};var _0x18c05e=_[_0x4ac6('0x2e')](db[_0x4ac6('0x2f')][_0x4ac6('0x30')],function(_0x45cd86){return{'name':_0x45cd86[_0x4ac6('0x31')],'type':_0x45cd86[_0x4ac6('0x32')][_0x4ac6('0x33')]};});_0x315d9d['model']=_[_0x4ac6('0x2e')](_0x18c05e,_0x4ac6('0x2c'));_0x315d9d[_0x4ac6('0x34')]=_[_0x4ac6('0x35')](_0x58d604[_0x4ac6('0x34')]);_0x315d9d[_0x4ac6('0x36')]=_[_0x4ac6('0x37')](_0x315d9d[_0x4ac6('0x38')],_0x315d9d[_0x4ac6('0x34')]);_0x145164[_0x4ac6('0x39')]=_[_0x4ac6('0x37')](_0x315d9d[_0x4ac6('0x38')],qs[_0x4ac6('0x3a')](_0x58d604[_0x4ac6('0x34')][_0x4ac6('0x3a')]));_0x145164[_0x4ac6('0x39')]=_0x145164[_0x4ac6('0x39')][_0x4ac6('0x3b')]?_0x145164[_0x4ac6('0x39')]:_0x315d9d[_0x4ac6('0x38')];if(!_0x58d604['query'][_0x4ac6('0x3c')](_0x4ac6('0x3d'))){_0x145164[_0x4ac6('0x1f')]=qs[_0x4ac6('0x1f')](_0x58d604[_0x4ac6('0x34')]['limit']);_0x145164[_0x4ac6('0x1d')]=qs[_0x4ac6('0x1d')](_0x58d604[_0x4ac6('0x34')][_0x4ac6('0x1d')]);}_0x145164['order']=qs[_0x4ac6('0x3e')](_0x58d604[_0x4ac6('0x34')][_0x4ac6('0x3e')]);delete _0x58d604[_0x4ac6('0x34')]['sort'];_0x145164[_0x4ac6('0x3f')]=qs[_0x4ac6('0x36')](_[_0x4ac6('0x40')](_0x58d604[_0x4ac6('0x34')],_0x315d9d[_0x4ac6('0x36')]),_0x18c05e);if(_0x58d604[_0x4ac6('0x34')][_0x4ac6('0x41')]){_0x145164[_0x4ac6('0x3f')]=_[_0x4ac6('0x42')](_0x145164[_0x4ac6('0x3f')],{'$or':_[_0x4ac6('0x2e')](_0x18c05e,function(_0x57e1b7){if(_0x57e1b7[_0x4ac6('0x32')]!==_0x4ac6('0x43')){var _0x366c2f={};_0x366c2f[_0x57e1b7[_0x4ac6('0x2c')]]={'$like':'%'+_0x58d604[_0x4ac6('0x34')][_0x4ac6('0x41')]+'%'};return _0x366c2f;}})});}_0x145164=_['merge']({},_0x145164,_0x58d604[_0x4ac6('0x44')]);var _0x393dd3={'where':_0x145164[_0x4ac6('0x3f')]};return db[_0x4ac6('0x2f')][_0x4ac6('0x20')](_0x393dd3)['then'](function(_0x1732ee){_0x1d84af[_0x4ac6('0x20')]=_0x1732ee;if(_0x58d604[_0x4ac6('0x34')][_0x4ac6('0x45')]){_0x145164[_0x4ac6('0x46')]=[{'all':!![]}];}return db[_0x4ac6('0x2f')][_0x4ac6('0x47')](_0x145164);})[_0x4ac6('0x27')](function(_0x5e335b){_0x1d84af[_0x4ac6('0x48')]=_0x5e335b;return _0x1d84af;})[_0x4ac6('0x27')](respondWithFilteredResult(_0x54479d,_0x145164))[_0x4ac6('0x49')](handleError(_0x54479d,null));};exports['show']=function(_0x16a108,_0x345ea2){var _0x5e5495={'raw':![],'where':{'id':_0x16a108[_0x4ac6('0x4a')]['id']}},_0x240638={};_0x240638['model']=_['keys'](db['VoiceMusicOnHold'][_0x4ac6('0x30')]);_0x240638[_0x4ac6('0x34')]=_['keys'](_0x16a108[_0x4ac6('0x34')]);_0x240638[_0x4ac6('0x36')]=_[_0x4ac6('0x37')](_0x240638[_0x4ac6('0x38')],_0x240638['query']);_0x5e5495[_0x4ac6('0x39')]=_[_0x4ac6('0x37')](_0x240638[_0x4ac6('0x38')],qs[_0x4ac6('0x3a')](_0x16a108[_0x4ac6('0x34')][_0x4ac6('0x3a')]));_0x5e5495[_0x4ac6('0x39')]=_0x5e5495[_0x4ac6('0x39')][_0x4ac6('0x3b')]?_0x5e5495[_0x4ac6('0x39')]:_0x240638['model'];if(_0x16a108[_0x4ac6('0x34')][_0x4ac6('0x45')]){_0x5e5495[_0x4ac6('0x46')]=[{'all':!![]}];}_0x5e5495=_['merge']({},_0x5e5495,_0x16a108[_0x4ac6('0x44')]);return db[_0x4ac6('0x2f')][_0x4ac6('0x4b')](_0x5e5495)['then'](handleEntityNotFound(_0x345ea2,null))['then'](respondWithResult(_0x345ea2,null))[_0x4ac6('0x49')](handleError(_0x345ea2,null));};exports[_0x4ac6('0x26')]=function(_0x3cff19,_0x170426){if(_0x3cff19[_0x4ac6('0x4c')]['id']){delete _0x3cff19[_0x4ac6('0x4c')]['id'];}return db[_0x4ac6('0x2f')]['find']({'where':{'id':_0x3cff19[_0x4ac6('0x4a')]['id']}})[_0x4ac6('0x27')](handleEntityNotFound(_0x170426,null))[_0x4ac6('0x27')](saveUpdates(_0x3cff19[_0x4ac6('0x4c')],null))[_0x4ac6('0x27')](respondWithResult(_0x170426,null))[_0x4ac6('0x49')](handleError(_0x170426,null));};exports[_0x4ac6('0x4d')]=function(_0x16486c,_0x1953aa,_0xf31e11){return db['sequelize'][_0x4ac6('0x4e')](function(_0x533bd2){if(_0x16486c[_0x4ac6('0x4c')][_0x4ac6('0x4f')]==='files'){_0x16486c['body'][_0x4ac6('0x50')]=path['join'](config[_0x4ac6('0x51')],_0x4ac6('0x52'),_0x16486c[_0x4ac6('0x4c')][_0x4ac6('0x2c')]);}return db[_0x4ac6('0x2f')][_0x4ac6('0x4d')](_0x16486c[_0x4ac6('0x4c')],{'transaction':_0x533bd2})['then'](function(_0x2fb9e9){if(_0x16486c[_0x4ac6('0x4c')][_0x4ac6('0x4f')]===_0x4ac6('0x53')){fs[_0x4ac6('0x54')](_0x2fb9e9['directory'],parseInt(_0x4ac6('0x55'),0x8));}var _0x5d6ea7=_0x16486c[_0x4ac6('0x56')][_0x4ac6('0x28')]({'plain':!![]});if(!_0x5d6ea7)throw new Error(_0x4ac6('0x57'));if(_0x5d6ea7[_0x4ac6('0x58')]===_0x4ac6('0x56')){var _0x44426d=_0x2fb9e9[_0x4ac6('0x28')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x5d6ea7[_0x4ac6('0x59')]},'raw':!![]})['then'](function(_0xe77282){if(_0xe77282&&_0xe77282[_0x4ac6('0x5a')]===0x0){return db['UserProfileResource'][_0x4ac6('0x4d')]({'name':_0x44426d[_0x4ac6('0x2c')],'resourceId':_0x44426d['id'],'type':_0xe77282[_0x4ac6('0x2c')],'sectionId':_0xe77282['id']},{})[_0x4ac6('0x27')](function(){return _0x2fb9e9;});}else{return _0x2fb9e9;}})[_0x4ac6('0x49')](function(_0x121bb6){logger[_0x4ac6('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x121bb6);});}return _0x2fb9e9;});})[_0x4ac6('0x27')](respondWithResult(_0x1953aa,0xc9))[_0x4ac6('0x49')](handleError(_0x1953aa,null));};exports[_0x4ac6('0x29')]=function(_0x18f799,_0x111931,_0x5a09e8){var _0x26c895;return db[_0x4ac6('0x2f')][_0x4ac6('0x4b')]({'where':{'id':_0x18f799[_0x4ac6('0x4a')]['id']}})[_0x4ac6('0x27')](function(_0x44debb){if(_0x44debb){return db['sequelize'][_0x4ac6('0x4e')](function(_0x3a4492){return _0x44debb[_0x4ac6('0x29')]({'transaction':_0x3a4492,'raw':!![]})[_0x4ac6('0x27')](function(_0x448da1){if(_0x448da1[_0x4ac6('0x50')]){fs[_0x4ac6('0x5b')](_0x448da1[_0x4ac6('0x50')])[_0x4ac6('0x5c')](function(_0x399c9e){fs[_0x4ac6('0x5d')](path[_0x4ac6('0x5e')](_0x448da1['directory'],_0x399c9e));});fs[_0x4ac6('0x5f')](_0x448da1[_0x4ac6('0x50')]);}return _0x448da1;});})[_0x4ac6('0x49')](function(_0x7b7e5c){throw new db[(_0x4ac6('0x60'))]['ValidationError'](_0x7b7e5c[_0x4ac6('0x61')]);});}})['then'](handleEntityNotFound(_0x111931,null))['then'](removeEntity(_0x111931,null))[_0x4ac6('0x49')](handleError(_0x111931,null));};exports['addSound']=function(_0x1f2f59,_0x55e640,_0x57097d){return db[_0x4ac6('0x62')]['transaction'](function(_0x35aff0){var _0x495cfa;return db[_0x4ac6('0x2f')][_0x4ac6('0x4b')]({'where':{'id':_0x1f2f59[_0x4ac6('0x4a')]['id']}})[_0x4ac6('0x27')](function(_0x2eb740){if(_0x2eb740){_0x495cfa=_0x2eb740;return _0x2eb740[_0x4ac6('0x63')](_0x1f2f59[_0x4ac6('0x4c')]['id'],{'transaction':_0x35aff0});}})[_0x4ac6('0x27')](function(_0x4c0f3f){if(_0x4c0f3f){return db['Sound'][_0x4ac6('0x64')]({'where':{'id':_0x1f2f59[_0x4ac6('0x4c')]['id']},'attributes':['id',_0x4ac6('0x2c'),_0x4ac6('0x65'),'converted_format',_0x4ac6('0x66')],'raw':!![]});}})[_0x4ac6('0x27')](function(_0x50a342){if(_0x50a342){var _0x118f37=path['join'](config[_0x4ac6('0x51')],_0x4ac6('0x67'),util[_0x4ac6('0x68')](_0x4ac6('0x69'),path[_0x4ac6('0x6a')](_0x50a342[_0x4ac6('0x65')],path[_0x4ac6('0x6b')](_0x50a342['save_name'])),_0x50a342['converted_format']));var _0x2a2ab2=path[_0x4ac6('0x5e')](config['root'],_0x4ac6('0x52'),_0x495cfa['name'],util[_0x4ac6('0x68')](_0x4ac6('0x69'),_0x50a342[_0x4ac6('0x2c')],_0x50a342[_0x4ac6('0x6c')]));fs['symlinkSync'](_0x118f37,_0x2a2ab2);return _0x50a342;}})['catch'](function(_0x5f340a){throw new db['Sequelize'][(_0x4ac6('0x6d'))](_0x5f340a[_0x4ac6('0x61')]);});})[_0x4ac6('0x27')](handleEntityNotFound(_0x55e640,null))[_0x4ac6('0x27')](respondWithResult(_0x55e640,0xc9))['catch'](handleError(_0x55e640,null));};exports[_0x4ac6('0x6e')]=function(_0x294f63,_0x571457,_0x52c8c1){return db['sequelize']['transaction'](function(_0x5b0858){var _0x160c45;return db[_0x4ac6('0x2f')]['findOne']({'where':{'id':_0x294f63['params']['id']}})[_0x4ac6('0x27')](handleEntityNotFound(_0x571457,null))[_0x4ac6('0x27')](function(_0x5988ca){if(_0x5988ca){_0x160c45=_0x5988ca;return _0x5988ca[_0x4ac6('0x6e')](_0x294f63[_0x4ac6('0x4a')][_0x4ac6('0x6f')]);}})['then'](function(_0x574ccb){if(_0x574ccb){return db[_0x4ac6('0x70')][_0x4ac6('0x64')]({'where':{'id':_0x294f63[_0x4ac6('0x4a')][_0x4ac6('0x6f')]},'attributes':['id',_0x4ac6('0x2c'),'save_name',_0x4ac6('0x6c'),_0x4ac6('0x66')],'raw':!![]});}})['then'](function(_0x5f8a31){if(_0x5f8a31){fs[_0x4ac6('0x5d')](path[_0x4ac6('0x5e')](_0x160c45[_0x4ac6('0x50')],util[_0x4ac6('0x68')](_0x4ac6('0x69'),_0x5f8a31['name'],_0x5f8a31[_0x4ac6('0x6c')])));return _0x5f8a31;}})[_0x4ac6('0x49')](function(_0x472fca){throw new db[(_0x4ac6('0x60'))]['ValidationError'](_0x472fca[_0x4ac6('0x61')]);});})['then'](handleEntityNotFound(_0x571457,null))[_0x4ac6('0x27')](respondWithStatusCode(_0x571457,0xcc))[_0x4ac6('0x49')](handleError(_0x571457,null));};exports[_0x4ac6('0x71')]=function(_0x363a17,_0x3ce38b,_0x4a91c4){var _0x1ae0a2={};var _0x58ac6a={};var _0x33c958;var _0x1f7417;return db[_0x4ac6('0x2f')][_0x4ac6('0x64')]({'where':{'id':_0x363a17['params']['id']}})['then'](handleEntityNotFound(_0x3ce38b,null))[_0x4ac6('0x27')](function(_0x24a289){if(_0x24a289){_0x33c958=_0x24a289;_0x58ac6a['model']=_[_0x4ac6('0x35')](db[_0x4ac6('0x70')][_0x4ac6('0x30')]);_0x58ac6a['query']=_[_0x4ac6('0x35')](_0x363a17[_0x4ac6('0x34')]);_0x58ac6a[_0x4ac6('0x36')]=_[_0x4ac6('0x37')](_0x58ac6a[_0x4ac6('0x38')],_0x58ac6a[_0x4ac6('0x34')]);_0x1ae0a2[_0x4ac6('0x39')]=_[_0x4ac6('0x37')](_0x58ac6a[_0x4ac6('0x38')],qs['fields'](_0x363a17['query'][_0x4ac6('0x3a')]));_0x1ae0a2[_0x4ac6('0x39')]=_0x1ae0a2[_0x4ac6('0x39')][_0x4ac6('0x3b')]?_0x1ae0a2[_0x4ac6('0x39')]:_0x58ac6a[_0x4ac6('0x38')];_0x1ae0a2[_0x4ac6('0x72')]=qs['sort'](_0x363a17['query']['sort']);_0x1ae0a2['where']=qs[_0x4ac6('0x36')](_[_0x4ac6('0x40')](_0x363a17[_0x4ac6('0x34')],_0x58ac6a['filters']));if(_0x363a17[_0x4ac6('0x34')][_0x4ac6('0x41')]){_0x1ae0a2[_0x4ac6('0x3f')]=_[_0x4ac6('0x42')](_0x1ae0a2['where'],{'$or':_[_0x4ac6('0x2e')](_0x1ae0a2['attributes'],function(_0x30f12f){var _0x6de87c={};_0x6de87c[_0x30f12f]={'$like':'%'+_0x363a17[_0x4ac6('0x34')][_0x4ac6('0x41')]+'%'};return _0x6de87c;})});}_0x1ae0a2=_[_0x4ac6('0x42')]({},_0x1ae0a2,_0x363a17['options']);return _0x33c958[_0x4ac6('0x71')](_0x1ae0a2);}})[_0x4ac6('0x27')](function(_0x39f1c6){if(_0x39f1c6){_0x1f7417=_0x39f1c6['length'];if(!_0x363a17[_0x4ac6('0x34')]['hasOwnProperty'](_0x4ac6('0x3d'))){_0x1ae0a2['limit']=qs[_0x4ac6('0x1f')](_0x363a17[_0x4ac6('0x34')][_0x4ac6('0x1f')]);_0x1ae0a2[_0x4ac6('0x1d')]=qs[_0x4ac6('0x1d')](_0x363a17['query']['offset']);}return _0x33c958[_0x4ac6('0x71')](_0x1ae0a2);}})[_0x4ac6('0x27')](function(_0x105251){if(_0x105251){return _0x105251?{'count':_0x1f7417,'rows':_0x105251}:null;}})[_0x4ac6('0x27')](respondWithResult(_0x3ce38b,null))[_0x4ac6('0x49')](handleError(_0x3ce38b,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 8e9df1f..b97cd83 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 _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 +var _0xa4b5=['path','./voiceMusicOnHold.attributes','exports','util','../../config/logger'];(function(_0x8bb4c1,_0x2d6e53){var _0x67a6e1=function(_0x1155e5){while(--_0x1155e5){_0x8bb4c1['push'](_0x8bb4c1['shift']());}};_0x67a6e1(++_0x2d6e53);}(_0xa4b5,0x1bb));var _0x5a4b=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xa4b5[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require('lodash');var util=require(_0x5a4b('0x0'));var logger=require(_0x5a4b('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a4b('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5a4b('0x3'));module[_0x5a4b('0x4')]=function(_0x1c3e39,_0x4d4273){return _0x1c3e39['define']('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','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 564398b..9a7d480 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 _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 +var _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x31b907,_0x52f3db){var _0x3c66fb=function(_0x44b0b4){while(--_0x44b0b4){_0x31b907['push'](_0x31b907['shift']());}};_0x3c66fb(++_0x52f3db);}(_0xe706,0xa3));var _0x6e70=function(_0x5c65ee,_0x57b017){_0x5c65ee=_0x5c65ee-0x0;var _0x4b8689=_0xe706[_0x5c65ee];return _0x4b8689;};'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']('VoiceMusicOnHold,\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']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index e7fa434..6dc47ae 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 _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 +var _0x7c06=['getTeams','post','create','addAgents','/:id/teams','addTeams','put','update','delete','destroy','removeAgents','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','/describe','/:id','show','/:id/users','getAgents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7c06,0x8e));var _0x67c0=function(_0x2667e8,_0x4f7f57){_0x2667e8=_0x2667e8-0x0;var _0x389b67=_0x7c06[_0x2667e8];return _0x389b67;};'use strict';var multer=require('multer');var util=require(_0x67c0('0x0'));var path=require(_0x67c0('0x1'));var timeout=require(_0x67c0('0x2'));var express=require('express');var router=express[_0x67c0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x67c0('0x4'));var interaction=require(_0x67c0('0x5'));var config=require('../../config/environment');var controller=require(_0x67c0('0x6'));router[_0x67c0('0x7')]('/',auth[_0x67c0('0x8')](),controller['index']);router[_0x67c0('0x7')](_0x67c0('0x9'),auth[_0x67c0('0x8')](),controller['describe']);router[_0x67c0('0x7')](_0x67c0('0xa'),auth[_0x67c0('0x8')](),controller[_0x67c0('0xb')]);router['get'](_0x67c0('0xc'),auth[_0x67c0('0x8')](),controller[_0x67c0('0xd')]);router[_0x67c0('0x7')]('/:id/teams',auth['isAuthenticated'](),controller[_0x67c0('0xe')]);router[_0x67c0('0xf')]('/',auth['isAuthenticated'](),controller[_0x67c0('0x10')]);router['post'](_0x67c0('0xc'),auth[_0x67c0('0x8')](),controller[_0x67c0('0x11')]);router['post'](_0x67c0('0x12'),auth[_0x67c0('0x8')](),controller[_0x67c0('0x13')]);router[_0x67c0('0x14')](_0x67c0('0xa'),auth[_0x67c0('0x8')](),controller[_0x67c0('0x15')]);router[_0x67c0('0x16')](_0x67c0('0xa'),auth['isAuthenticated'](),controller[_0x67c0('0x17')]);router[_0x67c0('0x16')](_0x67c0('0xc'),auth[_0x67c0('0x8')](),controller[_0x67c0('0x18')]);router['delete'](_0x67c0('0x12'),auth[_0x67c0('0x8')](),controller['removeTeams']);module[_0x67c0('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index c4d1b28..6d6ce04 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 _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 +var _0xe112=['getDataValue','STRING','INTEGER','sequelize','exports','name','system-'];(function(_0x47cd41,_0x5f3fa8){var _0x4e1eeb=function(_0x40a325){while(--_0x40a325){_0x47cd41['push'](_0x47cd41['shift']());}};_0x4e1eeb(++_0x5f3fa8);}(_0xe112,0x1f4));var _0x2e11=function(_0x8f7f44,_0x1917fe){_0x8f7f44=_0x8f7f44-0x0;var _0xde4e7=_0xe112[_0x8f7f44];return _0xde4e7;};'use strict';var Sequelize=require(_0x2e11('0x0'));module[_0x2e11('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2e11('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x46dadd){return _0x2e11('0x3')+this[_0x2e11('0x4')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x2e11('0x5')]},'VoiceExtensionId':{'type':Sequelize[_0x2e11('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 4147e2b..1e0d3a8 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 _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 +var _0xb62e=['all','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','VoicePrefixes','UserProfileResource','name','send','index','map','VoicePrefix','type','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','describe','create','sequelize','body','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','system-','transaction','findById','addAgents','ids','omit','spread','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','nolimit','getTeams','Team','addTeams','Agents','voicePause','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','User','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','SELECT','every','TeamId','includes'];(function(_0x5b39c0,_0x5c36c6){var _0x2b4498=function(_0x36c5e4){while(--_0x36c5e4){_0x5b39c0['push'](_0x5b39c0['shift']());}};_0x2b4498(++_0x5c36c6);}(_0xb62e,0x1de));var _0xeb62=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xb62e[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0xeb62('0x0'));var rimraf=require(_0xeb62('0x1'));var zipdir=require(_0xeb62('0x2'));var jsonpatch=require(_0xeb62('0x3'));var rp=require('request-promise');var moment=require(_0xeb62('0x4'));var BPromise=require(_0xeb62('0x5'));var Mustache=require(_0xeb62('0x6'));var util=require(_0xeb62('0x7'));var path=require(_0xeb62('0x8'));var sox=require(_0xeb62('0x9'));var csv=require('to-csv');var ejs=require(_0xeb62('0xa'));var fs=require('fs');var fs_extra=require(_0xeb62('0xb'));var _=require(_0xeb62('0xc'));var squel=require('squel');var crypto=require(_0xeb62('0xd'));var jsforce=require(_0xeb62('0xe'));var deskjs=require(_0xeb62('0xf'));var toCsv=require(_0xeb62('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xeb62('0x11'));var authService=require(_0xeb62('0x12'));var qs=require(_0xeb62('0x13'));var as=require(_0xeb62('0x14'));var hardwareService=require(_0xeb62('0x15'));var logger=require(_0xeb62('0x16'))(_0xeb62('0x17'));var utils=require(_0xeb62('0x18'));var config=require(_0xeb62('0x19'));var licenseUtil=require(_0xeb62('0x1a'));var db=require('../../mysqldb')['db'];config[_0xeb62('0x1b')]=_[_0xeb62('0x1c')](config[_0xeb62('0x1b')],{'host':_0xeb62('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeb62('0x1b')]));require(_0xeb62('0x1e'))[_0xeb62('0x1f')](socket);function respondWithStatusCode(_0x4da178,_0x26c3fd){_0x26c3fd=_0x26c3fd||0xcc;return function(_0x195837){if(_0x195837){return _0x4da178[_0xeb62('0x20')](_0x26c3fd);}return _0x4da178['status'](_0x26c3fd)[_0xeb62('0x21')]();};}function respondWithResult(_0x15b3e8,_0x184106){_0x184106=_0x184106||0xc8;return function(_0x353e2c){if(_0x353e2c){return _0x15b3e8[_0xeb62('0x22')](_0x184106)[_0xeb62('0x23')](_0x353e2c);}};}function respondWithFilteredResult(_0x1fb460,_0x1324d7){return function(_0x39b138){if(_0x39b138){var _0x27fd84=typeof _0x1324d7[_0xeb62('0x24')]===_0xeb62('0x25')&&typeof _0x1324d7[_0xeb62('0x26')]==='undefined';var _0x38c5e4=_0x39b138[_0xeb62('0x27')];var _0x332396=_0x27fd84?0x0:_0x1324d7[_0xeb62('0x24')];var _0x425817=_0x27fd84?_0x39b138[_0xeb62('0x27')]:_0x1324d7[_0xeb62('0x24')]+_0x1324d7['limit'];var _0x599d0b;if(_0x425817>=_0x38c5e4){_0x425817=_0x38c5e4;_0x599d0b=0xc8;}else{_0x599d0b=0xce;}_0x1fb460[_0xeb62('0x22')](_0x599d0b);return _0x1fb460[_0xeb62('0x28')](_0xeb62('0x29'),_0x332396+'-'+_0x425817+'/'+_0x38c5e4)[_0xeb62('0x23')](_0x39b138);}return null;};}function patchUpdates(_0x122b15){return function(_0x4cafcf){try{jsonpatch['apply'](_0x4cafcf,_0x122b15,!![]);}catch(_0x4664ce){return BPromise[_0xeb62('0x2a')](_0x4664ce);}return _0x4cafcf[_0xeb62('0x2b')]();};}function saveUpdates(_0x395b70,_0x55a169){return function(_0x4e92f5){if(_0x4e92f5){return _0x4e92f5[_0xeb62('0x2c')](_0x395b70)['then'](function(_0x448327){return _0x448327;});}return null;};}function removeEntity(_0x4b0f46,_0xfe3e16){return function(_0x516a72){if(_0x516a72){return _0x516a72[_0xeb62('0x2d')]()[_0xeb62('0x2e')](function(){var _0x46d1bb=_0x516a72['get']({'plain':!![]});var _0x3ef784=_0xeb62('0x2f');return db[_0xeb62('0x30')][_0xeb62('0x2d')]({'where':{'type':_0x3ef784,'resourceId':_0x46d1bb['id']}})[_0xeb62('0x2e')](function(){return _0x516a72;});})[_0xeb62('0x2e')](function(){_0x4b0f46['status'](0xcc)[_0xeb62('0x21')]();});}};}function handleEntityNotFound(_0x1616ee,_0x57169a){return function(_0x157474){if(!_0x157474){_0x1616ee[_0xeb62('0x20')](0x194);}return _0x157474;};}function handleError(_0x2c967c,_0x2c308c){_0x2c308c=_0x2c308c||0x1f4;return function(_0x235448){logger['error'](_0x235448['stack']);if(_0x235448[_0xeb62('0x31')]){delete _0x235448[_0xeb62('0x31')];}_0x2c967c[_0xeb62('0x22')](_0x2c308c)[_0xeb62('0x32')](_0x235448);};}exports[_0xeb62('0x33')]=function(_0x2ad3ec,_0x1ae51e){var _0x4be25d={},_0x411062={},_0x47a94b={'count':0x0,'rows':[]};var _0x555db1=_[_0xeb62('0x34')](db[_0xeb62('0x35')]['rawAttributes'],function(_0x1ade38){return{'name':_0x1ade38['fieldName'],'type':_0x1ade38[_0xeb62('0x36')][_0xeb62('0x37')]};});_0x411062['model']=_[_0xeb62('0x34')](_0x555db1,_0xeb62('0x31'));_0x411062['query']=_[_0xeb62('0x38')](_0x2ad3ec[_0xeb62('0x39')]);_0x411062[_0xeb62('0x3a')]=_[_0xeb62('0x3b')](_0x411062['model'],_0x411062[_0xeb62('0x39')]);_0x4be25d[_0xeb62('0x3c')]=_['intersection'](_0x411062['model'],qs[_0xeb62('0x3d')](_0x2ad3ec[_0xeb62('0x39')]['fields']));_0x4be25d[_0xeb62('0x3c')]=_0x4be25d[_0xeb62('0x3c')][_0xeb62('0x3e')]?_0x4be25d[_0xeb62('0x3c')]:_0x411062[_0xeb62('0x3f')];if(!_0x2ad3ec[_0xeb62('0x39')][_0xeb62('0x40')]('nolimit')){_0x4be25d['limit']=qs[_0xeb62('0x26')](_0x2ad3ec[_0xeb62('0x39')][_0xeb62('0x26')]);_0x4be25d[_0xeb62('0x24')]=qs['offset'](_0x2ad3ec[_0xeb62('0x39')]['offset']);}_0x4be25d[_0xeb62('0x41')]=qs[_0xeb62('0x42')](_0x2ad3ec[_0xeb62('0x39')][_0xeb62('0x42')]);_0x4be25d[_0xeb62('0x43')]=qs[_0xeb62('0x3a')](_[_0xeb62('0x44')](_0x2ad3ec[_0xeb62('0x39')],_0x411062['filters']),_0x555db1);if(_0x2ad3ec[_0xeb62('0x39')][_0xeb62('0x45')]){_0x4be25d[_0xeb62('0x43')]=_[_0xeb62('0x46')](_0x4be25d['where'],{'$or':_['map'](_0x555db1,function(_0x46a560){if(_0x46a560[_0xeb62('0x36')]!=='VIRTUAL'){var _0x1f7036={};_0x1f7036[_0x46a560[_0xeb62('0x31')]]={'$like':'%'+_0x2ad3ec['query'][_0xeb62('0x45')]+'%'};return _0x1f7036;}})});}_0x4be25d=_['merge']({},_0x4be25d,_0x2ad3ec[_0xeb62('0x47')]);var _0x47b815={'where':_0x4be25d[_0xeb62('0x43')]};return db['VoicePrefix'][_0xeb62('0x27')](_0x47b815)[_0xeb62('0x2e')](function(_0x317f50){_0x47a94b['count']=_0x317f50;if(_0x2ad3ec['query'][_0xeb62('0x48')]){_0x4be25d[_0xeb62('0x49')]=[{'all':!![]}];}return db[_0xeb62('0x35')][_0xeb62('0x4a')](_0x4be25d);})[_0xeb62('0x2e')](function(_0x4afd5e){_0x47a94b[_0xeb62('0x4b')]=_0x4afd5e;return _0x47a94b;})['then'](respondWithFilteredResult(_0x1ae51e,_0x4be25d))[_0xeb62('0x4c')](handleError(_0x1ae51e,null));};exports['show']=function(_0xeeced2,_0x4d2f80){var _0x26c77d={'raw':![],'where':{'id':_0xeeced2[_0xeb62('0x4d')]['id']}},_0x4dbcac={};_0x4dbcac[_0xeb62('0x3f')]=_[_0xeb62('0x38')](db[_0xeb62('0x35')][_0xeb62('0x4e')]);_0x4dbcac[_0xeb62('0x39')]=_['keys'](_0xeeced2[_0xeb62('0x39')]);_0x4dbcac[_0xeb62('0x3a')]=_['intersection'](_0x4dbcac['model'],_0x4dbcac['query']);_0x26c77d['attributes']=_[_0xeb62('0x3b')](_0x4dbcac[_0xeb62('0x3f')],qs['fields'](_0xeeced2[_0xeb62('0x39')][_0xeb62('0x3d')]));_0x26c77d[_0xeb62('0x3c')]=_0x26c77d[_0xeb62('0x3c')][_0xeb62('0x3e')]?_0x26c77d['attributes']:_0x4dbcac[_0xeb62('0x3f')];if(_0xeeced2['query'][_0xeb62('0x48')]){_0x26c77d[_0xeb62('0x49')]=[{'all':!![]}];}_0x26c77d=_[_0xeb62('0x46')]({},_0x26c77d,_0xeeced2[_0xeb62('0x47')]);return db[_0xeb62('0x35')][_0xeb62('0x4f')](_0x26c77d)[_0xeb62('0x2e')](handleEntityNotFound(_0x4d2f80,null))[_0xeb62('0x2e')](respondWithResult(_0x4d2f80,null))[_0xeb62('0x4c')](handleError(_0x4d2f80,null));};exports[_0xeb62('0x2d')]=function(_0xe13846,_0x13e102){return db['VoicePrefix'][_0xeb62('0x4f')]({'where':{'id':_0xe13846['params']['id']}})['then'](handleEntityNotFound(_0x13e102,null))[_0xeb62('0x2e')](removeEntity(_0x13e102,null))[_0xeb62('0x4c')](handleError(_0x13e102,null));};exports['describe']=function(_0x373505,_0x462760){return db['VoicePrefix'][_0xeb62('0x50')]()[_0xeb62('0x2e')](respondWithResult(_0x462760,null))[_0xeb62('0x4c')](handleError(_0x462760,null));};exports[_0xeb62('0x51')]=function(_0xe71e83,_0x1e6238){var _0x351027;return db[_0xeb62('0x52')]['transaction'](function(_0x3e2be9){return db['VoicePrefix'][_0xeb62('0x51')](_0xe71e83[_0xeb62('0x53')],{'transaction':_0x3e2be9})[_0xeb62('0x2e')](function(_0x289af0){_0x351027=_0x289af0[_0xeb62('0x54')]({'plain':!![]});return db[_0xeb62('0x55')][_0xeb62('0x4f')]({'where':{'id':_0x351027[_0xeb62('0x56')]},'raw':!![]})['then'](function(_0x4d31a1){return createVoicePrefixExtensions(_0x351027,_0x4d31a1,_0x3e2be9);});});})['then'](function(){var _0x5033eb=_0xe71e83[_0xeb62('0x57')]['get']({'plain':!![]});if(!_0x5033eb)throw new Error(_0xeb62('0x58'));if(_0x5033eb['role']===_0xeb62('0x57')){var _0x342768=_0x351027;return db[_0xeb62('0x59')]['find']({'where':{'name':_0xeb62('0x2f'),'userProfileId':_0x5033eb[_0xeb62('0x5a')]},'raw':!![]})['then'](function(_0x35982a){if(_0x35982a&&_0x35982a[_0xeb62('0x5b')]===0x0){return db[_0xeb62('0x30')][_0xeb62('0x51')]({'name':_0x342768['name'],'resourceId':_0x342768['id'],'type':_0x35982a[_0xeb62('0x31')],'sectionId':_0x35982a['id']},{})[_0xeb62('0x2e')](function(){return _0x351027;});}else{return _0x351027;}})['catch'](function(_0x2eba52){logger[_0xeb62('0x5c')](_0xeb62('0x5d'),_0x2eba52);throw _0x2eba52;});}return _0x351027;})[_0xeb62('0x2e')](respondWithResult(_0x1e6238,null))[_0xeb62('0x4c')](handleError(_0x1e6238,null));};function Extension(_0x46da69,_0x3e55bf,_0x1b354d,_0x222d0c){this[_0xeb62('0x5e')]=_0xeb62('0x5f');this[_0xeb62('0x60')]=_0x46da69;this[_0xeb62('0x61')]=_0x1b354d;this[_0xeb62('0x36')]=_0xeb62('0x62');this[_0xeb62('0x63')]='Voice\x20Prefix\x20Extension';this['priority']=_0x3e55bf;this['appdata']=_0x222d0c;}function createVoicePrefixExtensions(_0x5b28ec,_0x279b83,_0x5f363d){return new BPromise(function(_0x10cc40,_0x136d81){var _0x5b8c4=new Extension(formatPrefixName(_0x5b28ec[_0xeb62('0x64')]),0x1,_0xeb62('0x65'),_0xeb62('0x66'));_0x5b8c4[_0xeb62('0x67')]=_0x5b28ec['id'];return db[_0xeb62('0x55')][_0xeb62('0x51')](_0x5b8c4,{'transaction':_0x5f363d})[_0xeb62('0x2e')](function(_0x52dfbd){var _0x113302=_0x52dfbd[_0xeb62('0x54')]({'plain':!![]});var _0x42e992=_[_0xeb62('0x34')](addVoicePrefixExtensions(_0x5b28ec,_0x279b83),function(_0x4aba1f){_0x4aba1f[_0xeb62('0x56')]=_0x113302['id'];_0x4aba1f[_0xeb62('0x67')]=_0x5b28ec['id'];return _0x4aba1f;});return db[_0xeb62('0x55')][_0xeb62('0x68')](_0x42e992,{'transaction':_0x5f363d})[_0xeb62('0x2e')](function(_0x1679a7){if(!_0x1679a7){return _0x136d81(_0xeb62('0x69'));}else{return _0x10cc40(_0x1679a7);}})[_0xeb62('0x4c')](function(_0x2e1fb8){return _0x136d81(_0x2e1fb8);});});;});};function addVoicePrefixExtensions(_0x2b788e,_0x1d8675){var _0x510275=[];var _0x110224=formatPrefixName(_0x2b788e[_0xeb62('0x64')]);_0x510275[_0xeb62('0x6a')](new Extension(_0x110224,0x2,_0xeb62('0x6b'),_0xeb62('0x6c')+_0x2b788e[_0xeb62('0x31')]));if(_0x2b788e[_0xeb62('0x6d')]){_0x510275[_0xeb62('0x6a')](new Extension(_0x110224,0x3,_0xeb62('0x6b'),_0xeb62('0x6e')+_0x2b788e['callerIdAll']));}else{_0x510275[_0xeb62('0x6a')](new Extension(_0x110224,0x3,_0xeb62('0x65'),_0xeb62('0x6f')));}_0x510275[_0xeb62('0x6a')](new Extension(_0x110224,0x4,'goto',_0x1d8675[_0xeb62('0x5e')]+','+_0xeb62('0x70')+(0x8+_0x2b788e[_0xeb62('0x31')][_0xeb62('0x3e')])+'}'+','+0x1));return _0x510275;}function formatPrefixName(_0xc81d4c){var _0x32642f='_';for(var _0x48488c=0x0;_0x48488c<_0xc81d4c[_0xeb62('0x3e')];_0x48488c++){if(_0xc81d4c[_0xeb62('0x71')](_0x48488c)=='-'){_0x32642f+=_0xc81d4c[_0xeb62('0x71')](_0x48488c);}else{_0x32642f+='['+_0xc81d4c[_0xeb62('0x71')](_0x48488c)+']';}}_0x32642f+='.';return _0x32642f;}exports[_0xeb62('0x2c')]=function(_0x28d0ff,_0x2e4502,_0x313d33){var _0x233715=_0x28d0ff[_0xeb62('0x53')];_0x233715[_0xeb62('0x64')]=_0xeb62('0x72')+_0x233715[_0xeb62('0x31')]+'-';return db[_0xeb62('0x52')][_0xeb62('0x73')](function(_0x2bbbff){return db['VoicePrefix'][_0xeb62('0x2c')](_0x233715,{'where':{'id':_0x233715['id']},'transaction':_0x2bbbff})['then'](function(){return db[_0xeb62('0x55')][_0xeb62('0x2d')]({'where':{'VoicePrefixId':_0x233715['id']},'transaction':_0x2bbbff})['then'](function(){return db[_0xeb62('0x55')][_0xeb62('0x4f')]({'where':{'id':_0x233715[_0xeb62('0x56')]},'raw':!![]})[_0xeb62('0x2e')](function(_0x206e77){return createVoicePrefixExtensions(_0x233715,_0x206e77,_0x2bbbff);});});});})[_0xeb62('0x2e')](function(){return db[_0xeb62('0x35')][_0xeb62('0x74')](_0x233715['id']);})[_0xeb62('0x2e')](respondWithResult(_0x2e4502,null))[_0xeb62('0x4c')](handleError(_0x2e4502,null));};exports[_0xeb62('0x75')]=function(_0x146174,_0x910940,_0x4c6b69){return db[_0xeb62('0x35')][_0xeb62('0x4f')]({'where':{'id':_0x146174['params']['id']}})[_0xeb62('0x2e')](handleEntityNotFound(_0x910940,null))['then'](function(_0x32679a){if(_0x32679a){return _0x32679a[_0xeb62('0x75')](_0x146174[_0xeb62('0x53')][_0xeb62('0x76')],_[_0xeb62('0x77')](_0x146174[_0xeb62('0x53')],['ids','id'])||{})[_0xeb62('0x78')](function(_0x4fc07f){for(var _0x42ee4d=0x0;_0x42ee4d<_0x146174[_0xeb62('0x53')][_0xeb62('0x76')][_0xeb62('0x3e')];_0x42ee4d+=0x1){socket[_0xeb62('0x79')]('userVoicePrefix:save',{'UserId':Number(_0x146174[_0xeb62('0x53')][_0xeb62('0x76')][_0x42ee4d]),'VoicePrefixId':Number(_0x146174[_0xeb62('0x4d')]['id'])});}return _0x4fc07f;});}})['then'](respondWithResult(_0x910940,null))[_0xeb62('0x4c')](handleError(_0x910940,null));};exports[_0xeb62('0x7a')]=function(_0x8a8ef3,_0x7ca547,_0x16c28d){return db[_0xeb62('0x35')]['find']({'where':{'id':_0x8a8ef3['params']['id']}})['then'](handleEntityNotFound(_0x7ca547,null))['then'](function(_0x5bf6f6){if(_0x5bf6f6){return _0x5bf6f6[_0xeb62('0x7a')](_0x8a8ef3[_0xeb62('0x39')][_0xeb62('0x76')])[_0xeb62('0x2e')](function(){if(_[_0xeb62('0x7b')](_0x8a8ef3[_0xeb62('0x39')][_0xeb62('0x76')])){for(var _0x1c01ae=0x0;_0x1c01ae<_0x8a8ef3[_0xeb62('0x39')][_0xeb62('0x76')][_0xeb62('0x3e')];_0x1c01ae+=0x1){socket[_0xeb62('0x79')]('userVoicePrefix:remove',{'UserId':Number(_0x8a8ef3[_0xeb62('0x39')][_0xeb62('0x76')][_0x1c01ae]),'VoicePrefixId':Number(_0x8a8ef3[_0xeb62('0x4d')]['id'])});}}else{socket[_0xeb62('0x79')](_0xeb62('0x7c'),{'UserId':Number(_0x8a8ef3[_0xeb62('0x39')][_0xeb62('0x76')]),'VoicePrefixId':Number(_0x8a8ef3[_0xeb62('0x4d')]['id'])});}});}})[_0xeb62('0x2e')](respondWithStatusCode(_0x7ca547,null))[_0xeb62('0x4c')](handleError(_0x7ca547,null));};exports[_0xeb62('0x7d')]=function(_0x17beef,_0x45b2a3,_0x42c384){var _0xfff29b={};var _0x1cbfab={};var _0x29648f;var _0x2f5f2f;return db['VoicePrefix'][_0xeb62('0x7e')]({'where':{'id':_0x17beef['params']['id']}})[_0xeb62('0x2e')](handleEntityNotFound(_0x45b2a3,null))[_0xeb62('0x2e')](function(_0x48dcf6){if(_0x48dcf6){_0x29648f=_0x48dcf6;_0x1cbfab[_0xeb62('0x3f')]=_['keys'](db['User'][_0xeb62('0x4e')]);_0x1cbfab[_0xeb62('0x39')]=_[_0xeb62('0x38')](_0x17beef[_0xeb62('0x39')]);_0x1cbfab['filters']=_[_0xeb62('0x3b')](_0x1cbfab[_0xeb62('0x3f')],_0x1cbfab['query']);_0xfff29b[_0xeb62('0x3c')]=_[_0xeb62('0x3b')](_0x1cbfab[_0xeb62('0x3f')],qs[_0xeb62('0x3d')](_0x17beef[_0xeb62('0x39')][_0xeb62('0x3d')]));_0xfff29b[_0xeb62('0x3c')]=_0xfff29b[_0xeb62('0x3c')]['length']?_0xfff29b[_0xeb62('0x3c')]:_0x1cbfab[_0xeb62('0x3f')];_0xfff29b['order']=qs[_0xeb62('0x42')](_0x17beef['query']['sort']);_0xfff29b[_0xeb62('0x43')]=qs[_0xeb62('0x3a')](_[_0xeb62('0x44')](_0x17beef[_0xeb62('0x39')],_0x1cbfab[_0xeb62('0x3a')]));if(_0x17beef['query'][_0xeb62('0x45')]){_0xfff29b[_0xeb62('0x43')]=_[_0xeb62('0x46')](_0xfff29b[_0xeb62('0x43')],{'$or':_[_0xeb62('0x34')](_0xfff29b[_0xeb62('0x3c')],function(_0x401ad1){var _0x50170b={};_0x50170b[_0x401ad1]={'$like':'%'+_0x17beef['query']['filter']+'%'};return _0x50170b;})});}_0xfff29b=_[_0xeb62('0x46')]({},_0xfff29b,_0x17beef[_0xeb62('0x47')]);return _0x29648f[_0xeb62('0x7d')](_0xfff29b);}})[_0xeb62('0x2e')](function(_0x599418){if(_0x599418){_0x2f5f2f=_0x599418[_0xeb62('0x3e')];if(!_0x17beef['query']['hasOwnProperty'](_0xeb62('0x7f'))){_0xfff29b[_0xeb62('0x26')]=qs['limit'](_0x17beef[_0xeb62('0x39')]['limit']);_0xfff29b[_0xeb62('0x24')]=qs[_0xeb62('0x24')](_0x17beef[_0xeb62('0x39')]['offset']);}return _0x29648f['getAgents'](_0xfff29b);}})[_0xeb62('0x2e')](function(_0x276e06){if(_0x276e06){return _0x276e06?{'count':_0x2f5f2f,'rows':_0x276e06}:null;}})[_0xeb62('0x2e')](respondWithResult(_0x45b2a3,null))['catch'](handleError(_0x45b2a3,null));};exports[_0xeb62('0x80')]=function(_0x162993,_0x3f5c93,_0x3b15ec){var _0xca3f0e={};var _0x2e4d99={};var _0x518655;var _0x4cd599;return db['VoicePrefix'][_0xeb62('0x7e')]({'where':{'id':_0x162993['params']['id']}})['then'](handleEntityNotFound(_0x3f5c93,null))[_0xeb62('0x2e')](function(_0x49d2c7){if(_0x49d2c7){_0x518655=_0x49d2c7;_0x2e4d99['model']=_['keys'](db[_0xeb62('0x81')]['rawAttributes']);_0x2e4d99[_0xeb62('0x39')]=_[_0xeb62('0x38')](_0x162993[_0xeb62('0x39')]);_0x2e4d99[_0xeb62('0x3a')]=_[_0xeb62('0x3b')](_0x2e4d99[_0xeb62('0x3f')],_0x2e4d99[_0xeb62('0x39')]);_0xca3f0e['attributes']=_['intersection'](_0x2e4d99[_0xeb62('0x3f')],qs[_0xeb62('0x3d')](_0x162993[_0xeb62('0x39')][_0xeb62('0x3d')]));_0xca3f0e[_0xeb62('0x3c')]=_0xca3f0e['attributes'][_0xeb62('0x3e')]?_0xca3f0e[_0xeb62('0x3c')]:_0x2e4d99[_0xeb62('0x3f')];_0xca3f0e['order']=qs[_0xeb62('0x42')](_0x162993['query'][_0xeb62('0x42')]);_0xca3f0e[_0xeb62('0x43')]=qs['filters'](_['pick'](_0x162993[_0xeb62('0x39')],_0x2e4d99[_0xeb62('0x3a')]));if(_0x162993[_0xeb62('0x39')][_0xeb62('0x45')]){_0xca3f0e['where']=_[_0xeb62('0x46')](_0xca3f0e[_0xeb62('0x43')],{'$or':_['map'](_0xca3f0e['attributes'],function(_0x12adf6){var _0x1b9569={};_0x1b9569[_0x12adf6]={'$like':'%'+_0x162993[_0xeb62('0x39')][_0xeb62('0x45')]+'%'};return _0x1b9569;})});}_0xca3f0e=_[_0xeb62('0x46')]({},_0xca3f0e,_0x162993[_0xeb62('0x47')]);return _0x518655[_0xeb62('0x80')](_0xca3f0e);}})[_0xeb62('0x2e')](function(_0x144bc8){if(_0x144bc8){_0x4cd599=_0x144bc8[_0xeb62('0x3e')];if(!_0x162993[_0xeb62('0x39')][_0xeb62('0x40')](_0xeb62('0x7f'))){_0xca3f0e[_0xeb62('0x26')]=qs[_0xeb62('0x26')](_0x162993[_0xeb62('0x39')]['limit']);_0xca3f0e[_0xeb62('0x24')]=qs[_0xeb62('0x24')](_0x162993[_0xeb62('0x39')][_0xeb62('0x24')]);}return _0x518655[_0xeb62('0x80')](_0xca3f0e);}})['then'](function(_0x54984f){if(_0x54984f){return _0x54984f?{'count':_0x4cd599,'rows':_0x54984f}:null;}})[_0xeb62('0x2e')](respondWithResult(_0x3f5c93,null))[_0xeb62('0x4c')](handleError(_0x3f5c93,null));};exports[_0xeb62('0x82')]=function(_0x3d957d,_0x5af4d7,_0x3a0b12){var _0x5f2c1e=_0x3d957d[_0xeb62('0x53')][_0xeb62('0x76')];var _0x3409db;return db[_0xeb62('0x81')][_0xeb62('0x4a')]({'where':{'id':_0x5f2c1e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeb62('0x83'),'attributes':['id',_0xeb62('0x31'),'online',_0xeb62('0x84'),'interface'],'raw':!![]}]})[_0xeb62('0x2e')](function(_0x43107d){if(_0x43107d){_0x3409db=_0x43107d;var _0x2e503b=_[_0xeb62('0x85')](_0x43107d,function(_0x45a197){var _0x3394e6=_0x45a197['get']({'plain':!![]});return _0x3394e6['Agents'];});return db[_0xeb62('0x35')][_0xeb62('0x4f')]({'where':{'id':_0x3d957d[_0xeb62('0x4d')]['id']}})[_0xeb62('0x2e')](function(_0x582217){return db['sequelize'][_0xeb62('0x73')](function(_0x527de3){return _0x582217[_0xeb62('0x82')](_0x5f2c1e,{'transaction':_0x527de3})[_0xeb62('0x2e')](function(){return BPromise[_0xeb62('0x86')](_0x3409db,function(_0x5e43f0){return db[_0xeb62('0x87')][_0xeb62('0x88')]({'TeamId':_0x5e43f0['id'],'VoicePrefixId':_0x3d957d[_0xeb62('0x4d')]['id']},{'transaction':_0x527de3});});})[_0xeb62('0x2e')](function(){return BPromise[_0xeb62('0x86')](_0x2e503b,function(_0x10731b){return db[_0xeb62('0x89')][_0xeb62('0x8a')]({'where':{'UserId':_0x10731b['id'],'VoicePrefixId':_0x3d957d['params']['id']},'transaction':_0x527de3});});})[_0xeb62('0x2e')](function(){_0x2e503b[_0xeb62('0x8b')](function(_0x35d372){socket[_0xeb62('0x79')]('userVoicePrefix:save',{'UserId':_0x35d372['id'],'VoicePrefixId':_0x582217['id']});});});});});}})[_0xeb62('0x2e')](respondWithStatusCode(_0x5af4d7,null))[_0xeb62('0x4c')](handleError(_0x5af4d7,null));};exports[_0xeb62('0x8c')]=function(_0x146c7e,_0x24c285,_0x59bb00){return db[_0xeb62('0x81')][_0xeb62('0x4a')]({'where':{'id':_0x146c7e[_0xeb62('0x39')][_0xeb62('0x76')]},'attributes':['id'],'include':[{'model':db[_0xeb62('0x8d')],'as':_0xeb62('0x83'),'attributes':['id'],'raw':!![]}]})[_0xeb62('0x2e')](handleEntityNotFound(_0x24c285,null))[_0xeb62('0x2e')](function(_0x30625f){var _0x94d0c9=_['map'](_0x30625f,'id');var _0x3ae667=[];var _0x3338ba=[];var _0x50cf9b=squel['select']();_0x50cf9b[_0xeb62('0x8e')](_0xeb62('0x8f'))[_0xeb62('0x90')](_0xeb62('0x91'),'tq')[_0xeb62('0x92')](_0xeb62('0x93'),'ut',_0xeb62('0x94'))[_0xeb62('0x43')](_0xeb62('0x95'),_0x146c7e['params']['id']);for(var _0x535e7a=0x0;_0x535e7a<_0x30625f[_0xeb62('0x3e')];_0x535e7a+=0x1){let _0x43daef=_0x30625f[_0x535e7a];for(var _0x58ffb2=0x0;_0x58ffb2<_0x43daef['Agents'][_0xeb62('0x3e')];_0x58ffb2+=0x1){let _0x341bd8=_0x43daef[_0xeb62('0x83')][_0x58ffb2];var _0x55ef9d=_0x50cf9b['clone']();_0x55ef9d[_0xeb62('0x43')]('ut.UserId\x20=\x20?',_0x341bd8['id']);_0x3338ba[_0xeb62('0x6a')](db[_0xeb62('0x52')][_0xeb62('0x39')](_0x55ef9d['toString'](),{'type':db['sequelize']['QueryTypes'][_0xeb62('0x96')]})[_0xeb62('0x2e')](function(_0x3517db){if(_0x3517db[_0xeb62('0x3e')]===0x1){return _0x341bd8['id'];}else{var _0x5bd3b6=_[_0xeb62('0x97')](_[_0xeb62('0x34')](_0x3517db,_0xeb62('0x98')),function(_0x22eb23){return _[_0xeb62('0x99')](_0x94d0c9,_0x22eb23);});if(_0x5bd3b6){return _0x341bd8['id'];}}}));}}return BPromise[_0xeb62('0x9a')](_0x3338ba)[_0xeb62('0x2e')](function(_0x394573){_0x3ae667=_(_0x3ae667)['union'](_0x394573)[_0xeb62('0x9b')]()[_0xeb62('0x9c')]();return db[_0xeb62('0x35')][_0xeb62('0x4f')]({'where':{'id':_0x146c7e['params']['id']}})[_0xeb62('0x2e')](function(_0x1f84f0){return db['sequelize'][_0xeb62('0x73')](function(_0x26b456){return _0x1f84f0[_0xeb62('0x8c')](_0x146c7e[_0xeb62('0x39')][_0xeb62('0x76')],{'transaction':_0x26b456})[_0xeb62('0x2e')](function(){if(!_[_0xeb62('0x9d')](_0x3ae667)){return _0x1f84f0['removeAgents'](_0x3ae667,{'transaction':_0x26b456});}})[_0xeb62('0x2e')](function(){_0x3ae667['forEach'](function(_0x3578a9){socket[_0xeb62('0x79')](_0xeb62('0x7c'),{'UserId':_0x3578a9,'VoicePrefixId':_0x1f84f0['id']});});});});});});})['then'](respondWithStatusCode(_0x24c285,null))['catch'](handleError(_0x24c285,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index c8e459c..49e4389 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 _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 +var _0xca7c=['exports','../../mysqldb','VoicePrefix','setMaxListeners','save','emit','hook'];(function(_0x40cff6,_0x25f6bd){var _0x3f57c6=function(_0x34b874){while(--_0x34b874){_0x40cff6['push'](_0x40cff6['shift']());}};_0x3f57c6(++_0x25f6bd);}(_0xca7c,0x127));var _0xcca7=function(_0x325454,_0x143834){_0x325454=_0x325454-0x0;var _0xec9f73=_0xca7c[_0x325454];return _0xec9f73;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xcca7('0x0'))['db'][_0xcca7('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xcca7('0x2')](0x0);var events={'afterCreate':_0xcca7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x49b9aa){return function(_0x5cd6f3,_0x24d274,_0x543af4){VoicePrefixEvents[_0xcca7('0x4')](_0x49b9aa+':'+_0x5cd6f3['id'],_0x5cd6f3);VoicePrefixEvents[_0xcca7('0x4')](_0x49b9aa,_0x5cd6f3);_0x543af4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xcca7('0x5')](e,emitEvent(event));}}module[_0xcca7('0x6')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 3e6ffbf..d57ff55 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 _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 +var _0xb025=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','define','voice_prefixes','util'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xb025,0x16a));var _0x5b02=function(_0x59e1f0,_0x5e26f9){_0x59e1f0=_0x59e1f0-0x0;var _0x720503=_0xb025[_0x59e1f0];return _0x720503;};'use strict';var _=require('lodash');var util=require(_0x5b02('0x0'));var logger=require(_0x5b02('0x1'))('api');var moment=require(_0x5b02('0x2'));var BPromise=require(_0x5b02('0x3'));var rp=require(_0x5b02('0x4'));var fs=require('fs');var path=require(_0x5b02('0x5'));var rimraf=require(_0x5b02('0x6'));var config=require(_0x5b02('0x7'));var attributes=require(_0x5b02('0x8'));module['exports']=function(_0x5be74c,_0x1e97bf){return _0x5be74c[_0x5b02('0x9')]('VoicePrefix',attributes,{'tableName':_0x5b02('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 70e35c0..b069dec 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 _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 +var _0xa498=['result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x2947bf,_0x174a09){var _0x40421c=function(_0x42939d){while(--_0x42939d){_0x2947bf['push'](_0x2947bf['shift']());}};_0x40421c(++_0x174a09);}(_0xa498,0x1d6));var _0x8a49=function(_0x246115,_0x398123){_0x246115=_0x246115-0x0;var _0x385878=_0xa498[_0x246115];return _0x385878;};'use strict';var _=require('lodash');var util=require(_0x8a49('0x0'));var moment=require(_0x8a49('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a49('0x2'));var db=require(_0x8a49('0x3'))['db'];var utils=require(_0x8a49('0x4'));var logger=require(_0x8a49('0x5'))(_0x8a49('0x6'));var config=require('../../config/environment');var jayson=require(_0x8a49('0x7'));var client=jayson['client'][_0x8a49('0x8')]({'port':0x232a});config[_0x8a49('0x9')]=_[_0x8a49('0xa')](config['redis'],{'host':_0x8a49('0xb'),'port':0x18eb});var socket=require(_0x8a49('0xc'))(new Redis(config[_0x8a49('0x9')]));require(_0x8a49('0xd'))[_0x8a49('0xe')](socket);function respondWithRpcPromise(_0x688ffa,_0x595d79,_0x15e5b4){return new BPromise(function(_0x24bb85,_0x41674b){return client[_0x8a49('0xf')](_0x688ffa,_0x15e5b4)[_0x8a49('0x10')](function(_0x35f2b0){logger[_0x8a49('0x11')](_0x8a49('0x12'),_0x595d79,_0x8a49('0x13'));logger['debug'](_0x8a49('0x14'),_0x595d79,_0x8a49('0x13'),JSON[_0x8a49('0x15')](_0x35f2b0));if(_0x35f2b0['error']){if(_0x35f2b0[_0x8a49('0x16')]['code']===0x1f4){logger[_0x8a49('0x16')](_0x8a49('0x12'),_0x595d79,_0x35f2b0['error'][_0x8a49('0x17')]);return _0x41674b(_0x35f2b0[_0x8a49('0x16')][_0x8a49('0x17')]);}logger[_0x8a49('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x595d79,_0x35f2b0['error'][_0x8a49('0x17')]);return _0x24bb85(_0x35f2b0[_0x8a49('0x16')][_0x8a49('0x17')]);}else{logger[_0x8a49('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x595d79,_0x8a49('0x13'));_0x24bb85(_0x35f2b0[_0x8a49('0x18')][_0x8a49('0x17')]);}})[_0x8a49('0x19')](function(_0x441ab1){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x595d79,_0x441ab1);_0x41674b(_0x441ab1);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index ab74bc2..189d271 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 _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 +var _0xde56=['removeListener','register','length','voicePrefix:','./voicePrefix.events','remove','update','emit'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0xde56,0x144));var _0x6de5=function(_0x50c492,_0x5c1e67){_0x50c492=_0x50c492-0x0;var _0x3505a8=_0xde56[_0x50c492];return _0x3505a8;};'use strict';var VoicePrefixEvents=require(_0x6de5('0x0'));var events=['save',_0x6de5('0x1'),_0x6de5('0x2')];function createListener(_0x2d8342,_0x44082d){return function(_0x2484e4){_0x44082d[_0x6de5('0x3')](_0x2d8342,_0x2484e4);};}function removeListener(_0x1cdb30,_0x382a2a){return function(){VoicePrefixEvents[_0x6de5('0x4')](_0x1cdb30,_0x382a2a);};}exports[_0x6de5('0x5')]=function(_0x4c65d1){for(var _0x1d6194=0x0,_0x141d65=events[_0x6de5('0x6')];_0x1d6194<_0x141d65;_0x1d6194++){var _0x1f8236=events[_0x1d6194];var _0x1cd11e=createListener(_0x6de5('0x7')+_0x1f8236,_0x4c65d1);VoicePrefixEvents['on'](_0x1f8236,_0x1cd11e);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 295c787..1fd2e84 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_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 +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(_0x60e243,_0x42f155){var _0x53b8cc=function(_0x482b2b){while(--_0x482b2b){_0x60e243['push'](_0x60e243['shift']());}};_0x53b8cc(++_0x42f155);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 208111a..6dbd824 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 _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 +var _0x7e59=['leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','type','getDataValue','outbound','preview','roundrobin','includes','INTEGER','yes','all','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','progressive','power','predictive','booked','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\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)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','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','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\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)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','ENUM','inbound','default','ringall'];(function(_0x102a37,_0x881f9){var _0x2fa196=function(_0xa98303){while(--_0xa98303){_0x102a37['push'](_0x102a37['shift']());}};_0x2fa196(++_0x881f9);}(_0x7e59,0x1c1));var _0x97e5=function(_0x5c52ba,_0x1f8200){_0x5c52ba=_0x5c52ba-0x0;var _0x40c074=_0x7e59[_0x5c52ba];return _0x40c074;};'use strict';var Sequelize=require(_0x97e5('0x0'));module['exports']={'name':{'type':Sequelize[_0x97e5('0x1')],'allowNull':![],'unique':_0x97e5('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x97e5('0x3')](_0x97e5('0x4'),'outbound'),'allowNull':![],'defaultValue':_0x97e5('0x4')},'musiconhold':{'type':Sequelize[_0x97e5('0x1')],'defaultValue':_0x97e5('0x5')},'announce':{'type':Sequelize[_0x97e5('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x97e5('0x3')]('rr',_0x97e5('0x6'),_0x97e5('0x7'),_0x97e5('0x8'),_0x97e5('0x9'),_0x97e5('0xa'),_0x97e5('0xb'),_0x97e5('0xc'),_0x97e5('0xd')),'allowNull':![],'defaultValue':_0x97e5('0x6'),'set':function(_0x286244){this[_0x97e5('0xe')](_0x97e5('0xf'),_0x286244?_0x286244:'rrmemory');},'get':function(){var _0x12ddb9=this['getDataValue'](_0x97e5('0x10'));var _0x11eaf0=this[_0x97e5('0x11')]('dialMethod');var _0x22167f=this['getDataValue'](_0x97e5('0xf'));if(_0x12ddb9===_0x97e5('0x12')){if(_0x11eaf0===_0x97e5('0x13')){return null;}if(_0x11eaf0==='booked'&&!['rrmemory',_0x97e5('0x14')][_0x97e5('0x15')](_0x22167f)){this['setDataValue'](_0x97e5('0xf'),_0x97e5('0xa'));}}return _0x22167f;}},'servicelevel':{'type':Sequelize[_0x97e5('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x97e5('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x97e5('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x97e5('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x97e5('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x97e5('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x97e5('0x3')](_0x97e5('0x17'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM'](_0x97e5('0x17'),'no',_0x97e5('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x97e5('0x16')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x97e5('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x97e5('0x3')](_0x97e5('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x97e5('0x3')](_0x97e5('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x97e5('0x3')](_0x97e5('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x97e5('0x3')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x97e5('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x97e5('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x97e5('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x97e5('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x97e5('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x97e5('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x97e5('0x3')](_0x97e5('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x97e5('0x3')](_0x97e5('0x17'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x97e5('0x3')](_0x97e5('0x17'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x97e5('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x97e5('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x97e5('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x97e5('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x97e5('0x1')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x97e5('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x97e5('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x97e5('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x97e5('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x97e5('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x97e5('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x97e5('0x1')]},'queue_quantity1':{'type':Sequelize[_0x97e5('0x1')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x97e5('0x1')]},'queue_less_than':{'type':Sequelize[_0x97e5('0x1')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x21a1c0){this[_0x97e5('0xe')]('periodic_announce',_0x21a1c0?_0x21a1c0['join'](','):[]);},'get':function(){return this[_0x97e5('0x11')](_0x97e5('0x19'))?this[_0x97e5('0x11')](_0x97e5('0x19'))[_0x97e5('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x97e5('0x1')],'defaultValue':_0x97e5('0x17'),'set':function(_0x160eeb){this[_0x97e5('0xe')](_0x97e5('0x1b'),_0x160eeb?_0x160eeb['join'](','):undefined);},'get':function(){return this[_0x97e5('0x11')](_0x97e5('0x1b'))?this[_0x97e5('0x11')](_0x97e5('0x1b'))[_0x97e5('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x5ee7d7){this[_0x97e5('0xe')](_0x97e5('0x1c'),_0x5ee7d7?_0x5ee7d7['join'](','):undefined);},'get':function(){return this[_0x97e5('0x11')]('leavewhenempty')?this[_0x97e5('0x11')](_0x97e5('0x1c'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x97e5('0x3')](_0x97e5('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x97e5('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x97e5('0x3')](_0x97e5('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x97e5('0x1')]},'acw':{'type':Sequelize[_0x97e5('0x1d')],'defaultValue':0x0,'set':function(_0x149cfb){this['setDataValue']('acw',_0x149cfb);if(_0x149cfb){if(this[_0x97e5('0x11')]('wrapuptime')<0x2){this[_0x97e5('0xe')](_0x97e5('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x97e5('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x97e5('0x1d')],'defaultValue':0x0,'comment':_0x97e5('0x1f')},'dialMethod':{'type':Sequelize[_0x97e5('0x3')]('preview',_0x97e5('0x20'),_0x97e5('0x21'),_0x97e5('0x22'),_0x97e5('0x23')),'defaultValue':'progressive','comment':_0x97e5('0x24')},'dialLimitChannel':{'type':Sequelize[_0x97e5('0x16')](0x4)[_0x97e5('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x97e5('0x26')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x97e5('0x27')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x97e5('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x97e5('0x3')](_0x97e5('0x29'),'dropRate'),'defaultValue':_0x97e5('0x2a'),'comment':_0x97e5('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x97e5('0x27')](0x2)[_0x97e5('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x97e5('0x2c')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x97e5('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x97e5('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x97e5('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x97e5('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x97e5('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x97e5('0x2e')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x97e5('0x2f'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x97e5('0x16')](0x3)[_0x97e5('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x97e5('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x97e5('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x97e5('0x16')](0x5)[_0x97e5('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x97e5('0x16')](0x3)[_0x97e5('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x97e5('0x31')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x97e5('0x16')](0x3)[_0x97e5('0x25')],'defaultValue':0x3,'comment':_0x97e5('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x97e5('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x97e5('0x16')](0x3)[_0x97e5('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x97e5('0x1')],'defaultValue':_0x97e5('0x33')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x97e5('0x34'),_0x97e5('0x35'),'onlyIfOpen'),'defaultValue':_0x97e5('0x34')},'dialAMDActive':{'type':Sequelize[_0x97e5('0x1d')],'defaultValue':0x0,'comment':_0x97e5('0x36')},'dialAMDInitialSilence':{'type':Sequelize[_0x97e5('0x16')](0x9)[_0x97e5('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x97e5('0x37')},'dialAMDGreeting':{'type':Sequelize[_0x97e5('0x16')](0x9)[_0x97e5('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x97e5('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x97e5('0x16')](0x9)[_0x97e5('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x97e5('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x97e5('0x16')](0x9)[_0x97e5('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x97e5('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0x97e5('0x16')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x97e5('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x97e5('0x16')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x97e5('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x97e5('0x16')](0x9)[_0x97e5('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x97e5('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x97e5('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x97e5('0x16')](0x9)[_0x97e5('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x97e5('0x1d')],'defaultValue':0x0,'comment':_0x97e5('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x97e5('0x3f'),_0x97e5('0x40')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x97e5('0x1')],'comment':_0x97e5('0x41')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x97e5('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x97e5('0x16')](0x3)[_0x97e5('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x97e5('0x16')](0x3)[_0x97e5('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x97e5('0x42')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x97e5('0x16')](0x5)[_0x97e5('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x97e5('0x43')},'dialDropMaxRetry':{'type':Sequelize[_0x97e5('0x16')](0x3)[_0x97e5('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x97e5('0x44')},'dialDropRetryFrequency':{'type':Sequelize[_0x97e5('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x97e5('0x16')](0x3)[_0x97e5('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x97e5('0x16')](0x5)[_0x97e5('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x97e5('0x45')},'dialMachineMaxRetry':{'type':Sequelize[_0x97e5('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x97e5('0x46')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x97e5('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x97e5('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x97e5('0x16')](0x3)[_0x97e5('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x97e5('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x97e5('0x16')](0x5)[_0x97e5('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x97e5('0x1d')],'defaultValue':![],'comment':_0x97e5('0x49'),'set':function(_0x1c0951){if(!_0x1c0951)this[_0x97e5('0xe')](_0x97e5('0x4a'),null);this[_0x97e5('0xe')](_0x97e5('0x4b'),_0x1c0951);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x97e5('0x16')](0x3)[_0x97e5('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x97e5('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x97e5('0x1d')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x97e5('0x16')](0x3)[_0x97e5('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x97e5('0x1d')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 33803ee..6737d57 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 _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 +var _0x39c7=['stack','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','rows','catch','params','keys','intersection','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','findOne','hasOwnProperty','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','findAll','getHopperFinals','CmHopperFinal','CmHopperBlack','Team','getTeams','addTeams','User','Agents','online','voicePause','interface','flatMap','penalty','sequelize','transaction','upsert','each','findOrCreate','isNil','format','emit','userVoiceQueue:save','removeTeams','ids','field','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','compact','removeAgents','UserVoiceQueueRt','forEach','userVoiceQueue:remove','addAgents','spread','isEmpty','all','getAgents','getMembers','getLists','CmList','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','scheduledAt','ListId','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_contacts','CmListId','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','ListId\x20=\x20?','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','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','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','name','UserProfileResource','destroy','then','error'];(function(_0x5c8a28,_0x59ce4d){var _0xfd22ff=function(_0x59421f){while(--_0x59421f){_0x5c8a28['push'](_0x5c8a28['shift']());}};_0xfd22ff(++_0x59ce4d);}(_0x39c7,0x85));var _0x739c=function(_0x1b0181,_0x58de82){_0x1b0181=_0x1b0181-0x0;var _0xb47682=_0x39c7[_0x1b0181];return _0xb47682;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x739c('0x0'));var zipdir=require(_0x739c('0x1'));var jsonpatch=require(_0x739c('0x2'));var rp=require(_0x739c('0x3'));var moment=require(_0x739c('0x4'));var BPromise=require(_0x739c('0x5'));var Mustache=require('mustache');var util=require(_0x739c('0x6'));var path=require(_0x739c('0x7'));var sox=require(_0x739c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x739c('0x9'));var _=require(_0x739c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x739c('0xb'));var deskjs=require(_0x739c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x739c('0xd'));var Papa=require(_0x739c('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x739c('0xf'));var as=require(_0x739c('0x10'));var hardwareService=require(_0x739c('0x11'));var logger=require(_0x739c('0x12'))(_0x739c('0x13'));var utils=require(_0x739c('0x14'));var config=require(_0x739c('0x15'));var licenseUtil=require(_0x739c('0x16'));var db=require(_0x739c('0x17'))['db'];config[_0x739c('0x18')]=_[_0x739c('0x19')](config[_0x739c('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x739c('0x1a'))(new Redis(config[_0x739c('0x18')]));require(_0x739c('0x1b'))[_0x739c('0x1c')](socket);function respondWithStatusCode(_0x298049,_0x23be87){_0x23be87=_0x23be87||0xcc;return function(_0x254b5d){if(_0x254b5d){return _0x298049[_0x739c('0x1d')](_0x23be87);}return _0x298049[_0x739c('0x1e')](_0x23be87)[_0x739c('0x1f')]();};}function respondWithResult(_0x4cc36c,_0x50ee8d){_0x50ee8d=_0x50ee8d||0xc8;return function(_0x362095){if(_0x362095){return _0x4cc36c[_0x739c('0x1e')](_0x50ee8d)[_0x739c('0x20')](_0x362095);}};}function respondWithFilteredResult(_0x56034d,_0x1bb4fd){return function(_0x2dc479){if(_0x2dc479){var _0x27141a=typeof _0x1bb4fd[_0x739c('0x21')]===_0x739c('0x22')&&typeof _0x1bb4fd['limit']===_0x739c('0x22');var _0x30259e=_0x2dc479[_0x739c('0x23')];var _0x4fc201=_0x27141a?0x0:_0x1bb4fd[_0x739c('0x21')];var _0x48fc13=_0x27141a?_0x2dc479['count']:_0x1bb4fd[_0x739c('0x21')]+_0x1bb4fd['limit'];var _0x13deaf;if(_0x48fc13>=_0x30259e){_0x48fc13=_0x30259e;_0x13deaf=0xc8;}else{_0x13deaf=0xce;}_0x56034d[_0x739c('0x1e')](_0x13deaf);return _0x56034d['set'](_0x739c('0x24'),_0x4fc201+'-'+_0x48fc13+'/'+_0x30259e)['json'](_0x2dc479);}return null;};}function patchUpdates(_0x147baf){return function(_0x4a36c9){try{jsonpatch[_0x739c('0x25')](_0x4a36c9,_0x147baf,!![]);}catch(_0x34d5d5){return BPromise[_0x739c('0x26')](_0x34d5d5);}return _0x4a36c9[_0x739c('0x27')]();};}function saveUpdates(_0x3799ef,_0xc138ce){return function(_0x147b02){if(_0x147b02){return _0x147b02[_0x739c('0x28')](_0x3799ef)['then'](function(_0x384bc5){return _0x384bc5;});}return null;};}function removeEntity(_0x87b322,_0x5c963f){return function(_0x3dad7f){if(_0x3dad7f){return _0x3dad7f['destroy']()['then'](function(){var _0x4200b3=_0x3dad7f[_0x739c('0x29')]({'plain':!![]});var _0x322139=[{'name':_0x739c('0x2a'),'value':_0x739c('0x2b'),'ignore':![]},{'name':_0x739c('0x2c'),'value':_0x739c('0x2d'),'ignore':![]}];var _0x4b105e=_(_0x322139)[_0x739c('0x2e')](_0x739c('0x2f'))[_0x739c('0x30')](_0x739c('0x31'))[_0x739c('0x31')]();if(_[_0x739c('0x32')](_0x4b105e,_0x4200b3[_0x739c('0x33')])){return;}var _0x5635b2=_['find'](_0x322139,['value',_0x4200b3['type']])[_0x739c('0x34')];return db[_0x739c('0x35')][_0x739c('0x36')]({'where':{'type':_0x5635b2,'resourceId':_0x4200b3['id']}})[_0x739c('0x37')](function(){return _0x3dad7f;});})[_0x739c('0x37')](function(){_0x87b322[_0x739c('0x1e')](0xcc)[_0x739c('0x1f')]();});}};}function handleEntityNotFound(_0x161aa5,_0x2471ad){return function(_0x107396){if(!_0x107396){_0x161aa5[_0x739c('0x1d')](0x194);}return _0x107396;};}function handleError(_0xac8767,_0x368201){_0x368201=_0x368201||0x1f4;return function(_0x2d05cf){logger[_0x739c('0x38')](_0x2d05cf[_0x739c('0x39')]);if(_0x2d05cf[_0x739c('0x34')]){delete _0x2d05cf[_0x739c('0x34')];}_0xac8767[_0x739c('0x1e')](_0x368201)[_0x739c('0x3a')](_0x2d05cf);};}exports[_0x739c('0x3b')]=function(_0x267484,_0x1f2f1a){var _0xe1b735={},_0x46693d={},_0x36eec6={'count':0x0,'rows':[]};var _0x3a4fec=_[_0x739c('0x30')](db[_0x739c('0x3c')][_0x739c('0x3d')],function(_0x1ab70f){return{'name':_0x1ab70f[_0x739c('0x3e')],'type':_0x1ab70f[_0x739c('0x33')][_0x739c('0x3f')]};});_0x46693d[_0x739c('0x40')]=_['map'](_0x3a4fec,_0x739c('0x34'));_0x46693d[_0x739c('0x41')]=_['keys'](_0x267484[_0x739c('0x41')]);_0x46693d[_0x739c('0x42')]=_['intersection'](_0x46693d['model'],_0x46693d[_0x739c('0x41')]);_0xe1b735[_0x739c('0x43')]=_['intersection'](_0x46693d[_0x739c('0x40')],qs[_0x739c('0x44')](_0x267484[_0x739c('0x41')][_0x739c('0x44')]));_0xe1b735[_0x739c('0x43')]=_0xe1b735['attributes'][_0x739c('0x45')]?_0xe1b735[_0x739c('0x43')]:_0x46693d['model'];if(!_0x267484['query']['hasOwnProperty'](_0x739c('0x46'))){_0xe1b735[_0x739c('0x47')]=qs['limit'](_0x267484[_0x739c('0x41')]['limit']);_0xe1b735['offset']=qs[_0x739c('0x21')](_0x267484[_0x739c('0x41')][_0x739c('0x21')]);}_0xe1b735[_0x739c('0x48')]=qs[_0x739c('0x49')](_0x267484[_0x739c('0x41')][_0x739c('0x49')]);_0xe1b735[_0x739c('0x4a')]=qs['filters'](_[_0x739c('0x4b')](_0x267484[_0x739c('0x41')],_0x46693d[_0x739c('0x42')]),_0x3a4fec);if(_0x267484[_0x739c('0x41')]['filter']){_0xe1b735[_0x739c('0x4a')]=_[_0x739c('0x4c')](_0xe1b735['where'],{'$or':_[_0x739c('0x30')](_0x3a4fec,function(_0xc22cd1){if(_0xc22cd1[_0x739c('0x33')]!==_0x739c('0x4d')){var _0x480d22={};_0x480d22[_0xc22cd1[_0x739c('0x34')]]={'$like':'%'+_0x267484[_0x739c('0x41')][_0x739c('0x2e')]+'%'};return _0x480d22;}})});}_0xe1b735=_[_0x739c('0x4c')]({},_0xe1b735,_0x267484['options']);var _0xf96733={'where':_0xe1b735['where']};return db['VoiceQueue']['count'](_0xf96733)[_0x739c('0x37')](function(_0x407d42){_0x36eec6[_0x739c('0x23')]=_0x407d42;if(_0x267484[_0x739c('0x41')][_0x739c('0x4e')]){_0xe1b735[_0x739c('0x4f')]=[{'all':!![]}];}return db['VoiceQueue']['findAll'](_0xe1b735);})['then'](function(_0x4642cc){_0x36eec6[_0x739c('0x50')]=_0x4642cc;return _0x36eec6;})['then'](respondWithFilteredResult(_0x1f2f1a,_0xe1b735))[_0x739c('0x51')](handleError(_0x1f2f1a,null));};exports['show']=function(_0x43a704,_0x483329){var _0x4056da={'raw':![],'where':{'id':_0x43a704[_0x739c('0x52')]['id']}},_0x387596={};_0x387596['model']=_[_0x739c('0x53')](db[_0x739c('0x3c')]['rawAttributes']);_0x387596[_0x739c('0x41')]=_[_0x739c('0x53')](_0x43a704[_0x739c('0x41')]);_0x387596[_0x739c('0x42')]=_[_0x739c('0x54')](_0x387596['model'],_0x387596[_0x739c('0x41')]);_0x4056da[_0x739c('0x43')]=_['intersection'](_0x387596[_0x739c('0x40')],qs[_0x739c('0x44')](_0x43a704['query'][_0x739c('0x44')]));_0x4056da['attributes']=_0x4056da['attributes'][_0x739c('0x45')]?_0x4056da[_0x739c('0x43')]:_0x387596['model'];if(_0x43a704[_0x739c('0x41')]['includeAll']){_0x4056da[_0x739c('0x4f')]=[{'all':!![]}];}_0x4056da=_[_0x739c('0x4c')]({},_0x4056da,_0x43a704[_0x739c('0x55')]);return db[_0x739c('0x3c')][_0x739c('0x56')](_0x4056da)[_0x739c('0x37')](handleEntityNotFound(_0x483329,null))[_0x739c('0x37')](respondWithResult(_0x483329,null))[_0x739c('0x51')](handleError(_0x483329,null));};exports['create']=function(_0x195680,_0x25b22a){return db[_0x739c('0x3c')][_0x739c('0x57')](_0x195680[_0x739c('0x58')],{})[_0x739c('0x37')](function(_0x10b190){var _0x26dcfa=_0x195680[_0x739c('0x59')][_0x739c('0x29')]({'plain':!![]});if(!_0x26dcfa)throw new Error(_0x739c('0x5a'));if(_0x26dcfa[_0x739c('0x5b')]===_0x739c('0x59')){var _0x42d6f3=_0x10b190[_0x739c('0x29')]({'plain':!![]});var _0x4f1e61=[{'name':_0x739c('0x2a'),'value':_0x739c('0x2b')},{'name':'QueueCampaigns','value':_0x739c('0x2d')}];var _0x119ad1=_[_0x739c('0x56')](_0x4f1e61,[_0x739c('0x31'),_0x42d6f3[_0x739c('0x33')]])[_0x739c('0x34')];return db[_0x739c('0x5c')][_0x739c('0x56')]({'where':{'name':_0x119ad1,'userProfileId':_0x26dcfa[_0x739c('0x5d')]},'raw':!![]})[_0x739c('0x37')](function(_0x4edc8f){if(_0x4edc8f&&_0x4edc8f[_0x739c('0x5e')]===0x0){return db[_0x739c('0x35')][_0x739c('0x57')]({'name':_0x42d6f3[_0x739c('0x34')],'resourceId':_0x42d6f3['id'],'type':_0x4edc8f[_0x739c('0x34')],'sectionId':_0x4edc8f['id']},{})[_0x739c('0x37')](function(){return _0x10b190;});}else{return _0x10b190;}})[_0x739c('0x51')](function(_0x24f1f6){logger[_0x739c('0x38')](_0x739c('0x5f'),_0x24f1f6);throw _0x24f1f6;});}return _0x10b190;})['then'](respondWithResult(_0x25b22a,0xc9))['catch'](handleError(_0x25b22a,null));};exports[_0x739c('0x60')]=function(_0x21e03a,_0x20bdc1){var _0x1b8e81={'where':{'id':_0x21e03a[_0x739c('0x52')]['id']}},_0x261af2={};_0x261af2[_0x739c('0x40')]=_[_0x739c('0x53')](db[_0x739c('0x3c')][_0x739c('0x3d')]);_0x1b8e81[_0x739c('0x43')]=_[_0x739c('0x54')](_0x261af2[_0x739c('0x40')],qs[_0x739c('0x44')](_0x21e03a['query'][_0x739c('0x44')]));_0x1b8e81[_0x739c('0x43')]=_0x1b8e81[_0x739c('0x43')][_0x739c('0x45')]?_0x1b8e81['attributes']:_0x261af2[_0x739c('0x40')];if(_0x21e03a[_0x739c('0x41')][_0x739c('0x4e')]){_0x1b8e81['include']=[{'all':!![]}];}_0x1b8e81=_[_0x739c('0x4c')]({},_0x1b8e81,_0x21e03a[_0x739c('0x55')]);return db[_0x739c('0x3c')][_0x739c('0x56')](_0x1b8e81)[_0x739c('0x37')](handleEntityNotFound(_0x20bdc1,null))[_0x739c('0x37')](function(_0x44b7a8){if(_0x44b7a8){var _0x3a746d=_0x44b7a8[_0x739c('0x29')]({'plain':!![]});_0x3a746d=qs[_0x739c('0x61')](_0x3a746d,['id',_0x739c('0x62'),_0x739c('0x63')]);_0x21e03a[_0x739c('0x58')]=_[_0x739c('0x61')](_0x21e03a[_0x739c('0x58')],['id','createdAt',_0x739c('0x63')]);return db['VoiceQueue']['create'](_[_0x739c('0x4c')](_0x3a746d,_0x21e03a[_0x739c('0x58')]),{'include':_0x21e03a[_0x739c('0x41')][_0x739c('0x4e')]?[{'all':!![]}]:undefined})[_0x739c('0x37')](function(_0x401e5f){var _0x3187d8=_0x21e03a[_0x739c('0x59')]['get']({'plain':!![]});if(!_0x3187d8)throw new Error(_0x739c('0x5a'));if(_0x3187d8[_0x739c('0x5b')]===_0x739c('0x59')){var _0x2b0920=_0x401e5f[_0x739c('0x29')]({'plain':!![]});var _0x3737d8=[{'name':_0x739c('0x2a'),'value':_0x739c('0x2b')},{'name':_0x739c('0x2c'),'value':'outbound'}];var _0x52d51a=_[_0x739c('0x56')](_0x3737d8,['value',_0x2b0920[_0x739c('0x33')]])[_0x739c('0x34')];return db['UserProfileSection'][_0x739c('0x56')]({'where':{'name':_0x52d51a,'userProfileId':_0x3187d8[_0x739c('0x5d')]},'raw':!![]})[_0x739c('0x37')](function(_0x12806c){if(_0x12806c&&_0x12806c[_0x739c('0x5e')]===0x0){return db[_0x739c('0x35')]['create']({'name':_0x2b0920['name'],'resourceId':_0x2b0920['id'],'type':_0x12806c['name'],'sectionId':_0x12806c['id']},{})[_0x739c('0x37')](function(){return _0x401e5f;});}else{return _0x401e5f;}})['catch'](function(_0x28555b){logger[_0x739c('0x38')](_0x739c('0x5f'),_0x28555b);throw _0x28555b;});}return _0x401e5f;});}})['then'](respondWithResult(_0x20bdc1,0xc9))[_0x739c('0x51')](handleError(_0x20bdc1,null));};exports[_0x739c('0x28')]=function(_0xd5e2d3,_0x5634dd){if(_0xd5e2d3['body']['id']){delete _0xd5e2d3[_0x739c('0x58')]['id'];}return db['VoiceQueue'][_0x739c('0x56')]({'where':{'id':_0xd5e2d3[_0x739c('0x52')]['id']}})[_0x739c('0x37')](handleEntityNotFound(_0x5634dd,null))[_0x739c('0x37')](saveUpdates(_0xd5e2d3[_0x739c('0x58')],null))['then'](respondWithResult(_0x5634dd,null))[_0x739c('0x51')](handleError(_0x5634dd,null));};exports[_0x739c('0x36')]=function(_0x3bfc06,_0x3519cb){return db[_0x739c('0x3c')][_0x739c('0x56')]({'where':{'id':_0x3bfc06['params']['id']}})[_0x739c('0x37')](handleEntityNotFound(_0x3519cb,null))[_0x739c('0x37')](removeEntity(_0x3519cb,null))['catch'](handleError(_0x3519cb,null));};exports['getHoppers']=function(_0x18e558,_0x52b38c,_0x255602){var _0x4513a8={'raw':![],'where':{}};var _0xe48f99={};var _0xa2fd0a={'count':0x0,'rows':[]};return db[_0x739c('0x3c')][_0x739c('0x64')]({'where':{'id':_0x18e558[_0x739c('0x52')]['id']}})[_0x739c('0x37')](handleEntityNotFound(_0x52b38c,null))['then'](function(_0x346cd2){if(_0x346cd2){_0xe48f99[_0x739c('0x40')]=_[_0x739c('0x53')](db['CmHopper'][_0x739c('0x3d')]);_0xe48f99[_0x739c('0x41')]=_[_0x739c('0x53')](_0x18e558[_0x739c('0x41')]);_0xe48f99['filters']=_[_0x739c('0x54')](_0xe48f99[_0x739c('0x40')],_0xe48f99[_0x739c('0x41')]);_0x4513a8['attributes']=_[_0x739c('0x54')](_0xe48f99[_0x739c('0x40')],qs[_0x739c('0x44')](_0x18e558[_0x739c('0x41')]['fields']));_0x4513a8[_0x739c('0x43')]=_0x4513a8[_0x739c('0x43')]['length']?_0x4513a8[_0x739c('0x43')]:_0xe48f99[_0x739c('0x40')];if(!_0x18e558[_0x739c('0x41')][_0x739c('0x65')](_0x739c('0x46'))){_0x4513a8[_0x739c('0x47')]=qs[_0x739c('0x47')](_0x18e558[_0x739c('0x41')]['limit']);_0x4513a8[_0x739c('0x21')]=qs[_0x739c('0x21')](_0x18e558[_0x739c('0x41')]['offset']);}_0x4513a8[_0x739c('0x48')]=qs[_0x739c('0x49')](_0x18e558[_0x739c('0x41')][_0x739c('0x49')]);_0x4513a8[_0x739c('0x4a')]=qs['filters'](_['pick'](_0x18e558[_0x739c('0x41')],_0xe48f99[_0x739c('0x42')]));_0x4513a8[_0x739c('0x4a')][_0x739c('0x66')]=_0x346cd2['id'];if(_0x18e558['query'][_0x739c('0x2e')]){_0x4513a8[_0x739c('0x4a')]=_['merge'](_0x4513a8[_0x739c('0x4a')],{'$or':_[_0x739c('0x30')](_0x4513a8[_0x739c('0x43')],function(_0xecd770){var _0x3c959b={};_0x3c959b[_0xecd770]={'$like':'%'+_0x18e558[_0x739c('0x41')][_0x739c('0x2e')]+'%'};return _0x3c959b;})});}_0x4513a8=_[_0x739c('0x4c')]({},_0x4513a8,_0x18e558['options']);return db[_0x739c('0x67')][_0x739c('0x23')]({'where':_0x4513a8['where']})[_0x739c('0x37')](function(_0x25fde3){_0xa2fd0a[_0x739c('0x23')]=_0x25fde3;if(_0x18e558['query'][_0x739c('0x4e')]){_0x4513a8['include']=[{'all':!![]}];}return db[_0x739c('0x67')]['findAll'](_0x4513a8);})['then'](function(_0x51a3a7){_0xa2fd0a[_0x739c('0x50')]=_0x51a3a7;return _0xa2fd0a;});}})[_0x739c('0x37')](respondWithFilteredResult(_0x52b38c,_0x4513a8))['catch'](handleError(_0x52b38c,null));};exports[_0x739c('0x68')]=function(_0x30bc51,_0x2c2544,_0x38bcac){var _0xfd84c4={'raw':!![],'where':{}};var _0x273612={};var _0x2e517b={'count':0x0,'rows':[]};return db[_0x739c('0x3c')][_0x739c('0x64')]({'where':{'id':_0x30bc51[_0x739c('0x52')]['id']}})['then'](handleEntityNotFound(_0x2c2544,null))['then'](function(_0x5c0bbe){if(_0x5c0bbe){_0x273612[_0x739c('0x40')]=_[_0x739c('0x53')](db[_0x739c('0x69')][_0x739c('0x3d')]);_0x273612['query']=_[_0x739c('0x53')](_0x30bc51[_0x739c('0x41')]);_0x273612[_0x739c('0x42')]=_[_0x739c('0x54')](_0x273612['model'],_0x273612[_0x739c('0x41')]);_0xfd84c4[_0x739c('0x43')]=_['intersection'](_0x273612[_0x739c('0x40')],qs[_0x739c('0x44')](_0x30bc51[_0x739c('0x41')]['fields']));_0xfd84c4['attributes']=_0xfd84c4['attributes'][_0x739c('0x45')]?_0xfd84c4['attributes']:_0x273612[_0x739c('0x40')];if(!_0x30bc51[_0x739c('0x41')]['hasOwnProperty'](_0x739c('0x46'))){_0xfd84c4['limit']=qs[_0x739c('0x47')](_0x30bc51[_0x739c('0x41')][_0x739c('0x47')]);_0xfd84c4[_0x739c('0x21')]=qs[_0x739c('0x21')](_0x30bc51['query']['offset']);}_0xfd84c4[_0x739c('0x48')]=qs[_0x739c('0x49')](_0x30bc51['query'][_0x739c('0x49')]);_0xfd84c4['where']=qs[_0x739c('0x42')](_[_0x739c('0x4b')](_0x30bc51[_0x739c('0x41')],_0x273612[_0x739c('0x42')]));_0xfd84c4['where'][_0x739c('0x66')]=_0x5c0bbe['id'];if(_0x30bc51[_0x739c('0x41')][_0x739c('0x2e')]){_0xfd84c4['where']=_[_0x739c('0x4c')](_0xfd84c4[_0x739c('0x4a')],{'$or':_[_0x739c('0x30')](_0xfd84c4[_0x739c('0x43')],function(_0x173544){var _0x4996a1={};_0x4996a1[_0x173544]={'$like':'%'+_0x30bc51[_0x739c('0x41')][_0x739c('0x2e')]+'%'};return _0x4996a1;})});}_0xfd84c4=_['merge']({},_0xfd84c4,_0x30bc51[_0x739c('0x55')]);return db['CmHopperHistory']['count']({'where':_0xfd84c4[_0x739c('0x4a')]})[_0x739c('0x37')](function(_0x1b8346){_0x2e517b[_0x739c('0x23')]=_0x1b8346;if(_0x30bc51['query']['includeAll']){_0xfd84c4[_0x739c('0x4f')]=[{'all':!![]}];}return db[_0x739c('0x69')][_0x739c('0x6a')](_0xfd84c4);})[_0x739c('0x37')](function(_0x78fd22){_0x2e517b['rows']=_0x78fd22;return _0x2e517b;});}})[_0x739c('0x37')](respondWithFilteredResult(_0x2c2544,_0xfd84c4))[_0x739c('0x51')](handleError(_0x2c2544,null));};exports[_0x739c('0x6b')]=function(_0x397ec0,_0x4bd4a0,_0x506ad5){var _0x3158fd={'raw':!![],'where':{}};var _0xdf88be={};var _0x4e5059={'count':0x0,'rows':[]};return db[_0x739c('0x3c')][_0x739c('0x64')]({'where':{'id':_0x397ec0[_0x739c('0x52')]['id']}})[_0x739c('0x37')](handleEntityNotFound(_0x4bd4a0,null))['then'](function(_0x38aa67){if(_0x38aa67){_0xdf88be[_0x739c('0x40')]=_[_0x739c('0x53')](db['CmHopperFinal'][_0x739c('0x3d')]);_0xdf88be['query']=_[_0x739c('0x53')](_0x397ec0[_0x739c('0x41')]);_0xdf88be['filters']=_[_0x739c('0x54')](_0xdf88be[_0x739c('0x40')],_0xdf88be['query']);_0x3158fd[_0x739c('0x43')]=_['intersection'](_0xdf88be[_0x739c('0x40')],qs[_0x739c('0x44')](_0x397ec0[_0x739c('0x41')][_0x739c('0x44')]));_0x3158fd['attributes']=_0x3158fd[_0x739c('0x43')][_0x739c('0x45')]?_0x3158fd[_0x739c('0x43')]:_0xdf88be[_0x739c('0x40')];if(!_0x397ec0['query'][_0x739c('0x65')](_0x739c('0x46'))){_0x3158fd[_0x739c('0x47')]=qs[_0x739c('0x47')](_0x397ec0[_0x739c('0x41')][_0x739c('0x47')]);_0x3158fd[_0x739c('0x21')]=qs[_0x739c('0x21')](_0x397ec0[_0x739c('0x41')]['offset']);}_0x3158fd[_0x739c('0x48')]=qs[_0x739c('0x49')](_0x397ec0[_0x739c('0x41')]['sort']);_0x3158fd[_0x739c('0x4a')]=qs[_0x739c('0x42')](_[_0x739c('0x4b')](_0x397ec0['query'],_0xdf88be['filters']));_0x3158fd[_0x739c('0x4a')][_0x739c('0x66')]=_0x38aa67['id'];if(_0x397ec0[_0x739c('0x41')][_0x739c('0x2e')]){_0x3158fd['where']=_[_0x739c('0x4c')](_0x3158fd[_0x739c('0x4a')],{'$or':_[_0x739c('0x30')](_0x3158fd[_0x739c('0x43')],function(_0x537b3b){var _0x5a03be={};_0x5a03be[_0x537b3b]={'$like':'%'+_0x397ec0['query']['filter']+'%'};return _0x5a03be;})});}_0x3158fd=_[_0x739c('0x4c')]({},_0x3158fd,_0x397ec0[_0x739c('0x55')]);return db[_0x739c('0x6c')]['count']({'where':_0x3158fd['where']})[_0x739c('0x37')](function(_0x39a1a0){_0x4e5059[_0x739c('0x23')]=_0x39a1a0;if(_0x397ec0[_0x739c('0x41')][_0x739c('0x4e')]){_0x3158fd[_0x739c('0x4f')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x739c('0x6a')](_0x3158fd);})[_0x739c('0x37')](function(_0x16d8c5){_0x4e5059[_0x739c('0x50')]=_0x16d8c5;return _0x4e5059;});}})[_0x739c('0x37')](respondWithFilteredResult(_0x4bd4a0,_0x3158fd))[_0x739c('0x51')](handleError(_0x4bd4a0,null));};exports['getHopperBlacks']=function(_0x3d7aa4,_0x58ff71,_0x3a0e54){var _0x54f39a={'raw':!![],'where':{}};var _0x244afa={};var _0x28e4c9={'count':0x0,'rows':[]};return db[_0x739c('0x3c')]['findOne']({'where':{'id':_0x3d7aa4[_0x739c('0x52')]['id']}})[_0x739c('0x37')](handleEntityNotFound(_0x58ff71,null))[_0x739c('0x37')](function(_0x2f9ce9){if(_0x2f9ce9){_0x244afa[_0x739c('0x40')]=_[_0x739c('0x53')](db[_0x739c('0x6d')][_0x739c('0x3d')]);_0x244afa[_0x739c('0x41')]=_[_0x739c('0x53')](_0x3d7aa4[_0x739c('0x41')]);_0x244afa[_0x739c('0x42')]=_[_0x739c('0x54')](_0x244afa['model'],_0x244afa['query']);_0x54f39a[_0x739c('0x43')]=_[_0x739c('0x54')](_0x244afa['model'],qs[_0x739c('0x44')](_0x3d7aa4[_0x739c('0x41')][_0x739c('0x44')]));_0x54f39a['attributes']=_0x54f39a[_0x739c('0x43')]['length']?_0x54f39a[_0x739c('0x43')]:_0x244afa[_0x739c('0x40')];if(!_0x3d7aa4[_0x739c('0x41')][_0x739c('0x65')](_0x739c('0x46'))){_0x54f39a[_0x739c('0x47')]=qs[_0x739c('0x47')](_0x3d7aa4['query'][_0x739c('0x47')]);_0x54f39a[_0x739c('0x21')]=qs['offset'](_0x3d7aa4[_0x739c('0x41')][_0x739c('0x21')]);}_0x54f39a[_0x739c('0x48')]=qs['sort'](_0x3d7aa4[_0x739c('0x41')]['sort']);_0x54f39a['where']=qs['filters'](_[_0x739c('0x4b')](_0x3d7aa4['query'],_0x244afa[_0x739c('0x42')]));_0x54f39a[_0x739c('0x4a')][_0x739c('0x66')]=_0x2f9ce9['id'];if(_0x3d7aa4[_0x739c('0x41')][_0x739c('0x2e')]){_0x54f39a[_0x739c('0x4a')]=_[_0x739c('0x4c')](_0x54f39a[_0x739c('0x4a')],{'$or':_[_0x739c('0x30')](_0x54f39a[_0x739c('0x43')],function(_0x5c2b9b){var _0x568e9a={};_0x568e9a[_0x5c2b9b]={'$like':'%'+_0x3d7aa4[_0x739c('0x41')][_0x739c('0x2e')]+'%'};return _0x568e9a;})});}_0x54f39a=_[_0x739c('0x4c')]({},_0x54f39a,_0x3d7aa4['options']);return db[_0x739c('0x6d')][_0x739c('0x23')]({'where':_0x54f39a[_0x739c('0x4a')]})['then'](function(_0x3560cf){_0x28e4c9[_0x739c('0x23')]=_0x3560cf;if(_0x3d7aa4[_0x739c('0x41')]['includeAll']){_0x54f39a[_0x739c('0x4f')]=[{'all':!![]}];}return db[_0x739c('0x6d')]['findAll'](_0x54f39a);})[_0x739c('0x37')](function(_0x451377){_0x28e4c9[_0x739c('0x50')]=_0x451377;return _0x28e4c9;});}})[_0x739c('0x37')](respondWithFilteredResult(_0x58ff71,_0x54f39a))[_0x739c('0x51')](handleError(_0x58ff71,null));};exports['getTeams']=function(_0x5a427,_0x1e2a37,_0x575f32){var _0x54a757={};var _0x355e3c={};var _0x550fe0;var _0xb94413;return db[_0x739c('0x3c')][_0x739c('0x64')]({'where':{'id':_0x5a427[_0x739c('0x52')]['id']}})[_0x739c('0x37')](handleEntityNotFound(_0x1e2a37,null))[_0x739c('0x37')](function(_0x4be1d3){if(_0x4be1d3){_0x550fe0=_0x4be1d3;_0x355e3c[_0x739c('0x40')]=_['keys'](db[_0x739c('0x6e')][_0x739c('0x3d')]);_0x355e3c[_0x739c('0x41')]=_[_0x739c('0x53')](_0x5a427['query']);_0x355e3c[_0x739c('0x42')]=_[_0x739c('0x54')](_0x355e3c[_0x739c('0x40')],_0x355e3c[_0x739c('0x41')]);_0x54a757['attributes']=_[_0x739c('0x54')](_0x355e3c[_0x739c('0x40')],qs[_0x739c('0x44')](_0x5a427[_0x739c('0x41')]['fields']));_0x54a757[_0x739c('0x43')]=_0x54a757[_0x739c('0x43')][_0x739c('0x45')]?_0x54a757[_0x739c('0x43')]:_0x355e3c[_0x739c('0x40')];_0x54a757[_0x739c('0x48')]=qs[_0x739c('0x49')](_0x5a427['query']['sort']);_0x54a757['where']=qs[_0x739c('0x42')](_['pick'](_0x5a427[_0x739c('0x41')],_0x355e3c[_0x739c('0x42')]));if(_0x5a427['query'][_0x739c('0x2e')]){_0x54a757[_0x739c('0x4a')]=_['merge'](_0x54a757['where'],{'$or':_['map'](_0x54a757['attributes'],function(_0x49085b){var _0x61921b={};_0x61921b[_0x49085b]={'$like':'%'+_0x5a427['query']['filter']+'%'};return _0x61921b;})});}_0x54a757=_[_0x739c('0x4c')]({},_0x54a757,_0x5a427['options']);return _0x550fe0[_0x739c('0x6f')](_0x54a757);}})[_0x739c('0x37')](function(_0x2b1b80){if(_0x2b1b80){_0xb94413=_0x2b1b80[_0x739c('0x45')];if(!_0x5a427['query'][_0x739c('0x65')]('nolimit')){_0x54a757[_0x739c('0x47')]=qs[_0x739c('0x47')](_0x5a427[_0x739c('0x41')][_0x739c('0x47')]);_0x54a757[_0x739c('0x21')]=qs[_0x739c('0x21')](_0x5a427['query'][_0x739c('0x21')]);}return _0x550fe0[_0x739c('0x6f')](_0x54a757);}})['then'](function(_0x3cc273){if(_0x3cc273){return _0x3cc273?{'count':_0xb94413,'rows':_0x3cc273}:null;}})[_0x739c('0x37')](respondWithResult(_0x1e2a37,null))[_0x739c('0x51')](handleError(_0x1e2a37,null));};exports[_0x739c('0x70')]=function(_0x26d8e0,_0x4749ff,_0xca838c){var _0x4c783e=_0x26d8e0['body']['teams'];var _0x44058e=_[_0x739c('0x30')](_0x4c783e,'id');return db[_0x739c('0x6e')][_0x739c('0x6a')]({'where':{'id':_0x44058e},'attributes':['id'],'include':[{'model':db[_0x739c('0x71')],'as':_0x739c('0x72'),'attributes':['id',_0x739c('0x34'),_0x739c('0x73'),_0x739c('0x74'),_0x739c('0x75')],'raw':!![]}]})[_0x739c('0x37')](function(_0x13a740){if(_0x13a740){var _0x2e6979=_[_0x739c('0x76')](_0x13a740,function(_0x5010fb){var _0x39008a=_0x5010fb[_0x739c('0x29')]({'plain':!![]});_0x39008a[_0x739c('0x72')]['forEach'](function(_0x24ae62){_0x24ae62[_0x739c('0x77')]=_['find'](_0x4c783e,{'id':_0x39008a['id']})[_0x739c('0x77')];});return _0x39008a[_0x739c('0x72')];});return db[_0x739c('0x3c')][_0x739c('0x56')]({'where':{'id':_0x26d8e0[_0x739c('0x52')]['id']}})[_0x739c('0x37')](function(_0x468519){return db[_0x739c('0x78')][_0x739c('0x79')](function(_0x3e345b){return _0x468519[_0x739c('0x70')](_0x44058e,{'transaction':_0x3e345b})[_0x739c('0x37')](function(){return BPromise['each'](_0x4c783e,function(_0xa15b5d){return db['TeamVoiceQueue'][_0x739c('0x7a')]({'TeamId':_0xa15b5d['id'],'VoiceQueueId':_0x26d8e0['params']['id'],'penalty':_0xa15b5d[_0x739c('0x77')]},{'transaction':_0x3e345b});});})[_0x739c('0x37')](function(){return BPromise[_0x739c('0x7b')](_0x2e6979,function(_0x25011d){return db['UserVoiceQueue'][_0x739c('0x7c')]({'where':{'UserId':_0x25011d['id'],'VoiceQueueId':_0x26d8e0[_0x739c('0x52')]['id']},'defaults':{'penalty':_0x25011d[_0x739c('0x77')]},'transaction':_0x3e345b});});})[_0x739c('0x37')](function(){return BPromise[_0x739c('0x7b')](_[_0x739c('0x2e')](_0x2e6979,{'online':!![]}),function(_0x283e59){return db['UserVoiceQueueRt'][_0x739c('0x7a')]({'membername':_0x283e59[_0x739c('0x34')],'UserId':_0x283e59['id'],'queue_name':_0x468519['name'],'VoiceQueueId':_0x468519['id'],'interface':_[_0x739c('0x7d')](_0x283e59[_0x739c('0x75')])?util[_0x739c('0x7e')]('SIP/%s',_0x283e59['name']):_0x283e59['interface'],'paused':_0x283e59[_0x739c('0x74')]||![],'penalty':_0x283e59[_0x739c('0x77')]},{'transaction':_0x3e345b});});})[_0x739c('0x37')](function(){_0x2e6979['forEach'](function(_0x305c57){socket[_0x739c('0x7f')](_0x739c('0x80'),{'UserId':_0x305c57['id'],'VoiceQueueId':_0x468519['id']});});});});});}})[_0x739c('0x37')](respondWithStatusCode(_0x4749ff,null))['catch'](handleError(_0x4749ff,null));};exports[_0x739c('0x81')]=function(_0x2ab7da,_0x483f48,_0x7d0d88){return db[_0x739c('0x6e')][_0x739c('0x6a')]({'where':{'id':_0x2ab7da[_0x739c('0x41')][_0x739c('0x82')]},'attributes':['id'],'include':[{'model':db[_0x739c('0x71')],'as':_0x739c('0x72'),'attributes':['id'],'raw':!![]}]})[_0x739c('0x37')](handleEntityNotFound(_0x483f48,null))[_0x739c('0x37')](function(_0x835617){var _0x8fe2b8=_['map'](_0x835617,'id');var _0xb4f3ed=[];var _0xfe3534=[];var _0xd43829=squel['select']();_0xd43829[_0x739c('0x83')]('tq.TeamId')['from']('team_has_voice_queues','tq')[_0x739c('0x84')](_0x739c('0x85'),'ut',_0x739c('0x86'))[_0x739c('0x4a')](_0x739c('0x87'),_0x2ab7da[_0x739c('0x52')]['id']);for(var _0x41f3e0=0x0;_0x41f3e0<_0x835617[_0x739c('0x45')];_0x41f3e0+=0x1){let _0x36386d=_0x835617[_0x41f3e0];for(var _0x1a2eb1=0x0;_0x1a2eb1<_0x36386d[_0x739c('0x72')][_0x739c('0x45')];_0x1a2eb1+=0x1){let _0x22853d=_0x36386d[_0x739c('0x72')][_0x1a2eb1];var _0xedf208=_0xd43829[_0x739c('0x60')]();_0xedf208[_0x739c('0x4a')](_0x739c('0x88'),_0x22853d['id']);_0xfe3534[_0x739c('0x89')](db['sequelize'][_0x739c('0x41')](_0xedf208[_0x739c('0x8a')](),{'type':db[_0x739c('0x78')]['QueryTypes'][_0x739c('0x8b')]})[_0x739c('0x37')](function(_0x380518){if(_0x380518[_0x739c('0x45')]===0x1){return _0x22853d['id'];}else{var _0x518132=_[_0x739c('0x8c')](_[_0x739c('0x30')](_0x380518,_0x739c('0x8d')),function(_0x3bfb4f){return _['includes'](_0x8fe2b8,_0x3bfb4f);});if(_0x518132){return _0x22853d['id'];}}}));}}return BPromise['all'](_0xfe3534)[_0x739c('0x37')](function(_0x40f1cc){_0xb4f3ed=_(_0xb4f3ed)['union'](_0x40f1cc)[_0x739c('0x8e')]()[_0x739c('0x31')]();return db['VoiceQueue'][_0x739c('0x56')]({'where':{'id':_0x2ab7da[_0x739c('0x52')]['id']}})[_0x739c('0x37')](function(_0x1fa875){return db[_0x739c('0x78')][_0x739c('0x79')](function(_0x3eaef0){return _0x1fa875[_0x739c('0x81')](_0x2ab7da['query']['ids'],{'transaction':_0x3eaef0})['then'](function(){if(!_['isEmpty'](_0xb4f3ed)){return _0x1fa875[_0x739c('0x8f')](_0xb4f3ed,{'transaction':_0x3eaef0})[_0x739c('0x37')](function(){return db[_0x739c('0x90')][_0x739c('0x36')]({'where':{'VoiceQueueId':_0x2ab7da[_0x739c('0x52')]['id'],'UserId':_0xb4f3ed},'transaction':_0x3eaef0});});}})[_0x739c('0x37')](function(){_0xb4f3ed[_0x739c('0x91')](function(_0x2f2bea){socket[_0x739c('0x7f')](_0x739c('0x92'),{'UserId':_0x2f2bea,'VoiceQueueId':_0x1fa875['id']});});});});});});})[_0x739c('0x37')](respondWithStatusCode(_0x483f48,null))['catch'](handleError(_0x483f48,null));};exports[_0x739c('0x93')]=function(_0x3fdf9a,_0x2c57c8,_0x52d355){var _0x15e176,_0x16819c;return db[_0x739c('0x3c')][_0x739c('0x56')]({'where':{'id':_0x3fdf9a[_0x739c('0x52')]['id']}})[_0x739c('0x37')](handleEntityNotFound(_0x2c57c8,null))[_0x739c('0x37')](function(_0x4f3fb9){if(_0x4f3fb9){_0x16819c=_0x4f3fb9;return _0x4f3fb9[_0x739c('0x93')](_0x3fdf9a[_0x739c('0x58')][_0x739c('0x82')],_[_0x739c('0x61')](_0x3fdf9a[_0x739c('0x58')],[_0x739c('0x82'),'id'])||{})[_0x739c('0x94')](function(_0x39e417){for(var _0x30ddb6=0x0;_0x30ddb6<_0x3fdf9a[_0x739c('0x58')][_0x739c('0x82')]['length'];_0x30ddb6+=0x1){socket[_0x739c('0x7f')]('userVoiceQueue:save',{'UserId':Number(_0x3fdf9a['body'][_0x739c('0x82')][_0x30ddb6]),'VoiceQueueId':Number(_0x3fdf9a[_0x739c('0x52')]['id'])});}return _0x39e417;});}})[_0x739c('0x37')](function(_0x6e1052){_0x15e176=_0x6e1052||[];if(_0x16819c){return db[_0x739c('0x71')]['findAll']({'where':{'id':_0x3fdf9a[_0x739c('0x58')][_0x739c('0x82')]},'attributes':['id',_0x739c('0x34'),_0x739c('0x73'),_0x739c('0x74'),_0x739c('0x75')],'raw':!![]});}})[_0x739c('0x37')](function(_0x1edd4a){if(!_[_0x739c('0x95')](_0x1edd4a)){var _0x3ac19b=[];for(var _0x505391=0x0;_0x505391<_0x1edd4a[_0x739c('0x45')];_0x505391++){if(_0x1edd4a[_0x505391][_0x739c('0x73')]){_0x3ac19b[_0x739c('0x89')](db[_0x739c('0x90')][_0x739c('0x7a')]({'membername':_0x1edd4a[_0x505391][_0x739c('0x34')],'UserId':_0x1edd4a[_0x505391]['id'],'queue_name':_0x16819c[_0x739c('0x34')],'VoiceQueueId':_0x16819c['id'],'interface':_[_0x739c('0x7d')](_0x1edd4a[_0x505391][_0x739c('0x75')])?util[_0x739c('0x7e')]('SIP/%s',_0x1edd4a[_0x505391]['name']):_0x1edd4a[_0x505391][_0x739c('0x75')],'paused':_0x1edd4a[_0x505391][_0x739c('0x74')]||![],'penalty':_0x3fdf9a['body'][_0x739c('0x77')]||0x0}));}}return BPromise[_0x739c('0x96')](_0x3ac19b);}})[_0x739c('0x37')](function(){return _0x15e176;})['then'](respondWithResult(_0x2c57c8,null))[_0x739c('0x51')](handleError(_0x2c57c8,null));};exports['removeAgents']=function(_0xeaaed3,_0x28500b,_0x4a114c){return db[_0x739c('0x3c')][_0x739c('0x56')]({'where':{'id':_0xeaaed3[_0x739c('0x52')]['id']}})[_0x739c('0x37')](handleEntityNotFound(_0x28500b,null))['then'](function(_0x4a0d06){if(_0x4a0d06){return _0x4a0d06[_0x739c('0x8f')](_0xeaaed3[_0x739c('0x41')]['ids'])[_0x739c('0x37')](function(){if(_['isArray'](_0xeaaed3['query']['ids'])){for(var _0x1787a3=0x0;_0x1787a3<_0xeaaed3[_0x739c('0x41')][_0x739c('0x82')][_0x739c('0x45')];_0x1787a3+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0xeaaed3[_0x739c('0x41')][_0x739c('0x82')][_0x1787a3]),'VoiceQueueId':Number(_0xeaaed3[_0x739c('0x52')]['id'])});}}else{socket[_0x739c('0x7f')](_0x739c('0x92'),{'UserId':Number(_0xeaaed3[_0x739c('0x41')][_0x739c('0x82')]),'VoiceQueueId':Number(_0xeaaed3[_0x739c('0x52')]['id'])});}});}})[_0x739c('0x37')](function(_0x57e462){return db[_0x739c('0x90')][_0x739c('0x36')]({'where':{'VoiceQueueId':_0xeaaed3['params']['id'],'UserId':_0xeaaed3[_0x739c('0x41')][_0x739c('0x82')]}})['then'](function(){return _0x57e462;});})[_0x739c('0x37')](respondWithStatusCode(_0x28500b,null))[_0x739c('0x51')](handleError(_0x28500b,null));};exports[_0x739c('0x97')]=function(_0x317456,_0x3dd822,_0x5d9155){var _0x3a0fd1={};var _0x5a6d9b={};var _0x314841;var _0x51ebae;return db[_0x739c('0x3c')][_0x739c('0x64')]({'where':{'id':_0x317456[_0x739c('0x52')]['id']}})[_0x739c('0x37')](handleEntityNotFound(_0x3dd822,null))['then'](function(_0x1b540b){if(_0x1b540b){_0x314841=_0x1b540b;_0x5a6d9b[_0x739c('0x40')]=_[_0x739c('0x53')](db[_0x739c('0x71')]['rawAttributes']);_0x5a6d9b[_0x739c('0x41')]=_[_0x739c('0x53')](_0x317456[_0x739c('0x41')]);_0x5a6d9b['filters']=_['intersection'](_0x5a6d9b['model'],_0x5a6d9b[_0x739c('0x41')]);_0x3a0fd1['attributes']=_['intersection'](_0x5a6d9b[_0x739c('0x40')],qs[_0x739c('0x44')](_0x317456[_0x739c('0x41')]['fields']));_0x3a0fd1[_0x739c('0x43')]=_0x3a0fd1[_0x739c('0x43')][_0x739c('0x45')]?_0x3a0fd1[_0x739c('0x43')]:_0x5a6d9b['model'];_0x3a0fd1[_0x739c('0x48')]=qs['sort'](_0x317456['query'][_0x739c('0x49')]);_0x3a0fd1[_0x739c('0x4a')]=qs[_0x739c('0x42')](_['pick'](_0x317456[_0x739c('0x41')],_0x5a6d9b['filters']));if(_0x317456[_0x739c('0x41')][_0x739c('0x2e')]){_0x3a0fd1[_0x739c('0x4a')]=_[_0x739c('0x4c')](_0x3a0fd1['where'],{'$or':_[_0x739c('0x30')](_0x3a0fd1[_0x739c('0x43')],function(_0x1e71ef){var _0x2d33cc={};_0x2d33cc[_0x1e71ef]={'$like':'%'+_0x317456[_0x739c('0x41')]['filter']+'%'};return _0x2d33cc;})});}_0x3a0fd1=_[_0x739c('0x4c')]({},_0x3a0fd1,_0x317456[_0x739c('0x55')]);return _0x314841[_0x739c('0x97')](_0x3a0fd1);}})[_0x739c('0x37')](function(_0x332d61){if(_0x332d61){_0x51ebae=_0x332d61[_0x739c('0x45')];if(!_0x317456['query'][_0x739c('0x65')](_0x739c('0x46'))){_0x3a0fd1[_0x739c('0x47')]=qs[_0x739c('0x47')](_0x317456[_0x739c('0x41')]['limit']);_0x3a0fd1[_0x739c('0x21')]=qs[_0x739c('0x21')](_0x317456[_0x739c('0x41')][_0x739c('0x21')]);}return _0x314841[_0x739c('0x97')](_0x3a0fd1);}})[_0x739c('0x37')](function(_0x43aeb8){if(_0x43aeb8){return _0x43aeb8?{'count':_0x51ebae,'rows':_0x43aeb8}:null;}})['then'](respondWithResult(_0x3dd822,null))[_0x739c('0x51')](handleError(_0x3dd822,null));};exports['getMembers']=function(_0x222400,_0x171ee4,_0x246b00){var _0x740259={};var _0x9cbfda={};var _0x4347c6;var _0x498380;return db[_0x739c('0x3c')][_0x739c('0x64')]({'where':{'id':_0x222400[_0x739c('0x52')]['id']}})[_0x739c('0x37')](handleEntityNotFound(_0x171ee4,null))[_0x739c('0x37')](function(_0x4429be){if(_0x4429be){_0x4347c6=_0x4429be;_0x9cbfda['model']=_[_0x739c('0x53')](db[_0x739c('0x90')][_0x739c('0x3d')]);_0x9cbfda[_0x739c('0x41')]=_[_0x739c('0x53')](_0x222400['query']);_0x9cbfda[_0x739c('0x42')]=_[_0x739c('0x54')](_0x9cbfda[_0x739c('0x40')],_0x9cbfda[_0x739c('0x41')]);_0x740259[_0x739c('0x43')]=_[_0x739c('0x54')](_0x9cbfda[_0x739c('0x40')],qs['fields'](_0x222400[_0x739c('0x41')][_0x739c('0x44')]));_0x740259[_0x739c('0x43')]=_0x740259[_0x739c('0x43')][_0x739c('0x45')]?_0x740259[_0x739c('0x43')]:_0x9cbfda[_0x739c('0x40')];_0x740259[_0x739c('0x48')]=qs[_0x739c('0x49')](_0x222400[_0x739c('0x41')][_0x739c('0x49')]);_0x740259[_0x739c('0x4a')]=qs[_0x739c('0x42')](_['pick'](_0x222400['query'],_0x9cbfda[_0x739c('0x42')]));if(_0x222400['query']['filter']){_0x740259[_0x739c('0x4a')]=_['merge'](_0x740259[_0x739c('0x4a')],{'$or':_[_0x739c('0x30')](_0x740259[_0x739c('0x43')],function(_0x1dba8b){var _0x525088={};_0x525088[_0x1dba8b]={'$like':'%'+_0x222400['query'][_0x739c('0x2e')]+'%'};return _0x525088;})});}_0x740259=_[_0x739c('0x4c')]({},_0x740259,_0x222400[_0x739c('0x55')]);return _0x4347c6[_0x739c('0x98')](_0x740259);}})[_0x739c('0x37')](function(_0x4134e5){if(_0x4134e5){_0x498380=_0x4134e5[_0x739c('0x45')];if(!_0x222400[_0x739c('0x41')][_0x739c('0x65')](_0x739c('0x46'))){_0x740259[_0x739c('0x47')]=qs[_0x739c('0x47')](_0x222400[_0x739c('0x41')][_0x739c('0x47')]);_0x740259[_0x739c('0x21')]=qs[_0x739c('0x21')](_0x222400[_0x739c('0x41')][_0x739c('0x21')]);}return _0x4347c6[_0x739c('0x98')](_0x740259);}})[_0x739c('0x37')](function(_0x531a0){return _0x531a0?{'count':_0x498380,'rows':_0x531a0}:null;})[_0x739c('0x37')](respondWithResult(_0x171ee4,null))['catch'](handleError(_0x171ee4,null));};exports[_0x739c('0x99')]=function(_0x527322,_0x351232,_0x22dcb2){var _0x1ceea4={};var _0x27e943={};var _0x2249a1;var _0x234899;return db[_0x739c('0x3c')][_0x739c('0x64')]({'where':{'id':_0x527322['params']['id']}})[_0x739c('0x37')](handleEntityNotFound(_0x351232,null))[_0x739c('0x37')](function(_0x211226){if(_0x211226){_0x2249a1=_0x211226;_0x27e943[_0x739c('0x40')]=_[_0x739c('0x53')](db[_0x739c('0x9a')][_0x739c('0x3d')]);_0x27e943[_0x739c('0x41')]=_[_0x739c('0x53')](_0x527322[_0x739c('0x41')]);_0x27e943[_0x739c('0x42')]=_[_0x739c('0x54')](_0x27e943[_0x739c('0x40')],_0x27e943['query']);_0x1ceea4[_0x739c('0x43')]=_[_0x739c('0x54')](_0x27e943[_0x739c('0x40')],qs['fields'](_0x527322[_0x739c('0x41')][_0x739c('0x44')]));_0x1ceea4[_0x739c('0x43')]=_0x1ceea4[_0x739c('0x43')][_0x739c('0x45')]?_0x1ceea4[_0x739c('0x43')]:_0x27e943['model'];_0x1ceea4['order']=qs['sort'](_0x527322[_0x739c('0x41')][_0x739c('0x49')]);_0x1ceea4['where']=qs[_0x739c('0x42')](_[_0x739c('0x4b')](_0x527322[_0x739c('0x41')],_0x27e943[_0x739c('0x42')]));if(_0x527322[_0x739c('0x41')][_0x739c('0x2e')]){_0x1ceea4[_0x739c('0x4a')]=_['merge'](_0x1ceea4[_0x739c('0x4a')],{'$or':_['map'](_0x1ceea4[_0x739c('0x43')],function(_0x12dc80){var _0x12bd61={};_0x12bd61[_0x12dc80]={'$like':'%'+_0x527322[_0x739c('0x41')][_0x739c('0x2e')]+'%'};return _0x12bd61;})});}_0x1ceea4=_[_0x739c('0x4c')]({},_0x1ceea4,_0x527322['options']);return _0x2249a1[_0x739c('0x99')](_0x1ceea4);}})[_0x739c('0x37')](function(_0x38adde){if(_0x38adde){_0x234899=_0x38adde[_0x739c('0x45')];if(!_0x527322[_0x739c('0x41')][_0x739c('0x65')](_0x739c('0x46'))){_0x1ceea4[_0x739c('0x47')]=qs[_0x739c('0x47')](_0x527322['query']['limit']);_0x1ceea4[_0x739c('0x21')]=qs[_0x739c('0x21')](_0x527322[_0x739c('0x41')][_0x739c('0x21')]);}return _0x2249a1[_0x739c('0x99')](_0x1ceea4);}})[_0x739c('0x37')](function(_0x18d03f){if(_0x18d03f){return _0x18d03f?{'count':_0x234899,'rows':_0x18d03f}:null;}})[_0x739c('0x37')](respondWithResult(_0x351232,null))['catch'](handleError(_0x351232,null));};exports['addLists']=function(_0x2eeb64,_0x30e30c,_0x1ae9a8){var _0x5959c3=moment()[_0x739c('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');var _0x299fd0,_0x2845c7;return db[_0x739c('0x3c')]['find']({'where':{'id':_0x2eeb64[_0x739c('0x52')]['id']}})[_0x739c('0x37')](handleEntityNotFound(_0x30e30c,null))[_0x739c('0x37')](function(_0x4a6af1){if(_0x4a6af1){_0x2845c7=_0x4a6af1;return _0x4a6af1['addLists'](_0x2eeb64[_0x739c('0x58')][_0x739c('0x82')],_[_0x739c('0x61')](_0x2eeb64[_0x739c('0x58')],['ids','id'])||{});}return null;})[_0x739c('0x94')](function(_0x503a47){var _0xccc27a;_0x299fd0=_0x503a47||[];var _0x5b5006=[];if(_0x503a47){for(var _0x541e73=0x0;_0x541e73<_0x503a47[_0x739c('0x45')];_0x541e73+=0x1){var _0x1dd699=_0x503a47[_0x541e73][_0x739c('0x29')]({'plain':!![]});_0x2845c7[_0x739c('0x9b')]=_0x2eeb64['body']['dialCheckDuplicateType']?_0x2eeb64[_0x739c('0x58')][_0x739c('0x9b')]:_0x2845c7[_0x739c('0x9b')];switch(_0x2845c7[_0x739c('0x9b')]){case _0x739c('0x9c'):_0xccc27a=squel[_0x739c('0x9d')]()[_0x739c('0x9e')](_0x739c('0x9f'))[_0x739c('0xa0')]([_0x739c('0xa1'),'scheduledAt',_0x739c('0xa2'),'ListId',_0x739c('0x66'),_0x739c('0x62'),'updatedAt'],squel['select']()[_0x739c('0x83')]('phone',_0x739c('0xa1'))[_0x739c('0x83')]('\x27'+_0x5959c3+'\x27',_0x739c('0xa3'))['field']('id',_0x739c('0xa2'))[_0x739c('0x83')](_0x1dd699['CmListId'][_0x739c('0x8a')](),_0x739c('0xa4'))['field'](_0x2eeb64[_0x739c('0x52')]['id'][_0x739c('0x8a')](),'VoiceQueueId')[_0x739c('0x83')]('\x27'+_0x5959c3+'\x27',_0x739c('0x62'))[_0x739c('0x83')]('\x27'+_0x5959c3+'\x27',_0x739c('0x63'))[_0x739c('0xa5')]('cm_contacts')[_0x739c('0x4a')](_0x739c('0xa6'))[_0x739c('0x4a')]('ListId\x20=\x20?',_0x1dd699['CmListId'][_0x739c('0x8a')]())[_0x739c('0x4a')](_0x739c('0xa7'))[_0x739c('0x4a')](_0x739c('0xa8'),squel[_0x739c('0xa9')]()[_0x739c('0x83')](_0x739c('0xaa'))[_0x739c('0xa5')]('cm_hopper_final')[_0x739c('0x4a')]('VoiceQueueId\x20=\x20?',_0x2eeb64[_0x739c('0x52')]['id'][_0x739c('0x8a')]()))[_0x739c('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0x739c('0xa5')](_0x739c('0x9f'))[_0x739c('0x4a')]('VoiceQueueId\x20=\x20?',_0x2eeb64[_0x739c('0x52')]['id'][_0x739c('0x8a')]())))[_0x739c('0x8a')]();break;case'onlyIfOpen':_0xccc27a=squel[_0x739c('0x9d')]()[_0x739c('0x9e')](_0x739c('0x9f'))['fromQuery']([_0x739c('0xa1'),_0x739c('0xa3'),_0x739c('0xa2'),'ListId',_0x739c('0x66'),_0x739c('0x62'),_0x739c('0x63')],squel[_0x739c('0xa9')]()['field'](_0x739c('0xa1'),_0x739c('0xa1'))[_0x739c('0x83')]('\x27'+_0x5959c3+'\x27',_0x739c('0xa3'))[_0x739c('0x83')]('id',_0x739c('0xa2'))[_0x739c('0x83')](_0x1dd699['CmListId'][_0x739c('0x8a')](),_0x739c('0xa4'))[_0x739c('0x83')](_0x2eeb64['params']['id']['toString'](),'VoiceQueueId')[_0x739c('0x83')]('\x27'+_0x5959c3+'\x27','createdAt')[_0x739c('0x83')]('\x27'+_0x5959c3+'\x27',_0x739c('0x63'))[_0x739c('0xa5')](_0x739c('0xab'))[_0x739c('0x4a')](_0x739c('0xa6'))['where']('ListId\x20=\x20?',_0x1dd699[_0x739c('0xac')][_0x739c('0x8a')]())[_0x739c('0x4a')](_0x739c('0xa7'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x739c('0xa9')]()[_0x739c('0x83')](_0x739c('0xad'))[_0x739c('0xa5')](_0x739c('0x9f'))[_0x739c('0x4a')](_0x739c('0x87'),_0x2eeb64[_0x739c('0x52')]['id'][_0x739c('0x8a')]())))[_0x739c('0x8a')]();break;default:_0xccc27a=squel[_0x739c('0x9d')]()[_0x739c('0x9e')](_0x739c('0x9f'))[_0x739c('0xa0')]([_0x739c('0xa1'),_0x739c('0xa3'),_0x739c('0xa2'),_0x739c('0xa4'),_0x739c('0x66'),_0x739c('0x62'),'updatedAt'],squel[_0x739c('0xa9')]()['field'](_0x739c('0xa1'),_0x739c('0xa1'))['field']('\x27'+_0x5959c3+'\x27',_0x739c('0xa3'))[_0x739c('0x83')]('id',_0x739c('0xa2'))[_0x739c('0x83')](_0x1dd699['CmListId'][_0x739c('0x8a')](),'ListId')['field'](_0x2eeb64[_0x739c('0x52')]['id'][_0x739c('0x8a')](),_0x739c('0x66'))['field']('\x27'+_0x5959c3+'\x27',_0x739c('0x62'))[_0x739c('0x83')]('\x27'+_0x5959c3+'\x27',_0x739c('0x63'))[_0x739c('0xa5')](_0x739c('0xab'))['where'](_0x739c('0xa6'))[_0x739c('0x4a')]('ListId\x20=\x20?',_0x1dd699['CmListId']['toString']())[_0x739c('0x4a')](_0x739c('0xa7')))['toString']();}_0x5b5006[_0x739c('0x89')](db[_0x739c('0x78')][_0x739c('0x41')](_0xccc27a));}return BPromise[_0x739c('0x96')](_0x5b5006);}})[_0x739c('0x37')](function(){var _0x4d4277=[];var _0x5bf1e5=squel[_0x739c('0x9d')]()['into'](_0x739c('0xae'))[_0x739c('0xa0')]([_0x739c('0xaf'),'phone',_0x739c('0xb0'),_0x739c('0x62'),_0x739c('0x63')],squel[_0x739c('0xa9')]()[_0x739c('0x83')](_0x739c('0xb1'))[_0x739c('0x83')](_0x739c('0xb2'))[_0x739c('0x83')](_0x739c('0xb3'))[_0x739c('0x83')]('\x27'+_0x5959c3+'\x27','createdAt')['field']('\x27'+_0x5959c3+'\x27',_0x739c('0x63'))['from'](_0x739c('0xb4'),'ci')[_0x739c('0x84')](_0x739c('0x9f'),'h',_0x739c('0xb5'))[_0x739c('0x4a')](_0x739c('0xb6'),_0x5959c3)['where'](_0x739c('0xb7'),'PHONE'))[_0x739c('0x8a')]();_0x4d4277[_0x739c('0x89')](db[_0x739c('0x78')][_0x739c('0x41')](_0x5bf1e5));return BPromise[_0x739c('0x96')](_0x4d4277);})[_0x739c('0x37')](function(){return _0x299fd0;})[_0x739c('0x37')](respondWithResult(_0x30e30c,null))[_0x739c('0x51')](handleError(_0x30e30c,null));};exports[_0x739c('0xb8')]=function(_0x4a5438,_0x13fdeb,_0x297248){return db[_0x739c('0x3c')][_0x739c('0x56')]({'where':{'id':_0x4a5438[_0x739c('0x52')]['id']}})[_0x739c('0x37')](handleEntityNotFound(_0x13fdeb,null))['then'](function(_0x5844b6){if(_0x5844b6){return _0x5844b6['removeLists'](_0x4a5438[_0x739c('0x41')][_0x739c('0x82')]);}})[_0x739c('0x37')](function(_0x5d8084){if(_0x5d8084){return db[_0x739c('0x67')][_0x739c('0x36')]({'where':{'ListId':_0x4a5438[_0x739c('0x41')]['ids'],'VoiceQueueId':_0x4a5438[_0x739c('0x52')]['id']}})[_0x739c('0x37')](function(){return _0x5d8084;});}})[_0x739c('0x37')](respondWithStatusCode(_0x13fdeb,null))[_0x739c('0x51')](handleError(_0x13fdeb,null));};exports[_0x739c('0xb9')]=function(_0x1ffb54,_0x261c37,_0x33baa7){var _0xe46fcc={};var _0xbe09d={};var _0x43197b;var _0xed2946;return db['VoiceQueue'][_0x739c('0x64')]({'where':{'id':_0x1ffb54[_0x739c('0x52')]['id']}})[_0x739c('0x37')](handleEntityNotFound(_0x261c37,null))[_0x739c('0x37')](function(_0x85c795){if(_0x85c795){_0x43197b=_0x85c795;_0xbe09d['model']=_[_0x739c('0x53')](db['CmList'][_0x739c('0x3d')]);_0xbe09d[_0x739c('0x41')]=_[_0x739c('0x53')](_0x1ffb54[_0x739c('0x41')]);_0xbe09d['filters']=_[_0x739c('0x54')](_0xbe09d[_0x739c('0x40')],_0xbe09d[_0x739c('0x41')]);_0xe46fcc[_0x739c('0x43')]=_['intersection'](_0xbe09d[_0x739c('0x40')],qs['fields'](_0x1ffb54[_0x739c('0x41')][_0x739c('0x44')]));_0xe46fcc[_0x739c('0x43')]=_0xe46fcc[_0x739c('0x43')][_0x739c('0x45')]?_0xe46fcc[_0x739c('0x43')]:_0xbe09d[_0x739c('0x40')];_0xe46fcc[_0x739c('0x48')]=qs[_0x739c('0x49')](_0x1ffb54[_0x739c('0x41')][_0x739c('0x49')]);_0xe46fcc[_0x739c('0x4a')]=qs['filters'](_[_0x739c('0x4b')](_0x1ffb54[_0x739c('0x41')],_0xbe09d[_0x739c('0x42')]));if(_0x1ffb54[_0x739c('0x41')][_0x739c('0x2e')]){_0xe46fcc['where']=_[_0x739c('0x4c')](_0xe46fcc[_0x739c('0x4a')],{'$or':_[_0x739c('0x30')](_0xe46fcc['attributes'],function(_0x4a692a){var _0x5de4fe={};_0x5de4fe[_0x4a692a]={'$like':'%'+_0x1ffb54['query'][_0x739c('0x2e')]+'%'};return _0x5de4fe;})});}_0xe46fcc=_[_0x739c('0x4c')]({},_0xe46fcc,_0x1ffb54[_0x739c('0x55')]);return _0x43197b[_0x739c('0xb9')](_0xe46fcc);}})[_0x739c('0x37')](function(_0x3dbd2f){if(_0x3dbd2f){_0xed2946=_0x3dbd2f['length'];if(!_0x1ffb54['query'][_0x739c('0x65')](_0x739c('0x46'))){_0xe46fcc[_0x739c('0x47')]=qs[_0x739c('0x47')](_0x1ffb54[_0x739c('0x41')][_0x739c('0x47')]);_0xe46fcc[_0x739c('0x21')]=qs['offset'](_0x1ffb54['query'][_0x739c('0x21')]);}return _0x43197b['getBlackLists'](_0xe46fcc);}})[_0x739c('0x37')](function(_0x77e8b5){if(_0x77e8b5){return _0x77e8b5?{'count':_0xed2946,'rows':_0x77e8b5}:null;}})['then'](respondWithResult(_0x261c37,null))[_0x739c('0x51')](handleError(_0x261c37,null));};exports['addBlackLists']=function(_0x23fdc6,_0x4e82b1,_0x176099){var _0x1b21a3,_0x3fcb50;return db[_0x739c('0x3c')][_0x739c('0x56')]({'where':{'id':_0x23fdc6[_0x739c('0x52')]['id']}})[_0x739c('0x37')](handleEntityNotFound(_0x4e82b1,null))[_0x739c('0x37')](function(_0x124c05){if(_0x124c05){_0x3fcb50=_0x124c05;return _0x124c05[_0x739c('0xba')](_0x23fdc6['body']['ids'],_[_0x739c('0x61')](_0x23fdc6[_0x739c('0x58')],['ids','id'])||{});}return null;})['spread'](function(_0x3d0d71){var _0x3726da;_0x1b21a3=_0x3d0d71||[];var _0x3f03d=[];if(_0x3d0d71){for(var _0x4081ab=0x0;_0x4081ab<_0x3d0d71[_0x739c('0x45')];_0x4081ab+=0x1){var _0x530800=_0x3d0d71[_0x4081ab]['get']({'plain':!![]});_0x3726da=squel[_0x739c('0x9d')]()[_0x739c('0x9e')](_0x739c('0xbb'))['fromQuery']([_0x739c('0xa1'),_0x739c('0xa2'),_0x739c('0xa4'),_0x739c('0x66'),_0x739c('0x62'),_0x739c('0x63')],squel[_0x739c('0xa9')]()['field']('phone',_0x739c('0xa1'))[_0x739c('0x83')]('id','ContactId')[_0x739c('0x83')](_0x530800[_0x739c('0xac')]['toString'](),_0x739c('0xa4'))['field'](_0x23fdc6[_0x739c('0x52')]['id'][_0x739c('0x8a')](),_0x739c('0x66'))[_0x739c('0x83')]('NOW()',_0x739c('0x62'))[_0x739c('0x83')](_0x739c('0xbc'),_0x739c('0x63'))[_0x739c('0xa5')](_0x739c('0xab'))[_0x739c('0x4a')]('deletedAt\x20IS\x20NULL')['where'](_0x739c('0xbd'),_0x530800['CmListId'][_0x739c('0x8a')]())[_0x739c('0x4a')](_0x739c('0xa7')))['toString']();_0x3f03d[_0x739c('0x89')](db[_0x739c('0x78')]['query'](_0x3726da));}return BPromise[_0x739c('0x96')](_0x3f03d);}})[_0x739c('0x37')](function(){return _0x1b21a3;})[_0x739c('0x37')](respondWithResult(_0x4e82b1,null))[_0x739c('0x51')](handleError(_0x4e82b1,null));};exports['removeBlackLists']=function(_0x366325,_0x34af99,_0x2f5574){return db['VoiceQueue'][_0x739c('0x56')]({'where':{'id':_0x366325[_0x739c('0x52')]['id']}})[_0x739c('0x37')](handleEntityNotFound(_0x34af99,null))[_0x739c('0x37')](function(_0x31619b){if(_0x31619b){return _0x31619b['removeBlackLists'](_0x366325[_0x739c('0x41')][_0x739c('0x82')]);}})[_0x739c('0x37')](function(_0x4a8d57){if(_0x4a8d57){return db[_0x739c('0x6d')][_0x739c('0x36')]({'where':{'ListId':_0x366325['query'][_0x739c('0x82')],'VoiceQueueId':_0x366325[_0x739c('0x52')]['id']}})[_0x739c('0x37')](function(){return _0x4a8d57;});}})[_0x739c('0x37')](respondWithStatusCode(_0x34af99,null))[_0x739c('0x51')](handleError(_0x34af99,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 3f3ac81..82e433c 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 _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 +var _0xc7ab=['update','remove','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x1877e2,_0x2b76d4){var _0x44e96a=function(_0x8760bf){while(--_0x8760bf){_0x1877e2['push'](_0x1877e2['shift']());}};_0x44e96a(++_0x2b76d4);}(_0xc7ab,0x194));var _0xbc7a=function(_0x20aca6,_0x36ecfa){_0x20aca6=_0x20aca6-0x0;var _0x53ecc4=_0xc7ab[_0x20aca6];return _0x53ecc4;};'use strict';var EventEmitter=require(_0xbc7a('0x0'));var VoiceQueue=require(_0xbc7a('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xbc7a('0x2')](0x0);var events={'afterCreate':_0xbc7a('0x3'),'afterUpdate':_0xbc7a('0x4'),'afterDestroy':_0xbc7a('0x5')};function emitEvent(_0x3cc4c2){return function(_0x286c40,_0x9b10bb,_0x1a65e9){VoiceQueueEvents['emit'](_0x3cc4c2+':'+_0x286c40['id'],_0x286c40);VoiceQueueEvents['emit'](_0x3cc4c2,_0x286c40);_0x1a65e9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xbc7a('0x6')](e,emitEvent(event));}}module[_0xbc7a('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index d6d3f42..6e77cc9 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 _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 +var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1d034b,_0x2faa1d){var _0x32944a=function(_0x42914e){while(--_0x42914e){_0x1d034b['push'](_0x1d034b['shift']());}};_0x32944a(++_0x2faa1d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 2e0cbbf..6c9a9b9 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 _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 +var _0x7354=['rpc','jayson/promise','client','http','redis','defaults','localhost','./voiceQueue.socket','register','then','VoiceQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','where','attributes','limit','map','model','include','find','raw','ShowVoiceQueue','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x20fe19,_0x541f8c){var _0x2241de=function(_0x4f900b){while(--_0x4f900b){_0x20fe19['push'](_0x20fe19['shift']());}};_0x2241de(++_0x541f8c);}(_0x7354,0x1e4));var _0x4735=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0x7354[_0x4d1ee9];return _0x9a5456;};'use strict';var _=require('lodash');var util=require(_0x4735('0x0'));var moment=require(_0x4735('0x1'));var BPromise=require(_0x4735('0x2'));var rs=require(_0x4735('0x3'));var fs=require('fs');var Redis=require(_0x4735('0x4'));var db=require(_0x4735('0x5'))['db'];var utils=require(_0x4735('0x6'));var logger=require(_0x4735('0x7'))(_0x4735('0x8'));var config=require('../../config/environment');var jayson=require(_0x4735('0x9'));var client=jayson[_0x4735('0xa')][_0x4735('0xb')]({'port':0x232a});config[_0x4735('0xc')]=_[_0x4735('0xd')](config[_0x4735('0xc')],{'host':_0x4735('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4735('0xc')]));require(_0x4735('0xf'))[_0x4735('0x10')](socket);function respondWithRpcPromise(_0x390f87,_0x553891,_0x292ddd){return new BPromise(function(_0x50d1b7,_0xe97298){return client['request'](_0x390f87,_0x292ddd)[_0x4735('0x11')](function(_0x2eb827){logger['info'](_0x4735('0x12'),_0x553891,'request\x20sent');logger[_0x4735('0x13')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x553891,_0x4735('0x14'),JSON['stringify'](_0x2eb827));if(_0x2eb827[_0x4735('0x15')]){if(_0x2eb827['error'][_0x4735('0x16')]===0x1f4){logger[_0x4735('0x15')](_0x4735('0x12'),_0x553891,_0x2eb827[_0x4735('0x15')][_0x4735('0x17')]);return _0xe97298(_0x2eb827['error'][_0x4735('0x17')]);}logger['error'](_0x4735('0x12'),_0x553891,_0x2eb827['error'][_0x4735('0x17')]);return _0x50d1b7(_0x2eb827[_0x4735('0x15')][_0x4735('0x17')]);}else{logger[_0x4735('0x18')](_0x4735('0x12'),_0x553891,_0x4735('0x14'));_0x50d1b7(_0x2eb827[_0x4735('0x19')][_0x4735('0x17')]);}})[_0x4735('0x1a')](function(_0x173be6){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x553891,_0x173be6);_0xe97298(_0x173be6);});});}exports[_0x4735('0x1b')]=function(_0x8cb55d){var _0x1a0f51=this;return new Promise(function(_0xd06885,_0x3ee8a5){return db[_0x4735('0x1c')][_0x4735('0x1d')]({'raw':_0x8cb55d[_0x4735('0x1e')]?_0x8cb55d['options']['raw']===undefined?!![]:![]:!![],'where':_0x8cb55d[_0x4735('0x1e')]?_0x8cb55d['options'][_0x4735('0x1f')]||null:null,'attributes':_0x8cb55d['options']?_0x8cb55d[_0x4735('0x1e')][_0x4735('0x20')]||null:null,'limit':_0x8cb55d[_0x4735('0x1e')]?_0x8cb55d['options'][_0x4735('0x21')]||null:null,'include':_0x8cb55d['options']?_0x8cb55d[_0x4735('0x1e')]['include']?_[_0x4735('0x22')](_0x8cb55d[_0x4735('0x1e')]['include'],function(_0x22a07c){return{'model':db[_0x22a07c[_0x4735('0x23')]],'as':_0x22a07c['as'],'attributes':_0x22a07c[_0x4735('0x20')],'include':_0x22a07c[_0x4735('0x24')]?_[_0x4735('0x22')](_0x22a07c[_0x4735('0x24')],function(_0x46902c){return{'model':db[_0x46902c[_0x4735('0x23')]],'as':_0x46902c['as'],'attributes':_0x46902c['attributes'],'include':_0x46902c[_0x4735('0x24')]?_[_0x4735('0x22')](_0x46902c['include'],function(_0x505941){return{'model':db[_0x505941[_0x4735('0x23')]],'as':_0x505941['as'],'attributes':_0x505941[_0x4735('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4735('0x11')](function(_0x5e64c9){logger[_0x4735('0x18')](_0x4735('0x1b'),_0x8cb55d);logger[_0x4735('0x13')](_0x4735('0x1b'),_0x8cb55d,JSON['stringify'](_0x5e64c9));_0xd06885(_0x5e64c9);})[_0x4735('0x1a')](function(_0x1a5db4){logger['error'](_0x4735('0x1b'),_0x1a5db4[_0x4735('0x17')],_0x8cb55d);_0x3ee8a5(_0x1a0f51[_0x4735('0x15')](0x1f4,_0x1a5db4['message']));});});};exports['ShowVoiceQueue']=function(_0x1d82c8){var _0x456a3e=this;return new Promise(function(_0x3673d0,_0x1724c9){return db['VoiceQueue'][_0x4735('0x25')]({'raw':_0x1d82c8[_0x4735('0x1e')]?_0x1d82c8['options'][_0x4735('0x26')]===undefined?!![]:![]:!![],'where':_0x1d82c8[_0x4735('0x1e')]?_0x1d82c8[_0x4735('0x1e')][_0x4735('0x1f')]||null:null,'attributes':_0x1d82c8[_0x4735('0x1e')]?_0x1d82c8[_0x4735('0x1e')][_0x4735('0x20')]||null:null,'include':_0x1d82c8[_0x4735('0x1e')]?_0x1d82c8[_0x4735('0x1e')][_0x4735('0x24')]?_[_0x4735('0x22')](_0x1d82c8[_0x4735('0x1e')][_0x4735('0x24')],function(_0x361124){return{'model':db[_0x361124[_0x4735('0x23')]],'as':_0x361124['as'],'attributes':_0x361124[_0x4735('0x20')],'include':_0x361124[_0x4735('0x24')]?_['map'](_0x361124['include'],function(_0x3d7b4a){return{'model':db[_0x3d7b4a[_0x4735('0x23')]],'as':_0x3d7b4a['as'],'attributes':_0x3d7b4a[_0x4735('0x20')],'include':_0x3d7b4a[_0x4735('0x24')]?_['map'](_0x3d7b4a[_0x4735('0x24')],function(_0x3d8288){return{'model':db[_0x3d8288[_0x4735('0x23')]],'as':_0x3d8288['as'],'attributes':_0x3d8288[_0x4735('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4735('0x11')](function(_0x11549f){logger[_0x4735('0x18')]('ShowVoiceQueue',_0x1d82c8);logger[_0x4735('0x13')](_0x4735('0x27'),_0x1d82c8,JSON[_0x4735('0x28')](_0x11549f));_0x3673d0(_0x11549f);})[_0x4735('0x1a')](function(_0x50d618){logger[_0x4735('0x15')](_0x4735('0x27'),_0x50d618[_0x4735('0x17')],_0x1d82c8);_0x1724c9(_0x456a3e[_0x4735('0x15')](0x1f4,_0x50d618[_0x4735('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index ba8ff76..6bafbe9 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 _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 +var _0x2cc5=['removeListener','register','length','voiceQueue:','save','remove','update','emit'];(function(_0x52fb7b,_0x5b3bfb){var _0x57113a=function(_0x1113e8){while(--_0x1113e8){_0x52fb7b['push'](_0x52fb7b['shift']());}};_0x57113a(++_0x5b3bfb);}(_0x2cc5,0x174));var _0x52cc=function(_0x1e3c54,_0x55f71c){_0x1e3c54=_0x1e3c54-0x0;var _0x8f074=_0x2cc5[_0x1e3c54];return _0x8f074;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x52cc('0x0'),_0x52cc('0x1'),_0x52cc('0x2')];function createListener(_0xac9d9b,_0x43bfe3){return function(_0x303821){_0x43bfe3[_0x52cc('0x3')](_0xac9d9b,_0x303821);};}function removeListener(_0x1aadf9,_0x2818c9){return function(){VoiceQueueEvents[_0x52cc('0x4')](_0x1aadf9,_0x2818c9);};}exports[_0x52cc('0x5')]=function(_0xbfcaf8){for(var _0x36cfb7=0x0,_0x2f53ad=events[_0x52cc('0x6')];_0x36cfb7<_0x2f53ad;_0x36cfb7++){var _0x2a5c5a=events[_0x36cfb7];var _0x66bd01=createListener(_0x52cc('0x7')+_0x2a5c5a,_0xbfcaf8);VoiceQueueEvents['on'](_0x2a5c5a,_0x66bd01);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 10e4d07..1e325e0 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 _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 +var _0xd112=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','isAuthenticated','index','describe','get','/:id','show','post','create','put','update','delete'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd112,0x10a));var _0x2d11=function(_0x1113dc,_0x188e4b){_0x1113dc=_0x1113dc-0x0;var _0x1ebf6e=_0xd112[_0x1113dc];return _0x1ebf6e;};'use strict';var multer=require('multer');var util=require(_0x2d11('0x0'));var path=require(_0x2d11('0x1'));var timeout=require(_0x2d11('0x2'));var express=require(_0x2d11('0x3'));var router=express[_0x2d11('0x4')]();var fs_extra=require(_0x2d11('0x5'));var auth=require(_0x2d11('0x6'));var interaction=require(_0x2d11('0x7'));var config=require('../../config/environment');var controller=require(_0x2d11('0x8'));router['get']('/',auth[_0x2d11('0x9')](),controller[_0x2d11('0xa')]);router['get']('/describe',auth[_0x2d11('0x9')](),controller[_0x2d11('0xb')]);router[_0x2d11('0xc')]('/index',auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router['get'](_0x2d11('0xd'),auth['isAuthenticated'](),controller[_0x2d11('0xe')]);router[_0x2d11('0xf')]('/',auth[_0x2d11('0x9')](),controller[_0x2d11('0x10')]);router[_0x2d11('0x11')]('/:id',auth[_0x2d11('0x9')](),controller[_0x2d11('0x12')]);router[_0x2d11('0x13')](_0x2d11('0xd'),auth[_0x2d11('0x9')](),controller[_0x2d11('0x14')]);module[_0x2d11('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index a7b3c46..96127ee 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 _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 +var _0xea43=['BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER'];(function(_0x116f07,_0x3952d5){var _0xf4e86f=function(_0x4fb524){while(--_0x4fb524){_0x116f07['push'](_0x116f07['shift']());}};_0xf4e86f(++_0x3952d5);}(_0xea43,0xf1));var _0x3ea4=function(_0x5ea032,_0x41fc8c){_0x5ea032=_0x5ea032-0x0;var _0x20625c=_0xea43[_0x5ea032];return _0x20625c;};'use strict';var Sequelize=require(_0x3ea4('0x0'));var moment=require(_0x3ea4('0x1'));module[_0x3ea4('0x2')]={'type':{'type':Sequelize[_0x3ea4('0x3')]},'uniqueid':{'type':Sequelize[_0x3ea4('0x3')]},'calleridnum':{'type':Sequelize[_0x3ea4('0x3')]},'calleridname':{'type':Sequelize[_0x3ea4('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x3ea4('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x3ea4('0x4')],'set':function(_0x2c71e5){var _0x43e52b=moment(_0x2c71e5);var _0x1c638a=moment(this[_0x3ea4('0x5')](_0x3ea4('0x6')))[_0x3ea4('0x7')](_0x3ea4('0x8'));var _0x519652=_0x43e52b['diff'](_0x1c638a,_0x3ea4('0x9'));this[_0x3ea4('0xa')](_0x3ea4('0xb'),_0x2c71e5);this[_0x3ea4('0xa')](_0x3ea4('0xc'),_0x519652||null);}},'position':{'type':Sequelize[_0x3ea4('0xd')]},'count':{'type':Sequelize[_0x3ea4('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x3ea4('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x3ea4('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x3ea4('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x3ea4('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x3ea4('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x3ea4('0x3')],'comment':_0x3ea4('0xf')},'originalposition':{'type':Sequelize[_0x3ea4('0xd')]},'channel':{'type':Sequelize[_0x3ea4('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x3ea4('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3ea4('0x3')]},'priority':{'type':Sequelize[_0x3ea4('0x3')]},'holdtime':{'type':Sequelize[_0x3ea4('0xd')]},'mohtime':{'type':Sequelize[_0x3ea4('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3ea4('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x3ea4('0x3')]},'transfer':{'type':Sequelize[_0x3ea4('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x3ea4('0x10')},'transferexten':{'type':Sequelize[_0x3ea4('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x3ea4('0x3')]},'secondDisposition':{'type':Sequelize[_0x3ea4('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3ea4('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0x3ea4('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index d8226b1..07055a1 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 _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 +var _0x246a=['mustache','path','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','then','destroy','stack','name','send','map','VoiceQueueReport','rawAttributes','type','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','describe','getVoiceQueuesReport','sort','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x45988e,_0x307f1f){var _0x1693fc=function(_0x272035){while(--_0x272035){_0x45988e['push'](_0x45988e['shift']());}};_0x1693fc(++_0x307f1f);}(_0x246a,0x94));var _0xa246=function(_0x3173a5,_0x150e7c){_0x3173a5=_0x3173a5-0x0;var _0x26c94c=_0x246a[_0x3173a5];return _0x26c94c;};'use strict';var emlformat=require(_0xa246('0x0'));var rimraf=require(_0xa246('0x1'));var zipdir=require(_0xa246('0x2'));var jsonpatch=require(_0xa246('0x3'));var rp=require('request-promise');var moment=require(_0xa246('0x4'));var BPromise=require(_0xa246('0x5'));var Mustache=require(_0xa246('0x6'));var util=require('util');var path=require(_0xa246('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa246('0x8'));var _=require(_0xa246('0x9'));var squel=require(_0xa246('0xa'));var crypto=require('crypto');var jsforce=require(_0xa246('0xb'));var deskjs=require(_0xa246('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa246('0xd'));var Redis=require(_0xa246('0xe'));var authService=require(_0xa246('0xf'));var qs=require(_0xa246('0x10'));var as=require(_0xa246('0x11'));var hardwareService=require(_0xa246('0x12'));var logger=require(_0xa246('0x13'))(_0xa246('0x14'));var utils=require(_0xa246('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa246('0x16'));var db=require(_0xa246('0x17'))['db'];config[_0xa246('0x18')]=_[_0xa246('0x19')](config[_0xa246('0x18')],{'host':_0xa246('0x1a'),'port':0x18eb});var socket=require(_0xa246('0x1b'))(new Redis(config[_0xa246('0x18')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x590ddb,_0x3c252c){_0x3c252c=_0x3c252c||0xcc;return function(_0x5da37c){if(_0x5da37c){return _0x590ddb[_0xa246('0x1c')](_0x3c252c);}return _0x590ddb[_0xa246('0x1d')](_0x3c252c)[_0xa246('0x1e')]();};}function respondWithResult(_0x24989f,_0x5502a1){_0x5502a1=_0x5502a1||0xc8;return function(_0x51542a){if(_0x51542a){return _0x24989f[_0xa246('0x1d')](_0x5502a1)['json'](_0x51542a);}};}function respondWithFilteredResult(_0x1d3ac9,_0x22e540){return function(_0x161d1f){if(_0x161d1f){var _0x245870=typeof _0x22e540[_0xa246('0x1f')]===_0xa246('0x20')&&typeof _0x22e540[_0xa246('0x21')]==='undefined';var _0x1819eb=_0x161d1f['count'];var _0x2e0443=_0x245870?0x0:_0x22e540[_0xa246('0x1f')];var _0x5735eb=_0x245870?_0x161d1f[_0xa246('0x22')]:_0x22e540[_0xa246('0x1f')]+_0x22e540[_0xa246('0x21')];var _0x5a5035;if(_0x5735eb>=_0x1819eb){_0x5735eb=_0x1819eb;_0x5a5035=0xc8;}else{_0x5a5035=0xce;}_0x1d3ac9[_0xa246('0x1d')](_0x5a5035);return _0x1d3ac9[_0xa246('0x23')](_0xa246('0x24'),_0x2e0443+'-'+_0x5735eb+'/'+_0x1819eb)[_0xa246('0x25')](_0x161d1f);}return null;};}function patchUpdates(_0x450051){return function(_0x4082de){try{jsonpatch['apply'](_0x4082de,_0x450051,!![]);}catch(_0x6b076b){return BPromise['reject'](_0x6b076b);}return _0x4082de[_0xa246('0x26')]();};}function saveUpdates(_0xddb193,_0x40f615){return function(_0x3b7027){if(_0x3b7027){return _0x3b7027['update'](_0xddb193)[_0xa246('0x27')](function(_0x4c3306){return _0x4c3306;});}return null;};}function removeEntity(_0x4cb468,_0x2ee519){return function(_0x1f364b){if(_0x1f364b){return _0x1f364b[_0xa246('0x28')]()['then'](function(){_0x4cb468[_0xa246('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x282af1,_0x2e5cb1){return function(_0x490091){if(!_0x490091){_0x282af1[_0xa246('0x1c')](0x194);}return _0x490091;};}function handleError(_0x1c3d81,_0x18d3d0){_0x18d3d0=_0x18d3d0||0x1f4;return function(_0x54377f){logger['error'](_0x54377f[_0xa246('0x29')]);if(_0x54377f[_0xa246('0x2a')]){delete _0x54377f[_0xa246('0x2a')];}_0x1c3d81[_0xa246('0x1d')](_0x18d3d0)[_0xa246('0x2b')](_0x54377f);};}exports['index']=function(_0x3fa5d2,_0x20726a){var _0x6ce275={},_0x3c8c7b={},_0x5813a6={'count':0x0,'rows':[]};var _0xbe05e7=_[_0xa246('0x2c')](db[_0xa246('0x2d')][_0xa246('0x2e')],function(_0x564bcb){return{'name':_0x564bcb['fieldName'],'type':_0x564bcb[_0xa246('0x2f')]['key']};});_0x3c8c7b['model']=_[_0xa246('0x2c')](_0xbe05e7,_0xa246('0x2a'));_0x3c8c7b[_0xa246('0x30')]=_['keys'](_0x3fa5d2[_0xa246('0x30')]);_0x3c8c7b[_0xa246('0x31')]=_['intersection'](_0x3c8c7b['model'],_0x3c8c7b[_0xa246('0x30')]);_0x6ce275[_0xa246('0x32')]=_[_0xa246('0x33')](_0x3c8c7b[_0xa246('0x34')],qs[_0xa246('0x35')](_0x3fa5d2['query']['fields']));_0x6ce275[_0xa246('0x32')]=_0x6ce275[_0xa246('0x32')][_0xa246('0x36')]?_0x6ce275[_0xa246('0x32')]:_0x3c8c7b[_0xa246('0x34')];if(!_0x3fa5d2['query'][_0xa246('0x37')]('nolimit')){_0x6ce275[_0xa246('0x21')]=qs['limit'](_0x3fa5d2['query'][_0xa246('0x21')]);_0x6ce275['offset']=qs[_0xa246('0x1f')](_0x3fa5d2[_0xa246('0x30')]['offset']);}_0x6ce275['order']=qs['sort'](_0x3fa5d2['query']['sort']);_0x6ce275['where']=qs[_0xa246('0x31')](_[_0xa246('0x38')](_0x3fa5d2[_0xa246('0x30')],_0x3c8c7b['filters']),_0xbe05e7);if(_0x3fa5d2[_0xa246('0x30')]['filter']){_0x6ce275[_0xa246('0x39')]=_['merge'](_0x6ce275[_0xa246('0x39')],{'$or':_[_0xa246('0x2c')](_0xbe05e7,function(_0x2fc315){if(_0x2fc315[_0xa246('0x2f')]!==_0xa246('0x3a')){var _0x38560d={};_0x38560d[_0x2fc315[_0xa246('0x2a')]]={'$like':'%'+_0x3fa5d2[_0xa246('0x30')][_0xa246('0x3b')]+'%'};return _0x38560d;}})});}_0x6ce275=_[_0xa246('0x3c')]({},_0x6ce275,_0x3fa5d2[_0xa246('0x3d')]);var _0x2293a3={'where':_0x6ce275[_0xa246('0x39')]};return db['VoiceQueueReport']['count'](_0x2293a3)[_0xa246('0x27')](function(_0xfbcd26){_0x5813a6[_0xa246('0x22')]=_0xfbcd26;if(_0x3fa5d2[_0xa246('0x30')][_0xa246('0x3e')]){_0x6ce275[_0xa246('0x3f')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xa246('0x40')](_0x6ce275);})[_0xa246('0x27')](function(_0x4482a6){_0x5813a6[_0xa246('0x41')]=_0x4482a6;return _0x5813a6;})['then'](respondWithFilteredResult(_0x20726a,_0x6ce275))[_0xa246('0x42')](handleError(_0x20726a,null));};exports[_0xa246('0x43')]=function(_0x3e2b1c,_0x3cfcaa){var _0x4ccae4={'raw':![],'where':{'id':_0x3e2b1c[_0xa246('0x44')]['id']}},_0x25def1={};_0x25def1['model']=_[_0xa246('0x45')](db['VoiceQueueReport'][_0xa246('0x2e')]);_0x25def1[_0xa246('0x30')]=_['keys'](_0x3e2b1c[_0xa246('0x30')]);_0x25def1[_0xa246('0x31')]=_[_0xa246('0x33')](_0x25def1[_0xa246('0x34')],_0x25def1[_0xa246('0x30')]);_0x4ccae4[_0xa246('0x32')]=_[_0xa246('0x33')](_0x25def1[_0xa246('0x34')],qs[_0xa246('0x35')](_0x3e2b1c[_0xa246('0x30')][_0xa246('0x35')]));_0x4ccae4[_0xa246('0x32')]=_0x4ccae4[_0xa246('0x32')][_0xa246('0x36')]?_0x4ccae4[_0xa246('0x32')]:_0x25def1[_0xa246('0x34')];if(_0x3e2b1c['query'][_0xa246('0x3e')]){_0x4ccae4['include']=[{'all':!![]}];}_0x4ccae4=_[_0xa246('0x3c')]({},_0x4ccae4,_0x3e2b1c['options']);return db[_0xa246('0x2d')][_0xa246('0x46')](_0x4ccae4)[_0xa246('0x27')](handleEntityNotFound(_0x3cfcaa,null))[_0xa246('0x27')](respondWithResult(_0x3cfcaa,null))[_0xa246('0x42')](handleError(_0x3cfcaa,null));};exports[_0xa246('0x47')]=function(_0x5bb42c,_0x5e1174){return db['VoiceQueueReport'][_0xa246('0x47')](_0x5bb42c[_0xa246('0x48')],{})[_0xa246('0x27')](respondWithResult(_0x5e1174,0xc9))[_0xa246('0x42')](handleError(_0x5e1174,null));};exports[_0xa246('0x49')]=function(_0x484691,_0x16497f){if(_0x484691['body']['id']){delete _0x484691[_0xa246('0x48')]['id'];}return db[_0xa246('0x2d')]['find']({'where':{'id':_0x484691[_0xa246('0x44')]['id']}})[_0xa246('0x27')](handleEntityNotFound(_0x16497f,null))[_0xa246('0x27')](saveUpdates(_0x484691[_0xa246('0x48')],null))['then'](respondWithResult(_0x16497f,null))['catch'](handleError(_0x16497f,null));};exports[_0xa246('0x28')]=function(_0xdf353e,_0x137b38){return db[_0xa246('0x2d')][_0xa246('0x46')]({'where':{'id':_0xdf353e[_0xa246('0x44')]['id']}})['then'](handleEntityNotFound(_0x137b38,null))[_0xa246('0x27')](removeEntity(_0x137b38,null))['catch'](handleError(_0x137b38,null));};exports[_0xa246('0x4a')]=function(_0x18c250,_0x52f8d5){return db[_0xa246('0x2d')][_0xa246('0x4a')]()[_0xa246('0x27')](respondWithResult(_0x52f8d5,null))['catch'](handleError(_0x52f8d5,null));};exports[_0xa246('0x4b')]=function(_0x22385d,_0x588265){var _0x1a5f05={},_0xceb0ad={},_0x878878={'count':0x0,'rows':[]};_0xceb0ad[_0xa246('0x34')]=_[_0xa246('0x45')](db['VoiceQueueReport'][_0xa246('0x2e')]);_0xceb0ad[_0xa246('0x30')]=_['keys'](_0x22385d['query']);_0xceb0ad[_0xa246('0x31')]=_[_0xa246('0x33')](_0xceb0ad[_0xa246('0x34')],_0xceb0ad['query']);_0x1a5f05[_0xa246('0x32')]=_[_0xa246('0x33')](_0xceb0ad[_0xa246('0x34')],qs['fields'](_0x22385d[_0xa246('0x30')][_0xa246('0x35')]));_0x1a5f05[_0xa246('0x32')]=_0x1a5f05[_0xa246('0x32')][_0xa246('0x36')]?_0x1a5f05['attributes']:_0xceb0ad[_0xa246('0x34')];if(!_0x22385d[_0xa246('0x30')][_0xa246('0x37')]('nolimit')){_0x1a5f05['limit']=qs[_0xa246('0x21')](_0x22385d[_0xa246('0x30')]['limit']);_0x1a5f05[_0xa246('0x1f')]=qs[_0xa246('0x1f')](_0x22385d[_0xa246('0x30')][_0xa246('0x1f')]);}_0x1a5f05['order']=qs[_0xa246('0x4c')](_0x22385d[_0xa246('0x30')]['sort']);_0x1a5f05[_0xa246('0x39')]=qs[_0xa246('0x31')](_[_0xa246('0x38')](_0x22385d[_0xa246('0x30')],_0xceb0ad[_0xa246('0x31')]));if(_0x22385d[_0xa246('0x30')][_0xa246('0x3b')]){_0x1a5f05[_0xa246('0x39')]=_[_0xa246('0x3c')](_0x1a5f05['where'],{'$or':_[_0xa246('0x2c')](_0x1a5f05[_0xa246('0x32')],function(_0xd22aa){var _0x32e2af={};_0x32e2af[_0xd22aa]={'$like':'%'+_0x22385d['query'][_0xa246('0x3b')]+'%'};return _0x32e2af;})});}_0x1a5f05=_[_0xa246('0x3c')]({},_0x1a5f05,_0x22385d[_0xa246('0x3d')]);var _0xa2022f={'where':_0x1a5f05[_0xa246('0x39')]};return db['VoiceQueueReport']['count'](_0xa2022f)[_0xa246('0x27')](function(_0x2ba325){_0x878878['count']=_0x2ba325;if(_0x22385d[_0xa246('0x30')]['includeAll']){_0x1a5f05[_0xa246('0x3f')]=[{'all':!![]}];}return db[_0xa246('0x2d')][_0xa246('0x40')](_0x1a5f05);})[_0xa246('0x27')](function(_0x25a2f0){_0x878878[_0xa246('0x41')]=_0x25a2f0;return _0x878878;})[_0xa246('0x27')](respondWithFilteredResult(_0x588265,_0x1a5f05,_0xa246('0x4b')))[_0xa246('0x42')](handleError(_0x588265,null,_0xa246('0x4b')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index c323bdb..39e4b7c 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 _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 +var _0x2c07=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport'];(function(_0x1967a3,_0x2e5525){var _0x4647fc=function(_0x3227c8){while(--_0x3227c8){_0x1967a3['push'](_0x1967a3['shift']());}};_0x4647fc(++_0x2e5525);}(_0x2c07,0x13d));var _0x72c0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2c07[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x72c0('0x0'));var VoiceQueueReport=require(_0x72c0('0x1'))['db'][_0x72c0('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x72c0('0x3')](0x0);var events={'afterCreate':_0x72c0('0x4'),'afterUpdate':'update','afterDestroy':_0x72c0('0x5')};function emitEvent(_0x27ccf7){return function(_0x3cf03e,_0x5725e1,_0x277686){VoiceQueueReportEvents[_0x72c0('0x6')](_0x27ccf7+':'+_0x3cf03e['id'],_0x3cf03e);VoiceQueueReportEvents[_0x72c0('0x6')](_0x27ccf7,_0x3cf03e);_0x277686(null);};}for(var e in events){if(events[_0x72c0('0x7')](e)){var event=events[e];VoiceQueueReport[_0x72c0('0x8')](e,emitEvent(event));}}module[_0x72c0('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 91616dd..01a3e4c 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 _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 +var _0xaf16=['../../config/logger','api','bluebird','path','rimraf','./voiceQueueReport.attributes','exports','VoiceQueueReport','uniqueid','lodash','util'];(function(_0x3d8427,_0x26d438){var _0x50fbb5=function(_0x35a075){while(--_0x35a075){_0x3d8427['push'](_0x3d8427['shift']());}};_0x50fbb5(++_0x26d438);}(_0xaf16,0xf0));var _0x6af1=function(_0x1dae94,_0x239003){_0x1dae94=_0x1dae94-0x0;var _0x36ce2d=_0xaf16[_0x1dae94];return _0x36ce2d;};'use strict';var _=require(_0x6af1('0x0'));var util=require(_0x6af1('0x1'));var logger=require(_0x6af1('0x2'))(_0x6af1('0x3'));var moment=require('moment');var BPromise=require(_0x6af1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6af1('0x5'));var rimraf=require(_0x6af1('0x6'));var config=require('../../config/environment');var attributes=require(_0x6af1('0x7'));module[_0x6af1('0x8')]=function(_0x4c83f6,_0x544cbd){return _0x4c83f6['define'](_0x6af1('0x9'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x6af1('0xa')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 5dae047..fe58c00 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 _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 +var _0x27e5=['then','debug','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','raw','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','where','attributes','limit','map','include','model'];(function(_0x2376ff,_0x501212){var _0x38e668=function(_0x3203bd){while(--_0x3203bd){_0x2376ff['push'](_0x2376ff['shift']());}};_0x38e668(++_0x501212);}(_0x27e5,0xdf));var _0x527e=function(_0x5d1a8d,_0x1151c7){_0x5d1a8d=_0x5d1a8d-0x0;var _0x2f641c=_0x27e5[_0x5d1a8d];return _0x2f641c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x527e('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x527e('0x1'));var db=require(_0x527e('0x2'))['db'];var utils=require(_0x527e('0x3'));var logger=require(_0x527e('0x4'))(_0x527e('0x5'));var config=require(_0x527e('0x6'));var jayson=require(_0x527e('0x7'));var client=jayson[_0x527e('0x8')]['http']({'port':0x232a});config[_0x527e('0x9')]=_[_0x527e('0xa')](config[_0x527e('0x9')],{'host':_0x527e('0xb'),'port':0x18eb});var socket=require(_0x527e('0xc'))(new Redis(config[_0x527e('0x9')]));require(_0x527e('0xd'))[_0x527e('0xe')](socket);function respondWithRpcPromise(_0x17ae62,_0x2f9530,_0x4c524e){return new BPromise(function(_0x43cece,_0x15db7f){return client[_0x527e('0xf')](_0x17ae62,_0x4c524e)['then'](function(_0x10648c){logger['info'](_0x527e('0x10'),_0x2f9530,_0x527e('0x11'));logger['debug'](_0x527e('0x12'),_0x2f9530,_0x527e('0x11'),JSON[_0x527e('0x13')](_0x10648c));if(_0x10648c[_0x527e('0x14')]){if(_0x10648c[_0x527e('0x14')][_0x527e('0x15')]===0x1f4){logger[_0x527e('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x2f9530,_0x10648c[_0x527e('0x14')][_0x527e('0x16')]);return _0x15db7f(_0x10648c['error'][_0x527e('0x16')]);}logger[_0x527e('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x2f9530,_0x10648c[_0x527e('0x14')][_0x527e('0x16')]);return _0x43cece(_0x10648c['error'][_0x527e('0x16')]);}else{logger[_0x527e('0x17')](_0x527e('0x10'),_0x2f9530,_0x527e('0x11'));_0x43cece(_0x10648c[_0x527e('0x18')][_0x527e('0x16')]);}})[_0x527e('0x19')](function(_0x7d5623){logger['error'](_0x527e('0x10'),_0x2f9530,_0x7d5623);_0x15db7f(_0x7d5623);});});}exports[_0x527e('0x1a')]=function(_0xf36355){var _0x1f66e6=this;return new Promise(function(_0x3fcfaf,_0x3f433b){return db[_0x527e('0x1b')]['findAll']({'raw':_0xf36355[_0x527e('0x1c')]?_0xf36355['options']['raw']===undefined?!![]:![]:!![],'where':_0xf36355[_0x527e('0x1c')]?_0xf36355['options'][_0x527e('0x1d')]||null:null,'attributes':_0xf36355[_0x527e('0x1c')]?_0xf36355[_0x527e('0x1c')][_0x527e('0x1e')]||null:null,'limit':_0xf36355[_0x527e('0x1c')]?_0xf36355['options'][_0x527e('0x1f')]||null:null,'include':_0xf36355[_0x527e('0x1c')]?_0xf36355['options']['include']?_[_0x527e('0x20')](_0xf36355[_0x527e('0x1c')]['include'],function(_0x10a7ec){return{'model':db[_0x10a7ec['model']],'as':_0x10a7ec['as'],'attributes':_0x10a7ec[_0x527e('0x1e')],'include':_0x10a7ec[_0x527e('0x21')]?_['map'](_0x10a7ec['include'],function(_0x50e080){return{'model':db[_0x50e080[_0x527e('0x22')]],'as':_0x50e080['as'],'attributes':_0x50e080[_0x527e('0x1e')],'include':_0x50e080[_0x527e('0x21')]?_[_0x527e('0x20')](_0x50e080[_0x527e('0x21')],function(_0x212290){return{'model':db[_0x212290['model']],'as':_0x212290['as'],'attributes':_0x212290[_0x527e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x527e('0x23')](function(_0x9c4830){logger[_0x527e('0x17')]('GetVoiceQueueReport',_0xf36355);logger[_0x527e('0x24')](_0x527e('0x1a'),_0xf36355,JSON[_0x527e('0x13')](_0x9c4830));_0x3fcfaf(_0x9c4830);})['catch'](function(_0x21cd6e){logger[_0x527e('0x14')](_0x527e('0x1a'),_0x21cd6e[_0x527e('0x16')],_0xf36355);_0x3f433b(_0x1f66e6['error'](0x1f4,_0x21cd6e[_0x527e('0x16')]));});});};exports[_0x527e('0x25')]=function(_0x150734){var _0x44df0e=this;return new Promise(function(_0xff7d86,_0x3d69ea){return db[_0x527e('0x1b')][_0x527e('0x26')](_0x150734[_0x527e('0x27')],{'raw':_0x150734['options']?_0x150734[_0x527e('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x527e('0x23')](function(_0x2f1484){logger[_0x527e('0x17')](_0x527e('0x25'),_0x150734);logger[_0x527e('0x24')](_0x527e('0x25'),_0x150734,JSON[_0x527e('0x13')](_0x2f1484));_0xff7d86(_0x2f1484);})[_0x527e('0x19')](function(_0x1bb13e){logger[_0x527e('0x14')](_0x527e('0x25'),_0x1bb13e[_0x527e('0x16')],_0x150734);_0x3d69ea(_0x44df0e[_0x527e('0x14')](0x1f4,_0x1bb13e[_0x527e('0x16')]));});});};exports[_0x527e('0x28')]=function(_0x49dc43){var _0x21ea40=this;return new Promise(function(_0x4814df,_0x50e848){return db[_0x527e('0x1b')][_0x527e('0x29')](_0x49dc43['body'],{'raw':_0x49dc43[_0x527e('0x1c')]?_0x49dc43['options'][_0x527e('0x2a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49dc43['options']?_0x49dc43[_0x527e('0x1c')][_0x527e('0x1d')]||null:null,'attributes':_0x49dc43[_0x527e('0x1c')]?_0x49dc43[_0x527e('0x1c')][_0x527e('0x1e')]||null:null,'limit':_0x49dc43[_0x527e('0x1c')]?_0x49dc43[_0x527e('0x1c')][_0x527e('0x1f')]||null:null})[_0x527e('0x23')](function(_0x45553f){logger[_0x527e('0x17')](_0x527e('0x28'),_0x49dc43);logger[_0x527e('0x24')](_0x527e('0x28'),_0x49dc43,JSON[_0x527e('0x13')](_0x45553f));_0x4814df(_0x45553f);})[_0x527e('0x19')](function(_0x287e28){logger[_0x527e('0x14')](_0x527e('0x28'),_0x287e28[_0x527e('0x16')],_0x49dc43);_0x50e848(_0x21ea40[_0x527e('0x14')](0x1f4,_0x287e28[_0x527e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index ecba0e4..9e86ba9 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 _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 +var _0x3c94=['remove','update','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x1671ee,_0x295c2a){var _0x53bae4=function(_0x351ea7){while(--_0x351ea7){_0x1671ee['push'](_0x1671ee['shift']());}};_0x53bae4(++_0x295c2a);}(_0x3c94,0xcd));var _0x43c9=function(_0x8be9fb,_0x2f90d9){_0x8be9fb=_0x8be9fb-0x0;var _0x3b41ac=_0x3c94[_0x8be9fb];return _0x3b41ac;};'use strict';var VoiceQueueReportEvents=require(_0x43c9('0x0'));var events=[_0x43c9('0x1'),_0x43c9('0x2'),_0x43c9('0x3')];function createListener(_0x188507,_0x2da73f){return function(_0xe05adb){_0x2da73f[_0x43c9('0x4')](_0x188507,_0xe05adb);};}function removeListener(_0x170a0d,_0x44fc3){return function(){VoiceQueueReportEvents[_0x43c9('0x5')](_0x170a0d,_0x44fc3);};}exports[_0x43c9('0x6')]=function(_0x4fdfc2){for(var _0x39c220=0x0,_0xf03007=events[_0x43c9('0x7')];_0x39c220<_0xf03007;_0x39c220++){var _0x37c029=events[_0x39c220];var _0x383adb=createListener(_0x43c9('0x8')+_0x37c029,_0x4fdfc2);VoiceQueueReportEvents['on'](_0x37c029,_0x383adb);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index b3dcb83..d098e29 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 _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 +var _0xefd6=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x53bfa4,_0x4f13b8){var _0x4b4d37=function(_0x20079d){while(--_0x20079d){_0x53bfa4['push'](_0x53bfa4['shift']());}};_0x4b4d37(++_0x4f13b8);}(_0xefd6,0x126));var _0x6efd=function(_0x37d8f4,_0x260370){_0x37d8f4=_0x37d8f4-0x0;var _0x1592ac=_0xefd6[_0x37d8f4];return _0x1592ac;};'use strict';var multer=require(_0x6efd('0x0'));var util=require(_0x6efd('0x1'));var path=require(_0x6efd('0x2'));var timeout=require(_0x6efd('0x3'));var express=require(_0x6efd('0x4'));var router=express['Router']();var fs_extra=require(_0x6efd('0x5'));var auth=require(_0x6efd('0x6'));var interaction=require(_0x6efd('0x7'));var config=require(_0x6efd('0x8'));var controller=require(_0x6efd('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x6efd('0xa')]);router['get'](_0x6efd('0xb'),auth[_0x6efd('0xc')](),controller[_0x6efd('0xd')]);router[_0x6efd('0xe')]('/',auth[_0x6efd('0xc')](),controller[_0x6efd('0xf')]);router[_0x6efd('0x10')]('/:id',auth[_0x6efd('0xc')](),controller[_0x6efd('0x11')]);router[_0x6efd('0x12')](_0x6efd('0xb'),auth[_0x6efd('0xc')](),controller[_0x6efd('0x13')]);module[_0x6efd('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 77a3ebc..70ad119 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 _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 +var _0x61da=['DATE','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports','STRING'];(function(_0x590b1f,_0x891e35){var _0x56c30a=function(_0x9e0d89){while(--_0x9e0d89){_0x590b1f['push'](_0x590b1f['shift']());}};_0x56c30a(++_0x891e35);}(_0x61da,0x13a));var _0xa61d=function(_0x138b0d,_0x49b882){_0x138b0d=_0x138b0d-0x0;var _0x8d1ddc=_0x61da[_0x138b0d];return _0x8d1ddc;};'use strict';var Sequelize=require(_0xa61d('0x0'));var moment=require(_0xa61d('0x1'));module[_0xa61d('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xa61d('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xa61d('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xa61d('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xa61d('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xa61d('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xa61d('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xa61d('0x4')],'allowNull':![],'defaultValue':Sequelize['literal'](_0xa61d('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index ff467ee..01a7a22 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 _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 +var _0xf253=['rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','include','findAll','rows','show','params','intersection','includeAll','find','catch','create','body','eml-format'];(function(_0x42d6d0,_0x2693d7){var _0x7e9ed=function(_0x22f692){while(--_0x22f692){_0x42d6d0['push'](_0x42d6d0['shift']());}};_0x7e9ed(++_0x2693d7);}(_0xf253,0x95));var _0x3f25=function(_0x135e32,_0x880d3a){_0x135e32=_0x135e32-0x0;var _0x2cbb45=_0xf253[_0x135e32];return _0x2cbb45;};'use strict';var emlformat=require(_0x3f25('0x0'));var rimraf=require(_0x3f25('0x1'));var zipdir=require(_0x3f25('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3f25('0x3'));var moment=require(_0x3f25('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3f25('0x5'));var util=require(_0x3f25('0x6'));var path=require(_0x3f25('0x7'));var sox=require(_0x3f25('0x8'));var csv=require(_0x3f25('0x9'));var ejs=require(_0x3f25('0xa'));var fs=require('fs');var fs_extra=require(_0x3f25('0xb'));var _=require(_0x3f25('0xc'));var squel=require(_0x3f25('0xd'));var crypto=require('crypto');var jsforce=require(_0x3f25('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3f25('0x9'));var querystring=require(_0x3f25('0xf'));var Papa=require(_0x3f25('0x10'));var Redis=require(_0x3f25('0x11'));var authService=require(_0x3f25('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3f25('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f25('0x14'))(_0x3f25('0x15'));var utils=require(_0x3f25('0x16'));var config=require(_0x3f25('0x17'));var licenseUtil=require(_0x3f25('0x18'));var db=require(_0x3f25('0x19'))['db'];function respondWithStatusCode(_0xf67545,_0x56e558){_0x56e558=_0x56e558||0xcc;return function(_0x397da5){if(_0x397da5){return _0xf67545['sendStatus'](_0x56e558);}return _0xf67545[_0x3f25('0x1a')](_0x56e558)['end']();};}function respondWithResult(_0x46b3e2,_0x317888){_0x317888=_0x317888||0xc8;return function(_0x3b6f4a){if(_0x3b6f4a){return _0x46b3e2['status'](_0x317888)['json'](_0x3b6f4a);}};}function respondWithFilteredResult(_0x24f079,_0x612380){return function(_0x7c3cd9){if(_0x7c3cd9){var _0x51877a=typeof _0x612380[_0x3f25('0x1b')]==='undefined'&&typeof _0x612380[_0x3f25('0x1c')]===_0x3f25('0x1d');var _0x123d2b=_0x7c3cd9['count'];var _0x21b3ed=_0x51877a?0x0:_0x612380['offset'];var _0x4bb9ea=_0x51877a?_0x7c3cd9[_0x3f25('0x1e')]:_0x612380[_0x3f25('0x1b')]+_0x612380[_0x3f25('0x1c')];var _0x3e6386;if(_0x4bb9ea>=_0x123d2b){_0x4bb9ea=_0x123d2b;_0x3e6386=0xc8;}else{_0x3e6386=0xce;}_0x24f079[_0x3f25('0x1a')](_0x3e6386);return _0x24f079[_0x3f25('0x1f')](_0x3f25('0x20'),_0x21b3ed+'-'+_0x4bb9ea+'/'+_0x123d2b)[_0x3f25('0x21')](_0x7c3cd9);}return null;};}function patchUpdates(_0x452340){return function(_0x1f332a){try{jsonpatch['apply'](_0x1f332a,_0x452340,!![]);}catch(_0x37f63d){return BPromise[_0x3f25('0x22')](_0x37f63d);}return _0x1f332a[_0x3f25('0x23')]();};}function saveUpdates(_0x793d20,_0x3d6078){return function(_0x39c06d){if(_0x39c06d){return _0x39c06d[_0x3f25('0x24')](_0x793d20)[_0x3f25('0x25')](function(_0x2a47e2){return _0x2a47e2;});}return null;};}function removeEntity(_0x48ca98,_0xd46579){return function(_0x2f7fc4){if(_0x2f7fc4){return _0x2f7fc4[_0x3f25('0x26')]()[_0x3f25('0x25')](function(){_0x48ca98['status'](0xcc)[_0x3f25('0x27')]();});}};}function handleEntityNotFound(_0x4e28fe,_0x39c458){return function(_0x4183c0){if(!_0x4183c0){_0x4e28fe[_0x3f25('0x28')](0x194);}return _0x4183c0;};}function handleError(_0x27fe46,_0x359ba0){_0x359ba0=_0x359ba0||0x1f4;return function(_0x21a552){logger[_0x3f25('0x29')](_0x21a552[_0x3f25('0x2a')]);if(_0x21a552[_0x3f25('0x2b')]){delete _0x21a552[_0x3f25('0x2b')];}_0x27fe46[_0x3f25('0x1a')](_0x359ba0)[_0x3f25('0x2c')](_0x21a552);};}exports[_0x3f25('0x2d')]=function(_0x2ebd17,_0x262df6){var _0x11e7b6={},_0x27509f={},_0x1f6033={'count':0x0,'rows':[]};var _0x25d41a=_[_0x3f25('0x2e')](db[_0x3f25('0x2f')][_0x3f25('0x30')],function(_0x59caa8){return{'name':_0x59caa8['fieldName'],'type':_0x59caa8[_0x3f25('0x31')][_0x3f25('0x32')]};});_0x27509f[_0x3f25('0x33')]=_[_0x3f25('0x2e')](_0x25d41a,_0x3f25('0x2b'));_0x27509f[_0x3f25('0x34')]=_[_0x3f25('0x35')](_0x2ebd17[_0x3f25('0x34')]);_0x27509f[_0x3f25('0x36')]=_['intersection'](_0x27509f[_0x3f25('0x33')],_0x27509f['query']);_0x11e7b6[_0x3f25('0x37')]=_['intersection'](_0x27509f[_0x3f25('0x33')],qs[_0x3f25('0x38')](_0x2ebd17[_0x3f25('0x34')][_0x3f25('0x38')]));_0x11e7b6['attributes']=_0x11e7b6[_0x3f25('0x37')]['length']?_0x11e7b6['attributes']:_0x27509f['model'];if(!_0x2ebd17['query'][_0x3f25('0x39')]('nolimit')){_0x11e7b6[_0x3f25('0x1c')]=qs['limit'](_0x2ebd17['query'][_0x3f25('0x1c')]);_0x11e7b6['offset']=qs[_0x3f25('0x1b')](_0x2ebd17[_0x3f25('0x34')]['offset']);}_0x11e7b6[_0x3f25('0x3a')]=qs[_0x3f25('0x3b')](_0x2ebd17[_0x3f25('0x34')][_0x3f25('0x3b')]);_0x11e7b6['where']=qs['filters'](_['pick'](_0x2ebd17[_0x3f25('0x34')],_0x27509f[_0x3f25('0x36')]),_0x25d41a);if(_0x2ebd17[_0x3f25('0x34')]['filter']){_0x11e7b6[_0x3f25('0x3c')]=_[_0x3f25('0x3d')](_0x11e7b6['where'],{'$or':_[_0x3f25('0x2e')](_0x25d41a,function(_0x49fc08){if(_0x49fc08['type']!==_0x3f25('0x3e')){var _0x42504c={};_0x42504c[_0x49fc08[_0x3f25('0x2b')]]={'$like':'%'+_0x2ebd17[_0x3f25('0x34')]['filter']+'%'};return _0x42504c;}})});}_0x11e7b6=_[_0x3f25('0x3d')]({},_0x11e7b6,_0x2ebd17[_0x3f25('0x3f')]);var _0x51db53={'where':_0x11e7b6['where']};return db[_0x3f25('0x2f')]['count'](_0x51db53)[_0x3f25('0x25')](function(_0x1ab008){_0x1f6033[_0x3f25('0x1e')]=_0x1ab008;if(_0x2ebd17[_0x3f25('0x34')]['includeAll']){_0x11e7b6[_0x3f25('0x40')]=[{'all':!![]}];}return db[_0x3f25('0x2f')][_0x3f25('0x41')](_0x11e7b6);})[_0x3f25('0x25')](function(_0x1ba1d9){_0x1f6033[_0x3f25('0x42')]=_0x1ba1d9;return _0x1f6033;})[_0x3f25('0x25')](respondWithFilteredResult(_0x262df6,_0x11e7b6))['catch'](handleError(_0x262df6,null));};exports[_0x3f25('0x43')]=function(_0x2bfc90,_0x3ec14e){var _0x3eb6a1={'raw':!![],'where':{'id':_0x2bfc90[_0x3f25('0x44')]['id']}},_0x3f8edf={};_0x3f8edf[_0x3f25('0x33')]=_[_0x3f25('0x35')](db[_0x3f25('0x2f')][_0x3f25('0x30')]);_0x3f8edf['query']=_[_0x3f25('0x35')](_0x2bfc90[_0x3f25('0x34')]);_0x3f8edf[_0x3f25('0x36')]=_['intersection'](_0x3f8edf[_0x3f25('0x33')],_0x3f8edf[_0x3f25('0x34')]);_0x3eb6a1[_0x3f25('0x37')]=_[_0x3f25('0x45')](_0x3f8edf[_0x3f25('0x33')],qs[_0x3f25('0x38')](_0x2bfc90[_0x3f25('0x34')][_0x3f25('0x38')]));_0x3eb6a1['attributes']=_0x3eb6a1[_0x3f25('0x37')]['length']?_0x3eb6a1[_0x3f25('0x37')]:_0x3f8edf['model'];if(_0x2bfc90[_0x3f25('0x34')][_0x3f25('0x46')]){_0x3eb6a1[_0x3f25('0x40')]=[{'all':!![]}];}_0x3eb6a1=_['merge']({},_0x3eb6a1,_0x2bfc90['options']);return db[_0x3f25('0x2f')][_0x3f25('0x47')](_0x3eb6a1)['then'](handleEntityNotFound(_0x3ec14e,null))['then'](respondWithResult(_0x3ec14e,null))[_0x3f25('0x48')](handleError(_0x3ec14e,null));};exports[_0x3f25('0x49')]=function(_0x45a1d4,_0x1cfc58){return db[_0x3f25('0x2f')][_0x3f25('0x49')](_0x45a1d4['body'],{})[_0x3f25('0x25')](respondWithResult(_0x1cfc58,0xc9))[_0x3f25('0x48')](handleError(_0x1cfc58,null));};exports[_0x3f25('0x24')]=function(_0x56ed74,_0x4b52b3){if(_0x56ed74['body']['id']){delete _0x56ed74[_0x3f25('0x4a')]['id'];}return db[_0x3f25('0x2f')][_0x3f25('0x47')]({'where':{'id':_0x56ed74[_0x3f25('0x44')]['id']}})[_0x3f25('0x25')](handleEntityNotFound(_0x4b52b3,null))[_0x3f25('0x25')](saveUpdates(_0x56ed74[_0x3f25('0x4a')],null))[_0x3f25('0x25')](respondWithResult(_0x4b52b3,null))[_0x3f25('0x48')](handleError(_0x4b52b3,null));};exports[_0x3f25('0x26')]=function(_0x50aee5,_0x35ef89){return db['VoiceQueuesLog'][_0x3f25('0x47')]({'where':{'id':_0x50aee5[_0x3f25('0x44')]['id']}})[_0x3f25('0x25')](handleEntityNotFound(_0x35ef89,null))[_0x3f25('0x25')](removeEntity(_0x35ef89,null))[_0x3f25('0x48')](handleError(_0x35ef89,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 4a13aa7..6230385 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 _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 +var _0x4974=['path','../../config/environment','./voiceQueuesLog.attributes','exports','define','voice_queues_log','dtm','lodash','../../config/logger','api','moment','request-promise'];(function(_0x490b05,_0x7f0934){var _0x37ad3c=function(_0x4260d0){while(--_0x4260d0){_0x490b05['push'](_0x490b05['shift']());}};_0x37ad3c(++_0x7f0934);}(_0x4974,0x127));var _0x4497=function(_0x4b8e98,_0x6cb034){_0x4b8e98=_0x4b8e98-0x0;var _0x3577b2=_0x4974[_0x4b8e98];return _0x3577b2;};'use strict';var _=require(_0x4497('0x0'));var util=require('util');var logger=require(_0x4497('0x1'))(_0x4497('0x2'));var moment=require(_0x4497('0x3'));var BPromise=require('bluebird');var rp=require(_0x4497('0x4'));var fs=require('fs');var path=require(_0x4497('0x5'));var rimraf=require('rimraf');var config=require(_0x4497('0x6'));var attributes=require(_0x4497('0x7'));module[_0x4497('0x8')]=function(_0x4bc5e7,_0x16880a){return _0x4bc5e7[_0x4497('0x9')]('VoiceQueuesLog',attributes,{'tableName':_0x4497('0xa'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event',_0x4497('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 9e4be15..334f6ff 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 _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 +var _0x167e=['request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x3e7ce8,_0x2b9409){var _0xeee8b5=function(_0x597ffd){while(--_0x597ffd){_0x3e7ce8['push'](_0x3e7ce8['shift']());}};_0xeee8b5(++_0x2b9409);}(_0x167e,0xa3));var _0xe167=function(_0x5dc31e,_0x49e000){_0x5dc31e=_0x5dc31e-0x0;var _0x503b06=_0x167e[_0x5dc31e];return _0x503b06;};'use strict';var _=require(_0xe167('0x0'));var util=require(_0xe167('0x1'));var moment=require(_0xe167('0x2'));var BPromise=require(_0xe167('0x3'));var rs=require(_0xe167('0x4'));var fs=require('fs');var Redis=require(_0xe167('0x5'));var db=require(_0xe167('0x6'))['db'];var utils=require(_0xe167('0x7'));var logger=require('../../config/logger')(_0xe167('0x8'));var config=require('../../config/environment');var jayson=require(_0xe167('0x9'));var client=jayson[_0xe167('0xa')][_0xe167('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bad0c,_0x1426ae,_0x56cf9b){return new BPromise(function(_0x3a00d5,_0x5c6694){return client[_0xe167('0xc')](_0x3bad0c,_0x56cf9b)[_0xe167('0xd')](function(_0x26a191){logger[_0xe167('0xe')](_0xe167('0xf'),_0x1426ae,_0xe167('0x10'));logger[_0xe167('0x11')](_0xe167('0x12'),_0x1426ae,'request\x20sent',JSON[_0xe167('0x13')](_0x26a191));if(_0x26a191[_0xe167('0x14')]){if(_0x26a191['error'][_0xe167('0x15')]===0x1f4){logger[_0xe167('0x14')](_0xe167('0xf'),_0x1426ae,_0x26a191[_0xe167('0x14')][_0xe167('0x16')]);return _0x5c6694(_0x26a191[_0xe167('0x14')][_0xe167('0x16')]);}logger[_0xe167('0x14')](_0xe167('0xf'),_0x1426ae,_0x26a191['error'][_0xe167('0x16')]);return _0x3a00d5(_0x26a191[_0xe167('0x14')][_0xe167('0x16')]);}else{logger[_0xe167('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1426ae,_0xe167('0x10'));_0x3a00d5(_0x26a191[_0xe167('0x17')][_0xe167('0x16')]);}})[_0xe167('0x18')](function(_0x1244d4){logger['error'](_0xe167('0xf'),_0x1426ae,_0x1244d4);_0x5c6694(_0x1244d4);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 98b92c0..ab8b07a 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 _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 +var _0xaacb=['downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','/describe','isAuthenticated','/:id','show','/:id/download','/:id/downloads'];(function(_0x358806,_0x322b66){var _0x19fdcb=function(_0xe01b8d){while(--_0xe01b8d){_0x358806['push'](_0x358806['shift']());}};_0x19fdcb(++_0x322b66);}(_0xaacb,0xa0));var _0xbaac=function(_0xd1a252,_0x16396f){_0xd1a252=_0xd1a252-0x0;var _0x560ee1=_0xaacb[_0xd1a252];return _0x560ee1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbaac('0x0'));var timeout=require('connect-timeout');var express=require(_0xbaac('0x1'));var router=express[_0xbaac('0x2')]();var fs_extra=require(_0xbaac('0x3'));var auth=require(_0xbaac('0x4'));var interaction=require(_0xbaac('0x5'));var config=require(_0xbaac('0x6'));var controller=require(_0xbaac('0x7'));router[_0xbaac('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbaac('0x8')](_0xbaac('0x9'),auth[_0xbaac('0xa')](),controller['describe']);router['get'](_0xbaac('0xb'),auth['isAuthenticated'](),controller[_0xbaac('0xc')]);router[_0xbaac('0x8')](_0xbaac('0xd'),auth['isAuthenticated'](),controller['download']);router[_0xbaac('0x8')](_0xbaac('0xe'),controller[_0xbaac('0xf')]);router[_0xbaac('0x8')](_0xbaac('0x10'),auth[_0xbaac('0xa')](),controller[_0xbaac('0x11')]);router[_0xbaac('0x12')]('/',auth[_0xbaac('0xa')](),controller[_0xbaac('0x13')]);router[_0xbaac('0x12')]('/:id/transcribe',auth[_0xbaac('0xa')](),controller[_0xbaac('0x14')]);router[_0xbaac('0x15')]('/:id',auth[_0xbaac('0xa')](),controller['update']);router[_0xbaac('0x16')](_0xbaac('0xb'),auth[_0xbaac('0xa')](),controller[_0xbaac('0x17')]);module[_0xbaac('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 02b4d30..c513b75 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(_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 +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(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 eda087f..adaa5da 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 _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 +var _0x61dd=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','aws-sdk','../../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','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','VoiceRecording','fieldName','type','key','model','differenceBy','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','find','create','body','params','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','extname','unlink','Not\x20found','sequelize','col','token','$and','push','filename','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','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','transcribeName','transcribeStatus','runTranscribe','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x61dd,0x1d1));var _0xd61d=function(_0x1dacd4,_0x4259f7){_0x1dacd4=_0x1dacd4-0x0;var _0x5c29c5=_0x61dd[_0x1dacd4];return _0x5c29c5;};'use strict';var emlformat=require(_0xd61d('0x0'));var rimraf=require(_0xd61d('0x1'));var zipdir=require(_0xd61d('0x2'));var jsonpatch=require(_0xd61d('0x3'));var rp=require(_0xd61d('0x4'));var moment=require(_0xd61d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd61d('0x6'));var path=require(_0xd61d('0x7'));var sox=require(_0xd61d('0x8'));var csv=require(_0xd61d('0x9'));var ejs=require(_0xd61d('0xa'));var fs=require('fs');var fs_extra=require(_0xd61d('0xb'));var _=require(_0xd61d('0xc'));var squel=require(_0xd61d('0xd'));var crypto=require('crypto');var jsforce=require(_0xd61d('0xe'));var deskjs=require(_0xd61d('0xf'));var toCsv=require(_0xd61d('0x9'));var querystring=require(_0xd61d('0x10'));var Papa=require('papaparse');var AWS=require(_0xd61d('0x11'));var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0xd61d('0x12'));var qs=require(_0xd61d('0x13'));var as=require(_0xd61d('0x14'));var hardwareService=require(_0xd61d('0x15'));var logger=require(_0xd61d('0x16'))(_0xd61d('0x17'));var utils=require('../../config/utils');var config=require(_0xd61d('0x18'));var licenseUtil=require(_0xd61d('0x19'));var db=require(_0xd61d('0x1a'))['db'];function respondWithStatusCode(_0x24fa74,_0xd2a875){_0xd2a875=_0xd2a875||0xcc;return function(_0x20aafa){if(_0x20aafa){return _0x24fa74[_0xd61d('0x1b')](_0xd2a875);}return _0x24fa74[_0xd61d('0x1c')](_0xd2a875)[_0xd61d('0x1d')]();};}function respondWithResult(_0x23f705,_0xad051e){_0xad051e=_0xad051e||0xc8;return function(_0x2ef51b){if(_0x2ef51b){return _0x23f705[_0xd61d('0x1c')](_0xad051e)[_0xd61d('0x1e')](_0x2ef51b);}};}function respondWithFilteredResult(_0x245482,_0xffa9e8){return function(_0x3eeee7){if(_0x3eeee7){var _0x5437c1=typeof _0xffa9e8['offset']===_0xd61d('0x1f')&&typeof _0xffa9e8[_0xd61d('0x20')]==='undefined';var _0x3f7637=_0x3eeee7['count'];var _0x5bac9f=_0x5437c1?0x0:_0xffa9e8[_0xd61d('0x21')];var _0x573216=_0x5437c1?_0x3eeee7[_0xd61d('0x22')]:_0xffa9e8[_0xd61d('0x21')]+_0xffa9e8['limit'];var _0x50709e;if(_0x573216>=_0x3f7637){_0x573216=_0x3f7637;_0x50709e=0xc8;}else{_0x50709e=0xce;}_0x245482[_0xd61d('0x1c')](_0x50709e);return _0x245482[_0xd61d('0x23')](_0xd61d('0x24'),_0x5bac9f+'-'+_0x573216+'/'+_0x3f7637)[_0xd61d('0x1e')](_0x3eeee7);}return null;};}function patchUpdates(_0x126ebb){return function(_0x2eca4a){try{jsonpatch[_0xd61d('0x25')](_0x2eca4a,_0x126ebb,!![]);}catch(_0x57974b){return BPromise[_0xd61d('0x26')](_0x57974b);}return _0x2eca4a[_0xd61d('0x27')]();};}function saveUpdates(_0x1d20df,_0x263c25){return function(_0x485871){if(_0x485871){return _0x485871[_0xd61d('0x28')](_0x1d20df)[_0xd61d('0x29')](function(_0x13dc18){return _0x13dc18;});}return null;};}function removeEntity(_0x5e3978,_0x1f3166){return function(_0x3718a7){if(_0x3718a7){return _0x3718a7[_0xd61d('0x2a')]()['then'](function(){_0x5e3978[_0xd61d('0x1c')](0xcc)[_0xd61d('0x1d')]();});}};}function handleEntityNotFound(_0x5ea995,_0x362826){return function(_0x3d3209){if(!_0x3d3209){_0x5ea995[_0xd61d('0x1b')](0x194);}return _0x3d3209;};}function handleError(_0x583af6,_0x17c601){_0x17c601=_0x17c601||0x1f4;return function(_0x5db6f5){logger[_0xd61d('0x2b')](_0x5db6f5['stack']);if(_0x5db6f5[_0xd61d('0x2c')]){delete _0x5db6f5[_0xd61d('0x2c')];}_0x583af6[_0xd61d('0x1c')](_0x17c601)[_0xd61d('0x2d')](_0x5db6f5);};}exports[_0xd61d('0x2e')]=function(_0x4cc6f1,_0x269161){var _0x3ecc44={},_0x5e8281={},_0x2794b4={'count':0x0,'rows':[]};var _0x2dc699=_[_0xd61d('0x2f')](db[_0xd61d('0x30')]['rawAttributes'],function(_0x399b8c){return{'name':_0x399b8c[_0xd61d('0x31')],'type':_0x399b8c[_0xd61d('0x32')][_0xd61d('0x33')]};});_0x5e8281[_0xd61d('0x34')]=_[_0xd61d('0x35')](_['map'](_0x2dc699,_0xd61d('0x2c')),[_0xd61d('0x36')]);_0x5e8281['query']=_[_0xd61d('0x37')](_0x4cc6f1[_0xd61d('0x38')]);_0x5e8281[_0xd61d('0x39')]=_[_0xd61d('0x3a')](_0x5e8281[_0xd61d('0x34')],_0x5e8281['query']);_0x3ecc44[_0xd61d('0x3b')]=_[_0xd61d('0x3a')](_0x5e8281['model'],qs[_0xd61d('0x3c')](_0x4cc6f1[_0xd61d('0x38')]['fields']));_0x3ecc44[_0xd61d('0x3b')]=_0x3ecc44[_0xd61d('0x3b')][_0xd61d('0x3d')]?_0x3ecc44['attributes']:_0x5e8281[_0xd61d('0x34')];if(!_0x4cc6f1['query'][_0xd61d('0x3e')](_0xd61d('0x3f'))){_0x3ecc44[_0xd61d('0x20')]=qs[_0xd61d('0x20')](_0x4cc6f1[_0xd61d('0x38')]['limit']);_0x3ecc44[_0xd61d('0x21')]=qs[_0xd61d('0x21')](_0x4cc6f1[_0xd61d('0x38')][_0xd61d('0x21')]);}_0x3ecc44['order']=qs['sort'](_0x4cc6f1['query'][_0xd61d('0x40')]);_0x3ecc44[_0xd61d('0x41')]=qs[_0xd61d('0x39')](_[_0xd61d('0x42')](_0x4cc6f1[_0xd61d('0x38')],_0x5e8281[_0xd61d('0x39')]),_0x2dc699);if(_0x4cc6f1['query'][_0xd61d('0x43')]){_0x3ecc44[_0xd61d('0x41')]=_['merge'](_0x3ecc44[_0xd61d('0x41')],{'$or':_[_0xd61d('0x2f')](_0x2dc699,function(_0x2e2dbe){if(_0x2e2dbe[_0xd61d('0x32')]!==_0xd61d('0x44')){var _0x56fe99={};_0x56fe99[_0x2e2dbe[_0xd61d('0x2c')]]={'$like':'%'+_0x4cc6f1[_0xd61d('0x38')][_0xd61d('0x43')]+'%'};return _0x56fe99;}})});}_0x3ecc44=_[_0xd61d('0x45')]({},_0x3ecc44,_0x4cc6f1[_0xd61d('0x46')]);var _0x3d112e={'where':_0x3ecc44['where']};return db[_0xd61d('0x30')][_0xd61d('0x22')](_0x3d112e)[_0xd61d('0x29')](function(_0x3f3af5){_0x2794b4[_0xd61d('0x22')]=_0x3f3af5;if(_0x4cc6f1[_0xd61d('0x38')][_0xd61d('0x47')]){_0x3ecc44[_0xd61d('0x48')]=[{'all':!![]}];}return db[_0xd61d('0x30')]['findAll'](_0x3ecc44);})['then'](function(_0x2f70c4){_0x2794b4[_0xd61d('0x49')]=_0x2f70c4;return _0x2794b4;})['then'](respondWithFilteredResult(_0x269161,_0x3ecc44))[_0xd61d('0x4a')](handleError(_0x269161,null));};exports[_0xd61d('0x4b')]=function(_0x682cbc,_0x3e25da){var _0x4679c5={'raw':![],'where':{'id':_0x682cbc['params']['id']}},_0x2ff9f5={};_0x2ff9f5[_0xd61d('0x34')]=_['keys'](db['VoiceRecording']['rawAttributes']);_0x2ff9f5[_0xd61d('0x38')]=_['keys'](_0x682cbc[_0xd61d('0x38')]);_0x2ff9f5[_0xd61d('0x39')]=_['intersection'](_0x2ff9f5['model'],_0x2ff9f5[_0xd61d('0x38')]);_0x4679c5[_0xd61d('0x3b')]=_['intersection'](_0x2ff9f5[_0xd61d('0x34')],qs['fields'](_0x682cbc['query'][_0xd61d('0x3c')]));_0x4679c5['attributes']=_0x4679c5[_0xd61d('0x3b')]['length']?_0x4679c5['attributes']:_0x2ff9f5[_0xd61d('0x34')];if(_0x682cbc[_0xd61d('0x38')][_0xd61d('0x47')]){_0x4679c5[_0xd61d('0x48')]=[{'all':!![]}];}_0x4679c5=_[_0xd61d('0x45')]({},_0x4679c5,_0x682cbc[_0xd61d('0x46')]);return db[_0xd61d('0x30')][_0xd61d('0x4c')](_0x4679c5)['then'](handleEntityNotFound(_0x3e25da,null))[_0xd61d('0x29')](respondWithResult(_0x3e25da,null))['catch'](handleError(_0x3e25da,null));};exports[_0xd61d('0x4d')]=function(_0x49028c,_0x10ac05){return db[_0xd61d('0x30')][_0xd61d('0x4d')](_0x49028c['body'],{})[_0xd61d('0x29')](respondWithResult(_0x10ac05,0xc9))[_0xd61d('0x4a')](handleError(_0x10ac05,null));};exports[_0xd61d('0x28')]=function(_0x5b4258,_0xcfb830){if(_0x5b4258[_0xd61d('0x4e')]['id']){delete _0x5b4258[_0xd61d('0x4e')]['id'];}return db[_0xd61d('0x30')][_0xd61d('0x4c')]({'where':{'id':_0x5b4258[_0xd61d('0x4f')]['id']}})[_0xd61d('0x29')](handleEntityNotFound(_0xcfb830,null))['then'](saveUpdates(_0x5b4258[_0xd61d('0x4e')],null))[_0xd61d('0x29')](respondWithResult(_0xcfb830,null))['catch'](handleError(_0xcfb830,null));};exports[_0xd61d('0x50')]=function(_0x462c27,_0x646036){return db[_0xd61d('0x30')]['describe']()['then'](respondWithResult(_0x646036,null))[_0xd61d('0x4a')](handleError(_0x646036,null));};exports[_0xd61d('0x51')]=function(_0x36dec9,_0x2a4572,_0x5eff39){var _0x2527c4=require(_0xd61d('0x52'));var _0x2eb555=![];var _0x4e8268={};if(_0x36dec9[_0xd61d('0x38')][_0xd61d('0x32')]&&_0x36dec9[_0xd61d('0x38')][_0xd61d('0x32')]===_0xd61d('0x53')){_0x4e8268['uniqueid']=_0x36dec9[_0xd61d('0x4f')]['id'];}else{_0x4e8268['id']=_0x36dec9[_0xd61d('0x4f')]['id'];}return db[_0xd61d('0x30')][_0xd61d('0x4c')]({'where':_0x4e8268,'attributes':['id',_0xd61d('0x54')],'raw':!![]})[_0xd61d('0x29')](handleEntityNotFound(_0x2a4572,null))[_0xd61d('0x29')](function(_0x1b3f8e){if(_0x1b3f8e){var _0x58587a=_0x1b3f8e[_0xd61d('0x54')];var _0x37fc25=util[_0xd61d('0x36')](_0xd61d('0x55'),_0x58587a);if(fs[_0xd61d('0x56')](_0x37fc25)){_0x2eb555=!![];return _0x2527c4[_0xd61d('0x57')](_0x37fc25,_0x58587a,config[_0xd61d('0x58')][_0xd61d('0x59')])[_0xd61d('0x29')](function(){return _0x1b3f8e;});}return _0x1b3f8e;}})[_0xd61d('0x29')](function(_0xd01a02){if(_0xd01a02){var _0x40a506=_0xd01a02[_0xd61d('0x54')];if(!fs['existsSync'](_0x40a506)){throw new db[(_0xd61d('0x5a'))][(_0xd61d('0x5b'))](_0xd61d('0x5c'));}if(_0xd01a02['filename']){return _0x2a4572[_0xd61d('0x51')](_0x40a506,_0xd01a02['filename']+path[_0xd61d('0x5d')](_0x40a506),function(){if(_0x2eb555){fs[_0xd61d('0x5e')](_0x40a506);}});}else{return _0x2a4572[_0xd61d('0x51')](_0x40a506,function(_0x3a9490){if(_0x2eb555){fs['unlink'](_0x40a506);}});}}})['catch'](function(_0x445e3f){if(_0x445e3f['message']===_0xd61d('0x5c')){_0x2a4572[_0xd61d('0x1c')](0x194)['send'](_0xd61d('0x5f'));}else{return handleError(_0x2a4572,null);}});};exports['downloads']=function(_0x3f4f09,_0x51ec9c,_0x516a14){var _0x1b145b=require(_0xd61d('0x52'));var _0x285f5a=![];var _0x96892={'$and':[db[_0xd61d('0x60')]['where'](db[_0xd61d('0x60')]['fn']('MD5',db[_0xd61d('0x60')][_0xd61d('0x61')]('uniqueid')),_0x3f4f09[_0xd61d('0x38')][_0xd61d('0x62')])]};if(_0x3f4f09[_0xd61d('0x38')][_0xd61d('0x32')]&&_0x3f4f09['query'][_0xd61d('0x32')]==='uniqueid'){_0x96892[_0xd61d('0x63')][_0xd61d('0x64')]({'uniqueid':_0x3f4f09[_0xd61d('0x4f')]['id']});}else{_0x96892[_0xd61d('0x63')][_0xd61d('0x64')]({'id':_0x3f4f09[_0xd61d('0x4f')]['id']});}return db[_0xd61d('0x30')][_0xd61d('0x4c')]({'where':_0x96892,'attributes':['id',_0xd61d('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x51ec9c,null))[_0xd61d('0x29')](function(_0x20e6f8){if(_0x20e6f8){var _0x222e31=util[_0xd61d('0x36')](_0xd61d('0x55'),_0x20e6f8[_0xd61d('0x54')]);if(fs[_0xd61d('0x56')](_0x222e31)){_0x285f5a=!![];return _0x1b145b[_0xd61d('0x57')](_0x222e31,_0x20e6f8[_0xd61d('0x54')],config[_0xd61d('0x58')][_0xd61d('0x59')])[_0xd61d('0x29')](function(){return _0x20e6f8;});}return _0x20e6f8;}})[_0xd61d('0x29')](function(_0xf02e1b){if(_0xf02e1b){if(!fs[_0xd61d('0x56')](_0xf02e1b[_0xd61d('0x54')])){throw new db[(_0xd61d('0x5a'))][(_0xd61d('0x5b'))](_0xd61d('0x5c'));}if(_0xf02e1b['filename']){return _0x51ec9c[_0xd61d('0x51')](_0xf02e1b[_0xd61d('0x54')],_0xf02e1b[_0xd61d('0x65')]+path['extname'](_0xf02e1b[_0xd61d('0x54')]),function(){if(_0x285f5a){fs[_0xd61d('0x5e')](_0xf02e1b[_0xd61d('0x54')]);}});}else{return _0x51ec9c[_0xd61d('0x51')](_0xf02e1b['value'],function(_0x2bc610){if(_0x285f5a){fs[_0xd61d('0x5e')](_0xf02e1b[_0xd61d('0x54')]);}});}}})[_0xd61d('0x4a')](handleError(_0x51ec9c,null));};exports[_0xd61d('0x2a')]=function(_0x1709ec,_0x5b6da5){return db['VoiceRecording']['find']({'where':{'id':_0x1709ec['params']['id']}})[_0xd61d('0x29')](function(_0x2bbe0c){if(_[_0xd61d('0x66')](_0x2bbe0c)){throw new ReferenceError(_0xd61d('0x67'));}return _0x2bbe0c;})[_0xd61d('0x29')](function(_0x2a2cf6){var _0x2fd804=_0x2a2cf6[_0xd61d('0x54')];logger[_0xd61d('0x68')](_0xd61d('0x69'),_0x2fd804);if(!_['isNil'](_0x2a2cf6[_0xd61d('0x54')])&&fs[_0xd61d('0x56')](_0x2fd804)){logger[_0xd61d('0x68')](_0xd61d('0x6a')+_0x2fd804+_0xd61d('0x6b'));fs[_0xd61d('0x6c')](_0x2fd804);}_0x2fd804=_0x2fd804+_0xd61d('0x6d');if(!_[_0xd61d('0x66')](_0x2a2cf6['value'])&&fs['existsSync'](_0x2fd804)){logger['info'](_0xd61d('0x6a')+_0x2fd804+_0xd61d('0x6b'));fs[_0xd61d('0x6c')](_0x2fd804);}return _0x2a2cf6;})[_0xd61d('0x29')](function(_0x758f65){if(!_0x758f65)throw new InternalError();return _0x758f65[_0xd61d('0x2a')]();})[_0xd61d('0x29')](function(){_0x5b6da5[_0xd61d('0x1c')](0xcc)[_0xd61d('0x1d')]();})[_0xd61d('0x4a')](handleError(_0x5b6da5,null));};function getBucketslist(_0x44dfe8,_0x3a98c3,_0x5c4433){return new Promise(function(_0x10fd41,_0x43460d){var _0x33ddaf=new AWS['S3']({'accessKeyId':_0x3a98c3,'secretAccessKey':_0x44dfe8,'region':_0x5c4433});_0x33ddaf[_0xd61d('0x6e')]({},function(_0x32cf04,_0x52b4b8){if(_0x32cf04){return _0x43460d(_0x32cf04);}else{return _0x10fd41(_0x52b4b8);}});});}function createBucket(_0x28947b,_0x53816f,_0x135eef,_0x44da83){return new Promise(function(_0x415b93,_0x2ee09a){var _0x368482=new AWS['S3']({'accessKeyId':_0x53816f,'secretAccessKey':_0x28947b,'region':_0x135eef});_0x368482[_0xd61d('0x6f')]({'Bucket':_0x44da83},function(_0x1aed73,_0x112ccd){if(_0x1aed73){return _0x2ee09a(_0x1aed73);}else{return _0x415b93(_0x112ccd);}});});}function uploadFile(_0x550cc5,_0x299cca,_0x5c4a83,_0x5b8863,_0x876676,_0x35d883){return new Promise(function(_0x2fc587,_0x48d4d7){var _0x406f09=new AWS['S3']({'accessKeyId':_0x299cca,'secretAccessKey':_0x550cc5,'region':_0x5c4a83});_0x406f09[_0xd61d('0x70')]({'Bucket':_0x5b8863,'Key':_0x876676,'Body':_0x35d883},function(_0x3d829b,_0x5c3944){if(_0x3d829b){return _0x48d4d7(_0x3d829b);}else{return _0x2fc587(_0x5c3944);}});});}function startTranscribe(_0x1bc26f,_0x2aaa9f,_0x238fda,_0x12396d,_0x4fec45,_0x568d79){return new Promise(function(_0x4af2bc,_0x321544){var _0x28a62a=new AWS[(_0xd61d('0x71'))]({'accessKeyId':_0x2aaa9f,'secretAccessKey':_0x1bc26f,'region':_0x238fda});_0x28a62a[_0xd61d('0x72')]({'TranscriptionJobName':_0x12396d,'LanguageCode':_0x4fec45,'Media':{'MediaFileUri':_0x568d79}},function(_0x4fbec0,_0x17fab4){if(_0x4fbec0){return _0x321544(_0x4fbec0);}else{return _0x4af2bc(_0x17fab4);}});});}function transcribe(_0x2f8cb4,_0x5648a7,_0x3967df,_0x27e33e,_0xf798d7,_0x1d9007,_0x28b9ee){return new Promise(function(_0x35626c,_0x485fb1){var _0x2dd47f={};logger[_0xd61d('0x68')](util[_0xd61d('0x36')](_0xd61d('0x73'),_0x2f8cb4,_0xf798d7));return uploadFile(_0x5648a7,_0x3967df,_0x27e33e,_0xf798d7,path[_0xd61d('0x74')](_0x1d9007),fs[_0xd61d('0x75')](_0x1d9007))['then'](function(_0x3e52c8){logger[_0xd61d('0x68')](util['format'](_0xd61d('0x76'),_0x2f8cb4,_0xf798d7,_0x3e52c8[_0xd61d('0x77')]));_0x2dd47f[_0xd61d('0x78')]=_0x3e52c8[_0xd61d('0x79')];_0x2dd47f[_0xd61d('0x7a')]=_0x3e52c8['Location'];logger[_0xd61d('0x68')](util[_0xd61d('0x36')](_0xd61d('0x7b'),_0x2f8cb4));return startTranscribe(_0x5648a7,_0x3967df,_0x27e33e,uuidv4(),_0x28b9ee,_0x3e52c8[_0xd61d('0x77')]);})[_0xd61d('0x29')](function(_0xe0d8e1){logger[_0xd61d('0x68')](util[_0xd61d('0x36')](_0xd61d('0x7c'),_0x2f8cb4,_0xe0d8e1[_0xd61d('0x7d')][_0xd61d('0x7e')]));_0x2dd47f[_0xd61d('0x7f')]=_0xe0d8e1[_0xd61d('0x7d')][_0xd61d('0x7e')];_0x2dd47f[_0xd61d('0x80')]=_0xe0d8e1['TranscriptionJob']['TranscriptionJobStatus'];return _0x35626c(_0x2dd47f);})[_0xd61d('0x4a')](function(_0x387100){return _0x485fb1(_0x387100);});});}exports[_0xd61d('0x81')]=function(_0x5a6f6e,_0x22f860,_0x313023){var _0x4e69dc;var _0x1e80cc;var _0x1a88f4;var _0xee7215=require('../../components/encryptor');return db[_0xd61d('0x30')]['findOne']({'where':{'id':_0x5a6f6e[_0xd61d('0x4f')]['id']}})[_0xd61d('0x29')](function(_0x49fbdd){if(_0x49fbdd){var _0x2dceb8=util[_0xd61d('0x36')](_0xd61d('0x55'),_0x49fbdd[_0xd61d('0x54')]);if(fs[_0xd61d('0x56')](_0x2dceb8)){cypher=!![];return _0xee7215[_0xd61d('0x57')](_0x2dceb8,_0x49fbdd[_0xd61d('0x54')],config[_0xd61d('0x58')][_0xd61d('0x59')])[_0xd61d('0x29')](function(){return _0x49fbdd;});}return _0x49fbdd;}})['then'](function(_0x268d00){if(!_0x268d00){throw new db['Sequelize'][(_0xd61d('0x5b'))](_0xd61d('0x82'));}_0x1e80cc=_0x268d00;return db[_0xd61d('0x83')][_0xd61d('0x84')]({'where':{'id':0x1}});})[_0xd61d('0x29')](handleEntityNotFound(_0x22f860,null))['then'](function(_0x452f98){if(_0x452f98){_0x4e69dc=_0x452f98;if(!_0x4e69dc[_0xd61d('0x85')]||!_0x4e69dc[_0xd61d('0x86')]||!_0x4e69dc[_0xd61d('0x87')]||!_0x4e69dc[_0xd61d('0x88')]||!_0x4e69dc[_0xd61d('0x78')]){throw new db[(_0xd61d('0x5a'))]['ValidationError'](_0xd61d('0x89'));}if(_0x5a6f6e['body'][_0xd61d('0x8a')]&&(!_0x4e69dc['sentiment']||!_0x4e69dc[_0xd61d('0x8b')]||!_0x4e69dc[_0xd61d('0x8c')]||!_0x4e69dc[_0xd61d('0x88')]||!_0x4e69dc['bucket'])){throw new db['Sequelize'][(_0xd61d('0x5b'))](_0xd61d('0x8d'));}return db[_0xd61d('0x8e')][_0xd61d('0x84')]({'where':{'id':_0x4e69dc[_0xd61d('0x86')]}});}})[_0xd61d('0x29')](function(_0x5a29ff){if(!_0x5a29ff){throw new db['Sequelize'][(_0xd61d('0x5b'))](_0xd61d('0x8f'));}if(!_0x5a29ff[_0xd61d('0x90')]||!_0x5a29ff[_0xd61d('0x91')]){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x1a88f4=_0x5a29ff;return getBucketslist(_0x1a88f4[_0xd61d('0x90')],_0x1a88f4[_0xd61d('0x91')],_0x4e69dc[_0xd61d('0x87')]);})[_0xd61d('0x29')](function(_0x3968ad){if(_0x3968ad&&_0x3968ad[_0xd61d('0x92')]){var _0x20e7ca=_['find'](_0x3968ad['Buckets'],function(_0x544859){return _0x544859[_0xd61d('0x93')]===_0x4e69dc[_0xd61d('0x78')];});if(!_0x20e7ca){logger[_0xd61d('0x68')](util[_0xd61d('0x36')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x5a6f6e[_0xd61d('0x4f')]['id'],_0x4e69dc['bucket']));return createBucket(_0x1a88f4[_0xd61d('0x90')],_0x1a88f4[_0xd61d('0x91')],_0x4e69dc['transcribeRegion'],_0x4e69dc[_0xd61d('0x78')]);}logger['info'](util[_0xd61d('0x36')](_0xd61d('0x94'),_0x5a6f6e[_0xd61d('0x4f')]['id'],_0x4e69dc['bucket']));return;}})['then'](function(_0x1882d4){if(_0x1e80cc[_0xd61d('0x80')]===_0xd61d('0x95')){return transcribe(_0x5a6f6e[_0xd61d('0x4f')]['id'],_0x1a88f4[_0xd61d('0x90')],_0x1a88f4[_0xd61d('0x91')],_0x4e69dc[_0xd61d('0x87')],_0x4e69dc['bucket'],_0x1e80cc[_0xd61d('0x54')],_0x4e69dc[_0xd61d('0x88')]);}else{logger[_0xd61d('0x68')](util[_0xd61d('0x36')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x5a6f6e[_0xd61d('0x4f')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xd61d('0x29')](function(_0xf0a3ca){if(_0xf0a3ca){_0xf0a3ca[_0xd61d('0x96')]=_0x5a6f6e[_0xd61d('0x4e')]['runSentiment'];return _0x1e80cc[_0xd61d('0x97')](_0xf0a3ca);}})[_0xd61d('0x29')](respondWithResult(_0x22f860,null))[_0xd61d('0x4a')](handleError(_0x22f860,null));};function writeFile(_0xa0c893,_0x596350){return new Promise(function(_0x14337c,_0x335ad8){fs[_0xd61d('0x98')](_0x596350,_0xa0c893,function(_0x1df4e0,_0x192159){if(_0x1df4e0){return _0x335ad8(_0x1df4e0);}else{return _0x14337c(_0x192159);}});});}exports[_0xd61d('0x99')]=function(_0x49d384,_0x139f79,_0x2a15b7){return db[_0xd61d('0x30')][_0xd61d('0x84')]({'where':{'id':_0x49d384[_0xd61d('0x4f')]['id']}})[_0xd61d('0x29')](handleEntityNotFound(_0x139f79))[_0xd61d('0x29')](function(_0x22a4b9){if(_0x22a4b9&&_0x22a4b9[_0xd61d('0x9a')]){var _0x11074f=_0x22a4b9[_0xd61d('0x9a')];var _0x5ec66d=config[_0xd61d('0x9b')]+_0xd61d('0x9c')+_0x22a4b9['id']+'.txt';if(fs[_0xd61d('0x56')](_0x5ec66d)){return _0x5ec66d;}return writeFile(_0x11074f,_0x5ec66d)['then'](function(){return _0x5ec66d;});}else{throw new db[(_0xd61d('0x5a'))][(_0xd61d('0x5b'))]('Transcript\x20not\x20available');}})['then'](function(_0x135eb1){return _0x139f79[_0xd61d('0x51')](_0x135eb1);})['catch'](handleError(_0x139f79));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index c4d1c5d..2836177 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 _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 +var _0xc6d8=['define','voice_recordings','transcribeStatus','./voiceRecording.attributes'];(function(_0x567f8a,_0x1ad54d){var _0x3d3d08=function(_0x16085f){while(--_0x16085f){_0x567f8a['push'](_0x567f8a['shift']());}};_0x3d3d08(++_0x1ad54d);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x48d007,_0x446953){_0x48d007=_0x48d007-0x0;var _0x412d80=_0xc6d8[_0x48d007];return _0x412d80;};'use strict';var attributes=require(_0x8c6d('0x0'));module['exports']=function(_0x170f12,_0x49772b){return _0x170f12[_0x8c6d('0x1')]('VoiceRecording',attributes,{'tableName':_0x8c6d('0x2'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']},{'name':_0x8c6d('0x3'),'fields':[_0x8c6d('0x3')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 7fcfd24..8034692 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 _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 +var _0x0424=['stringify','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','limit','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s'];(function(_0x4a248b,_0x29e290){var _0x565f8c=function(_0x3944b1){while(--_0x3944b1){_0x4a248b['push'](_0x4a248b['shift']());}};_0x565f8c(++_0x29e290);}(_0x0424,0x159));var _0x4042=function(_0x5087b7,_0x117485){_0x5087b7=_0x5087b7-0x0;var _0x3b4c2b=_0x0424[_0x5087b7];return _0x3b4c2b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4042('0x0'));var BPromise=require(_0x4042('0x1'));var rs=require(_0x4042('0x2'));var fs=require('fs');var Redis=require(_0x4042('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4042('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4042('0x5'));var jayson=require(_0x4042('0x6'));var client=jayson[_0x4042('0x7')][_0x4042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3abaf1,_0xa5310f,_0x10ec07){return new BPromise(function(_0x5d11bf,_0x509772){return client[_0x4042('0x9')](_0x3abaf1,_0x10ec07)[_0x4042('0xa')](function(_0x103e4a){logger['info'](_0x4042('0xb'),_0xa5310f,_0x4042('0xc'));logger[_0x4042('0xd')](_0x4042('0xe'),_0xa5310f,_0x4042('0xc'),JSON[_0x4042('0xf')](_0x103e4a));if(_0x103e4a[_0x4042('0x10')]){if(_0x103e4a[_0x4042('0x10')]['code']===0x1f4){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a['error'][_0x4042('0x11')]);return _0x509772(_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);}logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);return _0x5d11bf(_0x103e4a['error'][_0x4042('0x11')]);}else{logger[_0x4042('0x12')]('VoiceRecording,\x20%s,\x20%s',_0xa5310f,_0x4042('0xc'));_0x5d11bf(_0x103e4a[_0x4042('0x13')][_0x4042('0x11')]);}})[_0x4042('0x14')](function(_0x31e765){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x31e765);_0x509772(_0x31e765);});});}exports[_0x4042('0x15')]=function(_0x466077){var _0x4b02d4=this;return new Promise(function(_0xe5c1ec,_0x4fe024){return db[_0x4042('0x16')]['update'](_0x466077[_0x4042('0x17')],{'raw':_0x466077[_0x4042('0x18')]?_0x466077[_0x4042('0x18')][_0x4042('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x466077['options']?_0x466077[_0x4042('0x18')][_0x4042('0x1a')]||null:null,'attributes':_0x466077[_0x4042('0x18')]?_0x466077[_0x4042('0x18')]['attributes']||null:null,'limit':_0x466077[_0x4042('0x18')]?_0x466077[_0x4042('0x18')][_0x4042('0x1b')]||null:null})[_0x4042('0xa')](function(_0x352631){logger['info'](_0x4042('0x15'),_0x466077);logger[_0x4042('0xd')]('UpdateVoiceRecording',_0x466077,JSON[_0x4042('0xf')](_0x352631));_0xe5c1ec(_0x352631);})['catch'](function(_0x271b82){logger[_0x4042('0x10')](_0x4042('0x15'),_0x271b82['message'],_0x466077);_0x4fe024(_0x4b02d4[_0x4042('0x10')](0x1f4,_0x271b82[_0x4042('0x11')]));});});};exports[_0x4042('0x1c')]=function(_0xbdadc8){var _0x1c4d9f=this;return new Promise(function(_0x52e575,_0x58c409){var _0x1d8d48=require(_0x4042('0x1d'));var _0x26542c;return db[_0x4042('0x1e')][_0x4042('0x1f')]({'attributes':['id',_0x4042('0x20')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x33733b){_0x26542c=_0x33733b;return db[_0x4042('0x16')]['create'](_0xbdadc8[_0x4042('0x17')]);})[_0x4042('0xa')](function(_0xe924fe){if(_0x26542c['callRecordingEncryption']&&fs['existsSync'](_0xe924fe[_0x4042('0x21')])){var _0x43bd1c=util['format'](_0x4042('0x22'),_0xe924fe[_0x4042('0x21')]);return _0x1d8d48[_0x4042('0x23')](_0xe924fe[_0x4042('0x21')],_0x43bd1c,config[_0x4042('0x24')][_0x4042('0x25')])[_0x4042('0xa')](function(){fs[_0x4042('0x26')](_0xe924fe[_0x4042('0x21')]);logger['info'](_0x4042('0x27'));return _0xe924fe;});}return _0xe924fe;})[_0x4042('0xa')](function(_0x5320f8){logger[_0x4042('0x12')](_0x4042('0x1c'),_0xbdadc8);logger['debug'](_0x4042('0x1c'),_0xbdadc8,JSON[_0x4042('0xf')](_0x5320f8));_0x52e575(_0x5320f8);})[_0x4042('0x14')](function(_0xaa7c99){logger[_0x4042('0x10')](_0x4042('0x1c'),_0xaa7c99[_0x4042('0x11')],_0xbdadc8);_0x58c409(_0x1c4d9f[_0x4042('0x10')](0x1f4,_0xaa7c99[_0x4042('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index d8f21f6..a22e1fc 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 _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 +var _0xb31f=['../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','/describe','describe','post','create','put','/:id','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x256cc1,_0x568424){var _0x330d0a=function(_0x4c8cc1){while(--_0x4c8cc1){_0x256cc1['push'](_0x256cc1['shift']());}};_0x330d0a(++_0x568424);}(_0xb31f,0x1d9));var _0xfb31=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xb31f[_0x54d4fe];return _0x1ab5bb;};'use strict';var multer=require(_0xfb31('0x0'));var util=require(_0xfb31('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfb31('0x2'));var router=express[_0xfb31('0x3')]();var fs_extra=require(_0xfb31('0x4'));var auth=require(_0xfb31('0x5'));var interaction=require(_0xfb31('0x6'));var config=require(_0xfb31('0x7'));var controller=require(_0xfb31('0x8'));router[_0xfb31('0x9')]('/',auth[_0xfb31('0xa')](),controller['index']);router[_0xfb31('0x9')](_0xfb31('0xb'),auth['isAuthenticated'](),controller[_0xfb31('0xc')]);router['get']('/:id',auth[_0xfb31('0xa')](),controller['show']);router[_0xfb31('0xd')]('/',auth[_0xfb31('0xa')](),controller[_0xfb31('0xe')]);router[_0xfb31('0xf')](_0xfb31('0x10'),auth['isAuthenticated'](),controller[_0xfb31('0x11')]);router[_0xfb31('0x12')](_0xfb31('0x10'),auth[_0xfb31('0xa')](),controller[_0xfb31('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 778cf84..2960770 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 _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 +var _0xaf1b=['exports','ENUM','blind','attended','STRING','Yes','sequelize','moment'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xaf1b,0x166));var _0xbaf1=function(_0x151fac,_0x5292e7){_0x151fac=_0x151fac-0x0;var _0x34f9f1=_0xaf1b[_0x151fac];return _0x34f9f1;};'use strict';var Sequelize=require(_0xbaf1('0x0'));var moment=require(_0xbaf1('0x1'));module[_0xbaf1('0x2')]={'type':{'type':Sequelize[_0xbaf1('0x3')](_0xbaf1('0x4'),_0xbaf1('0x5'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xbaf1('0x6')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xbaf1('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0xbaf1('0x6')]},'transfereraccountcode':{'type':Sequelize[_0xbaf1('0x6')]},'transferercontext':{'type':Sequelize[_0xbaf1('0x6')]},'transfererexten':{'type':Sequelize[_0xbaf1('0x6')]},'transfererlinkedid':{'type':Sequelize[_0xbaf1('0x6')]},'transfereechannel':{'type':Sequelize[_0xbaf1('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0xbaf1('0x6')]},'transfereecalleridname':{'type':Sequelize[_0xbaf1('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xbaf1('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0xbaf1('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0xbaf1('0x6')]},'transfereecontext':{'type':Sequelize[_0xbaf1('0x6')]},'transfereeexten':{'type':Sequelize[_0xbaf1('0x6')]},'transfereelinkedid':{'type':Sequelize[_0xbaf1('0x6')]},'isexternal':{'type':Sequelize[_0xbaf1('0x3')](_0xbaf1('0x7'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 2310379..0681180 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 _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 +var _0xff10=['reject','update','then','destroy','error','stack','name','send','index','VoiceTransferReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','options','includeAll','catch','show','params','rawAttributes','include','merge','find','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xff10,0x158));var _0x0ff1=function(_0x2a0689,_0x33a348){_0x2a0689=_0x2a0689-0x0;var _0x23979e=_0xff10[_0x2a0689];return _0x23979e;};'use strict';var emlformat=require(_0x0ff1('0x0'));var rimraf=require(_0x0ff1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ff1('0x2'));var rp=require(_0x0ff1('0x3'));var moment=require(_0x0ff1('0x4'));var BPromise=require(_0x0ff1('0x5'));var Mustache=require('mustache');var util=require(_0x0ff1('0x6'));var path=require(_0x0ff1('0x7'));var sox=require(_0x0ff1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0ff1('0x9'));var _=require(_0x0ff1('0xa'));var squel=require(_0x0ff1('0xb'));var crypto=require(_0x0ff1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0ff1('0xd'));var querystring=require(_0x0ff1('0xe'));var Papa=require(_0x0ff1('0xf'));var Redis=require(_0x0ff1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0ff1('0x11'));var as=require(_0x0ff1('0x12'));var hardwareService=require(_0x0ff1('0x13'));var logger=require(_0x0ff1('0x14'))(_0x0ff1('0x15'));var utils=require(_0x0ff1('0x16'));var config=require(_0x0ff1('0x17'));var licenseUtil=require(_0x0ff1('0x18'));var db=require(_0x0ff1('0x19'))['db'];function respondWithStatusCode(_0x1003ca,_0x433dcb){_0x433dcb=_0x433dcb||0xcc;return function(_0x31853e){if(_0x31853e){return _0x1003ca[_0x0ff1('0x1a')](_0x433dcb);}return _0x1003ca[_0x0ff1('0x1b')](_0x433dcb)[_0x0ff1('0x1c')]();};}function respondWithResult(_0x4d68bf,_0x380875){_0x380875=_0x380875||0xc8;return function(_0x2cb667){if(_0x2cb667){return _0x4d68bf['status'](_0x380875)[_0x0ff1('0x1d')](_0x2cb667);}};}function respondWithFilteredResult(_0x90ce99,_0x4fd7f6){return function(_0x5f9b7c){if(_0x5f9b7c){var _0x271adb=typeof _0x4fd7f6[_0x0ff1('0x1e')]==='undefined'&&typeof _0x4fd7f6[_0x0ff1('0x1f')]==='undefined';var _0x147617=_0x5f9b7c[_0x0ff1('0x20')];var _0x77769=_0x271adb?0x0:_0x4fd7f6[_0x0ff1('0x1e')];var _0x2e3d70=_0x271adb?_0x5f9b7c['count']:_0x4fd7f6[_0x0ff1('0x1e')]+_0x4fd7f6['limit'];var _0x14d193;if(_0x2e3d70>=_0x147617){_0x2e3d70=_0x147617;_0x14d193=0xc8;}else{_0x14d193=0xce;}_0x90ce99[_0x0ff1('0x1b')](_0x14d193);return _0x90ce99[_0x0ff1('0x21')](_0x0ff1('0x22'),_0x77769+'-'+_0x2e3d70+'/'+_0x147617)[_0x0ff1('0x1d')](_0x5f9b7c);}return null;};}function patchUpdates(_0x4f46ed){return function(_0x4300a1){try{jsonpatch[_0x0ff1('0x23')](_0x4300a1,_0x4f46ed,!![]);}catch(_0x39c2ca){return BPromise[_0x0ff1('0x24')](_0x39c2ca);}return _0x4300a1['save']();};}function saveUpdates(_0x146ec7,_0x7ec58e){return function(_0x30bda1){if(_0x30bda1){return _0x30bda1[_0x0ff1('0x25')](_0x146ec7)[_0x0ff1('0x26')](function(_0x307693){return _0x307693;});}return null;};}function removeEntity(_0x44c0f7,_0x4c576b){return function(_0x3345ca){if(_0x3345ca){return _0x3345ca[_0x0ff1('0x27')]()[_0x0ff1('0x26')](function(){_0x44c0f7[_0x0ff1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51c8f0,_0x1786e0){return function(_0x33d58a){if(!_0x33d58a){_0x51c8f0[_0x0ff1('0x1a')](0x194);}return _0x33d58a;};}function handleError(_0x338247,_0x4a0710){_0x4a0710=_0x4a0710||0x1f4;return function(_0x4adf14){logger[_0x0ff1('0x28')](_0x4adf14[_0x0ff1('0x29')]);if(_0x4adf14[_0x0ff1('0x2a')]){delete _0x4adf14['name'];}_0x338247[_0x0ff1('0x1b')](_0x4a0710)[_0x0ff1('0x2b')](_0x4adf14);};}exports[_0x0ff1('0x2c')]=function(_0x5c42f6,_0x4c0b84){var _0x18db10={},_0xf547c2={},_0x12ae2f={'count':0x0,'rows':[]};var _0x2a3596=_['map'](db[_0x0ff1('0x2d')]['rawAttributes'],function(_0x3eeb69){return{'name':_0x3eeb69[_0x0ff1('0x2e')],'type':_0x3eeb69[_0x0ff1('0x2f')][_0x0ff1('0x30')]};});_0xf547c2[_0x0ff1('0x31')]=_[_0x0ff1('0x32')](_0x2a3596,_0x0ff1('0x2a'));_0xf547c2[_0x0ff1('0x33')]=_[_0x0ff1('0x34')](_0x5c42f6[_0x0ff1('0x33')]);_0xf547c2[_0x0ff1('0x35')]=_[_0x0ff1('0x36')](_0xf547c2[_0x0ff1('0x31')],_0xf547c2[_0x0ff1('0x33')]);_0x18db10[_0x0ff1('0x37')]=_[_0x0ff1('0x36')](_0xf547c2['model'],qs[_0x0ff1('0x38')](_0x5c42f6[_0x0ff1('0x33')]['fields']));_0x18db10[_0x0ff1('0x37')]=_0x18db10[_0x0ff1('0x37')][_0x0ff1('0x39')]?_0x18db10[_0x0ff1('0x37')]:_0xf547c2['model'];if(!_0x5c42f6[_0x0ff1('0x33')][_0x0ff1('0x3a')](_0x0ff1('0x3b'))){_0x18db10[_0x0ff1('0x1f')]=qs[_0x0ff1('0x1f')](_0x5c42f6[_0x0ff1('0x33')][_0x0ff1('0x1f')]);_0x18db10['offset']=qs[_0x0ff1('0x1e')](_0x5c42f6[_0x0ff1('0x33')]['offset']);}_0x18db10[_0x0ff1('0x3c')]=qs[_0x0ff1('0x3d')](_0x5c42f6['query'][_0x0ff1('0x3d')]);_0x18db10['where']=qs[_0x0ff1('0x35')](_[_0x0ff1('0x3e')](_0x5c42f6[_0x0ff1('0x33')],_0xf547c2[_0x0ff1('0x35')]),_0x2a3596);if(_0x5c42f6[_0x0ff1('0x33')][_0x0ff1('0x3f')]){_0x18db10['where']=_['merge'](_0x18db10[_0x0ff1('0x40')],{'$or':_[_0x0ff1('0x32')](_0x2a3596,function(_0x10b6c2){if(_0x10b6c2[_0x0ff1('0x2f')]!=='VIRTUAL'){var _0x3917ca={};_0x3917ca[_0x10b6c2[_0x0ff1('0x2a')]]={'$like':'%'+_0x5c42f6[_0x0ff1('0x33')][_0x0ff1('0x3f')]+'%'};return _0x3917ca;}})});}_0x18db10=_['merge']({},_0x18db10,_0x5c42f6[_0x0ff1('0x41')]);var _0x2ee924={'where':_0x18db10[_0x0ff1('0x40')]};return db[_0x0ff1('0x2d')][_0x0ff1('0x20')](_0x2ee924)[_0x0ff1('0x26')](function(_0x549069){_0x12ae2f[_0x0ff1('0x20')]=_0x549069;if(_0x5c42f6[_0x0ff1('0x33')][_0x0ff1('0x42')]){_0x18db10['include']=[{'all':!![]}];}return db[_0x0ff1('0x2d')]['findAll'](_0x18db10);})['then'](function(_0x21c5e6){_0x12ae2f['rows']=_0x21c5e6;return _0x12ae2f;})['then'](respondWithFilteredResult(_0x4c0b84,_0x18db10))[_0x0ff1('0x43')](handleError(_0x4c0b84,null));};exports[_0x0ff1('0x44')]=function(_0x5df797,_0x4d14db){var _0xc750b5={'raw':!![],'where':{'id':_0x5df797[_0x0ff1('0x45')]['id']}},_0x554a3c={};_0x554a3c[_0x0ff1('0x31')]=_[_0x0ff1('0x34')](db[_0x0ff1('0x2d')][_0x0ff1('0x46')]);_0x554a3c['query']=_[_0x0ff1('0x34')](_0x5df797[_0x0ff1('0x33')]);_0x554a3c['filters']=_['intersection'](_0x554a3c[_0x0ff1('0x31')],_0x554a3c[_0x0ff1('0x33')]);_0xc750b5[_0x0ff1('0x37')]=_['intersection'](_0x554a3c[_0x0ff1('0x31')],qs[_0x0ff1('0x38')](_0x5df797['query'][_0x0ff1('0x38')]));_0xc750b5['attributes']=_0xc750b5[_0x0ff1('0x37')][_0x0ff1('0x39')]?_0xc750b5[_0x0ff1('0x37')]:_0x554a3c['model'];if(_0x5df797[_0x0ff1('0x33')][_0x0ff1('0x42')]){_0xc750b5[_0x0ff1('0x47')]=[{'all':!![]}];}_0xc750b5=_[_0x0ff1('0x48')]({},_0xc750b5,_0x5df797[_0x0ff1('0x41')]);return db[_0x0ff1('0x2d')][_0x0ff1('0x49')](_0xc750b5)[_0x0ff1('0x26')](handleEntityNotFound(_0x4d14db,null))['then'](respondWithResult(_0x4d14db,null))[_0x0ff1('0x43')](handleError(_0x4d14db,null));};exports['create']=function(_0x55f596,_0x4f2ed3){return db[_0x0ff1('0x2d')]['create'](_0x55f596[_0x0ff1('0x4a')],{})[_0x0ff1('0x26')](respondWithResult(_0x4f2ed3,0xc9))[_0x0ff1('0x43')](handleError(_0x4f2ed3,null));};exports[_0x0ff1('0x25')]=function(_0x5c2603,_0x13b15a){if(_0x5c2603[_0x0ff1('0x4a')]['id']){delete _0x5c2603[_0x0ff1('0x4a')]['id'];}return db[_0x0ff1('0x2d')][_0x0ff1('0x49')]({'where':{'id':_0x5c2603[_0x0ff1('0x45')]['id']}})['then'](handleEntityNotFound(_0x13b15a,null))[_0x0ff1('0x26')](saveUpdates(_0x5c2603[_0x0ff1('0x4a')],null))['then'](respondWithResult(_0x13b15a,null))['catch'](handleError(_0x13b15a,null));};exports['destroy']=function(_0x4d9e2e,_0x2e4948){return db[_0x0ff1('0x2d')][_0x0ff1('0x49')]({'where':{'id':_0x4d9e2e[_0x0ff1('0x45')]['id']}})[_0x0ff1('0x26')](handleEntityNotFound(_0x2e4948,null))['then'](removeEntity(_0x2e4948,null))['catch'](handleError(_0x2e4948,null));};exports[_0x0ff1('0x4b')]=function(_0x12ca06,_0x6f9a6e){return db[_0x0ff1('0x2d')]['describe']()[_0x0ff1('0x26')](respondWithResult(_0x6f9a6e,null))[_0x0ff1('0x43')](handleError(_0x6f9a6e,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 8bdcd99..575f3a7 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 _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 +var _0xf0a9=['rimraf','../../config/environment','./voiceTransferReport.attributes','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0xe86179,_0x2cd072){var _0x285061=function(_0x5e88d9){while(--_0x5e88d9){_0xe86179['push'](_0xe86179['shift']());}};_0x285061(++_0x2cd072);}(_0xf0a9,0xc6));var _0x9f0a=function(_0x2f40b4,_0x3140c9){_0x2f40b4=_0x2f40b4-0x0;var _0x10c745=_0xf0a9[_0x2f40b4];return _0x10c745;};'use strict';var _=require(_0x9f0a('0x0'));var util=require(_0x9f0a('0x1'));var logger=require(_0x9f0a('0x2'))('api');var moment=require(_0x9f0a('0x3'));var BPromise=require(_0x9f0a('0x4'));var rp=require(_0x9f0a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f0a('0x6'));var config=require(_0x9f0a('0x7'));var attributes=require(_0x9f0a('0x8'));module['exports']=function(_0x5e659f,_0x1ed58a){return _0x5e659f[_0x9f0a('0x9')](_0x9f0a('0xa'),attributes,{'tableName':_0x9f0a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index c45707b..4a11005 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 _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 +var _0x1a73=['request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','VoiceTransferReport','create','options','raw','CreateVoiceTransferReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2b7577,_0x422c99){var _0x1a7c9b=function(_0x386a67){while(--_0x386a67){_0x2b7577['push'](_0x2b7577['shift']());}};_0x1a7c9b(++_0x422c99);}(_0x1a73,0xeb));var _0x31a7=function(_0xace0af,_0x3a8558){_0xace0af=_0xace0af-0x0;var _0xe6ddb8=_0x1a73[_0xace0af];return _0xe6ddb8;};'use strict';var _=require(_0x31a7('0x0'));var util=require(_0x31a7('0x1'));var moment=require(_0x31a7('0x2'));var BPromise=require(_0x31a7('0x3'));var rs=require(_0x31a7('0x4'));var fs=require('fs');var Redis=require(_0x31a7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x31a7('0x6'));var logger=require(_0x31a7('0x7'))(_0x31a7('0x8'));var config=require(_0x31a7('0x9'));var jayson=require(_0x31a7('0xa'));var client=jayson[_0x31a7('0xb')][_0x31a7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xda023a,_0x170c27,_0xc6704f){return new BPromise(function(_0x50d419,_0x307210){return client[_0x31a7('0xd')](_0xda023a,_0xc6704f)[_0x31a7('0xe')](function(_0x1c3eb9){logger[_0x31a7('0xf')](_0x31a7('0x10'),_0x170c27,'request\x20sent');logger[_0x31a7('0x11')](_0x31a7('0x12'),_0x170c27,_0x31a7('0x13'),JSON['stringify'](_0x1c3eb9));if(_0x1c3eb9['error']){if(_0x1c3eb9[_0x31a7('0x14')][_0x31a7('0x15')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x170c27,_0x1c3eb9['error'][_0x31a7('0x16')]);return _0x307210(_0x1c3eb9[_0x31a7('0x14')]['message']);}logger[_0x31a7('0x14')](_0x31a7('0x10'),_0x170c27,_0x1c3eb9['error'][_0x31a7('0x16')]);return _0x50d419(_0x1c3eb9[_0x31a7('0x14')][_0x31a7('0x16')]);}else{logger[_0x31a7('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x170c27,'request\x20sent');_0x50d419(_0x1c3eb9[_0x31a7('0x17')]['message']);}})[_0x31a7('0x18')](function(_0x5af955){logger[_0x31a7('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x170c27,_0x5af955);_0x307210(_0x5af955);});});}exports['CreateVoiceTransferReport']=function(_0x99703a){var _0x5e7457=this;return new Promise(function(_0x4433a9,_0x550c46){return db[_0x31a7('0x19')][_0x31a7('0x1a')](_0x99703a['body'],{'raw':_0x99703a[_0x31a7('0x1b')]?_0x99703a['options'][_0x31a7('0x1c')]===undefined?!![]:![]:!![]})[_0x31a7('0xe')](function(_0x241ea5){logger[_0x31a7('0xf')](_0x31a7('0x1d'),_0x99703a);logger[_0x31a7('0x11')](_0x31a7('0x1d'),_0x99703a,JSON[_0x31a7('0x1e')](_0x241ea5));_0x4433a9(_0x241ea5);})['catch'](function(_0x23b7ba){logger['error'](_0x31a7('0x1d'),_0x23b7ba[_0x31a7('0x16')],_0x99703a);_0x550c46(_0x5e7457[_0x31a7('0x14')](0x1f4,_0x23b7ba[_0x31a7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index dd2ed01..923cb3f 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 _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 +var _0x0bb5=['unhold','/calls','calls','/transfer','exports','express','Router','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','/answer','/hold','hold','/unhold'];(function(_0xfbaeb5,_0x52b139){var _0x3a86e9=function(_0x23bc3d){while(--_0x23bc3d){_0xfbaeb5['push'](_0xfbaeb5['shift']());}};_0x3a86e9(++_0x52b139);}(_0x0bb5,0x148));var _0x50bb=function(_0x89e262,_0x210fd6){_0x89e262=_0x89e262-0x0;var _0x31e464=_0x0bb5[_0x89e262];return _0x31e464;};'use strict';var express=require(_0x50bb('0x0'));var router=express[_0x50bb('0x1')]();var auth=require('../../components/auth/service');var controller=require('./webbar.controller');router[_0x50bb('0x2')](_0x50bb('0x3'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0x6')]);router[_0x50bb('0x2')](_0x50bb('0x7'),auth[_0x50bb('0x4')](),auth['isWebrtcLicence'](),controller['hangup']);router[_0x50bb('0x2')](_0x50bb('0x8'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller['answer']);router['post'](_0x50bb('0x9'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0xa')]);router['post'](_0x50bb('0xb'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0xc')]);router[_0x50bb('0x2')](_0x50bb('0xd'),auth[_0x50bb('0x4')](),auth['isWebrtcLicence'](),controller[_0x50bb('0xe')]);router['post'](_0x50bb('0xf'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller['transfer']);module[_0x50bb('0x10')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index b43c44f..6fac37c 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 _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 +var _0x750a=['hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls\x20fired:','UserId','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','number','string','callNumber\x20is\x20required','sessionId\x20is\x20required','userId\x20is\x20required','emit','log','error','name','send','NotFound','code','message','result','catch','User','findOne','agent','then','all','filter','rows','sessionId','sessionId\x20','\x20not\x20found!','info','originate\x20fired:','body','validate','status','userId','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate','json','hangup','hangup\x20fired:','length','webbar:hangup','answer\x20fired:','entityFound:','webbar:answer','answer\x20executed!','hold'];(function(_0x400cd1,_0x1d7a4f){var _0x53fcbd=function(_0x5415b1){while(--_0x5415b1){_0x400cd1['push'](_0x400cd1['shift']());}};_0x53fcbd(++_0x1d7a4f);}(_0x750a,0x140));var _0xa750=function(_0x1291a2,_0x48fdb9){_0x1291a2=_0x1291a2-0x0;var _0x5e70f2=_0x750a[_0x1291a2];return _0x5e70f2;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0xa750('0x0'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0xa750('0x1'));var BPromise=require(_0xa750('0x2'));var jayson=require(_0xa750('0x3'));var amiClient=jayson[_0xa750('0x4')][_0xa750('0x5')]({'port':0x232a});var logger=require(_0xa750('0x6'))(_0xa750('0x7'));var Redis=require(_0xa750('0x8'));config[_0xa750('0x9')]=_[_0xa750('0xa')](config[_0xa750('0x9')],{'host':_0xa750('0xb'),'port':0x18eb});var io=require(_0xa750('0xc'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xa750('0xd'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xa750('0xe'),'required':[!![],_0xa750('0xf')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xa750('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0xa750('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xa750('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa750('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xa750('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa750('0xe'),'required':[!![],_0xa750('0x10')]},'transferNumber':{'type':_0xa750('0xe'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xa750('0xd'),'required':[!![],_0xa750('0x11')]},'sessionId':{'type':_0xa750('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xa750('0xd'),'required':[!![],_0xa750('0x11')]},'sessionId':{'type':_0xa750('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa750('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0xa750('0xd'),'required':[!![],_0xa750('0x11')]}});function emit(_0x49fe3b,_0x337095,_0x29480c){logger['info'](_0x49fe3b,_0x337095,JSON['stringify'](_0x29480c));io['to'](_0x49fe3b)[_0xa750('0x12')](_0x337095,_0x29480c);}function handleError(_0x5b1e6b){return function(_0x433dbd){console[_0xa750('0x13')]('handleError:',_0x433dbd,_0x433dbd instanceof RangeError);logger[_0xa750('0x14')](_0x433dbd['stack']);if(_0x433dbd instanceof RangeError){if(_0x433dbd['name']){delete _0x433dbd[_0xa750('0x15')];}_0x5b1e6b['status'](0x194)[_0xa750('0x16')](_0x433dbd);}else{if(_0x433dbd['name']){delete _0x433dbd[_0xa750('0x15')];}_0x5b1e6b['status'](0x1f4)[_0xa750('0x16')](_0x433dbd);}};}function checkError(){return function(_0x500922){if(!_0x500922){throw new RangeError(_0xa750('0x17'));}return _0x500922;};}function respondWithRpcPromise(_0x4d1939,_0x52f166){return new BPromise(function(_0xaa9d3e,_0x52da84){var _0x216fbf=amiClient;return _0x216fbf['request'](_0x4d1939,_0x52f166)['then'](function(_0x5b433d){if(_0x5b433d['error']){if(_0x5b433d[_0xa750('0x14')][_0xa750('0x18')]===0x1f4){return _0x52da84(_0x5b433d[_0xa750('0x14')][_0xa750('0x19')]);}return _0xaa9d3e(_0x5b433d[_0xa750('0x14')][_0xa750('0x19')]);}else{_0xaa9d3e(_0x5b433d[_0xa750('0x1a')]);}})[_0xa750('0x1b')](function(_0x3d52b3){_0x52da84(_0x3d52b3);});});}function getAgent(_0x94697a){return db[_0xa750('0x1c')][_0xa750('0x1d')]({'where':{'id':_0x94697a,'role':_0xa750('0x1e')}})[_0xa750('0x1f')](checkError());}function getAgentCheckSession(_0x310e2d,_0x4ffff4){return new BPromise(function(_0x3d3923,_0x35dfc9){var _0x21cd2c=respondWithRpcPromise('VoiceChannels');var _0x35ab53=getAgent(_0x310e2d);Promise[_0xa750('0x20')]([_0x21cd2c,_0x35ab53])[_0xa750('0x1f')](function(_0x1223d2){var _0x579f1c=_0x1223d2[0x0];var _0x297eef=_0x1223d2[0x1];var _0x34d5e9=_[_0xa750('0x21')](_0x579f1c[_0xa750('0x22')],function(_0x2c5253){return _0x2c5253['UserId']==_0x297eef['id']&&_0x2c5253[_0xa750('0x23')]==_0x4ffff4;});if(_0x34d5e9['length']==0x1){_0x3d3923(_0x297eef);}else{_0x35dfc9(new RangeError(_0xa750('0x24')+_0x4ffff4+_0xa750('0x25')));}});});}exports['originate']=function(_0x8b5c2d,_0x6bc25d){logger[_0xa750('0x26')](_0xa750('0x27'),_0x8b5c2d[_0xa750('0x28')]);var _0xe59fe7=originateValidation[_0xa750('0x29')](_0x8b5c2d[_0xa750('0x28')]);if(_0xe59fe7['length']>0x0){return _0x6bc25d[_0xa750('0x2a')](0x190)['json'](_0xe59fe7);}var _0x18d040=_0x8b5c2d[_0xa750('0x28')][_0xa750('0x2b')];var _0x13465a=_0x8b5c2d['body'][_0xa750('0x2c')];var _0xa700fd=_0x8b5c2d['body'][_0xa750('0x2d')];var _0x330710=_0x8b5c2d[_0xa750('0x28')][_0xa750('0x2e')];return getAgent(_0x18d040)['then'](function(_0xf60128){logger['info']('entityFound:',_0xf60128[_0xa750('0x15')]);emit(util[_0xa750('0x2f')](_0xa750('0x30'),_0xf60128['name']),_0xa750('0x31'),{'callNumber':_0x13465a,'callerId':_0xa700fd,'callbackUrl':_0x330710});return _0x6bc25d[_0xa750('0x2a')](0xc8)[_0xa750('0x32')]({'error':![],'message':'originate\x20executed!'});})[_0xa750('0x1b')](handleError(_0x6bc25d));};exports[_0xa750('0x33')]=function(_0x3f3c41,_0x5d402a){logger[_0xa750('0x26')](_0xa750('0x34'),_0x3f3c41[_0xa750('0x28')]);var _0x4b6438=hangupValidation[_0xa750('0x29')](_0x3f3c41[_0xa750('0x28')]);if(_0x4b6438[_0xa750('0x35')]>0x0){return _0x5d402a[_0xa750('0x2a')](0x190)['json'](_0x4b6438);}var _0x4dc0b8=_0x3f3c41[_0xa750('0x28')][_0xa750('0x2b')];var _0x4c614d=_0x3f3c41[_0xa750('0x28')][_0xa750('0x23')];return getAgent(_0x4dc0b8)[_0xa750('0x1f')](function(_0x1166ff){logger[_0xa750('0x26')]('entityFound:',_0x1166ff[_0xa750('0x15')]);emit(util[_0xa750('0x2f')](_0xa750('0x30'),_0x1166ff[_0xa750('0x15')]),_0xa750('0x36'),{'sessionId':_0x4c614d});return _0x5d402a[_0xa750('0x2a')](0xc8)[_0xa750('0x32')]({'error':![],'message':'hangup\x20executed!'});})[_0xa750('0x1b')](handleError(_0x5d402a));};exports['answer']=function(_0x214fa0,_0x4ab922){logger[_0xa750('0x26')](_0xa750('0x37'),_0x214fa0[_0xa750('0x28')]);var _0x1be24e=answerValidation[_0xa750('0x29')](_0x214fa0[_0xa750('0x28')]);if(_0x1be24e[_0xa750('0x35')]>0x0){return _0x4ab922[_0xa750('0x2a')](0x190)[_0xa750('0x32')](_0x1be24e);}var _0x108a1a=_0x214fa0[_0xa750('0x28')][_0xa750('0x2b')];var _0x3ec860=_0x214fa0[_0xa750('0x28')][_0xa750('0x23')];return getAgent(_0x108a1a)[_0xa750('0x1f')](function(_0x25b82c){logger[_0xa750('0x26')](_0xa750('0x38'),_0x25b82c[_0xa750('0x15')]);emit(util['format'](_0xa750('0x30'),_0x25b82c[_0xa750('0x15')]),_0xa750('0x39'),{'sessionId':_0x3ec860});return _0x4ab922[_0xa750('0x2a')](0xc8)[_0xa750('0x32')]({'error':![],'message':_0xa750('0x3a')});})[_0xa750('0x1b')](handleError(_0x4ab922));};exports[_0xa750('0x3b')]=function(_0x3534b1,_0x5635b9){logger[_0xa750('0x26')](_0xa750('0x3c'),_0x3534b1['body']);var _0xb7d7e=holdValidation[_0xa750('0x29')](_0x3534b1[_0xa750('0x28')]);if(_0xb7d7e[_0xa750('0x35')]>0x0){return _0x5635b9[_0xa750('0x2a')](0x190)[_0xa750('0x32')](_0xb7d7e);}var _0x5e7a95=_0x3534b1[_0xa750('0x28')][_0xa750('0x2b')];var _0x6cd49f=_0x3534b1['body'][_0xa750('0x23')];return getAgent(_0x5e7a95)[_0xa750('0x1f')](function(_0x58afd2){logger[_0xa750('0x26')](_0xa750('0x38'),_0x58afd2[_0xa750('0x15')]);emit(util['format'](_0xa750('0x30'),_0x58afd2[_0xa750('0x15')]),_0xa750('0x3d'),{'sessionId':_0x6cd49f});return _0x5635b9[_0xa750('0x2a')](0xc8)['json']({'error':![],'message':_0xa750('0x3e')});})[_0xa750('0x1b')](handleError(_0x5635b9));};exports[_0xa750('0x3f')]=function(_0xed4f88,_0x4ce363){logger[_0xa750('0x26')](_0xa750('0x40'),_0xed4f88['body']);var _0x38aa35=unholdValidation['validate'](_0xed4f88[_0xa750('0x28')]);if(_0x38aa35[_0xa750('0x35')]>0x0){return _0x4ce363['status'](0x190)['json'](_0x38aa35);}var _0x58eba1=_0xed4f88[_0xa750('0x28')][_0xa750('0x2b')];var _0x4ea12b=_0xed4f88[_0xa750('0x28')][_0xa750('0x23')];return getAgent(_0x58eba1)[_0xa750('0x1f')](function(_0x5e69ea){logger['info']('entityFound:',_0x5e69ea['name']);emit(util[_0xa750('0x2f')]('user:%s',_0x5e69ea[_0xa750('0x15')]),_0xa750('0x41'),{'sessionId':_0x4ea12b});return _0x4ce363['status'](0xc8)[_0xa750('0x32')]({'error':![],'message':'unhold\x20executed!'});})[_0xa750('0x1b')](handleError(_0x4ce363));};exports['calls']=function(_0x54788d,_0x5940be){logger['info'](_0xa750('0x42'),_0x5940be[_0xa750('0x28')]);var _0x5f1313=callsValidation['validate'](_0x54788d['body']);if(_0x5f1313[_0xa750('0x35')]>0x0){return _0x5940be[_0xa750('0x2a')](0x190)[_0xa750('0x32')](_0x5f1313);}var _0x45a7da=_0x54788d[_0xa750('0x28')][_0xa750('0x2b')];var _0x599e7e=respondWithRpcPromise('VoiceChannels');var _0x440975=getAgent(_0x45a7da);return Promise[_0xa750('0x20')]([_0x599e7e,_0x440975])[_0xa750('0x1f')](function(_0x11163d){var _0xa8fe=_0x11163d[0x0];var _0x5a3cd5=_0x11163d[0x1];var _0x4030b3=_[_0xa750('0x21')](_0xa8fe[_0xa750('0x22')],function(_0x16b826){return _0x16b826[_0xa750('0x43')]==_0x5a3cd5['id'];});return _0x5940be[_0xa750('0x2a')](0xc8)[_0xa750('0x32')]({'count':_0x4030b3[_0xa750('0x35')],'rows':_0x4030b3});})['catch'](handleError(_0x5940be));};exports[_0xa750('0x44')]=function(_0x1c7713,_0x130297){logger[_0xa750('0x26')](_0xa750('0x45'),_0x1c7713['body']);var _0xcad347=conferenceValidation[_0xa750('0x29')](_0x1c7713[_0xa750('0x28')]);if(_0xcad347[_0xa750('0x35')]>0x0){return _0x130297[_0xa750('0x2a')](0x190)[_0xa750('0x32')](_0xcad347);}var _0x6053de=_0x1c7713[_0xa750('0x28')][_0xa750('0x2b')];return getAgent(_0x6053de)[_0xa750('0x1f')](function(_0x32fd6b){logger[_0xa750('0x26')](_0xa750('0x38'),_0x32fd6b[_0xa750('0x15')]);emit(util[_0xa750('0x2f')](_0xa750('0x30'),_0x32fd6b['name']),_0xa750('0x46'));return _0x130297['status'](0xc8)[_0xa750('0x32')]({'error':![],'message':_0xa750('0x47')});})[_0xa750('0x1b')](handleError(_0x130297));};exports['transfer']=function(_0x18c242,_0x2ed01a){logger[_0xa750('0x26')](_0xa750('0x48'),_0x18c242[_0xa750('0x28')]);var _0x278a58=transferValidation['validate'](_0x18c242[_0xa750('0x28')]);if(_0x278a58[_0xa750('0x35')]>0x0){return _0x2ed01a['status'](0x190)[_0xa750('0x32')](_0x278a58);}var _0x1bdc5e=_0x18c242[_0xa750('0x28')][_0xa750('0x2b')];var _0x3255c7=_0x18c242[_0xa750('0x28')][_0xa750('0x23')];var _0xc0b61b=_0x18c242[_0xa750('0x28')][_0xa750('0x49')];return getAgent(_0x1bdc5e)[_0xa750('0x1f')](function(_0x5d3ae2){logger['info'](_0xa750('0x38'),_0x5d3ae2[_0xa750('0x15')]);emit(util[_0xa750('0x2f')](_0xa750('0x30'),_0x5d3ae2['name']),_0xa750('0x4a'),{'sessionId':_0x3255c7,'transferNumber':_0xc0b61b});return _0x2ed01a[_0xa750('0x2a')](0xc8)[_0xa750('0x32')]({'error':![],'message':_0xa750('0x4b')});})[_0xa750('0x1b')](handleError(_0x2ed01a));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 2263aa0..d21d1b9 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 _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 +var _0xb016=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getApplications','addAnswer','post','addAgents','/:id/applications','addApplications','/:id/notify','notify','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','express','fs-extra','../../components/auth/service'];(function(_0x3e51ff,_0x38babe){var _0x45b5e1=function(_0x3c1008){while(--_0x3c1008){_0x3e51ff['push'](_0x3e51ff['shift']());}};_0x45b5e1(++_0x38babe);}(_0xb016,0x159));var _0x6b01=function(_0x5e9c5f,_0x4649ed){_0x5e9c5f=_0x5e9c5f-0x0;var _0x4bff58=_0xb016[_0x5e9c5f];return _0x4bff58;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b01('0x2'));var router=express['Router']();var fs_extra=require(_0x6b01('0x3'));var auth=require(_0x6b01('0x4'));var interaction=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var controller=require('./whatsappAccount.controller');router[_0x6b01('0x7')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0x9')]);router['get']('/describe',auth[_0x6b01('0x8')](),controller[_0x6b01('0xa')]);router['get']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xb')]);router[_0x6b01('0x7')](_0x6b01('0xc'),auth[_0x6b01('0x8')](),controller['getDispositions']);router['get'](_0x6b01('0xd'),auth[_0x6b01('0x8')](),controller[_0x6b01('0xe')]);router['get'](_0x6b01('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0x6b01('0x7')]('/:id/applications',auth[_0x6b01('0x8')](),controller[_0x6b01('0x10')]);router['post']('/',auth[_0x6b01('0x8')](),controller['create']);router['post']('/:id/dispositions',auth[_0x6b01('0x8')](),controller['addDisposition']);router['post'](_0x6b01('0xd'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x11')]);router[_0x6b01('0x12')](_0x6b01('0xf'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x13')]);router[_0x6b01('0x12')](_0x6b01('0x14'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x15')]);router['post'](_0x6b01('0x16'),controller[_0x6b01('0x17')]);router[_0x6b01('0x12')](_0x6b01('0x18'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x19')]);router[_0x6b01('0x1a')](_0x6b01('0x1b'),auth['isAuthenticated'](),controller[_0x6b01('0x1c')]);router[_0x6b01('0x1d')](_0x6b01('0x1b'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x1e')]);router[_0x6b01('0x1d')](_0x6b01('0xc'),auth['isAuthenticated'](),controller[_0x6b01('0x1f')]);router[_0x6b01('0x1d')](_0x6b01('0xd'),auth['isAuthenticated'](),controller[_0x6b01('0x20')]);router[_0x6b01('0x1d')](_0x6b01('0xf'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x21')]);module[_0x6b01('0x22')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 6e56c0c..ba3e1a0 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 _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 +var _0x69b0=['sequelize','exports','STRING','name','generate','ENUM','sinch','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'];(function(_0x1cc299,_0x54b849){var _0x55fa0a=function(_0x27ebc8){while(--_0x27ebc8){_0x1cc299['push'](_0x1cc299['shift']());}};_0x55fa0a(++_0x54b849);}(_0x69b0,0x1a4));var _0x069b=function(_0x3439ea,_0x3c68ba){_0x3439ea=_0x3439ea-0x0;var _0x3900a3=_0x69b0[_0x3439ea];return _0x3900a3;};'use strict';var Sequelize=require(_0x069b('0x0'));var rs=require('randomstring');module[_0x069b('0x1')]={'name':{'type':Sequelize[_0x069b('0x2')],'unique':_0x069b('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x069b('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x069b('0x2')],'defaultValue':function(){return rs[_0x069b('0x4')]();}},'phone':{'type':Sequelize[_0x069b('0x2')]},'type':{'type':Sequelize[_0x069b('0x5')]('twilio',_0x069b('0x6'))},'accountSid':{'type':Sequelize[_0x069b('0x2')]},'baseUrl':{'type':Sequelize[_0x069b('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x069b('0x7');}},'notificationSound':{'type':Sequelize[_0x069b('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x069b('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x069b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x069b('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x069b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x069b('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x069b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x069b('0x9')],'comment':_0x069b('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x069b('0x8')],'defaultValue':![],'comment':_0x069b('0xb'),'set':function(_0x50f2d9){if(!_0x50f2d9){this[_0x069b('0xc')](_0x069b('0xd'),null);}this['setDataValue'](_0x069b('0xe'),_0x50f2d9);}},'description':{'type':Sequelize[_0x069b('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index d22defc..0b43d1d 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 _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 +var _0x937f=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','debug','request\x20sent','stringify','code','WhatsappAccount,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','then','get','WhatsappAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','nolimit','pick','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','stack','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','WhatsappMessage','timestamp','message_id','applications','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','replace','whatsapp:','Body','messageId','MessageSid','from','notifications','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','startRouting','Start','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x264183,_0x5b8e62){var _0x1f9e19=function(_0x4e25e7){while(--_0x4e25e7){_0x264183['push'](_0x264183['shift']());}};_0x1f9e19(++_0x5b8e62);}(_0x937f,0x187));var _0xf937=function(_0x16883e,_0x154b07){_0x16883e=_0x16883e-0x0;var _0x29cd6a=_0x937f[_0x16883e];return _0x29cd6a;};'use strict';var emlformat=require(_0xf937('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf937('0x1'));var rp=require(_0xf937('0x2'));var moment=require(_0xf937('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf937('0x4'));var path=require(_0xf937('0x5'));var sox=require('sox');var csv=require(_0xf937('0x6'));var ejs=require(_0xf937('0x7'));var fs=require('fs');var fs_extra=require(_0xf937('0x8'));var _=require(_0xf937('0x9'));var squel=require(_0xf937('0xa'));var crypto=require(_0xf937('0xb'));var jsforce=require(_0xf937('0xc'));var deskjs=require(_0xf937('0xd'));var toCsv=require(_0xf937('0x6'));var querystring=require(_0xf937('0xe'));var Papa=require('papaparse');var Redis=require(_0xf937('0xf'));var authService=require(_0xf937('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf937('0x11'));var logger=require(_0xf937('0x12'))(_0xf937('0x13'));var utils=require(_0xf937('0x14'));var config=require(_0xf937('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf937('0x16'))['db'];config['redis']=_[_0xf937('0x17')](config[_0xf937('0x18')],{'host':_0xf937('0x19'),'port':0x18eb});var socket=require(_0xf937('0x1a'))(new Redis(config[_0xf937('0x18')]));require('./whatsappAccount.socket')['register'](socket);var jayson=require(_0xf937('0x1b'));var client=jayson[_0xf937('0x1c')][_0xf937('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0xccb552,_0x1c40f6,_0x547d0f,_0x2f0377){return new BPromise(function(_0x154a5e,_0x2368aa){var _0x4f26df=_0x2f0377||client;return _0x4f26df[_0xf937('0x1e')](_0xccb552,_0x547d0f)['then'](function(_0x1b9c2d){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x1c40f6,'request\x20sent');logger[_0xf937('0x1f')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1c40f6,_0xf937('0x20'),JSON[_0xf937('0x21')](_0x1b9c2d));if(_0x1b9c2d['error']){if(_0x1b9c2d['error'][_0xf937('0x22')]===0x1f4){logger['error'](_0xf937('0x23'),_0x1c40f6,_0x1b9c2d[_0xf937('0x24')][_0xf937('0x25')]);return _0x2368aa(_0x1b9c2d[_0xf937('0x24')][_0xf937('0x25')]);}logger[_0xf937('0x24')](_0xf937('0x23'),_0x1c40f6,_0x1b9c2d[_0xf937('0x24')][_0xf937('0x25')]);return _0x154a5e(_0x1b9c2d[_0xf937('0x24')][_0xf937('0x25')]);}else{logger[_0xf937('0x26')](_0xf937('0x23'),_0x1c40f6,_0xf937('0x20'));_0x154a5e(_0x1b9c2d[_0xf937('0x27')][_0xf937('0x25')]);}})[_0xf937('0x28')](function(_0xa7f99a){logger[_0xf937('0x24')](_0xf937('0x23'),_0x1c40f6,_0xa7f99a);_0x2368aa(_0xa7f99a);});});}function respondWithStatusCode(_0x17b17e,_0x30b41d){_0x30b41d=_0x30b41d||0xcc;return function(_0x3b3edf){if(_0x3b3edf){return _0x17b17e[_0xf937('0x29')](_0x30b41d);}return _0x17b17e[_0xf937('0x2a')](_0x30b41d)[_0xf937('0x2b')]();};}function respondWithResult(_0x3bf053,_0x3aa015){_0x3aa015=_0x3aa015||0xc8;return function(_0x19dd3d){if(_0x19dd3d){return _0x3bf053[_0xf937('0x2a')](_0x3aa015)['json'](_0x19dd3d);}};}function respondWithFilteredResult(_0x1d7dd8,_0x1e8ae7){return function(_0x5ecfc3){if(_0x5ecfc3){var _0x129f54=typeof _0x1e8ae7[_0xf937('0x2c')]===_0xf937('0x2d')&&typeof _0x1e8ae7[_0xf937('0x2e')]===_0xf937('0x2d');var _0x164638=_0x5ecfc3[_0xf937('0x2f')];var _0x39846a=_0x129f54?0x0:_0x1e8ae7[_0xf937('0x2c')];var _0xd6d851=_0x129f54?_0x5ecfc3[_0xf937('0x2f')]:_0x1e8ae7[_0xf937('0x2c')]+_0x1e8ae7[_0xf937('0x2e')];var _0x1dee89;if(_0xd6d851>=_0x164638){_0xd6d851=_0x164638;_0x1dee89=0xc8;}else{_0x1dee89=0xce;}_0x1d7dd8['status'](_0x1dee89);return _0x1d7dd8[_0xf937('0x30')](_0xf937('0x31'),_0x39846a+'-'+_0xd6d851+'/'+_0x164638)[_0xf937('0x32')](_0x5ecfc3);}return null;};}function patchUpdates(_0x27c4a6){return function(_0x8ce5e1){try{jsonpatch[_0xf937('0x33')](_0x8ce5e1,_0x27c4a6,!![]);}catch(_0x20e497){return BPromise['reject'](_0x20e497);}return _0x8ce5e1[_0xf937('0x34')]();};}function saveUpdates(_0x3fe6a9,_0x41eef4){return function(_0x48cc14){if(_0x48cc14){return _0x48cc14[_0xf937('0x35')](_0x3fe6a9)['then'](function(_0x5601d4){return _0x5601d4;});}return null;};}function removeEntity(_0x3cb6d3,_0xeb8619){return function(_0x4ea0f2){if(_0x4ea0f2){return _0x4ea0f2[_0xf937('0x36')]()[_0xf937('0x37')](function(){var _0x51c1f8=_0x4ea0f2[_0xf937('0x38')]({'plain':!![]});var _0x492a80=_0xf937('0x39');return db[_0xf937('0x3a')][_0xf937('0x36')]({'where':{'type':_0x492a80,'resourceId':_0x51c1f8['id']}})[_0xf937('0x37')](function(){return _0x4ea0f2;});})['then'](function(){_0x3cb6d3[_0xf937('0x2a')](0xcc)[_0xf937('0x2b')]();});}};}function handleEntityNotFound(_0x27c89f,_0x3b7687){return function(_0x18850f){if(!_0x18850f){_0x27c89f['sendStatus'](0x194);}return _0x18850f;};}function handleError(_0x584528,_0x40553a){_0x40553a=_0x40553a||0x1f4;return function(_0x39137e){logger['error'](_0x39137e['stack']);if(_0x39137e[_0xf937('0x3b')]){delete _0x39137e[_0xf937('0x3b')];}_0x584528[_0xf937('0x2a')](_0x40553a)[_0xf937('0x3c')](_0x39137e);};}exports[_0xf937('0x3d')]=function(_0x26a1a2,_0x3b2c14){var _0x2b83da={'include':[{'model':db[_0xf937('0x3e')],'as':_0xf937('0x3f')}]},_0x31ff98={},_0x311987={'count':0x0,'rows':[]};var _0x254ba0=_['map'](db[_0xf937('0x40')][_0xf937('0x41')],function(_0x2720eb){return{'name':_0x2720eb[_0xf937('0x42')],'type':_0x2720eb['type'][_0xf937('0x43')]};});_0x31ff98[_0xf937('0x44')]=_[_0xf937('0x45')](_0x254ba0,_0xf937('0x3b'));_0x31ff98[_0xf937('0x46')]=_[_0xf937('0x47')](_0x26a1a2[_0xf937('0x46')]);_0x31ff98[_0xf937('0x48')]=_['intersection'](_0x31ff98[_0xf937('0x44')],_0x31ff98['query']);_0x2b83da[_0xf937('0x49')]=_[_0xf937('0x4a')](_0x31ff98[_0xf937('0x44')],qs[_0xf937('0x4b')](_0x26a1a2[_0xf937('0x46')][_0xf937('0x4b')]));_0x2b83da[_0xf937('0x49')]=_0x2b83da[_0xf937('0x49')]['length']?_0x2b83da['attributes']:_0x31ff98[_0xf937('0x44')];if(!_0x26a1a2[_0xf937('0x46')][_0xf937('0x4c')]('nolimit')){_0x2b83da[_0xf937('0x2e')]=qs['limit'](_0x26a1a2[_0xf937('0x46')][_0xf937('0x2e')]);_0x2b83da['offset']=qs[_0xf937('0x2c')](_0x26a1a2[_0xf937('0x46')][_0xf937('0x2c')]);}_0x2b83da[_0xf937('0x4d')]=qs[_0xf937('0x4e')](_0x26a1a2[_0xf937('0x46')][_0xf937('0x4e')]);_0x2b83da[_0xf937('0x4f')]=qs[_0xf937('0x48')](_['pick'](_0x26a1a2[_0xf937('0x46')],_0x31ff98[_0xf937('0x48')]),_0x254ba0);if(_0x26a1a2[_0xf937('0x46')]['filter']){_0x2b83da[_0xf937('0x4f')]=_[_0xf937('0x50')](_0x2b83da[_0xf937('0x4f')],{'$or':_[_0xf937('0x45')](_0x254ba0,function(_0x45d98c){if(_0x45d98c[_0xf937('0x51')]!==_0xf937('0x52')){var _0x5a067a={};_0x5a067a[_0x45d98c[_0xf937('0x3b')]]={'$like':'%'+_0x26a1a2[_0xf937('0x46')][_0xf937('0x53')]+'%'};return _0x5a067a;}})});}_0x2b83da=_[_0xf937('0x50')]({},_0x2b83da,_0x26a1a2[_0xf937('0x54')]);var _0x483864={'where':_0x2b83da['where']};return db[_0xf937('0x40')][_0xf937('0x2f')](_0x483864)['then'](function(_0x922088){_0x311987['count']=_0x922088;if(_0x26a1a2[_0xf937('0x46')][_0xf937('0x55')]){_0x2b83da[_0xf937('0x56')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xf937('0x57')](_0x2b83da);})[_0xf937('0x37')](function(_0x583a75){_0x311987['rows']=_0x583a75;return _0x311987;})[_0xf937('0x37')](respondWithFilteredResult(_0x3b2c14,_0x2b83da))['catch'](handleError(_0x3b2c14,null));};exports['show']=function(_0x1ddf89,_0x40bab3){var _0x388b48={'raw':![],'where':{'id':_0x1ddf89[_0xf937('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xf937('0x3f')}]},_0x5f1f99={};_0x5f1f99['model']=_[_0xf937('0x47')](db[_0xf937('0x40')]['rawAttributes']);_0x5f1f99['query']=_[_0xf937('0x47')](_0x1ddf89['query']);_0x5f1f99['filters']=_[_0xf937('0x4a')](_0x5f1f99[_0xf937('0x44')],_0x5f1f99[_0xf937('0x46')]);_0x388b48[_0xf937('0x49')]=_[_0xf937('0x4a')](_0x5f1f99['model'],qs[_0xf937('0x4b')](_0x1ddf89[_0xf937('0x46')][_0xf937('0x4b')]));_0x388b48[_0xf937('0x49')]=_0x388b48[_0xf937('0x49')][_0xf937('0x59')]?_0x388b48[_0xf937('0x49')]:_0x5f1f99[_0xf937('0x44')];if(_0x1ddf89[_0xf937('0x46')][_0xf937('0x55')]){_0x388b48[_0xf937('0x56')]=[{'all':!![]}];}_0x388b48=_[_0xf937('0x50')]({},_0x388b48,_0x1ddf89[_0xf937('0x54')]);return db[_0xf937('0x40')][_0xf937('0x5a')](_0x388b48)[_0xf937('0x37')](handleEntityNotFound(_0x40bab3,null))[_0xf937('0x37')](respondWithResult(_0x40bab3,null))['catch'](handleError(_0x40bab3,null));};exports['create']=function(_0x45c835,_0x3e1b5b){return db[_0xf937('0x40')][_0xf937('0x5b')](_0x45c835[_0xf937('0x5c')],{})[_0xf937('0x37')](function(_0x24346e){var _0x44032d=_0x45c835[_0xf937('0x5d')][_0xf937('0x38')]({'plain':!![]});if(!_0x44032d)throw new Error(_0xf937('0x5e'));if(_0x44032d[_0xf937('0x5f')]===_0xf937('0x5d')){var _0x49a28f=_0x24346e[_0xf937('0x38')]({'plain':!![]});var _0x479d28=_0xf937('0x39');return db[_0xf937('0x60')]['find']({'where':{'name':_0x479d28,'userProfileId':_0x44032d[_0xf937('0x61')]},'raw':!![]})[_0xf937('0x37')](function(_0x35993a){if(_0x35993a&&_0x35993a['autoAssociation']===0x0){return db['UserProfileResource'][_0xf937('0x5b')]({'name':_0x49a28f[_0xf937('0x3b')],'resourceId':_0x49a28f['id'],'type':_0x35993a['name'],'sectionId':_0x35993a['id']},{})[_0xf937('0x37')](function(){return _0x24346e;});}else{return _0x24346e;}})[_0xf937('0x28')](function(_0x261309){logger[_0xf937('0x24')](_0xf937('0x62'),_0x261309);throw _0x261309;});}return _0x24346e;})[_0xf937('0x37')](respondWithResult(_0x3e1b5b,0xc9))[_0xf937('0x28')](handleError(_0x3e1b5b,null));};exports[_0xf937('0x35')]=function(_0xfd1f97,_0x41c8f4){if(_0xfd1f97[_0xf937('0x5c')]['id']){delete _0xfd1f97[_0xf937('0x5c')]['id'];}return db[_0xf937('0x40')][_0xf937('0x5a')]({'where':{'id':_0xfd1f97['params']['id']},'include':[{'model':db[_0xf937('0x3e')],'as':'mandatoryDispositionPause'}]})[_0xf937('0x37')](handleEntityNotFound(_0x41c8f4,null))[_0xf937('0x37')](saveUpdates(_0xfd1f97['body'],null))[_0xf937('0x37')](respondWithResult(_0x41c8f4,null))[_0xf937('0x28')](handleError(_0x41c8f4,null));};exports[_0xf937('0x36')]=function(_0x34f3a9,_0x53a2d1){return db[_0xf937('0x40')][_0xf937('0x5a')]({'where':{'id':_0x34f3a9['params']['id']}})[_0xf937('0x37')](handleEntityNotFound(_0x53a2d1,null))[_0xf937('0x37')](removeEntity(_0x53a2d1,null))['catch'](handleError(_0x53a2d1,null));};exports[_0xf937('0x63')]=function(_0x4cda23,_0x5101aa){return db[_0xf937('0x40')][_0xf937('0x63')]()[_0xf937('0x37')](respondWithResult(_0x5101aa,null))[_0xf937('0x28')](handleError(_0x5101aa,null));};exports[_0xf937('0x64')]=function(_0xfb991f,_0xfa84b,_0x5dcd1d){if(_0xfb991f['body']['id']){delete _0xfb991f['body']['id'];}return db[_0xf937('0x40')]['find']({'where':{'id':_0xfb991f[_0xf937('0x58')]['id']}})[_0xf937('0x37')](handleEntityNotFound(_0xfa84b,null))[_0xf937('0x37')](function(_0x3cc356){if(_0x3cc356){_0xfb991f[_0xf937('0x5c')][_0xf937('0x65')]=_0x3cc356['id'];return db['Disposition'][_0xf937('0x5b')](_0xfb991f[_0xf937('0x5c')]);}})[_0xf937('0x37')](respondWithResult(_0xfa84b,null))['catch'](handleError(_0xfa84b,null));};exports['getDispositions']=function(_0x420331,_0x1d47ad,_0x236ed9){var _0xfb0398={'raw':![],'where':{}};var _0x45b068={};var _0x2a7c7e={'count':0x0,'rows':[]};return db[_0xf937('0x40')]['findOne']({'where':{'id':_0x420331[_0xf937('0x58')]['id']}})[_0xf937('0x37')](handleEntityNotFound(_0x1d47ad,null))[_0xf937('0x37')](function(_0x35377a){if(_0x35377a){_0x45b068['model']=_['keys'](db[_0xf937('0x66')][_0xf937('0x41')]);_0x45b068[_0xf937('0x46')]=_[_0xf937('0x47')](_0x420331['query']);_0x45b068[_0xf937('0x48')]=_[_0xf937('0x4a')](_0x45b068[_0xf937('0x44')],_0x45b068['query']);_0xfb0398['attributes']=_[_0xf937('0x4a')](_0x45b068[_0xf937('0x44')],qs[_0xf937('0x4b')](_0x420331[_0xf937('0x46')][_0xf937('0x4b')]));_0xfb0398['attributes']=_0xfb0398['attributes'][_0xf937('0x59')]?_0xfb0398['attributes']:_0x45b068['model'];if(!_0x420331[_0xf937('0x46')][_0xf937('0x4c')](_0xf937('0x67'))){_0xfb0398[_0xf937('0x2e')]=qs['limit'](_0x420331[_0xf937('0x46')][_0xf937('0x2e')]);_0xfb0398[_0xf937('0x2c')]=qs[_0xf937('0x2c')](_0x420331[_0xf937('0x46')][_0xf937('0x2c')]);}_0xfb0398[_0xf937('0x4d')]=qs['sort'](_0x420331['query'][_0xf937('0x4e')]);_0xfb0398[_0xf937('0x4f')]=qs['filters'](_[_0xf937('0x68')](_0x420331[_0xf937('0x46')],_0x45b068[_0xf937('0x48')]));_0xfb0398[_0xf937('0x4f')][_0xf937('0x65')]=_0x35377a['id'];if(_0x420331[_0xf937('0x46')][_0xf937('0x53')]){_0xfb0398['where']=_[_0xf937('0x50')](_0xfb0398[_0xf937('0x4f')],{'$or':_['map'](_0xfb0398[_0xf937('0x49')],function(_0x549507){var _0x5f5715={};_0x5f5715[_0x549507]={'$like':'%'+_0x420331['query']['filter']+'%'};return _0x5f5715;})});}_0xfb0398=_[_0xf937('0x50')]({},_0xfb0398,_0x420331[_0xf937('0x54')]);return db[_0xf937('0x66')][_0xf937('0x2f')]({'where':_0xfb0398['where']})[_0xf937('0x37')](function(_0x3d176e){_0x2a7c7e[_0xf937('0x2f')]=_0x3d176e;if(_0x420331[_0xf937('0x46')][_0xf937('0x55')]){_0xfb0398[_0xf937('0x56')]=[{'all':!![]}];}return db[_0xf937('0x66')][_0xf937('0x57')](_0xfb0398);})[_0xf937('0x37')](function(_0x1731bf){_0x2a7c7e[_0xf937('0x69')]=_0x1731bf;return _0x2a7c7e;});}})[_0xf937('0x37')](respondWithFilteredResult(_0x1d47ad,_0xfb0398))[_0xf937('0x28')](handleError(_0x1d47ad,null));};exports[_0xf937('0x6a')]=function(_0x5ddcd4,_0x4f248a,_0x2b2756){return db[_0xf937('0x40')][_0xf937('0x5a')]({'where':{'id':_0x5ddcd4['params']['id']}})[_0xf937('0x37')](handleEntityNotFound(_0x4f248a,null))[_0xf937('0x37')](function(_0x6ceec4){if(_0x6ceec4){return _0x6ceec4[_0xf937('0x6a')](_0x5ddcd4['query'][_0xf937('0x6b')]);}})['then'](respondWithStatusCode(_0x4f248a,null))[_0xf937('0x28')](handleError(_0x4f248a,null));};exports[_0xf937('0x6c')]=function(_0x470f29,_0x551604,_0x147f82){if(_0x470f29[_0xf937('0x5c')]['id']){delete _0x470f29['body']['id'];}return db[_0xf937('0x40')][_0xf937('0x5a')]({'where':{'id':_0x470f29[_0xf937('0x58')]['id']}})[_0xf937('0x37')](handleEntityNotFound(_0x551604,null))[_0xf937('0x37')](function(_0x1fbebf){if(_0x1fbebf){_0x470f29['body'][_0xf937('0x65')]=_0x1fbebf['id'];return db[_0xf937('0x6d')][_0xf937('0x5b')](_0x470f29['body']);}})[_0xf937('0x37')](respondWithResult(_0x551604,null))['catch'](handleError(_0x551604,null));};exports[_0xf937('0x6e')]=function(_0x3e3196,_0x2e598e,_0x447603){var _0x10d316={'raw':![],'where':{}};var _0x4e1184={};var _0x5bb935={'count':0x0,'rows':[]};return db[_0xf937('0x40')][_0xf937('0x6f')]({'where':{'id':_0x3e3196['params']['id']}})[_0xf937('0x37')](handleEntityNotFound(_0x2e598e,null))[_0xf937('0x37')](function(_0x4e56dc){if(_0x4e56dc){_0x4e1184['model']=_[_0xf937('0x47')](db[_0xf937('0x6d')][_0xf937('0x41')]);_0x4e1184[_0xf937('0x46')]=_['keys'](_0x3e3196[_0xf937('0x46')]);_0x4e1184[_0xf937('0x48')]=_[_0xf937('0x4a')](_0x4e1184['model'],_0x4e1184['query']);_0x10d316[_0xf937('0x49')]=_[_0xf937('0x4a')](_0x4e1184[_0xf937('0x44')],qs['fields'](_0x3e3196[_0xf937('0x46')]['fields']));_0x10d316[_0xf937('0x49')]=_0x10d316[_0xf937('0x49')]['length']?_0x10d316[_0xf937('0x49')]:_0x4e1184[_0xf937('0x44')];if(!_0x3e3196['query']['hasOwnProperty'](_0xf937('0x67'))){_0x10d316[_0xf937('0x2e')]=qs['limit'](_0x3e3196[_0xf937('0x46')]['limit']);_0x10d316[_0xf937('0x2c')]=qs['offset'](_0x3e3196[_0xf937('0x46')][_0xf937('0x2c')]);}_0x10d316['order']=qs[_0xf937('0x4e')](_0x3e3196[_0xf937('0x46')][_0xf937('0x4e')]);_0x10d316['where']=qs['filters'](_[_0xf937('0x68')](_0x3e3196[_0xf937('0x46')],_0x4e1184['filters']));_0x10d316[_0xf937('0x4f')][_0xf937('0x65')]=_0x4e56dc['id'];if(_0x3e3196[_0xf937('0x46')][_0xf937('0x53')]){_0x10d316[_0xf937('0x4f')]=_[_0xf937('0x50')](_0x10d316[_0xf937('0x4f')],{'$or':_[_0xf937('0x45')](_0x10d316[_0xf937('0x49')],function(_0x21a66a){var _0x1bf338={};_0x1bf338[_0x21a66a]={'$like':'%'+_0x3e3196[_0xf937('0x46')]['filter']+'%'};return _0x1bf338;})});}_0x10d316=_[_0xf937('0x50')]({},_0x10d316,_0x3e3196[_0xf937('0x54')]);return db['CannedAnswer'][_0xf937('0x2f')]({'where':_0x10d316['where']})[_0xf937('0x37')](function(_0x4782e5){_0x5bb935[_0xf937('0x2f')]=_0x4782e5;if(_0x3e3196[_0xf937('0x46')]['includeAll']){_0x10d316[_0xf937('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0xf937('0x57')](_0x10d316);})[_0xf937('0x37')](function(_0x3d0fc5){_0x5bb935[_0xf937('0x69')]=_0x3d0fc5;return _0x5bb935;});}})[_0xf937('0x37')](respondWithFilteredResult(_0x2e598e,_0x10d316))[_0xf937('0x28')](handleError(_0x2e598e,null));};exports[_0xf937('0x70')]=function(_0x59d2be,_0x2e5911,_0x538963){return db[_0xf937('0x40')][_0xf937('0x5a')]({'where':{'id':_0x59d2be[_0xf937('0x58')]['id']}})['then'](handleEntityNotFound(_0x2e5911,null))[_0xf937('0x37')](function(_0x3de732){if(_0x3de732){return _0x3de732[_0xf937('0x70')](_0x59d2be[_0xf937('0x46')]['ids']);}})[_0xf937('0x37')](respondWithStatusCode(_0x2e5911,null))[_0xf937('0x28')](handleError(_0x2e5911,null));};exports[_0xf937('0x71')]=function(_0xb0339e,_0x224e07,_0x5500fd){return db[_0xf937('0x40')][_0xf937('0x5a')]({'where':{'id':_0xb0339e[_0xf937('0x58')]['id']}})[_0xf937('0x37')](handleEntityNotFound(_0x224e07,null))[_0xf937('0x37')](function(_0xa91010){if(_0xa91010){return _0xa91010[_0xf937('0x71')](_0xb0339e['body'][_0xf937('0x6b')],_[_0xf937('0x72')](_0xb0339e[_0xf937('0x5c')],[_0xf937('0x6b'),'id'])||{})[_0xf937('0x73')](function(_0x4fa73){for(var _0x10d264=0x0;_0x10d264<_0xb0339e[_0xf937('0x5c')][_0xf937('0x6b')][_0xf937('0x59')];_0x10d264+=0x1){socket['emit'](_0xf937('0x74'),{'UserId':Number(_0xb0339e[_0xf937('0x5c')][_0xf937('0x6b')][_0x10d264]),'WhatsappAccountId':Number(_0xb0339e[_0xf937('0x58')]['id'])});}return _0x4fa73;});}})['then'](respondWithResult(_0x224e07,null))[_0xf937('0x28')](handleError(_0x224e07,null));};exports[_0xf937('0x75')]=function(_0x3f0a78,_0x3171b2,_0x39a500){return db[_0xf937('0x40')][_0xf937('0x5a')]({'where':{'id':_0x3f0a78[_0xf937('0x58')]['id']}})['then'](handleEntityNotFound(_0x3171b2,null))[_0xf937('0x37')](function(_0x49dcca){if(_0x49dcca){return _0x49dcca[_0xf937('0x75')](_0x3f0a78[_0xf937('0x46')]['ids'])[_0xf937('0x37')](function(){if(_[_0xf937('0x76')](_0x3f0a78[_0xf937('0x46')][_0xf937('0x6b')])){for(var _0x55ac5c=0x0;_0x55ac5c<_0x3f0a78['query'][_0xf937('0x6b')][_0xf937('0x59')];_0x55ac5c+=0x1){socket[_0xf937('0x77')](_0xf937('0x78'),{'UserId':Number(_0x3f0a78['query'][_0xf937('0x6b')][_0x55ac5c]),'WhatsappAccountId':Number(_0x3f0a78['params']['id'])});}}else{socket[_0xf937('0x77')](_0xf937('0x78'),{'UserId':Number(_0x3f0a78[_0xf937('0x46')][_0xf937('0x6b')]),'WhatsappAccountId':Number(_0x3f0a78[_0xf937('0x58')]['id'])});}});}})[_0xf937('0x37')](respondWithStatusCode(_0x3171b2,null))['catch'](handleError(_0x3171b2,null));};exports[_0xf937('0x79')]=function(_0x5bb488,_0x4ac54b,_0x47cf16){var _0x129d1f={};var _0x405f02={};var _0x572756;var _0x5bd600;return db[_0xf937('0x40')][_0xf937('0x6f')]({'where':{'id':_0x5bb488['params']['id']}})[_0xf937('0x37')](handleEntityNotFound(_0x4ac54b,null))['then'](function(_0x5e61f9){if(_0x5e61f9){_0x572756=_0x5e61f9;_0x405f02[_0xf937('0x44')]=_[_0xf937('0x47')](db[_0xf937('0x7a')]['rawAttributes']);_0x405f02['query']=_['keys'](_0x5bb488['query']);_0x405f02['filters']=_[_0xf937('0x4a')](_0x405f02['model'],_0x405f02[_0xf937('0x46')]);_0x129d1f[_0xf937('0x49')]=_[_0xf937('0x4a')](_0x405f02[_0xf937('0x44')],qs[_0xf937('0x4b')](_0x5bb488[_0xf937('0x46')][_0xf937('0x4b')]));_0x129d1f[_0xf937('0x49')]=_0x129d1f[_0xf937('0x49')][_0xf937('0x59')]?_0x129d1f['attributes']:_0x405f02[_0xf937('0x44')];_0x129d1f['order']=qs['sort'](_0x5bb488[_0xf937('0x46')][_0xf937('0x4e')]);_0x129d1f[_0xf937('0x4f')]=qs[_0xf937('0x48')](_[_0xf937('0x68')](_0x5bb488[_0xf937('0x46')],_0x405f02[_0xf937('0x48')]));if(_0x5bb488[_0xf937('0x46')][_0xf937('0x53')]){_0x129d1f[_0xf937('0x4f')]=_[_0xf937('0x50')](_0x129d1f['where'],{'$or':_[_0xf937('0x45')](_0x129d1f[_0xf937('0x49')],function(_0x58723a){var _0x4a6ec9={};_0x4a6ec9[_0x58723a]={'$like':'%'+_0x5bb488[_0xf937('0x46')]['filter']+'%'};return _0x4a6ec9;})});}_0x129d1f=_[_0xf937('0x50')]({},_0x129d1f,_0x5bb488['options']);return _0x572756[_0xf937('0x79')](_0x129d1f);}})[_0xf937('0x37')](function(_0x586331){if(_0x586331){_0x5bd600=_0x586331[_0xf937('0x59')];if(!_0x5bb488[_0xf937('0x46')]['hasOwnProperty'](_0xf937('0x67'))){_0x129d1f[_0xf937('0x2e')]=qs[_0xf937('0x2e')](_0x5bb488[_0xf937('0x46')][_0xf937('0x2e')]);_0x129d1f[_0xf937('0x2c')]=qs[_0xf937('0x2c')](_0x5bb488[_0xf937('0x46')][_0xf937('0x2c')]);}return _0x572756[_0xf937('0x79')](_0x129d1f);}})[_0xf937('0x37')](function(_0x50acea){if(_0x50acea){return _0x50acea?{'count':_0x5bd600,'rows':_0x50acea}:null;}})[_0xf937('0x37')](respondWithResult(_0x4ac54b,null))['catch'](handleError(_0x4ac54b,null));};exports[_0xf937('0x7b')]=function(_0x24a802,_0x390512){var _0x3c2e7a=_0x24a802[_0xf937('0x58')]['id'];var _0xd0f9e0=_0x24a802[_0xf937('0x5c')];var _0x53dc67=0xc8;var _0x2a52b8=null;return db['sequelize'][_0xf937('0x7c')]({'isolationLevel':db[_0xf937('0x7d')][_0xf937('0x7e')][_0xf937('0x7f')][_0xf937('0x80')]},function(_0x3a79c8){return db[_0xf937('0x40')][_0xf937('0x6f')]({'where':{'id':_0x3c2e7a},'transaction':_0x3a79c8})[_0xf937('0x37')](function(_0x1ae95f){if(_0x1ae95f){return db[_0xf937('0x81')][_0xf937('0x36')]({'where':{'WhatsappAccountId':_0x3c2e7a},'transaction':_0x3a79c8})['then'](function(){var _0x26c704=_[_0xf937('0x45')](_0xd0f9e0,function(_0x2622c1){_0x2622c1[_0xf937('0x65')]=_0x3c2e7a;return _0x2622c1;});return db['WhatsappApplication'][_0xf937('0x82')](_0x26c704,{'transaction':_0x3a79c8});});}else{_0x53dc67=0x194;_0x2a52b8=[];}});})[_0xf937('0x37')](function(){if(_0x53dc67!==0x194){return db[_0xf937('0x81')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x3c2e7a},'order':_0xf937('0x83')})[_0xf937('0x37')](function(_0x286f80){_0x2a52b8=_0x286f80;});}})[_0xf937('0x28')](function(_0x55f8c9){_0x53dc67=0x1f4;logger[_0xf937('0x24')](_0x55f8c9[_0xf937('0x84')]);if(_0x55f8c9['name']){delete _0x55f8c9[_0xf937('0x3b')];}_0x2a52b8=_0x55f8c9;})[_0xf937('0x85')](function(){if(_0x2a52b8===null){_0x390512[_0xf937('0x29')](_0x53dc67);}else{if(_0x53dc67===0x1f4){_0x390512[_0xf937('0x2a')](_0x53dc67)[_0xf937('0x3c')](_0x2a52b8);}else{_0x390512['status'](_0x53dc67)['json'](_0x2a52b8);}}});};exports[_0xf937('0x86')]=function(_0x47126a,_0x4a52b9,_0xced726){var _0x20d01d={};var _0x341cb1={};var _0x1c6235;var _0xa46167;return db[_0xf937('0x40')][_0xf937('0x6f')]({'where':{'id':_0x47126a[_0xf937('0x58')]['id']}})[_0xf937('0x37')](handleEntityNotFound(_0x4a52b9,null))['then'](function(_0x4d9b6d){if(_0x4d9b6d){_0x1c6235=_0x4d9b6d;_0x341cb1['model']=_['keys'](db[_0xf937('0x81')][_0xf937('0x41')]);_0x341cb1['query']=_['keys'](_0x47126a[_0xf937('0x46')]);_0x341cb1[_0xf937('0x48')]=_['intersection'](_0x341cb1['model'],_0x341cb1[_0xf937('0x46')]);_0x20d01d['attributes']=_[_0xf937('0x4a')](_0x341cb1[_0xf937('0x44')],qs[_0xf937('0x4b')](_0x47126a['query'][_0xf937('0x4b')]));_0x20d01d[_0xf937('0x49')]=_0x20d01d[_0xf937('0x49')][_0xf937('0x59')]?_0x20d01d['attributes']:_0x341cb1['model'];_0x20d01d[_0xf937('0x4d')]=qs['sort'](_0x47126a[_0xf937('0x46')][_0xf937('0x4e')]);_0x20d01d[_0xf937('0x4f')]=qs[_0xf937('0x48')](_[_0xf937('0x68')](_0x47126a['query'],_0x341cb1[_0xf937('0x48')]));if(_0x47126a[_0xf937('0x46')]['filter']){_0x20d01d[_0xf937('0x4f')]=_['merge'](_0x20d01d['where'],{'$or':_[_0xf937('0x45')](_0x20d01d[_0xf937('0x49')],function(_0x291b23){var _0x4bd6a9={};_0x4bd6a9[_0x291b23]={'$like':'%'+_0x47126a[_0xf937('0x46')][_0xf937('0x53')]+'%'};return _0x4bd6a9;})});}_0x20d01d=_[_0xf937('0x50')]({},_0x20d01d,_0x47126a[_0xf937('0x54')]);return _0x1c6235['getApplications'](_0x20d01d);}})[_0xf937('0x37')](function(_0x4b1d6c){if(_0x4b1d6c){_0xa46167=_0x4b1d6c[_0xf937('0x59')];if(!_0x47126a[_0xf937('0x46')][_0xf937('0x4c')]('nolimit')){_0x20d01d['limit']=qs['limit'](_0x47126a[_0xf937('0x46')][_0xf937('0x2e')]);_0x20d01d[_0xf937('0x2c')]=qs[_0xf937('0x2c')](_0x47126a[_0xf937('0x46')][_0xf937('0x2c')]);}return _0x1c6235['getApplications'](_0x20d01d);}})[_0xf937('0x37')](function(_0x514ce0){if(_0x514ce0){return _0x514ce0?{'count':_0xa46167,'rows':_0x514ce0}:null;}})[_0xf937('0x37')](respondWithResult(_0x4a52b9,null))[_0xf937('0x28')](handleError(_0x4a52b9,null));};exports[_0xf937('0x87')]=function(_0x295a6c,_0x285aca,_0x1e5708){var _0x1ae894={'channel':_0xf937('0x88')};var _0x3c7812=[];var _0x414137=[];var _0x5d71af={};return db[_0xf937('0x40')][_0xf937('0x5a')]({'where':{'id':_0x295a6c[_0xf937('0x58')]['id']},'include':[{'model':db[_0xf937('0x81')],'as':_0xf937('0x89')}]})[_0xf937('0x37')](handleEntityNotFound(_0x285aca,null))['then'](function(_0x497979){_0x1ae894[_0xf937('0x8a')]=_0x497979;if(_0x1ae894['account']&&_0x1ae894[_0xf937('0x8a')][_0xf937('0x51')]===_0xf937('0x8b')&&_0x295a6c[_0xf937('0x5c')][_0xf937('0x8c')]){if(_0x295a6c['body']['statuses'][_0xf937('0x59')]===0x0)return;if(_0x295a6c[_0xf937('0x5c')][_0xf937('0x8c')][0x0][_0xf937('0x8d')]!=='read')return;return db[_0xf937('0x8e')][_0xf937('0x35')]({'read':!![],'readAt':_0x295a6c[_0xf937('0x5c')][_0xf937('0x8c')][0x0][_0xf937('0x8f')]},{'where':{'messageId':_0x295a6c['body'][_0xf937('0x8c')][0x0][_0xf937('0x90')]},'individualHooks':!![]})['then'](function(_0x3c3472){return _0x285aca['status'](0xc8)[_0xf937('0x32')](_0x3c3472);});}_0x1ae894[_0xf937('0x91')]=_['orderBy'](_0x497979[_0xf937('0x89')],[_0xf937('0x83')],['asc']);if(_0x1ae894[_0xf937('0x8a')][_0xf937('0x89')]){delete _0x1ae894[_0xf937('0x8a')]['Applications'];}return db[_0xf937('0x92')][_0xf937('0x63')]()['then'](function(_0x2b2f00){if(!_0x2b2f00){throw new db['Sequelize'][(_0xf937('0x93'))](_0xf937('0x94'));}_0x3c7812=_[_0xf937('0x95')](_[_0xf937('0x47')](_0x2b2f00),[_0xf937('0x96'),_0xf937('0x97')]);_0x414137=_[_0xf937('0x95')](_[_0xf937('0x47')](_0x2b2f00),['createdAt','updatedAt',_0xf937('0x98'),_0xf937('0x99')]);_0x1ae894[_0xf937('0x5c')]={'mapKey':_0xf937('0x9a')};if(_0x1ae894[_0xf937('0x8a')]&&_0x1ae894[_0xf937('0x8a')][_0xf937('0x51')]===_0xf937('0x9b')){_0x1ae894[_0xf937('0x5c')]['from']=_0x295a6c[_0xf937('0x5c')][_0xf937('0x9c')][_0xf937('0x9d')](_0xf937('0x9e'),'');_0x1ae894['body'][_0xf937('0x5c')]=_0x295a6c[_0xf937('0x5c')][_0xf937('0x9f')];_0x1ae894['body'][_0xf937('0xa0')]=_0x295a6c['body'][_0xf937('0xa1')];}if(_0x1ae894['account']&&_0x1ae894[_0xf937('0x8a')][_0xf937('0x51')]===_0xf937('0x8b')){_0x1ae894['body'][_0xf937('0xa2')]=_0x295a6c[_0xf937('0x5c')][_0xf937('0xa3')][0x0][_0xf937('0xa2')];_0x1ae894[_0xf937('0x5c')][_0xf937('0x5c')]=_0x295a6c[_0xf937('0x5c')][_0xf937('0xa3')][0x0][_0xf937('0x25')][_0xf937('0x5c')];_0x1ae894['body']['messageId']=_0x295a6c['body'][_0xf937('0xa3')][0x0]['message_id'];}if(_0x1ae894[_0xf937('0x5c')]['id']){delete _0x1ae894['body']['id'];}if(_[_0xf937('0xa4')](_0x1ae894['body'][_0xf937('0xa2')])){throw new db[(_0xf937('0xa5'))][(_0xf937('0x93'))](_0xf937('0xa6'));}if(_['isNil'](_0x1ae894[_0xf937('0x5c')]['body'])||_0x1ae894['body'][_0xf937('0x5c')]===''){throw new db[(_0xf937('0xa5'))][(_0xf937('0x93'))](_0xf937('0xa7'));}if(_[_0xf937('0xa4')](_0x1ae894[_0xf937('0x5c')]['mapKey'])){throw new db[(_0xf937('0xa5'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x414137);}if(!_[_0xf937('0xa8')](_0x414137,_0x1ae894[_0xf937('0x5c')][_0xf937('0xa9')])){throw new db[(_0xf937('0xa5'))][(_0xf937('0x93'))](_0xf937('0xaa')+_0x414137);}_0x5d71af[_0x1ae894[_0xf937('0x5c')]['mapKey']]=_0x1ae894[_0xf937('0x5c')][_0xf937('0xa2')];return db[_0xf937('0xab')][_0xf937('0x5a')]({'where':{'id':_0x1ae894[_0xf937('0x8a')][_0xf937('0x99')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x5d71af,'limit':0x1,'order':[[_0xf937('0x97'),_0xf937('0xac')]]}]});})[_0xf937('0x37')](handleEntityNotFound(_0x285aca,null))[_0xf937('0x37')](function(_0x232a7b){if(_0x232a7b){_0x1ae894['list']=_[_0xf937('0x72')](_0x232a7b,[_0xf937('0xad')]);if(_0x232a7b[_0xf937('0xad')][_0xf937('0x59')]){return _0x232a7b['Contacts'][0x0];}var _0x827422=_[_0xf937('0x17')](_0x1ae894[_0xf937('0x5c')],{'firstName':_0x1ae894[_0xf937('0x5c')][_0xf937('0xa2')],'ListId':_0x232a7b['id']});_0x827422[_0x1ae894[_0xf937('0x5c')][_0xf937('0xa9')]]=_0x1ae894[_0xf937('0x5c')][_0xf937('0xa2')];return db[_0xf937('0x92')][_0xf937('0x5b')](_0x827422,{'fields':_0x3c7812,'raw':!![]});}})[_0xf937('0x37')](handleEntityNotFound(_0x285aca,null))[_0xf937('0x37')](function(_0x5c9e51){if(_0x5c9e51){_0x1ae894[_0xf937('0xae')]=_0x5c9e51;var _0x20c352={'ContactId':_0x5c9e51['id'],'phone':_0x1ae894[_0xf937('0x5c')][_0xf937('0xa2')],'WhatsappAccountId':_0x295a6c[_0xf937('0x58')]['id']};var _0x5917e4={'ContactId':_0x5c9e51['id'],'WhatsappAccountId':_0x295a6c[_0xf937('0x58')]['id'],'closed':![]};return db[_0xf937('0xaf')][_0xf937('0x5a')]({'where':_0x5917e4})[_0xf937('0x37')](function(_0x402069){if(_0x402069){return[_0x402069,![]];}return db[_0xf937('0xaf')][_0xf937('0x5b')](_0x20c352)[_0xf937('0x37')](function(_0x4fa655){return[_0x4fa655,!![]];});});}})[_0xf937('0x73')](function(_0x3c065d,_0x3f8e14){_0x1ae894[_0xf937('0xb0')]=_0x3c065d[_0xf937('0x38')]({'plain':!![]});_0x1ae894[_0xf937('0xb0')][_0xf937('0xb1')]=![];if(_0x3f8e14){if(_0x1ae894['account'][_0xf937('0xb2')]){_0x1ae894[_0xf937('0x91')][_0xf937('0xb3')]({'id':0x0,'priority':_0x1ae894['applications']['length']+0x1,'app':_0xf937('0xb4'),'appdata':_0xf937('0xb5'),'interval':_0xf937('0xb6')});}_0x1ae894[_0xf937('0xb0')][_0xf937('0xb1')]=!![];}return db[_0xf937('0x8e')][_0xf937('0x5b')]({'phone':_0x1ae894[_0xf937('0x5c')][_0xf937('0xa2')],'messageId':_0x1ae894[_0xf937('0x5c')]['messageId'],'body':_0x1ae894[_0xf937('0x5c')][_0xf937('0x5c')],'WhatsappAccountId':_0x295a6c[_0xf937('0x58')]['id'],'WhatsappInteractionId':_0x3c065d['id'],'direction':'in','ContactId':_0x3c065d[_0xf937('0xb7')],'AttachmentId':_0x1ae894['body'][_0xf937('0xb8')]});})[_0xf937('0x37')](function(_0x1b09cd){_0x1ae894[_0xf937('0x25')]=_0x1b09cd;if(_0x1ae894[_0xf937('0xb0')][_0xf937('0xb9')]){return db[_0xf937('0x7a')][_0xf937('0x5a')]({'attributes':['id',_0xf937('0x3b')],'where':{'id':_0x1ae894[_0xf937('0xb0')][_0xf937('0xb9')]}})['then'](function(_0x4a77cb){if(_0x4a77cb){_0x1ae894[_0xf937('0x91')][_0xf937('0xba')]({'id':0x0,'priority':0x0,'app':_0xf937('0xbb'),'appdata':_0x4a77cb[_0xf937('0x3b')]+','+(_0x1ae894['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xf937('0xbc'),_0x1ae894);});}return respondWithRpcPromise(_0xf937('0xbd'),'startRouting',_0x1ae894);})[_0xf937('0x37')](function(_0x52b7cb){if(_0x52b7cb){var _0x56595e=0xc8;var _0xac707a=_0xf937('0xbe');logger[_0xf937('0x26')](_0xf937('0xbf'),_0xac707a,_0x56595e,_0xf937('0xc0'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0xac707a,_0x56595e,_0xf937('0xc0'),JSON['stringify'](_0x52b7cb));if(_0x1ae894[_0xf937('0x8a')][_0xf937('0x51')]===_0xf937('0x9b')){return _0x285aca[_0xf937('0x2a')](_0x56595e)[_0xf937('0x30')](_0xf937('0xc1'),_0xf937('0xc2'))[_0xf937('0x3c')](_0xf937('0xc3'));}else{return _0x285aca[_0xf937('0x2a')](_0x56595e)['json'](_0x52b7cb);}}});})[_0xf937('0x28')](handleError(_0x285aca,null));};exports[_0xf937('0x3c')]=function(_0x257d88,_0x311547,_0x42aa1e){var _0x1d9541,_0x32710b,_0x1a2e60;if(_[_0xf937('0xa4')](_0x257d88['body'][_0xf937('0x5c')])||_0x257d88['body'][_0xf937('0x5c')]===''){throw new db[(_0xf937('0xa5'))][(_0xf937('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf937('0xa4')](_0x257d88['body']['to'])){throw new db[(_0xf937('0xa5'))][(_0xf937('0x93'))](_0xf937('0xc4'));}_0x1d9541=_0x257d88[_0xf937('0x5c')]['to'];return db['WhatsappAccount'][_0xf937('0x5a')]({'where':{'id':_0x257d88[_0xf937('0x58')]['id']},'include':[{'model':db[_0xf937('0xab')],'as':_0xf937('0xc5'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x1d9541},'limit':0x1,'order':[[_0xf937('0x97'),_0xf937('0xac')]]}]}]})[_0xf937('0x37')](handleEntityNotFound(_0x311547,null))['then'](function(_0x4a9a28){if(_0x4a9a28&&_0x4a9a28[_0xf937('0xc5')]){_0x32710b=_0x4a9a28[_0xf937('0x38')]({'plain':!![]});if(_0x32710b[_0xf937('0xc5')]&&_0x32710b[_0xf937('0xc5')][_0xf937('0xad')]['length']){return _0x32710b['List'][_0xf937('0xad')][0x0];}return db[_0xf937('0x92')][_0xf937('0x5b')](_['defaults'](_0x257d88[_0xf937('0x5c')],{'firstName':_0x1d9541,'mobile':_0x1d9541,'phone':_0x1d9541,'ListId':_0x32710b[_0xf937('0x99')]}));}})[_0xf937('0x37')](handleEntityNotFound(_0x311547,null))[_0xf937('0x37')](function(_0x28cf62){if(_0x28cf62){_0x1a2e60=_0x28cf62;return db[_0xf937('0xaf')][_0xf937('0x5a')]({'where':{'ContactId':_0x1a2e60['id'],'closed':![],'WhatsappAccountId':_0x32710b['id']}})[_0xf937('0x37')](function(_0xda7797){if(_0xda7797){return[_0xda7797,![]];}return db[_0xf937('0xaf')][_0xf937('0x5b')]({'UserId':_0x257d88['user']['id'],'ContactId':_0x1a2e60['id'],'WhatsappAccountId':_0x32710b['id'],'phone':_0x1d9541,'firstMsgDirection':_0xf937('0xc6'),'Messages':[_['merge'](_0x257d88[_0xf937('0x5c')],{'read':![],'body':_0x257d88[_0xf937('0x5c')][_0xf937('0x5c')],'phone':_0x1d9541,'WhatsappAccountId':_0x32710b['id'],'UserId':_0x257d88['user']['id'],'ContactId':_0x1a2e60['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xf937('0xc7')}]})['then'](function(_0x527a96){return[_0x527a96,!![]];});});}})[_0xf937('0x73')](function(_0x3c9d67,_0x1447b4){if(_0x1447b4){return _0x3c9d67;}return db['WhatsappMessage']['create'](_[_0xf937('0x50')](_0x257d88[_0xf937('0x5c')],{'read':![],'body':_0x257d88[_0xf937('0x5c')]['body'],'phone':_0x1d9541,'WhatsappAccountId':_0x32710b['id'],'WhatsappInteractionId':_0x3c9d67['id'],'UserId':_0x257d88[_0xf937('0x5d')]['id'],'ContactId':_0x1a2e60['id']}))[_0xf937('0x37')](function(_0x3e7eb2){_0x3c9d67[_0xf937('0xc8')][_0xf937('0xc7')]=[];_0x3c9d67[_0xf937('0xc8')][_0xf937('0xc7')][_0xf937('0xb3')](_0x3e7eb2[_0xf937('0xc8')]);return _0x3c9d67;});})[_0xf937('0x37')](respondWithResult(_0x311547,null))['catch'](handleError(_0x311547,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index f98e6aa..a1d3204 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 _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 +var _0x53c3=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save'];(function(_0x41cfd4,_0x1ed2cc){var _0x190f48=function(_0x4b5b1a){while(--_0x4b5b1a){_0x41cfd4['push'](_0x41cfd4['shift']());}};_0x190f48(++_0x1ed2cc);}(_0x53c3,0x103));var _0x353c=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x53c3[_0x36c5b0];return _0xf19333;};'use strict';var EventEmitter=require(_0x353c('0x0'));var WhatsappAccount=require(_0x353c('0x1'))['db'][_0x353c('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x353c('0x3')](0x0);var events={'afterCreate':_0x353c('0x4'),'afterUpdate':_0x353c('0x5'),'afterDestroy':_0x353c('0x6')};function emitEvent(_0x1e3566){return function(_0x22481f,_0x100e6d,_0x3620f8){WhatsappAccountEvents[_0x353c('0x7')](_0x1e3566+':'+_0x22481f['id'],_0x22481f);WhatsappAccountEvents[_0x353c('0x7')](_0x1e3566,_0x22481f);_0x3620f8(null);};}for(var e in events){if(events[_0x353c('0x8')](e)){var event=events[e];WhatsappAccount[_0x353c('0x9')](e,emitEvent(event));}}module[_0x353c('0xa')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 15e89b4..feb660b 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 _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 +var _0x11c8=['./whatsappAccount.attributes','exports','define','WhatsappAccount','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1aefea,_0x39e5fa){var _0x33a7a1=function(_0x5cef45){while(--_0x5cef45){_0x1aefea['push'](_0x1aefea['shift']());}};_0x33a7a1(++_0x39e5fa);}(_0x11c8,0x94));var _0x811c=function(_0x3c3195,_0x595377){_0x3c3195=_0x3c3195-0x0;var _0x2ee24e=_0x11c8[_0x3c3195];return _0x2ee24e;};'use strict';var _=require('lodash');var util=require(_0x811c('0x0'));var logger=require('../../config/logger')(_0x811c('0x1'));var moment=require(_0x811c('0x2'));var BPromise=require(_0x811c('0x3'));var rp=require(_0x811c('0x4'));var fs=require('fs');var path=require(_0x811c('0x5'));var rimraf=require(_0x811c('0x6'));var config=require(_0x811c('0x7'));var attributes=require(_0x811c('0x8'));module[_0x811c('0x9')]=function(_0x5246e3,_0x4693af){return _0x5246e3[_0x811c('0xa')](_0x811c('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 de3226d..755e016 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 _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 +var _0xb923=['../../config/logger','rpc','../../config/environment','client','redis','localhost','./whatsappAccount.socket','register','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','ShowWhatsappAccount','WhatsappAccount','find','options','raw','attributes','include','map','model','stringify','moment','bluebird','ioredis','../../config/utils'];(function(_0x5c0034,_0x2ab9b7){var _0x59b18f=function(_0x47043b){while(--_0x47043b){_0x5c0034['push'](_0x5c0034['shift']());}};_0x59b18f(++_0x2ab9b7);}(_0xb923,0x80));var _0x3b92=function(_0x2a2e3d,_0x2b8f7c){_0x2a2e3d=_0x2a2e3d-0x0;var _0x41b39f=_0xb923[_0x2a2e3d];return _0x41b39f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3b92('0x0'));var BPromise=require(_0x3b92('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b92('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b92('0x3'));var logger=require(_0x3b92('0x4'))(_0x3b92('0x5'));var config=require(_0x3b92('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3b92('0x7')]['http']({'port':0x232a});config[_0x3b92('0x8')]=_['defaults'](config[_0x3b92('0x8')],{'host':_0x3b92('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b92('0x8')]));require(_0x3b92('0xa'))[_0x3b92('0xb')](socket);function respondWithRpcPromise(_0x4b729d,_0x404427,_0x258014){return new BPromise(function(_0x55da1b,_0x2cdecb){return client[_0x3b92('0xc')](_0x4b729d,_0x258014)[_0x3b92('0xd')](function(_0x490dca){logger[_0x3b92('0xe')]('WhatsappAccount,\x20%s,\x20%s',_0x404427,_0x3b92('0xf'));logger[_0x3b92('0x10')](_0x3b92('0x11'),_0x404427,_0x3b92('0xf'),JSON['stringify'](_0x490dca));if(_0x490dca[_0x3b92('0x12')]){if(_0x490dca[_0x3b92('0x12')][_0x3b92('0x13')]===0x1f4){logger[_0x3b92('0x12')](_0x3b92('0x14'),_0x404427,_0x490dca['error'][_0x3b92('0x15')]);return _0x2cdecb(_0x490dca[_0x3b92('0x12')]['message']);}logger[_0x3b92('0x12')](_0x3b92('0x14'),_0x404427,_0x490dca[_0x3b92('0x12')][_0x3b92('0x15')]);return _0x55da1b(_0x490dca[_0x3b92('0x12')][_0x3b92('0x15')]);}else{logger[_0x3b92('0xe')]('WhatsappAccount,\x20%s,\x20%s',_0x404427,'request\x20sent');_0x55da1b(_0x490dca[_0x3b92('0x16')][_0x3b92('0x15')]);}})['catch'](function(_0x62052d){logger[_0x3b92('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x404427,_0x62052d);_0x2cdecb(_0x62052d);});});}exports[_0x3b92('0x17')]=function(_0x3f2a14){var _0x36bbf6=this;return new Promise(function(_0x2db315,_0x29a5f2){return db[_0x3b92('0x18')][_0x3b92('0x19')]({'raw':_0x3f2a14[_0x3b92('0x1a')]?_0x3f2a14['options'][_0x3b92('0x1b')]===undefined?!![]:![]:!![],'where':_0x3f2a14[_0x3b92('0x1a')]?_0x3f2a14[_0x3b92('0x1a')]['where']||null:null,'attributes':_0x3f2a14[_0x3b92('0x1a')]?_0x3f2a14['options'][_0x3b92('0x1c')]||null:null,'include':_0x3f2a14['options']?_0x3f2a14[_0x3b92('0x1a')][_0x3b92('0x1d')]?_[_0x3b92('0x1e')](_0x3f2a14[_0x3b92('0x1a')][_0x3b92('0x1d')],function(_0x1fdefd){return{'model':db[_0x1fdefd[_0x3b92('0x1f')]],'as':_0x1fdefd['as'],'attributes':_0x1fdefd[_0x3b92('0x1c')],'include':_0x1fdefd['include']?_[_0x3b92('0x1e')](_0x1fdefd['include'],function(_0xcbe6ed){return{'model':db[_0xcbe6ed[_0x3b92('0x1f')]],'as':_0xcbe6ed['as'],'attributes':_0xcbe6ed[_0x3b92('0x1c')],'include':_0xcbe6ed[_0x3b92('0x1d')]?_[_0x3b92('0x1e')](_0xcbe6ed['include'],function(_0x482f0f){return{'model':db[_0x482f0f[_0x3b92('0x1f')]],'as':_0x482f0f['as'],'attributes':_0x482f0f[_0x3b92('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x32b4dc){logger[_0x3b92('0xe')]('ShowWhatsappAccount',_0x3f2a14);logger['debug'](_0x3b92('0x17'),_0x3f2a14,JSON[_0x3b92('0x20')](_0x32b4dc));_0x2db315(_0x32b4dc);})['catch'](function(_0x4187a3){logger[_0x3b92('0x12')](_0x3b92('0x17'),_0x4187a3['message'],_0x3f2a14);_0x29a5f2(_0x36bbf6[_0x3b92('0x12')](0x1f4,_0x4187a3['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index c2046f9..d8768fc 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 _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 +var _0x54f4=['./whatsappAccount.events','save','remove','update','emit','register','length'];(function(_0x5cbd7b,_0x207439){var _0x3fdfb8=function(_0x4eb12e){while(--_0x4eb12e){_0x5cbd7b['push'](_0x5cbd7b['shift']());}};_0x3fdfb8(++_0x207439);}(_0x54f4,0x118));var _0x454f=function(_0x111a1b,_0x505ff1){_0x111a1b=_0x111a1b-0x0;var _0x533d2f=_0x54f4[_0x111a1b];return _0x533d2f;};'use strict';var WhatsappAccountEvents=require(_0x454f('0x0'));var events=[_0x454f('0x1'),_0x454f('0x2'),_0x454f('0x3')];function createListener(_0x5689b4,_0x2486a4){return function(_0x40766c){_0x2486a4[_0x454f('0x4')](_0x5689b4,_0x40766c);};}function removeListener(_0x1ef501,_0x11b8a0){return function(){WhatsappAccountEvents['removeListener'](_0x1ef501,_0x11b8a0);};}exports[_0x454f('0x5')]=function(_0x20d6e8){for(var _0x20c9aa=0x0,_0x4fa905=events[_0x454f('0x6')];_0x20c9aa<_0x4fa905;_0x20c9aa++){var _0x208369=events[_0x20c9aa];var _0x31a5ac=createListener('whatsappAccount:'+_0x208369,_0x20d6e8);WhatsappAccountEvents['on'](_0x208369,_0x31a5ac);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 9a964b4..36705bb 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 _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 +var _0x7a1d=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','create','put','/:id'];(function(_0x135c3d,_0xf4d149){var _0x23c7ea=function(_0x2de680){while(--_0x2de680){_0x135c3d['push'](_0x135c3d['shift']());}};_0x23c7ea(++_0xf4d149);}(_0x7a1d,0xad));var _0xd7a1=function(_0x2eb3db,_0x4a32c0){_0x2eb3db=_0x2eb3db-0x0;var _0x358f33=_0x7a1d[_0x2eb3db];return _0x358f33;};'use strict';var multer=require(_0xd7a1('0x0'));var util=require(_0xd7a1('0x1'));var path=require(_0xd7a1('0x2'));var timeout=require(_0xd7a1('0x3'));var express=require(_0xd7a1('0x4'));var router=express[_0xd7a1('0x5')]();var fs_extra=require(_0xd7a1('0x6'));var auth=require(_0xd7a1('0x7'));var interaction=require(_0xd7a1('0x8'));var config=require(_0xd7a1('0x9'));var controller=require('./whatsappApplication.controller');router[_0xd7a1('0xa')]('/',auth[_0xd7a1('0xb')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd7a1('0xc')]);router[_0xd7a1('0xd')]('/',auth[_0xd7a1('0xb')](),controller[_0xd7a1('0xe')]);router[_0xd7a1('0xf')](_0xd7a1('0x10'),auth[_0xd7a1('0xb')](),controller['update']);router[_0xd7a1('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd7a1('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index d546845..fcd66a8 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 _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 +var _0xf04b=['STRING','INTEGER','TEXT'];(function(_0x20874f,_0x49de8f){var _0x276715=function(_0x245f18){while(--_0x245f18){_0x20874f['push'](_0x20874f['shift']());}};_0x276715(++_0x49de8f);}(_0xf04b,0x175));var _0xbf04=function(_0x4fde8d,_0xa952a2){_0x4fde8d=_0x4fde8d-0x0;var _0x5f1fa8=_0xf04b[_0x4fde8d];return _0x5f1fa8;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xbf04('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xbf04('0x1')]()},'description':{'type':Sequelize[_0xbf04('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 3f04346..204a3ca 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 _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 +var _0xc1c6=['type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','WhatsappApplication','rawAttributes'];(function(_0x741b9a,_0x44c670){var _0x4bf212=function(_0x55e5b6){while(--_0x55e5b6){_0x741b9a['push'](_0x741b9a['shift']());}};_0x4bf212(++_0x44c670);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x3a7c79,_0x168f3b){_0x3a7c79=_0x3a7c79-0x0;var _0x57535c=_0xc1c6[_0x3a7c79];return _0x57535c;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['WhatsappApplication']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':!![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['WhatsappApplication'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['create']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')](_0x1fe6e8[_0x6c1c('0x48')],{})[_0x6c1c('0x25')](respondWithResult(_0x58d075,0xc9))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x52c14d,_0xa9889a){if(_0x52c14d[_0x6c1c('0x48')]['id']){delete _0x52c14d['body']['id'];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'id':_0x52c14d[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0xa9889a,null))['then'](saveUpdates(_0x52c14d[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0xa9889a,null))[_0x6c1c('0x41')](handleError(_0xa9889a,null));};exports['destroy']=function(_0x5b8d69,_0x56b367){return db['WhatsappApplication']['find']({'where':{'id':_0x5b8d69[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x56b367,null))['then'](removeEntity(_0x56b367,null))[_0x6c1c('0x41')](handleError(_0x56b367,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 49e6541..9ee2324 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 _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 +var _0x0ef0=['api','moment','bluebird','request-promise','path','rimraf','exports','define','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x5e9025,_0x25f9d1){var _0x18b7b3=function(_0x1ffb09){while(--_0x1ffb09){_0x5e9025['push'](_0x5e9025['shift']());}};_0x18b7b3(++_0x25f9d1);}(_0x0ef0,0x80));var _0x00ef=function(_0x5bdd93,_0x208ccb){_0x5bdd93=_0x5bdd93-0x0;var _0x2caf5e=_0x0ef0[_0x5bdd93];return _0x2caf5e;};'use strict';var _=require(_0x00ef('0x0'));var util=require(_0x00ef('0x1'));var logger=require('../../config/logger')(_0x00ef('0x2'));var moment=require(_0x00ef('0x3'));var BPromise=require(_0x00ef('0x4'));var rp=require(_0x00ef('0x5'));var fs=require('fs');var path=require(_0x00ef('0x6'));var rimraf=require(_0x00ef('0x7'));var config=require('../../config/environment');var attributes=require('./whatsappApplication.attributes');module[_0x00ef('0x8')]=function(_0x406d13,_0x471ebf){return _0x406d13[_0x00ef('0x9')]('WhatsappApplication',attributes,{'tableName':_0x00ef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x00ef('0xb'),'collate':_0x00ef('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 2b689f1..51dafa5 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 _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 +var _0xa8a8=['stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x34649e,_0x24ac1a){var _0xe8dd1d=function(_0x559ff1){while(--_0x559ff1){_0x34649e['push'](_0x34649e['shift']());}};_0xe8dd1d(++_0x24ac1a);}(_0xa8a8,0xec));var _0x8a8a=function(_0x2ae56d,_0x19bb4f){_0x2ae56d=_0x2ae56d-0x0;var _0xb8e30f=_0xa8a8[_0x2ae56d];return _0xb8e30f;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 84b3036..1beed1e 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 _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 +var _0x8375=['post','create','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','delete','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download'];(function(_0x16b542,_0x10cdb2){var _0x29511d=function(_0xc593ee){while(--_0xc593ee){_0x16b542['push'](_0x16b542['shift']());}};_0x29511d(++_0x10cdb2);}(_0x8375,0xa8));var _0x5837=function(_0x59b461,_0x3770f3){_0x59b461=_0x59b461-0x0;var _0x183194=_0x8375[_0x59b461];return _0x183194;};'use strict';var multer=require(_0x5837('0x0'));var util=require(_0x5837('0x1'));var path=require(_0x5837('0x2'));var timeout=require('connect-timeout');var express=require(_0x5837('0x3'));var router=express[_0x5837('0x4')]();var fs_extra=require(_0x5837('0x5'));var auth=require(_0x5837('0x6'));var interaction=require(_0x5837('0x7'));var config=require(_0x5837('0x8'));var controller=require('./whatsappInteraction.controller');router[_0x5837('0x9')]('/',auth[_0x5837('0xa')](),controller[_0x5837('0xb')]);router[_0x5837('0x9')](_0x5837('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x5837('0x9')](_0x5837('0xd'),auth['isAuthenticated'](),controller[_0x5837('0xe')]);router['get'](_0x5837('0xf'),auth[_0x5837('0xa')](),controller[_0x5837('0x10')]);router[_0x5837('0x9')](_0x5837('0x11'),auth[_0x5837('0xa')](),controller['download']);router[_0x5837('0x12')]('/',auth[_0x5837('0xa')](),controller[_0x5837('0x13')]);router[_0x5837('0x12')](_0x5837('0xf'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x5837('0x14'),auth[_0x5837('0xa')](),interaction[_0x5837('0x15')](_0x5837('0x16'),_0x5837('0x17')),controller[_0x5837('0x18')]);router[_0x5837('0x19')](_0x5837('0xd'),auth[_0x5837('0xa')](),interaction['tracked'](_0x5837('0x16'),_0x5837('0x1a')),controller['update']);router[_0x5837('0x1b')](_0x5837('0xd'),auth[_0x5837('0xa')](),interaction['tracked']('whatsapp','whatsappinteraction:destroy'),controller[_0x5837('0x1c')]);router[_0x5837('0x1b')](_0x5837('0x14'),auth['isAuthenticated'](),controller[_0x5837('0x1d')]);module[_0x5837('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 6dd83fe..fd57bad 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 _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 +var _0x98a8=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0x98a8,0x12c));var _0x898a=function(_0x545138,_0x82459){_0x545138=_0x545138-0x0;var _0x3485fa=_0x98a8[_0x545138];return _0x3485fa;};'use strict';var Sequelize=require(_0x898a('0x0'));var moment=require(_0x898a('0x1'));module[_0x898a('0x2')]={'closed':{'type':Sequelize[_0x898a('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x898a('0x4')]},'disposition':{'type':Sequelize[_0x898a('0x5')]},'secondDisposition':{'type':Sequelize[_0x898a('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x898a('0x5')]},'phone':{'type':Sequelize[_0x898a('0x5')]},'read1stAt':{'type':Sequelize[_0x898a('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x898a('0x6')]('in',_0x898a('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x898a('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x898a('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 eaea6ac..100bd0b 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 _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 +var _0xc08c=['omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','pick','where','WhatsappInteractionId','merge','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','setTags','spread','Tag','findAll','color','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','server','tmp','attachments','format','User','fullname','push','CmContact','Contact','lastName','Attachment','Messages','createdAt','secret','read','Account','Owner','mkdirSync','Whatsapp','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','direction','out','System','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','zip-dir','bluebird','util','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./whatsappInteraction.socket','register','end','status','json','offset','limit','undefined','count','update','then','sendStatus','error','stack','name','send','index','map','WhatsappInteraction','type','getOptions','whatsapp','query','catch','show','params','model','rawAttributes','keys','filters','intersection','attributes','fields','length','include','options','create','body','find','describe','addMessage','WhatsappMessage','ids'];(function(_0x30822a,_0x536002){var _0xfd9d33=function(_0xf7d284){while(--_0xf7d284){_0x30822a['push'](_0x30822a['shift']());}};_0xfd9d33(++_0x536002);}(_0xc08c,0x1b7));var _0xcc08=function(_0x304936,_0x260419){_0x304936=_0x304936-0x0;var _0x10349b=_0xc08c[_0x304936];return _0x10349b;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xcc08('0x0'));var moment=require('moment');var BPromise=require(_0xcc08('0x1'));var util=require(_0xcc08('0x2'));var path=require('path');var ejs=require(_0xcc08('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xcc08('0x4'));var interaction=require(_0xcc08('0x5'));var qs=require(_0xcc08('0x6'));var pdf=require(_0xcc08('0x7'));var logger=require(_0xcc08('0x8'))(_0xcc08('0x9'));var config=require(_0xcc08('0xa'));var db=require(_0xcc08('0xb'))['db'];config[_0xcc08('0xc')]=_['defaults'](config[_0xcc08('0xc')],{'host':_0xcc08('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcc08('0xe'))[_0xcc08('0xf')](socket);function respondWithStatusCode(_0x12d686,_0x1c5c9b){_0x1c5c9b=_0x1c5c9b||0xcc;return function(_0xbcc3aa){if(_0xbcc3aa){return _0x12d686['sendStatus'](_0x1c5c9b);}return _0x12d686['status'](_0x1c5c9b)[_0xcc08('0x10')]();};}function respondWithResult(_0x4c3541,_0x130171){_0x130171=_0x130171||0xc8;return function(_0x20c847){if(_0x20c847){return _0x4c3541[_0xcc08('0x11')](_0x130171)[_0xcc08('0x12')](_0x20c847);}};}function respondWithFilteredResult(_0xc10bfe,_0x501faa){return function(_0x5d0d53){if(_0x5d0d53){var _0x582f95=typeof _0x501faa[_0xcc08('0x13')]==='undefined'&&typeof _0x501faa[_0xcc08('0x14')]===_0xcc08('0x15');var _0x757c6b=_0x5d0d53[_0xcc08('0x16')];var _0x1e8cd6=_0x582f95?0x0:_0x501faa[_0xcc08('0x13')];var _0xd5667=_0x582f95?_0x5d0d53[_0xcc08('0x16')]:_0x501faa[_0xcc08('0x13')]+_0x501faa[_0xcc08('0x14')];var _0x2ab8a2;if(_0xd5667>=_0x757c6b){_0xd5667=_0x757c6b;_0x2ab8a2=0xc8;}else{_0x2ab8a2=0xce;}_0xc10bfe[_0xcc08('0x11')](_0x2ab8a2);return _0xc10bfe['set']('Content-Range',_0x1e8cd6+'-'+_0xd5667+'/'+_0x757c6b)['json'](_0x5d0d53);}return null;};}function saveUpdates(_0x46954b){return function(_0x3fef47){if(_0x3fef47){return _0x3fef47[_0xcc08('0x17')](_0x46954b)[_0xcc08('0x18')](function(_0x15b9e2){return _0x15b9e2;});}return null;};}function removeEntity(_0x5b4f97){return function(_0x35de59){if(_0x35de59){return _0x35de59['destroy']()[_0xcc08('0x18')](function(){_0x5b4f97[_0xcc08('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13c2f0){return function(_0x31cafe){if(!_0x31cafe){_0x13c2f0[_0xcc08('0x19')](0x194);}return _0x31cafe;};}function handleError(_0x1dfa4c,_0x5a3cf7){_0x5a3cf7=_0x5a3cf7||0x1f4;return function(_0x20f3e8){logger[_0xcc08('0x1a')](_0x20f3e8[_0xcc08('0x1b')]);if(_0x20f3e8[_0xcc08('0x1c')]){delete _0x20f3e8[_0xcc08('0x1c')];}_0x1dfa4c['status'](_0x5a3cf7)[_0xcc08('0x1d')](_0x20f3e8);};}exports[_0xcc08('0x1e')]=function(_0x5db177,_0x9b3800){var _0x5180d0={};var _0x359963=_[_0xcc08('0x1f')](db[_0xcc08('0x20')]['rawAttributes'],function(_0x814cbb){return{'name':_0x814cbb['fieldName'],'type':_0x814cbb[_0xcc08('0x21')]['key']};});_0x5180d0=qs[_0xcc08('0x22')](_0x359963,_0x5db177);return interaction['findAll'](_0xcc08('0x23'),_0x5db177[_0xcc08('0x24')],_0x5db177['user'],_0x5180d0,_0x359963)[_0xcc08('0x18')](respondWithFilteredResult(_0x9b3800,_0x5180d0))[_0xcc08('0x25')](handleError(_0x9b3800,null));};exports[_0xcc08('0x26')]=function(_0x9bf1d1,_0x2154fa){var _0x1f4bb4={'raw':![],'where':{'id':_0x9bf1d1[_0xcc08('0x27')]['id']}},_0x14adea={};_0x14adea[_0xcc08('0x28')]=_['keys'](db[_0xcc08('0x20')][_0xcc08('0x29')]);_0x14adea['query']=_[_0xcc08('0x2a')](_0x9bf1d1['query']);_0x14adea[_0xcc08('0x2b')]=_[_0xcc08('0x2c')](_0x14adea[_0xcc08('0x28')],_0x14adea[_0xcc08('0x24')]);_0x1f4bb4[_0xcc08('0x2d')]=_[_0xcc08('0x2c')](_0x14adea[_0xcc08('0x28')],qs[_0xcc08('0x2e')](_0x9bf1d1[_0xcc08('0x24')][_0xcc08('0x2e')]));_0x1f4bb4[_0xcc08('0x2d')]=_0x1f4bb4['attributes'][_0xcc08('0x2f')]?_0x1f4bb4[_0xcc08('0x2d')]:_0x14adea[_0xcc08('0x28')];if(_0x9bf1d1[_0xcc08('0x24')]['includeAll']){_0x1f4bb4[_0xcc08('0x30')]=[{'all':!![]}];}_0x1f4bb4=_['merge']({},_0x1f4bb4,_0x9bf1d1[_0xcc08('0x31')]);return db['WhatsappInteraction']['find'](_0x1f4bb4)['then'](handleEntityNotFound(_0x2154fa,null))['then'](respondWithResult(_0x2154fa,null))['catch'](handleError(_0x2154fa,null));};exports[_0xcc08('0x32')]=function(_0x355b5f,_0x68c7f2){return db[_0xcc08('0x20')][_0xcc08('0x32')](_0x355b5f['body'],{})[_0xcc08('0x18')](respondWithResult(_0x68c7f2,0xc9))[_0xcc08('0x25')](handleError(_0x68c7f2,null));};exports['update']=function(_0x47c671,_0x3d2339){if(_0x47c671[_0xcc08('0x33')]['id']){delete _0x47c671['body']['id'];}return db[_0xcc08('0x20')]['find']({'where':{'id':_0x47c671[_0xcc08('0x27')]['id']}})['then'](handleEntityNotFound(_0x3d2339,null))['then'](saveUpdates(_0x47c671['body'],null))[_0xcc08('0x18')](respondWithResult(_0x3d2339,null))[_0xcc08('0x25')](handleError(_0x3d2339,null));};exports['destroy']=function(_0xaac8ac,_0x135665){return db[_0xcc08('0x20')][_0xcc08('0x34')]({'where':{'id':_0xaac8ac[_0xcc08('0x27')]['id']}})[_0xcc08('0x18')](handleEntityNotFound(_0x135665,null))[_0xcc08('0x18')](removeEntity(_0x135665,null))['catch'](handleError(_0x135665,null));};exports[_0xcc08('0x35')]=function(_0x2bd9c4,_0x55fdb4){return db['WhatsappInteraction']['describe']()[_0xcc08('0x18')](respondWithResult(_0x55fdb4,null))[_0xcc08('0x25')](handleError(_0x55fdb4,null));};exports[_0xcc08('0x36')]=function(_0x3c1334,_0xc66f12){return db[_0xcc08('0x37')]['find']({'where':{'id':_0x3c1334[_0xcc08('0x27')]['id']}})['then'](handleEntityNotFound(_0xc66f12,null))[_0xcc08('0x18')](function(_0xd7eea4){if(_0xd7eea4){return _0xd7eea4[_0xcc08('0x36')](_0x3c1334[_0xcc08('0x33')][_0xcc08('0x38')],_[_0xcc08('0x39')](_0x3c1334[_0xcc08('0x33')],['ids','id'])||{});}})['then'](respondWithResult(_0xc66f12,null))['catch'](handleError(_0xc66f12,null));};exports[_0xcc08('0x3a')]=function(_0x25dc1d,_0x4161b8){var _0x326648={'raw':![],'where':{}};var _0x4311e7={};var _0x326a6f={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xcc08('0x3b')]({'where':{'id':_0x25dc1d[_0xcc08('0x27')]['id']}})[_0xcc08('0x18')](handleEntityNotFound(_0x4161b8,null))[_0xcc08('0x18')](function(_0x3264f1){if(_0x3264f1){_0x4311e7[_0xcc08('0x28')]=_['keys'](db[_0xcc08('0x37')][_0xcc08('0x29')]);_0x4311e7[_0xcc08('0x24')]=_[_0xcc08('0x2a')](_0x25dc1d[_0xcc08('0x24')]);_0x4311e7[_0xcc08('0x2b')]=_[_0xcc08('0x2c')](_0x4311e7[_0xcc08('0x28')],_0x4311e7[_0xcc08('0x24')]);_0x326648[_0xcc08('0x2d')]=_['intersection'](_0x4311e7[_0xcc08('0x28')],qs[_0xcc08('0x2e')](_0x25dc1d[_0xcc08('0x24')][_0xcc08('0x2e')]));_0x326648[_0xcc08('0x2d')]=_0x326648[_0xcc08('0x2d')][_0xcc08('0x2f')]?_0x326648[_0xcc08('0x2d')]:_0x4311e7[_0xcc08('0x28')];if(!_0x25dc1d[_0xcc08('0x24')][_0xcc08('0x3c')](_0xcc08('0x3d'))){_0x326648[_0xcc08('0x14')]=qs[_0xcc08('0x14')](_0x25dc1d['query'][_0xcc08('0x14')]);_0x326648[_0xcc08('0x13')]=qs[_0xcc08('0x13')](_0x25dc1d[_0xcc08('0x24')][_0xcc08('0x13')]);}_0x326648[_0xcc08('0x3e')]=qs[_0xcc08('0x3f')](_0x25dc1d[_0xcc08('0x24')][_0xcc08('0x3f')]);_0x326648['where']=qs[_0xcc08('0x2b')](_[_0xcc08('0x40')](_0x25dc1d[_0xcc08('0x24')],_0x4311e7[_0xcc08('0x2b')]));_0x326648[_0xcc08('0x41')][_0xcc08('0x42')]=_0x3264f1['id'];if(_0x25dc1d[_0xcc08('0x24')]['filter']){_0x326648['where']=_[_0xcc08('0x43')](_0x326648['where'],{'$or':_[_0xcc08('0x1f')](_0x326648[_0xcc08('0x2d')],function(_0x490aee){var _0x270c90={};_0x270c90[_0x490aee]={'$like':'%'+_0x25dc1d[_0xcc08('0x24')][_0xcc08('0x44')]+'%'};return _0x270c90;})});}if(_0x25dc1d['query']['$gte']){var _0xfedf3c=_0x25dc1d[_0xcc08('0x24')][_0xcc08('0x45')][_0xcc08('0x46')](',');var _0x4eaa92={};_0x4eaa92[_0xfedf3c[0x0]]={'$gte':moment(_0xfedf3c[0x1])['format'](_0xcc08('0x47'))};_0x326648['where']=_['merge'](_0x326648[_0xcc08('0x41')],_0x4eaa92);}_0x326648=_['merge']({},_0x326648,_0x25dc1d[_0xcc08('0x31')]);return db[_0xcc08('0x37')]['count']({'where':_0x326648[_0xcc08('0x41')]})['then'](function(_0x286d5d){_0x326a6f[_0xcc08('0x16')]=_0x286d5d;if(_0x25dc1d[_0xcc08('0x24')]['includeAll']){_0x326648[_0xcc08('0x30')]=[{'all':!![]}];}return db[_0xcc08('0x37')]['findAll'](_0x326648);})[_0xcc08('0x18')](function(_0x238b23){_0x326a6f['rows']=_0x238b23;return _0x326a6f;});}})[_0xcc08('0x18')](respondWithFilteredResult(_0x4161b8,_0x326648))['catch'](handleError(_0x4161b8,null));};exports['addTags']=function(_0x410811,_0x8c711){return db['WhatsappInteraction'][_0xcc08('0x34')]({'where':{'id':_0x410811[_0xcc08('0x27')]['id']}})[_0xcc08('0x18')](handleEntityNotFound(_0x8c711,null))[_0xcc08('0x18')](function(_0x336450){if(_0x336450){return _0x336450[_0xcc08('0x48')](_0x410811[_0xcc08('0x33')]['ids'],_[_0xcc08('0x39')](_0x410811[_0xcc08('0x33')],[_0xcc08('0x38'),'id'])||{})[_0xcc08('0x49')](function(){return db[_0xcc08('0x4a')][_0xcc08('0x4b')]({'attributes':['id',_0xcc08('0x1c'),_0xcc08('0x4c')],'where':{'id':_0x410811[_0xcc08('0x33')]['ids']}});})[_0xcc08('0x18')](function(_0x16b71e){socket[_0xcc08('0x4d')](_0xcc08('0x4e'),{'id':Number(_0x410811[_0xcc08('0x27')]['id']),'tags':_0x16b71e||[]});return{'id':Number(_0x410811['params']['id']),'tags':_0x16b71e||[]};});}})[_0xcc08('0x18')](respondWithResult(_0x8c711,null))['catch'](handleError(_0x8c711,null));};exports['removeTags']=function(_0x1c4ae3,_0x1b1235){return db[_0xcc08('0x20')][_0xcc08('0x34')]({'where':{'id':_0x1c4ae3[_0xcc08('0x27')]['id']}})[_0xcc08('0x18')](handleEntityNotFound(_0x1b1235,null))[_0xcc08('0x18')](function(_0x5d7a3a){if(_0x5d7a3a){return _0x5d7a3a[_0xcc08('0x4f')](_0x1c4ae3[_0xcc08('0x24')][_0xcc08('0x38')]);}})[_0xcc08('0x18')](respondWithStatusCode(_0x1b1235,null))['catch'](handleError(_0x1b1235,null));};exports[_0xcc08('0x50')]=function(_0x466f2d,_0x3b4556){var _0x1f7c04=moment()[_0xcc08('0x51')]()[_0xcc08('0x52')]();var _0x341cfc=path[_0xcc08('0x53')](config[_0xcc08('0x54')],_0xcc08('0x55'),'files',_0xcc08('0x56'));var _0x3b3469=path[_0xcc08('0x53')](config[_0xcc08('0x54')],_0xcc08('0x55'),'files',_0xcc08('0x57'));var _0x17c451=path[_0xcc08('0x53')](_0x341cfc,_0x1f7c04);var _0x3e19ad=util[_0xcc08('0x58')]('transcript-%d-%s.zip',_0x466f2d[_0xcc08('0x27')]['id'],_0x1f7c04);var _0x2b589b=path[_0xcc08('0x53')](_0x341cfc,_0x3e19ad);var _0x139437=[];_0x139437['push']({'model':db[_0xcc08('0x59')],'as':'User','attributes':['id',_0xcc08('0x5a')],'raw':!![]});_0x139437[_0xcc08('0x5b')]({'model':db[_0xcc08('0x5c')],'as':_0xcc08('0x5d'),'attributes':['id','firstName',_0xcc08('0x5e')],'raw':!![]});if(_0x466f2d['query']['attachments']){_0x139437[_0xcc08('0x5b')]({'model':db[_0xcc08('0x5f')],'as':_0xcc08('0x5f'),'raw':!![]});}var _0x571c3a=[{'model':db[_0xcc08('0x37')],'as':_0xcc08('0x60'),'attributes':['id',_0xcc08('0x33'),_0xcc08('0x61'),'direction',_0xcc08('0x62'),_0xcc08('0x63')],'include':_0x139437}];_0x571c3a[_0xcc08('0x5b')]({'model':db['WhatsappAccount'],'as':_0xcc08('0x64'),'attributes':['id','name']});_0x571c3a[_0xcc08('0x5b')]({'model':db[_0xcc08('0x59')],'as':_0xcc08('0x65'),'attributes':['id',_0xcc08('0x5a')]});return db[_0xcc08('0x20')][_0xcc08('0x34')]({'where':{'id':_0x466f2d[_0xcc08('0x27')]['id']},'include':_0x571c3a})[_0xcc08('0x18')](handleEntityNotFound(_0x3b4556,null))[_0xcc08('0x18')](function(_0x2a0be7){if(_0x2a0be7){var _0x31f61d=_0x2a0be7['get']({'plain':!![]});fs[_0xcc08('0x66')](_0x17c451);var _0x105cce={'channel':_0xcc08('0x67'),'account':_0x31f61d[_0xcc08('0x64')][_0xcc08('0x1c')],'agent':_0x31f61d[_0xcc08('0x65')]?_0x31f61d[_0xcc08('0x65')]['fullname']:'N.A.','createdAt':moment(_0x31f61d[_0xcc08('0x61')])[_0xcc08('0x58')](_0xcc08('0x47'))['toString'](),'closedAt':_0x31f61d[_0xcc08('0x68')]?moment(_0x31f61d[_0xcc08('0x69')])[_0xcc08('0x58')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x31f61d[_0xcc08('0x6a')],'messages':_(_0x31f61d[_0xcc08('0x60')])[_0xcc08('0x44')]({'secret':![]})['map'](function(_0x3cb189){if(_0x3cb189['Attachment']){var _0x2cf569=path[_0xcc08('0x53')](_0x3b3469,_0x3cb189['Attachment'][_0xcc08('0x6b')]);if(fs[_0xcc08('0x6c')](_0x2cf569)){fs[_0xcc08('0x6d')](_0x2cf569)[_0xcc08('0x6e')](fs[_0xcc08('0x6f')](path[_0xcc08('0x53')](_0x17c451,_0x3cb189[_0xcc08('0x5f')]['basename'])));}}return{'date':moment(_0x3cb189[_0xcc08('0x61')])[_0xcc08('0x58')](_0xcc08('0x47'))['toString'](),'sender':_0x3cb189[_0xcc08('0x70')]===_0xcc08('0x71')?_0x3cb189[_0xcc08('0x59')]?_0x3cb189[_0xcc08('0x59')]['fullname']:_0xcc08('0x72'):_0x3cb189[_0xcc08('0x5d')]['firstName']+(_0x3cb189[_0xcc08('0x5d')][_0xcc08('0x5e')]?'\x20'+_0x3cb189[_0xcc08('0x5d')][_0xcc08('0x5e')]:''),'body':_0x3cb189[_0xcc08('0x5f')]?_0x3cb189['Attachment']['basename']:_0x3cb189[_0xcc08('0x33')],'direction':_0x3cb189[_0xcc08('0x70')]===_0xcc08('0x71')?'A':'C','secret':_0x3cb189[_0xcc08('0x62')],'read':_0x3cb189[_0xcc08('0x63')],'attachment':_0x3cb189['Attachment']};})[_0xcc08('0x73')]()};return ejs[_0xcc08('0x74')](path['join'](config[_0xcc08('0x54')],_0xcc08('0x55'),_0xcc08('0x75'),_0xcc08('0x76')),{'interaction':_0x105cce})[_0xcc08('0x18')](function(_0x14efec){var _0x50600e=path['join'](_0x17c451,_0xcc08('0x77')+_0x31f61d['id']+'-'+_0x1f7c04+_0xcc08('0x78'));var _0xca18f3={'path':_0x50600e,'channel':_0xcc08('0x67'),'interactionId':_0x31f61d['id']};return pdf['createPdfFromHTML'](_0x14efec,_0xca18f3);})[_0xcc08('0x18')](function(){return new BPromise(function(_0x47903c,_0x2f13e5){zipdir(_0x17c451,{'saveTo':_0x2b589b},function(_0x5e9e5f,_0x2c9c4d){if(_0x5e9e5f)return _0x2f13e5(_0x5e9e5f);return _0x47903c(_0x2c9c4d);});})[_0xcc08('0x18')](function(){return new BPromise(function(_0x3dbf88,_0x4614b8){rimraf(_0x17c451,function(_0x465c93){if(_0x465c93)_0x4614b8(_0x465c93);return _0x3dbf88();});});})['then'](function(){return _0x3b4556[_0xcc08('0x50')](_0x2b589b,_0x3e19ad,function(_0x4339bb){if(_0x4339bb){console[_0xcc08('0x79')](_0xcc08('0x7a'),_0x4339bb);}else{fs[_0xcc08('0x7b')](_0x2b589b);}});});});}else{return _0x3b4556[_0xcc08('0x19')](0xc8);}})['catch'](handleError(_0x3b4556,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 15b5fed..b874476 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 _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 +var _0x834d=['update','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','save'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x834d,0x140));var _0xd834=function(_0x585d42,_0x22cd11){_0x585d42=_0x585d42-0x0;var _0x356b3b=_0x834d[_0x585d42];return _0x356b3b;};'use strict';var EventEmitter=require(_0xd834('0x0'));var WhatsappInteraction=require(_0xd834('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xd834('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd834('0x2'),'afterUpdate':_0xd834('0x3'),'afterDestroy':_0xd834('0x4')};function emitEvent(_0xfee6e0){return function(_0x4a7903,_0x149c3e,_0x3f0759){_0x4a7903[_0xd834('0x5')]({'attributes':['id'],'raw':!![]})[_0xd834('0x6')](function(_0x28907e){_0x4a7903[_0xd834('0x7')](_0xd834('0x8'),_0x28907e[_0xd834('0x9')](function(_0x4565f1){return{'id':_0x4565f1['id']};}));return WhatsappMessage[_0xd834('0xa')]({'where':{'WhatsappInteractionId':_0x4a7903['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x402f47){_0x4a7903[_0xd834('0x7')]('unreadMessages',_0x402f47[_0xd834('0xb')]);WhatsappInteractionEvents[_0xd834('0xc')](_0xfee6e0+':'+_0x4a7903['id'],_0x4a7903);WhatsappInteractionEvents['emit'](_0xfee6e0,_0x4a7903);_0x3f0759(null);})[_0xd834('0xd')](_0x3f0759(null));};}for(var e in events){if(events[_0xd834('0xe')](e)){var event=events[e];WhatsappInteraction[_0xd834('0xf')](e,emitEvent(event));}}module[_0xd834('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 1143c59..feadeaa 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 _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 +var _0xf935=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions'];(function(_0x41da29,_0x5eee3d){var _0x3b288c=function(_0x88d477){while(--_0x88d477){_0x41da29['push'](_0x41da29['shift']());}};_0x3b288c(++_0x5eee3d);}(_0xf935,0x1eb));var _0x5f93=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf935[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5f93('0x0'));var util=require(_0x5f93('0x1'));var logger=require('../../config/logger')(_0x5f93('0x2'));var moment=require(_0x5f93('0x3'));var BPromise=require(_0x5f93('0x4'));var rp=require(_0x5f93('0x5'));var fs=require('fs');var path=require(_0x5f93('0x6'));var rimraf=require('rimraf');var config=require(_0x5f93('0x7'));var attributes=require(_0x5f93('0x8'));module[_0x5f93('0x9')]=function(_0x4414d1,_0x3c0f72){return _0x4414d1[_0x5f93('0xa')](_0x5f93('0xb'),attributes,{'tableName':_0x5f93('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x34a148,_0x4bb35a,_0x578ad0){if(_0x34a148[_0x5f93('0xd')](_0x5f93('0xe'))){_0x34a148[_0x5f93('0xf')]=moment()[_0x5f93('0x10')](_0x5f93('0x11'));}_0x578ad0(null,_0x34a148);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index ea6dbc0..c1a066e 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 _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 +var _0x2674=['UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','attributes','AddTagsToWhatsappInteraction','find','body','omit','spread','AddTags','lodash','moment','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x2674,0x189));var _0x4267=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x2674[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0x4267('0x0'));var util=require('util');var moment=require(_0x4267('0x1'));var BPromise=require('bluebird');var rs=require(_0x4267('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4267('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4267('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4267('0x5'));var client=jayson[_0x4267('0x6')][_0x4267('0x7')]({'port':0x232a});config[_0x4267('0x8')]=_[_0x4267('0x9')](config[_0x4267('0x8')],{'host':_0x4267('0xa'),'port':0x18eb});var socket=require(_0x4267('0xb'))(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0x4267('0xc')](socket);function respondWithRpcPromise(_0x351b54,_0x98feea,_0x498377){return new BPromise(function(_0x358696,_0x54b7e0){return client[_0x4267('0xd')](_0x351b54,_0x498377)[_0x4267('0xe')](function(_0x45aa67){logger[_0x4267('0xf')](_0x4267('0x10'),_0x98feea,_0x4267('0x11'));logger[_0x4267('0x12')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x98feea,_0x4267('0x11'),JSON[_0x4267('0x13')](_0x45aa67));if(_0x45aa67[_0x4267('0x14')]){if(_0x45aa67[_0x4267('0x14')][_0x4267('0x15')]===0x1f4){logger[_0x4267('0x14')](_0x4267('0x10'),_0x98feea,_0x45aa67[_0x4267('0x14')][_0x4267('0x16')]);return _0x54b7e0(_0x45aa67[_0x4267('0x14')]['message']);}logger[_0x4267('0x14')](_0x4267('0x10'),_0x98feea,_0x45aa67[_0x4267('0x14')][_0x4267('0x16')]);return _0x358696(_0x45aa67[_0x4267('0x14')][_0x4267('0x16')]);}else{logger[_0x4267('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x98feea,'request\x20sent');_0x358696(_0x45aa67[_0x4267('0x17')][_0x4267('0x16')]);}})[_0x4267('0x18')](function(_0x2533e2){logger[_0x4267('0x14')](_0x4267('0x10'),_0x98feea,_0x2533e2);_0x54b7e0(_0x2533e2);});});}exports[_0x4267('0x19')]=function(_0x52039c){var _0x1fb8ea=this;return new Promise(function(_0x104670,_0x203bb3){return db[_0x4267('0x1a')][_0x4267('0x1b')](_0x52039c['body'],{'raw':_0x52039c[_0x4267('0x1c')]?_0x52039c[_0x4267('0x1c')][_0x4267('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52039c[_0x4267('0x1c')]?_0x52039c[_0x4267('0x1c')][_0x4267('0x1e')]||null:null,'attributes':_0x52039c[_0x4267('0x1c')]?_0x52039c[_0x4267('0x1c')][_0x4267('0x1f')]||null:null,'limit':_0x52039c['options']?_0x52039c[_0x4267('0x1c')]['limit']||null:null})[_0x4267('0xe')](function(_0x4406dc){logger['info'](_0x4267('0x19'),_0x52039c);logger[_0x4267('0x12')](_0x4267('0x19'),_0x52039c,JSON[_0x4267('0x13')](_0x4406dc));_0x104670(_0x4406dc);})[_0x4267('0x18')](function(_0x185847){logger[_0x4267('0x14')](_0x4267('0x19'),_0x185847[_0x4267('0x16')],_0x52039c);_0x203bb3(_0x1fb8ea[_0x4267('0x14')](0x1f4,_0x185847['message']));});});};exports[_0x4267('0x20')]=function(_0x422a11){return new Promise(function(_0x18bade,_0x2f082d){return db['WhatsappInteraction'][_0x4267('0x21')]({'where':_0x422a11[_0x4267('0x1c')]?_0x422a11['options']['where']||null:null})['then'](function(_0x345479){if(_0x345479){return _0x345479['addTags'](_0x422a11[_0x4267('0x22')]['ids'],_[_0x4267('0x23')](_0x422a11[_0x4267('0x22')],['ids','id'])||{});}})[_0x4267('0x24')](function(_0x337a7d){logger[_0x4267('0xf')](_0x4267('0x25'),_0x422a11);logger[_0x4267('0x12')](_0x4267('0x25'),_0x422a11,JSON[_0x4267('0x13')](_0x337a7d));_0x18bade(_0x337a7d);})['catch'](function(_0x4c7b54){logger[_0x4267('0x14')](_0x4267('0x25'),_0x4c7b54[_0x4267('0x16')],_0x422a11);_0x2f082d(_this['error'](0x1f4,_0x4c7b54[_0x4267('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 60e8eaa..feeaebb 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 _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 +var _0xcef9=['update','emit','removeListener','register','whatsappInteraction:','./whatsappInteraction.events','save','remove'];(function(_0x3500f2,_0x142fb1){var _0x7ad03f=function(_0x2a1a07){while(--_0x2a1a07){_0x3500f2['push'](_0x3500f2['shift']());}};_0x7ad03f(++_0x142fb1);}(_0xcef9,0xc5));var _0x9cef=function(_0x19500a,_0x317e84){_0x19500a=_0x19500a-0x0;var _0x21f791=_0xcef9[_0x19500a];return _0x21f791;};'use strict';var WhatsappInteractionEvents=require(_0x9cef('0x0'));var events=[_0x9cef('0x1'),_0x9cef('0x2'),_0x9cef('0x3')];function createListener(_0x58c4a7,_0x35bffb){return function(_0x5f23ff){_0x35bffb[_0x9cef('0x4')](_0x58c4a7,_0x5f23ff);};}function removeListener(_0x35af20,_0x39c6d2){return function(){WhatsappInteractionEvents[_0x9cef('0x5')](_0x35af20,_0x39c6d2);};}exports[_0x9cef('0x6')]=function(_0x50e60f){for(var _0x1d613f=0x0,_0x337a66=events['length'];_0x1d613f<_0x337a66;_0x1d613f++){var _0x481bd0=events[_0x1d613f];var _0x2f6647=createListener(_0x9cef('0x7')+_0x481bd0,_0x50e60f);WhatsappInteractionEvents['on'](_0x481bd0,_0x2f6647);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index fd16f27..9236ac2 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 _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 +var _0x0184=['/:id/status','update','/:id/accept','accept','put','reject','delete','/:id','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','index','describe','show','tracked','whatsapp','whatsappmessage:create','create','post'];(function(_0x3b526c,_0x324f7a){var _0x24472c=function(_0x275511){while(--_0x275511){_0x3b526c['push'](_0x3b526c['shift']());}};_0x24472c(++_0x324f7a);}(_0x0184,0x1ae));var _0x4018=function(_0x4434f7,_0x431595){_0x4434f7=_0x4434f7-0x0;var _0x364db2=_0x0184[_0x4434f7];return _0x364db2;};'use strict';var multer=require(_0x4018('0x0'));var util=require(_0x4018('0x1'));var path=require(_0x4018('0x2'));var timeout=require(_0x4018('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4018('0x4'));var auth=require(_0x4018('0x5'));var interaction=require(_0x4018('0x6'));var config=require('../../config/environment');var controller=require(_0x4018('0x7'));router[_0x4018('0x8')]('/',auth[_0x4018('0x9')](),controller[_0x4018('0xa')]);router['get']('/describe',auth[_0x4018('0x9')](),controller[_0x4018('0xb')]);router[_0x4018('0x8')]('/:id',auth[_0x4018('0x9')](),controller[_0x4018('0xc')]);router['post']('/',auth[_0x4018('0x9')](),interaction[_0x4018('0xd')](_0x4018('0xe'),_0x4018('0xf')),controller[_0x4018('0x10')]);router[_0x4018('0x11')](_0x4018('0x12'),controller['status']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4018('0x13')]);router['put'](_0x4018('0x14'),auth[_0x4018('0x9')](),controller[_0x4018('0x15')]);router[_0x4018('0x16')]('/:id/reject',auth[_0x4018('0x9')](),controller[_0x4018('0x17')]);router[_0x4018('0x18')](_0x4018('0x19'),auth['isAuthenticated'](),controller[_0x4018('0x1a')]);module[_0x4018('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 2e266c0..b4f2ed7 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 _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 +var _0x975f=['DATE','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x490742,_0xa571bb){var _0x473ac6=function(_0x372737){while(--_0x372737){_0x490742['push'](_0x490742['shift']());}};_0x473ac6(++_0xa571bb);}(_0x975f,0x1e1));var _0xf975=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0x975f[_0x102ff9];return _0x24fa97;};'use strict';var Sequelize=require('sequelize');module[_0xf975('0x0')]={'body':{'type':Sequelize[_0xf975('0x1')](_0xf975('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xf975('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf975('0x4')]('in',_0xf975('0x5')),'defaultValue':_0xf975('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xf975('0x6')]},'readAt':{'type':Sequelize[_0xf975('0x7')]},'secret':{'type':Sequelize[_0xf975('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf975('0x6')]},'providerResponse':{'type':Sequelize[_0xf975('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index fe8e967..64c1f64 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 _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 +var _0x4c19=['[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','interface','SIP/%s','rejectmessage','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappMessage.socket','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','rows','show','params','keys','length','includeAll','create','body','find','destroy','describe','whatsapp-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','channel','motionChannel','event','accept','EventManager'];(function(_0x4b5f0c,_0x4aede3){var _0x579c42=function(_0x3565f0){while(--_0x3565f0){_0x4b5f0c['push'](_0x4b5f0c['shift']());}};_0x579c42(++_0x4aede3);}(_0x4c19,0x1af));var _0x94c1=function(_0x24b852,_0x2bad67){_0x24b852=_0x24b852-0x0;var _0x180ad2=_0x4c19[_0x24b852];return _0x180ad2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x94c1('0x0'));var jsonpatch=require(_0x94c1('0x1'));var rp=require(_0x94c1('0x2'));var moment=require(_0x94c1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x94c1('0x4'));var util=require(_0x94c1('0x5'));var path=require('path');var sox=require(_0x94c1('0x6'));var csv=require('to-csv');var ejs=require(_0x94c1('0x7'));var fs=require('fs');var fs_extra=require(_0x94c1('0x8'));var _=require(_0x94c1('0x9'));var squel=require('squel');var crypto=require(_0x94c1('0xa'));var jsforce=require(_0x94c1('0xb'));var deskjs=require(_0x94c1('0xc'));var toCsv=require(_0x94c1('0xd'));var querystring=require(_0x94c1('0xe'));var Papa=require('papaparse');var Redis=require(_0x94c1('0xf'));var authService=require(_0x94c1('0x10'));var qs=require(_0x94c1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x94c1('0x12'));var logger=require(_0x94c1('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x94c1('0x14'));var db=require(_0x94c1('0x15'))['db'];config[_0x94c1('0x16')]=_[_0x94c1('0x17')](config[_0x94c1('0x16')],{'host':_0x94c1('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x94c1('0x16')]));require(_0x94c1('0x19'))['register'](socket);var jayson=require(_0x94c1('0x1a'));var client=jayson[_0x94c1('0x1b')][_0x94c1('0x1c')]({'port':0x232c});var client9002=jayson[_0x94c1('0x1b')][_0x94c1('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xf7182b,_0x777f3e,_0x997d08,_0x23986d){return new BPromise(function(_0x32e601,_0x31de3d){var _0x3cb399=_0x23986d||client;return _0x3cb399[_0x94c1('0x1d')](_0xf7182b,_0x997d08)['then'](function(_0x285ff6){logger[_0x94c1('0x1e')](_0x94c1('0x1f'),_0x777f3e,_0x94c1('0x20'));logger['debug'](_0x94c1('0x21'),_0x777f3e,_0x94c1('0x20'),JSON[_0x94c1('0x22')](_0x285ff6));if(_0x285ff6[_0x94c1('0x23')]){if(_0x285ff6[_0x94c1('0x23')][_0x94c1('0x24')]===0x1f4){logger[_0x94c1('0x23')](_0x94c1('0x1f'),_0x777f3e,_0x285ff6['error'][_0x94c1('0x25')]);return _0x31de3d(_0x285ff6['error'][_0x94c1('0x25')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x777f3e,_0x285ff6[_0x94c1('0x23')]['message']);return _0x32e601(_0x285ff6[_0x94c1('0x23')][_0x94c1('0x25')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x777f3e,'request\x20sent');_0x32e601(_0x285ff6[_0x94c1('0x26')]['message']);}})[_0x94c1('0x27')](function(_0x501f90){logger[_0x94c1('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x777f3e,_0x501f90);_0x31de3d(_0x501f90);});});}function respondWithStatusCode(_0x35f875,_0x46ce91){_0x46ce91=_0x46ce91||0xcc;return function(_0x40d473){if(_0x40d473){return _0x35f875[_0x94c1('0x28')](_0x46ce91);}return _0x35f875[_0x94c1('0x29')](_0x46ce91)[_0x94c1('0x2a')]();};}function respondWithResult(_0x21fad6,_0x4474b0){_0x4474b0=_0x4474b0||0xc8;return function(_0x1882ca){if(_0x1882ca){return _0x21fad6[_0x94c1('0x29')](_0x4474b0)['json'](_0x1882ca);}};}function respondWithFilteredResult(_0x15d8ec,_0x42a8d7){return function(_0x5ca57f){if(_0x5ca57f){var _0x247a56=typeof _0x42a8d7[_0x94c1('0x2b')]===_0x94c1('0x2c')&&typeof _0x42a8d7[_0x94c1('0x2d')]==='undefined';var _0x4a6ed3=_0x5ca57f[_0x94c1('0x2e')];var _0x320e59=_0x247a56?0x0:_0x42a8d7[_0x94c1('0x2b')];var _0x31ef08=_0x247a56?_0x5ca57f[_0x94c1('0x2e')]:_0x42a8d7[_0x94c1('0x2b')]+_0x42a8d7['limit'];var _0x405799;if(_0x31ef08>=_0x4a6ed3){_0x31ef08=_0x4a6ed3;_0x405799=0xc8;}else{_0x405799=0xce;}_0x15d8ec[_0x94c1('0x29')](_0x405799);return _0x15d8ec['set'](_0x94c1('0x2f'),_0x320e59+'-'+_0x31ef08+'/'+_0x4a6ed3)['json'](_0x5ca57f);}return null;};}function patchUpdates(_0x55c74a){return function(_0x5430de){try{jsonpatch[_0x94c1('0x30')](_0x5430de,_0x55c74a,!![]);}catch(_0x58edd0){return BPromise[_0x94c1('0x31')](_0x58edd0);}return _0x5430de[_0x94c1('0x32')]();};}function saveUpdates(_0x5b6f04,_0x2ab1fd){return function(_0x228d59){if(_0x228d59){return _0x228d59[_0x94c1('0x33')](_0x5b6f04)[_0x94c1('0x34')](function(_0x5af1c6){return _0x5af1c6;});}return null;};}function removeEntity(_0x435c41,_0x8bc6f8){return function(_0x28c44b){if(_0x28c44b){return _0x28c44b['destroy']()[_0x94c1('0x34')](function(){_0x435c41['status'](0xcc)[_0x94c1('0x2a')]();});}};}function handleEntityNotFound(_0x1479c1,_0x110fc0){return function(_0x42406e){if(!_0x42406e){_0x1479c1[_0x94c1('0x28')](0x194);}return _0x42406e;};}function handleError(_0x387cc6,_0x243443){_0x243443=_0x243443||0x1f4;return function(_0x5086b5){logger['error'](_0x5086b5[_0x94c1('0x35')]);if(_0x5086b5[_0x94c1('0x36')]){delete _0x5086b5[_0x94c1('0x36')];}_0x387cc6[_0x94c1('0x29')](_0x243443)[_0x94c1('0x37')](_0x5086b5);};}exports[_0x94c1('0x38')]=function(_0x2bab95,_0x317c41){var _0x578fe0={},_0x3a7fb9={},_0x13a9ec={'count':0x0,'rows':[]};var _0x321fac=_[_0x94c1('0x39')](db[_0x94c1('0x3a')][_0x94c1('0x3b')],function(_0x305200){return{'name':_0x305200[_0x94c1('0x3c')],'type':_0x305200[_0x94c1('0x3d')]['key']};});_0x3a7fb9[_0x94c1('0x3e')]=_['map'](_0x321fac,_0x94c1('0x36'));_0x3a7fb9['query']=_['keys'](_0x2bab95[_0x94c1('0x3f')]);_0x3a7fb9[_0x94c1('0x40')]=_[_0x94c1('0x41')](_0x3a7fb9[_0x94c1('0x3e')],_0x3a7fb9[_0x94c1('0x3f')]);_0x578fe0[_0x94c1('0x42')]=_[_0x94c1('0x41')](_0x3a7fb9[_0x94c1('0x3e')],qs[_0x94c1('0x43')](_0x2bab95[_0x94c1('0x3f')][_0x94c1('0x43')]));_0x578fe0[_0x94c1('0x42')]=_0x578fe0[_0x94c1('0x42')]['length']?_0x578fe0['attributes']:_0x3a7fb9[_0x94c1('0x3e')];if(!_0x2bab95['query'][_0x94c1('0x44')](_0x94c1('0x45'))){_0x578fe0[_0x94c1('0x2d')]=qs['limit'](_0x2bab95[_0x94c1('0x3f')]['limit']);_0x578fe0[_0x94c1('0x2b')]=qs['offset'](_0x2bab95['query'][_0x94c1('0x2b')]);}_0x578fe0[_0x94c1('0x46')]=qs[_0x94c1('0x47')](_0x2bab95[_0x94c1('0x3f')]['sort']);_0x578fe0[_0x94c1('0x48')]=qs[_0x94c1('0x40')](_[_0x94c1('0x49')](_0x2bab95[_0x94c1('0x3f')],_0x3a7fb9['filters']),_0x321fac);if(_0x2bab95[_0x94c1('0x3f')][_0x94c1('0x4a')]){_0x578fe0[_0x94c1('0x48')]=_[_0x94c1('0x4b')](_0x578fe0[_0x94c1('0x48')],{'$or':_[_0x94c1('0x39')](_0x321fac,function(_0x4da376){if(_0x4da376[_0x94c1('0x3d')]!=='VIRTUAL'){var _0x2b9c07={};_0x2b9c07[_0x4da376['name']]={'$like':'%'+_0x2bab95[_0x94c1('0x3f')][_0x94c1('0x4a')]+'%'};return _0x2b9c07;}})});}_0x578fe0=_['merge']({},_0x578fe0,_0x2bab95[_0x94c1('0x4c')]);var _0x1907a6={'where':_0x578fe0[_0x94c1('0x48')]};return db['WhatsappMessage'][_0x94c1('0x2e')](_0x1907a6)[_0x94c1('0x34')](function(_0x81240a){_0x13a9ec['count']=_0x81240a;if(_0x2bab95[_0x94c1('0x3f')]['includeAll']){_0x578fe0[_0x94c1('0x4d')]=[{'all':!![]}];}return db[_0x94c1('0x3a')]['findAll'](_0x578fe0);})[_0x94c1('0x34')](function(_0x57cf6b){_0x13a9ec[_0x94c1('0x4e')]=_0x57cf6b;return _0x13a9ec;})[_0x94c1('0x34')](respondWithFilteredResult(_0x317c41,_0x578fe0))[_0x94c1('0x27')](handleError(_0x317c41,null));};exports[_0x94c1('0x4f')]=function(_0x49b716,_0x13778b){var _0x53b85c={'raw':!![],'where':{'id':_0x49b716[_0x94c1('0x50')]['id']}},_0x331b8f={};_0x331b8f['model']=_[_0x94c1('0x51')](db[_0x94c1('0x3a')]['rawAttributes']);_0x331b8f['query']=_['keys'](_0x49b716[_0x94c1('0x3f')]);_0x331b8f['filters']=_[_0x94c1('0x41')](_0x331b8f[_0x94c1('0x3e')],_0x331b8f['query']);_0x53b85c['attributes']=_[_0x94c1('0x41')](_0x331b8f['model'],qs['fields'](_0x49b716[_0x94c1('0x3f')][_0x94c1('0x43')]));_0x53b85c[_0x94c1('0x42')]=_0x53b85c[_0x94c1('0x42')][_0x94c1('0x52')]?_0x53b85c['attributes']:_0x331b8f[_0x94c1('0x3e')];if(_0x49b716['query'][_0x94c1('0x53')]){_0x53b85c[_0x94c1('0x4d')]=[{'all':!![]}];}_0x53b85c=_['merge']({},_0x53b85c,_0x49b716[_0x94c1('0x4c')]);return db[_0x94c1('0x3a')]['find'](_0x53b85c)['then'](handleEntityNotFound(_0x13778b,null))[_0x94c1('0x34')](respondWithResult(_0x13778b,null))[_0x94c1('0x27')](handleError(_0x13778b,null));};exports[_0x94c1('0x54')]=function(_0x10d4e5,_0x5ef06e){return db[_0x94c1('0x3a')][_0x94c1('0x54')](_0x10d4e5[_0x94c1('0x55')],{})[_0x94c1('0x34')](respondWithResult(_0x5ef06e,0xc9))[_0x94c1('0x27')](handleError(_0x5ef06e,null));};exports[_0x94c1('0x33')]=function(_0x5a53ee,_0x3d46c5){if(_0x5a53ee[_0x94c1('0x55')]['id']){delete _0x5a53ee[_0x94c1('0x55')]['id'];}return db[_0x94c1('0x3a')][_0x94c1('0x56')]({'where':{'id':_0x5a53ee['params']['id']}})['then'](handleEntityNotFound(_0x3d46c5,null))[_0x94c1('0x34')](saveUpdates(_0x5a53ee[_0x94c1('0x55')],null))[_0x94c1('0x34')](respondWithResult(_0x3d46c5,null))[_0x94c1('0x27')](handleError(_0x3d46c5,null));};exports[_0x94c1('0x57')]=function(_0x45650e,_0x108828){return db[_0x94c1('0x3a')]['find']({'where':{'id':_0x45650e['params']['id']}})[_0x94c1('0x34')](handleEntityNotFound(_0x108828,null))[_0x94c1('0x34')](removeEntity(_0x108828,null))[_0x94c1('0x27')](handleError(_0x108828,null));};exports[_0x94c1('0x58')]=function(_0x1d5659,_0x22ca51){return db['WhatsappMessage']['describe']()[_0x94c1('0x34')](respondWithResult(_0x22ca51,null))['catch'](handleError(_0x22ca51,null));};var interaction_log=require(_0x94c1('0x13'))(_0x94c1('0x59'));exports['accept']=function(_0x199eac,_0x5e1262,_0x305aea){var _0xce1ba7={'agent':{},'channel':'whatsapp'};if(_0x199eac[_0x94c1('0x55')]['id']){delete _0x199eac[_0x94c1('0x55')]['id'];}_0x199eac[_0x94c1('0x55')][_0x94c1('0x5a')]=!![];_0x199eac[_0x94c1('0x55')][_0x94c1('0x5b')]=moment()[_0x94c1('0x5c')](_0x94c1('0x5d'));_0x199eac[_0x94c1('0x55')][_0x94c1('0x5e')]=_0x199eac[_0x94c1('0x55')][_0x94c1('0x5e')]||_0x199eac[_0x94c1('0x5f')]['id'];_0xce1ba7['agent']['id']=_0x199eac[_0x94c1('0x55')][_0x94c1('0x5e')];return db[_0x94c1('0x3a')][_0x94c1('0x56')]({'where':{'id':_0x199eac['params']['id'],'UserId':null}})[_0x94c1('0x34')](handleEntityNotFound(_0x5e1262,null))[_0x94c1('0x34')](saveUpdates(_0x199eac[_0x94c1('0x55')],null))[_0x94c1('0x34')](function(_0xe5ba4c){if(_0xe5ba4c){_0xce1ba7[_0x94c1('0x25')]=_0xe5ba4c[_0x94c1('0x60')]({'plain':!![]});return db[_0x94c1('0x61')][_0x94c1('0x56')]({'where':{'id':_0xe5ba4c[_0x94c1('0x62')]}});}return null;})[_0x94c1('0x34')](handleEntityNotFound(_0x5e1262,null))['then'](function(_0x1d4269){if(_0x1d4269){return _0x1d4269[_0x94c1('0x33')]({'UserId':_0x199eac[_0x94c1('0x55')][_0x94c1('0x5e')],'read1stAt':_[_0x94c1('0x63')](_0x1d4269['read1stAt'])?moment()[_0x94c1('0x5c')](_0x94c1('0x5d')):undefined});}return null;})[_0x94c1('0x34')](function(_0x44b9d0){if(_0x44b9d0){_0xce1ba7[_0x94c1('0x64')]=_0x44b9d0[_0x94c1('0x60')]({'plain':!![]});interaction_log[_0x94c1('0x1e')](_0x94c1('0x65'),_0x199eac[_0x94c1('0x5f')]['id'],_0x199eac[_0x94c1('0x5f')]['name'],_0x199eac['user'][_0x94c1('0x66')],_0xce1ba7[_0x94c1('0x64')]['id'],_0x199eac[_0x94c1('0x55')]?JSON[_0x94c1('0x22')](_0x199eac['body']):_0x94c1('0x67'));return respondWithRpcPromise(_0x94c1('0x68'),_0x94c1('0x69'),_0xce1ba7);}return null;})['then'](function(_0x2f54d9){var _0x49bec3=_0x94c1('0x6a')+_0x2f54d9[_0x94c1('0x25')][_0x94c1('0x6b')];return db['sequelize'][_0x94c1('0x3f')](_0x49bec3,{'type':db['Sequelize'][_0x94c1('0x6c')][_0x94c1('0x6d')],'raw':!![]})['then'](function(_0x4754b2){return _0x4754b2;});})[_0x94c1('0x34')](function(_0x196a24){if(_0x196a24){_0xce1ba7[_0x94c1('0x25')]['contact']=_0x196a24[0x0];if(!_0x199eac[_0x94c1('0x55')][_0x94c1('0x5e')])return;return db[_0x94c1('0x6e')][_0x94c1('0x56')]({'where':{'id':_0x199eac['body'][_0x94c1('0x5e')],'role':_0x94c1('0x6f')},'attributes':['id',_0x94c1('0x36'),_0x94c1('0x70'),_0x94c1('0x71'),_0x94c1('0x72')],'raw':!![]});}return null;})['then'](function(_0x34a77e){if(!_0x34a77e)return null;_0xce1ba7['message']['agent']=_0x34a77e;return _0xce1ba7;})['then'](function(_0x120ce4){if(_0x120ce4){if(_0x199eac[_0x94c1('0x55')][_0x94c1('0x73')]){_0xce1ba7[_0x94c1('0x25')]['interface']=util['format']('SIP/%s',_0x199eac[_0x94c1('0x5f')]['name']);_0xce1ba7[_0x94c1('0x25')][_0x94c1('0x74')]=_0xce1ba7[_0x94c1('0x74')];_0xce1ba7[_0x94c1('0x25')][_0x94c1('0x75')]=_0xce1ba7[_0x94c1('0x74')];_0xce1ba7[_0x94c1('0x25')][_0x94c1('0x76')]=_0x94c1('0x77');return respondWithRpcPromise(_0x94c1('0x78'),_0x94c1('0x78'),{'event':'acceptmessage','message':_0xce1ba7[_0x94c1('0x25')]},client9002)[_0x94c1('0x34')](function(){return _0xce1ba7;});}return _0xce1ba7;}return null;})['then'](respondWithResult(_0x5e1262,null))[_0x94c1('0x27')](handleError(_0x5e1262,null));};var interaction_log=require(_0x94c1('0x13'))(_0x94c1('0x59'));exports[_0x94c1('0x31')]=function(_0x252ec7,_0xc618d2,_0x521b50){var _0x2332ee={'agent':{},'channel':'whatsapp'};if(_0x252ec7[_0x94c1('0x55')]['id']){delete _0x252ec7['body']['id'];}_0x252ec7[_0x94c1('0x55')][_0x94c1('0x5e')]=_0x252ec7['body'][_0x94c1('0x5e')]||_0x252ec7[_0x94c1('0x5f')]['id'];_0x2332ee['agent']['id']=_0x252ec7[_0x94c1('0x55')]['UserId'];return db[_0x94c1('0x3a')][_0x94c1('0x56')]({'where':{'id':_0x252ec7[_0x94c1('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xc618d2,null))[_0x94c1('0x34')](function(_0x16d1ee){if(_0x16d1ee){_0x2332ee[_0x94c1('0x25')]=_0x16d1ee[_0x94c1('0x60')]({'plain':!![]});return db[_0x94c1('0x61')]['find']({'where':{'id':_0x16d1ee[_0x94c1('0x62')]}});}return null;})[_0x94c1('0x34')](handleEntityNotFound(_0xc618d2,null))['then'](function(_0x94cff){if(_0x94cff){_0x2332ee[_0x94c1('0x64')]=_0x94cff['get']({'plain':!![]});interaction_log[_0x94c1('0x1e')](_0x94c1('0x79'),_0x252ec7[_0x94c1('0x5f')]['id'],_0x252ec7[_0x94c1('0x5f')][_0x94c1('0x36')],_0x252ec7['user'][_0x94c1('0x66')],_0x2332ee[_0x94c1('0x64')]['id'],_0x252ec7[_0x94c1('0x55')]?JSON[_0x94c1('0x22')](_0x252ec7[_0x94c1('0x55')]):_0x94c1('0x67'));return respondWithRpcPromise(_0x94c1('0x7a'),_0x94c1('0x7b'),_0x2332ee);}return null;})[_0x94c1('0x34')](function(_0x4e9047){var _0x18c46c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e9047[_0x94c1('0x25')][_0x94c1('0x6b')];return db['sequelize'][_0x94c1('0x3f')](_0x18c46c,{'type':db['Sequelize'][_0x94c1('0x6c')]['SELECT'],'raw':!![]})[_0x94c1('0x34')](function(_0x3632a4){return _0x3632a4;});})['then'](function(_0x45db96){if(_0x45db96){_0x2332ee[_0x94c1('0x25')][_0x94c1('0x7c')]=_0x45db96[0x0];if(!_0x252ec7[_0x94c1('0x55')][_0x94c1('0x5e')])return;return db[_0x94c1('0x6e')][_0x94c1('0x56')]({'where':{'id':_0x252ec7[_0x94c1('0x55')][_0x94c1('0x5e')],'role':_0x94c1('0x6f')},'attributes':['id',_0x94c1('0x36'),_0x94c1('0x70'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x39824e){if(!_0x39824e)return null;_0x2332ee['message'][_0x94c1('0x6f')]=_0x39824e;return _0x2332ee;})[_0x94c1('0x34')](function(_0x52d276){if(_0x52d276){_0x52d276[_0x94c1('0x25')][_0x94c1('0x7d')]=util[_0x94c1('0x5c')](_0x94c1('0x7e'),_0x252ec7[_0x94c1('0x5f')][_0x94c1('0x36')]);_0x52d276[_0x94c1('0x25')][_0x94c1('0x74')]=_0x2332ee[_0x94c1('0x74')];_0x52d276[_0x94c1('0x25')]['motionChannel']=_0x2332ee[_0x94c1('0x74')];_0x52d276[_0x94c1('0x25')][_0x94c1('0x76')]=_0x94c1('0x31');respondWithRpcPromise('EventManager',_0x94c1('0x78'),{'event':_0x94c1('0x7f'),'message':_0x52d276[_0x94c1('0x25')]},client9002);return _0x2332ee;}return null;})[_0x94c1('0x34')](respondWithResult(_0xc618d2,null))[_0x94c1('0x27')](handleError(_0xc618d2,null));};exports['status']=function(_0x2cce06,_0xb7e45b,_0x434e94){if(_0x2cce06[_0x94c1('0x55')]['id']){delete _0x2cce06['body']['id'];}var _0x42bb92;return db[_0x94c1('0x3a')][_0x94c1('0x56')]({'where':{'id':_0x2cce06[_0x94c1('0x50')]['id']}})[_0x94c1('0x34')](handleEntityNotFound(_0xb7e45b,null))[_0x94c1('0x34')](function(_0x985c52){if(_0x985c52){_0x42bb92=_0x985c52;return db['WhatsappAccount'][_0x94c1('0x56')]({'where':{'id':_0x985c52[_0x94c1('0x80')]}});}})[_0x94c1('0x34')](handleEntityNotFound(_0xb7e45b,null))[_0x94c1('0x34')](function(_0x175099){if(_0x175099){logger[_0x94c1('0x81')](_0x94c1('0x82'),_0x94c1('0x29'),_0x94c1('0x83'),_0x175099[_0x94c1('0x3d')],util[_0x94c1('0x84')](_0x2cce06[_0x94c1('0x55')],{'showHidden':![],'depth':null}));switch(_0x175099[_0x94c1('0x3d')]){case'twilio':if(_0x2cce06[_0x94c1('0x55')]['MessageSid']&&_0x2cce06[_0x94c1('0x55')][_0x94c1('0x85')]===_0x42bb92[_0x94c1('0x86')]&&_0x2cce06[_0x94c1('0x55')][_0x94c1('0x87')]&&_0x2cce06[_0x94c1('0x55')][_0x94c1('0x87')]===_0x94c1('0x5a')){return _0x42bb92[_0x94c1('0x33')]({'read':!![]});}else{logger[_0x94c1('0x23')](_0x94c1('0x88'),_0x94c1('0x29'),_0x94c1('0x89'),util[_0x94c1('0x84')](_0x2cce06[_0x94c1('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x42bb92;}})[_0x94c1('0x34')](respondWithResult(_0xb7e45b,null))[_0x94c1('0x27')](handleError(_0xb7e45b,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 687b371..8f88615 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 _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 +var _0x04b8=['exports','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x4e6fc7,_0x6b9a5d){var _0x3c2ef6=function(_0x3907ed){while(--_0x3907ed){_0x4e6fc7['push'](_0x4e6fc7['shift']());}};_0x3c2ef6(++_0x6b9a5d);}(_0x04b8,0x159));var _0x804b=function(_0x5109c1,_0x37195b){_0x5109c1=_0x5109c1-0x0;var _0x47c577=_0x04b8[_0x5109c1];return _0x47c577;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x804b('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x804b('0x1')](0x0);var events={'afterCreate':_0x804b('0x2'),'afterUpdate':'update','afterDestroy':_0x804b('0x3')};function emitEvent(_0x1cd188){return function(_0x5857dc,_0x3530f6,_0x1c3474){WhatsappMessageEvents[_0x804b('0x4')](_0x1cd188+':'+_0x5857dc['id'],_0x5857dc);WhatsappMessageEvents['emit'](_0x1cd188,_0x5857dc);_0x1c3474(null);};}for(var e in events){if(events[_0x804b('0x5')](e)){var event=events[e];WhatsappMessage[_0x804b('0x6')](e,emitEvent(event));}}module[_0x804b('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 ea3a824..6984df3 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 _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 +var _0x73c9=['then','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','catch','error','find','type','twilio','accountSid','authToken','phone','messages','body','whatsapp:','remote','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/messages/','POST','Bearer\x20'];(function(_0x48f3f8,_0x13e1ca){var _0x176899=function(_0x485046){while(--_0x485046){_0x48f3f8['push'](_0x48f3f8['shift']());}};_0x176899(++_0x13e1ca);}(_0x73c9,0x11a));var _0x973c=function(_0x18c6e1,_0x17c0f2){_0x18c6e1=_0x18c6e1-0x0;var _0x8f13b6=_0x73c9[_0x18c6e1];return _0x8f13b6;};'use strict';var _=require(_0x973c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x973c('0x1'));var moment=require('moment');var BPromise=require(_0x973c('0x2'));var rp=require(_0x973c('0x3'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x973c('0x4'));var rimraf=require(_0x973c('0x5'));var config=require(_0x973c('0x6'));var attributes=require(_0x973c('0x7'));module['exports']=function(_0x1a0611,_0x2d31eb){return _0x1a0611[_0x973c('0x8')](_0x973c('0x9'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x973c('0xa')]},{'name':_0x973c('0xb'),'fields':['body'],'type':_0x973c('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x195ac8,_0x205891,_0x54ee1c){var _0xeebda=_0x1a0611[_0x973c('0xd')];var _0x19d316=_0x195ac8[_0x973c('0xe')]({'plain':!![]});if(_0x19d316[_0x973c('0xf')][_0x973c('0x10')]()==='in'||_0x19d316[_0x973c('0xf')][_0x973c('0x10')]()===_0x973c('0x11')&&!_0x19d316[_0x973c('0x12')]&&!_[_0x973c('0x13')](_0x19d316[_0x973c('0x14')])){_0xeebda[_0x973c('0x15')][_0x973c('0x16')]({'where':{'id':_0x19d316[_0x973c('0x17')]}})['then'](function(_0xb1a895){if(_0xb1a895){_0xb1a895[_0x973c('0x18')]({'lastMsgAt':_0x19d316['createdAt'],'lastMsgDirection':_0x19d316[_0x973c('0xf')][_0x973c('0x10')]()});}})[_0x973c('0x19')](function(_0x4c8536){console[_0x973c('0x1a')](_0x4c8536);});}if(_0x19d316[_0x973c('0xf')]===_0x973c('0x11')&&!_0x19d316[_0x973c('0x12')]){var _0x29f85b;_0xeebda['WhatsappAccount'][_0x973c('0x1b')]({'where':{'id':_0x19d316['WhatsappAccountId']},'raw':!![]})['then'](function(_0x1c7cf4){_0x29f85b=_0x1c7cf4;if(_0x29f85b&&_0x29f85b[_0x973c('0x1c')]){switch(_0x29f85b['type']){case _0x973c('0x1d'):var _0x3335d3=require(_0x973c('0x1d'));if(_0x29f85b[_0x973c('0x1e')]&&_0x29f85b[_0x973c('0x1f')]&&_0x29f85b[_0x973c('0x20')]){var _0x44dd72=new _0x3335d3(_0x29f85b[_0x973c('0x1e')],_0x29f85b[_0x973c('0x1f')]);_0x44dd72[_0x973c('0x21')]['create']({'body':_0x19d316[_0x973c('0x22')],'to':_0x973c('0x23')+_0x19d316[_0x973c('0x20')],'from':_0x973c('0x23')+_0x29f85b['phone'],'statusCallback':_0x29f85b[_0x973c('0x24')]+'/api/whatsapp/messages/'+_0x19d316['id']+_0x973c('0x25')+_0x29f85b[_0x973c('0x26')]})['then'](function(_0xc6b044){if(_0xc6b044[_0x973c('0x27')]){return _0x195ac8[_0x973c('0x18')]({'messageId':_0xc6b044['sid']});}})[_0x973c('0x19')](function(_0x220739){logger[_0x973c('0x1a')](_0x973c('0x28'),_0x973c('0x29'),_0x973c('0x1d'),util[_0x973c('0x2a')](_0x220739,{'showHidden':![],'depth':null}));});}else{logger[_0x973c('0x1a')](_0x973c('0x28'),_0x973c('0x29'),_0x973c('0x1d'),_0x973c('0x2b'));}break;case _0x973c('0x2c'):var _0x384cb7=_0x29f85b['accountSid'];var _0x11d09e=_0x29f85b[_0x973c('0x1f')];var _0x5669a0=_0x29f85b['baseUrl']+'/whatsapp/v1/'+_0x384cb7+_0x973c('0x2d');var _0x495215={'to':[_0x19d316['phone']],'message':{'type':'text','text':_0x19d316[_0x973c('0x22')]}};var _0x26e9c3={'method':_0x973c('0x2e'),'uri':_0x5669a0,'headers':{'Authorization':_0x973c('0x2f')+_0x11d09e,'Content-Type':'application/json'},'body':_0x495215,'json':!![]};rp(_0x26e9c3)[_0x973c('0x30')](function(_0x5de5e3){if(_0x5de5e3[_0x973c('0x31')][0x0][_0x973c('0x32')]){return _0x195ac8[_0x973c('0x18')]({'messageId':_0x5de5e3[_0x973c('0x31')][0x0]['message_id']});}})[_0x973c('0x19')](function(_0x19fb21){logger['err'](_0x973c('0x33'),_0x19fb21);});break;}}})[_0x973c('0x34')](function(){_0x54ee1c();});}else{_0x54ee1c();}}},'charset':_0x973c('0x35'),'collate':_0x973c('0x36')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index a386ebe..2dd138a 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 _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 +var _0xa4bf=['then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateWhatsappMessage','WhatsappMessage','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','request'];(function(_0x5563fd,_0x1f8c42){var _0x329495=function(_0x363728){while(--_0x363728){_0x5563fd['push'](_0x5563fd['shift']());}};_0x329495(++_0x1f8c42);}(_0xa4bf,0x1c0));var _0xfa4b=function(_0x11a1a6,_0x3bb701){_0x11a1a6=_0x11a1a6-0x0;var _0x38f91e=_0xa4bf[_0x11a1a6];return _0x38f91e;};'use strict';var _=require(_0xfa4b('0x0'));var util=require(_0xfa4b('0x1'));var moment=require(_0xfa4b('0x2'));var BPromise=require(_0xfa4b('0x3'));var rs=require(_0xfa4b('0x4'));var fs=require('fs');var Redis=require(_0xfa4b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa4b('0x6'));var logger=require(_0xfa4b('0x7'))(_0xfa4b('0x8'));var config=require(_0xfa4b('0x9'));var jayson=require(_0xfa4b('0xa'));var client=jayson[_0xfa4b('0xb')]['http']({'port':0x232a});config['redis']=_[_0xfa4b('0xc')](config[_0xfa4b('0xd')],{'host':_0xfa4b('0xe'),'port':0x18eb});var socket=require(_0xfa4b('0xf'))(new Redis(config[_0xfa4b('0xd')]));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0xd5ab99,_0x1fa59c,_0x5f823c){return new BPromise(function(_0x5486e7,_0x11dfc1){return client[_0xfa4b('0x10')](_0xd5ab99,_0x5f823c)[_0xfa4b('0x11')](function(_0x43fa22){logger[_0xfa4b('0x12')](_0xfa4b('0x13'),_0x1fa59c,_0xfa4b('0x14'));logger[_0xfa4b('0x15')](_0xfa4b('0x16'),_0x1fa59c,_0xfa4b('0x14'),JSON[_0xfa4b('0x17')](_0x43fa22));if(_0x43fa22[_0xfa4b('0x18')]){if(_0x43fa22['error']['code']===0x1f4){logger[_0xfa4b('0x18')](_0xfa4b('0x13'),_0x1fa59c,_0x43fa22['error'][_0xfa4b('0x19')]);return _0x11dfc1(_0x43fa22[_0xfa4b('0x18')][_0xfa4b('0x19')]);}logger[_0xfa4b('0x18')](_0xfa4b('0x13'),_0x1fa59c,_0x43fa22[_0xfa4b('0x18')][_0xfa4b('0x19')]);return _0x5486e7(_0x43fa22[_0xfa4b('0x18')]['message']);}else{logger[_0xfa4b('0x12')](_0xfa4b('0x13'),_0x1fa59c,_0xfa4b('0x14'));_0x5486e7(_0x43fa22['result'][_0xfa4b('0x19')]);}})[_0xfa4b('0x1a')](function(_0x24a781){logger[_0xfa4b('0x18')](_0xfa4b('0x13'),_0x1fa59c,_0x24a781);_0x11dfc1(_0x24a781);});});}exports[_0xfa4b('0x1b')]=function(_0x582485){var _0x427c2b=this;return new Promise(function(_0x2c88f1,_0x24cc90){return db[_0xfa4b('0x1c')]['create'](_0x582485[_0xfa4b('0x1d')],{'raw':_0x582485['options']?_0x582485[_0xfa4b('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xfa4b('0x11')](function(_0x938217){logger[_0xfa4b('0x12')](_0xfa4b('0x1b'),_0x582485);logger[_0xfa4b('0x15')](_0xfa4b('0x1b'),_0x582485,JSON[_0xfa4b('0x17')](_0x938217));_0x2c88f1(_0x938217);})[_0xfa4b('0x1a')](function(_0x856121){logger[_0xfa4b('0x18')](_0xfa4b('0x1b'),_0x856121[_0xfa4b('0x19')],_0x582485);_0x24cc90(_0x427c2b[_0xfa4b('0x18')](0x1f4,_0x856121[_0xfa4b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index ea0a143..5bdf65a 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 _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 +var _0xf1a9=['register','length','./whatsappMessage.events','save','remove','emit'];(function(_0x11309c,_0xe18a74){var _0x3fea9c=function(_0xeb11c3){while(--_0xeb11c3){_0x11309c['push'](_0x11309c['shift']());}};_0x3fea9c(++_0xe18a74);}(_0xf1a9,0x170));var _0x9f1a=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xf1a9[_0x5ddb1c];return _0x354adc;};'use strict';var WhatsappMessageEvents=require(_0x9f1a('0x0'));var events=[_0x9f1a('0x1'),_0x9f1a('0x2'),'update'];function createListener(_0x1b3651,_0x2f3c45){return function(_0x4a6c66){_0x2f3c45[_0x9f1a('0x3')](_0x1b3651,_0x4a6c66);};}function removeListener(_0x2becc4,_0x245ed1){return function(){WhatsappMessageEvents['removeListener'](_0x2becc4,_0x245ed1);};}exports[_0x9f1a('0x4')]=function(_0xddd1b0){for(var _0x444948=0x0,_0x510b2f=events[_0x9f1a('0x5')];_0x444948<_0x510b2f;_0x444948++){var _0x55147a=events[_0x444948];var _0x3c82cc=createListener('whatsappMessage:'+_0x55147a,_0xddd1b0);WhatsappMessageEvents['on'](_0x55147a,_0x3c82cc);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 4f28e84..d2ab4a7 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 _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 +var _0x334f=['fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents','put','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x1a3057,_0x275afb){var _0x3585b5=function(_0x3935c7){while(--_0x3935c7){_0x1a3057['push'](_0x1a3057['shift']());}};_0x3585b5(++_0x275afb);}(_0x334f,0xa2));var _0xf334=function(_0x40851d,_0x23bb4b){_0x40851d=_0x40851d-0x0;var _0x3aea1f=_0x334f[_0x40851d];return _0x3aea1f;};'use strict';var multer=require(_0xf334('0x0'));var util=require(_0xf334('0x1'));var path=require(_0xf334('0x2'));var timeout=require(_0xf334('0x3'));var express=require(_0xf334('0x4'));var router=express[_0xf334('0x5')]();var fs_extra=require(_0xf334('0x6'));var auth=require(_0xf334('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf334('0x8'));var controller=require(_0xf334('0x9'));router[_0xf334('0xa')]('/',auth[_0xf334('0xb')](),controller[_0xf334('0xc')]);router[_0xf334('0xa')](_0xf334('0xd'),auth['isAuthenticated'](),controller[_0xf334('0xe')]);router['get'](_0xf334('0xf'),auth[_0xf334('0xb')](),controller[_0xf334('0x10')]);router['get'](_0xf334('0x11'),auth[_0xf334('0xb')](),controller[_0xf334('0x12')]);router[_0xf334('0xa')](_0xf334('0x13'),auth[_0xf334('0xb')](),controller[_0xf334('0x14')]);router[_0xf334('0xa')](_0xf334('0x15'),auth[_0xf334('0xb')](),controller[_0xf334('0x16')]);router[_0xf334('0x17')]('/',auth[_0xf334('0xb')](),controller['create']);router[_0xf334('0x17')](_0xf334('0x13'),auth[_0xf334('0xb')](),controller['addTeams']);router[_0xf334('0x17')](_0xf334('0x15'),auth[_0xf334('0xb')](),controller[_0xf334('0x18')]);router[_0xf334('0x19')](_0xf334('0xf'),auth[_0xf334('0xb')](),controller['update']);router[_0xf334('0x1a')](_0xf334('0xf'),auth[_0xf334('0xb')](),controller[_0xf334('0x1b')]);router[_0xf334('0x1a')](_0xf334('0x13'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xf334('0x1a')](_0xf334('0x15'),auth[_0xf334('0xb')](),controller['removeAgents']);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 ecb6868..c47a10e 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 _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 +var _0xeebe=['rrmemory','beepall','roundrobin','sequelize','STRING','INTEGER','ENUM'];(function(_0x4629ee,_0x5802d8){var _0x47fb5b=function(_0xf899cd){while(--_0xf899cd){_0x4629ee['push'](_0x4629ee['shift']());}};_0x47fb5b(++_0x5802d8);}(_0xeebe,0xff));var _0xeeeb=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xeebe[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require(_0xeeeb('0x0'));module['exports']={'name':{'type':Sequelize[_0xeeeb('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xeeeb('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xeeeb('0x3')](_0xeeeb('0x4'),_0xeeeb('0x5'),_0xeeeb('0x6'))},'description':{'type':Sequelize[_0xeeeb('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 2384a61..98b3d2a 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 _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 +var _0xf233=['where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','nolimit','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','forEach','emit','userWhatsappQueue:save','select','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','set','apply','reject','save','then','get','WhatsappQueues','UserProfileResource','destroy','end','error','stack','name','index','map','WhatsappQueue','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter'];(function(_0x40cd57,_0x478837){var _0x178081=function(_0x2a6ce2){while(--_0x2a6ce2){_0x40cd57['push'](_0x40cd57['shift']());}};_0x178081(++_0x478837);}(_0xf233,0xdd));var _0x3f23=function(_0x234039,_0x5bb31e){_0x234039=_0x234039-0x0;var _0x4dedfa=_0xf233[_0x234039];return _0x4dedfa;};'use strict';var emlformat=require(_0x3f23('0x0'));var rimraf=require(_0x3f23('0x1'));var zipdir=require(_0x3f23('0x2'));var jsonpatch=require(_0x3f23('0x3'));var rp=require(_0x3f23('0x4'));var moment=require(_0x3f23('0x5'));var BPromise=require(_0x3f23('0x6'));var Mustache=require(_0x3f23('0x7'));var util=require('util');var path=require(_0x3f23('0x8'));var sox=require(_0x3f23('0x9'));var csv=require(_0x3f23('0xa'));var ejs=require(_0x3f23('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3f23('0xc'));var crypto=require('crypto');var jsforce=require(_0x3f23('0xd'));var deskjs=require(_0x3f23('0xe'));var toCsv=require(_0x3f23('0xa'));var querystring=require(_0x3f23('0xf'));var Papa=require(_0x3f23('0x10'));var Redis=require(_0x3f23('0x11'));var authService=require(_0x3f23('0x12'));var qs=require(_0x3f23('0x13'));var as=require(_0x3f23('0x14'));var hardwareService=require(_0x3f23('0x15'));var logger=require(_0x3f23('0x16'))(_0x3f23('0x17'));var utils=require(_0x3f23('0x18'));var config=require(_0x3f23('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f23('0x1a'))['db'];config[_0x3f23('0x1b')]=_['defaults'](config[_0x3f23('0x1b')],{'host':_0x3f23('0x1c'),'port':0x18eb});var socket=require(_0x3f23('0x1d'))(new Redis(config[_0x3f23('0x1b')]));require('./whatsappQueue.socket')[_0x3f23('0x1e')](socket);function respondWithStatusCode(_0x2c5bcd,_0x58eeeb){_0x58eeeb=_0x58eeeb||0xcc;return function(_0x4671a1){if(_0x4671a1){return _0x2c5bcd[_0x3f23('0x1f')](_0x58eeeb);}return _0x2c5bcd['status'](_0x58eeeb)['end']();};}function respondWithResult(_0x159e02,_0x24ce2a){_0x24ce2a=_0x24ce2a||0xc8;return function(_0x5377d2){if(_0x5377d2){return _0x159e02[_0x3f23('0x20')](_0x24ce2a)[_0x3f23('0x21')](_0x5377d2);}};}function respondWithFilteredResult(_0x2b6f43,_0x50fc0c){return function(_0x164598){if(_0x164598){var _0x66222=typeof _0x50fc0c[_0x3f23('0x22')]===_0x3f23('0x23')&&typeof _0x50fc0c['limit']===_0x3f23('0x23');var _0x33b5a4=_0x164598[_0x3f23('0x24')];var _0x5cb9f4=_0x66222?0x0:_0x50fc0c[_0x3f23('0x22')];var _0x3bf60b=_0x66222?_0x164598[_0x3f23('0x24')]:_0x50fc0c[_0x3f23('0x22')]+_0x50fc0c['limit'];var _0x2b297e;if(_0x3bf60b>=_0x33b5a4){_0x3bf60b=_0x33b5a4;_0x2b297e=0xc8;}else{_0x2b297e=0xce;}_0x2b6f43['status'](_0x2b297e);return _0x2b6f43[_0x3f23('0x25')]('Content-Range',_0x5cb9f4+'-'+_0x3bf60b+'/'+_0x33b5a4)[_0x3f23('0x21')](_0x164598);}return null;};}function patchUpdates(_0x286ce0){return function(_0xa6eede){try{jsonpatch[_0x3f23('0x26')](_0xa6eede,_0x286ce0,!![]);}catch(_0xa3eae8){return BPromise[_0x3f23('0x27')](_0xa3eae8);}return _0xa6eede[_0x3f23('0x28')]();};}function saveUpdates(_0x13c370,_0x51cdcc){return function(_0x3adb4a){if(_0x3adb4a){return _0x3adb4a['update'](_0x13c370)['then'](function(_0x50600c){return _0x50600c;});}return null;};}function removeEntity(_0x1d39d8,_0x140c56){return function(_0x51657b){if(_0x51657b){return _0x51657b['destroy']()[_0x3f23('0x29')](function(){var _0x3d4ee8=_0x51657b[_0x3f23('0x2a')]({'plain':!![]});var _0x292088=_0x3f23('0x2b');return db[_0x3f23('0x2c')][_0x3f23('0x2d')]({'where':{'type':_0x292088,'resourceId':_0x3d4ee8['id']}})[_0x3f23('0x29')](function(){return _0x51657b;});})['then'](function(){_0x1d39d8[_0x3f23('0x20')](0xcc)[_0x3f23('0x2e')]();});}};}function handleEntityNotFound(_0x492781,_0x46d2f4){return function(_0x13950e){if(!_0x13950e){_0x492781[_0x3f23('0x1f')](0x194);}return _0x13950e;};}function handleError(_0x3117b5,_0x5d799d){_0x5d799d=_0x5d799d||0x1f4;return function(_0x531763){logger[_0x3f23('0x2f')](_0x531763[_0x3f23('0x30')]);if(_0x531763[_0x3f23('0x31')]){delete _0x531763[_0x3f23('0x31')];}_0x3117b5[_0x3f23('0x20')](_0x5d799d)['send'](_0x531763);};}exports[_0x3f23('0x32')]=function(_0x20a334,_0x218882){var _0x3c0f0b={},_0x518949={},_0x380224={'count':0x0,'rows':[]};var _0x428c1b=_[_0x3f23('0x33')](db[_0x3f23('0x34')]['rawAttributes'],function(_0x1bdad5){return{'name':_0x1bdad5[_0x3f23('0x35')],'type':_0x1bdad5[_0x3f23('0x36')]['key']};});_0x518949['model']=_[_0x3f23('0x33')](_0x428c1b,_0x3f23('0x31'));_0x518949[_0x3f23('0x37')]=_[_0x3f23('0x38')](_0x20a334[_0x3f23('0x37')]);_0x518949[_0x3f23('0x39')]=_[_0x3f23('0x3a')](_0x518949[_0x3f23('0x3b')],_0x518949['query']);_0x3c0f0b[_0x3f23('0x3c')]=_[_0x3f23('0x3a')](_0x518949['model'],qs['fields'](_0x20a334[_0x3f23('0x37')][_0x3f23('0x3d')]));_0x3c0f0b[_0x3f23('0x3c')]=_0x3c0f0b[_0x3f23('0x3c')][_0x3f23('0x3e')]?_0x3c0f0b[_0x3f23('0x3c')]:_0x518949[_0x3f23('0x3b')];if(!_0x20a334[_0x3f23('0x37')][_0x3f23('0x3f')]('nolimit')){_0x3c0f0b['limit']=qs[_0x3f23('0x40')](_0x20a334['query'][_0x3f23('0x40')]);_0x3c0f0b['offset']=qs[_0x3f23('0x22')](_0x20a334[_0x3f23('0x37')]['offset']);}_0x3c0f0b[_0x3f23('0x41')]=qs[_0x3f23('0x42')](_0x20a334[_0x3f23('0x37')][_0x3f23('0x42')]);_0x3c0f0b['where']=qs[_0x3f23('0x39')](_[_0x3f23('0x43')](_0x20a334[_0x3f23('0x37')],_0x518949['filters']),_0x428c1b);if(_0x20a334[_0x3f23('0x37')][_0x3f23('0x44')]){_0x3c0f0b[_0x3f23('0x45')]=_[_0x3f23('0x46')](_0x3c0f0b['where'],{'$or':_[_0x3f23('0x33')](_0x428c1b,function(_0x411aac){if(_0x411aac[_0x3f23('0x36')]!==_0x3f23('0x47')){var _0x3612a6={};_0x3612a6[_0x411aac[_0x3f23('0x31')]]={'$like':'%'+_0x20a334[_0x3f23('0x37')][_0x3f23('0x44')]+'%'};return _0x3612a6;}})});}_0x3c0f0b=_[_0x3f23('0x46')]({},_0x3c0f0b,_0x20a334[_0x3f23('0x48')]);var _0x4b6ae1={'where':_0x3c0f0b[_0x3f23('0x45')]};return db[_0x3f23('0x34')]['count'](_0x4b6ae1)[_0x3f23('0x29')](function(_0x35eaf6){_0x380224['count']=_0x35eaf6;if(_0x20a334['query'][_0x3f23('0x49')]){_0x3c0f0b[_0x3f23('0x4a')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x3f23('0x4b')](_0x3c0f0b);})[_0x3f23('0x29')](function(_0x3c3276){_0x380224[_0x3f23('0x4c')]=_0x3c3276;return _0x380224;})['then'](respondWithFilteredResult(_0x218882,_0x3c0f0b))[_0x3f23('0x4d')](handleError(_0x218882,null));};exports[_0x3f23('0x4e')]=function(_0x1f047c,_0x4a5d5f){var _0x292efb={'raw':!![],'where':{'id':_0x1f047c[_0x3f23('0x4f')]['id']}},_0x289ab4={};_0x289ab4[_0x3f23('0x3b')]=_[_0x3f23('0x38')](db['WhatsappQueue'][_0x3f23('0x50')]);_0x289ab4[_0x3f23('0x37')]=_[_0x3f23('0x38')](_0x1f047c[_0x3f23('0x37')]);_0x289ab4[_0x3f23('0x39')]=_[_0x3f23('0x3a')](_0x289ab4['model'],_0x289ab4[_0x3f23('0x37')]);_0x292efb[_0x3f23('0x3c')]=_[_0x3f23('0x3a')](_0x289ab4[_0x3f23('0x3b')],qs[_0x3f23('0x3d')](_0x1f047c[_0x3f23('0x37')]['fields']));_0x292efb[_0x3f23('0x3c')]=_0x292efb[_0x3f23('0x3c')]['length']?_0x292efb[_0x3f23('0x3c')]:_0x289ab4[_0x3f23('0x3b')];if(_0x1f047c[_0x3f23('0x37')]['includeAll']){_0x292efb[_0x3f23('0x4a')]=[{'all':!![]}];}_0x292efb=_[_0x3f23('0x46')]({},_0x292efb,_0x1f047c[_0x3f23('0x48')]);return db[_0x3f23('0x34')][_0x3f23('0x51')](_0x292efb)[_0x3f23('0x29')](handleEntityNotFound(_0x4a5d5f,null))['then'](respondWithResult(_0x4a5d5f,null))['catch'](handleError(_0x4a5d5f,null));};exports[_0x3f23('0x52')]=function(_0x3886a9,_0x23cf53){return db['WhatsappQueue'][_0x3f23('0x52')](_0x3886a9[_0x3f23('0x53')],{})[_0x3f23('0x29')](function(_0x5858a5){var _0x4f940e=_0x3886a9[_0x3f23('0x54')][_0x3f23('0x2a')]({'plain':!![]});if(!_0x4f940e)throw new Error(_0x3f23('0x55'));if(_0x4f940e[_0x3f23('0x56')]===_0x3f23('0x54')){var _0x227ba7=_0x5858a5[_0x3f23('0x2a')]({'plain':!![]});var _0x576f34='WhatsappQueues';return db[_0x3f23('0x57')][_0x3f23('0x51')]({'where':{'name':_0x576f34,'userProfileId':_0x4f940e[_0x3f23('0x58')]},'raw':!![]})[_0x3f23('0x29')](function(_0x28f8e0){if(_0x28f8e0&&_0x28f8e0[_0x3f23('0x59')]===0x0){return db[_0x3f23('0x2c')][_0x3f23('0x52')]({'name':_0x227ba7['name'],'resourceId':_0x227ba7['id'],'type':_0x28f8e0[_0x3f23('0x31')],'sectionId':_0x28f8e0['id']},{})[_0x3f23('0x29')](function(){return _0x5858a5;});}else{return _0x5858a5;}})[_0x3f23('0x4d')](function(_0x28aea3){logger[_0x3f23('0x2f')](_0x3f23('0x5a'),_0x28aea3);throw _0x28aea3;});}return _0x5858a5;})[_0x3f23('0x29')](respondWithResult(_0x23cf53,0xc9))[_0x3f23('0x4d')](handleError(_0x23cf53,null));};exports['update']=function(_0x267a02,_0x38d4de){if(_0x267a02[_0x3f23('0x53')]['id']){delete _0x267a02[_0x3f23('0x53')]['id'];}return db['WhatsappQueue'][_0x3f23('0x51')]({'where':{'id':_0x267a02[_0x3f23('0x4f')]['id']}})[_0x3f23('0x29')](handleEntityNotFound(_0x38d4de,null))[_0x3f23('0x29')](saveUpdates(_0x267a02[_0x3f23('0x53')],null))['then'](respondWithResult(_0x38d4de,null))[_0x3f23('0x4d')](handleError(_0x38d4de,null));};exports['destroy']=function(_0xcada51,_0x312dee){return db[_0x3f23('0x34')]['find']({'where':{'id':_0xcada51[_0x3f23('0x4f')]['id']}})[_0x3f23('0x29')](handleEntityNotFound(_0x312dee,null))[_0x3f23('0x29')](removeEntity(_0x312dee,null))[_0x3f23('0x4d')](handleError(_0x312dee,null));};exports[_0x3f23('0x5b')]=function(_0x1f8526,_0x1f6b32){return db[_0x3f23('0x34')]['describe']()[_0x3f23('0x29')](respondWithResult(_0x1f6b32,null))[_0x3f23('0x4d')](handleError(_0x1f6b32,null));};exports[_0x3f23('0x5c')]=function(_0x2727c5,_0x3577b6,_0x4db7ca){var _0x52a939={'raw':!![],'where':{}},_0x3adb01={},_0x452040;return db[_0x3f23('0x34')][_0x3f23('0x5d')]({'where':{'id':_0x2727c5[_0x3f23('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3577b6,null))[_0x3f23('0x29')](function(_0x422053){if(_0x422053){_0x452040=_0x422053[_0x3f23('0x2a')]({'plain':!![]});_0x3adb01[_0x3f23('0x3b')]=_[_0x3f23('0x38')](db[_0x3f23('0x5e')][_0x3f23('0x50')]);_0x3adb01[_0x3f23('0x37')]=_[_0x3f23('0x38')](_0x2727c5[_0x3f23('0x37')]);_0x3adb01[_0x3f23('0x39')]=_[_0x3f23('0x3a')](_0x3adb01['model'],_0x3adb01[_0x3f23('0x37')]);_0x52a939['attributes']=_[_0x3f23('0x3a')](_0x3adb01[_0x3f23('0x3b')],qs[_0x3f23('0x3d')](_0x2727c5[_0x3f23('0x37')]['fields']));_0x52a939['attributes']=_0x52a939[_0x3f23('0x3c')][_0x3f23('0x3e')]?_0x52a939[_0x3f23('0x3c')]:_0x3adb01[_0x3f23('0x3b')];if(!_0x2727c5[_0x3f23('0x37')][_0x3f23('0x3f')](_0x3f23('0x5f'))){_0x52a939[_0x3f23('0x40')]=qs[_0x3f23('0x40')](_0x2727c5[_0x3f23('0x37')][_0x3f23('0x40')]);_0x52a939['offset']=qs['offset'](_0x2727c5[_0x3f23('0x37')]['offset']);}_0x52a939[_0x3f23('0x41')]=qs[_0x3f23('0x42')](_0x2727c5[_0x3f23('0x37')][_0x3f23('0x42')]);_0x52a939[_0x3f23('0x45')]=qs['filters'](_[_0x3f23('0x43')](_0x2727c5['query'],_0x3adb01[_0x3f23('0x39')]));_0x52a939[_0x3f23('0x45')][_0x3f23('0x60')]=_0x422053['id'];if(_0x2727c5[_0x3f23('0x37')][_0x3f23('0x44')]){_0x52a939[_0x3f23('0x45')]=_[_0x3f23('0x46')](_0x52a939['where'],{'$or':_[_0x3f23('0x33')](_0x52a939['attributes'],function(_0x3b4b86){var _0x17b1d1={};_0x17b1d1[_0x3b4b86]={'$like':'%'+_0x2727c5[_0x3f23('0x37')][_0x3f23('0x44')]+'%'};return _0x17b1d1;})});}_0x52a939=_[_0x3f23('0x46')]({},_0x52a939,_0x2727c5[_0x3f23('0x48')]);return db[_0x3f23('0x5e')][_0x3f23('0x4b')](_0x52a939);}})[_0x3f23('0x29')](function(_0x2ce13e){if(_0x2ce13e){return db[_0x3f23('0x61')][_0x3f23('0x62')]({'where':{'id':_[_0x3f23('0x33')](_0x2ce13e,_0x3f23('0x63')),'role':_0x3f23('0x64')},'attributes':['id',_0x3f23('0x31'),_0x3f23('0x65'),'updatedAt','createdAt']});}})[_0x3f23('0x29')](function(_0x3be785){if(_0x3be785){return{'count':_0x3be785[_0x3f23('0x24')],'rows':_[_0x3f23('0x33')](_0x3be785[_0x3f23('0x4c')],function(_0x2879dc){return{'membername':_0x2879dc[_0x3f23('0x31')],'UserId':_0x2879dc['id'],'queue_name':_0x452040['name'],'WhatsappQueueId':_0x452040['id'],'interface':util[_0x3f23('0x66')](_0x3f23('0x67'),_0x3f23('0x68'),_0x2879dc['name']),'penalty':0x0,'paused':_0x2879dc['whatsappPause'],'createdAt':_0x2879dc[_0x3f23('0x69')],'updatedAt':_0x2879dc[_0x3f23('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3577b6,_0x52a939))[_0x3f23('0x4d')](handleError(_0x3577b6,null));};exports[_0x3f23('0x6b')]=function(_0x410582,_0x49c6c3,_0x3ee7ed){var _0x1cb5f0={};var _0x369891={};var _0x4b2a52;var _0x34349a;return db[_0x3f23('0x34')][_0x3f23('0x5d')]({'where':{'id':_0x410582[_0x3f23('0x4f')]['id']}})[_0x3f23('0x29')](handleEntityNotFound(_0x49c6c3,null))[_0x3f23('0x29')](function(_0xd9feb3){if(_0xd9feb3){_0x4b2a52=_0xd9feb3;_0x369891[_0x3f23('0x3b')]=_['keys'](db[_0x3f23('0x6c')][_0x3f23('0x50')]);_0x369891[_0x3f23('0x37')]=_[_0x3f23('0x38')](_0x410582[_0x3f23('0x37')]);_0x369891[_0x3f23('0x39')]=_[_0x3f23('0x3a')](_0x369891[_0x3f23('0x3b')],_0x369891[_0x3f23('0x37')]);_0x1cb5f0[_0x3f23('0x3c')]=_[_0x3f23('0x3a')](_0x369891[_0x3f23('0x3b')],qs[_0x3f23('0x3d')](_0x410582['query'][_0x3f23('0x3d')]));_0x1cb5f0[_0x3f23('0x3c')]=_0x1cb5f0[_0x3f23('0x3c')][_0x3f23('0x3e')]?_0x1cb5f0['attributes']:_0x369891['model'];_0x1cb5f0['order']=qs[_0x3f23('0x42')](_0x410582[_0x3f23('0x37')]['sort']);_0x1cb5f0[_0x3f23('0x45')]=qs[_0x3f23('0x39')](_[_0x3f23('0x43')](_0x410582['query'],_0x369891[_0x3f23('0x39')]));if(_0x410582[_0x3f23('0x37')][_0x3f23('0x44')]){_0x1cb5f0[_0x3f23('0x45')]=_[_0x3f23('0x46')](_0x1cb5f0[_0x3f23('0x45')],{'$or':_['map'](_0x1cb5f0[_0x3f23('0x3c')],function(_0x1bc3d5){var _0x3ab975={};_0x3ab975[_0x1bc3d5]={'$like':'%'+_0x410582[_0x3f23('0x37')][_0x3f23('0x44')]+'%'};return _0x3ab975;})});}_0x1cb5f0=_['merge']({},_0x1cb5f0,_0x410582[_0x3f23('0x48')]);return _0x4b2a52['getTeams'](_0x1cb5f0);}})['then'](function(_0x46a1a0){if(_0x46a1a0){_0x34349a=_0x46a1a0[_0x3f23('0x3e')];if(!_0x410582['query'][_0x3f23('0x3f')](_0x3f23('0x5f'))){_0x1cb5f0[_0x3f23('0x40')]=qs[_0x3f23('0x40')](_0x410582[_0x3f23('0x37')][_0x3f23('0x40')]);_0x1cb5f0[_0x3f23('0x22')]=qs[_0x3f23('0x22')](_0x410582[_0x3f23('0x37')]['offset']);}return _0x4b2a52['getTeams'](_0x1cb5f0);}})[_0x3f23('0x29')](function(_0x2bd71d){if(_0x2bd71d){return _0x2bd71d?{'count':_0x34349a,'rows':_0x2bd71d}:null;}})[_0x3f23('0x29')](respondWithResult(_0x49c6c3,null))[_0x3f23('0x4d')](handleError(_0x49c6c3,null));};exports[_0x3f23('0x6d')]=function(_0x4c2658,_0x95cc20,_0x34cf5e){var _0x17f352=_0x4c2658[_0x3f23('0x53')][_0x3f23('0x6e')];return db[_0x3f23('0x6c')][_0x3f23('0x4b')]({'where':{'id':_0x17f352},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3f23('0x6f'),'attributes':['id',_0x3f23('0x31'),_0x3f23('0x70'),_0x3f23('0x71'),'interface'],'raw':!![]}]})[_0x3f23('0x29')](function(_0x8df3fb){if(_0x8df3fb){var _0x456051=_[_0x3f23('0x72')](_0x8df3fb,function(_0x5eb33c){var _0x5731eb=_0x5eb33c[_0x3f23('0x2a')]({'plain':!![]});return _0x5731eb[_0x3f23('0x6f')];});return db['WhatsappQueue']['find']({'where':{'id':_0x4c2658[_0x3f23('0x4f')]['id']}})[_0x3f23('0x29')](function(_0x4639f4){return db[_0x3f23('0x73')][_0x3f23('0x74')](function(_0x3eac5e){return _0x4639f4[_0x3f23('0x6d')](_0x17f352,{'transaction':_0x3eac5e})['then'](function(){return BPromise[_0x3f23('0x75')](_0x456051,function(_0x31fcc4){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x31fcc4['id'],'WhatsappQueueId':_0x4c2658['params']['id']},'transaction':_0x3eac5e});});})['then'](function(){_0x456051[_0x3f23('0x76')](function(_0x2cf58e){socket[_0x3f23('0x77')](_0x3f23('0x78'),{'UserId':_0x2cf58e['id'],'WhatsappQueueId':_0x4639f4['id']});});});});});}})[_0x3f23('0x29')](respondWithStatusCode(_0x95cc20,null))[_0x3f23('0x4d')](handleError(_0x95cc20,null));};exports['removeTeams']=function(_0x2e0a23,_0x2a11c3,_0x5f18a2){return db[_0x3f23('0x6c')]['findAll']({'where':{'id':_0x2e0a23[_0x3f23('0x37')][_0x3f23('0x6e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3f23('0x6f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2a11c3,null))[_0x3f23('0x29')](function(_0x579a9c){var _0xbbfec1=_[_0x3f23('0x33')](_0x579a9c,'id');var _0x5be57e=[];var _0x21de1a=[];var _0x50a990=squel[_0x3f23('0x79')]();_0x50a990['field'](_0x3f23('0x7a'))[_0x3f23('0x7b')](_0x3f23('0x7c'),'tq')[_0x3f23('0x7d')](_0x3f23('0x7e'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3f23('0x45')](_0x3f23('0x7f'),_0x2e0a23['params']['id']);for(var _0x5a93ab=0x0;_0x5a93ab<_0x579a9c['length'];_0x5a93ab+=0x1){let _0x24af83=_0x579a9c[_0x5a93ab];for(var _0x2a3fcb=0x0;_0x2a3fcb<_0x24af83[_0x3f23('0x6f')][_0x3f23('0x3e')];_0x2a3fcb+=0x1){let _0x594dc9=_0x24af83[_0x3f23('0x6f')][_0x2a3fcb];var _0x42c3c2=_0x50a990[_0x3f23('0x80')]();_0x42c3c2['where'](_0x3f23('0x81'),_0x594dc9['id']);_0x21de1a[_0x3f23('0x82')](db[_0x3f23('0x73')][_0x3f23('0x37')](_0x42c3c2[_0x3f23('0x83')](),{'type':db[_0x3f23('0x73')]['QueryTypes'][_0x3f23('0x84')]})['then'](function(_0x2d13de){if(_0x2d13de[_0x3f23('0x3e')]===0x1){return _0x594dc9['id'];}else{var _0x3dd4ed=_[_0x3f23('0x85')](_[_0x3f23('0x33')](_0x2d13de,_0x3f23('0x86')),function(_0x1ca553){return _[_0x3f23('0x87')](_0xbbfec1,_0x1ca553);});if(_0x3dd4ed){return _0x594dc9['id'];}}}));}}return BPromise[_0x3f23('0x88')](_0x21de1a)[_0x3f23('0x29')](function(_0xadaca4){_0x5be57e=_(_0x5be57e)['union'](_0xadaca4)[_0x3f23('0x89')]()[_0x3f23('0x8a')]();return db[_0x3f23('0x34')][_0x3f23('0x51')]({'where':{'id':_0x2e0a23[_0x3f23('0x4f')]['id']}})['then'](function(_0x53ca9d){return db[_0x3f23('0x73')][_0x3f23('0x74')](function(_0x437559){return _0x53ca9d['removeTeams'](_0x2e0a23[_0x3f23('0x37')][_0x3f23('0x6e')],{'transaction':_0x437559})[_0x3f23('0x29')](function(){if(!_[_0x3f23('0x8b')](_0x5be57e)){return _0x53ca9d[_0x3f23('0x8c')](_0x5be57e,{'transaction':_0x437559});}})[_0x3f23('0x29')](function(){_0x5be57e[_0x3f23('0x76')](function(_0x522aa4){socket['emit'](_0x3f23('0x8d'),{'UserId':_0x522aa4,'WhatsappQueueId':_0x53ca9d['id']});});});});});});})['then'](respondWithStatusCode(_0x2a11c3,null))[_0x3f23('0x4d')](handleError(_0x2a11c3,null));};exports[_0x3f23('0x8e')]=function(_0x1a8449,_0x4ba59f,_0x3f37d6){return db[_0x3f23('0x34')][_0x3f23('0x51')]({'where':{'id':_0x1a8449[_0x3f23('0x4f')]['id']}})[_0x3f23('0x29')](handleEntityNotFound(_0x4ba59f,null))[_0x3f23('0x29')](function(_0x4608d7){if(_0x4608d7){return _0x4608d7['addAgents'](_0x1a8449[_0x3f23('0x53')][_0x3f23('0x6e')],_['omit'](_0x1a8449[_0x3f23('0x53')],[_0x3f23('0x6e'),'id'])||{})[_0x3f23('0x8f')](function(_0x1d1664){for(var _0x5b7682=0x0;_0x5b7682<_0x1a8449[_0x3f23('0x53')]['ids']['length'];_0x5b7682+=0x1){socket[_0x3f23('0x77')](_0x3f23('0x78'),{'UserId':Number(_0x1a8449['body'][_0x3f23('0x6e')][_0x5b7682]),'WhatsappQueueId':Number(_0x1a8449['params']['id'])});}return _0x1d1664;});}})[_0x3f23('0x29')](respondWithResult(_0x4ba59f,null))[_0x3f23('0x4d')](handleError(_0x4ba59f,null));};exports['removeAgents']=function(_0x3e39d4,_0x4fafe7,_0x3d101d){return db[_0x3f23('0x34')]['find']({'where':{'id':_0x3e39d4[_0x3f23('0x4f')]['id']}})[_0x3f23('0x29')](handleEntityNotFound(_0x4fafe7,null))[_0x3f23('0x29')](function(_0x4f5c3c){if(_0x4f5c3c){return _0x4f5c3c[_0x3f23('0x8c')](_0x3e39d4[_0x3f23('0x37')]['ids'])[_0x3f23('0x29')](function(){if(_['isArray'](_0x3e39d4[_0x3f23('0x37')][_0x3f23('0x6e')])){for(var _0x1d152d=0x0;_0x1d152d<_0x3e39d4[_0x3f23('0x37')][_0x3f23('0x6e')][_0x3f23('0x3e')];_0x1d152d+=0x1){socket[_0x3f23('0x77')](_0x3f23('0x8d'),{'UserId':Number(_0x3e39d4['query']['ids'][_0x1d152d]),'WhatsappQueueId':Number(_0x3e39d4[_0x3f23('0x4f')]['id'])});}}else{socket[_0x3f23('0x77')]('userWhatsappQueue:remove',{'UserId':Number(_0x3e39d4['query'][_0x3f23('0x6e')]),'WhatsappQueueId':Number(_0x3e39d4[_0x3f23('0x4f')]['id'])});}});}})['then'](respondWithStatusCode(_0x4fafe7,null))[_0x3f23('0x4d')](handleError(_0x4fafe7,null));};exports['getAgents']=function(_0x5b12f3,_0x28a41a,_0x4ea346){var _0x4d05fb={};var _0x5cd248={};var _0x499cd7;var _0xfc06aa;return db['WhatsappQueue'][_0x3f23('0x5d')]({'where':{'id':_0x5b12f3['params']['id']}})[_0x3f23('0x29')](handleEntityNotFound(_0x28a41a,null))[_0x3f23('0x29')](function(_0x128013){if(_0x128013){_0x499cd7=_0x128013;_0x5cd248['model']=_[_0x3f23('0x38')](db['User'][_0x3f23('0x50')]);_0x5cd248[_0x3f23('0x37')]=_[_0x3f23('0x38')](_0x5b12f3[_0x3f23('0x37')]);_0x5cd248[_0x3f23('0x39')]=_[_0x3f23('0x3a')](_0x5cd248[_0x3f23('0x3b')],_0x5cd248['query']);_0x4d05fb[_0x3f23('0x3c')]=_[_0x3f23('0x3a')](_0x5cd248[_0x3f23('0x3b')],qs['fields'](_0x5b12f3[_0x3f23('0x37')][_0x3f23('0x3d')]));_0x4d05fb['attributes']=_0x4d05fb[_0x3f23('0x3c')][_0x3f23('0x3e')]?_0x4d05fb['attributes']:_0x5cd248[_0x3f23('0x3b')];_0x4d05fb[_0x3f23('0x41')]=qs['sort'](_0x5b12f3[_0x3f23('0x37')][_0x3f23('0x42')]);_0x4d05fb['where']=qs[_0x3f23('0x39')](_[_0x3f23('0x43')](_0x5b12f3[_0x3f23('0x37')],_0x5cd248[_0x3f23('0x39')]));if(_0x5b12f3[_0x3f23('0x37')][_0x3f23('0x44')]){_0x4d05fb[_0x3f23('0x45')]=_[_0x3f23('0x46')](_0x4d05fb['where'],{'$or':_[_0x3f23('0x33')](_0x4d05fb[_0x3f23('0x3c')],function(_0x4290d2){var _0x1fceef={};_0x1fceef[_0x4290d2]={'$like':'%'+_0x5b12f3[_0x3f23('0x37')]['filter']+'%'};return _0x1fceef;})});}_0x4d05fb=_[_0x3f23('0x46')]({},_0x4d05fb,_0x5b12f3['options']);return _0x499cd7[_0x3f23('0x90')](_0x4d05fb);}})[_0x3f23('0x29')](function(_0x1b821d){if(_0x1b821d){_0xfc06aa=_0x1b821d[_0x3f23('0x3e')];if(!_0x5b12f3[_0x3f23('0x37')][_0x3f23('0x3f')](_0x3f23('0x5f'))){_0x4d05fb[_0x3f23('0x40')]=qs[_0x3f23('0x40')](_0x5b12f3[_0x3f23('0x37')][_0x3f23('0x40')]);_0x4d05fb['offset']=qs[_0x3f23('0x22')](_0x5b12f3['query'][_0x3f23('0x22')]);}return _0x499cd7[_0x3f23('0x90')](_0x4d05fb);}})[_0x3f23('0x29')](function(_0x4aec5c){if(_0x4aec5c){return _0x4aec5c?{'count':_0xfc06aa,'rows':_0x4aec5c}:null;}})[_0x3f23('0x29')](respondWithResult(_0x28a41a,null))[_0x3f23('0x4d')](handleError(_0x28a41a,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 3afe1a3..323acea 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 _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 +var _0x5551=['WhatsappQueue','setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x5b90b6,_0x60eff5){var _0x166130=function(_0x2d640e){while(--_0x2d640e){_0x5b90b6['push'](_0x5b90b6['shift']());}};_0x166130(++_0x60eff5);}(_0x5551,0x10c));var _0x1555=function(_0xe76486,_0x4fa592){_0xe76486=_0xe76486-0x0;var _0x412b8c=_0x5551[_0xe76486];return _0x412b8c;};'use strict';var EventEmitter=require(_0x1555('0x0'));var WhatsappQueue=require(_0x1555('0x1'))['db'][_0x1555('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x1555('0x3')](0x0);var events={'afterCreate':_0x1555('0x4'),'afterUpdate':_0x1555('0x5'),'afterDestroy':_0x1555('0x6')};function emitEvent(_0x5166a8){return function(_0x481bad,_0x5153fe,_0x357437){WhatsappQueueEvents[_0x1555('0x7')](_0x5166a8+':'+_0x481bad['id'],_0x481bad);WhatsappQueueEvents[_0x1555('0x7')](_0x5166a8,_0x481bad);_0x357437(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x1555('0x8')](e,emitEvent(event));}}module[_0x1555('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index e155b5e..9645b64 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 _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 +var _0xab6d=['request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues','lodash','util','api','moment','bluebird'];(function(_0x27c7b7,_0x3ac29c){var _0x22e7d5=function(_0x1a5494){while(--_0x1a5494){_0x27c7b7['push'](_0x27c7b7['shift']());}};_0x22e7d5(++_0x3ac29c);}(_0xab6d,0x97));var _0xdab6=function(_0x3883d4,_0x169286){_0x3883d4=_0x3883d4-0x0;var _0x4385d7=_0xab6d[_0x3883d4];return _0x4385d7;};'use strict';var _=require(_0xdab6('0x0'));var util=require(_0xdab6('0x1'));var logger=require('../../config/logger')(_0xdab6('0x2'));var moment=require(_0xdab6('0x3'));var BPromise=require(_0xdab6('0x4'));var rp=require(_0xdab6('0x5'));var fs=require('fs');var path=require(_0xdab6('0x6'));var rimraf=require(_0xdab6('0x7'));var config=require(_0xdab6('0x8'));var attributes=require(_0xdab6('0x9'));module['exports']=function(_0x2df7f7,_0x1c4914){return _0x2df7f7[_0xdab6('0xa')](_0xdab6('0xb'),attributes,{'tableName':_0xdab6('0xc'),'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 879180e..f06e04e 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 _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 +var _0x4e97=['raw','where','attributes','include','map','model','ShowWhatsappQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','socket.io-emitter','redis','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetWhatsappQueue','WhatsappQueue','options'];(function(_0x41e21a,_0x4169b7){var _0x36604c=function(_0x213eeb){while(--_0x213eeb){_0x41e21a['push'](_0x41e21a['shift']());}};_0x36604c(++_0x4169b7);}(_0x4e97,0x148));var _0x74e9=function(_0x451d53,_0x3c657d){_0x451d53=_0x451d53-0x0;var _0x29087f=_0x4e97[_0x451d53];return _0x29087f;};'use strict';var _=require('lodash');var util=require(_0x74e9('0x0'));var moment=require(_0x74e9('0x1'));var BPromise=require(_0x74e9('0x2'));var rs=require(_0x74e9('0x3'));var fs=require('fs');var Redis=require(_0x74e9('0x4'));var db=require(_0x74e9('0x5'))['db'];var utils=require(_0x74e9('0x6'));var logger=require(_0x74e9('0x7'))(_0x74e9('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x74e9('0x9')][_0x74e9('0xa')]({'port':0x232a});config['redis']=_[_0x74e9('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x74e9('0xc'))(new Redis(config[_0x74e9('0xd')]));require(_0x74e9('0xe'))[_0x74e9('0xf')](socket);function respondWithRpcPromise(_0x448228,_0x1e5724,_0x31e9e4){return new BPromise(function(_0x53142d,_0x2d1d8e){return client[_0x74e9('0x10')](_0x448228,_0x31e9e4)[_0x74e9('0x11')](function(_0x1ea20f){logger['info'](_0x74e9('0x12'),_0x1e5724,_0x74e9('0x13'));logger[_0x74e9('0x14')](_0x74e9('0x15'),_0x1e5724,_0x74e9('0x13'),JSON[_0x74e9('0x16')](_0x1ea20f));if(_0x1ea20f[_0x74e9('0x17')]){if(_0x1ea20f[_0x74e9('0x17')][_0x74e9('0x18')]===0x1f4){logger[_0x74e9('0x17')](_0x74e9('0x12'),_0x1e5724,_0x1ea20f['error'][_0x74e9('0x19')]);return _0x2d1d8e(_0x1ea20f[_0x74e9('0x17')][_0x74e9('0x19')]);}logger[_0x74e9('0x17')](_0x74e9('0x12'),_0x1e5724,_0x1ea20f[_0x74e9('0x17')]['message']);return _0x53142d(_0x1ea20f['error']['message']);}else{logger[_0x74e9('0x1a')](_0x74e9('0x12'),_0x1e5724,_0x74e9('0x13'));_0x53142d(_0x1ea20f[_0x74e9('0x1b')][_0x74e9('0x19')]);}})[_0x74e9('0x1c')](function(_0x46ff65){logger['error'](_0x74e9('0x12'),_0x1e5724,_0x46ff65);_0x2d1d8e(_0x46ff65);});});}exports[_0x74e9('0x1d')]=function(_0x1b3845){var _0x31a7d1=this;return new Promise(function(_0x319f74,_0x4d4408){return db[_0x74e9('0x1e')]['findAll']({'raw':_0x1b3845[_0x74e9('0x1f')]?_0x1b3845['options'][_0x74e9('0x20')]===undefined?!![]:![]:!![],'where':_0x1b3845['options']?_0x1b3845[_0x74e9('0x1f')][_0x74e9('0x21')]||null:null,'attributes':_0x1b3845[_0x74e9('0x1f')]?_0x1b3845[_0x74e9('0x1f')][_0x74e9('0x22')]||null:null,'limit':_0x1b3845[_0x74e9('0x1f')]?_0x1b3845['options']['limit']||null:null,'include':_0x1b3845[_0x74e9('0x1f')]?_0x1b3845[_0x74e9('0x1f')][_0x74e9('0x23')]?_[_0x74e9('0x24')](_0x1b3845['options']['include'],function(_0x516308){return{'model':db[_0x516308['model']],'as':_0x516308['as'],'attributes':_0x516308['attributes'],'include':_0x516308['include']?_[_0x74e9('0x24')](_0x516308[_0x74e9('0x23')],function(_0x371a92){return{'model':db[_0x371a92[_0x74e9('0x25')]],'as':_0x371a92['as'],'attributes':_0x371a92[_0x74e9('0x22')],'include':_0x371a92['include']?_[_0x74e9('0x24')](_0x371a92[_0x74e9('0x23')],function(_0x2c0024){return{'model':db[_0x2c0024[_0x74e9('0x25')]],'as':_0x2c0024['as'],'attributes':_0x2c0024[_0x74e9('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x283e80){logger[_0x74e9('0x1a')](_0x74e9('0x1d'),_0x1b3845);logger[_0x74e9('0x14')]('GetWhatsappQueue',_0x1b3845,JSON[_0x74e9('0x16')](_0x283e80));_0x319f74(_0x283e80);})['catch'](function(_0x3d74fe){logger[_0x74e9('0x17')]('GetWhatsappQueue',_0x3d74fe[_0x74e9('0x19')],_0x1b3845);_0x4d4408(_0x31a7d1[_0x74e9('0x17')](0x1f4,_0x3d74fe['message']));});});};exports[_0x74e9('0x26')]=function(_0x413579){var _0x42c80e=this;return new Promise(function(_0x82d0f2,_0x4a43b){return db[_0x74e9('0x1e')][_0x74e9('0x27')]({'raw':_0x413579[_0x74e9('0x1f')]?_0x413579[_0x74e9('0x1f')][_0x74e9('0x20')]===undefined?!![]:![]:!![],'where':_0x413579[_0x74e9('0x1f')]?_0x413579['options'][_0x74e9('0x21')]||null:null,'attributes':_0x413579[_0x74e9('0x1f')]?_0x413579[_0x74e9('0x1f')][_0x74e9('0x22')]||null:null,'include':_0x413579[_0x74e9('0x1f')]?_0x413579[_0x74e9('0x1f')][_0x74e9('0x23')]?_[_0x74e9('0x24')](_0x413579[_0x74e9('0x1f')]['include'],function(_0x2ef5e1){return{'model':db[_0x2ef5e1['model']],'as':_0x2ef5e1['as'],'attributes':_0x2ef5e1['attributes'],'include':_0x2ef5e1[_0x74e9('0x23')]?_[_0x74e9('0x24')](_0x2ef5e1[_0x74e9('0x23')],function(_0x5da4cf){return{'model':db[_0x5da4cf[_0x74e9('0x25')]],'as':_0x5da4cf['as'],'attributes':_0x5da4cf[_0x74e9('0x22')],'include':_0x5da4cf[_0x74e9('0x23')]?_['map'](_0x5da4cf[_0x74e9('0x23')],function(_0x55a897){return{'model':db[_0x55a897[_0x74e9('0x25')]],'as':_0x55a897['as'],'attributes':_0x55a897[_0x74e9('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cc3b6){logger[_0x74e9('0x1a')]('ShowWhatsappQueue',_0x413579);logger[_0x74e9('0x14')](_0x74e9('0x26'),_0x413579,JSON[_0x74e9('0x16')](_0x5cc3b6));_0x82d0f2(_0x5cc3b6);})['catch'](function(_0x51f92f){logger['error'](_0x74e9('0x26'),_0x51f92f[_0x74e9('0x19')],_0x413579);_0x4a43b(_0x42c80e[_0x74e9('0x17')](0x1f4,_0x51f92f['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 528f825..4318bd6 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 _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 +var _0xf816=['whatsappQueue:','./whatsappQueue.events','save','remove','update','removeListener','register'];(function(_0x3c138b,_0xc9280b){var _0x84d664=function(_0x28429d){while(--_0x28429d){_0x3c138b['push'](_0x3c138b['shift']());}};_0x84d664(++_0xc9280b);}(_0xf816,0x1ac));var _0x6f81=function(_0x41b51b,_0x10aa62){_0x41b51b=_0x41b51b-0x0;var _0x178904=_0xf816[_0x41b51b];return _0x178904;};'use strict';var WhatsappQueueEvents=require(_0x6f81('0x0'));var events=[_0x6f81('0x1'),_0x6f81('0x2'),_0x6f81('0x3')];function createListener(_0x23ef1,_0x4e02ce){return function(_0x13892b){_0x4e02ce['emit'](_0x23ef1,_0x13892b);};}function removeListener(_0x144647,_0x19227c){return function(){WhatsappQueueEvents[_0x6f81('0x4')](_0x144647,_0x19227c);};}exports[_0x6f81('0x5')]=function(_0x430c6b){for(var _0xa81c9f=0x0,_0x1292cc=events['length'];_0xa81c9f<_0x1292cc;_0xa81c9f++){var _0x2400b5=events[_0xa81c9f];var _0x1a79fd=createListener(_0x6f81('0x6')+_0x2400b5,_0x430c6b);WhatsappQueueEvents['on'](_0x2400b5,_0x1a79fd);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index b2f657d..ed058dd 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 _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 +var _0x974b=['../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/:id','post','put','update','destroy','util','path','connect-timeout','express','Router'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x974b,0x14b));var _0xb974=function(_0x214185,_0x2d96bf){_0x214185=_0x214185-0x0;var _0x34abeb=_0x974b[_0x214185];return _0x34abeb;};'use strict';var multer=require('multer');var util=require(_0xb974('0x0'));var path=require(_0xb974('0x1'));var timeout=require(_0xb974('0x2'));var express=require(_0xb974('0x3'));var router=express[_0xb974('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb974('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb974('0x6'));var controller=require(_0xb974('0x7'));router[_0xb974('0x8')]('/',auth[_0xb974('0x9')](),controller[_0xb974('0xa')]);router['get']('/describe',auth[_0xb974('0x9')](),controller['describe']);router['get'](_0xb974('0xb'),auth[_0xb974('0x9')](),controller['show']);router[_0xb974('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb974('0xd')](_0xb974('0xb'),auth[_0xb974('0x9')](),controller[_0xb974('0xe')]);router['delete']('/:id',auth[_0xb974('0x9')](),controller[_0xb974('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 34b437a..36c45b2 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 _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 +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x4b0722,_0x582296){var _0x808ebe=function(_0x46188d){while(--_0x46188d){_0x4b0722['push'](_0x4b0722['shift']());}};_0x808ebe(++_0x582296);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 3364fc7..bc9b3d3 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 _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 +var _0x5c00=['request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','includeAll','catch','create','body','destroy','find','describe','eml-format','rimraf','zip-dir'];(function(_0xac0dde,_0x4fa5f0){var _0x2653f9=function(_0x9ab665){while(--_0x9ab665){_0xac0dde['push'](_0xac0dde['shift']());}};_0x2653f9(++_0x4fa5f0);}(_0x5c00,0x17e));var _0x05c0=function(_0x46003f,_0x18a160){_0x46003f=_0x46003f-0x0;var _0x373521=_0x5c00[_0x46003f];return _0x373521;};'use strict';var emlformat=require(_0x05c0('0x0'));var rimraf=require(_0x05c0('0x1'));var zipdir=require(_0x05c0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x05c0('0x3'));var moment=require('moment');var BPromise=require(_0x05c0('0x4'));var Mustache=require(_0x05c0('0x5'));var util=require(_0x05c0('0x6'));var path=require(_0x05c0('0x7'));var sox=require('sox');var csv=require(_0x05c0('0x8'));var ejs=require(_0x05c0('0x9'));var fs=require('fs');var fs_extra=require(_0x05c0('0xa'));var _=require(_0x05c0('0xb'));var squel=require('squel');var crypto=require(_0x05c0('0xc'));var jsforce=require(_0x05c0('0xd'));var deskjs=require(_0x05c0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x05c0('0xf'));var Papa=require(_0x05c0('0x10'));var Redis=require(_0x05c0('0x11'));var authService=require(_0x05c0('0x12'));var qs=require(_0x05c0('0x13'));var as=require(_0x05c0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x05c0('0x15'));var utils=require('../../config/utils');var config=require(_0x05c0('0x16'));var licenseUtil=require(_0x05c0('0x17'));var db=require(_0x05c0('0x18'))['db'];function respondWithStatusCode(_0x5a3e65,_0x4e39d4){_0x4e39d4=_0x4e39d4||0xcc;return function(_0x5eec41){if(_0x5eec41){return _0x5a3e65[_0x05c0('0x19')](_0x4e39d4);}return _0x5a3e65[_0x05c0('0x1a')](_0x4e39d4)[_0x05c0('0x1b')]();};}function respondWithResult(_0x12deeb,_0x25764b){_0x25764b=_0x25764b||0xc8;return function(_0xe57ed0){if(_0xe57ed0){return _0x12deeb[_0x05c0('0x1a')](_0x25764b)[_0x05c0('0x1c')](_0xe57ed0);}};}function respondWithFilteredResult(_0x4c3e54,_0x238e25){return function(_0x161a5f){if(_0x161a5f){var _0x4bb164=typeof _0x238e25[_0x05c0('0x1d')]===_0x05c0('0x1e')&&typeof _0x238e25[_0x05c0('0x1f')]===_0x05c0('0x1e');var _0xd07ad1=_0x161a5f[_0x05c0('0x20')];var _0x521cbd=_0x4bb164?0x0:_0x238e25[_0x05c0('0x1d')];var _0x1230e5=_0x4bb164?_0x161a5f[_0x05c0('0x20')]:_0x238e25['offset']+_0x238e25[_0x05c0('0x1f')];var _0x2023d6;if(_0x1230e5>=_0xd07ad1){_0x1230e5=_0xd07ad1;_0x2023d6=0xc8;}else{_0x2023d6=0xce;}_0x4c3e54[_0x05c0('0x1a')](_0x2023d6);return _0x4c3e54[_0x05c0('0x21')](_0x05c0('0x22'),_0x521cbd+'-'+_0x1230e5+'/'+_0xd07ad1)['json'](_0x161a5f);}return null;};}function patchUpdates(_0x407c1f){return function(_0x1014ef){try{jsonpatch['apply'](_0x1014ef,_0x407c1f,!![]);}catch(_0x548a0c){return BPromise['reject'](_0x548a0c);}return _0x1014ef[_0x05c0('0x23')]();};}function saveUpdates(_0x2055a3,_0x83f29){return function(_0x8e2d4){if(_0x8e2d4){return _0x8e2d4[_0x05c0('0x24')](_0x2055a3)[_0x05c0('0x25')](function(_0x14224f){return _0x14224f;});}return null;};}function removeEntity(_0x5b4eef,_0x9b4930){return function(_0x1abbf3){if(_0x1abbf3){return _0x1abbf3['destroy']()['then'](function(){_0x5b4eef['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56aa78,_0x3df135){return function(_0x15b497){if(!_0x15b497){_0x56aa78['sendStatus'](0x194);}return _0x15b497;};}function handleError(_0x41a6a2,_0x336e1b){_0x336e1b=_0x336e1b||0x1f4;return function(_0x3617dc){logger[_0x05c0('0x26')](_0x3617dc['stack']);if(_0x3617dc[_0x05c0('0x27')]){delete _0x3617dc[_0x05c0('0x27')];}_0x41a6a2[_0x05c0('0x1a')](_0x336e1b)[_0x05c0('0x28')](_0x3617dc);};}exports[_0x05c0('0x29')]=function(_0x5d12e0,_0x57886b){var _0x56ba64={},_0x2df109={},_0xbe7d9e={'count':0x0,'rows':[]};var _0x2053d5=_[_0x05c0('0x2a')](db[_0x05c0('0x2b')][_0x05c0('0x2c')],function(_0x1c4c8f){return{'name':_0x1c4c8f[_0x05c0('0x2d')],'type':_0x1c4c8f[_0x05c0('0x2e')][_0x05c0('0x2f')]};});_0x2df109[_0x05c0('0x30')]=_[_0x05c0('0x2a')](_0x2053d5,'name');_0x2df109['query']=_[_0x05c0('0x31')](_0x5d12e0[_0x05c0('0x32')]);_0x2df109[_0x05c0('0x33')]=_['intersection'](_0x2df109[_0x05c0('0x30')],_0x2df109[_0x05c0('0x32')]);_0x56ba64['attributes']=_[_0x05c0('0x34')](_0x2df109['model'],qs[_0x05c0('0x35')](_0x5d12e0[_0x05c0('0x32')][_0x05c0('0x35')]));_0x56ba64[_0x05c0('0x36')]=_0x56ba64[_0x05c0('0x36')][_0x05c0('0x37')]?_0x56ba64[_0x05c0('0x36')]:_0x2df109[_0x05c0('0x30')];if(!_0x5d12e0[_0x05c0('0x32')][_0x05c0('0x38')](_0x05c0('0x39'))){_0x56ba64[_0x05c0('0x1f')]=qs[_0x05c0('0x1f')](_0x5d12e0[_0x05c0('0x32')][_0x05c0('0x1f')]);_0x56ba64[_0x05c0('0x1d')]=qs[_0x05c0('0x1d')](_0x5d12e0[_0x05c0('0x32')][_0x05c0('0x1d')]);}_0x56ba64[_0x05c0('0x3a')]=qs[_0x05c0('0x3b')](_0x5d12e0[_0x05c0('0x32')][_0x05c0('0x3b')]);_0x56ba64[_0x05c0('0x3c')]=qs[_0x05c0('0x33')](_[_0x05c0('0x3d')](_0x5d12e0[_0x05c0('0x32')],_0x2df109[_0x05c0('0x33')]),_0x2053d5);if(_0x5d12e0[_0x05c0('0x32')][_0x05c0('0x3e')]){_0x56ba64[_0x05c0('0x3c')]=_[_0x05c0('0x3f')](_0x56ba64[_0x05c0('0x3c')],{'$or':_['map'](_0x2053d5,function(_0x2a19b4){if(_0x2a19b4[_0x05c0('0x2e')]!==_0x05c0('0x40')){var _0x3eff9e={};_0x3eff9e[_0x2a19b4['name']]={'$like':'%'+_0x5d12e0['query'][_0x05c0('0x3e')]+'%'};return _0x3eff9e;}})});}_0x56ba64=_[_0x05c0('0x3f')]({},_0x56ba64,_0x5d12e0[_0x05c0('0x41')]);var _0x4ced8e={'where':_0x56ba64[_0x05c0('0x3c')]};return db[_0x05c0('0x2b')][_0x05c0('0x20')](_0x4ced8e)[_0x05c0('0x25')](function(_0x47b349){_0xbe7d9e[_0x05c0('0x20')]=_0x47b349;if(_0x5d12e0[_0x05c0('0x32')]['includeAll']){_0x56ba64[_0x05c0('0x42')]=[{'all':!![]}];}return db[_0x05c0('0x2b')][_0x05c0('0x43')](_0x56ba64);})[_0x05c0('0x25')](function(_0x164e3a){_0xbe7d9e[_0x05c0('0x44')]=_0x164e3a;return _0xbe7d9e;})[_0x05c0('0x25')](respondWithFilteredResult(_0x57886b,_0x56ba64))['catch'](handleError(_0x57886b,null));};exports['show']=function(_0x29d62a,_0x1d1d94){var _0xaa5d53={'raw':!![],'where':{'id':_0x29d62a[_0x05c0('0x45')]['id']}},_0x11f079={};_0x11f079['model']=_[_0x05c0('0x31')](db[_0x05c0('0x2b')][_0x05c0('0x2c')]);_0x11f079[_0x05c0('0x32')]=_[_0x05c0('0x31')](_0x29d62a[_0x05c0('0x32')]);_0x11f079[_0x05c0('0x33')]=_['intersection'](_0x11f079[_0x05c0('0x30')],_0x11f079[_0x05c0('0x32')]);_0xaa5d53[_0x05c0('0x36')]=_[_0x05c0('0x34')](_0x11f079[_0x05c0('0x30')],qs[_0x05c0('0x35')](_0x29d62a[_0x05c0('0x32')][_0x05c0('0x35')]));_0xaa5d53[_0x05c0('0x36')]=_0xaa5d53[_0x05c0('0x36')][_0x05c0('0x37')]?_0xaa5d53['attributes']:_0x11f079['model'];if(_0x29d62a[_0x05c0('0x32')][_0x05c0('0x46')]){_0xaa5d53[_0x05c0('0x42')]=[{'all':!![]}];}_0xaa5d53=_[_0x05c0('0x3f')]({},_0xaa5d53,_0x29d62a[_0x05c0('0x41')]);return db[_0x05c0('0x2b')]['find'](_0xaa5d53)[_0x05c0('0x25')](handleEntityNotFound(_0x1d1d94,null))[_0x05c0('0x25')](respondWithResult(_0x1d1d94,null))[_0x05c0('0x47')](handleError(_0x1d1d94,null));};exports[_0x05c0('0x48')]=function(_0x587190,_0x34e94e){return db[_0x05c0('0x2b')][_0x05c0('0x48')](_0x587190[_0x05c0('0x49')],{})['then'](respondWithResult(_0x34e94e,0xc9))[_0x05c0('0x47')](handleError(_0x34e94e,null));};exports[_0x05c0('0x24')]=function(_0x2e5660,_0x9b521b){if(_0x2e5660['body']['id']){delete _0x2e5660[_0x05c0('0x49')]['id'];}return db[_0x05c0('0x2b')]['find']({'where':{'id':_0x2e5660[_0x05c0('0x45')]['id']}})['then'](handleEntityNotFound(_0x9b521b,null))['then'](saveUpdates(_0x2e5660[_0x05c0('0x49')],null))['then'](respondWithResult(_0x9b521b,null))[_0x05c0('0x47')](handleError(_0x9b521b,null));};exports[_0x05c0('0x4a')]=function(_0x2fedc0,_0x371aff){return db[_0x05c0('0x2b')][_0x05c0('0x4b')]({'where':{'id':_0x2fedc0['params']['id']}})[_0x05c0('0x25')](handleEntityNotFound(_0x371aff,null))['then'](removeEntity(_0x371aff,null))[_0x05c0('0x47')](handleError(_0x371aff,null));};exports[_0x05c0('0x4c')]=function(_0x183883,_0x13ad38){return db[_0x05c0('0x2b')][_0x05c0('0x4c')]()[_0x05c0('0x25')](respondWithResult(_0x13ad38,null))['catch'](handleError(_0x13ad38,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 60161d1..c543c82 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 _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 +var _0x0895=['path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0895,0x86));var _0x5089=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0895[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5089('0x0'));var util=require('util');var logger=require(_0x5089('0x1'))(_0x5089('0x2'));var moment=require(_0x5089('0x3'));var BPromise=require(_0x5089('0x4'));var rp=require(_0x5089('0x5'));var fs=require('fs');var path=require(_0x5089('0x6'));var rimraf=require(_0x5089('0x7'));var config=require(_0x5089('0x8'));var attributes=require(_0x5089('0x9'));module['exports']=function(_0x93fe9a,_0xb767ca){return _0x93fe9a[_0x5089('0xa')](_0x5089('0xb'),attributes,{'tableName':_0x5089('0xc'),'paranoid':![],'indexes':[{'name':_0x5089('0xd'),'fields':[_0x5089('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 97cfda8..11ff05d 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 _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 +var _0xd999=['client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','catch','WhatsappQueueReport','body','options','raw','CreateWhatsappQueueReport','stringify','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x7d881,_0x5d6f26){var _0x46bf76=function(_0x2f0306){while(--_0x2f0306){_0x7d881['push'](_0x7d881['shift']());}};_0x46bf76(++_0x5d6f26);}(_0xd999,0x1f3));var _0x9d99=function(_0xf74ddb,_0x8383bd){_0xf74ddb=_0xf74ddb-0x0;var _0x44e4cd=_0xd999[_0xf74ddb];return _0x44e4cd;};'use strict';var _=require(_0x9d99('0x0'));var util=require(_0x9d99('0x1'));var moment=require(_0x9d99('0x2'));var BPromise=require(_0x9d99('0x3'));var rs=require(_0x9d99('0x4'));var fs=require('fs');var Redis=require(_0x9d99('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d99('0x6'));var logger=require(_0x9d99('0x7'))(_0x9d99('0x8'));var config=require(_0x9d99('0x9'));var jayson=require(_0x9d99('0xa'));var client=jayson[_0x9d99('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x378d1d,_0x2bd800,_0x4c0f5e){return new BPromise(function(_0x76c1e2,_0x1294b1){return client[_0x9d99('0xc')](_0x378d1d,_0x4c0f5e)[_0x9d99('0xd')](function(_0x1847cf){logger[_0x9d99('0xe')](_0x9d99('0xf'),_0x2bd800,_0x9d99('0x10'));logger[_0x9d99('0x11')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x2bd800,_0x9d99('0x10'),JSON['stringify'](_0x1847cf));if(_0x1847cf['error']){if(_0x1847cf['error'][_0x9d99('0x12')]===0x1f4){logger[_0x9d99('0x13')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2bd800,_0x1847cf[_0x9d99('0x13')][_0x9d99('0x14')]);return _0x1294b1(_0x1847cf['error']['message']);}logger[_0x9d99('0x13')](_0x9d99('0xf'),_0x2bd800,_0x1847cf['error'][_0x9d99('0x14')]);return _0x76c1e2(_0x1847cf['error']['message']);}else{logger[_0x9d99('0xe')](_0x9d99('0xf'),_0x2bd800,'request\x20sent');_0x76c1e2(_0x1847cf[_0x9d99('0x15')][_0x9d99('0x14')]);}})[_0x9d99('0x16')](function(_0x3d3e99){logger[_0x9d99('0x13')](_0x9d99('0xf'),_0x2bd800,_0x3d3e99);_0x1294b1(_0x3d3e99);});});}exports['CreateWhatsappQueueReport']=function(_0x3d5dec){var _0x5e0dc9=this;return new Promise(function(_0x3552ea,_0x17a0af){return db[_0x9d99('0x17')]['create'](_0x3d5dec[_0x9d99('0x18')],{'raw':_0x3d5dec[_0x9d99('0x19')]?_0x3d5dec[_0x9d99('0x19')][_0x9d99('0x1a')]===undefined?!![]:![]:!![]})[_0x9d99('0xd')](function(_0x4463fe){logger[_0x9d99('0xe')]('CreateWhatsappQueueReport',_0x3d5dec);logger[_0x9d99('0x11')](_0x9d99('0x1b'),_0x3d5dec,JSON[_0x9d99('0x1c')](_0x4463fe));_0x3552ea(_0x4463fe);})[_0x9d99('0x16')](function(_0x23a12b){logger[_0x9d99('0x13')]('CreateWhatsappQueueReport',_0x23a12b[_0x9d99('0x14')],_0x3d5dec);_0x17a0af(_0x5e0dc9[_0x9d99('0x13')](0x1f4,_0x23a12b[_0x9d99('0x14')]));});});};exports[_0x9d99('0x1d')]=function(_0x4c8968){var _0x403697=this;return new Promise(function(_0x501727,_0x422e4f){return db['WhatsappQueueReport'][_0x9d99('0x1e')](_0x4c8968[_0x9d99('0x18')],{'raw':_0x4c8968[_0x9d99('0x19')]?_0x4c8968[_0x9d99('0x19')][_0x9d99('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c8968['options']?_0x4c8968[_0x9d99('0x19')][_0x9d99('0x1f')]||null:null,'attributes':_0x4c8968[_0x9d99('0x19')]?_0x4c8968[_0x9d99('0x19')][_0x9d99('0x20')]||null:null,'limit':_0x4c8968['options']?_0x4c8968['options'][_0x9d99('0x21')]||null:null})[_0x9d99('0xd')](function(_0x21c5bd){logger['info'](_0x9d99('0x1d'),_0x4c8968);logger['debug'](_0x9d99('0x1d'),_0x4c8968,JSON[_0x9d99('0x1c')](_0x21c5bd));_0x501727(_0x21c5bd);})[_0x9d99('0x16')](function(_0x413cfe){logger[_0x9d99('0x13')](_0x9d99('0x1d'),_0x413cfe['message'],_0x4c8968);_0x422e4f(_0x403697[_0x9d99('0x13')](0x1f4,_0x413cfe[_0x9d99('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index ab6611a..7d7c137 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 _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 +var _0x3137=['/describe','describe','show','post','create','put','update','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index'];(function(_0x50d0ff,_0x4cc080){var _0x36a50c=function(_0x45a73c){while(--_0x45a73c){_0x50d0ff['push'](_0x50d0ff['shift']());}};_0x36a50c(++_0x4cc080);}(_0x3137,0x128));var _0x7313=function(_0x3237a8,_0x32ca63){_0x3237a8=_0x3237a8-0x0;var _0x4516ed=_0x3137[_0x3237a8];return _0x4516ed;};'use strict';var multer=require('multer');var util=require(_0x7313('0x0'));var path=require('path');var timeout=require(_0x7313('0x1'));var express=require(_0x7313('0x2'));var router=express['Router']();var fs_extra=require(_0x7313('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7313('0x4'));var config=require(_0x7313('0x5'));var controller=require(_0x7313('0x6'));router[_0x7313('0x7')]('/',auth[_0x7313('0x8')](),controller[_0x7313('0x9')]);router['get'](_0x7313('0xa'),auth['isAuthenticated'](),controller[_0x7313('0xb')]);router[_0x7313('0x7')]('/:id',auth[_0x7313('0x8')](),controller[_0x7313('0xc')]);router[_0x7313('0xd')]('/',auth[_0x7313('0x8')](),controller[_0x7313('0xe')]);router[_0x7313('0xf')]('/:id',auth[_0x7313('0x8')](),controller[_0x7313('0x10')]);router['delete']('/:id',auth[_0x7313('0x8')](),controller['destroy']);module[_0x7313('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 54537ea..9b2c18d 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 _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 +var _0xcabe=['sequelize','STRING','ENUM','agent','queue'];(function(_0x15cbce,_0xda8402){var _0x257f29=function(_0x388132){while(--_0x388132){_0x15cbce['push'](_0x15cbce['shift']());}};_0x257f29(++_0xda8402);}(_0xcabe,0x1ef));var _0xecab=function(_0x2a1415,_0x45276b){_0x2a1415=_0x2a1415-0x0;var _0xa6735a=_0xcabe[_0x2a1415];return _0xa6735a;};'use strict';var Sequelize=require(_0xecab('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xecab('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xecab('0x2')]('account',_0xecab('0x3'),_0xecab('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index a69947c..3c1c7dc 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 _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 +var _0x884b=['offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','name','send','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','include','findAll','rows','catch','keys','find','create','body','update','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end'];(function(_0x4c7815,_0x2828f3){var _0x3da94f=function(_0x2e4c3c){while(--_0x2e4c3c){_0x4c7815['push'](_0x4c7815['shift']());}};_0x3da94f(++_0x2828f3);}(_0x884b,0x195));var _0xb884=function(_0x314a8c,_0x1c2e8d){_0x314a8c=_0x314a8c-0x0;var _0x1d4607=_0x884b[_0x314a8c];return _0x1d4607;};'use strict';var emlformat=require(_0xb884('0x0'));var rimraf=require(_0xb884('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb884('0x2'));var rp=require(_0xb884('0x3'));var moment=require(_0xb884('0x4'));var BPromise=require(_0xb884('0x5'));var Mustache=require(_0xb884('0x6'));var util=require('util');var path=require(_0xb884('0x7'));var sox=require(_0xb884('0x8'));var csv=require(_0xb884('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb884('0xa'));var _=require(_0xb884('0xb'));var squel=require(_0xb884('0xc'));var crypto=require(_0xb884('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb884('0xe'));var toCsv=require(_0xb884('0x9'));var querystring=require(_0xb884('0xf'));var Papa=require(_0xb884('0x10'));var Redis=require(_0xb884('0x11'));var authService=require(_0xb884('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb884('0x13'));var logger=require(_0xb884('0x14'))(_0xb884('0x15'));var utils=require(_0xb884('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb884('0x17'))['db'];function respondWithStatusCode(_0x412b15,_0x28b71b){_0x28b71b=_0x28b71b||0xcc;return function(_0x18559b){if(_0x18559b){return _0x412b15[_0xb884('0x18')](_0x28b71b);}return _0x412b15[_0xb884('0x19')](_0x28b71b)[_0xb884('0x1a')]();};}function respondWithResult(_0x30e258,_0x1fc799){_0x1fc799=_0x1fc799||0xc8;return function(_0x4c30c5){if(_0x4c30c5){return _0x30e258[_0xb884('0x19')](_0x1fc799)['json'](_0x4c30c5);}};}function respondWithFilteredResult(_0x51f1a4,_0x11c02b){return function(_0x33b3f1){if(_0x33b3f1){var _0x36ea27=typeof _0x11c02b[_0xb884('0x1b')]===_0xb884('0x1c')&&typeof _0x11c02b[_0xb884('0x1d')]===_0xb884('0x1c');var _0x1aaba5=_0x33b3f1[_0xb884('0x1e')];var _0x179d61=_0x36ea27?0x0:_0x11c02b[_0xb884('0x1b')];var _0x11e119=_0x36ea27?_0x33b3f1[_0xb884('0x1e')]:_0x11c02b[_0xb884('0x1b')]+_0x11c02b[_0xb884('0x1d')];var _0x1ac99a;if(_0x11e119>=_0x1aaba5){_0x11e119=_0x1aaba5;_0x1ac99a=0xc8;}else{_0x1ac99a=0xce;}_0x51f1a4['status'](_0x1ac99a);return _0x51f1a4['set'](_0xb884('0x1f'),_0x179d61+'-'+_0x11e119+'/'+_0x1aaba5)['json'](_0x33b3f1);}return null;};}function patchUpdates(_0x3747f9){return function(_0x3b2534){try{jsonpatch[_0xb884('0x20')](_0x3b2534,_0x3747f9,!![]);}catch(_0x1ba7f4){return BPromise[_0xb884('0x21')](_0x1ba7f4);}return _0x3b2534['save']();};}function saveUpdates(_0x10d5b1,_0x47b79b){return function(_0x2eaaf6){if(_0x2eaaf6){return _0x2eaaf6['update'](_0x10d5b1)[_0xb884('0x22')](function(_0x3acfe6){return _0x3acfe6;});}return null;};}function removeEntity(_0x73bcb,_0x39b583){return function(_0x438a32){if(_0x438a32){return _0x438a32[_0xb884('0x23')]()[_0xb884('0x22')](function(){_0x73bcb['status'](0xcc)[_0xb884('0x1a')]();});}};}function handleEntityNotFound(_0x19788d,_0x3fee55){return function(_0x45912c){if(!_0x45912c){_0x19788d[_0xb884('0x18')](0x194);}return _0x45912c;};}function handleError(_0x1e33d1,_0x5490fe){_0x5490fe=_0x5490fe||0x1f4;return function(_0x2380fc){logger['error'](_0x2380fc['stack']);if(_0x2380fc[_0xb884('0x24')]){delete _0x2380fc[_0xb884('0x24')];}_0x1e33d1['status'](_0x5490fe)[_0xb884('0x25')](_0x2380fc);};}exports['index']=function(_0x1eea77,_0x58aa82){var _0x5c26ca={},_0x1be079={},_0x434b4e={'count':0x0,'rows':[]};var _0x166f57=_[_0xb884('0x26')](db[_0xb884('0x27')][_0xb884('0x28')],function(_0x4e1894){return{'name':_0x4e1894[_0xb884('0x29')],'type':_0x4e1894[_0xb884('0x2a')][_0xb884('0x2b')]};});_0x1be079['model']=_[_0xb884('0x26')](_0x166f57,'name');_0x1be079[_0xb884('0x2c')]=_['keys'](_0x1eea77[_0xb884('0x2c')]);_0x1be079[_0xb884('0x2d')]=_[_0xb884('0x2e')](_0x1be079['model'],_0x1be079['query']);_0x5c26ca['attributes']=_[_0xb884('0x2e')](_0x1be079[_0xb884('0x2f')],qs[_0xb884('0x30')](_0x1eea77[_0xb884('0x2c')][_0xb884('0x30')]));_0x5c26ca[_0xb884('0x31')]=_0x5c26ca[_0xb884('0x31')][_0xb884('0x32')]?_0x5c26ca[_0xb884('0x31')]:_0x1be079[_0xb884('0x2f')];if(!_0x1eea77[_0xb884('0x2c')][_0xb884('0x33')](_0xb884('0x34'))){_0x5c26ca[_0xb884('0x1d')]=qs[_0xb884('0x1d')](_0x1eea77[_0xb884('0x2c')][_0xb884('0x1d')]);_0x5c26ca[_0xb884('0x1b')]=qs[_0xb884('0x1b')](_0x1eea77[_0xb884('0x2c')]['offset']);}_0x5c26ca[_0xb884('0x35')]=qs[_0xb884('0x36')](_0x1eea77[_0xb884('0x2c')][_0xb884('0x36')]);_0x5c26ca[_0xb884('0x37')]=qs['filters'](_[_0xb884('0x38')](_0x1eea77[_0xb884('0x2c')],_0x1be079[_0xb884('0x2d')]),_0x166f57);if(_0x1eea77[_0xb884('0x2c')]['filter']){_0x5c26ca[_0xb884('0x37')]=_['merge'](_0x5c26ca['where'],{'$or':_[_0xb884('0x26')](_0x166f57,function(_0xd7cd){if(_0xd7cd[_0xb884('0x2a')]!==_0xb884('0x39')){var _0x291240={};_0x291240[_0xd7cd[_0xb884('0x24')]]={'$like':'%'+_0x1eea77['query'][_0xb884('0x3a')]+'%'};return _0x291240;}})});}_0x5c26ca=_[_0xb884('0x3b')]({},_0x5c26ca,_0x1eea77[_0xb884('0x3c')]);var _0x2b4ccf={'where':_0x5c26ca['where']};return db[_0xb884('0x27')][_0xb884('0x1e')](_0x2b4ccf)[_0xb884('0x22')](function(_0x15c475){_0x434b4e[_0xb884('0x1e')]=_0x15c475;if(_0x1eea77[_0xb884('0x2c')]['includeAll']){_0x5c26ca[_0xb884('0x3d')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xb884('0x3e')](_0x5c26ca);})[_0xb884('0x22')](function(_0x2ba2a2){_0x434b4e[_0xb884('0x3f')]=_0x2ba2a2;return _0x434b4e;})['then'](respondWithFilteredResult(_0x58aa82,_0x5c26ca))[_0xb884('0x40')](handleError(_0x58aa82,null));};exports['show']=function(_0x1bcfc7,_0x237a80){var _0x5e9d07={'raw':!![],'where':{'id':_0x1bcfc7['params']['id']}},_0x2f08ff={};_0x2f08ff[_0xb884('0x2f')]=_[_0xb884('0x41')](db[_0xb884('0x27')][_0xb884('0x28')]);_0x2f08ff[_0xb884('0x2c')]=_['keys'](_0x1bcfc7[_0xb884('0x2c')]);_0x2f08ff[_0xb884('0x2d')]=_[_0xb884('0x2e')](_0x2f08ff['model'],_0x2f08ff[_0xb884('0x2c')]);_0x5e9d07[_0xb884('0x31')]=_[_0xb884('0x2e')](_0x2f08ff[_0xb884('0x2f')],qs['fields'](_0x1bcfc7['query']['fields']));_0x5e9d07[_0xb884('0x31')]=_0x5e9d07[_0xb884('0x31')][_0xb884('0x32')]?_0x5e9d07[_0xb884('0x31')]:_0x2f08ff[_0xb884('0x2f')];if(_0x1bcfc7[_0xb884('0x2c')]['includeAll']){_0x5e9d07[_0xb884('0x3d')]=[{'all':!![]}];}_0x5e9d07=_['merge']({},_0x5e9d07,_0x1bcfc7[_0xb884('0x3c')]);return db['WhatsappTransferReport'][_0xb884('0x42')](_0x5e9d07)[_0xb884('0x22')](handleEntityNotFound(_0x237a80,null))['then'](respondWithResult(_0x237a80,null))[_0xb884('0x40')](handleError(_0x237a80,null));};exports[_0xb884('0x43')]=function(_0x537753,_0x52b889){return db[_0xb884('0x27')]['create'](_0x537753[_0xb884('0x44')],{})['then'](respondWithResult(_0x52b889,0xc9))[_0xb884('0x40')](handleError(_0x52b889,null));};exports[_0xb884('0x45')]=function(_0x566e69,_0x294f76){if(_0x566e69['body']['id']){delete _0x566e69[_0xb884('0x44')]['id'];}return db[_0xb884('0x27')]['find']({'where':{'id':_0x566e69[_0xb884('0x46')]['id']}})[_0xb884('0x22')](handleEntityNotFound(_0x294f76,null))['then'](saveUpdates(_0x566e69[_0xb884('0x44')],null))['then'](respondWithResult(_0x294f76,null))['catch'](handleError(_0x294f76,null));};exports[_0xb884('0x23')]=function(_0x1b7ccc,_0x1adaa5){return db[_0xb884('0x27')][_0xb884('0x42')]({'where':{'id':_0x1b7ccc[_0xb884('0x46')]['id']}})['then'](handleEntityNotFound(_0x1adaa5,null))['then'](removeEntity(_0x1adaa5,null))[_0xb884('0x40')](handleError(_0x1adaa5,null));};exports[_0xb884('0x47')]=function(_0x564050,_0x42981b){return db[_0xb884('0x27')][_0xb884('0x47')]()[_0xb884('0x22')](respondWithResult(_0x42981b,null))[_0xb884('0x40')](handleError(_0x42981b,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 234368e..4fce332 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 _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 +var _0x0098=['api','moment','bluebird','request-promise','../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','uniqueid','util'];(function(_0x48accc,_0x3142e9){var _0x460cc4=function(_0x4af897){while(--_0x4af897){_0x48accc['push'](_0x48accc['shift']());}};_0x460cc4(++_0x3142e9);}(_0x0098,0x17b));var _0x8009=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x0098[_0x3d42d8];return _0x27fc41;};'use strict';var _=require('lodash');var util=require(_0x8009('0x0'));var logger=require('../../config/logger')(_0x8009('0x1'));var moment=require(_0x8009('0x2'));var BPromise=require(_0x8009('0x3'));var rp=require(_0x8009('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8009('0x5'));var attributes=require(_0x8009('0x6'));module[_0x8009('0x7')]=function(_0x292c7d,_0xbad68e){return _0x292c7d['define'](_0x8009('0x8'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x8009('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 423e9b2..eda5a6e 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 _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 +var _0xf4a7=['info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then'];(function(_0x5ecb82,_0x2bf30f){var _0x4f8dda=function(_0x34c198){while(--_0x34c198){_0x5ecb82['push'](_0x5ecb82['shift']());}};_0x4f8dda(++_0x2bf30f);}(_0xf4a7,0x72));var _0x7f4a=function(_0x15834d,_0x1feb94){_0x15834d=_0x15834d-0x0;var _0xfe2fa9=_0xf4a7[_0x15834d];return _0xfe2fa9;};'use strict';var _=require('lodash');var util=require(_0x7f4a('0x0'));var moment=require(_0x7f4a('0x1'));var BPromise=require(_0x7f4a('0x2'));var rs=require(_0x7f4a('0x3'));var fs=require('fs');var Redis=require(_0x7f4a('0x4'));var db=require(_0x7f4a('0x5'))['db'];var utils=require(_0x7f4a('0x6'));var logger=require('../../config/logger')(_0x7f4a('0x7'));var config=require(_0x7f4a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7f4a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bd345,_0x1b6bd6,_0x5df995){return new BPromise(function(_0x63f02e,_0x38c325){return client[_0x7f4a('0xa')](_0x3bd345,_0x5df995)[_0x7f4a('0xb')](function(_0x37ae65){logger[_0x7f4a('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1b6bd6,_0x7f4a('0xd'));logger[_0x7f4a('0xe')](_0x7f4a('0xf'),_0x1b6bd6,_0x7f4a('0xd'),JSON['stringify'](_0x37ae65));if(_0x37ae65['error']){if(_0x37ae65[_0x7f4a('0x10')]['code']===0x1f4){logger[_0x7f4a('0x10')](_0x7f4a('0x11'),_0x1b6bd6,_0x37ae65[_0x7f4a('0x10')][_0x7f4a('0x12')]);return _0x38c325(_0x37ae65[_0x7f4a('0x10')]['message']);}logger[_0x7f4a('0x10')](_0x7f4a('0x11'),_0x1b6bd6,_0x37ae65[_0x7f4a('0x10')][_0x7f4a('0x12')]);return _0x63f02e(_0x37ae65[_0x7f4a('0x10')][_0x7f4a('0x12')]);}else{logger['info'](_0x7f4a('0x11'),_0x1b6bd6,'request\x20sent');_0x63f02e(_0x37ae65[_0x7f4a('0x13')]['message']);}})[_0x7f4a('0x14')](function(_0x332691){logger[_0x7f4a('0x10')](_0x7f4a('0x11'),_0x1b6bd6,_0x332691);_0x38c325(_0x332691);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 2106834..85bfac3 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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 +var _0xdded=['./config/seedDB','./config/license','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','default','listen','start','info','filter','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','Offline\x20apps:','status','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','exit','lodash','./mysqldb'];(function(_0x2d0661,_0x3c4de6){var _0x2fd8ca=function(_0x436d42){while(--_0x436d42){_0x2d0661['push'](_0x2d0661['shift']());}};_0x2fd8ca(++_0x3c4de6);}(_0xdded,0x17a));var _0xddde=function(_0x4202b2,_0x7c754e){_0x4202b2=_0x4202b2-0x0;var _0x5632e0=_0xdded[_0x4202b2];return _0x5632e0;};'use strict';var _=require(_0xddde('0x0'));var db=require(_0xddde('0x1'))['db'];var seedDb=require(_0xddde('0x2'));var checkLicense=require(_0xddde('0x3'));var rpc=require(_0xddde('0x4'));var config=require(_0xddde('0x5'));var logger=require('./config/logger')(_0xddde('0x6'));var pm2=require(_0xddde('0x7'));var pm2Config=require(_0xddde('0x8'));var schedule=require(_0xddde('0x9'));var chat=require(_0xddde('0xa'));var whatsapp=require(_0xddde('0xb'));var transcribe=require(_0xddde('0xc'));var provider=require(_0xddde('0xd'));function main(){return db[_0xddde('0xe')][_0xddde('0xf')]()[_0xddde('0x10')](function(){if(config['seedDB']){return seedDb[_0xddde('0x11')]();}})['then'](function(){return checkLicense['default']();})['then'](function(){return rpc[_0xddde('0x12')]();})['then'](function(_0x247097){logger['info'](_0x247097);return chat[_0xddde('0x13')]();})[_0xddde('0x10')](function(){return whatsapp[_0xddde('0x13')]();})[_0xddde('0x10')](function(){return schedule[_0xddde('0x13')]();})[_0xddde('0x10')](function(){return transcribe[_0xddde('0x13')]();})[_0xddde('0x10')](function(){return provider['start']();})[_0xddde('0x10')](function(_0x218779){logger[_0xddde('0x14')](_0x218779);return pm2[_0xddde('0x13')](pm2Config);})[_0xddde('0x10')](function(_0x31c111){var _0x491be5=_0x31c111[_0xddde('0x15')](function(_0xbe1df5){return typeof _0xbe1df5[_0xddde('0x16')]==='number'&&_0xbe1df5['exitCode']>=0x0;});if(_0x491be5[_0xddde('0x17')]>0x0){throw new Error(_0x491be5['length']+_0xddde('0x18')+_[_0xddde('0x19')](_0x491be5,function(_0x338fa7){return'\x22'+_0x338fa7[_0xddde('0x1a')][_0xddde('0x1b')]+'\x22';}));}logger['info'](_0xddde('0x1c'),_[_0xddde('0x19')](_['filter'](_0x31c111,{'status':_0xddde('0x1d')}),_0xddde('0x1b'))['join']());logger['info'](_0xddde('0x1e'),_['map'](_[_0xddde('0x15')](_0x31c111,function(_0x5175bd){return _0x5175bd[_0xddde('0x1f')]!==_0xddde('0x1d');}),'name')['join']()||_0xddde('0x20'));console[_0xddde('0x21')](_0xddde('0x22'));})[_0xddde('0x23')](function(_0x2a3ea5){console[_0xddde('0x21')](_0xddde('0x24'),_0x2a3ea5);logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x2a3ea5);process[_0xddde('0x25')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index a162f5e..209968a 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(_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 +var _0x9c44=['showWebBar','lastLoginAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','user','ChatInteraction','findOne','params','then','status','disposition','unmanaged','json','Unmanaged.','catch','isAuthenticated','headers','authorization','startsWith','Basic','authenticate','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','User','find','sub','Setting','allowedLoginAttempts','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','minutes','use','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','sign','options','promisify','toString','hex','floor','now','HS512','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','crypto','util','moment','secrets','session','role','name','internal','email','userpic','voicePause','chatPause','faxPause','smsPause'];(function(_0x141e03,_0x18340e){var _0x2074e3=function(_0x2b7ece){while(--_0x2b7ece){_0x141e03['push'](_0x141e03['shift']());}};_0x2074e3(++_0x18340e);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var hardwareConf=require(_0x49c4('0x0'));var licenseUtil=require(_0x49c4('0x1'));var encryptor=require(_0x49c4('0x2'));var _=require(_0x49c4('0x3'));var jwt=require(_0x49c4('0x4'));var expressJwt=require(_0x49c4('0x5'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require(_0x49c4('0x6'));var BPromise=require('bluebird');var util=require(_0x49c4('0x7'));var moment=require(_0x49c4('0x8'));var validateJwt=expressJwt({'secret':config[_0x49c4('0x9')][_0x49c4('0xa')]});var userAttributes=['id',_0x49c4('0xb'),'fullname',_0x49c4('0xc'),_0x49c4('0xd'),_0x49c4('0xe'),_0x49c4('0xf'),'permissions','md5secret',_0x49c4('0x10'),_0x49c4('0x11'),'mailPause',_0x49c4('0x12'),_0x49c4('0x13'),'openchannelPause','pauseType',_0x49c4('0x14'),_0x49c4('0x15'),'lastPauseAt',_0x49c4('0x16'),_0x49c4('0x17'),'passwordResetAt',_0x49c4('0x18'),_0x49c4('0x19'),_0x49c4('0x1a'),_0x49c4('0x1b'),_0x49c4('0x1c'),_0x49c4('0x1d'),_0x49c4('0x1e'),_0x49c4('0x1f'),'phoneBarPrefixRequired',_0x49c4('0x20'),_0x49c4('0x21'),_0x49c4('0x22'),_0x49c4('0x23'),_0x49c4('0x24'),'privacyEnabled',_0x49c4('0x25'),_0x49c4('0x26'),'downloadVoiceRecordings','downloadOmnichannelInteractions',_0x49c4('0x27'),_0x49c4('0x28'),_0x49c4('0x29'),'chatAutoanswer',_0x49c4('0x2a'),'emailAutoanswer',_0x49c4('0x2b'),_0x49c4('0x2c'),_0x49c4('0x2d'),_0x49c4('0x2e'),_0x49c4('0x2f'),_0x49c4('0x30'),_0x49c4('0x31'),_0x49c4('0x32'),_0x49c4('0x33')];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])['use'](function(_0x1c99b1,_0x4f0b62,_0x592bb8){if(_0x1c99b1[_0x49c4('0x34')]){_0x592bb8();}else{return db[_0x49c4('0x35')][_0x49c4('0x36')]({'where':{'id':_0x1c99b1[_0x49c4('0x37')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0x49c4('0x38')](function(_0x9cb797){if(_0x9cb797&&_0x9cb797['closed']){return _0x4f0b62[_0x49c4('0x39')](_0x9cb797[_0x49c4('0x3a')]===_0x49c4('0x3b')?0x195:0x193)[_0x49c4('0x3c')]({'message':_0x9cb797['disposition']==='unmanaged'?_0x49c4('0x3d'):'Forbidden.'});}else{_0x592bb8();}})[_0x49c4('0x3e')](function(_0x3852b2){_0x592bb8(_0x3852b2);});}});};exports[_0x49c4('0x3f')]=function isAuthenticated(_0x372a47){return compose()['use'](function(_0x889909,_0x2b2793,_0x46e04d){var _0x4f28a2;if(_0x889909[_0x49c4('0x40')][_0x49c4('0x41')]){if(_[_0x49c4('0x42')](_0x889909[_0x49c4('0x40')][_0x49c4('0x41')],_0x49c4('0x43'))){var _0x46f7ea=basicAuth(_0x889909);db['User']['find']({'where':{'name':_0x46f7ea['name']}})[_0x49c4('0x38')](function(_0x7ee704){if(!_0x7ee704||!_0x7ee704[_0x49c4('0x44')](_0x46f7ea[_0x49c4('0x45')])){return _0x2b2793[_0x49c4('0x39')](0x191)['json']({'message':_0x49c4('0x46')});}_0x889909[_0x49c4('0x34')]={'id':_0x7ee704['id']};_0x46e04d();})[_0x49c4('0x3e')](function(_0x24bba9){_0x46e04d(_0x24bba9);});}else if(_['startsWith'](_0x889909['headers'][_0x49c4('0x41')],_0x49c4('0x47'))){validateJwt(_0x889909,_0x2b2793,_0x46e04d);}else{if(_0x372a47){_0x46e04d();}else{return _0x2b2793[_0x49c4('0x39')](0x193)[_0x49c4('0x3c')]({'message':_0x49c4('0x48')});}}}else if(_0x889909['query'][_0x49c4('0x49')]){try{var _0x84c621={'audience':hardwareConf[_0x49c4('0x4a')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x889909['query'][_0x49c4('0x49')],_0x84c621)[_0x49c4('0x38')](function(_0x3bec0a){return db[_0x49c4('0x4b')][_0x49c4('0x4c')]({'where':{'id':_0x3bec0a[_0x49c4('0x4d')]}})[_0x49c4('0x38')](function(_0x27ef5f){_0x4f28a2=_0x27ef5f;return db[_0x49c4('0x4e')]['findOne']({'where':{'id':0x1},'attributes':[_0x49c4('0x4f'),'blockDuration'],'raw':!![]});})[_0x49c4('0x38')](function(_0x349791){if(!_0x4f28a2||!_[_0x49c4('0x50')](_0x4f28a2[_0x49c4('0x51')],_0x3bec0a['nonce'])){return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':_0x49c4('0x52')});}if(_0x4f28a2['disabled']){return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':_0x49c4('0x53')});}if(_0x4f28a2[_0x49c4('0x54')]){if(_0x349791[_0x49c4('0x55')]>0x0){if(moment(_0x4f28a2[_0x49c4('0x56')])[_0x49c4('0x57')](_0x349791[_0x49c4('0x55')],_0x49c4('0x58'))>moment()){return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':_0x49c4('0x53')});}}_0x889909[_0x49c4('0x34')]={'id':_0x4f28a2['id']};_0x46e04d();});})[_0x49c4('0x3e')](function(){return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':_0x49c4('0x53')});});}catch(_0x248c0a){_0x46e04d(_0x248c0a);}}else if(_0x372a47){_0x46e04d();}else{return _0x2b2793[_0x49c4('0x39')](0x193)[_0x49c4('0x3c')]({'message':_0x49c4('0x48')});}})[_0x49c4('0x59')](function(_0x4e38bc,_0x212366,_0x49829e){if(_0x4e38bc[_0x49c4('0x34')]){db[_0x49c4('0x4b')][_0x49c4('0x4c')]({'where':{'id':_0x4e38bc[_0x49c4('0x34')]['id']},'attributes':userAttributes})[_0x49c4('0x38')](function(_0x281b83){if(!_0x281b83){return _0x212366['status'](0x194)['json']({'message':_0x49c4('0x5a')});}_0x4e38bc[_0x49c4('0x34')]=_0x281b83;_0x49829e();})[_0x49c4('0x3e')](function(_0x117151){_0x49829e(_0x117151);});}else if(_0x372a47){_0x49829e();}else{return _0x212366['status'](0x194)[_0x49c4('0x3c')]({'message':_0x49c4('0x5b')});}});};exports[_0x49c4('0x5c')]=function canUpdate(){return compose()[_0x49c4('0x59')](function(_0x81a674,_0x3bde49,_0x1a9593){return licenseUtil[_0x49c4('0x5d')]()[_0x49c4('0x38')](function(_0x5640d3){if(_0x5640d3[_0x49c4('0x5e')]){_0x1a9593();}else{return _0x3bde49['status'](0x193)[_0x49c4('0x3c')]({'message':_0x49c4('0x5f')});}})[_0x49c4('0x3e')](function(_0x258abe){_0x1a9593(_0x258abe);});});};exports[_0x49c4('0x60')]=function isWebrtcLicence(){return compose()['use'](function(_0x592e8e,_0x15b674,_0x384862){return licenseUtil[_0x49c4('0x5d')]()[_0x49c4('0x38')](function(_0x5d4790){if(_0x5d4790[_0x49c4('0x61')]){_0x384862();}else{return _0x15b674['status'](0x193)[_0x49c4('0x3c')]({'message':'Forbidden'});}})[_0x49c4('0x3e')](function(_0x906d3){_0x384862(_0x906d3);});});};exports[_0x49c4('0x62')]=function(_0x27adfe,_0x2d8087,_0x30bea5){_0x27adfe[_0x49c4('0x62')]=!![];return _0x30bea5();};exports['signToken']=function signToken(_0x3b731f){return signJwt(_0x3b731f);};exports[_0x49c4('0x63')]=function(_0x4a5c34,_0x1e1ac4){if(!_0x4a5c34[_0x49c4('0x34')]){return _0x1e1ac4[_0x49c4('0x39')](0x194)[_0x49c4('0x3c')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x5d8bf0={'payload':{'id':_0x4a5c34[_0x49c4('0x34')]['id'],'role':_0x4a5c34['user'][_0x49c4('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5d8bf0)[_0x49c4('0x38')](function(_0x3811b2){_0x1e1ac4[_0x49c4('0x64')](_0x49c4('0x65'),_0x3811b2);_0x1e1ac4[_0x49c4('0x66')](_0x49c4('0x67'));})['catch'](function(_0x1f26c2){return _0x1e1ac4[_0x49c4('0x39')](0x1f4)[_0x49c4('0x68')](_0x1f26c2);});};exports[_0x49c4('0x69')]=function(_0x17ef75){if(_[_0x49c4('0x6a')](_0x17ef75[_0x49c4('0x51')])||_[_0x49c4('0x6a')](_0x17ef75[_0x49c4('0x6b')])){return null;}else{return createJwt(_0x17ef75);}};exports[_0x49c4('0x6c')]=function(_0x5b822f){_0x5b822f['apiKeyNonce']=generateNonce();_0x5b822f[_0x49c4('0x6b')]=generateIssuedAt();return createJwt(_0x5b822f);};exports[_0x49c4('0x6d')]=function(_0x527e74,_0x59a8bc){var _0x77163d=_0x527e74['query']['apikey'];if(_0x77163d){var _0x3208c2={'nonce':_0x59a8bc[_0x49c4('0x51')],'iat':_0x59a8bc[_0x49c4('0x6b')],'audience':hardwareConf[_0x49c4('0x4a')](),'issuer':hardwareConf[_0x49c4('0x4a')]()};return verifyJwt(_0x77163d,_0x3208c2)[_0x49c4('0x38')](function(){return generateApiKey(_0x59a8bc);});}else{throw{'message':_0x49c4('0x6e')};}};exports['validatePasswordPattern']=function(_0x859dde){var _0xcc6a2b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xcc6a2b[_0x49c4('0x6f')](_0x859dde))throw new db[(_0x49c4('0x70'))][(_0x49c4('0x71'))](_0x49c4('0x72'));return;};exports['validatePasswordHistory']=function(_0x5c7ddd,_0x1ef0c1,_0x155c43){var _0x2a6308=encryptor[_0x49c4('0x73')](_0x1ef0c1)[_0x49c4('0x74')](',');for(var _0x6b2592=0x0;_0x6b2592<_0x155c43;_0x6b2592++){if(!_0x2a6308[_0x6b2592])break;if(_0x5c7ddd[_0x49c4('0x75')]()===_0x2a6308[_0x6b2592]['toLowerCase']()){var _0x45d715=util[_0x49c4('0x76')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x155c43);if(_0x155c43===0x1){_0x45d715=_0x49c4('0x77');}throw new db['Sequelize'][(_0x49c4('0x71'))](_0x45d715);}}return;};exports[_0x49c4('0x78')]=function(_0x9eaa84,_0x2fe89a){var _0x845f7e=_0x2fe89a?encryptor[_0x49c4('0x73')](_0x2fe89a)[_0x49c4('0x74')](','):[];if(_0x845f7e[_0x49c4('0x79')]===0x5){_0x845f7e['splice'](-0x1,0x1);}_0x845f7e[_0x49c4('0x7a')](_0x9eaa84);return encryptor[_0x49c4('0x7b')](_0x845f7e['join'](','));};function signJwt(_0x10dec7){var _0x299e74=BPromise['promisify'](jwt[_0x49c4('0x7c')],{'context':jwt});var _0x42e0e6=_0x10dec7['secret']||config['secrets']['session'];return new BPromise(function(_0x513879,_0xc43386){_0x299e74(_0x10dec7['payload'],_0x42e0e6,_0x10dec7[_0x49c4('0x7d')])[_0x49c4('0x38')](function(_0x515240){_0x513879(_0x515240);})[_0x49c4('0x3e')](function(_0xdb2b33){_0xc43386(_0xdb2b33);});});}function verifyJwt(_0x5ac9f0,_0x34272f,_0x3dcf4c){var _0x167e84=BPromise[_0x49c4('0x7e')](jwt['verify'],{'context':jwt});var _0x431921=_0x3dcf4c||config[_0x49c4('0x9')][_0x49c4('0xa')];return new BPromise(function(_0x20e97d,_0x5d3375){_0x167e84(_0x5ac9f0,_0x431921,_0x34272f)[_0x49c4('0x38')](function(_0x4a93bc){_0x20e97d(_0x4a93bc);})['catch'](function(_0x58259d){_0x5d3375(_0x58259d);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x49c4('0x7f')](_0x49c4('0x80'));}function generateIssuedAt(){return Math[_0x49c4('0x81')](Date[_0x49c4('0x82')]()/0x3e8)['toString']();}function createJwt(_0x4daa6d){var _0x340523={'payload':{'iat':_0x4daa6d[_0x49c4('0x6b')],'nonce':_0x4daa6d[_0x49c4('0x51')]},'options':{'algorithm':_0x49c4('0x83'),'subject':_0x4daa6d['id'][_0x49c4('0x7f')](),'issuer':hardwareConf[_0x49c4('0x4a')](),'audience':hardwareConf[_0x49c4('0x4a')]()}};return signJwt(_0x340523)[_0x49c4('0x38')](function(_0x4d49e0){return{'iat':_0x4daa6d[_0x49c4('0x6b')],'nonce':_0x4daa6d['apiKeyNonce'],'token':_0x4d49e0};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index ac77e7c..7d9e1a2 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 _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 +var _0xb10b=['user','clause','tags','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','keys','startsWith','cf_','map','CmCustomField','findOne','slice','all','fieldType','type','lodash','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','where','fields','filter'];(function(_0x3fcc9,_0xb274a6){var _0x9137b6=function(_0x477c56){while(--_0x477c56){_0x3fcc9['push'](_0x3fcc9['shift']());}};_0x9137b6(++_0xb274a6);}(_0xb10b,0x12a));var _0xbb10=function(_0x43b88c,_0x46fb04){_0x43b88c=_0x43b88c-0x0;var _0x407299=_0xb10b[_0x43b88c];return _0x407299;};'use strict';var _=require(_0xbb10('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xbb10('0x1'))['db'];exports[_0xbb10('0x2')]=function(_0x1dcb08,_0x4d688c,_0x4541ae,_0x9bbed){var _0x460981={'count':0x0,'rows':[]};var _0x22320e=sqlUtils[_0xbb10('0x3')](_0x4d688c,_0x1dcb08);if(_0x22320e){return Promise[_0xbb10('0x4')](_0x460981);}var _0x481979=sqlUtils[_0xbb10('0x5')]();var _0x3cdd53={};var _0x513741=![];var _0x1b9e94=![];return Promise[_0xbb10('0x4')]()[_0xbb10('0x6')](function(){if(_0x1dcb08[_0xbb10('0x7')]){return sqlUtils[_0xbb10('0x8')](_0x1dcb08[_0xbb10('0x7')],_0x9bbed);}else{return sqlUtils[_0xbb10('0x9')](_0x1dcb08,_0x9bbed);}})[_0xbb10('0x6')](function(_0x5ab04a){_0x481979['where'](_0x5ab04a[_0xbb10('0xa')]);_0x481979[_0xbb10('0xb')](_0x5ab04a[_0xbb10('0xc')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xd')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xe')][_0xbb10('0xf')]);_0x3cdd53=_0x5ab04a[_0xbb10('0x10')];_0x1b9e94=_0x5ab04a[_0xbb10('0xe')][_0xbb10('0x11')];return sqlUtils[_0xbb10('0x12')](_0x4d688c,_0x1dcb08,_0x1b9e94);})['then'](function(_0x26e021){_0x481979[_0xbb10('0xb')](_0x26e021);var _0x45b9d6=_0x1dcb08[_0xbb10('0x7')]?_0x3cdd53[_0xbb10('0x13')]:_0x1dcb08[_0xbb10('0x14')];_0x513741=_0x45b9d6?!![]:![];return sqlUtils[_0xbb10('0x15')](_0x481979,_0x45b9d6);})[_0xbb10('0x6')](function(_0x3e26f4){_0x460981[_0xbb10('0x16')]=_0x3e26f4;if(_0x460981['count']===0x0){return;}return sqlUtils[_0xbb10('0x17')](_0x481979,_0x1dcb08[_0xbb10('0xc')],_0x4541ae,_0x513741,_0x3cdd53[_0xbb10('0xf')],_0x1b9e94);})[_0xbb10('0x6')](function(_0x378da8){if(!_0x378da8){return[];}return sqlUtils[_0xbb10('0x18')](_0x378da8,_0x1dcb08,_0x4541ae);})[_0xbb10('0x6')](function(_0x30efc6){_0x460981[_0xbb10('0x19')]=_0x30efc6;return _0x460981;})[_0xbb10('0x1a')](function(_0x48b6e9){throw _0x48b6e9;});};exports[_0xbb10('0x1b')]=function(){var _0x19f48d={};var _0x388fab=[];return db[_0xbb10('0x1c')][_0xbb10('0x1b')]()[_0xbb10('0x6')](function(_0x4deb49){_0x19f48d=_0x4deb49;var _0x12f888=Object[_0xbb10('0x1d')](_0x19f48d)['filter'](function(_0x4c4b0d){return _[_0xbb10('0x1e')](_0x4c4b0d,_0xbb10('0x1f'))?_0x4c4b0d:undefined;});var _0x2e911d=_0x12f888[_0xbb10('0x20')](function(_0x445761){return db[_0xbb10('0x21')][_0xbb10('0x22')]({'where':{'id':_0x445761[_0xbb10('0x23')](0x3)},'raw':!![]});});return Promise[_0xbb10('0x24')](_0x2e911d);})[_0xbb10('0x6')](function(_0x3ba6cd){for(var _0x26ad93=0x0;_0x26ad93<_0x3ba6cd['length'];_0x26ad93++){if(_0x3ba6cd[_0x26ad93]){var _0x4fedac='cf_'+_0x3ba6cd[_0x26ad93]['id'];_0x19f48d[_0x4fedac][_0xbb10('0x25')]=_0x3ba6cd[_0x26ad93][_0xbb10('0x26')];}}_0x388fab=_[_0xbb10('0x20')](Object['keys'](_0x19f48d),function(_0x2fdde9){return{'name':_0x2fdde9,'type':_0x19f48d[_0x2fdde9][_0xbb10('0x26')]};});return _0x388fab;})[_0xbb10('0x1a')](function(_0x1d5e95){throw _0x1d5e95;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 5708215..41541b0 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 _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 +var _0xeac6=['forEach','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','length','name','dateOfBirth','fieldType','datetime','castTo','buildExpression','default','text','start','value','end','Tag','split','map','tags','clause','and','ids','User','user','skip','keys','compact','Contact','push','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','tag','filter','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','having','order','DESC','subqry.','findAll','QueryTypes','SELECT','CmContact','sequelize','query','Tags','COUNT(*)','isEmpty','t.id\x20IN\x20?','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','true','select','from','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','fax','createdAt','updatedAt','deletedAt','TagIds','includes'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0xeac6,0x1d5));var _0x6eac=function(_0x3f2d56,_0x2a3da3){_0x3f2d56=_0x3f2d56-0x0;var _0x99f3ac=_0xeac6[_0x3f2d56];return _0x99f3ac;};'use strict';var _=require('lodash');var squel=require('squel');var as=require(_0x6eac('0x0'));var qs=require(_0x6eac('0x1'));var utils=require(_0x6eac('0x2'));var db=require(_0x6eac('0x3'))['db'];function skipContactsQuery(_0x32ac14,_0x31081b){var _0x42af9c=![];if(_0x32ac14[_0x6eac('0x4')]===_0x6eac('0x5')&&!_0x31081b[_0x6eac('0x6')]&&!_0x31081b[_0x6eac('0x7')]&&_0x31081b[_0x6eac('0x8')]!==_0x6eac('0x9')){_0x42af9c=!![];}return _0x42af9c;}function getContactsSubquery(){return squel[_0x6eac('0xa')]()[_0x6eac('0xb')]('cm_contacts','c')[_0x6eac('0xc')](_0x6eac('0xd'));}function applyJoinClauses(_0x2d69eb,_0xdd3dee){var _0x5b6363=_0xdd3dee?'c':_0x6eac('0xe');_0x2d69eb[_0x6eac('0xf')](_0x6eac('0x10'),'uc',_0x6eac('0x11')+_0x5b6363+_0x6eac('0x12'))[_0x6eac('0xf')](_0x6eac('0x13'),'ct',_0x6eac('0x14')+_0x5b6363+_0x6eac('0x12'))[_0x6eac('0xf')](_0x6eac('0x15'),'t',_0x6eac('0x16'));return _0x2d69eb;}function addFieldsToQuery(_0x1672e3,_0x460432,_0x121de9,_0x4dfdc7,_0x2e13b0){var _0x443c62=_0x2e13b0?'c':_0x6eac('0xe');if(!_0x460432){_0x460432=['id',_0x6eac('0x17'),_0x6eac('0x18'),'phone','mobile',_0x6eac('0x19'),'email','ListId','CompanyId',_0x6eac('0x1a'),_0x6eac('0x1b'),_0x6eac('0x1c'),_0x6eac('0x1d')];}else if(!_0x460432[_0x6eac('0x1e')]('id')){_0x460432['push']('id');}var _0xdd34f9=_0x121de9&&_0x2e13b0||!_0x121de9&&!_0x2e13b0;if(_0x4dfdc7){_0xdd34f9=_0x4dfdc7&&_0x2e13b0||!_0x4dfdc7&&!_0x2e13b0;}_0x460432[_0x6eac('0x1f')](function(_0x2ee336){if(_0x2ee336===_0x6eac('0x1d')){if(_0xdd34f9){_0x1672e3['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2ee336);}else if(_0x121de9||_0x4dfdc7){_0x1672e3[_0x6eac('0x20')](_0x443c62+'.'+_0x2ee336);}}else{_0x1672e3[_0x6eac('0x20')](_0x443c62+'.'+_0x2ee336);}});return _0x1672e3;}function getSqlClauses(){var _0x2ff9aa={'default':squel[_0x6eac('0x21')](),'fields':squel[_0x6eac('0x21')](),'filter':squel[_0x6eac('0x21')](),'tags':{'clause':squel[_0x6eac('0x21')](),'ids':null},'user':{'clause':squel[_0x6eac('0x21')](),'skip':![]}};return _0x2ff9aa;}function parseTagParameter(_0x696bc0){var _0x5c0b75=squel[_0x6eac('0x21')]();if(_0x696bc0){var _0x15ef73=utils[_0x6eac('0x22')](_0x696bc0);_0x15ef73[_0x6eac('0x1f')](function(_0x672235){_0x5c0b75['or'](_0x6eac('0x23'),'%,'+_0x672235+',%');});}return _0x5c0b75;}function parseSearchFilter(_0x403d6a){var _0x32acf2=squel[_0x6eac('0x21')]();if(_0x403d6a){var _0x38ed22=_0x403d6a[_0x6eac('0x24')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x38ed22['split']('\x20')['length']>0x1){_0x32acf2['or'](_0x6eac('0x25'),qs[_0x6eac('0x26')](_0x38ed22),null);}else{if(qs[_0x6eac('0x27')](_0x38ed22)){_0x32acf2['or']('c.id\x20LIKE\x20?',_0x38ed22+'%');_0x32acf2['or'](_0x6eac('0x28'),_0x38ed22+'%');_0x32acf2['or'](_0x6eac('0x29'),_0x38ed22+'%');_0x32acf2['or'](_0x6eac('0x2a'),_0x38ed22+'%');}else if(qs['isEmail'](_0x38ed22)){_0x32acf2['or']('c.email\x20LIKE\x20?',_0x38ed22+'%');}else{_0x32acf2['or']('c.firstName\x20LIKE\x20?','%'+_0x38ed22+'%');_0x32acf2['or'](_0x6eac('0x2b'),'%'+_0x38ed22+'%');_0x32acf2['or']('c.email\x20LIKE\x20?','%'+_0x38ed22+'%');}}}return _0x32acf2;}function parseAdvancedSearchFilter(_0x4e27b1,_0x1bc180){var _0x21d3f0=getSqlClauses();var _0x364b00=as[_0x6eac('0x2c')](_0x4e27b1);var _0x117739=_0x364b00['sqlOperator'];for(var _0x5e9951=0x0;_0x5e9951<_0x364b00[_0x6eac('0x2d')][_0x6eac('0x2e')];_0x5e9951++){var _0x17b712=_0x364b00['conditions'][_0x5e9951];var _0x5edb4d='c';var _0x1d14ed=_['find'](_0x1bc180,[_0x6eac('0x2f'),_0x17b712[_0x6eac('0x20')]]);if(_0x1d14ed){if(_0x17b712[_0x6eac('0x20')]===_0x6eac('0x30')||_0x1d14ed[_0x6eac('0x31')]===_0x6eac('0x32')){_0x17b712[_0x6eac('0x33')]='DATE';}var _0x5b363f=as[_0x6eac('0x34')](_0x5edb4d,_0x1d14ed['type'],_0x17b712);_0x21d3f0[_0x6eac('0x35')][_0x117739](_0x5b363f[_0x6eac('0x36')],_0x5b363f['value'][_0x6eac('0x37')],_0x5b363f[_0x6eac('0x38')][_0x6eac('0x39')]);}else{if(_0x17b712[_0x6eac('0x20')]===_0x6eac('0x3a')){var _0x1da591=_0x17b712[_0x6eac('0x38')][_0x6eac('0x3b')](',')[_0x6eac('0x3c')](function(_0xdad202){return Number(_0xdad202);});var _0xbceddb=parseTagParameter(_0x1da591);_0x21d3f0[_0x6eac('0x3d')][_0x6eac('0x3e')][_0x6eac('0x3f')](_0xbceddb);_0x21d3f0[_0x6eac('0x3d')][_0x6eac('0x40')]=_0x1da591;}else if(_0x17b712[_0x6eac('0x20')]===_0x6eac('0x41')){_0x21d3f0[_0x6eac('0x42')][_0x6eac('0x3e')]['and']('uc.UserId\x20=\x20?',_0x17b712['value']);_0x21d3f0[_0x6eac('0x42')][_0x6eac('0x43')]=!![];}}}return _0x21d3f0;}function parseModelFields(_0xa2eb59,_0x13dd18){var _0x3ae3da=squel[_0x6eac('0x21')]();var _0x38acc2=_(_0xa2eb59)[_0x6eac('0x44')]()[_0x6eac('0x3c')](function(_0x3c7809){return _['some'](_0x13dd18,[_0x6eac('0x2f'),_0x3c7809])?_0x3c7809:undefined;})[_0x6eac('0x45')]()['value']();if(_0xa2eb59[_0x6eac('0x46')]){_0x38acc2[_0x6eac('0x47')](_0x6eac('0x46'));}if(_0x38acc2[_0x6eac('0x2e')]>0x0){_0x38acc2[_0x6eac('0x1f')](function(_0x2eaca5){if(_0x2eaca5===_0x6eac('0x7')){_0x3ae3da[_0x6eac('0x3f')](_0x6eac('0x48'),[]['concat'](_0xa2eb59[_0x2eaca5]));}else if(_0x2eaca5===_0x6eac('0x46')){var _0x40d33f='%'+_0xa2eb59[_0x2eaca5]+'%';_0x3ae3da[_0x6eac('0x3f')](_0x6eac('0x49'),_0x40d33f);}else{_0x3ae3da['and']('c.'+_0x2eaca5+_0x6eac('0x4a'),_0xa2eb59[_0x2eaca5]);}});}return _0x3ae3da;}function parseQueryParameters(_0x1916f2,_0x5e7700){var _0x13ed72=getSqlClauses();return Promise[_0x6eac('0x4b')]()['then'](function(){return parseModelFields(_0x1916f2,_0x5e7700);})[_0x6eac('0x4c')](function(_0x285545){_0x13ed72['fields']['and'](_0x285545);return parseTagParameter(_0x1916f2[_0x6eac('0x4d')]);})['then'](function(_0x21a845){_0x13ed72[_0x6eac('0x3d')][_0x6eac('0x3e')][_0x6eac('0x3f')](_0x21a845);return parseSearchFilter(_0x1916f2[_0x6eac('0x4e')]);})[_0x6eac('0x4c')](function(_0x4a17e4){_0x13ed72[_0x6eac('0x4e')]=_0x4a17e4;return _0x13ed72;});}function checkListsRestrictions(_0x3ccec4,_0x20f8a2,_0x585585){var _0x23a4ea=squel[_0x6eac('0x21')]();return Promise[_0x6eac('0x4b')]()[_0x6eac('0x4c')](function(){if(_0x20f8a2[_0x6eac('0x6')]&&_0x3ccec4[_0x6eac('0x4')]===_0x6eac('0x5')&&!_0x585585){return _0x3ccec4[_0x6eac('0x4f')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0xbedbf2){if(_0xbedbf2){if(_0xbedbf2[_0x6eac('0x2e')]===0x0){_0x23a4ea['and'](_0x6eac('0x50'));}else{_0x23a4ea[_0x6eac('0x3f')](_0x6eac('0x48'),_['map'](_0xbedbf2,'id'));}}})['then'](function(){return _0x23a4ea;});}function buildContactsQuery(_0x44b183,_0x256692,_0x4b082a,_0x2ce418,_0x587233,_0x2d7210){if(_0x256692){_0x256692=_0x4b082a[_0x6eac('0x51')];}_0x44b183=addFieldsToQuery(_0x44b183,_0x256692,_0x2ce418,_0x2d7210,!![]);var _0x46a9cc=squel[_0x6eac('0xa')]();_0x46a9cc=addFieldsToQuery(_0x46a9cc,_0x256692,_0x2ce418,_0x2d7210,![]);if(_0x2ce418||_0x2d7210){_0x44b183=applyJoinClauses(_0x44b183,!![]);_0x44b183[_0x6eac('0x52')](_0x6eac('0x53'));if(_0x4b082a[_0x6eac('0x54')]){_0x46a9cc['limit'](_0x4b082a[_0x6eac('0x54')]);}if(_0x4b082a['offset']){_0x46a9cc[_0x6eac('0x55')](_0x4b082a[_0x6eac('0x55')]);}}else{_0x46a9cc=applyJoinClauses(_0x46a9cc,![]);_0x46a9cc[_0x6eac('0x52')]('subqry.id');if(_0x4b082a[_0x6eac('0x54')]){_0x44b183[_0x6eac('0x54')](_0x4b082a[_0x6eac('0x54')]);}if(_0x4b082a['offset']){_0x44b183[_0x6eac('0x55')](_0x4b082a[_0x6eac('0x55')]);}}_0x46a9cc[_0x6eac('0x56')](_0x587233);if(_0x4b082a[_0x6eac('0x57')]){_0x4b082a['order'][_0x6eac('0x1f')](function(_0xb8aae){_0x44b183[_0x6eac('0x57')]('c.'+_0xb8aae[0x0],_0xb8aae[0x1]===_0x6eac('0x58')?![]:!![]);_0x46a9cc[_0x6eac('0x57')](_0x6eac('0x59')+_0xb8aae[0x0],_0xb8aae[0x1]===_0x6eac('0x58')?![]:!![]);});}_0x46a9cc['from'](_0x44b183,'subqry');return _0x46a9cc;}function getFilteredContacts(_0x24e693){var _0x238f37=[];return db[_0x6eac('0x3a')][_0x6eac('0x5a')]({'attributes':['id',_0x6eac('0x2f'),'color'],'raw':!![]})[_0x6eac('0x4c')](function(_0x1c4442){_0x238f37=_['keyBy'](_0x1c4442,'id');var _0x281c36={'type':db['Sequelize'][_0x6eac('0x5b')][_0x6eac('0x5c')],'model':db[_0x6eac('0x5d')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x6eac('0x5e')][_0x6eac('0x5f')](_0x24e693['toString'](),_0x281c36);})[_0x6eac('0x4c')](function(_0x48ffa5){_0x48ffa5['forEach'](function(_0x300318){if(_0x300318[_0x6eac('0x1d')]){_0x300318[_0x6eac('0x60')]=[];_0x300318[_0x6eac('0x1d')][_0x6eac('0x3b')](',')[_0x6eac('0x1f')](function(_0x3405dd){_0x300318['Tags'][_0x6eac('0x47')](_0x238f37[_0x3405dd]);});}delete _0x300318[_0x6eac('0x1d')];});return _0x48ffa5;});}function countFilteredContacts(_0x5759eb,_0x58e599){var _0x3fabcf=_0x5759eb['clone']();_0x3fabcf[_0x6eac('0x20')](_0x6eac('0x61'));_0x3fabcf=applyJoinClauses(_0x3fabcf,!![]);_0x5759eb[_0x6eac('0x52')]('c.id');var _0x364ce4=utils[_0x6eac('0x22')](_0x58e599);if(!_[_0x6eac('0x62')](_0x364ce4)){_0x3fabcf[_0x6eac('0xc')](_0x6eac('0x63'),_0x364ce4);}var _0xbb0ee0={'type':db['Sequelize'][_0x6eac('0x5b')]['SELECT'],'raw':!![]};return db[_0x6eac('0x5e')]['query'](_0x3fabcf['toString'](),_0xbb0ee0)[_0x6eac('0x4c')](function(_0x3da472){return _0x3da472[0x0]['COUNT(*)'];});}module['exports']={'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 1331515..c190f64 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 _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 +var _0x4c2c=['app','secrets','session','aes-256-ctr','encrypt','algorithm','join','error','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','final','close','unlink','decryptFile','createDecipher','end','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash'];(function(_0x2532e8,_0x1cdb49){var _0x1d165c=function(_0x3ab8f1){while(--_0x3ab8f1){_0x2532e8['push'](_0x2532e8['shift']());}};_0x1d165c(++_0x1cdb49);}(_0x4c2c,0x1a1));var _0xc4c2=function(_0x2cc96a,_0x5952d4){_0x2cc96a=_0x2cc96a-0x0;var _0x5237d7=_0x4c2c[_0x2cc96a];return _0x5237d7;};'use strict';var crypto=require(_0xc4c2('0x0'));var fs=require('fs');var BPromise=require(_0xc4c2('0x1'));var _=require(_0xc4c2('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xc4c2('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xc4c2('0x4')][_0xc4c2('0x5')],'algorithm':_0xc4c2('0x6')};const fileOptions={'algorithm':'aes192'};if(config[_0xc4c2('0x7')]&&config[_0xc4c2('0x7')][_0xc4c2('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xc4c2('0x8')]);if(isSupported){fileOptions['algorithm']=config[_0xc4c2('0x7')][_0xc4c2('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xc4c2('0x9')](',\x20');logger[_0xc4c2('0xa')](config[_0xc4c2('0x7')][_0xc4c2('0x8')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x4e7220){return AES_SUPPORTED_RX[_0xc4c2('0xb')](_0x4e7220);}function getSupportedCiphers(){return crypto[_0xc4c2('0xc')]()[_0xc4c2('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x3bc78b){return getSupportedCiphers()[_0xc4c2('0xe')](_0x3bc78b)>-0x1;}function combineOptions(_0x357738){var _0x9b8485={};for(var _0x27525e in fileOptions){if(fileOptions[_0xc4c2('0xf')](_0x27525e)){_0x9b8485[_0x27525e]=fileOptions[_0x27525e];}}if(_0x357738){for(var _0x535ee9 in _0x357738){if(_0x357738['hasOwnProperty'](_0x535ee9)){_0x9b8485[_0x535ee9]=_0x357738[_0x535ee9];}}}return _0x9b8485;}exports[_0xc4c2('0x10')]=function(_0xdd4296,_0x2951a7,_0xe8f595,_0xdc4dab){return new BPromise(function(_0x1e2189,_0x5da9f1){_0xdc4dab=combineOptions(_0xdc4dab);var _0x290660=new Buffer(_0xe8f595);var _0x459b01=fs[_0xc4c2('0x11')](_0xdd4296);var _0x5b39e0=fs[_0xc4c2('0x12')](_0x2951a7);var _0x491f91=crypto[_0xc4c2('0x13')](_0xdc4dab[_0xc4c2('0x8')],_0x290660);_0x459b01['on'](_0xc4c2('0x14'),function(_0x395c7f){var _0x3b781b=new Buffer(_0x491f91[_0xc4c2('0x15')](_0x395c7f),_0xc4c2('0x16'));_0x5b39e0[_0xc4c2('0x17')](_0x3b781b);});_0x459b01['on']('end',function(){try{var _0x3e102c=new Buffer(_0x491f91[_0xc4c2('0x18')](_0xc4c2('0x16')),_0xc4c2('0x16'));_0x5b39e0[_0xc4c2('0x17')](_0x3e102c);_0x5b39e0['end']();_0x5b39e0['on'](_0xc4c2('0x19'),function(){return _0x1e2189(_0x2951a7);});}catch(_0x143c04){fs[_0xc4c2('0x1a')](_0x2951a7);return _0x5da9f1(_0x143c04);}});});};exports[_0xc4c2('0x1b')]=function(_0x3faee9,_0x373f85,_0x5ac58d,_0x5d373a){return new BPromise(function(_0x5740a2,_0x21652b){_0x5d373a=combineOptions(_0x5d373a);var _0x345f60=new Buffer(_0x5ac58d);var _0x1f02cf=fs[_0xc4c2('0x11')](_0x3faee9);var _0x28f253=fs['createWriteStream'](_0x373f85);var _0x26c8c9=crypto[_0xc4c2('0x1c')](_0x5d373a[_0xc4c2('0x8')],_0x345f60);_0x1f02cf['on'](_0xc4c2('0x14'),function(_0x30d03b){var _0x2944d0=new Buffer(_0x26c8c9[_0xc4c2('0x15')](_0x30d03b),_0xc4c2('0x16'));_0x28f253[_0xc4c2('0x17')](_0x2944d0);});_0x1f02cf['on'](_0xc4c2('0x1d'),function(){try{var _0x262e3f=new Buffer(_0x26c8c9['final'](_0xc4c2('0x16')),_0xc4c2('0x16'));_0x28f253[_0xc4c2('0x17')](_0x262e3f);_0x28f253[_0xc4c2('0x1d')]();_0x28f253['on'](_0xc4c2('0x19'),function(){return _0x5740a2(_0x373f85);});}catch(_0x241abf){fs[_0xc4c2('0x1a')](_0x373f85);return _0x21652b(_0x241abf);}});});};exports[_0xc4c2('0x1e')]=function(_0x393173,_0x37b10d,_0x357894){var _0x392335=_0x357894||stringOptions[_0xc4c2('0x8')];var _0x332cde=_0x37b10d||stringOptions[_0xc4c2('0x1f')];var _0x2d66b5=crypto[_0xc4c2('0x13')](_0x392335,_0x332cde);var _0x1ad137=_0x2d66b5[_0xc4c2('0x15')](_0x393173,_0xc4c2('0x20'),_0xc4c2('0x21'));_0x1ad137+=_0x2d66b5[_0xc4c2('0x18')]('base64');return _0x1ad137;};exports[_0xc4c2('0x22')]=function(_0x5c1a45,_0x4c0ca3,_0x58d778){var _0x2dcb81=_0x58d778||stringOptions['algorithm'];var _0x1efe65=_0x4c0ca3||stringOptions['secret'];var _0x195140=crypto[_0xc4c2('0x1c')](_0x2dcb81,_0x1efe65);var _0x344d01=_0x195140[_0xc4c2('0x15')](_0x5c1a45,_0xc4c2('0x21'),_0xc4c2('0x20'));_0x344d01+=_0x195140[_0xc4c2('0x18')](_0xc4c2('0x20'));return _0x344d01;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index f42db58..52f3d56 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 _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 +var _0x13d0=['%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.csv','existsSync','join'];(function(_0x3fe6df,_0x5a04d4){var _0x372a0e=function(_0x144b98){while(--_0x144b98){_0x3fe6df['push'](_0x3fe6df['shift']());}};_0x372a0e(++_0x5a04d4);}(_0x13d0,0x6b));var _0x013d=function(_0x11d6d6,_0x106a75){_0x11d6d6=_0x11d6d6-0x0;var _0x158d4f=_0x13d0[_0x11d6d6];return _0x158d4f;};'use strict';var util=require(_0x013d('0x0'));var path=require(_0x013d('0x1'));var _=require(_0x013d('0x2'));var csv=require(_0x013d('0x3'));var fs=require('fs');var BPromise=require(_0x013d('0x4'));var zipdir=require(_0x013d('0x5'));var rimraf=require(_0x013d('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0x013d('0x7'))['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x013d('0x8')][0x2]);var QUERY=process[_0x013d('0x8')][0x3];var PATH=process[_0x013d('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xa5a4a8,_0x30dfc9){var _0x4114b5={'status':_0xa5a4a8};var _0x509ef4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x30dfc9){_0x4114b5['savename']=_0x30dfc9;}return db[_0x013d('0x9')][_0x013d('0xa')](_0x4114b5,_0x509ef4);}function main(){var _0x36d19d=0x1388;var _0xf75d44;logger[_0x013d('0xb')](util[_0x013d('0xc')](_0x013d('0xd'),EXTRACTED_REPORT_ID,_0x013d('0xe')));return db[_0x013d('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x013d('0x10'),_0x013d('0x11')]})['then'](function(_0x317279){if(_0x317279){_0xf75d44=_0x317279;_0x36d19d=_0xf75d44['splitSizeCsv']||0x1388;}})[_0x013d('0x12')](function(){return dbH[_0x013d('0x13')][_0x013d('0x14')](util[_0x013d('0xc')](_0x013d('0x15'),QUERY),{'type':dbH[_0x013d('0x13')][_0x013d('0x16')]['SELECT']});})[_0x013d('0x12')](function(_0x36836c){if(!_0x36836c[0x0]['num']){return analyticExtractedReport(_0x013d('0x17'));}var _0x4c6259=[];var _0x2c1d24=0x0;if(_0xf75d44[_0x013d('0x10')]){if(_0x36836c&&_0x36836c[_0x013d('0x18')]){var _0x396735=_[_0x013d('0x19')](_0x36836c[0x0][_0x013d('0x1a')]/_0x36d19d);var _0x46ed2d=Number[_0x013d('0x1b')](_0x36836c[0x0][_0x013d('0x1a')]/_0x36d19d)?_0x36836c[0x0]['num']%_0x36d19d:0x0;_0x396735[_0x013d('0x1c')](function(_0x50f8d0){if(_0x50f8d0>0x0){_0x2c1d24+=_0x36d19d;}_0x4c6259[_0x013d('0x1d')](dbH[_0x013d('0x13')][_0x013d('0x14')](util['format'](_0x013d('0x1e'),QUERY,_0x36d19d,_0x2c1d24),{'type':dbH['sequelize'][_0x013d('0x16')]['SELECT']}));});if(_0x46ed2d>0x0){_0x2c1d24+=_0x36d19d;_0x4c6259['push'](dbH['sequelize'][_0x013d('0x14')](util[_0x013d('0xc')](_0x013d('0x1e'),QUERY,_0x46ed2d,_0x2c1d24),{'type':dbH[_0x013d('0x13')]['QueryTypes'][_0x013d('0x1f')]}));}}}else{_0x4c6259[_0x013d('0x1d')](dbH[_0x013d('0x13')][_0x013d('0x14')](QUERY,{'type':dbH['sequelize'][_0x013d('0x16')]['SELECT']}));}var _0x324c79=path[_0x013d('0x20')](PATH);var _0x4d125d=path[_0x013d('0x21')](PATH,_0x013d('0x22'));var _0x56403b=_0xf75d44['split']&&_0x4c6259[_0x013d('0x18')]>0x1;var _0x441030=[];if(!fs[_0x013d('0x23')](path[_0x013d('0x24')](_0x324c79,_0x4d125d))&&_0x56403b){fs['mkdirSync'](path[_0x013d('0x24')](_0x324c79,_0x4d125d));}return BPromise['each'](_0x4c6259,function(_0x5219e2){_0x441030[_0x013d('0x1d')](_0x5219e2);})[_0x013d('0x12')](function(){for(var _0x2b50c7=0x0;_0x2b50c7<_0x441030[_0x013d('0x18')];_0x2b50c7+=0x1){var _0x587b51;var _0x4ce998=_0x441030[_0x2b50c7];if(_0x56403b){_0x587b51=path[_0x013d('0x24')](_0x324c79,_0x4d125d,util['format'](_0x013d('0x25'),_0x4d125d,_0x2b50c7,_0x013d('0x26')));}else{_0x587b51=path[_0x013d('0x24')](_0x324c79,util[_0x013d('0xc')](_0x013d('0x27'),_0x4d125d,_0x013d('0x26')));}fs[_0x013d('0x28')](_0x587b51,csv(_0x4ce998));}})[_0x013d('0x12')](function(){if(_0x56403b){return new Promise(function(_0x1575d1){zipdir(path[_0x013d('0x24')](_0x324c79,_0x4d125d),{'saveTo':path[_0x013d('0x24')](_0x324c79,util[_0x013d('0xc')](_0x013d('0x27'),_0x4d125d,_0x013d('0x29')))},function(_0x28d52a,_0x1451d9){rimraf(path[_0x013d('0x24')](_0x324c79,_0x4d125d),function(){});_0x1575d1('zip\x20finished');});});}})['then'](function(){logger[_0x013d('0xb')](util[_0x013d('0xc')](_0x013d('0x2a'),EXTRACTED_REPORT_ID,_0x013d('0xe')));return analyticExtractedReport(_0x013d('0x2b'),_0x56403b?util[_0x013d('0xc')](_0x013d('0x27'),_0x4d125d,_0x56403b?_0x013d('0x29'):_0x013d('0x26')):null);});})[_0x013d('0x2c')](function(_0xace911){logger[_0x013d('0xb')](util[_0x013d('0xc')](_0x013d('0x2d'),EXTRACTED_REPORT_ID,_0x013d('0xe')),util['inspect'](_0xace911,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x013d('0x2e'));})['finally'](function(){process[_0x013d('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 2778a52..28136eb 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 _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 +var _0xc9a6=['pdf','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','info','inspect','Failed','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','path','catch','lodash','util','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','bluebird','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','pick','toString','value','fill','length','body','concat','chunk','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','pageBreak','before','landscape','footer','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','dirname','basename','.pdf','existsSync','join','mkdirSync','each','flatten','%s%d.%s','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF'];(function(_0x2ae2a7,_0x11ba43){var _0x1b0217=function(_0x1a4343){while(--_0x1a4343){_0x2ae2a7['push'](_0x2ae2a7['shift']());}};_0x1b0217(++_0x11ba43);}(_0xc9a6,0xd5));var _0x6c9a=function(_0x138d24,_0x995883){_0x138d24=_0x138d24-0x0;var _0x5dfeda=_0xc9a6[_0x138d24];return _0x5dfeda;};'use strict';var _=require(_0x6c9a('0x0'));var fs=require('fs');var util=require(_0x6c9a('0x1'));var path=require('path');var moment=require(_0x6c9a('0x2'));var htmlToPdfmake=require(_0x6c9a('0x3'));var PdfPrinter=require(_0x6c9a('0x4'));var zipdir=require(_0x6c9a('0x5'));var rimraf=require(_0x6c9a('0x6'));var JSDOM=require(_0x6c9a('0x7'))['JSDOM'];var window=new JSDOM('')[_0x6c9a('0x8')];var BPromise=require(_0x6c9a('0x9'));var db=require(_0x6c9a('0xa'))['db'];var dbH=require(_0x6c9a('0xa'))[_0x6c9a('0xb')];var logger=require(_0x6c9a('0xc'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x6c9a('0xd')][0x3];var PATH=process[_0x6c9a('0xd')][0x4];var NAME=process[_0x6c9a('0xd')][0x5];var FORMAT=_0x6c9a('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x144f0f,_0x4d859c){var _0x303966={'status':_0x144f0f};var _0x2a8c9c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4d859c){_0x303966[_0x6c9a('0xf')]=_0x4d859c;}return db['AnalyticExtractedReport'][_0x6c9a('0x10')](_0x303966,_0x2a8c9c);}function getHeaders(_0x34936a){return _[_0x6c9a('0x11')](_0x34936a,function(_0x6fc884){return{'text':_0x6fc884,'style':_0x6c9a('0x12')};});}function getRows(_0x32be0c,_0x16b622){return _['map'](_0x16b622,function(_0x1a2631){return _(_0x1a2631)[_0x6c9a('0x13')](_0x32be0c)[_0x6c9a('0x11')](function(_0x254adb){return _0x254adb?_[_0x6c9a('0x14')](_0x254adb):'';})[_0x6c9a('0x15')]();});}function createTable(_0x205b9e,_0x11a82f){var _0x5c523f={'widths':_[_0x6c9a('0x16')](Array(_0x205b9e[_0x6c9a('0x17')]),0x91),'heights':function(_0x159cf7){return _0x159cf7===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2a6010=getHeaders(_0x205b9e);_0x5c523f[_0x6c9a('0x18')]['push'](_0x2a6010);var _0x4b1ab8=getRows(_0x205b9e,_0x11a82f);_0x5c523f[_0x6c9a('0x18')]=_0x5c523f[_0x6c9a('0x18')][_0x6c9a('0x19')](_0x4b1ab8);return _0x5c523f;}function createTables(_0x5a8870){var _0x514f63=[];var _0x58fba7=_[_0x6c9a('0x1a')](Object[_0x6c9a('0x1b')](_0x5a8870[0x0]),0x5);_0x58fba7[_0x6c9a('0x1c')](function(_0x36e4d7){_0x514f63[_0x6c9a('0x1d')](createTable(_0x36e4d7,_0x5a8870));});return _0x514f63;}function getPDFDocDefinition(_0x25e3bb){var _0x24d1cd=util[_0x6c9a('0x1e')](_0x6c9a('0x1f'),NAME,EXTRACTED_REPORT[_0x6c9a('0x20')],moment(EXTRACTED_REPORT[_0x6c9a('0x21')])[_0x6c9a('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0x6c9a('0x22')])['format'](FORMAT));var _0x55b419=[];for(var _0x2dcb6c=0x0;_0x2dcb6c<_0x25e3bb[_0x6c9a('0x17')];_0x2dcb6c++){var _0x4d193f=[];if(_0x2dcb6c===0x0){_0x4d193f[_0x6c9a('0x1d')]({'text':_0x24d1cd,'style':'header'});}var _0x666e5d={'table':_0x25e3bb[_0x2dcb6c]};if(_0x2dcb6c>0x0){_0x666e5d[_0x6c9a('0x23')]=_0x6c9a('0x24');_0x666e5d['margin']=[0x0,0x46,0x0,0x0];}_0x4d193f[_0x6c9a('0x1d')](_0x666e5d);_0x55b419[_0x6c9a('0x1d')](_0x4d193f);}return{'pageSize':'A4','pageOrientation':_0x6c9a('0x25'),'content':_0x55b419,'footer':function(_0x1009b1,_0xa956dd){return{'text':_0x1009b1[_0x6c9a('0x14')]()+'\x20/\x20'+_0xa956dd,'style':_0x6c9a('0x26')};},'defaultStyle':{'font':_0x6c9a('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x6c9a('0x28')},'footer':{'alignment':_0x6c9a('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xb22daa){var _0x20ea57=0x1388;var _0x48cc04;if(!_0xb22daa[0x0][_0x6c9a('0x2a')]){return analyticExtractedReport(_0x6c9a('0x2b'));}return db[_0x6c9a('0x2c')][_0x6c9a('0x2d')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6c9a('0x2e'),_0x6c9a('0x2f')]})['then'](function(_0x13b0dc){if(_0x13b0dc){_0x48cc04=_0x13b0dc;_0x20ea57=_0x48cc04[_0x6c9a('0x2f')]||0x3e8;}})[_0x6c9a('0x30')](function(){var _0xe04909=[];var _0x4af991=0x0;if(_0x48cc04[_0x6c9a('0x2e')]){if(_0xb22daa&&_0xb22daa[_0x6c9a('0x17')]){var _0x365a8a=_['range'](_0xb22daa[0x0]['num']/_0x20ea57);var _0x321659=Number[_0x6c9a('0x31')](_0xb22daa[0x0][_0x6c9a('0x2a')]/_0x20ea57)?_0xb22daa[0x0][_0x6c9a('0x2a')]%_0x20ea57:0x0;_0x365a8a[_0x6c9a('0x1c')](function(_0x102648){if(_0x102648>0x0){_0x4af991+=_0x20ea57;}_0xe04909[_0x6c9a('0x1d')](dbH[_0x6c9a('0x32')][_0x6c9a('0x33')](util['format'](_0x6c9a('0x34'),QUERY,_0x20ea57,_0x4af991),{'type':dbH[_0x6c9a('0x32')]['QueryTypes'][_0x6c9a('0x35')]}));});if(_0x321659>0x0){_0x4af991+=_0x20ea57;_0xe04909[_0x6c9a('0x1d')](dbH[_0x6c9a('0x32')][_0x6c9a('0x33')](util[_0x6c9a('0x1e')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x321659,_0x4af991),{'type':dbH[_0x6c9a('0x32')]['QueryTypes'][_0x6c9a('0x35')]}));}}}else{_0xe04909['push'](dbH[_0x6c9a('0x32')][_0x6c9a('0x33')](QUERY,{'type':dbH[_0x6c9a('0x32')][_0x6c9a('0x36')][_0x6c9a('0x35')]}));}var _0x209b3a=path[_0x6c9a('0x37')](PATH);var _0x5021f0=path[_0x6c9a('0x38')](PATH,_0x6c9a('0x39'));var _0x1c36be=_0x48cc04[_0x6c9a('0x2e')]&&_0xe04909['length']>0x1;var _0x5c032e=[];if(!fs[_0x6c9a('0x3a')](path[_0x6c9a('0x3b')](_0x209b3a,_0x5021f0))&&_0x1c36be){fs[_0x6c9a('0x3c')](path[_0x6c9a('0x3b')](_0x209b3a,_0x5021f0));}return BPromise[_0x6c9a('0x3d')](_0xe04909,function(_0x5916e1){_0x5c032e[_0x6c9a('0x1d')](_0x5916e1);})['then'](function(){var _0x44f798=[];for(var _0x5599c6=0x0;_0x5599c6<_0x5c032e[_0x6c9a('0x17')];_0x5599c6+=0x1){var _0x21cd1b=_0x5c032e[_0x5599c6];var _0x4c2336=createTables(_[_0x6c9a('0x3e')](_0x21cd1b));var _0x1f050c;var _0x2a2f17=getPDFDocDefinition(_0x4c2336);var _0xbfc745=getPDFPrinter();var _0x392b93=_0xbfc745['createPdfKitDocument'](_0x2a2f17);if(_0x1c36be){_0x1f050c=path[_0x6c9a('0x3b')](_0x209b3a,_0x5021f0,util['format'](_0x6c9a('0x3f'),_0x5021f0,_0x5599c6,'pdf'));}else{_0x1f050c=path[_0x6c9a('0x3b')](_0x209b3a,util[_0x6c9a('0x1e')](_0x6c9a('0x40'),_0x5021f0,'pdf'));}_0x44f798['push'](writePDFDocument(_0x392b93,_0x1f050c));}return Promise['all'](_0x44f798);})[_0x6c9a('0x30')](function(){if(_0x1c36be){return new Promise(function(_0x1294da){zipdir(path['join'](_0x209b3a,_0x5021f0),{'saveTo':path[_0x6c9a('0x3b')](_0x209b3a,util[_0x6c9a('0x1e')](_0x6c9a('0x40'),_0x5021f0,_0x6c9a('0x41')))},function(){rimraf(path[_0x6c9a('0x3b')](_0x209b3a,_0x5021f0),function(){});_0x1294da(_0x6c9a('0x42'));});});}})[_0x6c9a('0x30')](function(){if(!_0x1c36be)return;rimraf(path[_0x6c9a('0x3b')](_0x209b3a,_0x5021f0),function(){});})['then'](function(){logger['info'](util[_0x6c9a('0x1e')](_0x6c9a('0x43'),EXTRACTED_REPORT_ID,_0x6c9a('0x44')));return analyticExtractedReport('Completed',_0x1c36be?util['format']('%s.%s',_0x5021f0,_0x1c36be?_0x6c9a('0x41'):_0x6c9a('0x45')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format'](_0x6c9a('0x46'),EXTRACTED_REPORT_ID,_0x6c9a('0x44')));return db[_0x6c9a('0x47')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x9505f6){EXTRACTED_REPORT=_0x9505f6;return dbH[_0x6c9a('0x32')][_0x6c9a('0x33')](util[_0x6c9a('0x1e')](_0x6c9a('0x48'),QUERY),{'type':dbH[_0x6c9a('0x32')]['QueryTypes'][_0x6c9a('0x35')]});})[_0x6c9a('0x30')](extractReport)['catch'](function(_0x4576aa){logger[_0x6c9a('0x49')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6c9a('0x44')),util[_0x6c9a('0x4a')](_0x4576aa,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6c9a('0x4b'));})['finally'](function(){process[_0x6c9a('0x4c')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3e5894=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x6c9a('0x4d'),'italics':__dirname+_0x6c9a('0x4e'),'bolditalics':__dirname+_0x6c9a('0x4f')}});return _0x3e5894;}function getPDFDocDefinitionFromHTML(_0x53f28a,_0x4d3c76){var _0x2bfeea=util[_0x6c9a('0x1e')]('%s\x20#%d',_0x4d3c76[_0x6c9a('0x50')],_0x4d3c76[_0x6c9a('0x51')]);var _0x274599=moment()[_0x6c9a('0x1e')]('YYYY-MM-DD')['toString']();var _0x298d06=htmlToPdfmake(_0x53f28a,{'window':window,'tableAutoSize':!![]});return{'content':[_0x298d06],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x6c9a('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x6c9a('0x52')}},'header':function(){return[{'text':_0x6c9a('0x53'),'style':'header'}];},'footer':function(_0x386ec4,_0x1b31ee){return[{'text':util[_0x6c9a('0x1e')](_0x6c9a('0x54'),_0x2bfeea,_0x386ec4,_0x1b31ee,_0x274599),'style':'footer'}];}};}function writePDFDocument(_0x243aa6,_0x2a5498){return new Promise(function(_0x1f8c69,_0x196212){var _0x39745b=_0x243aa6[_0x6c9a('0x55')](fs[_0x6c9a('0x56')](_0x2a5498));_0x39745b['on'](_0x6c9a('0x57'),function(){_0x1f8c69('finish');});_0x39745b['on'](_0x6c9a('0x58'),function(_0x4c37f7){_0x196212(_0x4c37f7);});_0x243aa6[_0x6c9a('0x59')]();});}exports[_0x6c9a('0x5a')]=function(_0xd5c673,_0x1d3f69){var _0x552904=getPDFPrinter();var _0x17986d=getPDFDocDefinitionFromHTML(_0xd5c673,_0x1d3f69);var _0x3c14ed=_0x552904[_0x6c9a('0x5b')](_0x17986d);return writePDFDocument(_0x3c14ed,_0x1d3f69[_0x6c9a('0x5c')])[_0x6c9a('0x5d')](function(_0x7aacda){throw _0x7aacda;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index d39bec4..d6d20a1 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 _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 +var _0xecf5=['join','mkdirSync','each','xlsx','%s.%s','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','path','lodash','bluebird','zip-dir','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','split','splitSizeXlsx','then','sequelize','query','QueryTypes','Empty','length','num','forEach','push','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync'];(function(_0x1cc59c,_0x363029){var _0x45f34c=function(_0x378ab8){while(--_0x378ab8){_0x1cc59c['push'](_0x1cc59c['shift']());}};_0x45f34c(++_0x363029);}(_0xecf5,0x1c5));var _0x5ecf=function(_0x627145,_0x5304ad){_0x627145=_0x627145-0x0;var _0x4ea142=_0xecf5[_0x627145];return _0x4ea142;};'use strict';var util=require('util');var path=require(_0x5ecf('0x0'));var _=require(_0x5ecf('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x5ecf('0x2'));var zipdir=require(_0x5ecf('0x3'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x5ecf('0x4')];var logger=require(_0x5ecf('0x5'))(_0x5ecf('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x5ecf('0x7')][0x2]);var QUERY=process[_0x5ecf('0x7')][0x3];var PATH=process[_0x5ecf('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4af53e,_0x4972e3){var _0x5d89af={'status':_0x4af53e};var _0x99e0d1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4972e3){_0x5d89af[_0x5ecf('0x8')]=_0x4972e3;}return db[_0x5ecf('0x9')]['update'](_0x5d89af,_0x99e0d1);}function main(){var _0x28257a=0x1388;var _0x20c40b;logger[_0x5ecf('0xa')](util[_0x5ecf('0xb')](_0x5ecf('0xc'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting'][_0x5ecf('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5ecf('0xe'),_0x5ecf('0xf')]})[_0x5ecf('0x10')](function(_0x3d061c){if(_0x3d061c){_0x20c40b=_0x3d061c;_0x28257a=_0x20c40b['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0x5ecf('0x11')][_0x5ecf('0x12')](util[_0x5ecf('0xb')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x5ecf('0x11')][_0x5ecf('0x13')]['SELECT']});})['then'](function(_0x2c2472){if(!_0x2c2472[0x0]['num']){return analyticExtractedReport(_0x5ecf('0x14'));}var _0x54c980=[];var _0x306b6f=0x0;if(_0x20c40b[_0x5ecf('0xe')]){if(_0x2c2472&&_0x2c2472[_0x5ecf('0x15')]){var _0x327fed=_['range'](_0x2c2472[0x0][_0x5ecf('0x16')]/_0x28257a);var _0x5723b7=Number['isInteger'](_0x2c2472[0x0][_0x5ecf('0x16')]/_0x28257a)?_0x2c2472[0x0][_0x5ecf('0x16')]%_0x28257a:0x0;_0x327fed[_0x5ecf('0x17')](function(_0x416726){if(_0x416726>0x0){_0x306b6f+=_0x28257a;}_0x54c980[_0x5ecf('0x18')](dbH[_0x5ecf('0x11')][_0x5ecf('0x12')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x28257a,_0x306b6f),{'type':dbH[_0x5ecf('0x11')]['QueryTypes'][_0x5ecf('0x19')]}));});if(_0x5723b7>0x0){_0x306b6f+=_0x28257a;_0x54c980[_0x5ecf('0x18')](dbH['sequelize'][_0x5ecf('0x12')](util[_0x5ecf('0xb')](_0x5ecf('0x1a'),QUERY,_0x5723b7,_0x306b6f),{'type':dbH[_0x5ecf('0x11')]['QueryTypes']['SELECT']}));}}}else{_0x54c980[_0x5ecf('0x18')](dbH[_0x5ecf('0x11')][_0x5ecf('0x12')](QUERY,{'type':dbH['sequelize'][_0x5ecf('0x13')][_0x5ecf('0x19')]}));}var _0x2b0c61=path[_0x5ecf('0x1b')](PATH);var _0x3b6390=path[_0x5ecf('0x1c')](PATH,_0x5ecf('0x1d'));var _0x137e90=_0x20c40b[_0x5ecf('0xe')]&&_0x54c980[_0x5ecf('0x15')]>0x1;var _0x1786c7=[];if(!fs[_0x5ecf('0x1e')](path[_0x5ecf('0x1f')](_0x2b0c61,_0x3b6390))&&_0x137e90){fs[_0x5ecf('0x20')](path[_0x5ecf('0x1f')](_0x2b0c61,_0x3b6390));}return BPromise[_0x5ecf('0x21')](_0x54c980,function(_0x6dd7b4){_0x1786c7['push'](_0x6dd7b4);})[_0x5ecf('0x10')](function(){for(var _0x5831f8=0x0;_0x5831f8<_0x1786c7['length'];_0x5831f8+=0x1){var _0x4b752b;var _0x460bb2=_0x1786c7[_0x5831f8];if(_0x137e90){_0x4b752b=path[_0x5ecf('0x1f')](_0x2b0c61,_0x3b6390,util[_0x5ecf('0xb')]('%s%d.%s',_0x3b6390,_0x5831f8,_0x5ecf('0x22')));}else{_0x4b752b=path[_0x5ecf('0x1f')](_0x2b0c61,util[_0x5ecf('0xb')](_0x5ecf('0x23'),_0x3b6390,_0x5ecf('0x22')));}fs[_0x5ecf('0x24')](_0x4b752b,json2xls(_0x460bb2),'binary');}})[_0x5ecf('0x10')](function(){if(_0x137e90){return new Promise(function(_0xd28d6){zipdir(path[_0x5ecf('0x1f')](_0x2b0c61,_0x3b6390),{'saveTo':path['join'](_0x2b0c61,util[_0x5ecf('0xb')]('%s.%s',_0x3b6390,'zip'))},function(_0x256f79,_0x17c38b){rimraf(path[_0x5ecf('0x1f')](_0x2b0c61,_0x3b6390),function(){});_0xd28d6('zip\x20finished');});});}})[_0x5ecf('0x10')](function(){logger[_0x5ecf('0xa')](util['format'](_0x5ecf('0x25'),EXTRACTED_REPORT_ID,_0x5ecf('0x26')));return analyticExtractedReport(_0x5ecf('0x27'),_0x137e90?util[_0x5ecf('0xb')]('%s.%s',_0x3b6390,_0x137e90?_0x5ecf('0x28'):_0x5ecf('0x22')):null);});})['catch'](function(_0xb51a7c){logger[_0x5ecf('0xa')](util['format'](_0x5ecf('0x29'),EXTRACTED_REPORT_ID,_0x5ecf('0x26')),util['inspect'](_0xb51a7c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5ecf('0x2a'));})['finally'](function(){process[_0x5ecf('0x2b')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 9171d83..9b57ac1 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 _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 +var _0x3601=['then','intervals','VoiceExtension','IntervalId','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','exten','queue','priority','extensions','find','push','type','Set','format','CDR(type)=%s','VoiceExtensionId','inbound','CDR(routeid)=','context','outbound','extension','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','error','lodash','util','models','findAll'];(function(_0x4f8aa0,_0x113d69){var _0x45557c=function(_0x2e2670){while(--_0x2e2670){_0x4f8aa0['push'](_0x4f8aa0['shift']());}};_0x45557c(++_0x113d69);}(_0x3601,0xd1));var _0x1360=function(_0x1133bb,_0x46c98d){_0x1133bb=_0x1133bb-0x0;var _0x1ebc9b=_0x3601[_0x1133bb];return _0x1ebc9b;};'use strict';var _=require(_0x1360('0x0'));var util=require(_0x1360('0x1'));function rewrite(_0x4860b2,_0x3fb17c){var _0x39016c=this;return _0x4860b2[_0x1360('0x2')]['Interval'][_0x1360('0x3')]({'raw':!![]})[_0x1360('0x4')](function(_0x53a9ec){_0x39016c[_0x1360('0x5')]=_0x53a9ec;return _0x4860b2[_0x1360('0x2')][_0x1360('0x6')][_0x1360('0x3')]({'where':{'IntervalId':_0x3fb17c[_0x1360('0x7')]},'raw':!![]});})[_0x1360('0x4')](function(_0x59e908){return _0x4860b2[_0x1360('0x2')][_0x1360('0x6')]['findAll']({'where':{'exten':{'$in':_[_0x1360('0x8')](_[_0x1360('0x9')](_0x59e908,'exten'))}},'order':[{'raw':_0x1360('0xa')}],'raw':!![]});})['then'](function(_0x2f78b4){var _0x628d49=_[_0x1360('0xb')](_0x2f78b4,{'priority':'1'});var _0x5a0056=_['filter'](_0x2f78b4,{'isApp':0x1});var _0x4ea44c=_['groupBy'](_0x5a0056,_0x1360('0xc'));var _0x2626b5=[_0x1360('0xd'),'playback'];var _0x325a54=[];var _0x16e4df=[];for(var _0x2ef414 in _0x4ea44c){if(_0x4ea44c['hasOwnProperty'](_0x2ef414)){_0x39016c[_0x1360('0xe')]=0x2;_0x39016c[_0x1360('0xf')]=[];_0x39016c['extension']=_[_0x1360('0x10')](_0x628d49,{'exten':_0x4ea44c[_0x2ef414][0x0][_0x1360('0xc')]});_0x39016c[_0x1360('0xf')][_0x1360('0x11')]({'type':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x12')],'app':_0x1360('0x13'),'appdata':util[_0x1360('0x14')](_0x1360('0x15'),_0x4ea44c[_0x2ef414][0x0][_0x1360('0x12')]),'context':_0x4ea44c[_0x2ef414][0x0]['context'],'exten':_0x4ea44c[_0x2ef414][0x0][_0x1360('0xc')],'priority':_0x39016c[_0x1360('0xe')]++,'VoiceExtensionId':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x16')]});if(_0x4ea44c[_0x2ef414][0x0][_0x1360('0x12')]===_0x1360('0x17')){_0x39016c[_0x1360('0xf')][_0x1360('0x11')]({'type':_0x4ea44c[_0x2ef414][0x0]['type'],'app':_0x1360('0x13'),'appdata':_0x1360('0x18')+_0x4ea44c[_0x2ef414][0x0][_0x1360('0x16')],'context':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x19')],'exten':_0x4ea44c[_0x2ef414][0x0]['exten'],'priority':_0x39016c['priority']++,'VoiceExtensionId':_0x4ea44c[_0x2ef414][0x0]['VoiceExtensionId']});}else if(_0x4ea44c[_0x2ef414][0x0][_0x1360('0x12')]===_0x1360('0x1a')){if(_0x39016c[_0x1360('0x1b')]){_0x39016c['extensions']['push']({'type':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x12')],'app':_0x1360('0x13'),'appdata':_0x1360('0x1c')+(_0x39016c[_0x1360('0x1b')][_0x1360('0x1d')]?_0x1360('0x1e')+_0x39016c['extension'][_0x1360('0x1d')]+'}':'${EXTEN}'),'context':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x19')],'exten':_0x4ea44c[_0x2ef414][0x0]['exten'],'priority':_0x39016c['priority']++,'VoiceExtensionId':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x16')]});}_0x39016c['extensions']['push']({'type':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x12')],'app':'Set','appdata':_0x1360('0x18')+_0x4ea44c[_0x2ef414][0x0][_0x1360('0x16')],'context':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x19')],'exten':_0x4ea44c[_0x2ef414][0x0][_0x1360('0xc')],'priority':_0x39016c[_0x1360('0xe')]++,'VoiceExtensionId':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x16')]});var _0x59189c=_0x39016c[_0x1360('0xe')]++;_0x39016c[_0x1360('0xf')][_0x1360('0x11')]({'type':_0x4ea44c[_0x2ef414][0x0]['type'],'app':_0x1360('0x1f'),'appdata':_0x1360('0x20')+(_0x59189c+0x2)+_0x1360('0x21')+(_0x59189c+0x1)+')','context':_0x4ea44c[_0x2ef414][0x0]['context'],'exten':_0x4ea44c[_0x2ef414][0x0]['exten'],'priority':_0x59189c,'VoiceExtensionId':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x16')]});if(_0x39016c[_0x1360('0x1b')]){_0x39016c['extensions'][_0x1360('0x11')]({'type':_0x4ea44c[_0x2ef414][0x0]['type'],'app':'Set','appdata':_0x39016c[_0x1360('0x1b')]['cutdigits']?_0x1360('0x22')+_0x39016c[_0x1360('0x1b')]['cutdigits']+'}':_0x1360('0x23'),'context':_0x4ea44c[_0x2ef414][0x0]['context'],'exten':_0x4ea44c[_0x2ef414][0x0][_0x1360('0xc')],'priority':_0x39016c[_0x1360('0xe')]++,'VoiceExtensionId':_0x4ea44c[_0x2ef414][0x0]['VoiceExtensionId']});}_0x39016c['extensions'][_0x1360('0x11')]({'type':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x12')],'app':_0x1360('0x13'),'appdata':'outboundrouteid='+_0x4ea44c[_0x2ef414][0x0]['VoiceExtensionId'],'context':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x19')],'exten':_0x4ea44c[_0x2ef414][0x0]['exten'],'priority':_0x39016c[_0x1360('0xe')]++,'VoiceExtensionId':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x16')]});if(_0x39016c[_0x1360('0x1b')]&&_0x39016c[_0x1360('0x1b')][_0x1360('0x24')](_0x1360('0x25'))&&_0x39016c['extension'][_0x1360('0x25')]!==_0x1360('0x26')){_0x39016c[_0x1360('0xf')][_0x1360('0x11')]({'type':_0x4ea44c[_0x2ef414][0x0]['type'],'app':_0x1360('0x13'),'appdata':_0x1360('0x27'),'context':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x19')],'exten':_0x4ea44c[_0x2ef414][0x0][_0x1360('0xc')],'priority':_0x39016c[_0x1360('0xe')]++,'VoiceExtensionId':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x16')]});_0x39016c[_0x1360('0xf')][_0x1360('0x11')]({'type':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x12')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x39016c[_0x1360('0x1b')][_0x1360('0x25')]||_0x1360('0x28'),'context':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x19')],'exten':_0x4ea44c[_0x2ef414][0x0]['exten'],'priority':_0x39016c[_0x1360('0xe')]++,'VoiceExtensionId':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x16')]});}}_0x39016c[_0x1360('0xf')][_0x1360('0x11')]({'type':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x12')],'app':'Set','appdata':_0x1360('0x29'),'context':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x19')],'exten':_0x4ea44c[_0x2ef414][0x0][_0x1360('0xc')],'priority':_0x39016c[_0x1360('0xe')]++,'VoiceExtensionId':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x16')]});_0x39016c['extensions'][_0x1360('0x11')]({'type':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x12')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x19')],'exten':_0x4ea44c[_0x2ef414][0x0]['exten'],'priority':_0x39016c[_0x1360('0xe')]++,'VoiceExtensionId':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x16')]});_0x39016c[_0x1360('0xf')]['push']({'type':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x12')],'app':_0x1360('0x13'),'appdata':_0x1360('0x2a'),'context':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x19')],'exten':_0x4ea44c[_0x2ef414][0x0][_0x1360('0xc')],'priority':_0x39016c[_0x1360('0xe')]++,'VoiceExtensionId':_0x4ea44c[_0x2ef414][0x0]['VoiceExtensionId']});for(var _0x3c8d90=0x0,_0x35d8d2=0x0;_0x3c8d90<_0x4ea44c[_0x2ef414]['length'];_0x3c8d90+=0x1,_0x35d8d2=0x0){var _0x202fb0=_0x4ea44c[_0x2ef414][_0x3c8d90];if(_0x202fb0[_0x1360('0x12')]){_0x202fb0['type']=_0x202fb0[_0x1360('0x12')][_0x1360('0x2b')]();}var _0x4b9464=[];var _0x135583=[];delete _0x202fb0['id'];delete _0x202fb0[_0x1360('0x2c')];delete _0x202fb0[_0x1360('0x2d')];var _0x5de600=_0x202fb0[_0x1360('0x2e')]!==_0x1360('0x2f')?[_0x202fb0[_0x1360('0x2e')]]:_0x202fb0[_0x1360('0x7')]?_[_0x1360('0x9')](_[_0x1360('0xb')](_0x39016c['intervals'],{'IntervalId':_0x202fb0[_0x1360('0x7')]}),'interval'):[];if(_0x202fb0['hasOwnProperty'](_0x1360('0x30'))){if(_0x202fb0['tag']&&_0x202fb0[_0x1360('0x30')]!=='--'){_0x4b9464['push']({'type':_0x202fb0[_0x1360('0x12')],'app':_0x1360('0x13'),'appdata':_0x1360('0x31')+_0x202fb0['tag'],'context':_0x202fb0[_0x1360('0x19')],'exten':_0x202fb0[_0x1360('0xc')],'priority':_0x5de600[_0x1360('0x32')]+_0x39016c['priority']+_0x35d8d2++,'VoiceExtensionId':_0x202fb0['VoiceExtensionId']});}}if(_0x202fb0['type']===_0x1360('0x1a')&&_0x202fb0[_0x1360('0x24')](_0x1360('0x33'))){if(_0x202fb0['callerID']){_0x4b9464[_0x1360('0x11')]({'type':_0x202fb0[_0x1360('0x12')],'app':_0x1360('0x1f'),'appdata':_0x1360('0x34')+_0x202fb0[_0x1360('0x33')]+')','context':_0x202fb0['context'],'exten':_0x202fb0[_0x1360('0xc')],'priority':_0x5de600[_0x1360('0x32')]+_0x39016c['priority']+_0x35d8d2++,'VoiceExtensionId':_0x202fb0['VoiceExtensionId']});}else{_0x4b9464['push']({'type':_0x202fb0[_0x1360('0x12')],'app':_0x1360('0x1f'),'appdata':_0x1360('0x35'),'context':_0x202fb0[_0x1360('0x19')],'exten':_0x202fb0[_0x1360('0xc')],'priority':_0x5de600['length']+_0x39016c[_0x1360('0xe')]+_0x35d8d2++,'VoiceExtensionId':_0x202fb0['VoiceExtensionId']});}}if(_0x202fb0[_0x1360('0x24')]('answer')){if(_0x2626b5[_0x1360('0x36')](_0x202fb0[_0x1360('0x37')][_0x1360('0x2b')]())>=0x0&&_0x202fb0[_0x1360('0x38')]!==_0x1360('0x39')){if(_0x202fb0['answer']){_0x4b9464[_0x1360('0x11')]({'type':_0x202fb0['type'],'app':_0x1360('0x1f'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x202fb0[_0x1360('0x19')],'exten':_0x202fb0[_0x1360('0xc')],'priority':_0x5de600[_0x1360('0x32')]+_0x39016c[_0x1360('0xe')]+_0x35d8d2++,'VoiceExtensionId':_0x202fb0[_0x1360('0x16')]});_0x4b9464['push']({'type':_0x202fb0[_0x1360('0x12')],'app':_0x1360('0x13'),'appdata':_0x1360('0x3a'),'context':_0x202fb0['context'],'exten':_0x202fb0[_0x1360('0xc')],'priority':_0x5de600[_0x1360('0x32')]+_0x39016c[_0x1360('0xe')]+_0x35d8d2++,'VoiceExtensionId':_0x202fb0[_0x1360('0x16')]});}else{_0x4b9464[_0x1360('0x11')]({'type':_0x202fb0[_0x1360('0x12')],'app':_0x1360('0x1f'),'appdata':_0x1360('0x3b'),'context':_0x202fb0['context'],'exten':_0x202fb0['exten'],'priority':_0x5de600[_0x1360('0x32')]+_0x39016c[_0x1360('0xe')]+_0x35d8d2++,'VoiceExtensionId':_0x202fb0['VoiceExtensionId']});_0x4b9464[_0x1360('0x11')]({'type':_0x202fb0[_0x1360('0x12')],'app':'Set','appdata':_0x1360('0x3c'),'context':_0x202fb0[_0x1360('0x19')],'exten':_0x202fb0[_0x1360('0xc')],'priority':_0x5de600[_0x1360('0x32')]+_0x39016c[_0x1360('0xe')]+_0x35d8d2++,'VoiceExtensionId':_0x202fb0[_0x1360('0x16')]});}}}for(var _0x5c803e=0x0;_0x5c803e<_0x5de600[_0x1360('0x32')];_0x5c803e+=0x1){var _0x588cee=_0x39016c['priority']+_0x5de600['length'];var _0x1d7a38=_0x5c803e===_0x5de600['length']-0x1?_0x39016c[_0x1360('0xe')]+_0x4b9464[_0x1360('0x32')]+_0x135583['length']+0x2:_0x39016c[_0x1360('0xe')]+_0x5c803e+0x1;_0x4b9464['splice'](_0x5c803e,0x0,{'type':_0x202fb0[_0x1360('0x12')],'app':_0x1360('0x3d'),'appdata':_0x5de600[_0x5c803e]+'?'+_0x202fb0[_0x1360('0x19')]+_0x1360('0x3e')+_0x588cee+':'+_0x202fb0[_0x1360('0x19')]+_0x1360('0x3e')+_0x1d7a38,'exten':_0x202fb0[_0x1360('0xc')],'context':_0x202fb0[_0x1360('0x19')],'priority':_0x39016c[_0x1360('0xe')]+_0x5c803e,'VoiceExtensionId':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x16')]});}_0x202fb0[_0x1360('0xe')]=_0x4b9464[_0x1360('0x32')]?_['last'](_0x4b9464)[_0x1360('0xe')]+0x1:_0x39016c[_0x1360('0xe')];_0x39016c[_0x1360('0xe')]=(_0x135583[_0x1360('0x32')]?_[_0x1360('0x3f')](_0x135583)[_0x1360('0xe')]:_0x202fb0[_0x1360('0xe')])+0x1;_0x39016c[_0x1360('0xf')]=_[_0x1360('0x40')](_0x39016c[_0x1360('0xf')],_0x4b9464,[_0x202fb0],_0x135583);}_0x39016c[_0x1360('0xf')][_0x1360('0x11')]({'type':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x12')],'app':_0x1360('0x41'),'exten':_0x4ea44c[_0x2ef414][0x0][_0x1360('0xc')],'context':_0x4ea44c[_0x2ef414][0x0][_0x1360('0x19')],'priority':_0x39016c[_0x1360('0xe')],'VoiceExtensionId':_0x4ea44c[_0x2ef414][0x0]['VoiceExtensionId']});_0x325a54[_0x1360('0x11')](_0x4ea44c[_0x2ef414][0x0][_0x1360('0x16')]);_0x16e4df=_[_0x1360('0x40')](_0x16e4df,_0x39016c[_0x1360('0xf')]);}}return _0x4860b2[_0x1360('0x42')](function(_0x1b2183){return _0x4860b2[_0x1360('0x2')][_0x1360('0x6')][_0x1360('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x325a54}},'transaction':_0x1b2183})[_0x1360('0x4')](function(_0x13f235){return _0x4860b2[_0x1360('0x2')]['VoiceExtension'][_0x1360('0x44')](_[_0x1360('0x45')](_0x16e4df,_0x1360('0xe')),{'transaction':_0x1b2183});});});})['catch'](function(_0x1c12ae){console[_0x1360('0x46')](_0x1c12ae);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index e645224..2bed7fc 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 _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 +var _0x97a3=['email','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','keys','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','scheduledAt','createdAt','updatedAt','select','field','NOW()','ContactId','toString','from','deletedAt\x20IS\x20NULL','where','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','into','fromQuery','cm_contacts','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','ListId\x20=\x20?','cm_hopper_black','findAll','dialCheckDuplicateType','CmList','Lists','then','get','always','push','sequelize','query','onlyIfOpen','VoiceQueueId','VoiceQueue','outbound','BlackLists','Campaign','CampaignId','all','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','resolve','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','split','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','errors','length','map','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD'];(function(_0xfea60d,_0x5d5f0c){var _0x346960=function(_0x3bf318){while(--_0x3bf318){_0xfea60d['push'](_0xfea60d['shift']());}};_0x346960(++_0x5d5f0c);}(_0x97a3,0xb9));var _0x397a=function(_0x546a4b,_0x55ad70){_0x546a4b=_0x546a4b-0x0;var _0x2367f3=_0x97a3[_0x546a4b];return _0x2367f3;};'use strict';var BPromise=require(_0x397a('0x0'));var util=require('util');var _=require(_0x397a('0x1'));var fs=require('fs');var squel=require(_0x397a('0x2'));var Papa=require(_0x397a('0x3'));var Redis=require('ioredis');var db=require(_0x397a('0x4'))['db'];var config=require(_0x397a('0x5'));var logger=require(_0x397a('0x6'))(_0x397a('0x7'));config[_0x397a('0x8')]=_[_0x397a('0x9')](config[_0x397a('0x8')],{'host':_0x397a('0xa'),'port':0x18eb});var socket=require(_0x397a('0xb'))(new Redis(config['redis']));require(_0x397a('0xc'))[_0x397a('0xd')](socket);try{if(!process[_0x397a('0xe')][0x2]||process[_0x397a('0xe')][0x2]===_0x397a('0xf')||process[_0x397a('0xe')][0x2]===_0x397a('0x10')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x397a('0xe')][0x2];if(!process[_0x397a('0xe')][0x3]||process[_0x397a('0xe')][0x3]===_0x397a('0xf')||process[_0x397a('0xe')][0x3]===_0x397a('0x10')||!process['argv'][0x4]||process[_0x397a('0xe')][0x4]===_0x397a('0xf')||process[_0x397a('0xe')][0x4]===_0x397a('0x10')){throw new Error(_0x397a('0x11'));}var FIELDS=_[_0x397a('0x12')](process[_0x397a('0xe')][0x3]['split'](','),process[_0x397a('0xe')][0x4]['split'](','));if(!process[_0x397a('0xe')][0x5]||process[_0x397a('0xe')][0x5]===_0x397a('0xf')||process['argv'][0x5]===_0x397a('0x10')){throw new Error(_0x397a('0x13'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x397a('0xe')][0x6]&&process[_0x397a('0xe')][0x6]!=='undefined'&&process[_0x397a('0xe')][0x6]!==_0x397a('0x10')?process[_0x397a('0xe')][0x6]:null;var DUPLICATES=process[_0x397a('0xe')][0x7]&&process['argv'][0x7]!==_0x397a('0xf')&&process[_0x397a('0xe')][0x7]!==_0x397a('0x10')?process[_0x397a('0xe')][0x7]:null;if(!process[_0x397a('0xe')][0x8]||process[_0x397a('0xe')][0x8]===_0x397a('0xf')||process[_0x397a('0xe')][0x8]===_0x397a('0x10')){throw new Error(_0x397a('0x14'));}var SOCKET_TIMESTAMP=process[_0x397a('0xe')][0x8];}catch(_0x10343c){logger[_0x397a('0x15')](_0x10343c);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(_0x17fe0c,_0x34b195,_0x296fbb,_0x7e994d){var _0x429d43={'message':_0x34b195};_0x429d43[_0x17fe0c]=!![];if(_0x296fbb){_0x429d43[_0x397a('0x16')]=_0x296fbb;}if(_0x7e994d){_0x429d43[_0x397a('0x17')]=_0x7e994d;}return _0x429d43;}function isEmail(_0x344e13){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))*$/[_0x397a('0x18')](_0x344e13);}function checkRow(_0x1e2a49,_0x1d4351,_0x4539c9){return new BPromise(function(_0xacfbb,_0x11c7d5){if(_['isNil'](_0x1e2a49)){return _0x11c7d5(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x4539c9));}if(_0x1e2a49[_0x397a('0x19')]&&_0x1e2a49['errors'][_0x397a('0x1a')]){var _0x47cb1e=_[_0x397a('0x1b')](_0x1e2a49['errors'],_0x397a('0x1c'))['join'](';');return _0x11c7d5(handleCheckRowError(_0x397a('0x15'),_0x47cb1e,null,_0x4539c9));}var _0x2bbd2c={};for(var _0x2c861f in FIELDS){if(FIELDS[_0x397a('0x1d')](_0x2c861f)&&FIELDS[_0x2c861f]){_0x2bbd2c[_0x2c861f]=_0x1e2a49[_0x397a('0x1e')][0x0][FIELDS[_0x2c861f]]||_0x1e2a49['data'][0x0]['\ufeff'+FIELDS[_0x2c861f]];}}if(!_0x2bbd2c[_0x397a('0x1f')]){return _0x11c7d5(handleCheckRowError('error',_0x397a('0x20'),null,_0x4539c9));}if(!_0x2bbd2c[_0x397a('0x21')]){return _0x11c7d5(handleCheckRowError(_0x397a('0x15'),_0x397a('0x22'),null,_0x4539c9));}if(_0x2bbd2c[_0x397a('0x23')]){var _0xa829c6=moment(_0x2bbd2c['birthDate'],_0x397a('0x24'));if(!_0xa829c6['isValid']()){return _0x11c7d5(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x4539c9));}}if(_0x2bbd2c[_0x397a('0x25')]){if(!isEmail(_0x2bbd2c[_0x397a('0x25')])){return _0x11c7d5(handleCheckRowError(_0x397a('0x15'),'email\x20format\x20is\x20not\x20valid!',null,_0x4539c9));}}_0x2bbd2c[_0x397a('0x26')]=LISTID;_0x2bbd2c[_0x397a('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x397a('0x1a')]&&_0x1d4351){var _0x53b9e4={};for(var _0x19f053=0x0,_0x4657b3=DUPLICATES[_0x397a('0x1a')];_0x19f053<_0x4657b3;_0x19f053+=0x1){_0x53b9e4[DUPLICATES[_0x19f053]]=_0x2bbd2c[DUPLICATES[_0x19f053]];}var _0x55eb97=_[_0x397a('0x28')](_0x1d4351,_0x53b9e4);if(_0x55eb97){return _0x11c7d5(handleCheckRowError(_0x397a('0x29'),_0x397a('0x2a'),_0x55eb97,_0x4539c9));}}return db[_0x397a('0x2b')]['create'](_0x2bbd2c,{'raw':!![],'hooks':![],'fields':_[_0x397a('0x2c')](_0x2bbd2c)})['then'](function(_0x14117e){if(DUPLICATES&&DUPLICATES[_0x397a('0x1a')]&&_0x1d4351){_0x1d4351['push'](_[_0x397a('0x2d')](_0x2bbd2c,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x14117e['id'];return _0xacfbb();})[_0x397a('0x2e')](function(_0x1242fa){return _0x11c7d5(handleCheckRowError(_0x397a('0x15'),_0x397a('0x2f')+(_0x1242fa[_0x397a('0x1c')]||JSON[_0x397a('0x30')](_0x1242fa)),null,_0x4539c9));});});}function checkHopper(){function _0x3fd961(){return function(_0x233365){logger[_0x397a('0x15')](_0x397a('0x31'),_0x397a('0x32'),util[_0x397a('0x33')](_0x233365,{'showHidden':![],'depth':null}));};}var _0x30d26f=function(_0x3bab0d,_0x1c9f56){var _0x275c89=squel[_0x397a('0x34')]()['into'](_0x397a('0x35'))['fromQuery']([_0x397a('0x21'),_0x397a('0x36'),'ContactId','ListId',_0x1c9f56,_0x397a('0x37'),_0x397a('0x38')],squel[_0x397a('0x39')]()[_0x397a('0x3a')](_0x397a('0x21'),_0x397a('0x21'))[_0x397a('0x3a')](_0x397a('0x3b'),_0x397a('0x36'))[_0x397a('0x3a')]('id',_0x397a('0x3c'))['field'](LISTID[_0x397a('0x3d')](),_0x397a('0x26'))[_0x397a('0x3a')](_0x3bab0d['id']['toString'](),_0x1c9f56)[_0x397a('0x3a')](_0x397a('0x3b'),'createdAt')[_0x397a('0x3a')](_0x397a('0x3b'),_0x397a('0x38'))[_0x397a('0x3e')]('cm_contacts')['where'](_0x397a('0x3f'))[_0x397a('0x40')]('ListId\x20=\x20?',LISTID[_0x397a('0x3d')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x397a('0x41'),squel[_0x397a('0x39')]()[_0x397a('0x3a')]('phone')['from'](_0x397a('0x35'))[_0x397a('0x40')](_0x1c9f56+_0x397a('0x42'),_0x3bab0d['id'][_0x397a('0x3d')]())))['toString']();return _0x275c89;};var _0xa63d73=function(_0x46b340,_0x3c9d1b){var _0x1e66a1=squel['insert']()[_0x397a('0x43')](_0x397a('0x35'))[_0x397a('0x44')]([_0x397a('0x21'),_0x397a('0x36'),'ContactId',_0x397a('0x26'),_0x3c9d1b,_0x397a('0x37'),_0x397a('0x38')],squel[_0x397a('0x39')]()[_0x397a('0x3a')](_0x397a('0x21'),_0x397a('0x21'))[_0x397a('0x3a')]('NOW()',_0x397a('0x36'))[_0x397a('0x3a')]('id',_0x397a('0x3c'))[_0x397a('0x3a')](LISTID[_0x397a('0x3d')](),_0x397a('0x26'))[_0x397a('0x3a')](_0x46b340['id']['toString'](),_0x3c9d1b)[_0x397a('0x3a')]('NOW()','createdAt')[_0x397a('0x3a')](_0x397a('0x3b'),_0x397a('0x38'))[_0x397a('0x3e')](_0x397a('0x45'))[_0x397a('0x40')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID['toString']())['where'](_0x397a('0x46'),squel[_0x397a('0x47')](hopperContacts))[_0x397a('0x40')](_0x397a('0x48'))[_0x397a('0x40')](_0x397a('0x41'),squel['select']()[_0x397a('0x3a')](_0x397a('0x49'))[_0x397a('0x3e')](_0x397a('0x4a'))['where'](_0x3c9d1b+'\x20=\x20?',_0x46b340['id'][_0x397a('0x3d')]()))[_0x397a('0x40')](_0x397a('0x41'),squel['select']()['field'](_0x397a('0x21'))[_0x397a('0x3e')](_0x397a('0x35'))[_0x397a('0x40')](_0x3c9d1b+_0x397a('0x42'),_0x46b340['id'][_0x397a('0x3d')]())))[_0x397a('0x3d')]();return _0x1e66a1;};function _0x40f31e(_0x4afc4c,_0x24ef67){var _0x3928fe=squel['insert']()[_0x397a('0x43')]('cm_hopper')['fromQuery']([_0x397a('0x21'),'scheduledAt',_0x397a('0x3c'),_0x397a('0x26'),_0x24ef67,_0x397a('0x37'),'updatedAt'],squel['select']()[_0x397a('0x3a')]('phone',_0x397a('0x21'))['field']('NOW()','scheduledAt')[_0x397a('0x3a')]('id',_0x397a('0x3c'))[_0x397a('0x3a')](LISTID[_0x397a('0x3d')](),_0x397a('0x26'))[_0x397a('0x3a')](_0x4afc4c['id'][_0x397a('0x3d')](),_0x24ef67)['field'](_0x397a('0x3b'),_0x397a('0x37'))[_0x397a('0x3a')]('NOW()',_0x397a('0x38'))[_0x397a('0x3e')](_0x397a('0x45'))[_0x397a('0x40')](_0x397a('0x3f'))['where'](_0x397a('0x4b'),LISTID[_0x397a('0x3d')]())[_0x397a('0x40')](_0x397a('0x46'),squel[_0x397a('0x47')](hopperContacts))[_0x397a('0x40')](_0x397a('0x48')))[_0x397a('0x3d')]();return _0x3928fe;}function _0x417736(_0x46570c,_0x4c4e05){var _0x2b68ea=squel['insert']()[_0x397a('0x43')](_0x397a('0x4c'))[_0x397a('0x44')](['phone',_0x397a('0x3c'),'ListId',_0x4c4e05,_0x397a('0x37'),_0x397a('0x38')],squel[_0x397a('0x39')]()['field'](_0x397a('0x21'),_0x397a('0x21'))[_0x397a('0x3a')]('id',_0x397a('0x3c'))[_0x397a('0x3a')](LISTID[_0x397a('0x3d')](),'ListId')['field'](_0x46570c['id']['toString'](),_0x4c4e05)[_0x397a('0x3a')](_0x397a('0x3b'),_0x397a('0x37'))[_0x397a('0x3a')]('NOW()',_0x397a('0x38'))[_0x397a('0x3e')](_0x397a('0x45'))[_0x397a('0x40')](_0x397a('0x3f'))[_0x397a('0x40')](_0x397a('0x4b'),LISTID[_0x397a('0x3d')]())[_0x397a('0x40')]('id\x20IN\x20?',squel[_0x397a('0x47')](hopperContacts))[_0x397a('0x40')](_0x397a('0x48')))[_0x397a('0x3d')]();return _0x2b68ea;}return db['VoiceQueue'][_0x397a('0x4d')]({'where':{'type':'outbound'},'attributes':['id',_0x397a('0x4e')],'include':[{'model':db[_0x397a('0x4f')],'as':_0x397a('0x50'),'where':{'id':LISTID}}]})[_0x397a('0x51')](function(_0x3c8026){var _0x4516ae=[];if(_0x3c8026){var _0x5b57c4;for(var _0x2a0d15=0x0,_0x5ac564;_0x2a0d15<_0x3c8026['length'];_0x2a0d15+=0x1){_0x5ac564=_0x3c8026[_0x2a0d15][_0x397a('0x52')]({'plain':!![]});switch(_0x5ac564['dialCheckDuplicateType']){case _0x397a('0x53'):_0x4516ae[_0x397a('0x54')](db[_0x397a('0x55')][_0x397a('0x56')](_0xa63d73(_0x5ac564,'VoiceQueueId'))[_0x397a('0x51')](function(){})[_0x397a('0x2e')](_0x3fd961()));break;case _0x397a('0x57'):_0x4516ae[_0x397a('0x54')](db[_0x397a('0x55')][_0x397a('0x56')](_0x30d26f(_0x5ac564,_0x397a('0x58')))[_0x397a('0x51')](function(){})[_0x397a('0x2e')](_0x3fd961()));break;default:_0x4516ae['push'](db[_0x397a('0x55')][_0x397a('0x56')](_0x40f31e(_0x5ac564,_0x397a('0x58')))[_0x397a('0x51')](function(){})[_0x397a('0x2e')](_0x3fd961()));}}}return _0x4516ae;})['all']()[_0x397a('0x51')](function(){return db[_0x397a('0x59')][_0x397a('0x4d')]({'where':{'type':_0x397a('0x5a')},'attributes':['id'],'include':[{'model':db[_0x397a('0x4f')],'as':_0x397a('0x5b'),'where':{'id':LISTID}}]})[_0x397a('0x51')](function(_0x1c402e){var _0x1fe6ef=[];if(_0x1c402e){var _0x5ce316;for(var _0x260a72=0x0,_0x37aac2;_0x260a72<_0x1c402e[_0x397a('0x1a')];_0x260a72+=0x1){_0x37aac2=_0x1c402e[_0x260a72][_0x397a('0x52')]({'plain':!![]});_0x1fe6ef[_0x397a('0x54')](db[_0x397a('0x55')][_0x397a('0x56')](_0x417736(_0x37aac2,_0x397a('0x58')))['then'](function(){})['catch'](_0x3fd961()));}}return _0x1fe6ef;})['all']();})[_0x397a('0x51')](function(){return db[_0x397a('0x5c')][_0x397a('0x4d')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x397a('0x4f')],'as':_0x397a('0x50'),'where':{'id':LISTID}}]})[_0x397a('0x51')](function(_0x46d6dd){var _0x1cd78d=[];if(_0x46d6dd){for(var _0x4c1ec2=0x0,_0x3cc653;_0x4c1ec2<_0x46d6dd[_0x397a('0x1a')];_0x4c1ec2+=0x1){_0x3cc653=_0x46d6dd[_0x4c1ec2][_0x397a('0x52')]({'plain':!![]});switch(_0x3cc653[_0x397a('0x4e')]){case _0x397a('0x53'):_0x1cd78d[_0x397a('0x54')](db[_0x397a('0x55')][_0x397a('0x56')](_0xa63d73(_0x3cc653,_0x397a('0x5d')))[_0x397a('0x51')](function(){})[_0x397a('0x2e')](_0x3fd961()));break;case _0x397a('0x57'):_0x1cd78d[_0x397a('0x54')](db['sequelize'][_0x397a('0x56')](_0x30d26f(_0x3cc653,'CampaignId'))[_0x397a('0x51')](function(){})[_0x397a('0x2e')](_0x3fd961()));break;default:_0x1cd78d[_0x397a('0x54')](db[_0x397a('0x55')][_0x397a('0x56')](_0x40f31e(_0x3cc653,_0x397a('0x5d')))[_0x397a('0x51')](function(){})[_0x397a('0x2e')](_0x3fd961()));}}}return _0x1cd78d;})['all']();})['then'](function(){return db[_0x397a('0x5c')][_0x397a('0x4d')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x397a('0x5b'),'where':{'id':LISTID}}]})[_0x397a('0x51')](function(_0x4db467){var _0x5b4f80=[];if(_0x4db467){for(var _0x226224=0x0,_0x667e6f;_0x226224<_0x4db467[_0x397a('0x1a')];_0x226224+=0x1){_0x667e6f=_0x4db467[_0x226224][_0x397a('0x52')]({'plain':!![]});_0x5b4f80[_0x397a('0x54')](db[_0x397a('0x55')][_0x397a('0x56')](_0x417736(_0x667e6f,_0x397a('0x5d')))[_0x397a('0x51')](function(){})[_0x397a('0x2e')](_0x3fd961()));}}return _0x5b4f80;})[_0x397a('0x5e')]();})[_0x397a('0x2e')](function(_0x1e29ff){logger[_0x397a('0x15')]('cmContact,\x20%s,\x20%s',_0x397a('0x5f'),_0x1e29ff[_0x397a('0x1c')]);});}var processPromises=function(_0x41f2b8){return BPromise[_0x397a('0x5e')](promises)['then'](function(_0x8794e8){})[_0x397a('0x2e')](function(_0x17fdd0){logger['error'](_0x397a('0x60'),JSON[_0x397a('0x30')](_0x17fdd0));})['finally'](function(){socket[_0x397a('0x61')](_0x397a('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x41f2b8){return _0x41f2b8[_0x397a('0x63')]();}});};var endCsv=function(){return BPromise[_0x397a('0x64')]()[_0x397a('0x51')](function(){if(hopperContacts){return checkHopper();}})[_0x397a('0x51')](function(){socket[_0x397a('0x61')](_0x397a('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x397a('0x65')](FILEPATH);}catch(_0x54d996){logger['error']('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x397a('0x30')](_0x54d996));}finally{process[_0x397a('0x66')](0x0);}});};process['on'](_0x397a('0x67'),function(){logger[_0x397a('0x68')](_0x397a('0x69'));endCsv();});function main(){return BPromise[_0x397a('0x64')]()[_0x397a('0x51')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x397a('0x6a')](',');return db['CmContact'][_0x397a('0x4d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x397a('0x51')](function(_0x1c49db){var _0x979465=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x979465,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3c6761,_0x15abb2){total+=0x1;var _0x2b18a3=total;promises[_0x397a('0x54')](checkRow(_0x3c6761,_0x1c49db,_0x2b18a3)[_0x397a('0x51')](function(){success+=0x1;})[_0x397a('0x2e')](function(_0x7f67ae){if(_0x7f67ae[_0x397a('0x15')]){errors+=0x1;delete _0x7f67ae[_0x397a('0x15')];}else if(_0x7f67ae['duplicate']){duplicates+=0x1;delete _0x7f67ae['duplicate'];}rows[_0x397a('0x54')](_0x7f67ae);}));if(total%0xc8===0x0){_0x15abb2[_0x397a('0x6b')]();return processPromises(_0x15abb2);}},'complete':function(){return processPromises()[_0x397a('0x51')](function(){logger[_0x397a('0x68')](_0x397a('0x6c'));endCsv();});},'error':function(_0x36463a,_0x214fc1){logger[_0x397a('0x68')](_0x397a('0x6d'),JSON['stringify'](_0x36463a));endCsv();}});})['catch'](function(_0x2005e8){logger[_0x397a('0x15')](_0x397a('0x6e'),JSON[_0x397a('0x30')](_0x2005e8));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 6da1447..9e0b53a 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 _0x85a7=['where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','length','push','all','split','filter','CmContactHasItem','findOne','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','UserId','select','fields','from','cm_contacts','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_hopper_black','updatedAt','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.id','scheduledat','toString','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','error','message','errors','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','utcOffset','set','offset','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','header','ContactItemType','name','keys','writeFileSync','parse','createReadStream','rows','data','find','_description','isNil','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','email','email\x20wrong\x20format','dateOfBirth','timezones','firstName','\x20not\x20specified','itemTypeId','description','SystemRow','appendFileSync','emit','Abort\x20parser','SystemError','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','campaigns_has_cm_lists','affectedRows','contact:import:','unlink','exit','complete','argv','arguments\x20\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_0x67a5e4['name']===_0x2d7826);let _0x2b578f=contactItemTypes[_0xc5eb('0x7e')](_0x527923=>_0x527923[_0xc5eb('0x79')]+'_description'===_0x2d7826);if(_[_0xc5eb('0x7f')](_0x301a45)&&_['isNil'](_0x2b578f)){if(_0x1c9ff0[_0xc5eb('0x80')](_0x2d7826)){if(_0x3b0b44[_0xc5eb('0x7d')][_0x51c068][_0x1c9ff0[_0x2d7826]]){var _0x410681=_[_0xc5eb('0x81')](_0x3b0b44[_0xc5eb('0x7d')][_0x51c068][_0x1c9ff0[_0x2d7826]]['replace'](/"/g,'\x27'));switch(_0x2d7826){case'scheduledat':var _0xfd6d54=moment(_0x410681,_0xc5eb('0xe'),!![]);if(_0xfd6d54[_0xc5eb('0x82')]()){_0x352458[_0xc5eb('0x1c')]('\x22'+_0x410681+'\x22');}else{_0x2d9c38['push'](_0xc5eb('0x83'));}break;case _0xc5eb('0x84'):var _0x3f5379=parseInt(_0x410681);_0x410681=_['isNaN'](_0x3f5379)||_0x3f5379<0x0||_0x3f5379>0x4?_0x245ddb?0x3:0x2:_0x3f5379;_0x352458[_0xc5eb('0x1c')]('\x22'+_0x410681+'\x22');break;case _0xc5eb('0x32'):var _0x41faaa=parseInt(_0x410681);if(_[_0xc5eb('0x85')](_0x41faaa)&&_[_0xc5eb('0x76')](_0x49bb63,_0x41faaa)){_0x352458['push']('\x22'+_0x41faaa+'\x22');}else{_0x2d9c38[_0xc5eb('0x1c')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x410681)){_0x352458[_0xc5eb('0x1c')]('\x22'+_0x410681+'\x22');}else{_0x2d9c38[_0xc5eb('0x1c')](_0xc5eb('0x86'));}break;case _0xc5eb('0x87'):var _0x3e4666=moment(_0x410681,'YYYY-MM-DD',!![]);if(_0x3e4666[_0xc5eb('0x82')]()){_0x352458[_0xc5eb('0x1c')]('\x22'+_0x410681+'\x22');}else{_0x2d9c38[_0xc5eb('0x1c')](_0xc5eb('0x88'));}break;case _0xc5eb('0x69'):var _0x1adc6a=shared['timezones'];var _0x354f39=_0x1adc6a[_0x410681];if(!_[_0xc5eb('0x7f')](_0x354f39)){var _0x57f7d5=_0x354f39['utcOffset'];_0x352458[_0xc5eb('0x1c')]('\x22'+_0x410681+'\x22');_0x352458['push']('\x22'+_0x57f7d5+'\x22');}break;default:_0x352458[_0xc5eb('0x1c')]('\x22'+_0x410681+'\x22');}}else{switch(_0x2d7826){case _0xc5eb('0x89'):case _0xc5eb('0x12'):_0x2d9c38[_0xc5eb('0x1c')](_0x2d7826+'\x20not\x20specified');break;default:_0x352458['push']('\x22\x22');}}}}else{var _0x39cc92='';if(!_[_0xc5eb('0x7f')](_0x301a45)){if(!_0x1bd26a['hasOwnProperty'](_0x301a45['id'])){if(!_[_0xc5eb('0x7f')](_0x3b0b44['data'][_0x51c068][_0x1c9ff0[_0x2d7826]])){var _0x410681=_[_0xc5eb('0x81')](_0x3b0b44[_0xc5eb('0x7d')][_0x51c068][_0x1c9ff0[_0x2d7826]][_0xc5eb('0x8a')](/"/g,'\x27'));var _0x564627=phoneDescriptions[_0xc5eb('0x7e')](_0x97cdcc=>_0x97cdcc[_0xc5eb('0x8b')]===_0x301a45['id']);if(!_[_0xc5eb('0x7f')](_0x564627)){var _0x1e4c6a=_[_0xc5eb('0x81')](_0x3b0b44[_0xc5eb('0x7d')][_0x51c068][_0x1c9ff0[_0x564627[_0xc5eb('0x8c')]]][_0xc5eb('0x8a')](/"/g,'\x27'));if(!_[_0xc5eb('0x7f')](_0x1e4c6a))_0x410681=_0x410681+'§'+_0x1e4c6a;}if(_0x39cc92=='')_0x39cc92=_0x410681;else _0x39cc92+='|'+_0x410681;}_0x37b1e6[_0xc5eb('0x1c')](_0x301a45['id']+':'+_0x39cc92);_0x1bd26a[_0x301a45['id']]=0x1;}}}}if(hasAdditionalPhones){_0x352458[_0xc5eb('0x1c')]('\x22'+_0x37b1e6[_0xc5eb('0x14')](';')+'\x22');}if(_0x2d9c38[_0xc5eb('0x1b')]){handleError(_0x3b0b44[_0xc5eb('0x7d')][_0x51c068],{'code':_0xc5eb('0x8d'),'message':_0x2d9c38[_0xc5eb('0x14')]()});}else{fs['appendFileSync'](_0x548bdd,_0x352458[_0xc5eb('0x14')]()+'\x0a');}_0x352458=[];}if(!(stats[_0xc5eb('0x8e')]%0xc8)){socket[_0xc5eb('0x8f')](_0xc5eb('0x90')+_0x21b0d7,stats);stats[_0xc5eb('0x56')]=[];}}if(stopped){logger[_0xc5eb('0x51')](_0xc5eb('0x91'));_0x6bebd3[_0xc5eb('0x92')]();}}catch(_0xe9255f){handleError(_0x3b0b44[_0xc5eb('0x7d')][_0x51c068],{'code':'SystemError','message':_0xe9255f['message']});logger[_0xc5eb('0x53')](_0xc5eb('0x93'),_0xe9255f[_0xc5eb('0x54')]);}},'complete':function(){try{var _0x372780=[];var _0x29183b=[];var _0x264f7b=_0xc5eb('0x35');if(_0x18b780[_0xc5eb('0x94')]&&_0x18b780[_0xc5eb('0x94')][_0xc5eb('0x1b')]){_0x264f7b=_0xc5eb('0x95')+_0x21b0d7;_0x372780['push']('CREATE\x20TABLE\x20'+_0x264f7b+_0xc5eb('0x96'));}tmp_campaigns=_0xc5eb('0x97')+_0x21b0d7;tmp_voice_queues=_0xc5eb('0x98')+_0x21b0d7;_0x29183b[_0xc5eb('0x1c')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0xc5eb('0x99'));_0x29183b[_0xc5eb('0x1c')](_0xc5eb('0x9a')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0xc5eb('0x9b')](_0x29183b,handleTZQuery)[_0xc5eb('0x1a')](function(_0x2dcc74){updateTzCampaigns(_0x18b780[_0xc5eb('0x3d')])[_0xc5eb('0x1a')](function(_0x52ac09){updateTzVoiceQueues(_0x18b780[_0xc5eb('0x3d')])['then'](function(_0x3c96d9){if(hasTZ)_0x4ee7d9=_0x4ee7d9['replace']('dialTimezone',_0xc5eb('0x9c'));var _0x2d78d6=util[_0xc5eb('0xf')](_0xc5eb('0x9d'),_0x548bdd,_0x264f7b,_0x4ee7d9,_0x18b780[_0xc5eb('0x3d')],_0x18b780[_0xc5eb('0x4d')]||null,NOW,NOW);if(_[_0xc5eb('0x7f')](_0x1c9ff0[_0xc5eb('0x30')])){_0x2d78d6+=',\x20scheduledAt\x20=\x20NOW()';}_0x372780[_0xc5eb('0x1c')](_0x2d78d6);if(_0x18b780[_0xc5eb('0x94')]&&_0x18b780['duplicates'][_0xc5eb('0x1b')]){_0x372780['push'](insertCmContact(_0x18b780['ListId'],_0x264f7b,_0x18b780['duplicates'],_0x1c9ff0));_0x372780[_0xc5eb('0x1c')](_0xc5eb('0x9e')+_0x264f7b+';');}BPromise[_0xc5eb('0x9b')](_0x372780,handleQuery)['then'](function(_0x109378){BPromise['all']([handleAdditionalPhones()])[_0xc5eb('0x1a')](function(){_0x372780=[];for(var _0x35b63a=0x0;_0x35b63a\x20\x20');}var _0x1b668d=path[_0xc5eb('0x14')](config[_0xc5eb('0x73')],_0xc5eb('0x74'),process[_0xc5eb('0xaa')][0x2]);if(!fs[_0xc5eb('0xab')](_0x1b668d)){throw new Error(_0xc5eb('0xac'));}var _0x35e960={};try{_0x35e960=JSON['parse'](process[_0xc5eb('0xaa')][0x3]);if(!_0x35e960['binding']){throw new Error(_0xc5eb('0xad'));}if(!_0x35e960[_0xc5eb('0x70')][_0xc5eb('0x12')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x35e960['binding'][_0xc5eb('0x89')]){throw new Error(_0xc5eb('0xae'));}var _0x48303e=0x0;if(_0x35e960[_0xc5eb('0x70')][_0xc5eb('0x32')]){_0x48303e=0x1;}if(!_0x35e960[_0xc5eb('0x3d')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x4f2419){throw new Error('body\x20id\x20mandatory');}var _0x4a7a10=[];try{_0x4a7a10=_[_0xc5eb('0xaf')](JSON[_0xc5eb('0x7c')](process[_0xc5eb('0xaa')][0x4]),'id');}catch(_0xd49c3b){logger[_0xc5eb('0x51')](_0xc5eb('0xb0'));}main(_0x1b668d,_0x35e960,_0x4a7a10,_0x48303e);}validate();process['on'](_0xc5eb('0xb1'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index f5ff62a..5fb2a78 100644 --- a/server/components/import/cm/csvUpdates.js +++ b/server/components/import/cm/csvUpdates.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf7=['file\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','localhost','socket.io-emitter','format','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','then','catch','error','split','filter','CmContactHasItem','findOne','update','updated','PHONE','inserted','CmContact','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','cm_hopper','scheduledat','ContactId','ListId','updatedAt','priority','UserId','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','fromQuery','createdAt','.CmListId\x20=\x20?','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','into','cm_hopper_additional_phones','CmHopperId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','fields','MIN(id)','min_id','group','info','message','code','main','stringify','start','binding','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','_description','parse','createReadStream','data','rows','errors','find','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','hasOwnProperty','description','SystemRow','appendFileSync','emit','abort','SystemError','step','CREATE\x20TABLE\x20','CIS\x20len',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactId','contactTypeId','orderBy','contact:import:','unlink','exit','complete','argv','arguments\x20\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_0x4dd5c5[_0x778e('0x6a')]===_0x37bb14);let _0x4db150=contactItemTypes['find'](_0x107ce7=>_0x107ce7['name']+_0x778e('0x6b')===_0x37bb14);if(_[_0x778e('0x19')](_0x3708cb)&&_[_0x778e('0x19')](_0x4db150)){if(_0x8fb312[_0x778e('0x72')](_0x37bb14)){if(_0x35541e[_0x778e('0x70')][_0x49a7ab][_0x8fb312[_0x37bb14]]){var _0x185387=_[_0x778e('0x73')](_0x35541e['data'][_0x49a7ab][_0x8fb312[_0x37bb14]][_0x778e('0x74')](/"/g,'\x27'));switch(_0x37bb14){case _0x778e('0x2f'):var _0x16beaa=moment(_0x185387,_0x778e('0xc'),!![]);if(_0x16beaa[_0x778e('0x75')]()){_0xd841b6[_0x778e('0x1b')]('\x22'+_0x185387+'\x22');}else{_0x28c352[_0x778e('0x1b')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x5ec3dc=parseInt(_0x185387);_0x185387=_['isNaN'](_0x5ec3dc)||_0x5ec3dc<0x0||_0x5ec3dc>0x4?_0x3b8699?0x3:0x2:_0x5ec3dc;_0xd841b6[_0x778e('0x1b')]('\x22'+_0x185387+'\x22');break;case'UserId':var _0x4380f0=parseInt(_0x185387);if(_[_0x778e('0x76')](_0x4380f0)&&_['includes'](_0x54bd39,_0x4380f0)){_0xd841b6[_0x778e('0x1b')]('\x22'+_0x4380f0+'\x22');}else{_0x28c352[_0x778e('0x1b')](_0x778e('0x77'));}break;case _0x778e('0x78'):if(isEmail(_0x185387)){_0xd841b6[_0x778e('0x1b')]('\x22'+_0x185387+'\x22');}else{_0x28c352[_0x778e('0x1b')](_0x778e('0x79'));}break;case _0x778e('0x7a'):var _0x5940d8=moment(_0x185387,_0x778e('0x7b'),!![]);if(_0x5940d8[_0x778e('0x75')]()){_0xd841b6[_0x778e('0x1b')]('\x22'+_0x185387+'\x22');}else{_0x28c352[_0x778e('0x1b')](_0x778e('0x7c'));}break;default:_0xd841b6[_0x778e('0x1b')]('\x22'+_0x185387+'\x22');}}else{switch(_0x37bb14){case _0x778e('0x7d'):case'phone':_0x28c352[_0x778e('0x1b')](_0x37bb14+_0x778e('0x7e'));break;default:_0xd841b6[_0x778e('0x1b')]('\x22\x22');}}}}else{var _0xbb8204='';if(!_['isNil'](_0x3708cb)){if(!_0x4d9850[_0x778e('0x72')](_0x3708cb['id'])){for(var _0x28249a=0x0;_0x28249a<_0x8fb312[_0x37bb14][_0x778e('0x18')];_0x28249a++){var _0x185387=_[_0x778e('0x73')](_0x35541e[_0x778e('0x70')][_0x49a7ab][_0x8fb312[_0x37bb14][_0x28249a]][_0x778e('0x74')](/"/g,'\x27'));var _0x29cb7f=phoneDescriptions[_0x778e('0x71')](_0x4a6798=>_0x4a6798[_0x778e('0x7f')]===_0x3708cb['id']);if(!_[_0x778e('0x19')](_0x29cb7f)){var _0x5ee6e7=_['trim'](_0x35541e[_0x778e('0x70')][_0x49a7ab][_0x8fb312[_0x29cb7f[_0x778e('0x80')]][0x0]][_0x778e('0x74')](/"/g,'\x27'));if(!_[_0x778e('0x19')](_0x5ee6e7))_0x185387=_0x185387+'§'+_0x5ee6e7;}if(_0xbb8204=='')_0xbb8204=_0x185387;else _0xbb8204+='|'+_0x185387;}_0x23c383['push'](_0x3708cb['id']+':'+_0xbb8204);_0x4d9850[_0x3708cb['id']]=0x1;}}}}if(hasAdditionalPhones){_0xd841b6[_0x778e('0x1b')]('\x22'+_0x23c383[_0x778e('0x12')](';')+'\x22');}if(_0x28c352['length']){handleError(_0x35541e['data'][_0x49a7ab],{'code':_0x778e('0x81'),'message':_0x28c352[_0x778e('0x12')]()});}else{fs[_0x778e('0x82')](_0x10b556,_0xd841b6['join']()+'\x0a');}_0xd841b6=[];}if(!(stats[_0x778e('0x83')]%0xc8)){socket[_0x778e('0x84')](_0x778e('0x85')+_0x30b7f8,stats);stats['errors']=[];}}if(stopped){logger[_0x778e('0x5a')](_0x778e('0x86'));_0x323f5e[_0x778e('0x87')]();}}catch(_0x482b9e){handleError(_0x35541e[_0x778e('0x70')][_0x49a7ab],{'code':_0x778e('0x88'),'message':_0x482b9e[_0x778e('0x5f')]});logger[_0x778e('0x1d')](_0x778e('0x89'),_0x482b9e[_0x778e('0x5f')]);}},'complete':function(){try{var _0x3179d2=[];var _0x3953e8=tempTableName;_0x3179d2[_0x778e('0x1b')]('CREATE\x20TABLE\x20'+_0x3953e8+'\x20LIKE\x20cm_contacts;');logger[_0x778e('0x5a')](_0x778e('0x8a'),contactItemTypes[_0x778e('0x18')]);var _0x37dbff=util[_0x778e('0xe')](_0x778e('0x8b'),_0x10b556,_0x3953e8,_0x579cb0,_0x57fe7b[_0x778e('0x31')],_0x57fe7b[_0x778e('0x54')]||null,NOW,NOW);if(_['isNil'](_0x8fb312[_0x778e('0x2f')])){_0x37dbff+=_0x778e('0x8c');}_0x3179d2['push'](_0x37dbff);BPromise[_0x778e('0x8d')](_0x3179d2,handleQuery)[_0x778e('0x1c')](function(_0x39ec90){BPromise[_0x778e('0x8e')]([handleAdditionalPhones()])['then'](function(){_0x3179d2=[];for(var _0x212b9b=0x0;_0x212b9b\x20\x20');}var _0x185c13=path[_0x778e('0x12')](config[_0x778e('0x66')],_0x778e('0x67'),process[_0x778e('0x97')][0x2]);if(!fs['existsSync'](_0x185c13)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x3320f0={};try{_0x3320f0=JSON['parse'](process[_0x778e('0x97')][0x3]);if(!_0x3320f0[_0x778e('0x64')]){throw new Error(_0x778e('0x98'));}var _0xc096a4=0x0;if(_0x3320f0['binding'][_0x778e('0x34')]){_0xc096a4=0x1;}if(!_0x3320f0[_0x778e('0x31')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x277bef){throw new Error(_0x778e('0x99'));}var _0x1a8d36=[];try{_0x1a8d36=_[_0x778e('0x9a')](JSON['parse'](process[_0x778e('0x97')][0x4]),'id');}catch(_0x3f6b8e){logger[_0x778e('0x5a')](_0x778e('0x9b'));}main(_0x185c13,_0x3320f0,_0x1a8d36,_0xc096a4);}validate();process['on']('SIGINT',handleStop);process['on'](_0x778e('0x9c'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 8fcd1b9..718e33e 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5ce=['Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Complete','Hold\x20Time','talktime','Called\x20Number','membername','UniqueId','starttime','Answer\x20Time','endtime','duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','voice','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','toLowerCase','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','Call\x20To','destexten','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0xa5ce,0x170));var _0xea5c=function(_0xcef3ff,_0x483063){_0xcef3ff=_0xcef3ff-0x0;var _0x595467=_0xa5ce[_0xcef3ff];return _0x595467;};'use strict';exports['getSubjects']=function(_0x26c0d0,_0x492309){var _0x2f0342=[{'type':_0xea5c('0x0'),'content':_0xea5c('0x1'),'variableName':null}];switch(_0x26c0d0['toLowerCase']()){case _0xea5c('0x2'):switch(_0x492309['toLowerCase']()){case _0xea5c('0x3'):_0x2f0342[_0xea5c('0x4')]({'type':_0xea5c('0x5'),'content':'','variableName':_0xea5c('0x6')});_0x2f0342[_0xea5c('0x4')]({'type':_0xea5c('0x5'),'content':'','variableName':_0xea5c('0x7')});break;case _0xea5c('0x8'):_0x2f0342['push']({'type':_0xea5c('0x0'),'content':_0xea5c('0x9'),'variableName':null});_0x2f0342[_0xea5c('0x4')]({'type':_0xea5c('0x5'),'content':'','variableName':_0xea5c('0xa')});break;}}return _0x2f0342;};exports[_0xea5c('0xb')]=function(_0x2d1ba5,_0x55b694){var _0x26f532=[];switch(_0x2d1ba5[_0xea5c('0xc')]()){case _0xea5c('0x2'):switch(_0x55b694[_0xea5c('0xc')]()){case _0xea5c('0x3'):_0x26f532=[{'type':_0xea5c('0x0'),'content':_0xea5c('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0xea5c('0xe'),'content':'','key':_0xea5c('0xf'),'keyType':'variable','variableName':_0xea5c('0x7')},{'type':_0xea5c('0xe'),'content':'','key':'Caller\x20Name','keyType':_0xea5c('0x5'),'variableName':_0xea5c('0x10')},{'type':_0xea5c('0xe'),'content':'','key':_0xea5c('0x11'),'keyType':_0xea5c('0x5'),'variableName':_0xea5c('0x12')},{'type':'keyValue','content':'','key':'Queue','keyType':_0xea5c('0x5'),'variableName':_0xea5c('0x6')},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0xea5c('0x5'),'variableName':_0xea5c('0x13')},{'type':_0xea5c('0xe'),'content':'','key':'Date','keyType':'variable','variableName':_0xea5c('0x14')},{'type':_0xea5c('0x0'),'content':_0xea5c('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0xea5c('0xe'),'content':'','key':_0xea5c('0x16'),'keyType':'variable','variableName':_0xea5c('0x17')},{'type':'keyValue','content':'','key':_0xea5c('0x18'),'keyType':_0xea5c('0x5'),'variableName':_0xea5c('0xa')},{'type':'string','content':_0xea5c('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xea5c('0xe'),'content':'','key':_0xea5c('0x1a'),'keyType':_0xea5c('0x5'),'variableName':_0xea5c('0x14')},{'type':_0xea5c('0xe'),'content':'','key':'Agent\x20Connect','keyType':_0xea5c('0x5'),'variableName':'agentconnectAt'},{'type':_0xea5c('0xe'),'content':'','key':_0xea5c('0x1b'),'keyType':_0xea5c('0x5'),'variableName':'agentcompleteAt'},{'type':_0xea5c('0xe'),'content':'','key':_0xea5c('0x1c'),'keyType':'variable','variableName':'holdtime'},{'type':_0xea5c('0xe'),'content':'','key':'Talk\x20Time','keyType':_0xea5c('0x5'),'variableName':_0xea5c('0x1d')}];break;case'outbound':_0x26f532=[{'type':'string','content':_0xea5c('0xd'),'variableName':null},{'type':_0xea5c('0xe'),'content':'','key':_0xea5c('0x1e'),'keyType':_0xea5c('0x5'),'keyContent':'','variableName':_0xea5c('0xa')},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':_0xea5c('0x5'),'keyContent':'','variableName':_0xea5c('0x1f')},{'type':'keyValue','content':'','key':_0xea5c('0x20'),'keyType':'variable','keyContent':'','variableName':_0xea5c('0x13')},{'type':'keyValue','content':'','key':'Date','keyType':'variable','keyContent':'','variableName':_0xea5c('0x21')},{'type':_0xea5c('0x0'),'content':_0xea5c('0x19')},{'type':'keyValue','content':'','key':_0xea5c('0x22'),'keyType':_0xea5c('0x5'),'keyContent':'','variableName':'answertime'},{'type':_0xea5c('0xe'),'content':'','key':'Complete\x20Time','keyType':'variable','keyContent':'','variableName':_0xea5c('0x23')},{'type':_0xea5c('0xe'),'content':'','key':'Duration','keyType':_0xea5c('0x5'),'keyContent':'','variableName':_0xea5c('0x24')},{'type':_0xea5c('0xe'),'content':'','key':_0xea5c('0x25'),'keyType':_0xea5c('0x5'),'keyContent':'','variableName':_0xea5c('0x26')}];break;}}return _0x26f532;}; \ No newline at end of file +var _0xf640=['agentcompleteAt','Hold\x20Time','talktime','Called\x20Number','membername','Answer\x20Time','Complete\x20Time','endtime','Duration','duration','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','queue','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','Caller\x20Number','keyValue','Caller\x20Name','variable','calleridname','Call\x20To','destexten','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','Agent\x20Complete'];(function(_0x2cee34,_0x7e21a9){var _0x5a369e=function(_0x5114d1){while(--_0x5114d1){_0x2cee34['push'](_0x2cee34['shift']());}};_0x5a369e(++_0x7e21a9);}(_0xf640,0x1ea));var _0x0f64=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf640[_0x321bb2];return _0x9c12ed;};'use strict';exports[_0x0f64('0x0')]=function(_0x51f543,_0x3ec4aa){var _0x5e53fe=[{'type':'string','content':_0x0f64('0x1'),'variableName':null}];switch(_0x51f543[_0x0f64('0x2')]()){case _0x0f64('0x3'):switch(_0x3ec4aa[_0x0f64('0x2')]()){case _0x0f64('0x4'):_0x5e53fe[_0x0f64('0x5')]({'type':'variable','content':'','variableName':_0x0f64('0x6')});_0x5e53fe[_0x0f64('0x5')]({'type':'variable','content':'','variableName':_0x0f64('0x7')});break;case _0x0f64('0x8'):_0x5e53fe[_0x0f64('0x5')]({'type':_0x0f64('0x9'),'content':_0x0f64('0xa'),'variableName':null});_0x5e53fe[_0x0f64('0x5')]({'type':'variable','content':'','variableName':_0x0f64('0xb')});break;}}return _0x5e53fe;};exports[_0x0f64('0xc')]=function(_0x234661,_0x37b17f){var _0x535040=[];switch(_0x234661[_0x0f64('0x2')]()){case _0x0f64('0x3'):switch(_0x37b17f[_0x0f64('0x2')]()){case _0x0f64('0x4'):_0x535040=[{'type':_0x0f64('0x9'),'content':_0x0f64('0xd'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x0f64('0xe'),'keyType':'variable','variableName':_0x0f64('0x7')},{'type':_0x0f64('0xf'),'content':'','key':_0x0f64('0x10'),'keyType':_0x0f64('0x11'),'variableName':_0x0f64('0x12')},{'type':_0x0f64('0xf'),'content':'','key':_0x0f64('0x13'),'keyType':'variable','variableName':_0x0f64('0x14')},{'type':_0x0f64('0xf'),'content':'','key':'Queue','keyType':_0x0f64('0x11'),'variableName':_0x0f64('0x6')},{'type':_0x0f64('0xf'),'content':'','key':_0x0f64('0x15'),'keyType':_0x0f64('0x11'),'variableName':_0x0f64('0x16')},{'type':_0x0f64('0xf'),'content':'','key':_0x0f64('0x17'),'keyType':_0x0f64('0x11'),'variableName':_0x0f64('0x18')},{'type':_0x0f64('0x9'),'content':_0x0f64('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0x0f64('0xf'),'content':'','key':'Agent\x20Name','keyType':_0x0f64('0x11'),'variableName':'destcalleridname'},{'type':'keyValue','content':'','key':_0x0f64('0x1a'),'keyType':_0x0f64('0x11'),'variableName':_0x0f64('0xb')},{'type':_0x0f64('0x9'),'content':_0x0f64('0x1b'),'key':null,'keyType':null,'variableName':null},{'type':_0x0f64('0xf'),'content':'','key':'Agent\x20Ring','keyType':_0x0f64('0x11'),'variableName':'agentcalledAt'},{'type':'keyValue','content':'','key':_0x0f64('0x1c'),'keyType':_0x0f64('0x11'),'variableName':'agentconnectAt'},{'type':_0x0f64('0xf'),'content':'','key':_0x0f64('0x1d'),'keyType':_0x0f64('0x11'),'variableName':_0x0f64('0x1e')},{'type':_0x0f64('0xf'),'content':'','key':_0x0f64('0x1f'),'keyType':_0x0f64('0x11'),'variableName':'holdtime'},{'type':_0x0f64('0xf'),'content':'','key':'Talk\x20Time','keyType':_0x0f64('0x11'),'variableName':_0x0f64('0x20')}];break;case _0x0f64('0x8'):_0x535040=[{'type':_0x0f64('0x9'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x0f64('0xf'),'content':'','key':_0x0f64('0x21'),'keyType':_0x0f64('0x11'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x0f64('0xf'),'content':'','key':'Member\x20Name','keyType':_0x0f64('0x11'),'keyContent':'','variableName':_0x0f64('0x22')},{'type':_0x0f64('0xf'),'content':'','key':_0x0f64('0x15'),'keyType':_0x0f64('0x11'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':'Date','keyType':_0x0f64('0x11'),'keyContent':'','variableName':'starttime'},{'type':_0x0f64('0x9'),'content':_0x0f64('0x1b')},{'type':_0x0f64('0xf'),'content':'','key':_0x0f64('0x23'),'keyType':'variable','keyContent':'','variableName':'answertime'},{'type':_0x0f64('0xf'),'content':'','key':_0x0f64('0x24'),'keyType':_0x0f64('0x11'),'keyContent':'','variableName':_0x0f64('0x25')},{'type':_0x0f64('0xf'),'content':'','key':_0x0f64('0x26'),'keyType':_0x0f64('0x11'),'keyContent':'','variableName':_0x0f64('0x27')},{'type':_0x0f64('0xf'),'content':'','key':'Billable\x20Time','keyType':_0x0f64('0x11'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x535040;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 48c35ed..c112fbd 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd95=['DESC','getFilteredInteractions','rows','catch','tracked','user','query','clone','omit','html','phone','mobile','updateUser','lodash','./sql-utils','./utils','resolve','getInteractionsQuery','then','search','parseAdvancedSearchFilter','parseQueryParameters','body','contact','fields','where','filter','having','read','tags','group','tag','countFilteredInteractions','count','length','clause','order','forEach','contactName','closed','getClosedOrderClause'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xcd95,0xda));var _0x5cd9=function(_0xfac6cd,_0x32fb94){_0xfac6cd=_0xfac6cd-0x0;var _0xeb2337=_0xcd95[_0xfac6cd];return _0xeb2337;};'use strict';var _=require(_0x5cd9('0x0'));var sqlUtils=require(_0x5cd9('0x1'));var utils=require(_0x5cd9('0x2'));exports['findAll']=function(_0x1645b0,_0x46a90a,_0x2d09c1,_0x1d1d4b,_0x52c83e){var _0x2425bb={'count':0x0,'rows':[]};var _0x23f70f=sqlUtils['skipInteractionsQuery'](_0x1645b0,_0x2d09c1,_0x46a90a);if(_0x23f70f){return Promise[_0x5cd9('0x3')](_0x2425bb);}var _0x5b5265=sqlUtils[_0x5cd9('0x4')](_0x1645b0);var _0x4cc23d={};return Promise['resolve']()[_0x5cd9('0x5')](function(){if(_0x46a90a[_0x5cd9('0x6')]){return sqlUtils[_0x5cd9('0x7')](_0x46a90a[_0x5cd9('0x6')],_0x52c83e);}else{return sqlUtils[_0x5cd9('0x8')](_0x1645b0,_0x46a90a,_0x52c83e);}})['then'](function(_0x5e0705){_0x5b5265['where'](_0x5e0705[_0x5cd9('0x9')]);_0x5b5265['where'](_0x5e0705[_0x5cd9('0xa')]);_0x5b5265['where'](_0x5e0705['default']);_0x5b5265['where'](_0x5e0705[_0x5cd9('0xb')]);_0x5b5265[_0x5cd9('0xc')](_0x5e0705[_0x5cd9('0xd')]);_0x5b5265[_0x5cd9('0xc')](_0x5e0705['user']);_0x5b5265[_0x5cd9('0xe')](_0x5e0705[_0x5cd9('0xf')]);_0x4cc23d=_0x5e0705[_0x5cd9('0x10')];return sqlUtils['checkAccountsRestrictions'](_0x1645b0,_0x2d09c1,_0x46a90a);})[_0x5cd9('0x5')](function(_0x3ba0ca){_0x5b5265[_0x5cd9('0xc')](_0x3ba0ca);_0x5b5265[_0x5cd9('0x11')]('i.id');var _0x1f2002=_0x46a90a[_0x5cd9('0x6')]?_0x4cc23d['ids']:_0x46a90a[_0x5cd9('0x12')];return sqlUtils[_0x5cd9('0x13')](_0x5b5265,_0x1f2002);})['then'](function(_0x5e2ce3){_0x2425bb[_0x5cd9('0x14')]=_0x5e2ce3[_0x5cd9('0x15')];if(_0x2425bb['count']===0x0){return[];}_0x5b5265[_0x5cd9('0xe')](_0x4cc23d[_0x5cd9('0x16')]);if(_0x1d1d4b[_0x5cd9('0x17')]){_0x1d1d4b['order'][_0x5cd9('0x18')](function(_0x1e5eae){var _0x42d4dd=_0x1e5eae[0x0]===_0x5cd9('0x19')?_0x1e5eae[0x0]:'i.'+_0x1e5eae[0x0];_0x5b5265[_0x5cd9('0x17')](_0x42d4dd,_0x1e5eae[0x1]==='DESC'?![]:!![]);if(_0x1e5eae[0x0]===_0x5cd9('0x1a')){var _0x37df76=sqlUtils[_0x5cd9('0x1b')](_0x1645b0,_0x46a90a);_0x5b5265[_0x5cd9('0x17')](_0x37df76,_0x1e5eae[0x1]===_0x5cd9('0x1c')?![]:!![]);}});}return sqlUtils[_0x5cd9('0x1d')](_0x1645b0,_0x5b5265,_0x46a90a,_0x1d1d4b);})[_0x5cd9('0x5')](function(_0x467c70){_0x2425bb[_0x5cd9('0x1e')]=_0x467c70;return _0x2425bb;})[_0x5cd9('0x1f')](function(_0x477020){throw _0x477020;});};exports[_0x5cd9('0x20')]=function(_0x4afdf4,_0x5ece91){return function(_0x5dcf30,_0x38b090,_0x18f82e){var _0x28f707=_0x5dcf30[_0x5cd9('0x21')];var _0x59ae47={};var _0xad0751=_0x5dcf30[_0x5cd9('0x22')];if(_0x59ae47){_0x59ae47=_[_0x5cd9('0x23')](_0x5dcf30[_0x5cd9('0x9')]);_0x59ae47=_[_0x5cd9('0x24')](_0x59ae47,['body',_0x5cd9('0x25'),_0x5cd9('0x26'),'fax',_0x5cd9('0x27')]);}utils[_0x5cd9('0x28')](_0x28f707,_0x59ae47,_0xad0751,_0x4afdf4,_0x5ece91);_0x18f82e(null);};}; \ No newline at end of file +var _0x570a=['resolve','getInteractionsQuery','then','parseAdvancedSearchFilter','search','parseQueryParameters','contact','where','default','fields','filter','read','group','ids','tag','countFilteredInteractions','count','length','clause','order','forEach','contactName','DESC','closed','getClosedOrderClause','tracked','user','query','clone','body','omit','html','fax','mobile','updateUser','lodash','./sql-utils','./utils','findAll','skipInteractionsQuery'];(function(_0x4e8db9,_0x15ff81){var _0x1fc3be=function(_0x1cc230){while(--_0x1cc230){_0x4e8db9['push'](_0x4e8db9['shift']());}};_0x1fc3be(++_0x15ff81);}(_0x570a,0x1db));var _0xa570=function(_0x3eaa2a,_0x53477a){_0x3eaa2a=_0x3eaa2a-0x0;var _0x1ade8b=_0x570a[_0x3eaa2a];return _0x1ade8b;};'use strict';var _=require(_0xa570('0x0'));var sqlUtils=require(_0xa570('0x1'));var utils=require(_0xa570('0x2'));exports[_0xa570('0x3')]=function(_0x2c0cf2,_0x43333b,_0x7de1e8,_0x134eb6,_0x2731d8){var _0x443cf3={'count':0x0,'rows':[]};var _0x4c44ee=sqlUtils[_0xa570('0x4')](_0x2c0cf2,_0x7de1e8,_0x43333b);if(_0x4c44ee){return Promise[_0xa570('0x5')](_0x443cf3);}var _0x9e7b71=sqlUtils[_0xa570('0x6')](_0x2c0cf2);var _0x2e528f={};return Promise[_0xa570('0x5')]()[_0xa570('0x7')](function(){if(_0x43333b['search']){return sqlUtils[_0xa570('0x8')](_0x43333b[_0xa570('0x9')],_0x2731d8);}else{return sqlUtils[_0xa570('0xa')](_0x2c0cf2,_0x43333b,_0x2731d8);}})['then'](function(_0x3c05d9){_0x9e7b71['where'](_0x3c05d9['body']);_0x9e7b71['where'](_0x3c05d9[_0xa570('0xb')]);_0x9e7b71[_0xa570('0xc')](_0x3c05d9[_0xa570('0xd')]);_0x9e7b71[_0xa570('0xc')](_0x3c05d9[_0xa570('0xe')]);_0x9e7b71['where'](_0x3c05d9[_0xa570('0xf')]);_0x9e7b71[_0xa570('0xc')](_0x3c05d9['user']);_0x9e7b71['having'](_0x3c05d9[_0xa570('0x10')]);_0x2e528f=_0x3c05d9['tags'];return sqlUtils['checkAccountsRestrictions'](_0x2c0cf2,_0x7de1e8,_0x43333b);})[_0xa570('0x7')](function(_0x282ebc){_0x9e7b71[_0xa570('0xc')](_0x282ebc);_0x9e7b71[_0xa570('0x11')]('i.id');var _0x7b0bc2=_0x43333b[_0xa570('0x9')]?_0x2e528f[_0xa570('0x12')]:_0x43333b[_0xa570('0x13')];return sqlUtils[_0xa570('0x14')](_0x9e7b71,_0x7b0bc2);})['then'](function(_0x2f7ec3){_0x443cf3[_0xa570('0x15')]=_0x2f7ec3[_0xa570('0x16')];if(_0x443cf3[_0xa570('0x15')]===0x0){return[];}_0x9e7b71['having'](_0x2e528f[_0xa570('0x17')]);if(_0x134eb6[_0xa570('0x18')]){_0x134eb6[_0xa570('0x18')][_0xa570('0x19')](function(_0x418878){var _0x3d937c=_0x418878[0x0]===_0xa570('0x1a')?_0x418878[0x0]:'i.'+_0x418878[0x0];_0x9e7b71[_0xa570('0x18')](_0x3d937c,_0x418878[0x1]===_0xa570('0x1b')?![]:!![]);if(_0x418878[0x0]===_0xa570('0x1c')){var _0x3ba103=sqlUtils[_0xa570('0x1d')](_0x2c0cf2,_0x43333b);_0x9e7b71[_0xa570('0x18')](_0x3ba103,_0x418878[0x1]===_0xa570('0x1b')?![]:!![]);}});}return sqlUtils['getFilteredInteractions'](_0x2c0cf2,_0x9e7b71,_0x43333b,_0x134eb6);})[_0xa570('0x7')](function(_0x3609d1){_0x443cf3['rows']=_0x3609d1;return _0x443cf3;})['catch'](function(_0x142dfd){throw _0x142dfd;});};exports[_0xa570('0x1e')]=function(_0x3d8a72,_0x320012){return function(_0x215084,_0x504f23,_0x1fa42c){var _0xaf779b=_0x215084[_0xa570('0x1f')];var _0x1b1b64={};var _0x384fd1=_0x215084[_0xa570('0x20')];if(_0x1b1b64){_0x1b1b64=_[_0xa570('0x21')](_0x215084[_0xa570('0x22')]);_0x1b1b64=_[_0xa570('0x23')](_0x1b1b64,[_0xa570('0x22'),_0xa570('0x24'),'phone',_0xa570('0x25'),_0xa570('0x26')]);}utils[_0xa570('0x27')](_0xaf779b,_0x1b1b64,_0x384fd1,_0x3d8a72,_0x320012);_0x1fa42c(null);};}; \ No newline at end of file diff --git a/server/components/interaction/sql-utils.js b/server/components/interaction/sql-utils.js index 0530a57..793c6b4 100644 --- a/server/components/interaction/sql-utils.js +++ b/server/components/interaction/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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 +var _0x80d9=['i.ContactId','i.MailAccountId','i.UserId','openchannel','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','TagIds','limit','offset','sequelize','toString','groupBy','Setting','findOne','enableEmailPreview','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','exports','lodash','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','../../mysqldb','getAccountFK','search','select','field','name','color','_interactions','u.id','u.fullname','ui.','from','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','getInteractionFK','interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.','me.','\x20=\x20i.id','interactionsTags','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','mail','c.email\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','text','value','end','read','and','Contact','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','type','start','Tag','split','tags','clause','ids','User','operator','$substring','UserId','buildExpression','body','plainBody','keys','map','compact','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','tag','chat','Accounts','role','agent','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','join','capitalize','Interaction','Sequelize','QueryTypes','SELECT','query','merge','attributes','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','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection'];(function(_0xa1610c,_0x2d5bcc){var _0x5ffdbb=function(_0x220a1e){while(--_0x220a1e){_0xa1610c['push'](_0xa1610c['shift']());}};_0x5ffdbb(++_0x2d5bcc);}(_0x80d9,0x15c));var _0x980d=function(_0x5ba369,_0x5cf30e){_0x5ba369=_0x5ba369-0x0;var _0x2b307a=_0x80d9[_0x5ba369];return _0x2b307a;};'use strict';var _=require(_0x980d('0x0'));var squel=require('squel');var as=require(_0x980d('0x1'));var qs=require(_0x980d('0x2'));var updateInteraction=require(_0x980d('0x3'))['updateInteraction'];var utils=require(_0x980d('0x4'));var db=require(_0x980d('0x5'))['db'];function skipInteractionsQuery(_0x38d1b9,_0x279d93,_0x290800){var _0x4a1d3f=![];var _0x4c3533=utils[_0x980d('0x6')](_0x38d1b9);if(_0x279d93['role']==='agent'&&!_0x290800[_0x980d('0x7')]&&!_0x290800[_0x4c3533]){_0x4a1d3f=!![];}return _0x4a1d3f;}function getTagsQuery(){return squel[_0x980d('0x8')]()[_0x980d('0x9')]('id')[_0x980d('0x9')](_0x980d('0xa'))[_0x980d('0x9')](_0x980d('0xb'))['from']('tools_tags');}function getUsersQuery(_0x533b8c,_0x43a0d8){var _0x10872c=utils['getInteractionFK'](_0x533b8c);var _0x1c8a14='user_has_'+_0x533b8c+_0x980d('0xc');var _0x52cd18=squel[_0x980d('0x8')]()[_0x980d('0x9')](_0x980d('0xd'))[_0x980d('0x9')](_0x980d('0xe'))[_0x980d('0x9')](_0x980d('0xf')+_0x10872c)[_0x980d('0x10')](_0x1c8a14,'ui')['left_join'](_0x980d('0x11'),'u',_0x980d('0x12'));if(_0x43a0d8[_0x980d('0x13')]>0x0){_0x52cd18[_0x980d('0x14')](_0x980d('0xf')+_0x10872c+_0x980d('0x15'),_['map'](_0x43a0d8,'id'));}return _0x52cd18;}function getInteractionsQuery(_0x27dd6a){var _0x393ae2=utils['getInteractionsTables'](_0x27dd6a);var _0x1633cf=utils['getAccountFK'](_0x27dd6a);var _0x23f64c=utils[_0x980d('0x16')](_0x27dd6a);return squel[_0x980d('0x8')]()[_0x980d('0x10')](_0x393ae2[_0x980d('0x17')],'i')[_0x980d('0x18')](_0x980d('0x19'),'c',_0x980d('0x1a'))[_0x980d('0x18')](_0x980d('0x11'),'o',_0x980d('0x1b'))['left_join'](_0x393ae2['accounts'],'a',_0x980d('0x1c')+_0x1633cf)['left_join'](_0x393ae2['messages'],'me',_0x980d('0x1d')+_0x23f64c+_0x980d('0x1e'))[_0x980d('0x18')](_0x393ae2[_0x980d('0x1f')],'it','it.'+_0x23f64c+'\x20=\x20i.id')[_0x980d('0x18')]('tools_tags','t',_0x980d('0x20'));}function getSqlClauses(){var _0x20cea1={'body':squel['expr'](),'contact':squel[_0x980d('0x21')](),'default':squel['expr'](),'fields':squel['expr'](),'filter':squel['expr'](),'read':squel[_0x980d('0x21')](),'tags':{'clause':squel[_0x980d('0x21')](),'ids':null},'user':squel[_0x980d('0x21')]()};return _0x20cea1;}function parseTagParameter(_0x28adb3){var _0x5342dd=squel['expr']();if(_0x28adb3){var _0x26d9c6=utils[_0x980d('0x22')](_0x28adb3);_0x26d9c6[_0x980d('0x23')](function(_0x1da8ea){_0x5342dd['or'](_0x980d('0x24'),'%,'+_0x1da8ea+',%');});}return _0x5342dd;}function parseReadParameter(_0x47b11d){var _0x4a51f9='';if(_0x47b11d){_0x4a51f9=_0x980d('0x25');if(_0x47b11d==='1'){_0x4a51f9=_0x4a51f9[_0x980d('0x26')](_0x980d('0x27'),'=');}else{_0x4a51f9=_0x4a51f9[_0x980d('0x26')](_0x980d('0x27'),'>');}}return _0x4a51f9;}function parseSearchFilter(_0x25542b,_0x513693){var _0x14c61b=squel[_0x980d('0x21')]();if(_0x513693){var _0xaa9cd6=_0x513693[_0x980d('0x26')]('\x5c','\x5c\x5c')[_0x980d('0x26')](/'/g,'\x27\x27');if(qs[_0x980d('0x28')](_0xaa9cd6)){_0x14c61b['or'](_0x980d('0x29'),_0xaa9cd6+'%');if([_0x980d('0x2a'),_0x980d('0x2b')]['includes'](_0x25542b)){_0x14c61b['or'](_0x980d('0x2c'),_0xaa9cd6+'%');}else if(_0x25542b===_0x980d('0x2d')){_0x14c61b['or'](_0x980d('0x2e'),_0xaa9cd6+'%');}else if(_0x25542b==='openchannel'){_0x14c61b['or']('i.from\x20LIKE\x20?',_0xaa9cd6+'%');}}else if(_0x25542b===_0x980d('0x2f')&&qs['isEmail'](_0xaa9cd6)){_0x14c61b['or'](_0x980d('0x30'),_0xaa9cd6+'%');}else{if(_0x25542b==='mail'){_0x14c61b['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xaa9cd6))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xaa9cd6));}else{if(_0x25542b!=='fax'){_0x14c61b['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x980d('0x31')](_0xaa9cd6));}_0x14c61b['or'](_0x980d('0x32'),_0xaa9cd6+'%');}}}return _0x14c61b;}function parseAdvancedSearchFilter(_0x12530d,_0x58dcc4){var _0x498081=getSqlClauses();var _0x21a66a=as[_0x980d('0x33')](_0x12530d);var _0x2623d8=_0x21a66a[_0x980d('0x34')];for(var _0x27890f=0x0;_0x27890f<_0x21a66a[_0x980d('0x35')]['length'];_0x27890f++){var _0x43c2e2=_0x21a66a[_0x980d('0x35')][_0x27890f];var _0x5f4502='i';var _0x92c9bd=_['find'](_0x58dcc4,[_0x980d('0xa'),_0x43c2e2[_0x980d('0x9')]]);if(_0x92c9bd){var _0x41159e=as['buildExpression'](_0x5f4502,_0x92c9bd['type'],_0x43c2e2);_0x498081['default'][_0x2623d8](_0x41159e[_0x980d('0x36')],_0x41159e['value']['start'],_0x41159e[_0x980d('0x37')][_0x980d('0x38')]);}else{switch(_0x43c2e2[_0x980d('0x9')]){case'unreadMessages':var _0x41174b=parseReadParameter(_0x43c2e2[_0x980d('0x37')]);_0x498081[_0x980d('0x39')][_0x980d('0x3a')](_0x41174b);break;case _0x980d('0x3b'):if(_0x43c2e2['operator']==='$substring'){if(_0x43c2e2[_0x980d('0x37')]['split']('\x20')['length']>0x1){_0x498081['contact'][_0x2623d8]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x980d('0x31')](_0x43c2e2[_0x980d('0x37')]),null);}else{var _0x8bcd98='%'+_0x43c2e2['value']+'%';_0x498081[_0x980d('0x3c')][_0x2623d8](_0x980d('0x3d'),_0x8bcd98,_0x8bcd98,_0x8bcd98);}}else{_0x92c9bd=_[_0x980d('0x3e')](_0x58dcc4,[_0x980d('0xa'),_0x980d('0x3f')]);_0x43c2e2[_0x980d('0x9')]=_0x980d('0x3f');_0x41159e=as['buildExpression'](_0x5f4502,_0x92c9bd[_0x980d('0x40')],_0x43c2e2);_0x498081[_0x980d('0x3c')][_0x2623d8](_0x41159e[_0x980d('0x36')],_0x41159e['value'][_0x980d('0x41')],_0x41159e[_0x980d('0x37')][_0x980d('0x38')]);}break;case _0x980d('0x42'):var _0x42486b=_0x43c2e2[_0x980d('0x37')][_0x980d('0x43')](',')['map'](function(_0x473c94){return Number(_0x473c94);});var _0x512503=parseTagParameter(_0x42486b);_0x498081[_0x980d('0x44')][_0x980d('0x45')][_0x980d('0x3a')](_0x512503);_0x498081[_0x980d('0x44')][_0x980d('0x46')]=_0x42486b;break;case _0x980d('0x47'):if(_0x43c2e2[_0x980d('0x48')]===_0x980d('0x49')){_0x498081['user'][_0x2623d8]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x43c2e2[_0x980d('0x37')]+'%',null);}else{_0x92c9bd=_[_0x980d('0x3e')](_0x58dcc4,[_0x980d('0xa'),_0x980d('0x4a')]);_0x43c2e2[_0x980d('0x9')]='UserId';_0x41159e=as[_0x980d('0x4b')](_0x5f4502,_0x92c9bd[_0x980d('0x40')],_0x43c2e2);_0x498081['user'][_0x2623d8](_0x41159e[_0x980d('0x36')],_0x41159e[_0x980d('0x37')][_0x980d('0x41')],_0x41159e[_0x980d('0x37')][_0x980d('0x38')]);}break;case _0x980d('0x4c'):case _0x980d('0x4d'):_0x41159e=as[_0x980d('0x4b')]('me',null,_0x43c2e2);_0x498081[_0x980d('0x4c')][_0x2623d8](_0x41159e['text'],_0x41159e[_0x980d('0x37')][_0x980d('0x41')],_0x41159e[_0x980d('0x37')][_0x980d('0x38')]);break;}}}return _0x498081;}function parseModelFields(_0x2e18c6,_0x7d0acf,_0x2e6cdf){var _0x4f0a6e=utils[_0x980d('0x6')](_0x2e18c6);var _0x50de9a=squel[_0x980d('0x21')]();var _0x6e16c1=_(_0x7d0acf)[_0x980d('0x4e')]()[_0x980d('0x4f')](function(_0xb1d509){return _['some'](_0x2e6cdf,[_0x980d('0xa'),_0xb1d509])?_0xb1d509:undefined;})[_0x980d('0x50')]()[_0x980d('0x37')]();if(_0x6e16c1[_0x980d('0x13')]>0x0){_0x6e16c1[_0x980d('0x23')](function(_0x2799a4){if(_0x2799a4===_0x4f0a6e){_0x50de9a[_0x980d('0x3a')]('i.'+_0x4f0a6e+'\x20IN\x20?',[]['concat'](_0x7d0acf[_0x2799a4]));}else if(_0x2799a4==='createdAt'){var _0x4e0f93=JSON[_0x980d('0x51')](_0x7d0acf[_0x2799a4])[_0x980d('0x52')];var _0x2850da=JSON[_0x980d('0x51')](_0x7d0acf[_0x2799a4])[_0x980d('0x53')];_0x50de9a[_0x980d('0x3a')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4e0f93,_0x2850da);}else{if(_0x7d0acf[_0x2799a4]===_0x980d('0x54')){_0x50de9a['and']('i.'+_0x2799a4+_0x980d('0x55'));}else{_0x50de9a[_0x980d('0x3a')]('i.'+_0x2799a4+_0x980d('0x56'),_0x7d0acf[_0x2799a4]);}}});}return _0x50de9a;}function parseQueryParameters(_0x4656f4,_0x522b28,_0x555080){var _0x36a241=getSqlClauses();return Promise[_0x980d('0x57')]()[_0x980d('0x58')](function(){return parseModelFields(_0x4656f4,_0x522b28,_0x555080);})['then'](function(_0x4c95b7){_0x36a241[_0x980d('0x59')]['and'](_0x4c95b7);return parseReadParameter(_0x522b28[_0x980d('0x39')]);})[_0x980d('0x58')](function(_0x409c0f){_0x36a241[_0x980d('0x39')][_0x980d('0x3a')](_0x409c0f);return parseTagParameter(_0x522b28[_0x980d('0x5a')]);})[_0x980d('0x58')](function(_0x4621eb){_0x36a241['tags']['clause'][_0x980d('0x3a')](_0x4621eb);return parseSearchFilter(_0x4656f4,_0x522b28['filter']);})[_0x980d('0x58')](function(_0x21cf36){_0x36a241['filter']=_0x21cf36;return _0x36a241;});}function checkAccountsRestrictions(_0x2b28e4,_0x338128,_0x3204e3){var _0x60969d=utils['getAccountFK'](_0x2b28e4);var _0x2ccfff='get'+_['capitalize'](_0x2b28e4)+(_0x2b28e4===_0x980d('0x5b')?'Websites':_0x980d('0x5c'));var _0x563bb9=squel[_0x980d('0x21')]();return Promise[_0x980d('0x57')]()['then'](function(){if(_0x3204e3[_0x980d('0x7')]&&_0x338128[_0x980d('0x5d')]===_0x980d('0x5e')){return _0x338128[_0x2ccfff]({'attributes':['id'],'raw':!![]});}})[_0x980d('0x58')](function(_0x26a600){if(_0x26a600){if(_0x26a600[_0x980d('0x13')]===0x0){_0x563bb9[_0x980d('0x3a')]('i.'+_0x60969d+_0x980d('0x55'));}else{_0x563bb9[_0x980d('0x3a')]('i.'+_0x60969d+_0x980d('0x15'),_[_0x980d('0x4f')](_0x26a600,'id'));}}else if(!_0x3204e3[_0x60969d]){_0x563bb9[_0x980d('0x3a')]('i.'+_0x60969d+'\x20IS\x20NOT\x20NULL');}})['then'](function(){return _0x563bb9;});}function getClosedOrderClause(_0x4a5719,_0x438b7e){var _0x53a444='';var _0x153c02=[_0x980d('0x5f'),_0x980d('0x60'),_0x980d('0x61')];if(_0x4a5719==='mail'){_0x153c02[_0x980d('0x62')](_0x980d('0x63'));}if(_0x438b7e['closed']==='0'&&_0x4a5719===_0x980d('0x2f')){_0x53a444='i.substatus';}else{if(_0x438b7e[_0x980d('0x64')]==='1'){_0x153c02['shift']();}_0x53a444='CONCAT_WS(\x27\x27,\x20'+_0x153c02[_0x980d('0x65')](',\x20')+')';}return _0x53a444;}function getFilteredInteractions(_0x46e459,_0x3e6234,_0x16f427,_0x4dbcca){var _0x17d4ff=utils['getInteractionFK'](_0x46e459);var _0x5d0fc5=_[_0x980d('0x66')](_0x46e459)+_0x980d('0x67');var _0x3bd029=[];var _0x357f77=getTagsQuery();var _0x1d9e40={'type':db[_0x980d('0x68')][_0x980d('0x69')][_0x980d('0x6a')],'raw':!![]};var _0x392ec3=[];var _0x46ea46=[];return db['sequelize'][_0x980d('0x6b')](_0x357f77['toString'](),_0x1d9e40)[_0x980d('0x58')](function(_0x3020eb){_0x3bd029=_['keyBy'](_0x3020eb,'id');_0x1d9e40=_[_0x980d('0x6c')](_0x1d9e40,{'model':db[_0x5d0fc5],'mapToModel':!![],'nest':!![]});if(_0x16f427[_0x980d('0x59')]){_0x4dbcca[_0x980d('0x6d')][_0x980d('0x23')](function(_0x4debc0){_0x3e6234[_0x980d('0x9')]('i.'+_0x4debc0);});}else{_0x3e6234[_0x980d('0x9')](_0x980d('0x6e'),_0x980d('0x6f'));_0x3e6234[_0x980d('0x9')](_0x980d('0x70'),_0x980d('0x71'));_0x3e6234[_0x980d('0x9')](_0x980d('0x72'),_0x980d('0x73'));if(_0x46e459==='mail'){_0x3e6234[_0x980d('0x9')](_0x980d('0x74'),_0x980d('0x75'));_0x3e6234[_0x980d('0x9')](_0x980d('0x76'),_0x980d('0x77'));_0x3e6234['field']('i.id');_0x3e6234[_0x980d('0x9')](_0x980d('0x78'));_0x3e6234[_0x980d('0x9')](_0x980d('0x79'));_0x3e6234[_0x980d('0x9')](_0x980d('0x7a'));_0x3e6234['field']('i.closedAt');_0x3e6234['field'](_0x980d('0x7b'));_0x3e6234['field'](_0x980d('0x7c'));_0x3e6234[_0x980d('0x9')](_0x980d('0x7d'));_0x3e6234[_0x980d('0x9')]('i.subject');_0x3e6234['field'](_0x980d('0x61'));_0x3e6234['field'](_0x980d('0x60'));_0x3e6234[_0x980d('0x9')](_0x980d('0x5f'));_0x3e6234[_0x980d('0x9')]('i.substatus');_0x3e6234[_0x980d('0x9')]('i.to');_0x3e6234[_0x980d('0x9')](_0x980d('0x7e'));_0x3e6234[_0x980d('0x9')](_0x980d('0x7f'));_0x3e6234['field'](_0x980d('0x80'));}else if(_0x46e459===_0x980d('0x81')){_0x3e6234[_0x980d('0x9')](_0x980d('0x82'),_0x980d('0x77'));}else{_0x3e6234[_0x980d('0x9')]('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',_0x980d('0x77'));}if(_0x46e459!==_0x980d('0x2f')){_0x3e6234['field'](_0x980d('0x83'));}_0x3e6234[_0x980d('0x9')]('c.firstName','Contact.firstName');_0x3e6234['field'](_0x980d('0x84'),_0x980d('0x85'));_0x3e6234[_0x980d('0x9')](_0x980d('0x86'),_0x980d('0x87'));_0x3e6234[_0x980d('0x9')](_0x980d('0x88'),_0x980d('0x89'));_0x3e6234[_0x980d('0x9')](_0x980d('0x8a'),'Contact.mobile');_0x3e6234[_0x980d('0x9')](_0x980d('0x8b'),_0x980d('0x8c'));_0x3e6234[_0x980d('0x9')](_0x980d('0x8d'),_0x980d('0x8e'));_0x3e6234['field']('o.internal',_0x980d('0x8f'));_0x3e6234[_0x980d('0x9')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x980d('0x90'));}if(_0x4dbcca[_0x980d('0x91')]){_0x3e6234[_0x980d('0x91')](_0x4dbcca[_0x980d('0x91')]);}if(_0x4dbcca[_0x980d('0x92')]){_0x3e6234[_0x980d('0x92')](_0x4dbcca['offset']);}return db[_0x980d('0x93')][_0x980d('0x6b')](_0x3e6234[_0x980d('0x94')](),_0x1d9e40);})[_0x980d('0x58')](function(_0x4e4e32){_0x392ec3=_0x4e4e32;var _0x3ad100=getUsersQuery(_0x46e459,_0x392ec3);return db['sequelize']['query'](_0x3ad100['toString'](),_0x1d9e40);})[_0x980d('0x58')](function(_0x584d7d){_0x46ea46=_[_0x980d('0x95')](_0x584d7d,_0x17d4ff);if(_0x46e459===_0x980d('0x2f')){return db[_0x980d('0x96')][_0x980d('0x97')]({'attributes':[_0x980d('0x98')],'raw':!![]});}})[_0x980d('0x58')](function(_0x54eb5e){var _0x1cce28=_0x54eb5e?_0x54eb5e[_0x980d('0x98')]:undefined;var _0x5ea5e4=_0x392ec3[_0x980d('0x4f')](function(_0x573c58){return updateInteraction(_0x573c58,_0x3bd029,_0x46ea46,_0x1cce28);});return Promise['all'](_0x5ea5e4);});}function countFilteredInteractions(_0x336709,_0x172038){var _0x39fa3e=_0x336709[_0x980d('0x99')]();_0x39fa3e[_0x980d('0x9')](_0x980d('0x9a'));_0x39fa3e[_0x980d('0x9')](_0x980d('0x6e'),_0x980d('0x6f'));var _0x3517bd=utils[_0x980d('0x22')](_0x172038);if(!_[_0x980d('0x9b')](_0x3517bd)){_0x39fa3e[_0x980d('0x14')](_0x980d('0x9c'),_0x3517bd);}var _0x5d71f2={'type':db[_0x980d('0x68')]['QueryTypes']['SELECT'],'raw':!![]};return db[_0x980d('0x93')][_0x980d('0x6b')](_0x39fa3e[_0x980d('0x94')](),_0x5d71f2);}module[_0x980d('0x9d')]={'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 0ad5e18..fcf8b74 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 _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 +var _0xc7d1=['-id','then','lastMsgText','trimStart','catch','updateInteraction','Users','Tags','TagIds','../../mysqldb','map','fullname','split','push','waiting','answered','unmanaged','abandoned','closed','UserId','talking','disposition','total','MailMessage','findOne','out','plainBody'];(function(_0x573c51,_0x499532){var _0x468a50=function(_0x54a005){while(--_0x54a005){_0x573c51['push'](_0x573c51['shift']());}};_0x468a50(++_0x499532);}(_0xc7d1,0xfc));var _0x1c7d=function(_0x91ca02,_0xf7ef3){_0x91ca02=_0x91ca02-0x0;var _0x205c8b=_0xc7d1[_0x91ca02];return _0x205c8b;};'use strict';var _=require('lodash');var db=require(_0x1c7d('0x0'))['db'];function getInteractionUsers(_0x4d6b56,_0x346f6e){return new Promise(function(_0x547dae,_0x159d2e){try{var _0x3729ae=[];if(_0x346f6e[_0x4d6b56]){_0x3729ae=_0x346f6e[_0x4d6b56][_0x1c7d('0x1')](function(_0x4a13a5){return{'id':_0x4a13a5['id'],'fullname':_0x4a13a5[_0x1c7d('0x2')]};});}return _0x547dae(_0x3729ae);}catch(_0x3cc9ca){_0x159d2e(_0x3cc9ca);}});}function getInteractionTags(_0x4c0eeb,_0x18047b){var _0x36e119=[];if(_0x4c0eeb){_0x4c0eeb[_0x1c7d('0x3')](',')['forEach'](function(_0x25a0ff){_0x36e119[_0x1c7d('0x4')](_0x18047b[_0x25a0ff]);});}return _0x36e119;}function updateWaitingCounter(_0x326100){if(_0x326100[_0x1c7d('0x5')]){_0x326100[_0x1c7d('0x5')]-=0x1;}}function updateInteractionCounters(_0xa2448b){_0xa2448b[_0x1c7d('0x5')]=0x0;_0xa2448b['talking']=0x0;_0xa2448b[_0x1c7d('0x6')]=0x0;_0xa2448b[_0x1c7d('0x7')]=0x0;_0xa2448b[_0x1c7d('0x8')]=0x0;_0xa2448b['total']=0x0;if(_0xa2448b[_0x1c7d('0x9')]){if(_0xa2448b['disposition']===_0x1c7d('0x8')){_0xa2448b['abandoned']+=0x1;updateWaitingCounter(_0xa2448b);}if(_0xa2448b[_0x1c7d('0xa')]){_0xa2448b[_0x1c7d('0x6')]+=0x1;if(_0xa2448b[_0x1c7d('0xb')]){_0xa2448b['talking']-=0x1;}}else{if(_0xa2448b[_0x1c7d('0xc')]){_0xa2448b['unmanaged']+=0x1;updateWaitingCounter(_0xa2448b);}}}else{if(!_0xa2448b['UserId']){_0xa2448b[_0x1c7d('0x5')]+=0x1;}if(_0xa2448b['UserId']){_0xa2448b[_0x1c7d('0xb')]+=0x1;updateWaitingCounter(_0xa2448b);}}_0xa2448b[_0x1c7d('0xd')]+=0x1;return _0xa2448b;}function getLastMessageText(_0x260517){return db[_0x1c7d('0xe')][_0x1c7d('0xf')]({'where':{'$and':[{'MailInteractionId':_0x260517['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x1c7d('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x1c7d('0x11')],'order':_0x1c7d('0x12'),'raw':!![]})[_0x1c7d('0x13')](function(_0x427a5a){if(_0x427a5a&&_0x427a5a[_0x1c7d('0x11')]){_0x260517[_0x1c7d('0x14')]=_[_0x1c7d('0x15')](_0x427a5a[_0x1c7d('0x11')]);}return _0x260517;})[_0x1c7d('0x16')](function(_0x5b81af){throw _0x5b81af;});}exports[_0x1c7d('0x17')]=function(_0x28ad9d,_0x5b2cf1,_0x9fe12d,_0x386593){return new Promise(function(_0x17bc4c,_0x42f3c6){return getInteractionUsers(_0x28ad9d['id'],_0x9fe12d)[_0x1c7d('0x13')](function(_0x4614a3){_0x28ad9d[_0x1c7d('0x18')]=_0x4614a3;return getInteractionTags(_0x28ad9d['TagIds'],_0x5b2cf1);})[_0x1c7d('0x13')](function(_0x3d34ff){_0x28ad9d[_0x1c7d('0x19')]=_0x3d34ff;delete _0x28ad9d[_0x1c7d('0x1a')];return updateInteractionCounters(_0x28ad9d);})[_0x1c7d('0x13')](function(_0x54e490){if(_0x386593){return getLastMessageText(_0x54e490);}else{return _0x54e490;}})[_0x1c7d('0x13')](function(_0x3abbab){_0x17bc4c(_0x3abbab);})[_0x1c7d('0x16')](function(_0x134192){_0x42f3c6(_0x134192);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index bcf7241..de59930 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 _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 +var _0x87d9=['info','catch','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','capitalize','chat','Website','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_interaction_has_tags','_messages','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','then','update'];(function(_0x266cb9,_0x43c3a0){var _0x53e316=function(_0x38b707){while(--_0x38b707){_0x266cb9['push'](_0x266cb9['shift']());}};_0x53e316(++_0x43c3a0);}(_0x87d9,0x147));var _0x987d=function(_0x1ce236,_0xca922e){_0x1ce236=_0x1ce236-0x0;var _0x241819=_0x87d9[_0x1ce236];return _0x241819;};'use strict';var _=require(_0x987d('0x0'));var db=require(_0x987d('0x1'))['db'];var loggers={'openchannel':require(_0x987d('0x2'))(_0x987d('0x3')),'mail':require(_0x987d('0x2'))(_0x987d('0x4')),'fax':require(_0x987d('0x2'))(_0x987d('0x5')),'sms':require('../../config/logger')(_0x987d('0x6')),'chat':require(_0x987d('0x2'))(_0x987d('0x7')),'whatsapp':require(_0x987d('0x2'))('whatsapp-interactions')};function getAccountFK(_0x180b7c){return _[_0x987d('0x8')](_0x180b7c)+(_0x180b7c===_0x987d('0x9')?_0x987d('0xa'):'Account')+'Id';}function getInteractionFK(_0x1fb924){return _[_0x987d('0x8')](_0x1fb924)+_0x987d('0xb');}function getInteractionId(_0x41868d,_0x177a51,_0x40d49f){if(_0x41868d&&_0x41868d[_[_0x987d('0xc')](_0x40d49f)+_0x987d('0xb')]){return _0x41868d[_[_0x987d('0xc')](_0x40d49f)+'InteractionId'];}else if(_0x41868d&&_0x41868d['id']){return _0x41868d['id'];}else if(_0x177a51&&_0x177a51['id']){return _0x177a51['id'];}else{return _0x987d('0xd');}}function getInteractionsTables(_0x689c1b){return{'accounts':_0x689c1b+'_'+(_0x689c1b===_0x987d('0x9')?_0x987d('0xe'):_0x987d('0xf')),'interactions':_0x689c1b+_0x987d('0x10'),'interactionsTags':_0x689c1b+_0x987d('0x11'),'messages':_0x689c1b+_0x987d('0x12'),'userInteractions':'user_has_'+_0x689c1b+_0x987d('0x10')};}function getSelectedTags(_0x44d2ee){var _0x17863f=[];if(_0x44d2ee){_0x17863f=Array['isArray'](_0x44d2ee)?_0x44d2ee:[_0x44d2ee];}return _0x17863f;}function log(_0x328db4,_0xfb782c,_0x554965,_0x1f1e55,_0x414683,_0x1c94b7){loggers[_0x414683[_0x987d('0x13')]()][_0x328db4](_0x987d('0x14'),_0x1c94b7[_0x987d('0x15')](),_0xfb782c?_0xfb782c['id']:null,_0xfb782c?_0xfb782c['name']:null,_0xfb782c?_0xfb782c['role']:null,getInteractionId(_0x554965,_0x1f1e55,_0x414683),_0x554965?JSON['stringify'](_0x554965):'null');}function updateUser(_0x1b6214,_0x5d15f2,_0x14791d,_0x21f815,_0x28e82c){db[_['upperFirst'](_0x21f815)+'Interaction']['findOne']({'where':{'id':getInteractionId(_0x5d15f2,_0x14791d,_0x21f815)}})[_0x987d('0x16')](function(_0x273b04){if(_0x273b04){return _0x273b04[_0x987d('0x17')]({'UserId':_0x1b6214?_0x1b6214['id']:null});}})[_0x987d('0x16')](function(_0x1008d1){if(_0x1008d1){log(_0x987d('0x18'),_0x1b6214,_0x5d15f2,_0x14791d,_0x21f815,_0x28e82c);}})[_0x987d('0x19')](function(){log('error',_0x1b6214,_0x5d15f2,_0x14791d,_0x21f815,_0x28e82c);});}module[_0x987d('0x1a')]={'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 e7e8500..7107b67 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 _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 +var _0x2806=['User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','final','parse','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users'];(function(_0x22c4d7,_0x519ab3){var _0x2345ec=function(_0x320a08){while(--_0x320a08){_0x22c4d7['push'](_0x22c4d7['shift']());}};_0x2345ec(++_0x519ab3);}(_0x2806,0xf4));var _0x6280=function(_0x14f332,_0x3b2250){_0x14f332=_0x14f332-0x0;var _0x515be8=_0x2806[_0x14f332];return _0x515be8;};'use strict';var crypto=require(_0x6280('0x0'));var util=require(_0x6280('0x1'));var compose=require(_0x6280('0x2'));var db=require(_0x6280('0x3'))['db'];var config=require(_0x6280('0x4'));function getValueFromLicense(_0x1fe7b1,_0x2b0dff){if(_0x1fe7b1&&_0x2b0dff){if(_0x2b0dff[_0x6280('0x5')]&&_0x2b0dff[_0x6280('0x6')]){var _0x549679=_0x2b0dff[_0x6280('0x5')];var _0x40b95a=_0x2b0dff['license'];var _0x4d62f7=_0x549679[_0x6280('0x7')]('-')[0x4];var _0x54b28e=_0x549679[_0x6280('0x7')]('-')[0x0];var _0x144b38=crypto[_0x6280('0x8')](_0x6280('0x9'),util[_0x6280('0xa')](_0x6280('0xb'),_0x4d62f7,_0x549679,_0x54b28e));var _0x483f5d=_0x144b38[_0x6280('0xc')](_0x40b95a,_0x6280('0xd'),'utf8');_0x483f5d+=_0x144b38[_0x6280('0xe')]('utf8');var _0x3f4b8a=JSON[_0x6280('0xf')](_0x483f5d);return _0x3f4b8a['hasOwnProperty'](_0x1fe7b1)?_0x3f4b8a[_0x1fe7b1]:null;}}return null;}function isLimit(_0x63cce4,_0x1dedc9,_0x4e91e8,_0x24f84c){var _0x24d242=_0x1dedc9;return compose()[_0x6280('0x10')](function(_0x4787e2,_0x20354f,_0x532ee1){return db[_0x6280('0x11')][_0x6280('0x12')]({'where':{'id':0x1},'raw':!![]})[_0x6280('0x13')](function(_0x55b676){var _0x31461f=getValueFromLicense(_0x63cce4,_0x55b676);return _0x31461f?_0x31461f:_0x24d242;})[_0x6280('0x13')](function(_0x12dcfc){_0x24d242=_0x12dcfc;return _0x4e91e8[_0x6280('0x14')](_0x24f84c);})[_0x6280('0x13')](function(_0x9cd7fc){if(_0x9cd7fc>=_0x24d242){return _0x20354f[_0x6280('0x15')](0x193)[_0x6280('0x16')]({'message':util[_0x6280('0xa')](_0x6280('0x17'),_0x63cce4)});}_0x532ee1();})[_0x6280('0x18')](function(_0x549fc8){_0x532ee1(_0x549fc8);});});}function isUserLimit(){return isLimit(_0x6280('0x19'),0x1,db[_0x6280('0x1a')],{'where':{'$or':[{'role':_0x6280('0x1b')},{'role':_0x6280('0x1c')}]}});}exports[_0x6280('0x1d')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index dc1f8f0..3f11869 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 _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 +var _0xf174=['value','includes','$gt','$lte','add','castTo','CAST(','field','\x20AS\x20','text','$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','pop','format','minutes','seconds','moment','parseSearch','sqlOperator','startsWith','[$or]','and','length','split','shift','match','forEach','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq'];(function(_0x17774f,_0x5d24bd){var _0x258615=function(_0x124c33){while(--_0x124c33){_0x17774f['push'](_0x17774f['shift']());}};_0x258615(++_0x5d24bd);}(_0xf174,0x12a));var _0x4f17=function(_0x2df944,_0x5ea810){_0x2df944=_0x2df944-0x0;var _0x1cd642=_0xf174[_0x2df944];return _0x1cd642;};'use strict';var _=require('lodash');var moment=require(_0x4f17('0x0'));exports[_0x4f17('0x1')]=function(_0x35d057){var _0x50a739={'conditions':[]};_0x50a739[_0x4f17('0x2')]=_[_0x4f17('0x3')](_0x35d057,_0x4f17('0x4'))?'or':_0x4f17('0x5');var _0x1cccb1=_0x35d057['replace']('[$and]','')['replace'](_0x4f17('0x4'),'')['split']('||');for(var _0xdce978=0x0;_0xdce978<_0x1cccb1[_0x4f17('0x6')];_0xdce978++){var _0x321ce2=_0x1cccb1[_0xdce978][_0x4f17('0x7')](':=');var _0x44e452=_0x321ce2[0x0];var _0x26b6d5=_0x321ce2['slice'](0x1);_0x26b6d5['forEach'](function(_0x47628f){var _0x33f876=_0x47628f['split']('[')[_0x4f17('0x8')]();var _0x377c77=_0x47628f[_0x4f17('0x9')](/\[(.*?)\]/g);_0x377c77[_0x4f17('0xa')](function(_0x3534ca){var _0x56694b=_0x3534ca[_0x4f17('0x7')]('[')[_0x4f17('0xb')](function(_0x5d4f9c){return _0x5d4f9c[_0x4f17('0xc')](']')>-0x1;})[_0x4f17('0xd')](function(_0x571471){return _0x571471['split'](']')[0x0];})[0x0];_0x50a739[_0x4f17('0xe')][_0x4f17('0xf')]({'field':_0x44e452,'operator':_0x33f876,'value':_0x56694b});});});}return _0x50a739;};exports[_0x4f17('0x10')]=function(_0x2bb5f1,_0x52c292,_0x1e60ea){var _0x107b78={};if(_0x52c292===_0x4f17('0x11')){if(_0x1e60ea[_0x4f17('0x12')]===_0x4f17('0x13')){_0x1e60ea['operator']='$between';_0x1e60ea[_0x4f17('0x14')]+=','+_0x1e60ea['value'];}else if(_[_0x4f17('0x15')]([_0x4f17('0x16'),_0x4f17('0x17')],_0x1e60ea[_0x4f17('0x12')])){_0x1e60ea[_0x4f17('0x14')]=moment(_0x1e60ea['value'])[_0x4f17('0x18')](0x1,'days')['format']('YYYY-MM-DD');}}if(_0x1e60ea[_0x4f17('0x19')]){_0x52c292=_0x1e60ea['castTo'];_0x107b78['text']=_0x4f17('0x1a')+_0x2bb5f1+'.'+_0x1e60ea[_0x4f17('0x1b')]+_0x4f17('0x1c')+_0x1e60ea[_0x4f17('0x19')]+')\x20'+parseOperator(_0x1e60ea[_0x4f17('0x12')]);}else{_0x107b78[_0x4f17('0x1d')]=_0x2bb5f1+'.'+_0x1e60ea[_0x4f17('0x1b')]+'\x20'+parseOperator(_0x1e60ea[_0x4f17('0x12')]);}if(_['includes']([_0x4f17('0x1e'),_0x4f17('0x1f')],_0x1e60ea[_0x4f17('0x12')]))_0x107b78[_0x4f17('0x1d')]='('+_0x107b78[_0x4f17('0x1d')]+'\x20OR\x20'+_0x2bb5f1+'.'+_0x1e60ea[_0x4f17('0x1b')]+_0x4f17('0x20');_0x107b78[_0x4f17('0x14')]=parseValue(_0x52c292,_0x1e60ea[_0x4f17('0x12')],_0x1e60ea['value']);return _0x107b78;};function parseOperator(_0x4ac07a){var _0x105f74;switch(_0x4ac07a){case _0x4f17('0x21'):_0x105f74=_0x4f17('0x22');break;case _0x4f17('0x1f'):_0x105f74=_0x4f17('0x23');break;case _0x4f17('0x13'):_0x105f74='=\x20?';break;case _0x4f17('0x1e'):_0x105f74=_0x4f17('0x24');break;case _0x4f17('0x25'):case _0x4f17('0x26'):case _0x4f17('0x27'):_0x105f74=_0x4f17('0x28');break;case _0x4f17('0x29'):_0x105f74=_0x4f17('0x2a');break;case _0x4f17('0x16'):_0x105f74='>\x20?';break;case'$lte':_0x105f74=_0x4f17('0x2b');break;case _0x4f17('0x2c'):_0x105f74=_0x4f17('0x2d');break;case _0x4f17('0x2e'):_0x105f74=_0x4f17('0x2f');break;}return _0x105f74;}function parseValue(_0x540ea9,_0x1cf24d,_0x38096b){var _0x3d2c11={'start':undefined,'end':undefined};switch(_0x1cf24d){case _0x4f17('0x21'):case _0x4f17('0x1f'):_0x3d2c11['start']=_0x38096b[_0x4f17('0x7')](',');break;case'$substring':_0x3d2c11['start']='%'+_0x38096b+'%';break;case _0x4f17('0x26'):_0x3d2c11['start']=_0x38096b+'%';break;case _0x4f17('0x27'):_0x3d2c11[_0x4f17('0x30')]='%'+_0x38096b;break;case _0x4f17('0x2e'):var _0x5adc96=_0x38096b[_0x4f17('0x7')](',');var _0x38096b=_0x5adc96[_0x4f17('0x8')]();var _0x21cc9a=_0x5adc96[_0x4f17('0x31')]();if(_0x540ea9===_0x4f17('0x11')){_0x38096b=moment(_0x38096b)['utcOffset'](0x0,!![])[_0x4f17('0x32')]();_0x21cc9a=moment(_0x21cc9a)['utcOffset'](0x0,!![])['add'](0x17,'hours')['add'](0x3b,_0x4f17('0x33'))['add'](0x3b,_0x4f17('0x34'))[_0x4f17('0x32')]();}_0x3d2c11={'start':_0x38096b,'end':_0x21cc9a};break;default:_0x3d2c11[_0x4f17('0x30')]=_0x38096b;break;}return _0x3d2c11;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index fc3d00b..34f425f 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 _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 +var _0xcca7=['filter','columns','value','merge','VIRTUAL','lower','lodash','sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','find','type','isPlainObject','format','YYYY-MM-DD','utc','$lte','subtract','isArray','limit','sort','map','indexOf','cast','col','priority','unsigned','DESC','ASC','omit','length','isObject','isString','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','name','intersection','model','attributes','hasOwnProperty','offset','order','where'];(function(_0x4ad9f0,_0x6ec64b){var _0x57d2df=function(_0x1d6bfa){while(--_0x1d6bfa){_0x4ad9f0['push'](_0x4ad9f0['shift']());}};_0x57d2df(++_0x6ec64b);}(_0xcca7,0x1aa));var _0x7cca=function(_0x28a7bc,_0x3094c3){_0x28a7bc=_0x28a7bc-0x0;var _0x39aa9c=_0xcca7[_0x28a7bc];return _0x39aa9c;};'use strict';var _=require(_0x7cca('0x0'));var sequelize=require(_0x7cca('0x1'));var moment=require(_0x7cca('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x33db4f){var _0x5cfce5=['ne'];try{var _0x4c311e=JSON[_0x7cca('0x3')](_0x33db4f);var _0x533b00=Object[_0x7cca('0x4')](_0x4c311e)[0x0];return _0x5cfce5[_0x7cca('0x5')](_0x533b00);}catch(_0x2126f7){return![];}}function getOperatorValue(_0x312e98){var _0x1c6c95=JSON[_0x7cca('0x3')](_0x312e98);var _0x5aec51=Object['keys'](_0x1c6c95)[0x0];var _0x937fad=_0x1c6c95[_0x5aec51];return{['$'+_0x5aec51]:_0x937fad};}exports[_0x7cca('0x6')]=function(_0x1aed1b){var _0x1e8cb9=null;if(_0x1aed1b){_0x1e8cb9=_0x1aed1b[_0x7cca('0x7')](',');}return _0x1e8cb9;};exports[_0x7cca('0x8')]=function(_0x20ffa9,_0x2b8b62){var _0x27323a={};if(!_[_0x7cca('0x9')](_0x20ffa9)){_['forOwn'](_0x20ffa9,function(_0x302367,_0x464911){try{if(_0x2b8b62){var _0x275ab2=_[_0x7cca('0xa')](_0x2b8b62,{'name':_0x464911})||{};if(hasSequelizeOperator(_0x302367)){_0x27323a[_0x464911]=getOperatorValue(_0x302367);}else if(_0x275ab2[_0x7cca('0xb')]==='DATE'&&_[_0x7cca('0xc')](_0x302367)){var _0x41e0a2=JSON[_0x7cca('0x3')](_0x302367);var _0x4d0d6d={'$gte':moment(moment(_0x41e0a2['$gte'])[_0x7cca('0xd')](_0x7cca('0xe')))[_0x7cca('0xf')]()[_0x7cca('0xd')](),'$lte':moment(moment(_0x41e0a2[_0x7cca('0x10')])[_0x7cca('0xd')](_0x7cca('0xe')))['utc']()[_0x7cca('0x11')](0x1,'s')['format']()};_0x27323a[_0x464911]=_0x4d0d6d;}else if(_0x275ab2['name']==='uniqueid'){_0x27323a[_0x464911]=_0x302367;}else{_0x27323a[_0x464911]=_[_0x7cca('0x12')](_0x302367)?_0x302367:JSON[_0x7cca('0x3')](_0x302367);}}else{_0x27323a[_0x464911]=_[_0x7cca('0x12')](_0x302367)?_0x302367:JSON[_0x7cca('0x3')](_0x302367);}}catch(_0x44294b){_0x27323a[_0x464911]=_0x302367['split'](',');}});}return _0x27323a;};exports[_0x7cca('0x13')]=function(_0x4fba9e){_0x4fba9e=parseInt(_0x4fba9e,0xa);if(!_0x4fba9e||_0x4fba9e<0x0){_0x4fba9e=LIMIT_VALUE;}return _0x4fba9e;};exports['offset']=function(_0x5d7ac6){_0x5d7ac6=parseInt(_0x5d7ac6,0xa);if(!_0x5d7ac6||_0x5d7ac6<0x0){_0x5d7ac6=0x0;}return _0x5d7ac6;};exports[_0x7cca('0x14')]=function(_0x25297b){var _0x2beb6c,_0x1a20be=null;if(_0x25297b){_0x2beb6c=_0x25297b[_0x7cca('0x7')](',');_0x1a20be=_[_0x7cca('0x15')](_0x2beb6c,function(_0x2e023c){if(_0x2e023c[_0x7cca('0x16')]('-')===0x0){return[_0x2e023c==='priority'?sequelize[_0x7cca('0x17')](sequelize[_0x7cca('0x18')](_0x7cca('0x19')),_0x7cca('0x1a')):_0x2e023c['substr'](0x1),_0x7cca('0x1b')];}else{return[_0x2e023c===_0x7cca('0x19')?sequelize[_0x7cca('0x17')](sequelize[_0x7cca('0x18')](_0x7cca('0x19')),_0x7cca('0x1a')):_0x2e023c,_0x7cca('0x1c')];}});}return _0x1a20be;};exports[_0x7cca('0x1d')]=function(_0x4b99b6,_0xfe121c){if(_[_0x7cca('0x9')](_0x4b99b6)){return _0x4b99b6;}if(_[_0x7cca('0x12')](_0x4b99b6)){for(var _0xdaf07f=0x0;_0xdaf07f<_0x4b99b6[_0x7cca('0x1e')];_0xdaf07f+=0x1){_0x4b99b6[_0xdaf07f]=this[_0x7cca('0x1d')](_0x4b99b6[_0xdaf07f],_0xfe121c);}return _0x4b99b6;}if(!_[_0x7cca('0x1f')](_0x4b99b6)){return _0x4b99b6;}if(_[_0x7cca('0x20')](_0xfe121c)){_0xfe121c=[_0xfe121c];}if(!_['isArray'](_0xfe121c)){return _0x4b99b6;}for(var _0x2cafe1=0x0;_0x2cafe1<_0xfe121c['length'];_0x2cafe1+=0x1){_[_0x7cca('0x21')](_0x4b99b6,_0xfe121c[_0x2cafe1]);}for(var _0x201fbb in _0x4b99b6){if(_0x4b99b6['hasOwnProperty'](_0x201fbb)){_0x4b99b6[_0x201fbb]=this[_0x7cca('0x1d')](_0x4b99b6[_0x201fbb],_0xfe121c);}}return _0x4b99b6;};exports[_0x7cca('0x22')]=function(_0x5533fb){return _0x5533fb[_0x7cca('0x23')](RegExp(_0x7cca('0x24')))?!![]:![];};exports[_0x7cca('0x25')]=function(_0x52fb40){return _0x52fb40['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x7cca('0x26')]=function(_0x13d217){var _0x3797f4=[];_0x13d217[_0x7cca('0x7')](/[ ,]+/)[_0x7cca('0x27')](function(_0xe1ee18){_0xe1ee18=_0xe1ee18[_0x7cca('0x28')](/([^:]")"+/g,'$1');_0xe1ee18='+'+_0xe1ee18+'*';var _0x5a2c7c=/[ `!@#$%^&*()_\-?~]/;if(_0xe1ee18['match'](_0x5a2c7c))_0xe1ee18='\x22'+_0xe1ee18+'\x22';_0x3797f4[_0x7cca('0x29')](_0xe1ee18);});return _0x3797f4[_0x7cca('0x2a')]('\x20');};exports[_0x7cca('0x2b')]=function(_0x4f5fd2,_0x2c4f63,_0x4f8e75){var _0x2061fe={},_0x10558a={};if(_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x2d')]){_0x2c4f63['query']['id']=_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x2d')];delete _0x2c4f63[_0x7cca('0x2c')]['$id'];}_0x2061fe['model']=_['map'](_0x4f5fd2,_0x7cca('0x2e'));_0x2061fe[_0x7cca('0x2c')]=_['keys'](_0x2c4f63[_0x7cca('0x2c')]);_0x2061fe[_0x7cca('0x8')]=_[_0x7cca('0x2f')](_0x2061fe[_0x7cca('0x30')],_0x2061fe[_0x7cca('0x2c')]);_0x10558a[_0x7cca('0x31')]=_[_0x7cca('0x2f')](_0x2061fe['model'],this[_0x7cca('0x6')](_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x6')]));_0x10558a[_0x7cca('0x31')]=_0x10558a['attributes'][_0x7cca('0x1e')]?_0x10558a[_0x7cca('0x31')]:_0x2061fe[_0x7cca('0x30')];if(!_0x2c4f63['query'][_0x7cca('0x32')]('nolimit')){_0x10558a[_0x7cca('0x13')]=this[_0x7cca('0x13')](_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x13')]);_0x10558a[_0x7cca('0x33')]=this[_0x7cca('0x33')](_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x33')]);}_0x10558a[_0x7cca('0x34')]=this['sort'](_0x2c4f63['query'][_0x7cca('0x14')]);_0x10558a[_0x7cca('0x35')]=this['filters'](_['pick'](_0x2c4f63[_0x7cca('0x2c')],_0x2061fe[_0x7cca('0x8')]),_0x4f5fd2);if(_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x36')]){var _0x371c67=_0x4f5fd2;var _0x4cd159=_0x2c4f63[_0x7cca('0x2c')]['filter'];if(typeof _0x4cd159==='object'){_0x371c67=_[_0x7cca('0x36')](_0x4f5fd2,function(_0x33d069){return _['includes'](_0x4cd159[_0x7cca('0x37')],_0x33d069['name']);});_0x4cd159=_0x4cd159[_0x7cca('0x38')];}_0x10558a[_0x7cca('0x35')]=_[_0x7cca('0x39')](_0x10558a['where'],{'$or':_[_0x7cca('0x15')](_0x371c67,function(_0x207250){if(_0x207250[_0x7cca('0xb')]!==_0x7cca('0x3a')){if(_0x4f8e75){return sequelize['where'](sequelize['fn'](_0x7cca('0x3b'),sequelize[_0x7cca('0x18')](_0x207250[_0x7cca('0x2e')])),{'$like':sequelize['fn'](_0x7cca('0x3b'),'%'+_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x36')]+'%')});}else{var _0x57f440={};_0x57f440[_0x207250['name']]={'$like':'%'+_0x2c4f63['query']['filter']+'%'};return _0x57f440;}}})});}_0x10558a=_[_0x7cca('0x39')]({},_0x10558a,_0x2c4f63['options']);return _0x10558a;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 54b4b29..3469352 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 _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 +var _0xfb41=['screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','omit','value','filterAgentAttributes','lodash','../../mysqldb','client','http','chatPause','faxPause','openchannelPause','voicePause','whatsappPause','length','unknown','unavailable','isNil','voiceStatus','idle','chatStatus','faxStatus','mailStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','pause','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','all','getAgentIdsByQueues','filter','includes','getAgentIdsByStatus','resolve','User','findAll','name','fullname','smsPause','pauseType','find','globalStatus','split','fields','order','DESC','getUpdatedSortOptions','internal','substring','indexOf','sort','toLowerCase','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','openchannelStatus','smsStatus','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum'];(function(_0x399ad3,_0x249e0f){var _0x290fed=function(_0x2c9415){while(--_0x2c9415){_0x399ad3['push'](_0x399ad3['shift']());}};_0x290fed(++_0x249e0f);}(_0xfb41,0x1c3));var _0x1fb4=function(_0x730192,_0x531aed){_0x730192=_0x730192-0x0;var _0x24bd5d=_0xfb41[_0x730192];return _0x24bd5d;};'use strict';var _=require(_0x1fb4('0x0'));var jayson=require('jayson/promise');var db=require(_0x1fb4('0x1'))['db'];var amiClient=jayson[_0x1fb4('0x2')][_0x1fb4('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0x1fb4('0x3')]({'port':0x232c});function isAgentPaused(_0x17408c,_0x2da121){var _0x448654=[_0x17408c[_0x1fb4('0x4')],_0x17408c[_0x1fb4('0x5')],_0x17408c['mailPause'],_0x17408c[_0x1fb4('0x6')],_0x17408c['smsPause'],_0x17408c[_0x1fb4('0x7')],_0x17408c[_0x1fb4('0x8')]];if(!_0x2da121)return _['every'](_0x448654);var _0x24d385=_['filter'](_0x448654);return _0x24d385[_0x1fb4('0x9')]>0x0&&_0x24d385['length']<_0x448654[_0x1fb4('0x9')]?!![]:![];}function isIdle(_0x55c30e){return _0x55c30e==='idle'||_0x55c30e===_0x1fb4('0xa')||_0x55c30e===_0x1fb4('0xb')||_0x55c30e==='ringing'||_[_0x1fb4('0xc')](_0x55c30e);}function isAgentIdle(_0x29d9e2){if(_0x29d9e2[_0x1fb4('0xd')]!==_0x1fb4('0xe')&&_0x29d9e2[_0x1fb4('0x7')]){_0x29d9e2['voiceStatus']='pause';return![];}return _['every']([_0x29d9e2[_0x1fb4('0xf')],_0x29d9e2[_0x1fb4('0x10')],_0x29d9e2[_0x1fb4('0x11')],_0x29d9e2['openchannelStatus'],_0x29d9e2['smsStatus'],_0x29d9e2[_0x1fb4('0xd')],_0x29d9e2[_0x1fb4('0x12')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x1fb4('0x13')](_0x1fb4('0x14'),{})[_0x1fb4('0x15')](function(_0x13170d){if(_0x13170d[_0x1fb4('0x16')]){throw new Error(_0x1fb4('0x17'));}var _0x1c9ca1=_0x13170d[_0x1fb4('0x18')];return routingClient[_0x1fb4('0x13')]('Agents',{})[_0x1fb4('0x15')](function(_0x27c936){if(_0x27c936[_0x1fb4('0x16')]){throw new Error(_0x1fb4('0x19'));}var _0x212806=_0x27c936[_0x1fb4('0x18')];return _[_0x1fb4('0x1a')]({},_0x1c9ca1,_0x212806);});})[_0x1fb4('0x1b')](function(_0x18dd4b){throw _0x18dd4b;});}exports[_0x1fb4('0x1c')]=getRealtimeAgents;function getAgentStatus(_0x9d1d04){var _0x57c63d=_0x1fb4('0xa');if(isAgentPaused(_0x9d1d04))_0x57c63d=_0x1fb4('0x1d');else if(isAgentPaused(_0x9d1d04,!![]))_0x57c63d='*pause';else if(isAgentIdle(_0x9d1d04))_0x57c63d='idle';else _0x57c63d=_0x1fb4('0x1e');return _0x57c63d;}exports[_0x1fb4('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x3b288b,_0x97a9b6){var _0x1e9c15=_[_0x1fb4('0x20')](_0x3b288b)?_0x3b288b:[_0x3b288b];var _0x2be1ad=_[_0x1fb4('0x21')](_0x97a9b6)+_0x1fb4('0x22');var _0x3e9d6d=_[_0x1fb4('0x23')](_0x1e9c15,function(_0x5a746a){return db[_0x2be1ad][_0x1fb4('0x24')]({'where':{'id':_0x5a746a}})[_0x1fb4('0x15')](function(_0x597740){if(!_0x597740)return[];return _0x597740['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x1fb4('0x25')](_0x3e9d6d)[_0x1fb4('0x15')](function(_0x3c952a){var _0x106ab8=_(_0x3c952a)['flatten']()['map']('id')['uniq']()['value']();return _0x106ab8;});}exports[_0x1fb4('0x26')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x46f53d,_0x279c17,_0x4f95de){try{if(_0x279c17['length']>0x0){_0x46f53d=_0x46f53d[_0x1fb4('0x27')](function(_0x1722d1){return _0x279c17[_0x1fb4('0x28')](_0x1722d1['id']);});}var _0xb9bd58=_0x46f53d['filter'](function(_0x19c1af){var _0x34113c=_0x1fb4('0x1e');if(isAgentIdle(_0x19c1af)){_0x34113c=_0x1fb4('0xe');}return _0x34113c===_0x4f95de;});return _['map'](_0xb9bd58,'id');}catch(_0x2c8a67){throw _0x2c8a67;}}exports[_0x1fb4('0x29')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0xec6c79,_0xbfc272,_0x4d06f4){return Promise[_0x1fb4('0x2a')]()[_0x1fb4('0x15')](function(){if(_0xbfc272['length']>0x0){_0xec6c79=_0xec6c79['filter'](function(_0x363d12){return _0xbfc272['includes'](_0x363d12['id']);});}return _0xec6c79;})['then'](function(){return db[_0x1fb4('0x2b')][_0x1fb4('0x2c')]({'attributes':['id',_0x1fb4('0x2d'),_0x1fb4('0x2e'),'chatPause',_0x1fb4('0x5'),'mailPause',_0x1fb4('0x6'),_0x1fb4('0x2f'),_0x1fb4('0x7'),'whatsappPause',_0x1fb4('0x30')],'where':{'id':{'$in':_[_0x1fb4('0x23')](_0xec6c79,'id')}},'raw':!![]});})['then'](function(_0x4eebd7){return _0x4eebd7[_0x1fb4('0x23')](function(_0x32f819){var _0x4a785a=_[_0x1fb4('0x31')](_0xec6c79,['id',_0x32f819['id']]);var _0x458924=filterAgentAttributes(_0x4a785a);_['merge'](_0x32f819,_0x458924);_0x32f819[_0x1fb4('0x32')]=getAgentStatus(_0x32f819);return _0x32f819;});})[_0x1fb4('0x15')](function(_0x3ab1ad){var _0x35c49c=sortAgentsByStatus(_0x3ab1ad,_0x4d06f4);return _['map'](_0x35c49c,'id');})[_0x1fb4('0x1b')](function(_0xbd2f9c){throw _0xbd2f9c;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x48bb41){var _0x1a42f6={'fields':[],'order':null};var _0x4dd19e=_0x48bb41[_0x1fb4('0x33')](',');_0x1a42f6[_0x1fb4('0x34')]=_['filter'](_0x4dd19e,function(_0x40e9c6){if(!_0x40e9c6[_0x1fb4('0x28')]('globalStatus')){return!![];}_0x1a42f6[_0x1fb4('0x35')]=_['startsWith'](_0x40e9c6,'-')?_0x1fb4('0x36'):'ASC';return![];});return _0x1a42f6;}exports[_0x1fb4('0x37')]=getUpdatedSortOptions;function validateSortParameter(_0x3465f1){if(_0x3465f1[_0x1fb4('0x28')](_0x1fb4('0x2e'))&&!_0x3465f1['includes'](_0x1fb4('0x38'))){var _0x1a36af=_0x3465f1[_0x1fb4('0x39')](0x0,_0x3465f1[_0x1fb4('0x3a')]('fullname'));_0x3465f1+=','+_0x1a36af+_0x1fb4('0x38');}return _0x3465f1;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x1c5865,_0x2fcc19){var _0x55508e=_0x1c5865[_0x1fb4('0x3b')](function(_0x128e6d,_0x6a477a){if(_0x128e6d['globalStatus']===_0x6a477a[_0x1fb4('0x32')]){if(_0x128e6d[_0x1fb4('0x32')]===_0x1fb4('0x1d')){if(_0x2fcc19===_0x1fb4('0x36')){return(_0x128e6d[_0x1fb4('0x30')]||'')<(_0x6a477a['pauseType']||'')||_0x128e6d['fullname'][_0x1fb4('0x3c')]()>_0x6a477a[_0x1fb4('0x2e')]['toLowerCase']()?0x1:-0x1;}else{return(_0x128e6d[_0x1fb4('0x30')]||'')<(_0x6a477a[_0x1fb4('0x30')]||'')||_0x128e6d['fullname']['toLowerCase']()>_0x6a477a[_0x1fb4('0x2e')][_0x1fb4('0x3c')]()?-0x1:0x1;}}else{if(_0x2fcc19===_0x1fb4('0x36')){return _0x128e6d[_0x1fb4('0x2e')][_0x1fb4('0x3c')]()<_0x6a477a[_0x1fb4('0x2e')][_0x1fb4('0x3c')]()?0x1:-0x1;}else{return _0x128e6d[_0x1fb4('0x2e')][_0x1fb4('0x3c')]()<_0x6a477a[_0x1fb4('0x2e')][_0x1fb4('0x3c')]()?-0x1:0x1;}}}else{if(_0x2fcc19===_0x1fb4('0x36')){return _0x128e6d[_0x1fb4('0x32')]<_0x6a477a[_0x1fb4('0x32')]?0x1:-0x1;}else{return _0x128e6d[_0x1fb4('0x32')]<_0x6a477a[_0x1fb4('0x32')]?-0x1:0x1;}}});return _0x55508e;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x126472){var _0x474437=['userpic',_0x1fb4('0x3d'),_0x1fb4('0x3e'),'lastPauseAt','pauseType',_0x1fb4('0x3f'),'internal',_0x1fb4('0x40'),'chatPause','openchannelPause','mailPause',_0x1fb4('0x2f'),_0x1fb4('0x8'),_0x1fb4('0x5'),_0x1fb4('0x7'),_0x1fb4('0x41'),_0x1fb4('0x42'),'mailCapacity',_0x1fb4('0x43'),'whatsappCapacity',_0x1fb4('0x44'),_0x1fb4('0x45'),_0x1fb4('0x46'),_0x1fb4('0x47'),_0x1fb4('0x48'),'whatsappCurrentCapacity','faxCurrentCapacity',_0x1fb4('0xf'),_0x1fb4('0x49'),_0x1fb4('0x11'),_0x1fb4('0x4a'),'whatsappStatus',_0x1fb4('0x10'),'voiceStatus',_0x1fb4('0x4b'),_0x1fb4('0x4c'),'mailStatusTime',_0x1fb4('0x4d'),_0x1fb4('0x4e'),_0x1fb4('0x4f'),_0x1fb4('0x50'),_0x1fb4('0x51'),_0x1fb4('0x52'),_0x1fb4('0x53'),'phoneBarEnableScreenRecordingByAgent',_0x1fb4('0x54'),_0x1fb4('0x55')];var _0x2fbca7=['chatPause',_0x1fb4('0x6'),'mailPause','smsPause','whatsappPause','faxPause',_0x1fb4('0x7'),'online'];var _0xd5181c=_(_0x126472)[_0x1fb4('0x56')](_0x2fbca7)['pick'](_0x474437)[_0x1fb4('0x57')]();return _0xd5181c;}exports[_0x1fb4('0x58')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 68fbb54..e3d08f9 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 _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 +var _0xb351=['pick','initializeQueues','lodash','util','client','http','available','loggedIn','paused','busy','inUse','notInUse','onHold','ringing','ringInUse','talking','unavailable','unknown','originated','message','dialActive','dialMethod','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','voice','request','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','inbound','concat','outbound','map','loggedInDb','pTalking','find','merge'];(function(_0x542a4e,_0x23f7ef){var _0x11d75d=function(_0x12c1c7){while(--_0x12c1c7){_0x542a4e['push'](_0x542a4e['shift']());}};_0x11d75d(++_0x23f7ef);}(_0xb351,0x1d6));var _0x1b35=function(_0x3d5a5a,_0x4849d2){_0x3d5a5a=_0x3d5a5a-0x0;var _0x391a33=_0xb351[_0x3d5a5a];return _0x391a33;};'use strict';var _=require(_0x1b35('0x0'));var jayson=require('jayson/promise');var util=require(_0x1b35('0x1'));var amiClient=jayson[_0x1b35('0x2')]['http']({'port':0x232a});var routingClient=jayson['client'][_0x1b35('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x1b35('0x4'),_0x1b35('0x5'),_0x1b35('0x6'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0x1b35('0x7'),_0x1b35('0x8'),'invalid','loggedInDb',_0x1b35('0x9'),_0x1b35('0xa'),_0x1b35('0xb'),_0x1b35('0xc'),_0x1b35('0xd'),_0x1b35('0xe'),_0x1b35('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0x1b35('0x10'),_0x1b35('0x11'),'statusMessage',_0x1b35('0x12'),_0x1b35('0x13'),'Trunk','startPredictive',_0x1b35('0x14'),_0x1b35('0x15'),_0x1b35('0x16'),_0x1b35('0x17'),_0x1b35('0x18'),_0x1b35('0x19'),_0x1b35('0x1a'),_0x1b35('0x1b'),_0x1b35('0x1c'),_0x1b35('0x1d'),_0x1b35('0x1e'),_0x1b35('0x1f'),_0x1b35('0x20'),'predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x12a146,_0x159eee){var _0x41ab7a=_0x159eee===_0x1b35('0x21')?amiClient:routingClient;return _0x41ab7a[_0x1b35('0x22')](_['startCase'](_0x159eee)+_0x1b35('0x23'),_0x12a146)[_0x1b35('0x24')](function(_0x21bf8e){if(_0x21bf8e[_0x1b35('0x25')])throw new Error(util[_0x1b35('0x26')](_0x1b35('0x27'),_0x159eee));return _0x21bf8e[_0x1b35('0x28')];})['catch'](function(_0x182cbe){throw _0x182cbe;});}exports[_0x1b35('0x29')]=getRealtimeQueues;function initializeQueues(_0x250c17,_0x28b4ef,_0x3782fb,_0x3700fb){var _0x3e0513=DEFAULT_QUEUE_ATTRIBUTES;if(_0x3782fb===_0x1b35('0x21')){if(_0x3700fb===_0x1b35('0x2a')){_0x3e0513=_0x3e0513[_0x1b35('0x2b')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x3700fb===_0x1b35('0x2c')){_0x3e0513=_0x3e0513['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x250c17[_0x1b35('0x2d')](function(_0xd5cd64){var _0x28fb14=_0xd5cd64['get']({'plain':!![]});_0x28fb14['paused']=0x0;_0x28fb14[_0x1b35('0x2e')]=0x0;_0x28fb14['loggedIn']=0x0;_0x28fb14[_0x1b35('0x4')]=0x0;_0x28fb14['waiting']=0x0;if(_0x3782fb===_0x1b35('0x21')){_0x28fb14[_0x1b35('0xd')]=0x0;_0x28fb14['busy']=0x0;if(_0x3700fb===_0x1b35('0x2c')){_0x28fb14[_0x1b35('0x2f')]=0x0;_0x28fb14[_0x1b35('0x10')]=0x0;}}var _0x38eeca=_[_0x1b35('0x30')](_0x28b4ef,['id',_0x28fb14['id']]);if(_0x38eeca){_[_0x1b35('0x31')](_0x28fb14,_[_0x1b35('0x32')](_0x38eeca,_0x3e0513));}return _0x28fb14;});}exports[_0x1b35('0x33')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 302bd5c..9f47046 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_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 +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(_0x333160,_0x4c1df7){var _0x256d5a=function(_0xa6643e){while(--_0xa6643e){_0x333160['push'](_0x333160['shift']());}};_0x256d5a(++_0x4c1df7);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 9097017..4766eab 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 _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 +var _0xf2da=['cpus','map','model','createHash','md5','hex','getUuid','test','licenseToken','win32','utf8','replace','hostname','macAddress','update','digest','substring','lodash','crypto','child_process','../environment','networkInterfaces','keys','length','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface'];(function(_0x43488c,_0x92e2e6){var _0xfe6cab=function(_0x30a263){while(--_0x30a263){_0x43488c['push'](_0x43488c['shift']());}};_0xfe6cab(++_0x92e2e6);}(_0xf2da,0x187));var _0xaf2d=function(_0x3a2e49,_0x21ebea){_0x3a2e49=_0x3a2e49-0x0;var _0x257140=_0xf2da[_0x3a2e49];return _0x257140;};'use strict';var _=require(_0xaf2d('0x0'));var os=require('os');var crypto=require(_0xaf2d('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0xaf2d('0x2'))['execSync'];var config=require(_0xaf2d('0x3'));function getInterfaces(){var _0x368494=[];var _0x19090c=os[_0xaf2d('0x4')]();var _0x14e86c=_['orderBy'](_[_0xaf2d('0x5')](_0x19090c));for(var _0x245824=0x0;_0x245824<_0x14e86c[_0xaf2d('0x6')];_0x245824++){var _0x5bcbc0=_0x19090c[_0x14e86c[_0x245824]][_0xaf2d('0x7')](function(_0x8a4475){return _0x8a4475['family']===_0xaf2d('0x8')&&_0x8a4475[_0xaf2d('0x9')]===![];});_0x368494=_0x368494[_0xaf2d('0xa')](_0x5bcbc0);}return _0x368494;}function getFirstInterface(){var _0x1479c5=_[_0xaf2d('0xb')](getInterfaces());return{'macAddress':_0x1479c5&&_0x1479c5[_0xaf2d('0xc')]?_0x1479c5['mac']:_0xaf2d('0xd'),'ipAddress':_0x1479c5&&_0x1479c5['address']?_0x1479c5[_0xaf2d('0xe')]:_0xaf2d('0xf')};}exports[_0xaf2d('0x10')]=getFirstInterface;function getCPUhash(){var _0x381c17=_['orderBy'](os[_0xaf2d('0x11')]()[_0xaf2d('0x12')](function(_0x459ada){return _0x459ada[_0xaf2d('0x13')];}))['join'](':');return crypto[_0xaf2d('0x14')](_0xaf2d('0x15'))['update'](_0x381c17)['digest'](_0xaf2d('0x16'));}exports[_0xaf2d('0x17')]=function(){var _0x1a51ed=os['platform']();var _0x464240=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x464240[_0xaf2d('0x18')](config[_0xaf2d('0x19')])){return config[_0xaf2d('0x19')];}else if(_0x1a51ed===_0xaf2d('0x1a')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xaf2d('0x1b')})[_0xaf2d('0x1c')]('\x0d\x0a','');}else{var _0x469a2b=getFirstInterface();var _0x54fe0b=getCPUhash();var _0x16c42b=_0x54fe0b+'|'+os[_0xaf2d('0x1d')]()+'|'+_0x469a2b[_0xaf2d('0x1e')]+'|'+_0x469a2b['ipAddress'];var _0x3df6bf=crypto[_0xaf2d('0x14')](_0xaf2d('0x15'))[_0xaf2d('0x1f')](_0x16c42b)[_0xaf2d('0x20')]('hex');return _0x3df6bf[_0xaf2d('0x21')](0x0,0x8)+'-'+_0x3df6bf[_0xaf2d('0x21')](0x8,0xc)+'-'+_0x3df6bf[_0xaf2d('0x21')](0xc,0x10)+'-'+_0x3df6bf[_0xaf2d('0x21')](0x10,0x14)+'-'+_0x3df6bf[_0xaf2d('0x21')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 1443826..ba76239 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 _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 +var _0x6bc9=['bluebird','pkginfo','version','../../components/encryptor','../logger','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','license','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','data1','error','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','request-promise'];(function(_0x1eff7c,_0x357ad0){var _0x304854=function(_0x27f760){while(--_0x27f760){_0x1eff7c['push'](_0x1eff7c['shift']());}};_0x304854(++_0x357ad0);}(_0x6bc9,0x9f));var _0x96bc=function(_0x507597,_0x412525){_0x507597=_0x507597-0x0;var _0x110a0f=_0x6bc9[_0x507597];return _0x110a0f;};'use strict';var util=require('util');var moment=require('moment');var rp=require(_0x96bc('0x0'));var BPromise=require(_0x96bc('0x1'));var pkginfo=require(_0x96bc('0x2'))(module,_0x96bc('0x3'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x96bc('0x4'));var hardware=require('./hardware');var logger=require(_0x96bc('0x5'))('license');var HOST=_0x96bc('0x6');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x6d1ca9){return new BPromise(function(_0x25df41,_0x307851){var _0x52954b=util['format'](_0x96bc('0x7'),HOST,_0x6d1ca9,module[_0x96bc('0x8')]['version']);if(oldToken){_0x52954b=util[_0x96bc('0x9')](_0x96bc('0xa'),HOST,_0x6d1ca9,module['exports'][_0x96bc('0x3')],oldToken);}var _0x4ae129={'uri':_0x52954b,'method':_0x96bc('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x4ae129)[_0x96bc('0xc')](function(_0x4121d7){_0x25df41(_0x4121d7);})[_0x96bc('0xd')](function(_0x1633bd){_0x307851(_0x1633bd);});});}function manageLicense(_0x4bbe0a,_0x5b2642){var _0x216790=_0x5b2642[_0x96bc('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x216790['data1']!==_0x4bbe0a&&!_0x216790['data2']){oldToken=_0x216790['data1'];}httpRequest(_0x4bbe0a)['then'](function(_0x7f77af){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x7f77af['active']){isOldTokenSent=![];if(!_0x216790[_0x96bc('0xf')]&&_0x216790[_0x96bc('0xf')]!=_0x7f77af[_0x96bc('0xf')]||_0x216790[_0x96bc('0xf')]&&_0x216790['data2']){logger['info'](_0x96bc('0x10'));}if(_0x216790[_0x96bc('0xf')]&&!_0x216790[_0x96bc('0x11')]&&_0x216790[_0x96bc('0xf')]!=_0x7f77af[_0x96bc('0xf')]){logger[_0x96bc('0x12')](_0x96bc('0x13'));}if(_0x216790[_0x96bc('0xf')]&&!_0x216790[_0x96bc('0x11')]&&_0x216790[_0x96bc('0xf')]==_0x7f77af[_0x96bc('0xf')]){return _0x5b2642;}return _0x5b2642['update']({'data1':_0x4bbe0a,'data2':null,'license':_0x7f77af[_0x96bc('0xf')]});}else{if(_0x7f77af[_0x96bc('0xf')]||_0x216790[_0x96bc('0xf')]){if(!_0x216790['data2']){if(_0x216790['data1']==_0x4bbe0a){GRAY_PERIOD_REASON=_0x96bc('0x14');logger[_0x96bc('0x12')](_0x96bc('0x15'));}else{GRAY_PERIOD_REASON=_0x96bc('0x16');logger[_0x96bc('0x12')](_0x96bc('0x17'),_0x216790['data1'],_0x4bbe0a);}logger['info'](_0x96bc('0x18'),GRAY_PERIOD_REASON[_0x96bc('0x19')](),moment()[_0x96bc('0x9')](_0x96bc('0x1a')));return _0x5b2642[_0x96bc('0x1b')]({'data2':encryptor['encryptString'](moment()[_0x96bc('0x9')](_0x96bc('0x1a')))});}else{if(moment()[_0x96bc('0x1c')](encryptor[_0x96bc('0x1d')](_0x216790['data2']),_0x96bc('0x1e'))>DAYS){logger['info'](_0x96bc('0x1f'),moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x5b2642['update']({'data1':_0x4bbe0a,'data2':null,'license':null});}}}else{if(_0x216790[_0x96bc('0x20')]!=_0x4bbe0a){logger[_0x96bc('0x12')](_0x96bc('0x17'),_0x216790[_0x96bc('0x20')],_0x4bbe0a);return _0x5b2642[_0x96bc('0x1b')]({'data1':_0x4bbe0a,'data2':null,'license':null});}}}return _0x5b2642;})['then'](function(_0x251fa3){_0x5b2642=_0x251fa3;})[_0x96bc('0xd')](function(_0x41652d){logger[_0x96bc('0x21')](_0x41652d['message']);})[_0x96bc('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0x96bc('0x23')](),_0x5b2642);},TIME);});}function defaultLicense(){var _0x377855=hardware[_0x96bc('0x23')]();if(_0x377855){return db[_0x96bc('0x24')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x377855}})[_0x96bc('0x25')](function(_0x2f86c3,_0x85ab21){logger[_0x96bc('0x12')](_0x96bc('0x26'),_0x377855);manageLicense(_0x377855,_0x2f86c3);})[_0x96bc('0xd')](function(_0x40b6c2){logger[_0x96bc('0x21')](_0x40b6c2['message']);});}}exports[_0x96bc('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index f3a8e42..fa20d7e 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 _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 +var _0xbd36=['days','grayReason','changed','disabled','message','User','findAll','sequelize','COUNT','col','role','count','user','telephone','users','telephones','admin','pick','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','license','data1','data2','split','decryptString','format','parse','machineUuid','add'];(function(_0x297c29,_0x1d65aa){var _0x9bffd8=function(_0x30dfe3){while(--_0x30dfe3){_0x297c29['push'](_0x297c29['shift']());}};_0x9bffd8(++_0x1d65aa);}(_0xbd36,0xfb));var _0x6bd3=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xbd36[_0x565c49];return _0x20ca34;};'use strict';var util=require(_0x6bd3('0x0'));var _=require(_0x6bd3('0x1'));var moment=require(_0x6bd3('0x2'));var BPromise=require(_0x6bd3('0x3'));var hardware=require(_0x6bd3('0x4'));var encryptor=require('../../components/encryptor');var db=require(_0x6bd3('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6bd3('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x6bd3('0x7'),'machineUuid':hardware[_0x6bd3('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'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':![],'update':![],'description':_0x6bd3('0x9'),'machineUuid':hardware[_0x6bd3('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x19d850){return new BPromise(function(_0x53fa67,_0x7e70e4){return db[_0x6bd3('0xa')][_0x6bd3('0xb')](_[_0x6bd3('0xc')](_0x19d850,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x128fd3){return checkLicense(_0x128fd3,null);})[_0x6bd3('0xd')](function(_0x2c60b4){_0x53fa67(_0x2c60b4);return;})[_0x6bd3('0xe')](function(_0x95f68b){_0x7e70e4(_0x95f68b);});});}function checkLicense(_0x47e84f,_0x4cf1d7){if(!_0x47e84f){demoLicense[_0x6bd3('0xf')]=_0x47e84f['data1'];return demoLicense;}try{var _0x31fca3=_0x4cf1d7||_0x47e84f[_0x6bd3('0x10')];if(_['isEmpty'](_0x31fca3)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x1d4d39=_0x47e84f[_0x6bd3('0x11')];var _0x15ca53=_0x47e84f[_0x6bd3('0x12')];var _0x1b3768=_0x1d4d39['split']('-')[0x4];var _0x1bbd25=_0x1d4d39[_0x6bd3('0x13')]('-')[0x0];var _0x58d02e=encryptor[_0x6bd3('0x14')](_0x31fca3,util[_0x6bd3('0x15')]('%s:%s:%s',_0x1b3768,_0x1d4d39,_0x1bbd25));var _0x168183=JSON[_0x6bd3('0x16')](_0x58d02e);_0x168183['demo']=![];_0x168183[_0x6bd3('0xf')]=_0x1d4d39;_0x168183[_0x6bd3('0x17')]=hardware['getUuid']();if(_0x15ca53){var _0x38293d=encryptor['decryptString'](_0x15ca53);_0x168183['gray']=_0x38293d;_0x168183['deadline']=moment(_0x38293d)[_0x6bd3('0x18')](0x7,_0x6bd3('0x19'))[_0x6bd3('0x15')]();_0x168183[_0x6bd3('0x1a')]=_0x168183[_0x6bd3('0xf')]!=_0x168183[_0x6bd3('0x17')]?_0x6bd3('0x1b'):_0x6bd3('0x1c');}return _0x168183;}catch(_0x355552){breakingLicense['uuid']=_0x47e84f['data1'];breakingLicense[_0x6bd3('0x1d')]=_0x355552[_0x6bd3('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x8ec832,_0x3a5069){getLicense()[_0x6bd3('0xd')](function(_0x191cb6){return db[_0x6bd3('0x1e')][_0x6bd3('0x1f')]({'attributes':['role',[db[_0x6bd3('0x20')]['fn'](_0x6bd3('0x21'),db[_0x6bd3('0x20')][_0x6bd3('0x22')](_0x6bd3('0x23'))),_0x6bd3('0x24')]],'group':_0x6bd3('0x23'),'where':{'role':{'$or':['admin',_0x6bd3('0x25'),_0x6bd3('0x26')]}},'raw':!![]})['then'](function(_0xf6d3a2){var _0xa3d127={'user':_0x191cb6[_0x6bd3('0x27')]||0x0,'telephone':_0x191cb6[_0x6bd3('0x28')]||0x0};_0xf6d3a2['forEach'](function(_0x2bc58c){var _0x5b0cd0=_0x2bc58c[_0x6bd3('0x23')]===_0x6bd3('0x29')?_0x6bd3('0x25'):_0x2bc58c['role'];_0xa3d127[_0x5b0cd0]-=_0x2bc58c[_0x6bd3('0x24')];if(_0xa3d127[_0x5b0cd0]<0x0)_0xa3d127[_0x5b0cd0]=0x0;});_0x8ec832(_0xa3d127);return;});})[_0x6bd3('0xe')](function(_0x127564){_0x3a5069(_0x127564);});});}function checkUserLimits(_0x4f73b3){return new BPromise(function(_0x4bae1a,_0x3ee38a){getLimits()['then'](function(_0x4c73c9){var _0x2e1eb9=_[_0x6bd3('0x2a')](_['countBy'](_0x4f73b3,_0x6bd3('0x23')),[_0x6bd3('0x29'),_0x6bd3('0x25'),_0x6bd3('0x26')]);var _0x288237=(_0x2e1eb9[_0x6bd3('0x29')]||0x0)+(_0x2e1eb9[_0x6bd3('0x25')]||0x0);var _0x527d26=_0x2e1eb9[_0x6bd3('0x26')]||0x0;if(_0x288237>_0x4c73c9[_0x6bd3('0x25')])return _0x3ee38a(_0x6bd3('0x2b'));if(_0x527d26>_0x4c73c9['telephone'])return _0x3ee38a(_0x6bd3('0x2c'));return _0x4bae1a();})[_0x6bd3('0xe')](function(_0x18cbfe){_0x3ee38a(_0x18cbfe);});});}module[_0x6bd3('0x2d')]={'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 383743c..2842345 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 _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 +var _0x056b=['app-id','secret','http://localhost:9000','myappanuglar-secret'];(function(_0x2c23d4,_0x283bdc){var _0x5b8316=function(_0x1abfb9){while(--_0x1abfb9){_0x2c23d4['push'](_0x2c23d4['shift']());}};_0x5b8316(++_0x283bdc);}(_0x056b,0xb6));var _0xb056=function(_0x934754,_0x15bd40){_0x934754=_0x934754-0x0;var _0x5cf1fc=_0x056b[_0x934754];return _0x5cf1fc;};'use strict';module['exports']={'DOMAIN':_0xb056('0x0'),'SESSION_SECRET':_0xb056('0x1'),'GOOGLE_ID':_0xb056('0x2'),'GOOGLE_SECRET':_0xb056('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 46cfa91..f465dbd 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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 +var _0x0035=['exports'];(function(_0x165939,_0x1b2438){var _0xb185df=function(_0x59e235){while(--_0x59e235){_0x165939['push'](_0x165939['shift']());}};_0xb185df(++_0x1b2438);}(_0x0035,0x18c));var _0x5003=function(_0x6cf622,_0x146e67){_0x6cf622=_0x6cf622-0x0;var _0x1887fe=_0x0035[_0x6cf622];return _0x1887fe;};'use strict';var fileLogger=require('../utils/loggers')['fileLogger'];module[_0x5003('0x0')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 19471c4..be4a1e7 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 _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 +var _0xabc8=['xdr','../../services/xdr/index.js','exports','path','../../config/environment','join','root','legacy-libs','../../services/express/index.js','ami','agi','../../services/agi/index.js','email','routing','../../services/routing/index.js'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xabc8,0x111));var _0x8abc=function(_0x2fb87c,_0x2dee49){_0x2fb87c=_0x2fb87c-0x0;var _0x43038b=_0xabc8[_0x2fb87c];return _0x43038b;};'use strict';var path=require(_0x8abc('0x0'));var cfg=require(_0x8abc('0x1'));var env={'NODE_PATH':path['resolve'](path[_0x8abc('0x2')](cfg[_0x8abc('0x3')],_0x8abc('0x4')))};var pm2config={'apps':[{'name':'express','script':path[_0x8abc('0x2')](__dirname,_0x8abc('0x5')),'env':env},{'name':_0x8abc('0x6'),'script':path[_0x8abc('0x2')](__dirname,'../../services/ami/index.js'),'env':env},{'name':_0x8abc('0x7'),'script':path[_0x8abc('0x2')](__dirname,_0x8abc('0x8')),'env':env},{'name':_0x8abc('0x9'),'script':path[_0x8abc('0x2')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0x8abc('0xa'),'script':path[_0x8abc('0x2')](__dirname,_0x8abc('0xb')),'env':env},{'name':_0x8abc('0xc'),'script':path[_0x8abc('0x2')](__dirname,_0x8abc('0xd')),'env':env}]};module[_0x8abc('0xe')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 90066fe..48ae567 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 _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 +var _0x244f=['then','disconnect','stop','restart','list','describe','delete','dump','saved','bluebird','./config','connect','connected','start'];(function(_0x12d5e0,_0x2e7c4d){var _0x41b3ee=function(_0x2278ef){while(--_0x2278ef){_0x12d5e0['push'](_0x12d5e0['shift']());}};_0x41b3ee(++_0x2e7c4d);}(_0x244f,0x12f));var _0xf244=function(_0xe9837,_0x302011){_0xe9837=_0xe9837-0x0;var _0x5bb439=_0x244f[_0xe9837];return _0x5bb439;};'use strict';var pm2=require('pm2');var BPromise=require(_0xf244('0x0'));var config=require(_0xf244('0x1'));function connect(){return new BPromise(function(_0x4edd9b,_0xb73409){return pm2[_0xf244('0x2')](function(_0x524982){if(_0x524982){return _0xb73409(_0x524982);}return _0x4edd9b(_0xf244('0x3'));});});};exports[_0xf244('0x4')]=function(_0xdf09c1){return connect()[_0xf244('0x5')](function(){return new BPromise(function(_0x4334aa,_0x2d22c6){return pm2[_0xf244('0x4')](_0xdf09c1,function(_0x1630e8,_0x5c30a2){if(_0x1630e8){return _0x2d22c6(_0x1630e8);}pm2[_0xf244('0x6')]();return _0x4334aa(_0x5c30a2);});});});};exports['stop']=function(_0x5f0365){return connect()['then'](function(){return new BPromise(function(_0x21041e,_0x20c141){return pm2[_0xf244('0x7')](_0x5f0365,function(_0x217cda,_0x295da5){if(_0x217cda){return _0x20c141(_0x217cda);}pm2['disconnect']();return _0x21041e(_0x295da5);});});});};exports['restart']=function(_0x4c45dc){return connect()[_0xf244('0x5')](function(){return new BPromise(function(_0xa725a7,_0x1dfb8e){return pm2[_0xf244('0x8')](_0x4c45dc,function(_0x5aa5a0,_0x2d816f){if(_0x5aa5a0){return _0x1dfb8e(_0x5aa5a0);}pm2[_0xf244('0x6')]();return _0xa725a7(_0x2d816f);});});});};exports[_0xf244('0x9')]=function(){return connect()[_0xf244('0x5')](function(){return new BPromise(function(_0x59004e,_0x51fb66){return pm2[_0xf244('0x9')](function(_0x5ba6e8,_0x206547){if(_0x5ba6e8){return _0x51fb66(_0x5ba6e8);}pm2['disconnect']();return _0x59004e(_0x206547);});});});};exports[_0xf244('0xa')]=function(_0x410997){return connect()[_0xf244('0x5')](function(){return new BPromise(function(_0x2d58d0,_0x1ed26d){return pm2[_0xf244('0xa')](_0x410997,function(_0x46038d,_0xbb8253){if(_0x46038d){return _0x1ed26d(_0x46038d);}pm2[_0xf244('0x6')]();return _0x2d58d0(_0xbb8253);});});});};exports[_0xf244('0xb')]=function(_0x3dbc38){return connect()[_0xf244('0x5')](function(){return new BPromise(function(_0x445721,_0x928df9){return pm2['delete'](_0x3dbc38,function(_0x509f83,_0x171f4e){if(_0x509f83){return _0x928df9(_0x509f83);}pm2[_0xf244('0x6')]();return _0x445721(_0x171f4e);});});});};exports[_0xf244('0xc')]=function(){return connect()[_0xf244('0x5')](function(){return new BPromise(function(_0x4b9ffd,_0x7ecff4){return pm2['dump'](function(_0x546291){if(_0x546291){return _0x7ecff4(_0x546291);}return _0x4b9ffd(_0xf244('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 9cb31bf..67feafb 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 _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 +var _0x0b8a=['then','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','inspect','lodash','moment','ioredis','util','../../mysqldb','schedule','localhost','socket.io-emitter','redis','Setting','chatTimeout','ChatInteraction','findAll','lastMsgAt','minutes'];(function(_0x2fd4b4,_0x3d767d){var _0x360280=function(_0xa4dba){while(--_0xa4dba){_0x2fd4b4['push'](_0x2fd4b4['shift']());}};_0x360280(++_0x3d767d);}(_0x0b8a,0xa5));var _0xa0b8=function(_0x49cd03,_0x49ec4e){_0x49cd03=_0x49cd03-0x0;var _0x5c2315=_0x0b8a[_0x49cd03];return _0x5c2315;};'use strict';var _=require(_0xa0b8('0x0'));var moment=require(_0xa0b8('0x1'));var Redis=require(_0xa0b8('0x2'));var util=require(_0xa0b8('0x3'));var config=require('../../config/environment');var db=require(_0xa0b8('0x4'))['db'];var logger=require('../logger')(_0xa0b8('0x5'));config['redis']=_['defaults'](config['redis'],{'host':_0xa0b8('0x6'),'port':0x18eb});var io=require(_0xa0b8('0x7'))(new Redis(config[_0xa0b8('0x8')]));function closeInteractions(){var _0x5cc253=0x0;var _0x266796=[];return db[_0xa0b8('0x9')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x5b0cd8){_0x5cc253=_0x5b0cd8[_0xa0b8('0xa')];if(_0x5cc253){return db[_0xa0b8('0xb')][_0xa0b8('0xc')]({'raw':!![],'attributes':['id',_0xa0b8('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x5b0cd8[_0xa0b8('0xa')],_0xa0b8('0xe'))}}});}else{return[];}})[_0xa0b8('0xf')](function(_0x36fafa){if(_0x36fafa&&_0x36fafa[_0xa0b8('0x10')]){_0x266796=_[_0xa0b8('0x11')](_0x36fafa||[],'id');logger['info'](_0xa0b8('0x12'),_0x266796[_0xa0b8('0x13')]());return db[_0xa0b8('0xb')][_0xa0b8('0x14')]({'closeReason':_0xa0b8('0x15'),'disposition':_0xa0b8('0x16'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x266796}});}})['then'](function(){if(_0x266796&&_0x266796[_0xa0b8('0x10')]){logger[_0xa0b8('0x17')](_0xa0b8('0x18'),_0x266796[_0xa0b8('0x13')]());for(var _0x48f0f9=0x0;_0x48f0f9<_0x266796['length'];_0x48f0f9++){io[_0xa0b8('0x19')](_0xa0b8('0x1a'),{'id':_0x266796[_0x48f0f9],'closed':!![]});}}})[_0xa0b8('0x1b')](function(_0x5d0d05){logger[_0xa0b8('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x5d0d05?util[_0xa0b8('0x1d')](_0x5d0d05,{'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 1d34de3..42c12ab 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 _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 +var _0x4bf6=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x4ff2a7,_0x46fbd1){var _0x562f6e=function(_0x3ad5de){while(--_0x3ad5de){_0x4ff2a7['push'](_0x4ff2a7['shift']());}};_0x562f6e(++_0x46fbd1);}(_0x4bf6,0x1a0));var _0x64bf=function(_0x43907e,_0x15567c){_0x43907e=_0x43907e-0x0;var _0x476a21=_0x4bf6[_0x43907e];return _0x476a21;};'use strict';function start(){var _0x48082c=require(_0x64bf('0x0'));return _0x48082c[_0x64bf('0x1')]();}module[_0x64bf('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 d4e9ad0..0cf7767 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 _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 +var _0xd1cd=['isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','then','CustomReportId','exec\x20custom\x20report\x20id:%s','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','deleteJob','toRun','index','resolve','run\x20job','cron','active','isBetween','startAt','add','start','add\x20cron','stop','endAt','update','update\x20cron','stop\x20cron','run','util','path','lodash','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','format','MailAccount','name','Smtp','user','bcc','subtractNumber','subtractUnit','join','../../files/reports','%s.%s','basename','savename','extname','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','email\x20sent','catch'];(function(_0x55cc58,_0x5ce0af){var _0x26062e=function(_0x59e29d){while(--_0x59e29d){_0x55cc58['push'](_0x55cc58['shift']());}};_0x26062e(++_0x5ce0af);}(_0xd1cd,0x127));var _0xdd1c=function(_0xf5c773,_0x2d5fcc){_0xf5c773=_0xf5c773-0x0;var _0x20ff9b=_0xd1cd[_0xf5c773];return _0x20ff9b;};'use strict';var fs=require('fs');var util=require(_0xdd1c('0x0'));var path=require(_0xdd1c('0x1'));var _=require(_0xdd1c('0x2'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0xdd1c('0x3'));var BPromise=require(_0xdd1c('0x4'));var logger=require(_0xdd1c('0x5'))(_0xdd1c('0x6'));var db=require(_0xdd1c('0x7'))['db'];var analyticCustomReportController=require(_0xdd1c('0x8'));var analyticDefaultReportController=require(_0xdd1c('0x9'));var client=jayson[_0xdd1c('0xa')][_0xdd1c('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5ae3c4,_0xa56674){return function(){logger[_0xdd1c('0xc')](_0xdd1c('0xd'),_0x5ae3c4[_0xdd1c('0xe')]);var _0x38e2bc=!![];var _0x1c86e6=_0x5ae3c4['MailAccount']['getSmtpOptions']();var _0x5d77c6={'account':_0x1c86e6,'message':{'from':util[_0xdd1c('0xf')]('\x22%s\x22\x20<%s>',_0x5ae3c4[_0xdd1c('0x10')][_0xdd1c('0x11')],_0x5ae3c4[_0xdd1c('0x10')][_0xdd1c('0xe')]||_0x5ae3c4['MailAccount'][_0xdd1c('0x12')][_0xdd1c('0x13')]),'to':_0x5ae3c4['email'],'cc':_0x5ae3c4['cc'],'bcc':_0x5ae3c4[_0xdd1c('0x14')],'subject':util[_0xdd1c('0xf')]('Report\x20%s\x20last\x20%s\x20%s',_0xa56674['name'],_0x5ae3c4[_0xdd1c('0x15')],_0x5ae3c4[_0xdd1c('0x16')])}};var _0x48debc=path[_0xdd1c('0x17')](__dirname,_0xdd1c('0x18'));var _0x20bb89=_0xa56674['savename'];var _0x29dcc9=util[_0xdd1c('0xf')](_0xdd1c('0x19'),path[_0xdd1c('0x1a')](_0xa56674[_0xdd1c('0x1b')],path[_0xdd1c('0x1c')](_0xa56674['savename'])),_0xdd1c('0x1d'));var _0x313637=path['join'](_0x48debc,_0x20bb89);var _0x338175=path[_0xdd1c('0x17')](_0x48debc,_0x29dcc9);if(fs[_0xdd1c('0x1e')](_0x313637)){_0xa56674[_0xdd1c('0x1f')]=_0xdd1c('0x20');_0x5d77c6[_0xdd1c('0x21')][_0xdd1c('0x22')]=[{'filename':_0x20bb89,'path':_0x313637}];_0x5d77c6[_0xdd1c('0x21')][_0xdd1c('0x23')]=util[_0xdd1c('0xf')](_0xdd1c('0x24'),JSON[_0xdd1c('0x25')](_0xa56674,null,0x2));}else if(fs[_0xdd1c('0x1e')](_0x338175)){_0xa56674[_0xdd1c('0x1f')]=_0xdd1c('0x20');_0x5d77c6['message'][_0xdd1c('0x22')]=[{'filename':_0x29dcc9,'path':_0x338175}];}else{_0x5d77c6['message'][_0xdd1c('0x23')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x5ae3c4['sendIfEmpty']){_0x38e2bc=![];logger[_0xdd1c('0xc')](_0xdd1c('0x26'));}}if(_0x38e2bc){return client[_0xdd1c('0x27')](_0xdd1c('0x28'),_0x5d77c6)['then'](function(_0x31953f){if(_0x31953f[_0xdd1c('0x29')]){return logger['error'](_0xdd1c('0x2a'),JSON[_0xdd1c('0x25')](_0x31953f));}return logger[_0xdd1c('0xc')](_0xdd1c('0x2b'));})[_0xdd1c('0x2c')](function(_0x765e62){return logger[_0xdd1c('0x29')](_0xdd1c('0x2a'),JSON[_0xdd1c('0x25')](_0x765e62));});}};}function handleError(){return function(_0x4be5f3){return logger[_0xdd1c('0x29')](JSON[_0xdd1c('0x25')](_0x4be5f3));};}function handleResult(_0xec1a81){return function(_0xb5d7dd){logger[_0xdd1c('0xc')]('data',JSON[_0xdd1c('0x25')](_0xb5d7dd));if(_0xec1a81[_0xdd1c('0x10')]&&_0xec1a81[_0xdd1c('0x10')][_0xdd1c('0x12')]&&!_['isNil'](_0xec1a81['email'])){setTimeout(handleSendEmail(_0xec1a81,_0xb5d7dd),0x3c*0x3e8);}};}function handleJob(_0x57e6fa){return function(){try{if(_[_0xdd1c('0x2d')](_0x57e6fa['subtractNumber'])){return logger[_0xdd1c('0xc')](_0xdd1c('0x2e'));}if(_[_0xdd1c('0x2d')](_0x57e6fa[_0xdd1c('0x16')])){return logger[_0xdd1c('0xc')](_0xdd1c('0x2f'));}var _0x23e482={'startDate':moment()['subtract'](_0x57e6fa['subtractNumber'],_0x57e6fa['subtractUnit'])['format'](_0xdd1c('0x30')),'endDate':moment()['format'](_0xdd1c('0x30')),'type':_0xdd1c('0x31'),'output':_0x57e6fa['output'],'name':_0x57e6fa[_0xdd1c('0x11')]};if(!_[_0xdd1c('0x2d')](_0x57e6fa[_0xdd1c('0x32')])){logger[_0xdd1c('0xc')](_0xdd1c('0x33'),_0x57e6fa[_0xdd1c('0x32')]);return analyticDefaultReportController['runReport']({'id':_0x57e6fa['DefaultReportId']},_0x23e482)[_0xdd1c('0x34')](handleResult(_0x57e6fa))[_0xdd1c('0x2c')](handleError());}if(!_[_0xdd1c('0x2d')](_0x57e6fa[_0xdd1c('0x35')])){logger[_0xdd1c('0xc')](_0xdd1c('0x36'),_0x57e6fa[_0xdd1c('0x35')]);return analyticCustomReportController['runReport']({'id':_0x57e6fa[_0xdd1c('0x35')]},_0x23e482)[_0xdd1c('0x34')](handleResult(_0x57e6fa))[_0xdd1c('0x2c')](handleError());}}catch(_0x524024){logger[_0xdd1c('0x29')](JSON['stringify'](_0x524024));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x12f3bb){var _0x222236={};if(_0x12f3bb){_0x222236['id']=_0x12f3bb;}return db['Schedule'][_0xdd1c('0x37')]({'where':_0x222236,'include':[{'model':db[_0xdd1c('0x10')],'attributes':['id',_0xdd1c('0x11'),_0xdd1c('0xe')],'include':[{'model':db[_0xdd1c('0x38')],'as':_0xdd1c('0x12'),'include':[{'model':db[_0xdd1c('0x39')],'as':_0xdd1c('0x39')}]}]}]})[_0xdd1c('0x34')](function(_0x1ad27c){var _0x4dcfc6=_[_0xdd1c('0x3a')](manager[_0xdd1c('0x3b')]);var _0x9780ca=_[_0xdd1c('0x3c')](_0x1ad27c,function(_0x234ed0){return _0x234ed0['id'][_0xdd1c('0x3d')]();});var _0x1793e2=_[_0xdd1c('0x3e')](_0x1ad27c,function(_0x404774){return _0x404774['id'][_0xdd1c('0x3d')]();});var _0x46990d=_0x12f3bb?_0x9780ca:_[_0xdd1c('0x3f')](_0x9780ca,_0x4dcfc6);var _0x220b10=_[_0xdd1c('0x40')](_0x9780ca,_0x4dcfc6);var _0x1fc05f=_['difference'](_0x4dcfc6,_0x9780ca);var _0x3a84ad;var _0x478cfc;for(_0x3a84ad=0x0;_0x3a84ad<_0x1fc05f[_0xdd1c('0x41')]&&!_0x12f3bb;_0x3a84ad+=0x1){_0x478cfc=_0x1fc05f[_0x3a84ad]['toString']();if(manager[_0xdd1c('0x42')](_0x478cfc)){manager['stop'](_0x478cfc);manager[_0xdd1c('0x43')](_0x478cfc);logger['info']('delete\x20cron',_0x478cfc);}}logger[_0xdd1c('0xc')](_0xdd1c('0x44'),JSON[_0xdd1c('0x25')](_0x46990d));for(_0x3a84ad=0x0;_0x3a84ad<_0x46990d['length'];_0x3a84ad+=0x1){_0x478cfc=_0x46990d[_0x3a84ad]['toString']();logger[_0xdd1c('0xc')](_0xdd1c('0x45'),_0x478cfc);if(_0x12f3bb){logger[_0xdd1c('0xc')]('my\x20id',_0x12f3bb);logger[_0xdd1c('0xc')](JSON['stringify'](_0x1793e2[_0x478cfc]));BPromise[_0xdd1c('0x46')]()[_0xdd1c('0x34')](handleJob(_0x1793e2[_0x478cfc]));logger[_0xdd1c('0xc')](_0xdd1c('0x47'),_0x1793e2[_0x478cfc][_0xdd1c('0x11')],_0x1793e2[_0x478cfc][_0xdd1c('0x48')]);}else if(_0x1793e2[_0x478cfc][_0xdd1c('0x48')]&&_0x1793e2[_0x478cfc][_0xdd1c('0x49')]&&moment()[_0xdd1c('0x4a')](_0x1793e2[_0x478cfc][_0xdd1c('0x4b')],_0x1793e2[_0x478cfc]['endAt'])){manager[_0xdd1c('0x4c')](_0x478cfc,_0x1793e2[_0x478cfc][_0xdd1c('0x48')],handleJob(_0x1793e2[_0x478cfc]));manager[_0xdd1c('0x4d')](_0x478cfc);logger[_0xdd1c('0xc')](_0xdd1c('0x4e'),_0x1793e2[_0x478cfc][_0xdd1c('0x11')],_0x1793e2[_0x478cfc][_0xdd1c('0x48')]);}else if(manager['exists'](_0x478cfc)){manager[_0xdd1c('0x4f')](_0x478cfc);manager[_0xdd1c('0x43')](_0x478cfc);logger[_0xdd1c('0xc')]('stop\x20cron',_0x1793e2[_0x478cfc][_0xdd1c('0x11')],_0x1793e2[_0x478cfc][_0xdd1c('0x48')]);}}for(_0x3a84ad=0x0,_0x478cfc;_0x3a84ad<_0x220b10['length']&&!_0x12f3bb;_0x3a84ad+=0x1){_0x478cfc=_0x220b10[_0x3a84ad][_0xdd1c('0x3d')]();if(manager[_0xdd1c('0x42')](_0x478cfc)){if(_0x1793e2[_0x478cfc][_0xdd1c('0x48')]&&_0x1793e2[_0x478cfc][_0xdd1c('0x49')]&&moment()[_0xdd1c('0x4a')](_0x1793e2[_0x478cfc][_0xdd1c('0x4b')],_0x1793e2[_0x478cfc][_0xdd1c('0x50')])){manager[_0xdd1c('0x51')](_0x478cfc,_0x1793e2[_0x478cfc]['cron'],handleJob(_0x1793e2[_0x478cfc]));logger['info'](_0xdd1c('0x52'),_0x1793e2[_0x478cfc]['name'],_0x1793e2[_0x478cfc][_0xdd1c('0x48')]);}else{manager[_0xdd1c('0x4f')](_0x478cfc);manager[_0xdd1c('0x43')](_0x478cfc);logger[_0xdd1c('0xc')](_0xdd1c('0x53'),_0x1793e2[_0x478cfc][_0xdd1c('0x11')],_0x1793e2[_0x478cfc][_0xdd1c('0x48')]);}}}})[_0xdd1c('0x2c')](function(_0x834c03){logger[_0xdd1c('0x29')](JSON[_0xdd1c('0x25')](_0x834c03));});}exports[_0xdd1c('0x54')]=function(_0x19a8fe){return getJobs(_0x19a8fe);};exports[_0xdd1c('0x4d')]=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 b806393..3a69a41 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 _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 +var _0xd136=['inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','findOne','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','all','error','start','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','substring','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','info','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis'];(function(_0x5e5671,_0x457d56){var _0x3035f8=function(_0x3397e4){while(--_0x3397e4){_0x5e5671['push'](_0x5e5671['shift']());}};_0x3035f8(++_0x457d56);}(_0xd136,0x94));var _0x6d13=function(_0x59b649,_0x267783){_0x59b649=_0x59b649-0x0;var _0x488069=_0xd136[_0x59b649];return _0x488069;};var _=require('lodash');var AWS=require(_0x6d13('0x0'));var rp=require(_0x6d13('0x1'));var util=require('util');var BPromise=require(_0x6d13('0x2'));var db=require(_0x6d13('0x3'))['db'];var logger=require(_0x6d13('0x4'))(_0x6d13('0x5'));function getTranscriptionJob(_0xec09ab,_0x387947,_0x276099,_0x18fa4f){return new Promise(function(_0x147026,_0x4aabef){var _0x335482=new AWS[(_0x6d13('0x6'))]({'accessKeyId':_0x387947,'secretAccessKey':_0xec09ab,'region':_0x276099});_0x335482['getTranscriptionJob']({'TranscriptionJobName':_0x18fa4f},function(_0x598021,_0x1af16f){if(_0x598021){return _0x4aabef(_0x598021);}else{return _0x147026(_0x1af16f);}});});}function sentiment(_0x1f7d07,_0x240dba,_0x2216d7,_0x5c8282,_0x4f494b){return new Promise(function(_0x1a3613,_0x600fa9){var _0x1cf1e1=new AWS['Comprehend']({'accessKeyId':_0x240dba,'secretAccessKey':_0x1f7d07,'region':_0x2216d7});_0x1cf1e1['detectSentiment']({'Text':_0x5c8282,'LanguageCode':_0x4f494b[_0x6d13('0x7')](0x0,0x2)},function(_0x2a2120,_0x28fe97){if(_0x2a2120){return _0x600fa9(_0x2a2120);}else{return _0x1a3613(_0x28fe97);}});});}function checkTranscribeJob(_0x47d637,_0x1b4cc3,_0x5ef7e6){var _0x37d3c1;return new BPromise(function(_0x2b53e8,_0x5a07f8){logger['info'](util['format'](_0x6d13('0x8'),_0x47d637['id'],_0x47d637[_0x6d13('0x9')]));return getTranscriptionJob(_0x5ef7e6[_0x6d13('0xa')],_0x5ef7e6[_0x6d13('0xb')],_0x1b4cc3[_0x6d13('0xc')],_0x47d637['transcribeName'])[_0x6d13('0xd')](function(_0x405368){logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x10'),_0x47d637['id'],_0x47d637[_0x6d13('0x9')],_0x405368[_0x6d13('0x11')][_0x6d13('0x12')]));if(!_0x47d637[_0x6d13('0x13')]){switch(_0x405368['TranscriptionJob'][_0x6d13('0x12')]){case _0x6d13('0x14'):var _0x78eef7={'transcribeStatus':_0x405368[_0x6d13('0x11')][_0x6d13('0x12')],'fileUri':_0x405368[_0x6d13('0x11')][_0x6d13('0x15')][_0x6d13('0x16')]};logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x17'),_0x47d637['id']));return rp({'uri':_0x405368[_0x6d13('0x11')][_0x6d13('0x15')][_0x6d13('0x16')],'json':!![]})[_0x6d13('0xd')](function(_0x208876){logger['info'](util[_0x6d13('0xf')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x47d637['id']));if(_0x208876&&_0x208876[_0x6d13('0x18')]&&_0x208876[_0x6d13('0x18')][_0x6d13('0x19')]&&_0x208876['results'][_0x6d13('0x19')][_0x6d13('0x1a')]){_0x78eef7[_0x6d13('0x13')]='';for(var _0x4366a0=0x0;_0x4366a0<_0x208876[_0x6d13('0x18')][_0x6d13('0x19')][_0x6d13('0x1a')];_0x4366a0++){_0x78eef7[_0x6d13('0x13')]+=_0x208876['results'][_0x6d13('0x19')][_0x4366a0]['transcript']+'';}}return _0x47d637['update'](_0x78eef7);})[_0x6d13('0xd')](function(){logger['info'](util[_0x6d13('0xf')](_0x6d13('0x1b'),_0x47d637['id']));if(!_0x47d637[_0x6d13('0x1c')]){throw new db['Sequelize'][(_0x6d13('0x1d'))](_0x6d13('0x1e'));}if(!_0x1b4cc3['sentiment']||!_0x1b4cc3[_0x6d13('0x1f')]||!_0x1b4cc3[_0x6d13('0x20')]||!_0x1b4cc3[_0x6d13('0x21')]||!_0x1b4cc3[_0x6d13('0x22')]){throw new db[(_0x6d13('0x23'))][(_0x6d13('0x1d'))](_0x6d13('0x24'));}if(!_0x78eef7[_0x6d13('0x13')]){throw new Error('Transcript\x20not\x20available');}if(_0x1b4cc3[_0x6d13('0x1f')]===_0x5ef7e6['id']){return _0x5ef7e6;}else{return db[_0x6d13('0x25')]['findOne']({'where':{'id':_settings[_0x6d13('0x1f')]}});}})[_0x6d13('0xd')](function(_0x19eb67){if(!_0x19eb67){throw new db['Sequelize'][(_0x6d13('0x1d'))](_0x6d13('0x26'));}if(!_0x19eb67[_0x6d13('0xa')]||!_0x19eb67[_0x6d13('0xb')]){throw new db[(_0x6d13('0x23'))][(_0x6d13('0x1d'))](_0x6d13('0x27'));}_0x37d3c1=_0x19eb67;logger['info'](util[_0x6d13('0xf')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x47d637['id']));return sentiment(_0x37d3c1[_0x6d13('0xa')],_0x37d3c1[_0x6d13('0xb')],_0x1b4cc3[_0x6d13('0x20')],_0x78eef7[_0x6d13('0x13')],_0x1b4cc3[_0x6d13('0x21')]);})[_0x6d13('0xd')](function(_0x4d7223){logger['info'](util[_0x6d13('0xf')](_0x6d13('0x28'),_0x47d637['id']));return _0x47d637[_0x6d13('0x29')]({'sentiment':_0x4d7223[_0x6d13('0x2a')],'sPositive':_0x4d7223[_0x6d13('0x2b')][_0x6d13('0x2c')],'sNegative':_0x4d7223['SentimentScore'][_0x6d13('0x2d')],'sMixed':_0x4d7223[_0x6d13('0x2b')][_0x6d13('0x2e')],'sNeutral':_0x4d7223[_0x6d13('0x2b')][_0x6d13('0x2f')]});})[_0x6d13('0xd')](function(){logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x1b'),_0x47d637['id']));_0x2b53e8();});case _0x6d13('0x30'):return _0x47d637['update']({'transcribeStatus':'FAILED','failureReason':_0x405368[_0x6d13('0x11')]['FailureReason']})['then'](function(){logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x1b'),_0x47d637['id']));_0x2b53e8();});default:logger['info'](util[_0x6d13('0xf')](_0x6d13('0x31'),_0x47d637['id']));break;}}else{return BPromise[_0x6d13('0x32')]()['then'](function(){if(!_0x47d637[_0x6d13('0x1c')]){throw new db['Sequelize'][(_0x6d13('0x1d'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1b4cc3['sentiment']||!_0x1b4cc3[_0x6d13('0x1f')]||!_0x1b4cc3[_0x6d13('0x20')]||!_0x1b4cc3['language']||!_0x1b4cc3['bucket']){throw new db[(_0x6d13('0x23'))][(_0x6d13('0x1d'))](_0x6d13('0x24'));}if(!_0x47d637[_0x6d13('0x13')]){throw new Error('Transcript\x20not\x20available');}if(_0x1b4cc3[_0x6d13('0x1f')]===_0x5ef7e6['id']){return _0x5ef7e6;}else{return db[_0x6d13('0x25')]['findOne']({'where':{'id':_settings[_0x6d13('0x1f')]}});}})[_0x6d13('0xd')](function(_0x42a347){if(!_0x42a347){throw new db[(_0x6d13('0x23'))][(_0x6d13('0x1d'))](_0x6d13('0x26'));}if(!_0x42a347[_0x6d13('0xa')]||!_0x42a347['data2']){throw new db[(_0x6d13('0x23'))][(_0x6d13('0x1d'))](_0x6d13('0x27'));}_0x37d3c1=_0x42a347;logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x33'),_0x47d637['id']));return sentiment(_0x37d3c1[_0x6d13('0xa')],_0x37d3c1['data2'],_0x1b4cc3[_0x6d13('0x20')],_0x47d637['fileText'],_0x1b4cc3[_0x6d13('0x21')]);})[_0x6d13('0xd')](function(_0x223b03){logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x28'),_0x47d637['id']));return _0x47d637[_0x6d13('0x29')]({'sentiment':_0x223b03[_0x6d13('0x2a')],'sPositive':_0x223b03['SentimentScore'][_0x6d13('0x2c')],'sNegative':_0x223b03['SentimentScore'][_0x6d13('0x2d')],'sMixed':_0x223b03[_0x6d13('0x2b')][_0x6d13('0x2e')],'sNeutral':_0x223b03[_0x6d13('0x2b')][_0x6d13('0x2f')],'transcribeStatus':_0x6d13('0x14')});})[_0x6d13('0xd')](function(){logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x1b'),_0x47d637['id']));_0x2b53e8();});}})[_0x6d13('0x34')](function(_0x479b50){if(_0x479b50){if(!_0x479b50[_0x6d13('0x35')]||_0x479b50[_0x6d13('0x35')]!==_0x6d13('0x36')){logger['error'](util['format'](_0x6d13('0x37'),_0x47d637['id']),util[_0x6d13('0x38')](_0x479b50,{'showHidden':![],'depth':null}));}}_0x2b53e8();});});}function checkTranscribe(){var _0x2492b5;var _0x5b00c6;var _0x3ac978;return db[_0x6d13('0x39')][_0x6d13('0x3a')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x6d13('0xd')](function(_0x122adb){if(!_0x122adb||!_0x122adb['length']){throw new db['Sequelize'][(_0x6d13('0x1d'))](_0x6d13('0x3b'));}_0x2492b5=_0x122adb;return db[_0x6d13('0x3c')][_0x6d13('0x3d')]({'where':{'id':0x1}});})[_0x6d13('0xd')](function(_0x3d3244){if(!_0x3d3244){throw new db['Sequelize']['ValidationError'](_0x6d13('0x3e'));}_0x5b00c6=_0x3d3244;if(!_0x5b00c6[_0x6d13('0x5')]||!_0x5b00c6[_0x6d13('0x3f')]||!_0x5b00c6[_0x6d13('0xc')]||!_0x5b00c6[_0x6d13('0x21')]||!_0x5b00c6['bucket']){throw new db[(_0x6d13('0x23'))]['ValidationError'](_0x6d13('0x40'));}return db[_0x6d13('0x25')][_0x6d13('0x3d')]({'where':{'id':_0x5b00c6['transcribeAccountId']}});})[_0x6d13('0xd')](function(_0x53854e){if(!_0x53854e){throw new db['Sequelize'][(_0x6d13('0x1d'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x53854e[_0x6d13('0xa')]||!_0x53854e['data2']){throw new db[(_0x6d13('0x23'))]['ValidationError'](_0x6d13('0x27'));}_0x3ac978=_0x53854e;var _0x42f131=[];_0x2492b5['forEach'](function(_0x95e9c6){_0x42f131['push'](checkTranscribeJob(_0x95e9c6,_0x5b00c6,_0x3ac978));});return BPromise[_0x6d13('0x41')](_0x42f131);})[_0x6d13('0x34')](function(_0x2daf24){if(_0x2daf24){if(!_0x2daf24[_0x6d13('0x35')]||_0x2daf24['name']!==_0x6d13('0x36')){logger[_0x6d13('0x42')](util[_0x6d13('0x38')](_0x2daf24,{'showHidden':![],'depth':null}));}}});}exports[_0x6d13('0x43')]=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 7204860..68a0c74 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 _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 +var _0x1f2d=['error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x1f2d,0x1c4));var _0xd1f2=function(_0xa4c85,_0x2b52a7){_0xa4c85=_0xa4c85-0x0;var _0x172c1f=_0x1f2d[_0xa4c85];return _0x172c1f;};'use strict';var _=require(_0xd1f2('0x0'));var moment=require(_0xd1f2('0x1'));var Redis=require(_0xd1f2('0x2'));var util=require(_0xd1f2('0x3'));var config=require('../../config/environment');var db=require(_0xd1f2('0x4'))['db'];var logger=require(_0xd1f2('0x5'))(_0xd1f2('0x6'));config[_0xd1f2('0x7')]=_[_0xd1f2('0x8')](config[_0xd1f2('0x7')],{'host':_0xd1f2('0x9'),'port':0x18eb});var io=require(_0xd1f2('0xa'))(new Redis(config[_0xd1f2('0x7')]));function closeInteractions(){var _0x3a30cd=[];return db[_0xd1f2('0xb')][_0xd1f2('0xc')]({'raw':!![],'attributes':['id',_0xd1f2('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xd1f2('0xe')](0x18,_0xd1f2('0xf'))}}})[_0xd1f2('0x10')](function(_0x42014c){if(_0x42014c&&_0x42014c['length']){_0x3a30cd=_[_0xd1f2('0x11')](_0x42014c||[],'id');logger[_0xd1f2('0x12')](_0xd1f2('0x13'),_0x3a30cd[_0xd1f2('0x14')]());return db['WhatsappInteraction'][_0xd1f2('0x15')]({'closeReason':_0xd1f2('0x16'),'disposition':_0xd1f2('0x17'),'closed':!![],'closedAt':moment()['format'](_0xd1f2('0x18'))},{'where':{'id':_0x3a30cd}});}})[_0xd1f2('0x10')](function(){if(_0x3a30cd&&_0x3a30cd[_0xd1f2('0x19')]){logger[_0xd1f2('0x12')](_0xd1f2('0x1a'),_0x3a30cd[_0xd1f2('0x14')]());for(var _0x2def2b=0x0;_0x2def2b<_0x3a30cd['length'];_0x2def2b++){io[_0xd1f2('0x1b')]('whatsappInteraction:update',{'id':_0x3a30cd[_0x2def2b],'closed':!![]});}}})['catch'](function(_0x487bac){logger[_0xd1f2('0x1c')](_0xd1f2('0x1d'),_0x487bac?util[_0xd1f2('0x1e')](_0x487bac,{'showHidden':![],'depth':null}):'');});}exports[_0xd1f2('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 bc527f8..2f11a4f 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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 +var _0xd2c7=['../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','then','CmContact','bulkCreate','log','finished\x20populating','contacts1','CmHopper','destroy','hopper1','contacts2','catch','util'];(function(_0x3ec0e9,_0x35ac39){var _0x1c5d9b=function(_0x44598f){while(--_0x44598f){_0x3ec0e9['push'](_0x3ec0e9['shift']());}};_0x1c5d9b(++_0x35ac39);}(_0xd2c7,0xc5));var _0x7d2c=function(_0x94189,_0x302a24){_0x94189=_0x94189-0x0;var _0x7bcba0=_0xd2c7[_0x94189];return _0x7bcba0;};'use strict';var util=require(_0x7d2c('0x0'));var db=require(_0x7d2c('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x7d2c('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x7d2c('0x3')+i,'phone':0xf879fb460+i,'email':_0x7d2c('0x4')+i+_0x7d2c('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x7d2c('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x7d2c('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7d2c('0x6')](),'updatedAt':Date[_0x7d2c('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x7d2c('0x4')+i+_0x7d2c('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x7d2c('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x7d2c('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7d2c('0x6')](),'updatedAt':Date[_0x7d2c('0x6')]()});}db['CmContact']['destroy']({'where':{}})[_0x7d2c('0x7')](function(){return db[_0x7d2c('0x8')][_0x7d2c('0x9')](contacts);})[_0x7d2c('0x7')](function(){console[_0x7d2c('0xa')](_0x7d2c('0xb'),_0x7d2c('0xc'));return db[_0x7d2c('0xd')][_0x7d2c('0xe')]({'where':{}});})[_0x7d2c('0x7')](function(){return db[_0x7d2c('0xd')][_0x7d2c('0x9')](hopper);})['then'](function(){console[_0x7d2c('0xa')]('finished\x20populating',_0x7d2c('0xf'));return db[_0x7d2c('0x8')][_0x7d2c('0x9')](contacts2);})['then'](function(){console['log'](_0x7d2c('0xb'),_0x7d2c('0x10'));return db[_0x7d2c('0xd')][_0x7d2c('0x9')](hopper2);})[_0x7d2c('0x7')](function(){console['log']('finished\x20populating','hopper2');})[_0x7d2c('0x11')](function(_0x6f48af){console[_0x7d2c('0xa')](_0x6f48af);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 7a6e9db..6ff6b9f 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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 +var _0xa035=['User','bulkCreate','then','add\x20user','catch','log','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>'];(function(_0x1d9283,_0x2f3703){var _0x4b3d9f=function(_0xd839c2){while(--_0xd839c2){_0x1d9283['push'](_0x1d9283['shift']());}};_0x4b3d9f(++_0x2f3703);}(_0xa035,0xf8));var _0x5a03=function(_0xc65f44,_0x191a08){_0xc65f44=_0xc65f44-0x0;var _0x5a7f9a=_0xa035[_0xc65f44];return _0x5a7f9a;};'use strict';var util=require(_0x5a03('0x0'));var db=require(_0x5a03('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x5a03('0x2')]({'name':util[_0x5a03('0x3')](_0x5a03('0x4'),_0x5a03('0x5'),i),'fullname':util[_0x5a03('0x3')](_0x5a03('0x4'),'agent',i),'email':util[_0x5a03('0x3')](_0x5a03('0x6'),_0x5a03('0x5'),i),'role':_0x5a03('0x5'),'password':_0x5a03('0x7'),'internal':0xfa0+i,'type':_0x5a03('0x8'),'transport':[_0x5a03('0x9'),'ws',_0x5a03('0xa')],'disallow':['all'],'allow':[_0x5a03('0xb')],'defaultuser':util[_0x5a03('0x3')](_0x5a03('0x4'),'agent',i),'encryption':'yes','avpf':_0x5a03('0xc'),'force_avp':'yes','icesupport':_0x5a03('0xc'),'dtlsenable':_0x5a03('0xc'),'dtlsverify':'no','dtlscertfile':_0x5a03('0xd'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x5a03('0xe'),'callerid':util[_0x5a03('0x3')](_0x5a03('0xf'),util[_0x5a03('0x3')](_0x5a03('0x4'),_0x5a03('0x5'),i),0xfa0+i)});}db[_0x5a03('0x10')][_0x5a03('0x11')](users)[_0x5a03('0x12')](function(){console['log'](_0x5a03('0x13'));})[_0x5a03('0x14')](function(_0x37f09f){console[_0x5a03('0x15')](_0x37f09f);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 863cdf6..2d46d03 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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 +var _0x87bc=['resourceId','User','where','role','Campaign','type','format','%s:queue:%s','length','query','find','handshake','ChatInteraction','ChatInteractions','MailInteraction','SmsInteraction','SmsInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','userProfileId','ChatQueues','WhatsappQueue','Telephones','Trunks','agent','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','user_has_mail_interactions:remove','FaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','connection','setMaxListeners','address','request','remotePort','connectedAt','log','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','lodash','util','../mysqldb','Agents','name','telephone','ivr','UserProfileSection','findOne','then','autoAssociation','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','IvrCampaigns','UserProfileResource','map'];(function(_0x375492,_0x4ed149){var _0x18ba5b=function(_0x154a12){while(--_0x154a12){_0x375492['push'](_0x375492['shift']());}};_0x18ba5b(++_0x4ed149);}(_0x87bc,0x189));var _0xc87b=function(_0x47944c,_0x94cd2d){_0x47944c=_0x47944c-0x0;var _0x451f93=_0x87bc[_0x47944c];return _0x451f93;};'use strict';var _=require(_0xc87b('0x0'));var util=require(_0xc87b('0x1'));var BPromise=require('bluebird');var db=require(_0xc87b('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0xc87b('0x3'),'model':db['User'],'attributes':['id',_0xc87b('0x4'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xc87b('0x5')}};var queryTrunks={'raw':!![],'attributes':['id',_0xc87b('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xc87b('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name','type'],'where':{'type':_0xc87b('0x6')}};function getAssociatedResources(_0x169bbb,_0x1144cc,_0x19b571){return db[_0xc87b('0x7')][_0xc87b('0x8')]({'where':{'name':_0x169bbb,'userProfileId':_0x1144cc},'raw':!![]})[_0xc87b('0x9')](function(_0x1d834a){if(_0x1d834a){if(_0x1d834a[_0xc87b('0xa')]){switch(_0x169bbb){case'VoiceQueues':case'ChatQueues':case _0xc87b('0xb'):case'SmsQueues':case _0xc87b('0xc'):case _0xc87b('0xd'):case _0xc87b('0xe'):return db[_0x19b571][_0xc87b('0xf')](queryQueues);case'Telephones':return db[_0x19b571][_0xc87b('0xf')](queryTelephones);case'Trunks':return db[_0x19b571][_0xc87b('0xf')](queryTrunks);case _0xc87b('0x10'):return db[_0x19b571]['findAll'](queryCampaigns);}}else{return db[_0xc87b('0x11')][_0xc87b('0xf')]({'attributes':['resourceId'],'where':{'sectionId':_0x1d834a['id']},'raw':!![]})[_0xc87b('0x9')](function(_0x21f1d1){if(_0x21f1d1){var _0x34195e={'where':{'id':_[_0xc87b('0x12')](_0x21f1d1,_0xc87b('0x13'))},'raw':!![]};switch(_0x19b571){case _0xc87b('0x14'):_0x34195e[_0xc87b('0x15')][_0xc87b('0x16')]='telephone';break;case _0xc87b('0x17'):_0x34195e['where'][_0xc87b('0x18')]=_0xc87b('0x6');break;}return db[_0x19b571]['findAll'](_0x34195e);}else{return[];}});}}else{return[];}})[_0xc87b('0x9')](function(_0x372665){return _0x372665;});}function joinOrLeaveQueues(_0x4f56a0,_0x35b58f,_0x4cceeb,_0x36c8c4){_0x4f56a0[_0x35b58f](util[_0xc87b('0x19')](_0xc87b('0x1a'),_0x4cceeb,_0x36c8c4[_0xc87b('0x4')]));if(_0x36c8c4[_0xc87b('0x3')]){for(var _0x211b3c=0x0;_0x211b3c<_0x36c8c4[_0xc87b('0x3')][_0xc87b('0x1b')];_0x211b3c+=0x1){_0x4f56a0[_0x35b58f](util[_0xc87b('0x19')]('user:%s',_0x36c8c4[_0xc87b('0x3')][_0x211b3c]['name']));}}}function joinOrLeave(_0x3c6d50,_0x42d099,_0x147731){var _0x4bff29;if(_0x3c6d50['handshake'][_0xc87b('0x1c')]['id']){db[_0xc87b('0x14')][_0xc87b('0x1d')]({'attributes':['id',_0xc87b('0x4'),_0xc87b('0x16'),'userProfileId'],'where':{'id':_0x3c6d50[_0xc87b('0x1e')][_0xc87b('0x1c')]['id']},'include':[{'model':db[_0xc87b('0x1f')],'as':_0xc87b('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0xc87b('0x21')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xc87b('0x22')],'as':_0xc87b('0x23'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xc87b('0x24')],'as':_0xc87b('0x25'),'attributes':['id'],'raw':!![]}]})[_0xc87b('0x9')](function(_0x4e02d7){if(_0x4e02d7){_0x4bff29=_0x4e02d7;_0x3c6d50[_0x42d099](util[_0xc87b('0x19')](_0xc87b('0x26'),_0x4e02d7[_0xc87b('0x4')]));var _0x4b1ac6=[];switch(_0x4e02d7[_0xc87b('0x16')]){case _0xc87b('0x27'):_0x3c6d50[_0x42d099](_0xc87b('0x28'));_0x3c6d50[_0x42d099](_0xc87b('0x29'));if(queryQueues[_0xc87b('0x2a')](_0xc87b('0x2b'))){delete queryQueues[_0xc87b('0x2b')];}_0x4b1ac6[_0xc87b('0x2c')](db[_0xc87b('0x2d')][_0xc87b('0xf')](queryQueues));_0x4b1ac6[_0xc87b('0x2c')](db[_0xc87b('0x2e')]['findAll'](queryQueues));_0x4b1ac6[_0xc87b('0x2c')](db[_0xc87b('0x2f')]['findAll'](queryQueues));_0x4b1ac6[_0xc87b('0x2c')](db[_0xc87b('0x30')][_0xc87b('0xf')](queryQueues));_0x4b1ac6['push'](db[_0xc87b('0x31')][_0xc87b('0xf')](queryQueues));_0x4b1ac6[_0xc87b('0x2c')](db[_0xc87b('0x32')][_0xc87b('0xf')](queryQueues));_0x4b1ac6['push'](db['WhatsappQueue'][_0xc87b('0xf')](queryQueues));_0x4b1ac6['push'](db[_0xc87b('0x14')][_0xc87b('0xf')](queryTelephones));_0x4b1ac6[_0xc87b('0x2c')](db[_0xc87b('0x33')]['findAll'](queryTrunks));_0x4b1ac6[_0xc87b('0x2c')](db[_0xc87b('0x17')][_0xc87b('0xf')](queryCampaigns));_0x4b1ac6[_0xc87b('0x2c')](db[_0xc87b('0x14')][_0xc87b('0xf')](queryAgents));break;case _0xc87b('0x34'):_0x3c6d50[_0x42d099]('voice:inbound');_0x3c6d50[_0x42d099](_0xc87b('0x29'));_0x4b1ac6['push'](getAssociatedResources('VoiceQueues',_0x4e02d7[_0xc87b('0x35')],_0xc87b('0x2d')));_0x4b1ac6[_0xc87b('0x2c')](getAssociatedResources(_0xc87b('0x36'),_0x4e02d7[_0xc87b('0x35')],_0xc87b('0x2e')));_0x4b1ac6['push'](getAssociatedResources(_0xc87b('0xb'),_0x4e02d7[_0xc87b('0x35')],_0xc87b('0x2f')));_0x4b1ac6[_0xc87b('0x2c')](getAssociatedResources('SmsQueues',_0x4e02d7[_0xc87b('0x35')],_0xc87b('0x30')));_0x4b1ac6[_0xc87b('0x2c')](getAssociatedResources(_0xc87b('0xc'),_0x4e02d7['userProfileId'],'MailQueue'));_0x4b1ac6['push'](getAssociatedResources(_0xc87b('0xd'),_0x4e02d7[_0xc87b('0x35')],'OpenchannelQueue'));_0x4b1ac6[_0xc87b('0x2c')](getAssociatedResources(_0xc87b('0xe'),_0x4e02d7[_0xc87b('0x35')],_0xc87b('0x37')));_0x4b1ac6[_0xc87b('0x2c')](getAssociatedResources(_0xc87b('0x38'),_0x4e02d7[_0xc87b('0x35')],_0xc87b('0x14')));_0x4b1ac6[_0xc87b('0x2c')](getAssociatedResources(_0xc87b('0x39'),_0x4e02d7[_0xc87b('0x35')],_0xc87b('0x33')));_0x4b1ac6[_0xc87b('0x2c')](getAssociatedResources(_0xc87b('0x10'),_0x4e02d7[_0xc87b('0x35')],'Campaign'));_0x4b1ac6[_0xc87b('0x2c')](db[_0xc87b('0x14')][_0xc87b('0xf')](queryAgents));break;case _0xc87b('0x3a'):_0x3c6d50[_0x42d099](_0xc87b('0x28'));_0x3c6d50[_0x42d099]('voice:outbound');_0x4b1ac6['push'](_0x4e02d7[_0xc87b('0x3b')]({'attributes':['id',_0xc87b('0x4')]}));_0x4b1ac6['push'](_0x4e02d7[_0xc87b('0x3c')]({'attributes':['id',_0xc87b('0x4')]}));_0x4b1ac6[_0xc87b('0x2c')](_0x4e02d7[_0xc87b('0x3d')]({'attributes':['id',_0xc87b('0x4')]}));_0x4b1ac6[_0xc87b('0x2c')](_0x4e02d7['getSmsQueues']({'attributes':['id','name']}));_0x4b1ac6[_0xc87b('0x2c')](_0x4e02d7[_0xc87b('0x3e')]({'attributes':['id',_0xc87b('0x4')]}));_0x4b1ac6[_0xc87b('0x2c')](_0x4e02d7[_0xc87b('0x3f')]({'attributes':['id',_0xc87b('0x4')]}));_0x4b1ac6[_0xc87b('0x2c')](_0x4e02d7[_0xc87b('0x40')]({'attributes':['id',_0xc87b('0x4')]}));break;}return BPromise[_0xc87b('0x41')](_0x4b1ac6);}})[_0xc87b('0x9')](function(_0x2fe333){if(_0x2fe333&&_0x2fe333[_0xc87b('0x1b')]){for(var _0x5ee6ea=0x0;_0x5ee6ea<_0x2fe333[_0xc87b('0x1b')];_0x5ee6ea+=0x1){for(var _0x3b6d31=0x0;_0x3b6d31<_0x2fe333[_0x5ee6ea]['length'];_0x3b6d31+=0x1){switch(_0x5ee6ea){case 0x0:joinOrLeaveQueues(_0x3c6d50,_0x42d099,_0xc87b('0x42'),_0x2fe333[_0x5ee6ea][_0x3b6d31]);break;case 0x1:joinOrLeaveQueues(_0x3c6d50,_0x42d099,_0xc87b('0x43'),_0x2fe333[_0x5ee6ea][_0x3b6d31]);break;case 0x2:joinOrLeaveQueues(_0x3c6d50,_0x42d099,_0xc87b('0x44'),_0x2fe333[_0x5ee6ea][_0x3b6d31]);break;case 0x3:joinOrLeaveQueues(_0x3c6d50,_0x42d099,_0xc87b('0x45'),_0x2fe333[_0x5ee6ea][_0x3b6d31]);break;case 0x4:joinOrLeaveQueues(_0x3c6d50,_0x42d099,_0xc87b('0x46'),_0x2fe333[_0x5ee6ea][_0x3b6d31]);break;case 0x5:joinOrLeaveQueues(_0x3c6d50,_0x42d099,_0xc87b('0x47'),_0x2fe333[_0x5ee6ea][_0x3b6d31]);break;case 0x6:joinOrLeaveQueues(_0x3c6d50,_0x42d099,_0xc87b('0x48'),_0x2fe333[_0x5ee6ea][_0x3b6d31]);break;case 0x7:if(_0x4bff29['role']!=='agent')_0x3c6d50[_0x42d099](util[_0xc87b('0x19')]('telephone:%s',_0x2fe333[_0x5ee6ea][_0x3b6d31][_0xc87b('0x4')]));break;case 0x8:if(_0x4bff29[_0xc87b('0x16')]!==_0xc87b('0x3a'))_0x3c6d50[_0x42d099](util['format'](_0xc87b('0x49'),_0x2fe333[_0x5ee6ea][_0x3b6d31][_0xc87b('0x4')]));break;case 0x9:if(_0x4bff29[_0xc87b('0x16')]!==_0xc87b('0x3a'))_0x3c6d50[_0x42d099](util[_0xc87b('0x19')](_0xc87b('0x4a'),_0x2fe333[_0x5ee6ea][_0x3b6d31][_0xc87b('0x18')],_0x2fe333[_0x5ee6ea][_0x3b6d31]['name']));break;case 0xa:_0x3c6d50[_0x42d099](util['format'](_0xc87b('0x26'),_0x2fe333[_0x5ee6ea][_0x3b6d31][_0xc87b('0x4')]));break;}}}}})[_0xc87b('0x9')](function(){if(_0x42d099===_0xc87b('0x4b')){var _0xe73d52=_['map'](_0x4bff29['ChatInteractions'],'id');return _0x4bff29[_0xc87b('0x4c')](_0xe73d52)[_0xc87b('0x9')](function(){for(var _0x4ac1ca=0x0;_0x4ac1ca<_0xe73d52[_0xc87b('0x1b')];_0x4ac1ca+=0x1){_0x147731[_0xc87b('0x4d')](_0xc87b('0x4e'),{'ChatInteractionId':Number(_0xe73d52[_0x4ac1ca]),'UserId':Number(_0x4bff29['id'])});}});}})[_0xc87b('0x9')](function(){if(_0x42d099==='leave'){var _0x1a38e5=_[_0xc87b('0x12')](_0x4bff29[_0xc87b('0x4f')],'id');return _0x4bff29['removeMailInteractions'](_0x1a38e5)[_0xc87b('0x9')](function(){for(var _0x1d5a58=0x0;_0x1d5a58<_0x1a38e5['length'];_0x1d5a58+=0x1){_0x147731[_0xc87b('0x4d')](_0xc87b('0x50'),{'MailInteractionId':Number(_0x1a38e5[_0x1d5a58]),'UserId':Number(_0x4bff29['id'])});}});}})[_0xc87b('0x9')](function(){if(_0x42d099===_0xc87b('0x4b')){var _0x2fbaf0=_[_0xc87b('0x12')](_0x4bff29[_0xc87b('0x51')],'id');return _0x4bff29['removeFaxInteractions'](_0x2fbaf0)['then'](function(){for(var _0x27f74d=0x0;_0x27f74d<_0x2fbaf0[_0xc87b('0x1b')];_0x27f74d+=0x1){_0x147731[_0xc87b('0x4d')](_0xc87b('0x52'),{'FaxInteractionId':Number(_0x2fbaf0[_0x27f74d]),'UserId':Number(_0x4bff29['id'])});}});}})[_0xc87b('0x9')](function(){if(_0x42d099===_0xc87b('0x4b')){var _0x57dbec=_['map'](_0x4bff29[_0xc87b('0x23')],'id');return _0x4bff29['removeSmsInteractions'](_0x57dbec)['then'](function(){for(var _0x2ef012=0x0;_0x2ef012<_0x57dbec[_0xc87b('0x1b')];_0x2ef012+=0x1){_0x147731[_0xc87b('0x4d')](_0xc87b('0x53'),{'SmsInteractionId':Number(_0x57dbec[_0x2ef012]),'UserId':Number(_0x4bff29['id'])});}});}})[_0xc87b('0x9')](function(){if(_0x42d099===_0xc87b('0x4b')){var _0x3f1a63=_['map'](_0x4bff29[_0xc87b('0x54')],'id');return _0x4bff29[_0xc87b('0x55')](_0x3f1a63)[_0xc87b('0x9')](function(){for(var _0x1594e8=0x0;_0x1594e8<_0x3f1a63[_0xc87b('0x1b')];_0x1594e8+=0x1){_0x147731[_0xc87b('0x4d')](_0xc87b('0x56'),{'OpenchannelInteractionId':Number(_0x3f1a63[_0x1594e8]),'UserId':Number(_0x4bff29['id'])});}});}})[_0xc87b('0x9')](function(){if(_0x42d099===_0xc87b('0x4b')){var _0x5f4553=_[_0xc87b('0x12')](_0x4bff29[_0xc87b('0x25')],'id');return _0x4bff29[_0xc87b('0x57')](_0x5f4553)[_0xc87b('0x9')](function(){for(var _0x5337c9=0x0;_0x5337c9<_0x5f4553[_0xc87b('0x1b')];_0x5337c9+=0x1){_0x147731['emit'](_0xc87b('0x58'),{'WhatsappInteractionId':Number(_0x5f4553[_0x5337c9]),'UserId':Number(_0x4bff29['id'])});}});}})[_0xc87b('0x59')](function(_0xaf8206){_0x3c6d50['log'](_0xaf8206);});}}function onDisconnect(_0x3a7e5b,_0x1900c9){joinOrLeave(_0x3a7e5b,_0xc87b('0x4b'),_0x1900c9);}function onConnect(_0x438abe){joinOrLeave(_0x438abe,_0xc87b('0x5a'));}exports[_0xc87b('0x5b')]=function(_0x342f05){_0x342f05['on'](_0xc87b('0x5c'),function(_0x1c0807){_0x1c0807[_0xc87b('0x5d')](0x0);_0x1c0807[_0xc87b('0x5e')]=_0x1c0807[_0xc87b('0x5f')][_0xc87b('0x5c')]['remoteAddress']+':'+_0x1c0807['request'][_0xc87b('0x5c')][_0xc87b('0x60')];_0x1c0807[_0xc87b('0x61')]=new Date();_0x1c0807[_0xc87b('0x62')]=function(_0x58a215){console[_0xc87b('0x62')](_0xc87b('0x63')+_0x1c0807['nsp'][_0xc87b('0x4')]+'['+_0x1c0807[_0xc87b('0x5e')]+']',_0x58a215);};_0x1c0807['on'](_0xc87b('0x64'),function(){onDisconnect(_0x1c0807,_0x342f05);_0x1c0807[_0xc87b('0x62')](_0xc87b('0x65'));});onConnect(_0x1c0807);_0x1c0807[_0xc87b('0x62')](_0xc87b('0x66'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 628f490..4f19257 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 _0x596a=['undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','UserId','format','SIP/%s','name','agent','incomingmessage','outgoingmessage','AfterCreateMessage','motionChannel','offlineMessage','resolve','Sequelize','QueryTypes','AfterCreate','changed','closed','substatus','interface','AfterUpdate','User','find','fullname','email','default','length','hasOwnProperty','model','hook','callback','condition','util','../../mysqldb','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','ChatOfflineMessage','newmessage','Sms','SmsInteraction','SmsMessage','WhatsappInteraction','Whatsapp','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','catch','get','channel','event','direction'];(function(_0x5f1e9b,_0x375e08){var _0x4ae30b=function(_0x11d184){while(--_0x11d184){_0x5f1e9b['push'](_0x5f1e9b['shift']());}};_0x4ae30b(++_0x375e08);}(_0x596a,0x6f));var _0xa596=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x596a[_0x3bf83f];return _0x22c4a9;};'use strict';var util=require(_0xa596('0x0'));var db=require(_0xa596('0x1'))['db'];var jayson=require('jayson/promise');var logger=require('../logger')(_0xa596('0x2'));var client=jayson[_0xa596('0x3')][_0xa596('0x4')]({'port':0x232a});var triggers=[{'channel':_0xa596('0x5'),'model':_0xa596('0x6'),'event':_0xa596('0x7'),'condition':_0xa596('0x8'),'callback':afterCreate},{'channel':'Chat','model':'ChatInteraction','event':_0xa596('0x9'),'condition':_0xa596('0xa'),'callback':afterUpdate},{'channel':_0xa596('0x5'),'model':_0xa596('0xb'),'event':_0xa596('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Chat','model':_0xa596('0xc'),'event':_0xa596('0x7'),'condition':_0xa596('0xd'),'callback':afterCreateOfflineMessage},{'channel':_0xa596('0xe'),'model':_0xa596('0xf'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Sms','model':'SmsInteraction','event':_0xa596('0x9'),'condition':_0xa596('0xa'),'callback':afterUpdate},{'channel':_0xa596('0xe'),'model':_0xa596('0x10'),'event':_0xa596('0x7'),'condition':_0xa596('0xd'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0xa596('0x11'),'event':_0xa596('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':'Whatsapp','model':_0xa596('0x11'),'event':_0xa596('0x9'),'condition':_0xa596('0xa'),'callback':afterUpdate},{'channel':_0xa596('0x12'),'model':'WhatsappMessage','event':_0xa596('0x7'),'condition':_0xa596('0xd'),'callback':afterCreateMessage},{'channel':_0xa596('0x13'),'model':_0xa596('0x14'),'event':_0xa596('0x7'),'condition':_0xa596('0x8'),'callback':afterCreate},{'channel':_0xa596('0x13'),'model':_0xa596('0x14'),'event':'afterUpdate','condition':_0xa596('0xa'),'callback':afterUpdate},{'channel':_0xa596('0x13'),'model':_0xa596('0x15'),'event':_0xa596('0x7'),'condition':_0xa596('0xd'),'callback':afterCreateMessage},{'channel':_0xa596('0x16'),'model':_0xa596('0x17'),'event':_0xa596('0x7'),'condition':_0xa596('0x8'),'callback':afterCreate},{'channel':_0xa596('0x16'),'model':_0xa596('0x17'),'event':_0xa596('0x9'),'condition':_0xa596('0xa'),'callback':afterUpdate},{'channel':_0xa596('0x16'),'model':_0xa596('0x18'),'event':_0xa596('0x7'),'condition':_0xa596('0xd'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0xa596('0x19'),'event':_0xa596('0x7'),'condition':_0xa596('0x8'),'callback':afterCreate},{'channel':'Openchannel','model':_0xa596('0x19'),'event':_0xa596('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xa596('0x1a'),'model':_0xa596('0x1b'),'event':_0xa596('0x7'),'condition':_0xa596('0xd'),'callback':afterCreateMessage}];function request(_0x4f6643){return client[_0xa596('0x1c')](_0xa596('0x1d'),_0x4f6643)[_0xa596('0x1e')](function(_0xf4d493){logger[_0xa596('0x1f')](_0xa596('0x20'),_0xa596('0x1d'),_0xf4d493);if(_0xf4d493[_0xa596('0x21')]){if(_0xf4d493[_0xa596('0x21')]['code']===0x1f4){logger[_0xa596('0x21')](_0xa596('0x20'),_0xa596('0x1d'),_0xf4d493[_0xa596('0x21')]);}}})[_0xa596('0x22')](function(_0xe9888c){logger['error']('Trigger,\x20%s',_0xa596('0x1d'),_0xe9888c);});}function afterCreateMessage(_0x43ca4e){return function(_0x294de7){_0x294de7=_0x294de7[_0xa596('0x23')]({'plain':!![]});_0x294de7[_0xa596('0x24')]=_0x43ca4e;_0x294de7['motionChannel']=_0x43ca4e;_0x294de7[_0xa596('0x25')]=_0x294de7[_0xa596('0x26')];Promise['resolve']()[_0xa596('0x1e')](function(){if(typeof _0x294de7['ContactId']===_0xa596('0x27'))return null;var _0x1ba13f=_0xa596('0x28')+_0x294de7[_0xa596('0x29')];return db[_0xa596('0x2a')]['query'](_0x1ba13f,{'type':db['Sequelize']['QueryTypes'][_0xa596('0x2b')],'raw':!![]});})[_0xa596('0x1e')](function(_0x44f0b2){if(_0x44f0b2){_0x294de7[_0xa596('0x2c')]=_0x44f0b2[0x0];}if(typeof _0x294de7['UserId']===_0xa596('0x27'))return;return getAgent(_0x294de7[_0xa596('0x2d')]);})['then'](function(_0x71d5bb){if(_0x71d5bb){_0x294de7['interface']=util[_0xa596('0x2e')](_0xa596('0x2f'),_0x71d5bb[_0xa596('0x30')]);_0x294de7[_0xa596('0x31')]=_0x71d5bb;_0x294de7[_0xa596('0x24')]=_0x43ca4e;return request({'event':_0xa596('0x32'),'message':_0x294de7});}else{return request({'event':_0xa596('0x33'),'message':_0x294de7});}})['catch'](function(_0x4381af){logger[_0xa596('0x21')]('Trigger,\x20%s',_0xa596('0x34'),_0x4381af);});};}function afterCreateOfflineMessage(_0x4c730d){return function(_0x2d6e04){_0x2d6e04=_0x2d6e04[_0xa596('0x23')]({'plain':!![]});_0x2d6e04['channel']=_0x4c730d;_0x2d6e04[_0xa596('0x35')]=_0x4c730d;_0x2d6e04['event']=_0xa596('0x36');return request({'event':_0x2d6e04[_0xa596('0x25')],'message':_0x2d6e04});};}function afterCreate(_0x36944d,_0x13f546){return function(_0x1f7cf3){_0x1f7cf3=_0x1f7cf3['get']({'plain':!![]});_0x1f7cf3[_0xa596('0x24')]=_0x36944d;_0x1f7cf3[_0xa596('0x35')]=_0x36944d;_0x1f7cf3[_0xa596('0x25')]='opened';Promise[_0xa596('0x37')]()[_0xa596('0x1e')](function(){var _0x45055c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1f7cf3['ContactId'];return db[_0xa596('0x2a')]['query'](_0x45055c,{'type':db[_0xa596('0x38')][_0xa596('0x39')][_0xa596('0x2b')],'raw':!![]});})[_0xa596('0x1e')](function(_0x34016e){if(_0x34016e){_0x1f7cf3[_0xa596('0x2c')]=_0x34016e[0x0];}if(typeof _0x1f7cf3[_0xa596('0x2d')]==='undefined')return;return getAgent(_0x1f7cf3[_0xa596('0x2d')]);})[_0xa596('0x1e')](function(_0x3349d7){if(_0x3349d7){_0x1f7cf3['interface']=util[_0xa596('0x2e')](_0xa596('0x2f'),_0x3349d7[_0xa596('0x30')]);_0x1f7cf3[_0xa596('0x31')]=_0x3349d7;}return request({'event':_0x13f546,'message':_0x1f7cf3});})['catch'](function(_0x277bfa){logger[_0xa596('0x21')](_0xa596('0x20'),_0xa596('0x3a'),_0x277bfa);});};}function afterUpdate(_0x41f43d){return function(_0x5d6acf){var _0x486b14=_0x5d6acf[_0xa596('0x3b')](_0xa596('0x3c'))&&_0x5d6acf[_0xa596('0x3c')];var _0x1360ea=_0x5d6acf[_0xa596('0x3b')](_0xa596('0x3d'));if(_0x486b14||_0x1360ea){var _0x15c942=_0x486b14?_0xa596('0xa'):_0xa596('0x3d');var _0xafdb3b=_0x5d6acf['get']({'plain':!![]});_0xafdb3b[_0xa596('0x24')]=_0x41f43d;_0xafdb3b[_0xa596('0x35')]=_0x41f43d;_0xafdb3b['event']=_0x486b14?_0xa596('0x3c'):_0xa596('0x3d');var _0x316c25=_0xa596('0x28')+_0xafdb3b[_0xa596('0x29')];return db[_0xa596('0x2a')]['query'](_0x316c25,{'type':db[_0xa596('0x38')]['QueryTypes'][_0xa596('0x2b')],'raw':!![]})[_0xa596('0x1e')](function(_0x139bc9){if(_0x139bc9){_0xafdb3b[_0xa596('0x2c')]=_0x139bc9[0x0];}if(typeof _0xafdb3b[_0xa596('0x2d')]===_0xa596('0x27'))return;return getAgent(_0xafdb3b['UserId']);})[_0xa596('0x1e')](function(_0x178e74){if(_0x178e74){_0xafdb3b[_0xa596('0x3e')]=util[_0xa596('0x2e')]('SIP/%s',_0x178e74[_0xa596('0x30')]);_0xafdb3b['agent']=_0x178e74;}return request({'event':_0x15c942,'message':_0xafdb3b});})['catch'](function(_0x490c73){logger[_0xa596('0x21')](_0xa596('0x20'),_0xa596('0x3f'),_0x490c73);});}};}function getAgent(_0x1c6a86){return db[_0xa596('0x40')][_0xa596('0x41')]({'where':{'id':_0x1c6a86},'attributes':['id',_0xa596('0x30'),_0xa596('0x42'),_0xa596('0x43'),'internal'],'raw':!![]})[_0xa596('0x1e')](function(_0x1ed434){return _0x1ed434;});}exports[_0xa596('0x44')]=function(){for(var _0x59a8a0=0x0;_0x59a8a0=_0x165236[_0x3164('0x10')]){throw Error(_0x3164('0x11'));}_0x16df7b(_0x1635b0);})[_0x3164('0x12')](function(_0x45092d){_0x11b2eb(_0x45092d);});});}; \ No newline at end of file +var _0x034c=['role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','./license/util','mail','chat','fax','sms','whatsapp','openchannel','getChannels','toLowerCase','includes','clearBlockUser','updateAttributes','getLicense'];(function(_0x1054f3,_0x4c7855){var _0x5d3f56=function(_0xdc21b3){while(--_0xdc21b3){_0x1054f3['push'](_0x1054f3['shift']());}};_0x5d3f56(++_0x4c7855);}(_0x034c,0xfa));var _0xc034=function(_0x5ad387,_0x3960ac){_0x5ad387=_0x5ad387-0x0;var _0x27f097=_0x034c[_0x5ad387];return _0x27f097;};'use strict';var _=require(_0xc034('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require(_0xc034('0x1'));var channels=['voice',_0xc034('0x2'),_0xc034('0x3'),_0xc034('0x4'),_0xc034('0x5'),_0xc034('0x6'),_0xc034('0x7')];exports[_0xc034('0x8')]=function(){return channels;};exports['isValidChannel']=function(_0x370d22){_0x370d22=_0x370d22[_0xc034('0x9')]();return _[_0xc034('0xa')](channels,_0x370d22);};exports[_0xc034('0xb')]=function(_0x4e9caa,_0x20d584,_0x2416a2,_0x114918){var _0x4b5302={'loginAttempts':_0x20d584,'blocked':_0x2416a2};if(!_['isUndefined'](_0x114918)){_0x4b5302['blockedAt']=_0x114918;}return _0x4e9caa[_0xc034('0xc')](_0x4b5302);};exports[_0xc034('0xd')]=function(_0x101768){return new BPromise(function(_0x887167,_0x1d5d25){var _0x23a71a=0x0;if(_0x101768[_0xc034('0xe')]!==_0xc034('0xf')){_0x887167(_0x101768);}db[_0xc034('0x10')][_0xc034('0x11')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x101768['id']}}})[_0xc034('0x12')](function(_0xc49e1a){_0x23a71a=_0xc49e1a;return util[_0xc034('0xd')]();})['then'](function(_0x5c8812){if(_0x5c8812&&_0x5c8812[_0xc034('0x13')]&&_0x23a71a>=_0x5c8812[_0xc034('0x13')]){throw Error(_0xc034('0x14'));}_0x887167(_0x101768);})[_0xc034('0x15')](function(_0x2916f0){_0x1d5d25(_0x2916f0);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index f14a7b9..efe7770 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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 +var _0x750a=['Error','inherits','Bad\x20Request','Forbidden','OutOfInterval','stack','status','exports','../config/logger','message','Internal\x20Server\x20Error','name'];(function(_0x540fad,_0x5874e5){var _0x8508a2=function(_0x541a07){while(--_0x541a07){_0x540fad['push'](_0x540fad['shift']());}};_0x8508a2(++_0x5874e5);}(_0x750a,0x140));var _0xa750=function(_0x47e7b0,_0x49fc0f){_0x47e7b0=_0x47e7b0-0x0;var _0x326ec5=_0x750a[_0x47e7b0];return _0x326ec5;};'use strict';var util=require('util');var logger=require(_0xa750('0x0'))('api');var APIError=function(_0x499583,_0x139fa5){this[_0xa750('0x1')]=_0x499583||_0xa750('0x2');this[_0xa750('0x3')]=_0x139fa5||_0xa750('0x4');util[_0xa750('0x5')](APIError,Error);};var APIBadRequestError=function(_0x562911){this[_0xa750('0x1')]=_0x562911||_0xa750('0x6');this[_0xa750('0x3')]=_0xa750('0x6');util[_0xa750('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x3d7c43){this['message']=_0x3d7c43||'Entity\x20not\x20found';this[_0xa750('0x3')]='Not\x20Found';util[_0xa750('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x1760f5){switch(_0x1760f5){case'Bad\x20Request':return 0x190;case _0xa750('0x7'),_0xa750('0x8'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x5aca9c){return function(_0xcb62ae){logger['error'](_0xcb62ae[_0xa750('0x9')]);var _0x5adaae=getStatusCode(_0xcb62ae['name']);if(_0xcb62ae[_0xa750('0x3')])delete _0xcb62ae[_0xa750('0x3')];return _0x5aca9c[_0xa750('0xa')](_0x5adaae)['send'](_0xcb62ae);};}module[_0xa750('0xb')]={'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 c2b59e2..5e82ff8 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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 +var _0x1646=['json','exports','status','render'];(function(_0x46d97e,_0x67e2e1){var _0xa8a7db=function(_0x220250){while(--_0x220250){_0x46d97e['push'](_0x46d97e['shift']());}};_0xa8a7db(++_0x67e2e1);}(_0x1646,0x1bd));var _0x6164=function(_0x4b6778,_0x505a76){_0x4b6778=_0x4b6778-0x0;var _0x22dbb9=_0x1646[_0x4b6778];return _0x22dbb9;};'use strict';module[_0x6164('0x0')][0x194]=function pageNotFound(_0xbdcfa,_0x2e94df){var _0x19c912='404';var _0xbfcd93=0x194;var _0x4fab20={'status':_0xbfcd93};_0x2e94df[_0x6164('0x1')](_0x4fab20['status']);_0x2e94df[_0x6164('0x2')](_0x19c912,{},function(_0x5c5c88,_0x277308){if(_0x5c5c88){return _0x2e94df[_0x6164('0x1')](_0x4fab20['status'])[_0x6164('0x3')](_0x4fab20);}_0x2e94df['send'](_0x277308);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 8a71ee0..18b93aa 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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 +var _0x1106=['../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','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','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','VoiceMail','UserId','User','userSetting','cascade','hasMany','VoiceRecording','Extensions','HopperFinals','HopperHistory','OpenchannelInteraction','ChatInteraction','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','UserProfile','Groups','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_fax_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','SmsQueues','UserWhatsappQueue','CmList','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','user_has_whatsapp_accounts','SpiedAgents','VoiceContext','Sounds','moh_has_sounds','UserVoiceQueueRt','Members','VoiceQueueId','HopperHistories','JscriptySessions','TrunkId','belongsTo','TrunkBackupId','IntervalId','voice_queues_has_cm_lists','Agents','Teams','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','mailbox','VoiceCallReport','QueueCalls','uniqueid','AgentReports','Contact','CloudProviderId','MailAccountId','restrict','Imap','Smtp','Dispositions','CannedAnswer','Answers','Messages','Interactions','List','TemplateId','mandatoryDispositionPause','team_has_mail_queues','ContactId','Owner','mail_interaction_has_tags','Tags','Users','MailInteractionId','Interaction','Account','ChatWebsiteId','ChatOfflineMessageId','TagId','ListId','Dashboard','Items','FaxAccountId','Applications','Exntensions','FaxInteractionId','fax_interaction_has_tags','ThroughTags','team_has_fax_queues','SmsAccountId','mandatoryDispositionPauseId','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','ChatApplication','OpenchannelQueueReport','Queue','ChatQueueId','Website','chat_interaction_has_tags','user_has_chat_interactions','ChatInteractionId','AttachmentId','Attachments','team_has_chat_queues','ChatInternalMessage','ChatGroupId','CompanyId','CmContactHasItem','Phones','Hoppers','OpenchannelInteractions','Company','cm_contact_has_tags','AdditionalPhones','CmHopperId','Agent','CampaignId','OwnerId','CmHopperBlack','All','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Mohs','whatsapp_interaction_has_tags','ItemTypeId','Hopper','CmContactId','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','CustomReportId','Fields','MetricId','Configurations','SalesforceField','Subjects','Descriptions','DescriptionId','Subject','SubjectId','Description','Field','FieldId','VariableId','AccountId','DeskConfiguration','int_desk_configuration_has_tags','ZohoField','ZendeskAccount','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerField','Dynamics365Configuration','FreshsalesConfiguration','JscriptyProject','ProjectId','MailQueues','FaxQueues','HopperBlacks','TrunkBackup','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','FromChatWebsiteId','FromAccount','FromAgent','ToChatQueueId','ToQueue','ToAccount','FromFaxAccountId','ToFaxQueueId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsAccountId','CustomFields','Queues','userProfileId','UserProfileSections','Resources','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','user','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','name','utf8','sequelizeHistory','xcall','mysql','utf8_general_ci','username','options','database','password','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmHopperAdditionalPhone','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','VtigerConfiguration'];(function(_0x3e4a72,_0xb90e00){var _0x39aec8=function(_0x2c4c78){while(--_0x2c4c78){_0x3e4a72['push'](_0x3e4a72['shift']());}};_0x39aec8(++_0xb90e00);}(_0x1106,0x146));var _0x6110=function(_0x51fd7e,_0x59ed19){_0x51fd7e=_0x51fd7e-0x0;var _0x25956d=_0x1106[_0x51fd7e];return _0x25956d;};'use strict';var config=require(_0x6110('0x0'));var Sequelize=require(_0x6110('0x1'));var _=require(_0x6110('0x2'));var jstz=require(_0x6110('0x3'));var timezone=jstz[_0x6110('0x4')]();config[_0x6110('0x1')]=_[_0x6110('0x5')](config[_0x6110('0x1')],{'database':_0x6110('0x6'),'username':'xcall','password':_0x6110('0x7'),'options':{'host':_0x6110('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x6110('0x9')](),'define':{'charset':_0x6110('0xa'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_['defaultsDeep'](config[_0x6110('0xb')],{'database':_0x6110('0x6'),'username':_0x6110('0xc'),'password':_0x6110('0x7'),'options':{'host':_0x6110('0x8'),'port':0xcea,'dialect':_0x6110('0xd'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x6110('0x9')](),'define':{'charset':'utf8','collate':_0x6110('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x6110('0x1')]['database'],config['sequelize'][_0x6110('0xf')],config[_0x6110('0x1')]['password'],config[_0x6110('0x1')][_0x6110('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x6110('0xb')][_0x6110('0x11')],config[_0x6110('0xb')][_0x6110('0xf')],config['sequelizeHistory'][_0x6110('0x12')],config[_0x6110('0xb')][_0x6110('0x10')])};db['User']=db['sequelize'][_0x6110('0x13')]('../api/user/user.model');db[_0x6110('0x14')]=db[_0x6110('0x1')]['import'](_0x6110('0x15'));db['VoiceContext']=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x16'));db[_0x6110('0x17')]=db['sequelize'][_0x6110('0x13')]('../api/voiceExtension/voiceExtension.model');db[_0x6110('0x18')]=db[_0x6110('0x1')][_0x6110('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x6110('0x19')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x1a'));db['VoiceRecording']=db[_0x6110('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x6110('0x1b')]=db['sequelize'][_0x6110('0x13')](_0x6110('0x1c'));db['VoiceMail']=db['sequelize'][_0x6110('0x13')](_0x6110('0x1d'));db[_0x6110('0x1e')]=db['sequelize'][_0x6110('0x13')](_0x6110('0x1f'));db['VoiceCallReport']=db['sequelize']['import'](_0x6110('0x20'));db[_0x6110('0x21')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x22'));db[_0x6110('0x23')]=db['sequelize'][_0x6110('0x13')](_0x6110('0x24'));db[_0x6110('0x25')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x26'));db['MemberReport']=db[_0x6110('0x1')]['import'](_0x6110('0x27'));db[_0x6110('0x28')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x29'));db[_0x6110('0x2a')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x2b'));db['UserVoiceQueueRt']=db['sequelize']['import'](_0x6110('0x2c'));db[_0x6110('0x2d')]=db['sequelize']['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0x6110('0x2e')]=db['sequelize'][_0x6110('0x13')]('../api/userChatQueue/userChatQueue.model');db[_0x6110('0x2f')]=db['sequelize'][_0x6110('0x13')](_0x6110('0x30'));db[_0x6110('0x31')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x32'));db[_0x6110('0x33')]=db[_0x6110('0x1')][_0x6110('0x13')]('../api/userSmsQueue/userSmsQueue.model');db[_0x6110('0x34')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x35'));db['UserWhatsappQueue']=db[_0x6110('0x1')]['import'](_0x6110('0x36'));db[_0x6110('0x37')]=db['sequelize'][_0x6110('0x13')](_0x6110('0x38'));db[_0x6110('0x39')]=db[_0x6110('0x1')][_0x6110('0x13')]('../api/mailServerOut/mailServerOut.model');db[_0x6110('0x3a')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x3b'));db[_0x6110('0x3c')]=db[_0x6110('0x1')]['import'](_0x6110('0x3d'));db[_0x6110('0x3e')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x3f'));db[_0x6110('0x40')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x41'));db[_0x6110('0x42')]=db[_0x6110('0x1')][_0x6110('0x13')]('../api/mailMessage/mailMessage.model');db[_0x6110('0x43')]=db['sequelize']['import'](_0x6110('0x44'));db[_0x6110('0x45')]=db['sequelize'][_0x6110('0x13')](_0x6110('0x46'));db['Dashboard']=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x47'));db[_0x6110('0x48')]=db['sequelize'][_0x6110('0x13')](_0x6110('0x49'));db['FaxAccount']=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x4a'));db[_0x6110('0x4b')]=db['sequelize'][_0x6110('0x13')](_0x6110('0x4c'));db[_0x6110('0x4d')]=db[_0x6110('0x1')]['import'](_0x6110('0x4e'));db[_0x6110('0x4f')]=db[_0x6110('0x1')]['import'](_0x6110('0x50'));db[_0x6110('0x51')]=db[_0x6110('0x1')]['import'](_0x6110('0x52'));db[_0x6110('0x53')]=db[_0x6110('0x1')][_0x6110('0x13')]('../api/faxQueueReport/faxQueueReport.model');db[_0x6110('0x54')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x55'));db[_0x6110('0x56')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x57'));db[_0x6110('0x58')]=db['sequelize'][_0x6110('0x13')](_0x6110('0x59'));db[_0x6110('0x5a')]=db[_0x6110('0x1')]['import'](_0x6110('0x5b'));db[_0x6110('0x5c')]=db[_0x6110('0x1')][_0x6110('0x13')]('../api/smsQueue/smsQueue.model');db[_0x6110('0x5d')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x5e'));db[_0x6110('0x5f')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x60'));db['OpenchannelInteraction']=db[_0x6110('0x1')]['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0x6110('0x61')]=db[_0x6110('0x1')][_0x6110('0x13')]('../api/openchannelMessage/openchannelMessage.model');db[_0x6110('0x62')]=db[_0x6110('0x1')]['import'](_0x6110('0x63'));db[_0x6110('0x64')]=db[_0x6110('0x1')]['import'](_0x6110('0x65'));db['OpenchannelQueueReport']=db[_0x6110('0x1')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db['ChatApplication']=db[_0x6110('0x1')][_0x6110('0x13')]('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x66'));db[_0x6110('0x67')]=db[_0x6110('0x1')]['import'](_0x6110('0x68'));db[_0x6110('0x69')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x6a'));db[_0x6110('0x6b')]=db['sequelize'][_0x6110('0x13')](_0x6110('0x6c'));db[_0x6110('0x6d')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x6e'));db[_0x6110('0x6f')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x70'));db[_0x6110('0x71')]=db[_0x6110('0x1')]['import'](_0x6110('0x72'));db[_0x6110('0x73')]=db[_0x6110('0x1')][_0x6110('0x13')]('../api/cmContact/cmContact.model');db[_0x6110('0x74')]=db[_0x6110('0x1')]['import']('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x75'));db[_0x6110('0x76')]=db[_0x6110('0x1')][_0x6110('0x13')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x6110('0x77')]=db['sequelize'][_0x6110('0x13')](_0x6110('0x78'));db[_0x6110('0x79')]=db['sequelize']['import'](_0x6110('0x7a'));db[_0x6110('0x7b')]=db['sequelize'][_0x6110('0x13')](_0x6110('0x7c'));db[_0x6110('0x7d')]=db[_0x6110('0x1')]['import'](_0x6110('0x7e'));db[_0x6110('0x7f')]=db[_0x6110('0x1')]['import'](_0x6110('0x80'));db['CannedAnswer']=db['sequelize'][_0x6110('0x13')](_0x6110('0x81'));db[_0x6110('0x82')]=db[_0x6110('0x1')]['import'](_0x6110('0x83'));db[_0x6110('0x84')]=db[_0x6110('0x1')][_0x6110('0x13')]('../api/condition/condition.model');db[_0x6110('0x85')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x86'));db[_0x6110('0x87')]=db[_0x6110('0x1')]['import'](_0x6110('0x88'));db[_0x6110('0x89')]=db['sequelize'][_0x6110('0x13')](_0x6110('0x8a'));db[_0x6110('0x8b')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x8c'));db[_0x6110('0x8d')]=db[_0x6110('0x1')][_0x6110('0x13')]('../api/schedule/schedule.model');db[_0x6110('0x8e')]=db[_0x6110('0x1')]['import'](_0x6110('0x8f'));db[_0x6110('0x90')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x91'));db[_0x6110('0x92')]=db['sequelize'][_0x6110('0x13')](_0x6110('0x93'));db['CmContactHasItem']=db['sequelize']['import']('../api/cmContactHasItem/cmContactHasItem.model');db[_0x6110('0x94')]=db[_0x6110('0x1')][_0x6110('0x13')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x6110('0x95')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x96'));db[_0x6110('0x97')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x98'));db[_0x6110('0x99')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x9a'));db['Integration']=db[_0x6110('0x1')][_0x6110('0x13')]('../api/integration/integration.model');db[_0x6110('0x9b')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x9c'));db[_0x6110('0x9d')]=db['sequelize'][_0x6110('0x13')](_0x6110('0x9e'));db[_0x6110('0x9f')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xa0'));db['AnalyticExtractedReport']=db[_0x6110('0x1')]['import'](_0x6110('0xa1'));db[_0x6110('0xa2')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xa3'));db[_0x6110('0xa4')]=db['sequelize'][_0x6110('0x13')](_0x6110('0xa5'));db[_0x6110('0xa6')]=db['sequelize'][_0x6110('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x6110('0xa7')]=db['sequelize'][_0x6110('0x13')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x6110('0xa8')]=db['sequelize'][_0x6110('0x13')](_0x6110('0xa9'));db['SalesforceField']=db[_0x6110('0x1')]['import'](_0x6110('0xaa'));db[_0x6110('0xab')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xac'));db[_0x6110('0xad')]=db['sequelize'][_0x6110('0x13')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x6110('0xae')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xaf'));db[_0x6110('0xb0')]=db[_0x6110('0x1')]['import'](_0x6110('0xb1'));db['DeskConfiguration']=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xb2'));db[_0x6110('0xb3')]=db[_0x6110('0x1')]['import'](_0x6110('0xb4'));db[_0x6110('0xb5')]=db['sequelize'][_0x6110('0x13')](_0x6110('0xb6'));db[_0x6110('0xb7')]=db[_0x6110('0x1')]['import'](_0x6110('0xb8'));db['ZohoField']=db[_0x6110('0x1')]['import'](_0x6110('0xb9'));db['ZendeskAccount']=db[_0x6110('0x1')][_0x6110('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x6110('0xba')]=db['sequelize']['import'](_0x6110('0xbb'));db[_0x6110('0xbc')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xbd'));db[_0x6110('0xbe')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xbf'));db[_0x6110('0xc0')]=db['sequelize'][_0x6110('0x13')](_0x6110('0xc1'));db[_0x6110('0xc2')]=db['sequelize']['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0x6110('0xc3')]=db[_0x6110('0x1')][_0x6110('0x13')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x6110('0xc4')]=db['sequelize'][_0x6110('0x13')](_0x6110('0xc5'));db['VtigerField']=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xc6'));db[_0x6110('0xc7')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xc8'));db[_0x6110('0xc9')]=db['sequelize']['import'](_0x6110('0xca'));db[_0x6110('0xcb')]=db['sequelize'][_0x6110('0x13')](_0x6110('0xcc'));db[_0x6110('0xcd')]=db[_0x6110('0x1')][_0x6110('0x13')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0x6110('0x1')]['import'](_0x6110('0xce'));db[_0x6110('0xcf')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xd0'));db[_0x6110('0xd1')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xd2'));db['FreshsalesConfiguration']=db[_0x6110('0x1')]['import'](_0x6110('0xd3'));db[_0x6110('0xd4')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xd5'));db[_0x6110('0xd6')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xd7'));db[_0x6110('0xd8')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xd9'));db[_0x6110('0xda')]=db['sequelize'][_0x6110('0x13')](_0x6110('0xdb'));db['ChatInternalMessage']=db[_0x6110('0x1')]['import'](_0x6110('0xdc'));db[_0x6110('0xdd')]=db[_0x6110('0x1')]['import'](_0x6110('0xde'));db[_0x6110('0xdf')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xe0'));db[_0x6110('0xe1')]=db[_0x6110('0x1')]['import'](_0x6110('0xe2'));db[_0x6110('0xe3')]=db[_0x6110('0x1')]['import'](_0x6110('0xe4'));db['SquareReport']=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xe5'));db[_0x6110('0xe6')]=db[_0x6110('0x1')]['import'](_0x6110('0xe7'));db['JscriptyProject']=db['sequelize'][_0x6110('0x13')](_0x6110('0xe8'));db[_0x6110('0xe9')]=db[_0x6110('0x1')][_0x6110('0x13')]('../api/setting/setting.model');db['SquareOdbc']=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xea'));db[_0x6110('0xeb')]=db['sequelize'][_0x6110('0x13')](_0x6110('0xec'));db[_0x6110('0xed')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xee'));db[_0x6110('0xef')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xf0'));db[_0x6110('0xf1')]=db['sequelize'][_0x6110('0x13')]('../api/team/team.model');db['License']=db['sequelize']['import'](_0x6110('0xf2'));db[_0x6110('0xf3')]=db['sequelize'][_0x6110('0x13')](_0x6110('0xf4'));db[_0x6110('0xf5')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xf6'));db[_0x6110('0xf7')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xf8'));db['Plugin']=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xf9'));db[_0x6110('0xfa')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xfb'));db[_0x6110('0xfc')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0xfd'));db[_0x6110('0xfe')]=db[_0x6110('0x1')]['import'](_0x6110('0xff'));db['OpenchannelTransferReport']=db['sequelize'][_0x6110('0x13')](_0x6110('0x100'));db[_0x6110('0x101')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x102'));db['CmList']=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x103'));db[_0x6110('0x104')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x105'));db['UserProfile']=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x106'));db[_0x6110('0x107')]=db['sequelize'][_0x6110('0x13')](_0x6110('0x108'));db[_0x6110('0x109')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x10a'));db['UserNotification']=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x10b'));db[_0x6110('0x10c')]=db[_0x6110('0x1')]['import'](_0x6110('0x10d'));db[_0x6110('0x10e')]=db[_0x6110('0x1')]['import'](_0x6110('0x10f'));db[_0x6110('0x110')]=db[_0x6110('0x1')][_0x6110('0x13')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x6110('0x111')]=db['sequelize'][_0x6110('0x13')](_0x6110('0x112'));db['WhatsappQueueReport']=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x113'));db[_0x6110('0x114')]=db[_0x6110('0x1')]['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x6110('0x115')]=db[_0x6110('0x1')][_0x6110('0x13')]('../api/whatsappQueue/whatsappQueue.model');db[_0x6110('0x116')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x117'));db['TeamVoiceQueue']=db['sequelize'][_0x6110('0x13')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x6110('0x118')]=db['sequelize'][_0x6110('0x13')](_0x6110('0x119'));db[_0x6110('0x11a')]=db[_0x6110('0x1')][_0x6110('0x13')](_0x6110('0x11b'));db[_0x6110('0x11c')]=db['sequelize']['import'](_0x6110('0x11d'));db['User'][_0x6110('0x11e')](db[_0x6110('0x11f')],{'as':_0x6110('0x11f'),'onDelete':'cascade','foreignKey':_0x6110('0x120')});db[_0x6110('0x121')][_0x6110('0x11e')](db[_0x6110('0x11c')],{'as':_0x6110('0x122'),'onDelete':_0x6110('0x123'),'foreignKey':'UserId'});db[_0x6110('0x121')][_0x6110('0x124')](db[_0x6110('0x125')],{'as':'Recordings','foreignKey':_0x6110('0x120')});db[_0x6110('0x121')][_0x6110('0x124')](db['UserVoiceQueueRt'],{'as':'VoiceQueuesRt','foreignKey':_0x6110('0x120')});db['User'][_0x6110('0x124')](db['VoiceExtension'],{'as':_0x6110('0x126'),'onDelete':'cascade','hooks':!![]});db[_0x6110('0x121')]['hasMany'](db[_0x6110('0x76')],{'as':_0x6110('0x127'),'foreignKey':_0x6110('0x120')});db['User'][_0x6110('0x124')](db['CmHopperHistory'],{'as':_0x6110('0x128'),'foreignKey':'UserId'});db['User'][_0x6110('0x124')](db[_0x6110('0x79')],{'as':_0x6110('0x79'),'foreignKey':_0x6110('0x120')});db[_0x6110('0x121')]['hasMany'](db[_0x6110('0x129')],{'as':'OpenchannelInteractions','foreignKey':_0x6110('0x120')});db[_0x6110('0x121')]['hasMany'](db[_0x6110('0x12a')],{'as':_0x6110('0x12b'),'foreignKey':_0x6110('0x120')});db[_0x6110('0x121')][_0x6110('0x124')](db[_0x6110('0x58')],{'as':_0x6110('0x12c'),'foreignKey':_0x6110('0x120')});db[_0x6110('0x121')][_0x6110('0x124')](db[_0x6110('0x4d')],{'as':_0x6110('0x12d'),'foreignKey':_0x6110('0x120')});db[_0x6110('0x121')][_0x6110('0x124')](db[_0x6110('0x40')],{'as':_0x6110('0x12e'),'foreignKey':'UserId'});db[_0x6110('0x121')][_0x6110('0x124')](db[_0x6110('0x110')],{'as':_0x6110('0x12f'),'foreignKey':_0x6110('0x120')});db[_0x6110('0x121')][_0x6110('0x124')](db[_0x6110('0x130')],{'as':_0x6110('0x131'),'foreignKey':'SenderId'});db[_0x6110('0x121')]['belongsTo'](db['UserProfile'],{'as':_0x6110('0x132'),'foreignKey':'userProfileId'});db['User']['belongsToMany'](db['ChatGroup'],{'as':_0x6110('0x133'),'through':_0x6110('0x134')});db[_0x6110('0x121')][_0x6110('0x135')](db[_0x6110('0x73')],{'as':_0x6110('0x136'),'through':_0x6110('0x137')});db['User'][_0x6110('0x135')](db['CmList'],{'as':_0x6110('0x138'),'through':_0x6110('0x139')});db[_0x6110('0x121')][_0x6110('0x135')](db['Team'],{'through':_0x6110('0x13a')});db[_0x6110('0x121')][_0x6110('0x135')](db['MailInteraction'],{'as':_0x6110('0x12e'),'through':_0x6110('0x13b')});db[_0x6110('0x121')][_0x6110('0x135')](db[_0x6110('0x12a')],{'as':'ChatInteractions','through':'user_has_chat_interactions'});db['User'][_0x6110('0x135')](db['FaxInteraction'],{'as':_0x6110('0x12d'),'through':_0x6110('0x13c')});db[_0x6110('0x121')][_0x6110('0x135')](db[_0x6110('0x58')],{'as':'SmsInteractions','through':'user_has_sms_interactions'});db[_0x6110('0x121')]['belongsToMany'](db[_0x6110('0x129')],{'as':'OpenchannelInteractions','through':_0x6110('0x13d')});db[_0x6110('0x121')][_0x6110('0x135')](db[_0x6110('0x110')],{'as':'WhatsappInteractions','through':_0x6110('0x13e')});db['User'][_0x6110('0x135')](db[_0x6110('0x19')],{'as':_0x6110('0x13f'),'through':_0x6110('0x2d'),'required':![]});db[_0x6110('0x121')][_0x6110('0x135')](db[_0x6110('0x104')],{'as':_0x6110('0x140'),'through':'UserVoicePrefix','required':![]});db[_0x6110('0x121')][_0x6110('0x135')](db['MailQueue'],{'as':'MailQueues','through':_0x6110('0x2f'),'required':![]});db[_0x6110('0x121')]['belongsToMany'](db[_0x6110('0x6b')],{'as':_0x6110('0x141'),'through':_0x6110('0x2e'),'required':![],'hooks':!![]});db[_0x6110('0x121')][_0x6110('0x135')](db[_0x6110('0x51')],{'as':'FaxQueues','through':'UserFaxQueue','required':![]});db[_0x6110('0x121')][_0x6110('0x135')](db['SmsQueue'],{'as':_0x6110('0x142'),'through':'UserSmsQueue','required':![]});db['User'][_0x6110('0x135')](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':_0x6110('0x34'),'required':![]});db[_0x6110('0x121')]['belongsToMany'](db[_0x6110('0x115')],{'as':'WhatsappQueues','through':_0x6110('0x143'),'required':![]});db[_0x6110('0x121')]['belongsToMany'](db[_0x6110('0x144')],{'through':_0x6110('0x139')});db[_0x6110('0x121')]['belongsToMany'](db['ChatWebsite'],{'as':_0x6110('0x145'),'through':_0x6110('0x146')});db[_0x6110('0x121')][_0x6110('0x135')](db[_0x6110('0x147')],{'as':_0x6110('0x148'),'through':_0x6110('0x149')});db['User'][_0x6110('0x135')](db[_0x6110('0x3a')],{'as':'MailAccounts','through':_0x6110('0x14a')});db[_0x6110('0x121')][_0x6110('0x135')](db[_0x6110('0x5d')],{'as':_0x6110('0x14b'),'through':_0x6110('0x14c')});db[_0x6110('0x121')][_0x6110('0x135')](db[_0x6110('0x54')],{'as':_0x6110('0x14d'),'through':_0x6110('0x14e')});db[_0x6110('0x121')]['belongsToMany'](db[_0x6110('0x10c')],{'as':'WhatsappAccounts','through':_0x6110('0x14f')});db[_0x6110('0x14')][_0x6110('0x124')](db[_0x6110('0x17')],{'as':_0x6110('0x150'),'onDelete':_0x6110('0x123'),'foreignKey':'ChanSpyId'});db[_0x6110('0x151')][_0x6110('0x124')](db[_0x6110('0x17')],{'onDelete':_0x6110('0x123')});db['VoiceExtension'][_0x6110('0x124')](db[_0x6110('0x17')],{'as':'Applications','onDelete':_0x6110('0x123')});db[_0x6110('0x18')]['belongsToMany'](db[_0x6110('0x8e')],{'as':_0x6110('0x152'),'through':_0x6110('0x153')});db[_0x6110('0x19')][_0x6110('0x124')](db[_0x6110('0x154')],{'as':_0x6110('0x155'),'foreignKey':_0x6110('0x156')});db[_0x6110('0x19')][_0x6110('0x124')](db[_0x6110('0x74')],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0x6110('0x76')],{'as':'HopperFinals','foreignKey':_0x6110('0x156')});db[_0x6110('0x19')]['hasMany'](db[_0x6110('0x77')],{'as':_0x6110('0x157'),'foreignKey':_0x6110('0x156')});db[_0x6110('0x19')][_0x6110('0x124')](db['ReportAgentPreview'],{'as':_0x6110('0x79'),'foreignKey':_0x6110('0x156')});db[_0x6110('0x19')][_0x6110('0x124')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x6110('0x156')});db[_0x6110('0x19')][_0x6110('0x124')](db[_0x6110('0xe1')],{'as':_0x6110('0x158'),'foreignKey':_0x6110('0x156')});db['VoiceQueue']['belongsTo'](db['Trunk'],{'as':'Trunk','foreignKey':_0x6110('0x159')});db[_0x6110('0x19')][_0x6110('0x15a')](db[_0x6110('0x28')],{'as':'TrunkBackup','foreignKey':_0x6110('0x15b')});db[_0x6110('0x19')][_0x6110('0x15a')](db[_0x6110('0x85')],{'as':'Interval','foreignKey':_0x6110('0x15c')});db['VoiceQueue'][_0x6110('0x15a')](db[_0x6110('0x87')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x6110('0x19')][_0x6110('0x135')](db[_0x6110('0x144')],{'as':_0x6110('0x138'),'through':_0x6110('0x15d')});db['VoiceQueue'][_0x6110('0x135')](db[_0x6110('0x121')],{'as':_0x6110('0x15e'),'through':_0x6110('0x2d')});db[_0x6110('0x19')][_0x6110('0x135')](db[_0x6110('0xf1')],{'as':_0x6110('0x15f'),'through':_0x6110('0x160')});db[_0x6110('0x19')][_0x6110('0x135')](db[_0x6110('0x144')],{'as':_0x6110('0x161'),'through':_0x6110('0x162')});db[_0x6110('0x125')][_0x6110('0x15a')](db[_0x6110('0x121')],{'as':_0x6110('0x121'),'foreignKey':_0x6110('0x120')});db[_0x6110('0x1b')]['belongsTo'](db['User'],{'as':'User','foreignKey':_0x6110('0x120')});db['VoiceMail']['hasMany'](db[_0x6110('0x1e')],{'as':'Messages','onDelete':_0x6110('0x123'),'foreignKey':'mailboxuser','sourceKey':'mailbox'});db['VoiceMailMessage'][_0x6110('0x15a')](db[_0x6110('0x11f')],{'foreignKey':_0x6110('0x163'),'targetKey':_0x6110('0x164')});db[_0x6110('0x165')][_0x6110('0x124')](db[_0x6110('0x25')],{'as':_0x6110('0x166'),'foreignKey':_0x6110('0x167'),'constraints':![]});db[_0x6110('0x165')][_0x6110('0x124')](db[_0x6110('0x23')],{'as':_0x6110('0x168'),'foreignKey':_0x6110('0x167'),'constraints':![]});db[_0x6110('0x165')]['belongsTo'](db['User'],{'as':'User','foreignKey':_0x6110('0x120')});db[_0x6110('0x165')][_0x6110('0x15a')](db[_0x6110('0x73')],{'as':_0x6110('0x169'),'foreignKey':'ContactId'});db[_0x6110('0x37')]['belongsTo'](db[_0x6110('0x3a')],{'as':_0x6110('0x3a'),'foreignKey':'MailAccountId'});db[_0x6110('0x37')][_0x6110('0x15a')](db['CloudProvider'],{'as':_0x6110('0x116'),'foreignKey':_0x6110('0x16a'),'onDelete':'restrict'});db[_0x6110('0x39')][_0x6110('0x15a')](db[_0x6110('0x3a')],{'as':_0x6110('0x3a'),'foreignKey':_0x6110('0x16b')});db[_0x6110('0x39')][_0x6110('0x15a')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':'CloudProviderId','onDelete':_0x6110('0x16c')});db[_0x6110('0x3a')][_0x6110('0x11e')](db[_0x6110('0x37')],{'as':_0x6110('0x16d'),'onDelete':_0x6110('0x123')});db['MailAccount']['hasOne'](db[_0x6110('0x39')],{'as':_0x6110('0x16e'),'onDelete':_0x6110('0x123')});db[_0x6110('0x3a')][_0x6110('0x124')](db[_0x6110('0x82')],{'as':_0x6110('0x16f'),'foreignKey':'MailAccountId','onDelete':_0x6110('0x123')});db[_0x6110('0x3a')][_0x6110('0x124')](db[_0x6110('0x170')],{'as':_0x6110('0x171'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x6110('0x124')](db[_0x6110('0x42')],{'as':_0x6110('0x172'),'foreignKey':_0x6110('0x16b')});db[_0x6110('0x3a')][_0x6110('0x124')](db[_0x6110('0x40')],{'as':_0x6110('0x173')});db[_0x6110('0x3a')]['hasMany'](db[_0x6110('0x43')],{'as':'Applications'});db[_0x6110('0x3a')]['belongsTo'](db[_0x6110('0x144')],{'as':_0x6110('0x174'),'foreignKey':'ListId'});db[_0x6110('0x3a')][_0x6110('0x15a')](db['Template'],{'as':_0x6110('0x95'),'foreignKey':_0x6110('0x175')});db[_0x6110('0x3a')][_0x6110('0x15a')](db[_0x6110('0x87')],{'as':_0x6110('0x176'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0x6110('0x135')](db['User'],{'as':_0x6110('0x15e'),'through':_0x6110('0x14a')});db[_0x6110('0x3c')][_0x6110('0x135')](db['User'],{'as':_0x6110('0x15e'),'through':_0x6110('0x2f')});db[_0x6110('0x3c')][_0x6110('0x135')](db[_0x6110('0xf1')],{'through':_0x6110('0x177'),'as':_0x6110('0x15f')});db[_0x6110('0x40')][_0x6110('0x124')](db['MailMessage'],{'as':_0x6110('0x172'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0x6110('0x40')]['belongsTo'](db[_0x6110('0x3a')],{'as':'Account','foreignKey':_0x6110('0x16b')});db[_0x6110('0x40')]['belongsTo'](db[_0x6110('0x73')],{'as':'Contact','foreignKey':_0x6110('0x178')});db[_0x6110('0x40')][_0x6110('0x15a')](db[_0x6110('0x121')],{'as':_0x6110('0x179'),'foreignKey':_0x6110('0x120')});db[_0x6110('0x40')][_0x6110('0x135')](db[_0x6110('0x90')],{'through':_0x6110('0x17a'),'as':_0x6110('0x17b')});db[_0x6110('0x40')]['belongsToMany'](db[_0x6110('0x90')],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db[_0x6110('0x40')][_0x6110('0x135')](db['User'],{'as':_0x6110('0x17c'),'through':'user_has_mail_interactions','foreignKey':_0x6110('0x17d')});db[_0x6110('0x42')][_0x6110('0x124')](db[_0x6110('0xf7')],{'as':'Attachments','onDelete':'cascade'});db[_0x6110('0x42')]['belongsTo'](db[_0x6110('0x121')],{'as':_0x6110('0x121')});db[_0x6110('0x42')][_0x6110('0x15a')](db['CmContact'],{'onDelete':_0x6110('0x123'),'as':_0x6110('0x169')});db[_0x6110('0x42')][_0x6110('0x15a')](db[_0x6110('0x40')],{'as':_0x6110('0x17e'),'foreignKey':'MailInteractionId'});db[_0x6110('0x42')][_0x6110('0x15a')](db[_0x6110('0x3a')],{'as':_0x6110('0x17f'),'foreignKey':_0x6110('0x16b')});db['MailMessage'][_0x6110('0x15a')](db[_0x6110('0x64')],{'as':_0x6110('0x64'),'foreignKey':_0x6110('0x180')});db[_0x6110('0x42')][_0x6110('0x15a')](db[_0x6110('0x69')],{'as':_0x6110('0x69'),'foreignKey':_0x6110('0x181')});db[_0x6110('0x43')][_0x6110('0x15a')](db[_0x6110('0x121')],{'onDelete':_0x6110('0x16c')});db[_0x6110('0x43')][_0x6110('0x15a')](db[_0x6110('0x3c')],{'onDelete':_0x6110('0x16c')});db['MailApplication']['belongsTo'](db['MailAccount'],{'onDelete':'restrict'});db['MailApplication'][_0x6110('0x15a')](db[_0x6110('0x85')],{'onDelete':_0x6110('0x16c'),'foreignKey':_0x6110('0x15c')});db['MailApplication']['belongsTo'](db[_0x6110('0x90')],{'onDelete':_0x6110('0x16c'),'foreignKey':_0x6110('0x182')});db['MailQueueReport'][_0x6110('0x15a')](db[_0x6110('0x3a')],{});db[_0x6110('0x45')][_0x6110('0x15a')](db[_0x6110('0x144')],{'as':_0x6110('0x174'),'foreignKey':_0x6110('0x183')});db['MailQueueReport']['belongsTo'](db['CmContact'],{'as':_0x6110('0x169'),'foreignKey':_0x6110('0x178')});db[_0x6110('0x45')][_0x6110('0x15a')](db[_0x6110('0x40')],{});db[_0x6110('0x45')]['belongsTo'](db['MailMessage'],{});db['MailQueueReport'][_0x6110('0x15a')](db[_0x6110('0x121')],{});db[_0x6110('0x45')][_0x6110('0x15a')](db[_0x6110('0x3c')],{});db[_0x6110('0x184')]['hasMany'](db['DashboardItem'],{'as':_0x6110('0x185'),'onDelete':_0x6110('0x123')});db['FaxAccount']['hasMany'](db[_0x6110('0x82')],{'as':'Dispositions','foreignKey':_0x6110('0x186'),'onDelete':'cascade'});db['FaxAccount'][_0x6110('0x124')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x6110('0x186')});db['FaxAccount']['hasMany'](db[_0x6110('0x4d')],{'as':_0x6110('0x173')});db[_0x6110('0x147')][_0x6110('0x124')](db[_0x6110('0x4b')],{'as':_0x6110('0x187')});db[_0x6110('0x147')][_0x6110('0x124')](db[_0x6110('0x17')],{'as':_0x6110('0x188'),'onDelete':_0x6110('0x123')});db[_0x6110('0x147')][_0x6110('0x124')](db[_0x6110('0x4f')],{'as':_0x6110('0x172')});db[_0x6110('0x147')][_0x6110('0x15a')](db[_0x6110('0x28')],{'as':_0x6110('0x28')});db[_0x6110('0x147')]['belongsTo'](db[_0x6110('0x144')],{'as':'List','foreignKey':_0x6110('0x183')});db[_0x6110('0x147')]['belongsTo'](db[_0x6110('0x87')],{'as':_0x6110('0x176'),'foreignKey':'mandatoryDispositionPauseId'});db['FaxAccount'][_0x6110('0x135')](db[_0x6110('0x121')],{'as':_0x6110('0x15e'),'through':_0x6110('0x149')});db[_0x6110('0x4b')]['belongsTo'](db[_0x6110('0x121')],{'onDelete':'restrict'});db[_0x6110('0x4b')]['belongsTo'](db[_0x6110('0x51')],{'onDelete':'restrict'});db[_0x6110('0x4b')]['belongsTo'](db[_0x6110('0x147')],{'onDelete':'restrict'});db['FaxApplication'][_0x6110('0x15a')](db[_0x6110('0x90')],{'onDelete':_0x6110('0x16c'),'foreignKey':_0x6110('0x182')});db[_0x6110('0x4d')]['hasMany'](db[_0x6110('0x4f')],{'as':_0x6110('0x172'),'onDelete':'cascade','foreignKey':_0x6110('0x189')});db['FaxInteraction']['belongsTo'](db[_0x6110('0x147')],{'as':_0x6110('0x17f'),'foreignKey':_0x6110('0x186')});db[_0x6110('0x4d')]['belongsTo'](db['CmContact'],{'as':_0x6110('0x169'),'foreignKey':_0x6110('0x178')});db[_0x6110('0x4d')]['belongsTo'](db[_0x6110('0x121')],{'as':_0x6110('0x179'),'foreignKey':'UserId'});db[_0x6110('0x4d')][_0x6110('0x135')](db[_0x6110('0x90')],{'through':_0x6110('0x18a'),'as':_0x6110('0x17b')});db[_0x6110('0x4d')][_0x6110('0x135')](db['Tag'],{'through':_0x6110('0x18a'),'as':_0x6110('0x18b')});db['FaxInteraction'][_0x6110('0x135')](db[_0x6110('0x121')],{'as':_0x6110('0x17c'),'through':_0x6110('0x13c'),'foreignKey':_0x6110('0x189')});db[_0x6110('0x4f')][_0x6110('0x15a')](db[_0x6110('0x121')],{'onDelete':_0x6110('0x123'),'as':'User'});db[_0x6110('0x4f')][_0x6110('0x15a')](db[_0x6110('0x4d')],{'as':_0x6110('0x17e'),'foreignKey':'FaxInteractionId'});db['FaxMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x6110('0x123'),'as':'Contact'});db[_0x6110('0x4f')][_0x6110('0x15a')](db[_0x6110('0xf7')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x6110('0x4f')][_0x6110('0x15a')](db[_0x6110('0x147')],{'as':_0x6110('0x17f'),'foreignKey':_0x6110('0x186')});db[_0x6110('0x51')]['belongsToMany'](db[_0x6110('0x121')],{'as':_0x6110('0x15e'),'through':_0x6110('0x31')});db[_0x6110('0x51')][_0x6110('0x135')](db[_0x6110('0xf1')],{'through':_0x6110('0x18c'),'as':_0x6110('0x15f')});db[_0x6110('0x53')][_0x6110('0x15a')](db[_0x6110('0x147')],{});db[_0x6110('0x53')][_0x6110('0x15a')](db['CmList'],{'as':_0x6110('0x174'),'foreignKey':_0x6110('0x183')});db[_0x6110('0x53')][_0x6110('0x15a')](db[_0x6110('0x73')],{'as':'Contact','foreignKey':_0x6110('0x178')});db[_0x6110('0x53')][_0x6110('0x15a')](db[_0x6110('0x4d')],{});db[_0x6110('0x53')]['belongsTo'](db[_0x6110('0x4f')],{});db['FaxQueueReport'][_0x6110('0x15a')](db[_0x6110('0x121')],{});db[_0x6110('0x53')][_0x6110('0x15a')](db[_0x6110('0x51')],{});db[_0x6110('0x54')]['hasMany'](db['Disposition'],{'as':_0x6110('0x16f'),'foreignKey':'SmsAccountId','onDelete':'cascade'});db[_0x6110('0x54')][_0x6110('0x124')](db[_0x6110('0x170')],{'as':_0x6110('0x171'),'foreignKey':_0x6110('0x18d')});db[_0x6110('0x54')][_0x6110('0x124')](db[_0x6110('0x5a')],{'as':_0x6110('0x172'),'foreignKey':_0x6110('0x18d')});db[_0x6110('0x54')][_0x6110('0x124')](db[_0x6110('0x58')],{'as':_0x6110('0x173')});db[_0x6110('0x54')][_0x6110('0x124')](db[_0x6110('0x56')],{'as':_0x6110('0x187')});db[_0x6110('0x54')][_0x6110('0x15a')](db['CmList'],{'as':_0x6110('0x174'),'foreignKey':_0x6110('0x183')});db['SmsAccount'][_0x6110('0x15a')](db[_0x6110('0x87')],{'as':_0x6110('0x176'),'foreignKey':_0x6110('0x18e')});db[_0x6110('0x54')]['belongsToMany'](db[_0x6110('0x121')],{'as':_0x6110('0x15e'),'through':_0x6110('0x14e')});db[_0x6110('0x56')][_0x6110('0x15a')](db['User'],{'onDelete':'restrict'});db[_0x6110('0x56')][_0x6110('0x15a')](db[_0x6110('0x5c')],{'onDelete':'restrict'});db[_0x6110('0x56')][_0x6110('0x15a')](db[_0x6110('0x54')],{'onDelete':_0x6110('0x16c')});db[_0x6110('0x56')]['belongsTo'](db['Interval'],{'onDelete':_0x6110('0x16c'),'foreignKey':_0x6110('0x15c')});db[_0x6110('0x56')]['belongsTo'](db[_0x6110('0x90')],{'onDelete':_0x6110('0x16c'),'foreignKey':_0x6110('0x182')});db['SmsInteraction'][_0x6110('0x124')](db['SmsMessage'],{'as':_0x6110('0x172'),'onDelete':_0x6110('0x123'),'foreignKey':_0x6110('0x18f')});db[_0x6110('0x58')]['belongsTo'](db[_0x6110('0x54')],{'as':_0x6110('0x17f'),'foreignKey':'SmsAccountId'});db[_0x6110('0x58')][_0x6110('0x15a')](db[_0x6110('0x73')],{'as':_0x6110('0x169'),'foreignKey':_0x6110('0x178')});db[_0x6110('0x58')][_0x6110('0x15a')](db[_0x6110('0x121')],{'as':_0x6110('0x179'),'foreignKey':_0x6110('0x120')});db[_0x6110('0x58')][_0x6110('0x135')](db[_0x6110('0x90')],{'through':_0x6110('0x190'),'as':_0x6110('0x17b')});db[_0x6110('0x58')]['belongsToMany'](db[_0x6110('0x90')],{'through':_0x6110('0x190'),'as':_0x6110('0x18b')});db['SmsInteraction']['belongsToMany'](db['User'],{'as':_0x6110('0x17c'),'through':_0x6110('0x191'),'foreignKey':_0x6110('0x18f')});db[_0x6110('0x5a')][_0x6110('0x15a')](db[_0x6110('0x121')],{'as':_0x6110('0x121')});db[_0x6110('0x5a')]['belongsTo'](db['CmContact'],{'onDelete':_0x6110('0x123'),'as':'Contact'});db[_0x6110('0x5a')][_0x6110('0x15a')](db[_0x6110('0x58')],{'onDelete':_0x6110('0x123'),'as':_0x6110('0x17e'),'foreignKey':_0x6110('0x18f')});db[_0x6110('0x5a')][_0x6110('0x15a')](db[_0x6110('0x54')],{'as':'Account','foreignKey':_0x6110('0x18d')});db[_0x6110('0x5c')][_0x6110('0x135')](db[_0x6110('0x121')],{'as':_0x6110('0x15e'),'through':_0x6110('0x33'),'foreignKey':_0x6110('0x192')});db['SmsQueue'][_0x6110('0x135')](db[_0x6110('0xf1')],{'through':_0x6110('0x193'),'as':_0x6110('0x15f')});db['OpenchannelAccount'][_0x6110('0x124')](db[_0x6110('0x82')],{'as':_0x6110('0x16f'),'foreignKey':_0x6110('0x194'),'onDelete':_0x6110('0x123')});db[_0x6110('0x5d')]['hasMany'](db[_0x6110('0x170')],{'as':_0x6110('0x171'),'foreignKey':'OpenchannelAccountId'});db[_0x6110('0x5d')]['hasMany'](db['OpenchannelInteraction'],{'as':'Interactions','foreignKey':_0x6110('0x194')});db[_0x6110('0x5d')][_0x6110('0x124')](db[_0x6110('0x61')],{'as':'Messages','foreignKey':_0x6110('0x194')});db[_0x6110('0x5d')][_0x6110('0x124')](db[_0x6110('0x5f')],{'as':_0x6110('0x187'),'foreignKey':_0x6110('0x194')});db['OpenchannelAccount'][_0x6110('0x15a')](db[_0x6110('0x144')],{'as':'List','foreignKey':_0x6110('0x183')});db[_0x6110('0x5d')][_0x6110('0x15a')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x6110('0x18e')});db[_0x6110('0x5d')][_0x6110('0x135')](db[_0x6110('0x121')],{'as':'Agents','through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0x6110('0x15a')](db[_0x6110('0x121')],{'onDelete':_0x6110('0x16c')});db[_0x6110('0x5f')][_0x6110('0x15a')](db[_0x6110('0x62')],{'onDelete':_0x6110('0x16c'),'foreignKey':_0x6110('0x195')});db[_0x6110('0x5f')]['belongsTo'](db['OpenchannelAccount'],{'onDelete':_0x6110('0x16c'),'foreignKey':_0x6110('0x194')});db[_0x6110('0x5f')]['belongsTo'](db[_0x6110('0x85')],{'onDelete':_0x6110('0x16c'),'foreignKey':_0x6110('0x15c')});db[_0x6110('0x5f')][_0x6110('0x15a')](db[_0x6110('0x90')],{'onDelete':_0x6110('0x16c'),'foreignKey':_0x6110('0x182')});db[_0x6110('0x129')][_0x6110('0x124')](db['OpenchannelMessage'],{'as':'Messages','onDelete':_0x6110('0x123'),'foreignKey':_0x6110('0x196')});db[_0x6110('0x129')]['belongsTo'](db[_0x6110('0x5d')],{'as':_0x6110('0x17f'),'foreignKey':_0x6110('0x194')});db[_0x6110('0x129')][_0x6110('0x15a')](db[_0x6110('0x73')],{'as':_0x6110('0x169'),'foreignKey':_0x6110('0x178')});db[_0x6110('0x129')][_0x6110('0x15a')](db[_0x6110('0x121')],{'as':_0x6110('0x179'),'foreignKey':'UserId'});db['OpenchannelInteraction'][_0x6110('0x135')](db[_0x6110('0x90')],{'through':_0x6110('0x197'),'as':_0x6110('0x17b')});db[_0x6110('0x129')][_0x6110('0x135')](db[_0x6110('0x90')],{'through':_0x6110('0x197'),'as':_0x6110('0x18b')});db[_0x6110('0x129')]['belongsToMany'](db[_0x6110('0x121')],{'as':_0x6110('0x17c'),'through':'user_has_openchannel_interactions','foreignKey':'OpenchannelInteractionId'});db[_0x6110('0x61')][_0x6110('0x15a')](db[_0x6110('0x121')],{'onDelete':_0x6110('0x123'),'as':_0x6110('0x121')});db[_0x6110('0x61')][_0x6110('0x15a')](db['CmContact'],{'onDelete':_0x6110('0x123'),'as':'Contact'});db['OpenchannelMessage'][_0x6110('0x15a')](db[_0x6110('0x129')],{'onDelete':_0x6110('0x123'),'as':'Interaction','foreignKey':_0x6110('0x196')});db[_0x6110('0x61')][_0x6110('0x15a')](db[_0x6110('0xf7')],{'as':_0x6110('0xf7'),'foreignKey':'AttachmentId'});db['OpenchannelMessage'][_0x6110('0x15a')](db[_0x6110('0x5d')],{'as':_0x6110('0x17f'),'foreignKey':_0x6110('0x194')});db['OpenchannelQueue'][_0x6110('0x135')](db[_0x6110('0x121')],{'as':_0x6110('0x15e'),'through':_0x6110('0x34'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue'][_0x6110('0x135')](db['Team'],{'through':_0x6110('0x198'),'as':_0x6110('0x15f')});db['ChatWebsite'][_0x6110('0x124')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x6110('0x180'),'onDelete':_0x6110('0x123')});db[_0x6110('0x64')][_0x6110('0x124')](db[_0x6110('0x170')],{'as':_0x6110('0x171'),'foreignKey':'ChatWebsiteId'});db[_0x6110('0x64')]['hasMany'](db[_0x6110('0x6f')],{'as':_0x6110('0x199')});db[_0x6110('0x64')]['hasMany'](db[_0x6110('0x12a')],{'as':_0x6110('0x173')});db['ChatWebsite'][_0x6110('0x124')](db[_0x6110('0x19a')],{'as':'Applications'});db['ChatWebsite']['hasMany'](db['ChatMessage'],{'as':_0x6110('0x172')});db[_0x6110('0x64')]['belongsTo'](db['CmList'],{'as':_0x6110('0x174'),'foreignKey':'ListId'});db[_0x6110('0x64')]['belongsTo'](db['Interval'],{'as':_0x6110('0x85'),'foreignKey':_0x6110('0x15c')});db[_0x6110('0x64')]['belongsTo'](db[_0x6110('0x3a')],{'as':'MailAccount','foreignKey':_0x6110('0x16b')});db[_0x6110('0x64')][_0x6110('0x15a')](db['Pause'],{'as':_0x6110('0x176'),'foreignKey':_0x6110('0x18e')});db[_0x6110('0x64')][_0x6110('0x135')](db[_0x6110('0x121')],{'as':'Agents','through':_0x6110('0x146')});db[_0x6110('0x19b')][_0x6110('0x15a')](db[_0x6110('0x5d')],{});db[_0x6110('0x19b')][_0x6110('0x15a')](db[_0x6110('0x144')],{'as':_0x6110('0x174'),'foreignKey':_0x6110('0x183')});db['OpenchannelQueueReport']['belongsTo'](db[_0x6110('0x73')],{'as':'Contact','foreignKey':'ContactId'});db['OpenchannelQueueReport']['belongsTo'](db[_0x6110('0x129')],{});db[_0x6110('0x19b')][_0x6110('0x15a')](db[_0x6110('0x61')],{});db[_0x6110('0x19b')][_0x6110('0x15a')](db[_0x6110('0x121')],{});db[_0x6110('0x19b')]['belongsTo'](db[_0x6110('0x62')],{});db[_0x6110('0x19a')][_0x6110('0x15a')](db['User'],{'as':'Agent','foreignKey':'UserId','onDelete':'restrict'});db['ChatApplication'][_0x6110('0x15a')](db[_0x6110('0x6b')],{'as':_0x6110('0x19c'),'foreignKey':_0x6110('0x19d'),'onDelete':_0x6110('0x16c')});db[_0x6110('0x19a')][_0x6110('0x15a')](db[_0x6110('0x64')],{'as':_0x6110('0x19e'),'foreignKey':_0x6110('0x180'),'onDelete':'restrict'});db[_0x6110('0x19a')][_0x6110('0x15a')](db[_0x6110('0x90')],{'onDelete':'restrict','foreignKey':_0x6110('0x182')});db[_0x6110('0x12a')]['hasMany'](db['ChatMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':'ChatInteractionId'});db[_0x6110('0x12a')][_0x6110('0x15a')](db[_0x6110('0x64')],{'as':_0x6110('0x17f'),'foreignKey':'ChatWebsiteId'});db[_0x6110('0x12a')][_0x6110('0x15a')](db['CmContact'],{'as':_0x6110('0x169'),'foreignKey':'ContactId'});db[_0x6110('0x12a')][_0x6110('0x15a')](db[_0x6110('0x121')],{'as':_0x6110('0x179'),'foreignKey':_0x6110('0x120')});db[_0x6110('0x12a')]['belongsToMany'](db[_0x6110('0x90')],{'through':_0x6110('0x19f'),'as':'Tags'});db['ChatInteraction']['belongsToMany'](db[_0x6110('0x90')],{'through':_0x6110('0x19f'),'as':_0x6110('0x18b')});db[_0x6110('0x12a')]['belongsToMany'](db[_0x6110('0x121')],{'as':'Users','through':_0x6110('0x1a0'),'foreignKey':_0x6110('0x1a1')});db[_0x6110('0x67')]['belongsTo'](db[_0x6110('0x121')],{'onDelete':_0x6110('0x123'),'as':'User'});db['ChatMessage'][_0x6110('0x15a')](db[_0x6110('0x73')],{'onDelete':_0x6110('0x123'),'as':'Contact','foreignKey':'ContactId'});db[_0x6110('0x67')][_0x6110('0x15a')](db[_0x6110('0x12a')],{'onDelete':_0x6110('0x123'),'as':_0x6110('0x17e'),'foreignKey':_0x6110('0x1a1')});db[_0x6110('0x67')]['belongsTo'](db[_0x6110('0xf7')],{'as':_0x6110('0xf7'),'foreignKey':_0x6110('0x1a2')});db[_0x6110('0x67')][_0x6110('0x15a')](db[_0x6110('0x64')],{'as':_0x6110('0x17f'),'foreignKey':_0x6110('0x180')});db['ChatOfflineMessage']['hasMany'](db[_0x6110('0xf7')],{'as':_0x6110('0x1a3'),'foreignKey':_0x6110('0x181'),'onDelete':_0x6110('0x123'),'hooks':!![]});db[_0x6110('0x69')][_0x6110('0x15a')](db[_0x6110('0x73')],{'onDelete':_0x6110('0x123'),'as':_0x6110('0x169'),'foreignKey':_0x6110('0x178')});db[_0x6110('0x69')][_0x6110('0x15a')](db[_0x6110('0x64')],{'as':_0x6110('0x17f'),'foreignKey':'ChatWebsiteId'});db[_0x6110('0x6b')][_0x6110('0x135')](db[_0x6110('0x121')],{'as':_0x6110('0x15e'),'through':'UserChatQueue','hooks':!![]});db[_0x6110('0x6b')][_0x6110('0x135')](db['Team'],{'through':_0x6110('0x1a4'),'as':_0x6110('0x15f')});db[_0x6110('0x6d')][_0x6110('0x124')](db[_0x6110('0x1a5')],{'as':'Messages','foreignKey':_0x6110('0x1a6'),'onDelete':_0x6110('0x123')});db[_0x6110('0x6d')][_0x6110('0x135')](db[_0x6110('0x121')],{'as':_0x6110('0x155'),'through':_0x6110('0x134')});db[_0x6110('0x6f')]['belongsTo'](db[_0x6110('0x64')],{'as':'Website','foreignKey':_0x6110('0x180')});db[_0x6110('0x71')][_0x6110('0x124')](db[_0x6110('0x73')],{'as':_0x6110('0x136'),'foreignKey':_0x6110('0x1a7')});db[_0x6110('0x73')][_0x6110('0x124')](db[_0x6110('0x1a8')],{'as':_0x6110('0x1a9'),'foreignKey':'CmContactId'});db[_0x6110('0x73')][_0x6110('0x124')](db[_0x6110('0x74')],{'as':_0x6110('0x1aa'),'foreignKey':_0x6110('0x178')});db[_0x6110('0x73')]['hasMany'](db[_0x6110('0x76')],{'as':_0x6110('0x127'),'foreignKey':_0x6110('0x178')});db[_0x6110('0x73')]['hasMany'](db[_0x6110('0x77')],{'as':'HopperHistories','foreignKey':_0x6110('0x178')});db[_0x6110('0x73')][_0x6110('0x124')](db[_0x6110('0x79')],{'as':_0x6110('0x79'),'foreignKey':_0x6110('0x178')});db['CmContact'][_0x6110('0x124')](db[_0x6110('0xe1')],{'as':_0x6110('0x158'),'foreignKey':_0x6110('0x178')});db[_0x6110('0x73')][_0x6110('0x124')](db[_0x6110('0x129')],{'as':_0x6110('0x1ab'),'foreignKey':_0x6110('0x178'),'onDelete':'restrict'});db[_0x6110('0x73')][_0x6110('0x124')](db[_0x6110('0x12a')],{'as':_0x6110('0x12b'),'foreignKey':_0x6110('0x178'),'onDelete':_0x6110('0x16c')});db[_0x6110('0x73')]['hasMany'](db[_0x6110('0x58')],{'as':_0x6110('0x12c'),'foreignKey':_0x6110('0x178'),'onDelete':_0x6110('0x16c')});db[_0x6110('0x73')][_0x6110('0x124')](db[_0x6110('0x4d')],{'as':'FaxInteractions','foreignKey':_0x6110('0x178'),'onDelete':_0x6110('0x16c')});db['CmContact'][_0x6110('0x124')](db[_0x6110('0x40')],{'as':_0x6110('0x12e'),'foreignKey':_0x6110('0x178'),'onDelete':_0x6110('0x16c')});db['CmContact'][_0x6110('0x15a')](db[_0x6110('0x71')],{'as':_0x6110('0x1ac'),'foreignKey':_0x6110('0x1a7')});db[_0x6110('0x73')][_0x6110('0x15a')](db[_0x6110('0x144')],{'as':_0x6110('0x174'),'foreignKey':_0x6110('0x183'),'onDelete':_0x6110('0x123')});db[_0x6110('0x73')][_0x6110('0x135')](db['User'],{'as':'Users','through':'cm_user_has_contacts'});db[_0x6110('0x73')][_0x6110('0x135')](db[_0x6110('0x90')],{'as':_0x6110('0x17b'),'through':_0x6110('0x1ad')});db['CmContact'][_0x6110('0x135')](db['Tag'],{'through':'cm_contact_has_tags','as':_0x6110('0x18b')});db['CmHopper'][_0x6110('0x124')](db[_0x6110('0x94')],{'as':_0x6110('0x1ae'),'foreignKey':_0x6110('0x1af')});db[_0x6110('0x74')]['belongsTo'](db[_0x6110('0x73')],{'as':_0x6110('0x169'),'foreignKey':_0x6110('0x178'),'onDelete':_0x6110('0x123')});db[_0x6110('0x74')][_0x6110('0x15a')](db[_0x6110('0x144')],{'as':_0x6110('0x174'),'foreignKey':_0x6110('0x183'),'onDelete':_0x6110('0x123')});db['CmHopper'][_0x6110('0x15a')](db['User'],{'as':_0x6110('0x1b0'),'foreignKey':_0x6110('0x120')});db[_0x6110('0x74')][_0x6110('0x15a')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x6110('0x156'),'onDelete':_0x6110('0x123')});db[_0x6110('0x74')][_0x6110('0x15a')](db[_0x6110('0xf3')],{'as':_0x6110('0xf3'),'foreignKey':_0x6110('0x1b1'),'onDelete':_0x6110('0x123')});db[_0x6110('0x74')][_0x6110('0x15a')](db['User'],{'as':_0x6110('0x179'),'foreignKey':_0x6110('0x1b2')});db[_0x6110('0x1b3')][_0x6110('0x15a')](db[_0x6110('0x73')],{'as':_0x6110('0x169'),'foreignKey':_0x6110('0x178'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x6110('0x183'),'onDelete':'cascade'});db['CmHopperBlack'][_0x6110('0x15a')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x6110('0x156'),'onDelete':_0x6110('0x123')});db[_0x6110('0x1b3')][_0x6110('0x15a')](db[_0x6110('0xf3')],{'as':'Campaign','foreignKey':_0x6110('0x1b1'),'onDelete':_0x6110('0x123')});db['Automation']['hasMany'](db[_0x6110('0x84')],{'as':{'plural':_0x6110('0x1b4'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':_0x6110('0x123'),'hooks':!![]});db[_0x6110('0x7f')][_0x6110('0x124')](db[_0x6110('0x84')],{'as':{'plural':'Any','singular':_0x6110('0x1b5')},'foreignKey':_0x6110('0x1b6'),'onDelete':_0x6110('0x123'),'hooks':!![]});db[_0x6110('0x7f')][_0x6110('0x124')](db[_0x6110('0x7d')],{'as':_0x6110('0x1b7'),'foreignKey':_0x6110('0x1b8'),'onDelete':_0x6110('0x123'),'hooks':!![]});db[_0x6110('0x82')][_0x6110('0x124')](db[_0x6110('0x82')],{'as':_0x6110('0x16f'),'foreignKey':_0x6110('0x1b9'),'onDelete':_0x6110('0x123')});db[_0x6110('0x85')][_0x6110('0x124')](db['Interval'],{'as':_0x6110('0x1ba'),'foreignKey':_0x6110('0x15c'),'onDelete':_0x6110('0x123'),'hooks':!![],'required':![]});db[_0x6110('0x85')][_0x6110('0x124')](db['VoiceExtension'],{'as':_0x6110('0x126'),'foreignKey':_0x6110('0x15c'),'onDelete':_0x6110('0x16c')});db[_0x6110('0x85')][_0x6110('0x124')](db['MailApplication'],{'as':_0x6110('0x1bb'),'foreignKey':_0x6110('0x15c')});db['Interval'][_0x6110('0x124')](db[_0x6110('0x19a')],{'as':_0x6110('0x1bc'),'foreignKey':_0x6110('0x15c')});db['Interval'][_0x6110('0x124')](db['FaxApplication'],{'as':_0x6110('0x1bd'),'foreignKey':_0x6110('0x15c')});db[_0x6110('0x85')][_0x6110('0x124')](db[_0x6110('0x56')],{'as':_0x6110('0x1be'),'foreignKey':_0x6110('0x15c')});db[_0x6110('0x8d')][_0x6110('0x15a')](db[_0x6110('0x3a')],{});db['Schedule'][_0x6110('0x15a')](db['AnalyticDefaultReport'],{'foreignKey':_0x6110('0x1bf')});db[_0x6110('0x8d')]['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':'CustomReportId'});db[_0x6110('0x8e')][_0x6110('0x135')](db[_0x6110('0x18')],{'as':_0x6110('0x1c0'),'through':_0x6110('0x153'),'onDelete':'restrict'});db[_0x6110('0x90')][_0x6110('0x135')](db[_0x6110('0x73')],{'through':_0x6110('0x1ad')});db['Tag'][_0x6110('0x135')](db[_0x6110('0x12a')],{'through':'chat_interaction_has_tags'});db[_0x6110('0x90')][_0x6110('0x135')](db['MailInteraction'],{'through':_0x6110('0x17a')});db[_0x6110('0x90')]['belongsToMany'](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0x6110('0x90')][_0x6110('0x135')](db['FaxInteraction'],{'through':_0x6110('0x18a')});db[_0x6110('0x90')][_0x6110('0x135')](db[_0x6110('0x129')],{'through':_0x6110('0x197')});db[_0x6110('0x90')][_0x6110('0x135')](db[_0x6110('0x110')],{'through':_0x6110('0x1c1')});db[_0x6110('0x1a8')]['belongsTo'](db[_0x6110('0x92')],{'as':'ItemType','foreignKey':_0x6110('0x1c2')});db['CmHopperAdditionalPhone'][_0x6110('0x15a')](db[_0x6110('0x74')],{'as':_0x6110('0x1c3'),'foreignKey':_0x6110('0x1af')});db['CmContactHasItem'][_0x6110('0x15a')](db[_0x6110('0x73')],{'as':'Contact','foreignKey':_0x6110('0x1c4')});db[_0x6110('0x97')]['hasMany'](db[_0x6110('0x84')],{'as':{'plural':'AllConditions','singular':_0x6110('0x1c5')},'foreignKey':_0x6110('0x1c6'),'onDelete':_0x6110('0x123'),'hooks':!![]});db[_0x6110('0x97')][_0x6110('0x124')](db['Condition'],{'as':{'plural':_0x6110('0x1c7'),'singular':_0x6110('0x1c8')},'foreignKey':_0x6110('0x1c9'),'onDelete':_0x6110('0x123'),'hooks':!![]});db[_0x6110('0x97')][_0x6110('0x124')](db[_0x6110('0x7d')],{'as':_0x6110('0x1b7'),'foreignKey':_0x6110('0x1ca'),'onDelete':'cascade','hooks':!![]});db[_0x6110('0x9d')][_0x6110('0x124')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':'cascade','foreignKey':_0x6110('0x1cb'),'hooks':!![]});db[_0x6110('0x9f')][_0x6110('0x124')](db[_0x6110('0xa4')],{'as':_0x6110('0x1cc'),'onDelete':_0x6110('0x123'),'foreignKey':_0x6110('0x1bf')});db[_0x6110('0xa2')][_0x6110('0x124')](db[_0x6110('0xa4')],{'as':_0x6110('0x1cc'),'onDelete':_0x6110('0x123'),'foreignKey':_0x6110('0x1cd')});db['AnalyticFieldReport']['belongsTo'](db[_0x6110('0xa2')],{'foreignKey':'MetricId'});db['SalesforceAccount']['hasMany'](db['SalesforceConfiguration'],{'as':_0x6110('0x1ce'),'onDelete':_0x6110('0x123'),'foreignKey':'AccountId'});db[_0x6110('0xa8')][_0x6110('0x124')](db[_0x6110('0x1cf')],{'as':_0x6110('0x1d0'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x6110('0xa8')][_0x6110('0x124')](db[_0x6110('0x1cf')],{'as':_0x6110('0x1d1'),'onDelete':'cascade','foreignKey':_0x6110('0x1d2')});db[_0x6110('0xa8')][_0x6110('0x124')](db[_0x6110('0x1cf')],{'as':'Fields','onDelete':_0x6110('0x123'),'foreignKey':'FieldId'});db[_0x6110('0xa8')][_0x6110('0x15a')](db[_0x6110('0xa7')],{'as':_0x6110('0x17f'),'foreignKey':'AccountId'});db['SalesforceField'][_0x6110('0x124')](db[_0x6110('0x1cf')],{'as':_0x6110('0x1d3'),'foreignKey':_0x6110('0x1d4')});db[_0x6110('0x1cf')][_0x6110('0x124')](db[_0x6110('0x1cf')],{'as':_0x6110('0x1d5'),'foreignKey':_0x6110('0x1d2')});db['SalesforceField'][_0x6110('0x124')](db[_0x6110('0x1cf')],{'as':_0x6110('0x1d6'),'foreignKey':_0x6110('0x1d7')});db[_0x6110('0x1cf')][_0x6110('0x15a')](db['Variable'],{'as':_0x6110('0x99'),'foreignKey':_0x6110('0x1d8')});db[_0x6110('0xab')][_0x6110('0x124')](db[_0x6110('0xad')],{'as':_0x6110('0x1ce'),'onDelete':_0x6110('0x123'),'foreignKey':_0x6110('0x1d9')});db['SugarcrmConfiguration'][_0x6110('0x124')](db['SugarcrmField'],{'as':_0x6110('0x1d0'),'onDelete':_0x6110('0x123'),'foreignKey':_0x6110('0x1d4')});db[_0x6110('0xad')][_0x6110('0x124')](db[_0x6110('0xae')],{'as':'Descriptions','onDelete':_0x6110('0x123'),'foreignKey':_0x6110('0x1d2')});db['SugarcrmConfiguration']['hasMany'](db[_0x6110('0xae')],{'as':_0x6110('0x1cc'),'onDelete':_0x6110('0x123'),'foreignKey':'FieldId'});db[_0x6110('0xad')]['belongsTo'](db[_0x6110('0xab')],{'as':_0x6110('0x17f'),'foreignKey':_0x6110('0x1d9')});db['SugarcrmField'][_0x6110('0x124')](db[_0x6110('0xae')],{'as':_0x6110('0x1d3'),'foreignKey':_0x6110('0x1d4')});db[_0x6110('0xae')]['hasMany'](db[_0x6110('0xae')],{'as':_0x6110('0x1d5'),'foreignKey':_0x6110('0x1d2')});db[_0x6110('0xae')][_0x6110('0x124')](db[_0x6110('0xae')],{'as':_0x6110('0x1d6'),'foreignKey':_0x6110('0x1d7')});db[_0x6110('0xae')][_0x6110('0x15a')](db[_0x6110('0x99')],{'as':'Variable','foreignKey':_0x6110('0x1d8')});db[_0x6110('0xb0')][_0x6110('0x124')](db[_0x6110('0x1da')],{'as':_0x6110('0x1ce'),'onDelete':_0x6110('0x123'),'foreignKey':_0x6110('0x1d9')});db[_0x6110('0x1da')]['hasMany'](db[_0x6110('0xb3')],{'as':_0x6110('0x1d0'),'onDelete':_0x6110('0x123'),'foreignKey':_0x6110('0x1d4')});db[_0x6110('0x1da')][_0x6110('0x124')](db[_0x6110('0xb3')],{'as':_0x6110('0x1d1'),'onDelete':_0x6110('0x123'),'foreignKey':_0x6110('0x1d2')});db['DeskConfiguration']['hasMany'](db[_0x6110('0xb3')],{'as':'Fields','onDelete':_0x6110('0x123'),'foreignKey':_0x6110('0x1d7')});db['DeskConfiguration'][_0x6110('0x15a')](db[_0x6110('0xb0')],{'as':_0x6110('0x17f'),'foreignKey':_0x6110('0x1d9')});db['DeskConfiguration'][_0x6110('0x135')](db[_0x6110('0x90')],{'through':_0x6110('0x1db')});db[_0x6110('0xb3')][_0x6110('0x124')](db[_0x6110('0xb3')],{'as':_0x6110('0x1d3'),'foreignKey':_0x6110('0x1d4')});db[_0x6110('0xb3')][_0x6110('0x124')](db[_0x6110('0xb3')],{'as':_0x6110('0x1d5'),'foreignKey':_0x6110('0x1d2')});db[_0x6110('0xb3')][_0x6110('0x124')](db['DeskField'],{'as':_0x6110('0x1d6'),'foreignKey':_0x6110('0x1d7')});db[_0x6110('0xb3')][_0x6110('0x15a')](db['Variable'],{'as':'Variable','foreignKey':_0x6110('0x1d8')});db[_0x6110('0xb5')][_0x6110('0x124')](db[_0x6110('0xb7')],{'as':_0x6110('0x1ce'),'onDelete':_0x6110('0x123'),'foreignKey':'AccountId'});db['ZohoConfiguration'][_0x6110('0x124')](db[_0x6110('0x1dc')],{'as':_0x6110('0x1d0'),'onDelete':'cascade','foreignKey':_0x6110('0x1d4')});db[_0x6110('0xb7')]['hasMany'](db[_0x6110('0x1dc')],{'as':_0x6110('0x1d1'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x6110('0xb7')]['hasMany'](db['ZohoField'],{'as':_0x6110('0x1cc'),'onDelete':_0x6110('0x123'),'foreignKey':_0x6110('0x1d7')});db[_0x6110('0xb7')]['belongsTo'](db[_0x6110('0xb5')],{'as':_0x6110('0x17f'),'foreignKey':_0x6110('0x1d9')});db[_0x6110('0x1dc')]['hasMany'](db[_0x6110('0x1dc')],{'as':_0x6110('0x1d3'),'foreignKey':_0x6110('0x1d4')});db[_0x6110('0x1dc')]['hasMany'](db[_0x6110('0x1dc')],{'as':'Description','foreignKey':_0x6110('0x1d2')});db[_0x6110('0x1dc')][_0x6110('0x124')](db['ZohoField'],{'as':_0x6110('0x1d6'),'foreignKey':_0x6110('0x1d7')});db[_0x6110('0x1dc')][_0x6110('0x15a')](db[_0x6110('0x99')],{'as':_0x6110('0x99'),'foreignKey':_0x6110('0x1d8')});db[_0x6110('0x1dd')][_0x6110('0x124')](db[_0x6110('0xba')],{'as':_0x6110('0x1ce'),'onDelete':'cascade','foreignKey':_0x6110('0x1d9')});db[_0x6110('0xba')][_0x6110('0x124')](db[_0x6110('0xbc')],{'as':_0x6110('0x1d0'),'foreignKey':_0x6110('0x1d4')});db[_0x6110('0xba')][_0x6110('0x124')](db[_0x6110('0xbc')],{'as':_0x6110('0x1d1'),'foreignKey':_0x6110('0x1d2')});db['ZendeskConfiguration'][_0x6110('0x124')](db[_0x6110('0xbc')],{'as':_0x6110('0x1cc'),'foreignKey':_0x6110('0x1d7')});db[_0x6110('0xba')][_0x6110('0x15a')](db[_0x6110('0x1dd')],{'as':_0x6110('0x17f'),'foreignKey':_0x6110('0x1d9')});db['ZendeskConfiguration'][_0x6110('0x135')](db[_0x6110('0x90')],{'through':_0x6110('0x1de')});db['ZendeskField'][_0x6110('0x124')](db[_0x6110('0xbc')],{'as':_0x6110('0x1d3'),'foreignKey':_0x6110('0x1d4')});db[_0x6110('0xbc')][_0x6110('0x124')](db[_0x6110('0xbc')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x6110('0xbc')][_0x6110('0x124')](db['ZendeskField'],{'as':_0x6110('0x1d6'),'foreignKey':_0x6110('0x1d7')});db[_0x6110('0xbc')]['belongsTo'](db[_0x6110('0x99')],{'as':_0x6110('0x99'),'foreignKey':_0x6110('0x1d8')});db[_0x6110('0xbe')]['hasMany'](db[_0x6110('0xc0')],{'as':'Configurations','onDelete':_0x6110('0x123'),'foreignKey':_0x6110('0x1d9')});db['FreshdeskConfiguration'][_0x6110('0x124')](db[_0x6110('0xc2')],{'as':_0x6110('0x1d0'),'onDelete':_0x6110('0x123'),'foreignKey':'SubjectId'});db[_0x6110('0xc0')][_0x6110('0x124')](db['FreshdeskField'],{'as':_0x6110('0x1d1'),'onDelete':_0x6110('0x123'),'foreignKey':_0x6110('0x1d2')});db[_0x6110('0xc0')]['hasMany'](db['FreshdeskField'],{'as':_0x6110('0x1cc'),'onDelete':'cascade','foreignKey':_0x6110('0x1d7')});db['FreshdeskConfiguration'][_0x6110('0x15a')](db['FreshdeskAccount'],{'as':_0x6110('0x17f'),'foreignKey':_0x6110('0x1d9')});db[_0x6110('0xc0')][_0x6110('0x135')](db['Tag'],{'through':_0x6110('0x1df')});db['FreshdeskField']['hasMany'](db[_0x6110('0xc2')],{'as':_0x6110('0x1d3'),'foreignKey':_0x6110('0x1d4')});db[_0x6110('0xc2')][_0x6110('0x124')](db[_0x6110('0xc2')],{'as':_0x6110('0x1d5'),'foreignKey':_0x6110('0x1d2')});db[_0x6110('0xc2')][_0x6110('0x124')](db[_0x6110('0xc2')],{'as':'Field','foreignKey':_0x6110('0x1d7')});db['FreshdeskField']['belongsTo'](db[_0x6110('0x99')],{'as':_0x6110('0x99'),'foreignKey':_0x6110('0x1d8')});db[_0x6110('0xc3')][_0x6110('0x124')](db[_0x6110('0xc4')],{'as':_0x6110('0x1ce'),'onDelete':_0x6110('0x123'),'foreignKey':_0x6110('0x1d9')});db[_0x6110('0xc4')][_0x6110('0x124')](db['VtigerField'],{'as':'Subjects','foreignKey':_0x6110('0x1d4')});db[_0x6110('0xc4')]['hasMany'](db['VtigerField'],{'as':_0x6110('0x1d1'),'foreignKey':_0x6110('0x1d2')});db[_0x6110('0xc4')]['hasMany'](db[_0x6110('0x1e0')],{'as':_0x6110('0x1cc'),'foreignKey':_0x6110('0x1d7')});db['VtigerConfiguration']['belongsTo'](db['VtigerAccount'],{'as':_0x6110('0x17f'),'foreignKey':_0x6110('0x1d9')});db[_0x6110('0x1e0')][_0x6110('0x124')](db[_0x6110('0x1e0')],{'as':_0x6110('0x1d3'),'foreignKey':'SubjectId'});db['VtigerField'][_0x6110('0x124')](db[_0x6110('0x1e0')],{'as':'Description','foreignKey':_0x6110('0x1d2')});db['VtigerField']['hasMany'](db[_0x6110('0x1e0')],{'as':'Field','foreignKey':_0x6110('0x1d7')});db[_0x6110('0x1e0')][_0x6110('0x15a')](db[_0x6110('0x99')],{'as':_0x6110('0x99'),'foreignKey':_0x6110('0x1d8')});db[_0x6110('0xc7')]['hasMany'](db[_0x6110('0xc9')],{'as':'Configurations','onDelete':_0x6110('0x123'),'foreignKey':'AccountId'});db[_0x6110('0xc9')][_0x6110('0x124')](db['ServicenowField'],{'as':_0x6110('0x1d0'),'foreignKey':_0x6110('0x1d4')});db[_0x6110('0xc9')][_0x6110('0x124')](db[_0x6110('0xcb')],{'as':'Descriptions','foreignKey':_0x6110('0x1d2')});db[_0x6110('0xc9')][_0x6110('0x124')](db['ServicenowField'],{'as':_0x6110('0x1cc'),'foreignKey':_0x6110('0x1d7')});db[_0x6110('0xc9')][_0x6110('0x15a')](db['ServicenowAccount'],{'as':_0x6110('0x17f'),'foreignKey':_0x6110('0x1d9')});db['ServicenowField'][_0x6110('0x124')](db[_0x6110('0xcb')],{'as':_0x6110('0x1d3'),'foreignKey':'SubjectId'});db[_0x6110('0xcb')][_0x6110('0x124')](db[_0x6110('0xcb')],{'as':_0x6110('0x1d5'),'foreignKey':_0x6110('0x1d2')});db[_0x6110('0xcb')][_0x6110('0x124')](db['ServicenowField'],{'as':_0x6110('0x1d6'),'foreignKey':_0x6110('0x1d7')});db[_0x6110('0xcb')]['belongsTo'](db[_0x6110('0x99')],{'as':_0x6110('0x99'),'foreignKey':_0x6110('0x1d8')});db[_0x6110('0xcd')][_0x6110('0x124')](db[_0x6110('0x1e1')],{'as':_0x6110('0x1ce'),'onDelete':_0x6110('0x123'),'foreignKey':'AccountId'});db[_0x6110('0xcd')][_0x6110('0x15a')](db['CloudProvider'],{'as':_0x6110('0x116'),'foreignKey':_0x6110('0x16a')});db[_0x6110('0x1e1')][_0x6110('0x124')](db['Dynamics365Field'],{'as':_0x6110('0x1d0'),'onDelete':'cascade','foreignKey':_0x6110('0x1d4')});db[_0x6110('0x1e1')][_0x6110('0x124')](db[_0x6110('0xcf')],{'as':_0x6110('0x1d1'),'onDelete':_0x6110('0x123'),'foreignKey':_0x6110('0x1d2')});db[_0x6110('0x1e1')][_0x6110('0x124')](db[_0x6110('0xcf')],{'as':_0x6110('0x1cc'),'onDelete':_0x6110('0x123'),'foreignKey':_0x6110('0x1d7')});db[_0x6110('0x1e1')][_0x6110('0x15a')](db[_0x6110('0xcd')],{'as':_0x6110('0x17f'),'foreignKey':_0x6110('0x1d9')});db[_0x6110('0xcf')]['hasMany'](db[_0x6110('0xcf')],{'as':_0x6110('0x1d3'),'foreignKey':_0x6110('0x1d4')});db[_0x6110('0xcf')][_0x6110('0x124')](db[_0x6110('0xcf')],{'as':_0x6110('0x1d5'),'foreignKey':_0x6110('0x1d2')});db[_0x6110('0xcf')][_0x6110('0x124')](db[_0x6110('0xcf')],{'as':'Field','foreignKey':_0x6110('0x1d7')});db['Dynamics365Field'][_0x6110('0x15a')](db[_0x6110('0x99')],{'as':_0x6110('0x99'),'foreignKey':'VariableId'});db[_0x6110('0xd1')][_0x6110('0x124')](db[_0x6110('0x1e2')],{'as':_0x6110('0x1ce'),'onDelete':_0x6110('0x123'),'foreignKey':'AccountId'});db[_0x6110('0x1e2')][_0x6110('0x124')](db[_0x6110('0xd4')],{'as':_0x6110('0x1d0'),'foreignKey':'SubjectId'});db[_0x6110('0x1e2')][_0x6110('0x124')](db[_0x6110('0xd4')],{'as':'Descriptions','foreignKey':_0x6110('0x1d2')});db[_0x6110('0x1e2')]['hasMany'](db['FreshsalesField'],{'as':_0x6110('0x1cc'),'foreignKey':'FieldId'});db[_0x6110('0x1e2')][_0x6110('0x15a')](db['FreshsalesAccount'],{'as':'Account','foreignKey':_0x6110('0x1d9')});db[_0x6110('0xd4')][_0x6110('0x124')](db['FreshsalesField'],{'as':_0x6110('0x1d3'),'foreignKey':_0x6110('0x1d4')});db[_0x6110('0xd4')][_0x6110('0x124')](db[_0x6110('0xd4')],{'as':_0x6110('0x1d5'),'foreignKey':_0x6110('0x1d2')});db['FreshsalesField']['hasMany'](db[_0x6110('0xd4')],{'as':_0x6110('0x1d6'),'foreignKey':_0x6110('0x1d7')});db[_0x6110('0xd4')]['belongsTo'](db[_0x6110('0x99')],{'as':_0x6110('0x99'),'foreignKey':_0x6110('0x1d8')});db[_0x6110('0xda')][_0x6110('0x15a')](db[_0x6110('0x64')],{});db[_0x6110('0xda')]['belongsTo'](db[_0x6110('0x144')],{'as':_0x6110('0x174'),'foreignKey':'ListId'});db[_0x6110('0xda')][_0x6110('0x15a')](db[_0x6110('0x73')],{'as':'Contact','foreignKey':_0x6110('0x178')});db['ChatQueueReport']['belongsTo'](db[_0x6110('0x12a')],{});db['ChatQueueReport'][_0x6110('0x15a')](db[_0x6110('0x67')],{});db[_0x6110('0xda')][_0x6110('0x15a')](db['User'],{});db[_0x6110('0xda')][_0x6110('0x15a')](db[_0x6110('0x6b')],{});db[_0x6110('0x1a5')]['belongsTo'](db[_0x6110('0x121')],{'onDelete':_0x6110('0x123'),'foreignKey':'FromId'});db[_0x6110('0x1a5')][_0x6110('0x15a')](db[_0x6110('0x121')],{'onDelete':'cascade','foreignKey':'ToId'});db[_0x6110('0xe1')]['hasMany'](db[_0x6110('0xdf')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x6110('0xe1')][_0x6110('0x124')](db[_0x6110('0xdd')],{'foreignKey':'SessionId','onDelete':_0x6110('0x123')});db['SmsQueueReport'][_0x6110('0x15a')](db['SmsAccount'],{});db[_0x6110('0xe3')][_0x6110('0x15a')](db[_0x6110('0x144')],{'as':_0x6110('0x174'),'foreignKey':_0x6110('0x183')});db[_0x6110('0xe3')][_0x6110('0x15a')](db[_0x6110('0x73')],{'as':'Contact','foreignKey':_0x6110('0x178')});db[_0x6110('0xe3')][_0x6110('0x15a')](db[_0x6110('0x58')],{});db[_0x6110('0xe3')][_0x6110('0x15a')](db[_0x6110('0x5a')],{});db[_0x6110('0xe3')][_0x6110('0x15a')](db['User'],{});db['SmsQueueReport'][_0x6110('0x15a')](db[_0x6110('0x5c')],{});db[_0x6110('0x1e3')][_0x6110('0x124')](db[_0x6110('0xe1')],{'foreignKey':_0x6110('0x1e4')});db[_0x6110('0x1e3')][_0x6110('0x124')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0x6110('0x1e3')][_0x6110('0x124')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x6110('0xf1')][_0x6110('0x135')](db['User'],{'as':'Agents','through':'user_has_teams'});db[_0x6110('0xf1')][_0x6110('0x135')](db[_0x6110('0x19')],{'through':'TeamVoiceQueue','as':_0x6110('0x13f')});db[_0x6110('0xf1')][_0x6110('0x135')](db[_0x6110('0x3c')],{'through':_0x6110('0x177'),'as':_0x6110('0x1e5')});db['Team']['belongsToMany'](db[_0x6110('0x6b')],{'through':'team_has_chat_queues','as':_0x6110('0x141')});db[_0x6110('0xf1')][_0x6110('0x135')](db[_0x6110('0x51')],{'through':_0x6110('0x18c'),'as':_0x6110('0x1e6')});db[_0x6110('0xf1')][_0x6110('0x135')](db[_0x6110('0x5c')],{'through':_0x6110('0x193'),'as':'SmsQueues'});db[_0x6110('0xf1')][_0x6110('0x135')](db[_0x6110('0x62')],{'through':_0x6110('0x198'),'as':'OpenchannelQueues'});db[_0x6110('0xf1')][_0x6110('0x135')](db[_0x6110('0x115')],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db[_0x6110('0xf1')]['belongsToMany'](db[_0x6110('0x104')],{'through':_0x6110('0x118'),'as':_0x6110('0x140')});db[_0x6110('0xf3')]['hasMany'](db[_0x6110('0x74')],{'as':_0x6110('0x1aa'),'foreignKey':_0x6110('0x1b1')});db[_0x6110('0xf3')]['hasMany'](db[_0x6110('0x76')],{'as':_0x6110('0x127'),'foreignKey':'CampaignId'});db[_0x6110('0xf3')][_0x6110('0x124')](db[_0x6110('0x77')],{'as':_0x6110('0x157'),'foreignKey':_0x6110('0x1b1')});db['Campaign'][_0x6110('0x124')](db[_0x6110('0x1b3')],{'as':_0x6110('0x1e7'),'foreignKey':_0x6110('0x1b1')});db[_0x6110('0xf3')][_0x6110('0x15a')](db[_0x6110('0x28')],{'as':_0x6110('0x28'),'foreignKey':_0x6110('0x159')});db[_0x6110('0xf3')]['belongsTo'](db[_0x6110('0x28')],{'as':_0x6110('0x1e8'),'foreignKey':_0x6110('0x15b')});db['Campaign'][_0x6110('0x15a')](db['Interval'],{'as':_0x6110('0x85'),'foreignKey':'IntervalId'});db[_0x6110('0xf3')][_0x6110('0x15a')](db['SquareProject'],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0x6110('0xf3')][_0x6110('0x135')](db[_0x6110('0x144')],{'as':_0x6110('0x138'),'through':_0x6110('0x1e9')});db[_0x6110('0xf3')][_0x6110('0x135')](db[_0x6110('0x144')],{'as':_0x6110('0x161'),'through':_0x6110('0x1ea')});db[_0x6110('0xf7')]['belongsTo'](db[_0x6110('0x69')],{'as':'ChatOfflineMessage','foreignKey':_0x6110('0x181')});db[_0x6110('0xfa')]['belongsTo'](db[_0x6110('0x42')],{});db[_0x6110('0xfa')][_0x6110('0x15a')](db['MailInteraction'],{});db['MailTransferReport']['belongsTo'](db[_0x6110('0x3a')],{'foreignKey':_0x6110('0x1eb'),'as':'FromAccount'});db[_0x6110('0xfa')][_0x6110('0x15a')](db[_0x6110('0x121')],{'foreignKey':_0x6110('0x1ec'),'as':'FromAgent'});db['MailTransferReport'][_0x6110('0x15a')](db[_0x6110('0x121')],{'foreignKey':_0x6110('0x1ed'),'as':_0x6110('0x1ee')});db[_0x6110('0xfa')]['belongsTo'](db['MailQueue'],{'foreignKey':_0x6110('0x1ef'),'as':'ToQueue'});db['MailTransferReport'][_0x6110('0x15a')](db[_0x6110('0x3a')],{'foreignKey':_0x6110('0x1f0'),'as':'ToAccount'});db[_0x6110('0xfc')][_0x6110('0x15a')](db[_0x6110('0x67')],{});db['ChatTransferReport'][_0x6110('0x15a')](db[_0x6110('0x12a')],{});db[_0x6110('0xfc')]['belongsTo'](db[_0x6110('0x64')],{'foreignKey':_0x6110('0x1f1'),'as':_0x6110('0x1f2')});db[_0x6110('0xfc')][_0x6110('0x15a')](db[_0x6110('0x121')],{'foreignKey':_0x6110('0x1ec'),'as':_0x6110('0x1f3')});db[_0x6110('0xfc')]['belongsTo'](db['User'],{'foreignKey':_0x6110('0x1ed'),'as':_0x6110('0x1ee')});db[_0x6110('0xfc')]['belongsTo'](db[_0x6110('0x6b')],{'foreignKey':_0x6110('0x1f4'),'as':_0x6110('0x1f5')});db[_0x6110('0xfc')][_0x6110('0x15a')](db[_0x6110('0x64')],{'foreignKey':'ToChatWebsiteId','as':_0x6110('0x1f6')});db[_0x6110('0xfe')][_0x6110('0x15a')](db[_0x6110('0x4f')],{});db[_0x6110('0xfe')][_0x6110('0x15a')](db['FaxInteraction'],{});db[_0x6110('0xfe')][_0x6110('0x15a')](db['FaxAccount'],{'foreignKey':_0x6110('0x1f7'),'as':'FromAccount'});db[_0x6110('0xfe')][_0x6110('0x15a')](db[_0x6110('0x121')],{'foreignKey':'FromUserId','as':_0x6110('0x1f3')});db[_0x6110('0xfe')][_0x6110('0x15a')](db[_0x6110('0x121')],{'foreignKey':_0x6110('0x1ed'),'as':'ToAgent'});db[_0x6110('0xfe')]['belongsTo'](db[_0x6110('0x51')],{'foreignKey':_0x6110('0x1f8'),'as':_0x6110('0x1f5')});db[_0x6110('0xfe')][_0x6110('0x15a')](db[_0x6110('0x147')],{'foreignKey':'ToFaxAccountId','as':_0x6110('0x1f6')});db[_0x6110('0x1f9')][_0x6110('0x15a')](db[_0x6110('0x61')],{});db[_0x6110('0x1f9')][_0x6110('0x15a')](db['OpenchannelInteraction'],{});db[_0x6110('0x1f9')][_0x6110('0x15a')](db[_0x6110('0x5d')],{'foreignKey':_0x6110('0x1fa'),'as':_0x6110('0x1f2')});db[_0x6110('0x1f9')][_0x6110('0x15a')](db[_0x6110('0x121')],{'foreignKey':_0x6110('0x1ec'),'as':_0x6110('0x1f3')});db[_0x6110('0x1f9')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x6110('0x1f9')][_0x6110('0x15a')](db['OpenchannelQueue'],{'foreignKey':_0x6110('0x1fb'),'as':_0x6110('0x1f5')});db[_0x6110('0x1f9')][_0x6110('0x15a')](db[_0x6110('0x5d')],{'foreignKey':'ToOpenchannelAccountId','as':_0x6110('0x1f6')});db['SmsTransferReport'][_0x6110('0x15a')](db[_0x6110('0x5a')],{});db['SmsTransferReport'][_0x6110('0x15a')](db[_0x6110('0x58')],{});db[_0x6110('0x101')]['belongsTo'](db[_0x6110('0x54')],{'foreignKey':_0x6110('0x1fc'),'as':'FromAccount'});db[_0x6110('0x101')][_0x6110('0x15a')](db['User'],{'foreignKey':'FromUserId','as':_0x6110('0x1f3')});db[_0x6110('0x101')][_0x6110('0x15a')](db[_0x6110('0x121')],{'foreignKey':_0x6110('0x1ed'),'as':_0x6110('0x1ee')});db['SmsTransferReport'][_0x6110('0x15a')](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x6110('0x1f5')});db['SmsTransferReport'][_0x6110('0x15a')](db[_0x6110('0x54')],{'foreignKey':_0x6110('0x1fd'),'as':_0x6110('0x1f6')});db[_0x6110('0x144')]['hasMany'](db[_0x6110('0x82')],{'as':'Dispositions','foreignKey':_0x6110('0x183'),'onDelete':_0x6110('0x123')});db[_0x6110('0x144')][_0x6110('0x124')](db[_0x6110('0x7b')],{'as':_0x6110('0x1fe'),'foreignKey':_0x6110('0x183')});db['CmList']['hasMany'](db[_0x6110('0x73')],{'as':_0x6110('0x136'),'onDelete':_0x6110('0x123'),'foreignKey':'ListId'});db['CmList'][_0x6110('0x124')](db['CmHopperFinal'],{'as':_0x6110('0x127'),'foreignKey':_0x6110('0x183')});db['CmList']['hasMany'](db[_0x6110('0x77')],{'as':'HopperHistory','foreignKey':_0x6110('0x183')});db[_0x6110('0x144')][_0x6110('0x124')](db[_0x6110('0x79')],{'as':'ReportAgentPreview','foreignKey':_0x6110('0x183')});db[_0x6110('0x144')][_0x6110('0x135')](db[_0x6110('0x19')],{'as':_0x6110('0x1ff'),'through':_0x6110('0x15d')});db[_0x6110('0x144')][_0x6110('0x135')](db[_0x6110('0x121')],{'as':'Agents','through':'cm_user_has_lists'});db[_0x6110('0x104')][_0x6110('0x124')](db[_0x6110('0x17')],{'as':'Extensions','onDelete':_0x6110('0x123')});db['VoicePrefix']['belongsToMany'](db[_0x6110('0x121')],{'as':_0x6110('0x15e'),'through':'UserVoicePrefix'});db['VoicePrefix'][_0x6110('0x135')](db[_0x6110('0xf1')],{'through':_0x6110('0x118'),'as':_0x6110('0x15f')});db[_0x6110('0x132')][_0x6110('0x124')](db[_0x6110('0x121')],{'as':_0x6110('0x17c'),'foreignKey':_0x6110('0x200')});db['UserProfile'][_0x6110('0x124')](db[_0x6110('0x107')],{'as':_0x6110('0x201'),'foreignKey':_0x6110('0x200'),'onDelete':'cascade'});db[_0x6110('0x107')][_0x6110('0x124')](db[_0x6110('0x109')],{'as':_0x6110('0x202'),'foreignKey':'sectionId','onDelete':_0x6110('0x123')});db[_0x6110('0x10c')][_0x6110('0x124')](db[_0x6110('0x82')],{'as':_0x6110('0x16f'),'foreignKey':'WhatsappAccountId','onDelete':_0x6110('0x123')});db[_0x6110('0x10c')][_0x6110('0x124')](db['CannedAnswer'],{'as':_0x6110('0x171'),'foreignKey':_0x6110('0x203')});db[_0x6110('0x10c')]['hasMany'](db[_0x6110('0x111')],{'as':_0x6110('0x172'),'foreignKey':_0x6110('0x203')});db[_0x6110('0x10c')][_0x6110('0x124')](db[_0x6110('0x110')],{'as':_0x6110('0x173')});db[_0x6110('0x10c')][_0x6110('0x124')](db[_0x6110('0x10e')],{'as':_0x6110('0x187')});db[_0x6110('0x10c')][_0x6110('0x15a')](db[_0x6110('0x144')],{'as':'List','foreignKey':'ListId'});db[_0x6110('0x10c')][_0x6110('0x15a')](db[_0x6110('0x87')],{'as':_0x6110('0x176'),'foreignKey':_0x6110('0x18e')});db[_0x6110('0x10c')][_0x6110('0x135')](db[_0x6110('0x121')],{'as':_0x6110('0x15e'),'through':_0x6110('0x14f')});db[_0x6110('0x10e')][_0x6110('0x15a')](db['User'],{'onDelete':_0x6110('0x16c')});db[_0x6110('0x10e')]['belongsTo'](db[_0x6110('0x115')],{'onDelete':_0x6110('0x16c')});db['WhatsappApplication'][_0x6110('0x15a')](db[_0x6110('0x10c')],{'onDelete':'restrict'});db[_0x6110('0x10e')]['belongsTo'](db[_0x6110('0x85')],{'onDelete':_0x6110('0x16c'),'foreignKey':_0x6110('0x15c')});db[_0x6110('0x10e')]['belongsTo'](db['Tag'],{'onDelete':_0x6110('0x16c'),'foreignKey':_0x6110('0x182')});db[_0x6110('0x110')][_0x6110('0x124')](db[_0x6110('0x111')],{'as':_0x6110('0x172'),'onDelete':_0x6110('0x123'),'foreignKey':_0x6110('0x204')});db['WhatsappInteraction'][_0x6110('0x15a')](db[_0x6110('0x10c')],{'as':_0x6110('0x17f'),'foreignKey':'WhatsappAccountId'});db['WhatsappInteraction']['belongsTo'](db['CmContact'],{'as':_0x6110('0x169'),'foreignKey':_0x6110('0x178')});db[_0x6110('0x110')]['belongsTo'](db[_0x6110('0x121')],{'as':_0x6110('0x179'),'foreignKey':_0x6110('0x120')});db['WhatsappInteraction']['belongsToMany'](db[_0x6110('0x90')],{'through':_0x6110('0x1c1'),'as':_0x6110('0x17b')});db[_0x6110('0x110')]['belongsToMany'](db[_0x6110('0x90')],{'through':_0x6110('0x1c1'),'as':_0x6110('0x18b')});db[_0x6110('0x110')][_0x6110('0x135')](db['User'],{'as':'Users','through':_0x6110('0x13e'),'foreignKey':_0x6110('0x204')});db[_0x6110('0x111')][_0x6110('0x15a')](db['User'],{'as':'User'});db[_0x6110('0x111')][_0x6110('0x15a')](db[_0x6110('0x73')],{'onDelete':_0x6110('0x123'),'as':_0x6110('0x169')});db[_0x6110('0x111')]['belongsTo'](db[_0x6110('0x110')],{'onDelete':_0x6110('0x123'),'as':_0x6110('0x17e'),'foreignKey':_0x6110('0x204')});db[_0x6110('0x111')]['belongsTo'](db['WhatsappAccount'],{'as':_0x6110('0x17f'),'foreignKey':'WhatsappAccountId'});db[_0x6110('0x205')][_0x6110('0x15a')](db[_0x6110('0x10c')],{});db[_0x6110('0x205')][_0x6110('0x15a')](db[_0x6110('0x144')],{'as':_0x6110('0x174'),'foreignKey':_0x6110('0x183')});db[_0x6110('0x205')][_0x6110('0x15a')](db[_0x6110('0x73')],{'as':'Contact','foreignKey':_0x6110('0x178')});db['WhatsappQueueReport']['belongsTo'](db[_0x6110('0x110')],{});db[_0x6110('0x205')][_0x6110('0x15a')](db[_0x6110('0x115')],{});db[_0x6110('0x205')][_0x6110('0x15a')](db[_0x6110('0x111')],{});db[_0x6110('0x205')][_0x6110('0x15a')](db[_0x6110('0x121')],{});db[_0x6110('0x114')][_0x6110('0x15a')](db['WhatsappMessage'],{});db['WhatsappTransferReport']['belongsTo'](db[_0x6110('0x110')],{});db['WhatsappTransferReport'][_0x6110('0x15a')](db[_0x6110('0x10c')],{'foreignKey':'FromWhatsappAccountId','as':_0x6110('0x1f2')});db['WhatsappTransferReport'][_0x6110('0x15a')](db[_0x6110('0x10c')],{'foreignKey':_0x6110('0x206'),'as':_0x6110('0x1f6')});db['WhatsappTransferReport'][_0x6110('0x15a')](db[_0x6110('0x115')],{'foreignKey':_0x6110('0x207'),'as':'ToQueue'});db[_0x6110('0x114')][_0x6110('0x15a')](db[_0x6110('0x121')],{'foreignKey':_0x6110('0x1ec'),'as':_0x6110('0x1f3')});db[_0x6110('0x114')][_0x6110('0x15a')](db['User'],{'foreignKey':_0x6110('0x1ed'),'as':_0x6110('0x1ee')});db[_0x6110('0x115')][_0x6110('0x135')](db[_0x6110('0x121')],{'as':_0x6110('0x15e'),'through':_0x6110('0x143'),'foreignKey':_0x6110('0x208')});db[_0x6110('0x115')][_0x6110('0x135')](db['Team'],{'through':_0x6110('0x209'),'as':_0x6110('0x15f')});db[_0x6110('0x11c')][_0x6110('0x15a')](db['User'],{'as':_0x6110('0x20a'),'foreignKey':_0x6110('0x120'),'onDelete':'cascade','hooks':!![]});db[_0x6110('0x116')][_0x6110('0x11e')](db[_0x6110('0xcd')],{'as':_0x6110('0xcd'),'onDelete':_0x6110('0x16c')});db[_0x6110('0x116')][_0x6110('0x11e')](db[_0x6110('0x37')],{'as':_0x6110('0x16d'),'onDelete':'restrict'});db[_0x6110('0x116')][_0x6110('0x11e')](db['MailServerOut'],{'as':_0x6110('0x16e'),'onDelete':_0x6110('0x16c')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 51fb237..69d6fcc 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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 +var _0x4b8c=['/api/cm/hopper_final','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','./api/pause','./api/cdr','/api/schedules','./api/schedule','/api/sounds','./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/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./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/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','./api/network','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/squareReport','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','./api/user-setting','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','static','root','/www','join','/snippet','snippet','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','then','use','/api/users','./api/user','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black'];(function(_0x49d367,_0x2864c5){var _0x1546a1=function(_0x44c309){while(--_0x44c309){_0x49d367['push'](_0x49d367['shift']());}};_0x1546a1(++_0x2864c5);}(_0x4b8c,0xb1));var _0xc4b8=function(_0xe74312,_0x4871c7){_0xe74312=_0xe74312-0x0;var _0x398e39=_0x4b8c[_0xe74312];return _0x398e39;};'use strict';var path=require(_0xc4b8('0x0'));var express=require(_0xc4b8('0x1'));var errors=require(_0xc4b8('0x2'));var config=require(_0xc4b8('0x3'));var setupLoggers=require(_0xc4b8('0x4'))[_0xc4b8('0x5')];var clientSideLogs=require('./api/client-side-logs');exports['default']=function(_0x590268){return setupLoggers(_0x590268)[_0xc4b8('0x6')](function(){_0x590268[_0xc4b8('0x7')](_0xc4b8('0x8'),require(_0xc4b8('0x9')));_0x590268[_0xc4b8('0x7')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xa'),require(_0xc4b8('0xb')));_0x590268['use'](_0xc4b8('0xc'),require(_0xc4b8('0xd')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xe'),require(_0xc4b8('0xf')));_0x590268['use'](_0xc4b8('0x10'),require(_0xc4b8('0x11')));_0x590268[_0xc4b8('0x7')]('/api/voice/recordings',require(_0xc4b8('0x12')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x13'),require('./api/screenRecording'));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x14'),require(_0xc4b8('0x15')));_0x590268['use'](_0xc4b8('0x16'),require(_0xc4b8('0x17')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x18'),require(_0xc4b8('0x19')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x1a'),require('./api/voiceDialReport'));_0x590268[_0xc4b8('0x7')]('/api/voice/agents/reports',require(_0xc4b8('0x1b')));_0x590268['use'](_0xc4b8('0x1c'),require(_0xc4b8('0x1d')));_0x590268['use'](_0xc4b8('0x1e'),require('./api/memberReport'));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x1f'),require(_0xc4b8('0x20')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x21'),require(_0xc4b8('0x22')));_0x590268[_0xc4b8('0x7')]('/api/mail/out_servers',require(_0xc4b8('0x23')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x24'),require(_0xc4b8('0x25')));_0x590268['use'](_0xc4b8('0x26'),require(_0xc4b8('0x27')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x28'),require(_0xc4b8('0x29')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x2a'),require(_0xc4b8('0x2b')));_0x590268['use'](_0xc4b8('0x2c'),require('./api/mailMessage'));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x2d'),require(_0xc4b8('0x2e')));_0x590268['use'](_0xc4b8('0x2f'),require(_0xc4b8('0x30')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x31'),require('./api/dashboard'));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x32'),require(_0xc4b8('0x33')));_0x590268[_0xc4b8('0x7')]('/api/fax/accounts',require(_0xc4b8('0x34')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x35'),require('./api/faxApplication'));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x36'),require(_0xc4b8('0x37')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x38'),require(_0xc4b8('0x39')));_0x590268['use'](_0xc4b8('0x3a'),require(_0xc4b8('0x3b')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x3c'),require(_0xc4b8('0x3d')));_0x590268[_0xc4b8('0x7')]('/api/sms/accounts',require(_0xc4b8('0x3e')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x3f'),require(_0xc4b8('0x40')));_0x590268['use']('/api/sms/interactions',require(_0xc4b8('0x41')));_0x590268['use'](_0xc4b8('0x42'),require('./api/smsMessage'));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x43'),require(_0xc4b8('0x44')));_0x590268['use'](_0xc4b8('0x45'),require(_0xc4b8('0x46')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x47'),require(_0xc4b8('0x48')));_0x590268['use'](_0xc4b8('0x49'),require(_0xc4b8('0x4a')));_0x590268[_0xc4b8('0x7')]('/api/openchannel/messages',require(_0xc4b8('0x4b')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x4c'),require(_0xc4b8('0x4d')));_0x590268[_0xc4b8('0x7')]('/api/chat/websites',require(_0xc4b8('0x4e')));_0x590268['use'](_0xc4b8('0x4f'),require(_0xc4b8('0x50')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x51'),require('./api/chatApplication'));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x52'),require('./api/chatInteraction'));_0x590268['use']('/api/chat/messages',require(_0xc4b8('0x53')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x54'),require('./api/chatOfflineMessage'));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x55'),require(_0xc4b8('0x56')));_0x590268['use'](_0xc4b8('0x57'),require(_0xc4b8('0x58')));_0x590268['use'](_0xc4b8('0x59'),require(_0xc4b8('0x5a')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x5b'),require(_0xc4b8('0x5c')));_0x590268['use'](_0xc4b8('0x5d'),require(_0xc4b8('0x5e')));_0x590268[_0xc4b8('0x7')]('/api/cm/hopper',require(_0xc4b8('0x5f')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x60'),require('./api/cmHopperBlack'));_0x590268['use'](_0xc4b8('0x61'),require('./api/cmHopperFinal'));_0x590268['use']('/api/cm/hopper_history',require(_0xc4b8('0x62')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x63'),require(_0xc4b8('0x64')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x65'),require(_0xc4b8('0x66')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x67'),require(_0xc4b8('0x68')));_0x590268[_0xc4b8('0x7')]('/api/canned_answers',require(_0xc4b8('0x69')));_0x590268['use'](_0xc4b8('0x6a'),require(_0xc4b8('0x6b')));_0x590268[_0xc4b8('0x7')]('/api/conditions',require(_0xc4b8('0x6c')));_0x590268['use'](_0xc4b8('0x6d'),require(_0xc4b8('0x6e')));_0x590268['use']('/api/pauses',require(_0xc4b8('0x6f')));_0x590268[_0xc4b8('0x7')]('/api/cdr',require(_0xc4b8('0x70')));_0x590268[_0xc4b8('0x7')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x71'),require(_0xc4b8('0x72')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x73'),require(_0xc4b8('0x74')));_0x590268['use'](_0xc4b8('0x75'),require(_0xc4b8('0x76')));_0x590268['use'](_0xc4b8('0x77'),require(_0xc4b8('0x78')));_0x590268['use'](_0xc4b8('0x79'),require(_0xc4b8('0x7a')));_0x590268['use'](_0xc4b8('0x7b'),require(_0xc4b8('0x7c')));_0x590268[_0xc4b8('0x7')]('/api/templates',require(_0xc4b8('0x7d')));_0x590268[_0xc4b8('0x7')]('/api/triggers',require(_0xc4b8('0x7e')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x7f'),require('./api/variable'));_0x590268['use'](_0xc4b8('0x80'),require(_0xc4b8('0x81')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x82'),require('./api/integrationReport'));_0x590268[_0xc4b8('0x7')]('/api/analytics/custom_reports',require(_0xc4b8('0x83')));_0x590268[_0xc4b8('0x7')]('/api/analytics/default_reports',require(_0xc4b8('0x84')));_0x590268['use'](_0xc4b8('0x85'),require(_0xc4b8('0x86')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x87'),require(_0xc4b8('0x88')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x89'),require(_0xc4b8('0x8a')));_0x590268['use']('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x8b'),require(_0xc4b8('0x8c')));_0x590268[_0xc4b8('0x7')]('/api/integrations/salesforce/configurations',require(_0xc4b8('0x8d')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x8e'),require(_0xc4b8('0x8f')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x90'),require(_0xc4b8('0x91')));_0x590268['use'](_0xc4b8('0x92'),require(_0xc4b8('0x93')));_0x590268[_0xc4b8('0x7')]('/api/integrations/sugarcrm/fields',require(_0xc4b8('0x94')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x95'),require(_0xc4b8('0x96')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x97'),require(_0xc4b8('0x98')));_0x590268[_0xc4b8('0x7')]('/api/integrations/desk/fields',require(_0xc4b8('0x99')));_0x590268[_0xc4b8('0x7')]('/api/integrations/zoho/accounts',require(_0xc4b8('0x9a')));_0x590268['use'](_0xc4b8('0x9b'),require(_0xc4b8('0x9c')));_0x590268['use'](_0xc4b8('0x9d'),require('./api/intZohoField'));_0x590268[_0xc4b8('0x7')]('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x9e'),require('./api/intZendeskConfiguration'));_0x590268['use'](_0xc4b8('0x9f'),require(_0xc4b8('0xa0')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xa1'),require('./api/intFreshdeskAccount'));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xa2'),require(_0xc4b8('0xa3')));_0x590268['use']('/api/integrations/freshdesk/fields',require(_0xc4b8('0xa4')));_0x590268['use'](_0xc4b8('0xa5'),require(_0xc4b8('0xa6')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xa7'),require(_0xc4b8('0xa8')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xa9'),require(_0xc4b8('0xaa')));_0x590268['use'](_0xc4b8('0xab'),require(_0xc4b8('0xac')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xad'),require(_0xc4b8('0xae')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xaf'),require(_0xc4b8('0xb0')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xb1'),require(_0xc4b8('0xb2')));_0x590268[_0xc4b8('0x7')]('/api/integrations/dynamics365/configurations',require(_0xc4b8('0xb3')));_0x590268[_0xc4b8('0x7')]('/api/integrations/dynamics365/fields',require(_0xc4b8('0xb4')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xb5'),require('./api/intFreshsalesAccount'));_0x590268['use'](_0xc4b8('0xb6'),require(_0xc4b8('0xb7')));_0x590268[_0xc4b8('0x7')]('/api/integrations/freshsales/fields',require(_0xc4b8('0xb8')));_0x590268['use']('/api/networks',require(_0xc4b8('0xb9')));_0x590268['use']('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xba'),require(_0xc4b8('0xbb')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xbc'),require('./api/jscriptyAnswerReport'));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xbd'),require(_0xc4b8('0xbe')));_0x590268['use'](_0xc4b8('0xbf'),require(_0xc4b8('0xc0')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xc1'),require('./api/smsQueueReport'));_0x590268[_0xc4b8('0x7')]('/api/square/reports',require(_0xc4b8('0xc2')));_0x590268[_0xc4b8('0x7')]('/api/square/details/reports',require('./api/squareReportDetail'));_0x590268[_0xc4b8('0x7')]('/api/jscripty/projects',require(_0xc4b8('0xc3')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xc4'),require(_0xc4b8('0xc5')));_0x590268['use'](_0xc4b8('0xc6'),require(_0xc4b8('0xc7')));_0x590268['use'](_0xc4b8('0xc8'),require(_0xc4b8('0xc9')));_0x590268['use'](_0xc4b8('0xca'),require(_0xc4b8('0xcb')));_0x590268[_0xc4b8('0x7')]('/api/square/messages',require(_0xc4b8('0xcc')));_0x590268['use'](_0xc4b8('0xcd'),require(_0xc4b8('0xce')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xcf'),require(_0xc4b8('0xd0')));_0x590268['use'](_0xc4b8('0xd1'),require('./api/campaign'));_0x590268['use'](_0xc4b8('0xd2'),require(_0xc4b8('0xd3')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xd4'),require(_0xc4b8('0xd5')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xd6'),require('./api/plugin'));_0x590268[_0xc4b8('0x7')]('/api/mail/reports/transfer',require(_0xc4b8('0xd7')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xd8'),require(_0xc4b8('0xd9')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xda'),require('./api/faxTransferReport'));_0x590268[_0xc4b8('0x7')]('/api/openchannel/reports/transfer',require(_0xc4b8('0xdb')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xdc'),require(_0xc4b8('0xdd')));_0x590268[_0xc4b8('0x7')]('/api/cm/lists',require(_0xc4b8('0xde')));_0x590268[_0xc4b8('0x7')]('/api/voice/prefixes',require('./api/voicePrefix'));_0x590268['use']('/api/userProfiles',require('./api/userProfile'));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xdf'),require(_0xc4b8('0xe0')));_0x590268['use']('/api/userProfile/resources',require(_0xc4b8('0xe1')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xe2'),require(_0xc4b8('0xe3')));_0x590268['use'](_0xc4b8('0xe4'),require(_0xc4b8('0xe5')));_0x590268[_0xc4b8('0x7')]('/api/whatsapp/applications',require('./api/whatsappApplication'));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xe6'),require(_0xc4b8('0xe7')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xe8'),require(_0xc4b8('0xe9')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xea'),require(_0xc4b8('0xeb')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xec'),require('./api/whatsappTransferReport'));_0x590268['use'](_0xc4b8('0xed'),require(_0xc4b8('0xee')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xef'),require(_0xc4b8('0xf0')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xf1'),require(_0xc4b8('0xf2')));_0x590268['use']('/api/user-settings',require(_0xc4b8('0xf3')));_0x590268[_0xc4b8('0x7')]('/api/auth/local',require(_0xc4b8('0xf4')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xf5'),require(_0xc4b8('0xf6')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xf7'),require(_0xc4b8('0xf8')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xf9'),require(_0xc4b8('0xfa')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xfb'),require(_0xc4b8('0xfc')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xfd'),require('./api/version'));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xfe'),require('./api/system'));_0x590268[_0xc4b8('0x7')](_0xc4b8('0xff'),require(_0xc4b8('0x100')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x101'),require(_0xc4b8('0x102')));_0x590268[_0xc4b8('0x7')](_0xc4b8('0x103'),clientSideLogs);_0x590268[_0xc4b8('0x7')]('/apidoc',express[_0xc4b8('0x104')](path['join'](config[_0xc4b8('0x105')],'/apidoc')));_0x590268['use'](_0xc4b8('0x106'),express[_0xc4b8('0x104')](path[_0xc4b8('0x107')](config[_0xc4b8('0x105')],_0xc4b8('0x106'))));_0x590268[_0xc4b8('0x7')]('/demo',express['static'](path['join'](config[_0xc4b8('0x105')],'/demo')));_0x590268['use'](_0xc4b8('0x108'),express[_0xc4b8('0x104')](path['join'](config[_0xc4b8('0x105')],_0xc4b8('0x109'),'3.1.0')));_0x590268[_0xc4b8('0x7')]('/plugins',express[_0xc4b8('0x104')](path[_0xc4b8('0x107')](config[_0xc4b8('0x105')],_0xc4b8('0x10a'))));_0x590268[_0xc4b8('0x10b')](_0xc4b8('0x10c'))[_0xc4b8('0x10d')](errors[0x194]);_0x590268[_0xc4b8('0x10b')]('/*')[_0xc4b8('0x10d')](function(_0x276a2a,_0x53e038){_0x53e038[_0xc4b8('0x10e')](path[_0xc4b8('0x10f')](_0x590268[_0xc4b8('0x10d')](_0xc4b8('0x110'))+_0xc4b8('0x111')));});return _0x590268;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 1c37b7a..8ca1f89 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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 +var _0xfb51=['../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.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/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','http','rpc','port','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc'];(function(_0x1decf3,_0x5811ea){var _0x24a190=function(_0x14df2a){while(--_0x14df2a){_0x1decf3['push'](_0x1decf3['shift']());}};_0x24a190(++_0x5811ea);}(_0xfb51,0x1b5));var _0x1fb5=function(_0x384447,_0x41669a){_0x384447=_0x384447-0x0;var _0x3810db=_0xfb51[_0x384447];return _0x3810db;};'use strict';var jayson=require(_0x1fb5('0x0'));var _=require(_0x1fb5('0x1'));var config=require(_0x1fb5('0x2'));exports['listen']=function(){return new Promise(function(_0x164ecb,_0x34fe7d){var _0x4ba3ff={};_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x4')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x5')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require('../api/voiceQueue/voiceQueue.rpc'));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x6')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x7')));_0x4ba3ff=_['merge'](_0x4ba3ff,require(_0x1fb5('0x8')));_0x4ba3ff=_['merge'](_0x4ba3ff,require(_0x1fb5('0x9')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0xa')));_0x4ba3ff=_['merge'](_0x4ba3ff,require(_0x1fb5('0xb')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0xc')));_0x4ba3ff=_['merge'](_0x4ba3ff,require(_0x1fb5('0xd')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0xe')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0xf')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x10')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x11')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x12')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require('../api/mailMessage/mailMessage.rpc'));_0x4ba3ff=_['merge'](_0x4ba3ff,require(_0x1fb5('0x13')));_0x4ba3ff=_['merge'](_0x4ba3ff,require(_0x1fb5('0x14')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x15')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x16')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require('../api/faxInteraction/faxInteraction.rpc'));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x17')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x18')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x19')));_0x4ba3ff=_['merge'](_0x4ba3ff,require(_0x1fb5('0x1a')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require('../api/smsInteraction/smsInteraction.rpc'));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x1b')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x1c')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x4ba3ff=_['merge'](_0x4ba3ff,require(_0x1fb5('0x1d')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x1e')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x1f')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x20')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x21')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require('../api/cmContact/cmContact.rpc'));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x22')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x23')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x24')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x25')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x26')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require('../api/interval/interval.rpc'));_0x4ba3ff=_['merge'](_0x4ba3ff,require(_0x1fb5('0x27')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require('../api/sound/sound.rpc'));_0x4ba3ff=_['merge'](_0x4ba3ff,require(_0x1fb5('0x28')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x29')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x2a')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require('../api/variable/variable.rpc'));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x4ba3ff=_['merge'](_0x4ba3ff,require(_0x1fb5('0x2b')));_0x4ba3ff=_['merge'](_0x4ba3ff,require(_0x1fb5('0x2c')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x2d')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x2e')));_0x4ba3ff=_['merge'](_0x4ba3ff,require(_0x1fb5('0x2f')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x30')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x31')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x32')));_0x4ba3ff=_['merge'](_0x4ba3ff,require(_0x1fb5('0x33')));_0x4ba3ff=_['merge'](_0x4ba3ff,require(_0x1fb5('0x34')));_0x4ba3ff=_['merge'](_0x4ba3ff,require(_0x1fb5('0x35')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x36')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x37')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require('../api/squareOdbc/squareOdbc.rpc'));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x38')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x39')));_0x4ba3ff=_['merge'](_0x4ba3ff,require('../api/squareMessage/squareMessage.rpc'));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x3a')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x3b')));_0x4ba3ff=_['merge'](_0x4ba3ff,require(_0x1fb5('0x3c')));_0x4ba3ff=_['merge'](_0x4ba3ff,require(_0x1fb5('0x3d')));_0x4ba3ff=_['merge'](_0x4ba3ff,require(_0x1fb5('0x3e')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require(_0x1fb5('0x3f')));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x4ba3ff=_[_0x1fb5('0x3')](_0x4ba3ff,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x5b96ac=jayson['server'](_0x4ba3ff)[_0x1fb5('0x40')]();var _0x20d65a=config[_0x1fb5('0x41')][_0x1fb5('0x42')]||config[_0x1fb5('0x42')]+0x1;var _0x7cffdd=config[_0x1fb5('0x41')]['ip']||_0x1fb5('0x43');_0x5b96ac['on'](_0x1fb5('0x44'),function(_0x2ff8a4){return _0x34fe7d(_0x2ff8a4);});_0x5b96ac[_0x1fb5('0x45')](_0x20d65a,_0x7cffdd,function(){console[_0x1fb5('0x46')](_0x1fb5('0x47'),_0x7cffdd,_0x20d65a);require(_0x1fb5('0x48'))[_0x1fb5('0x49')]();return _0x164ecb(_0x1fb5('0x4a')+_0x7cffdd+':'+_0x20d65a);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 383e0c1..3dbb5c3 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 _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 +var _0x71ab=['sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','lodash','events','EventEmitter','./reply','./error','setEncoding','setTimeout','utf8','headers','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sync','answer','ANSWER','getData','beep','sendRequest','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','HANGUP','setVariable','isBoolean','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s'];(function(_0x2ace97,_0x28d322){var _0x2392cd=function(_0x2b8455){while(--_0x2b8455){_0x2ace97['push'](_0x2ace97['shift']());}};_0x2392cd(++_0x28d322);}(_0x71ab,0xfb));var _0xb71a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x71ab[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require('util');var _=require(_0xb71a('0x0'));var EventEmitter=require(_0xb71a('0x1'))[_0xb71a('0x2')];var AGIReply=require(_0xb71a('0x3'));var AGIError=require(_0xb71a('0x4'));function AGIChannel(_0x54929d){var _0x35cb44=this,_0x3d5af9=new AGIReply(),_0x496d8b=![],_0x7a021d={};EventEmitter['call'](_0x35cb44);_0x54929d[_0xb71a('0x5')]('utf8');_0x54929d[_0xb71a('0x6')](0x8*0x3c*0x3c*0x3e8);_0x3d5af9[_0xb71a('0x5')](_0xb71a('0x7'));_0x3d5af9['on'](_0xb71a('0x8'),function(_0x5ef2e8){for(var _0x53e784 in _0x5ef2e8){_0x35cb44[_0x53e784]=_0x5ef2e8[_0x53e784];}_0x35cb44[_0xb71a('0x9')](_0xb71a('0xa'));});_0x3d5af9['on'](_0xb71a('0xb'),function(_0x25fac8){if(_0x25fac8['toLowerCase']()==_0xb71a('0xc')){_0x35cb44[_0xb71a('0x9')](_0xb71a('0xc'));return;}if(_0x25fac8[_0xb71a('0xd')](0x0,0xb)==_0xb71a('0xe')){_0x496d8b=!![];}if(_0x496d8b){_0x7a021d['rx']+=_0x25fac8+'\x0a';if(_0x25fac8[_0xb71a('0xf')](_0xb71a('0x10'))!=-0x1){_0x496d8b=![];}}else{_0x7a021d['rx']=_0x25fac8;}if(_0x496d8b){return;}if(typeof _0x7a021d['cb']==_0xb71a('0x11')){var _0x31cc39=_0x7a021d['rx'][_0xb71a('0xd')](0x0,0x3),_0x1d06c6=null,_0x3c2d1f=null;_0x31cc39=parseInt(_0x31cc39);if(isNaN(_0x31cc39)){_0x7a021d['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xb71a('0x12')});return;}if(_0x31cc39!=0xc8){_0x7a021d['cb'](null,{'code':_0x31cc39,'result':-0x1,'extra':'KO'});return;}_0x1d06c6=_0x7a021d['rx'][_0xb71a('0xd')](0x4)[_0xb71a('0x13')](_0xb71a('0x14'),'');if(_0x1d06c6[_0xb71a('0x15')]('\x20')!=-0x1){_0x1d06c6=_0x1d06c6[_0xb71a('0x16')](0x0,_0x1d06c6['indexOf']('\x20'));}if(_[_0xb71a('0x17')](_0x1d06c6,'-1')){_0x1d06c6=parseInt(_0x1d06c6);}_0x3c2d1f=_0x7a021d['rx'][_0xb71a('0x18')]('\x20');if(_0x3c2d1f['length']==0x3){_0x3c2d1f=_0x3c2d1f[0x2][_0xb71a('0xd')](0x1,_0x3c2d1f[0x2][_0xb71a('0x19')]-0x1);}else if(_0x3c2d1f[_0xb71a('0x19')]>0x3){var _0x1b925b=/\((.+)\)/;var _0x566975=_0x7a021d['rx']['match'](_0x1b925b);if(_0x566975){_0x3c2d1f=_0x566975[0x1];}else{_0x3c2d1f=null;}}else{_0x3c2d1f=null;}_0x7a021d['cb'](null,{'code':_0x31cc39,'result':_0x1d06c6,'extra':_0x3c2d1f});}});_0x54929d['on'](_0xb71a('0x1a'),function(_0x4c1661){_0x35cb44[_0xb71a('0x9')](_0xb71a('0x1a'),new AGIError('E_AGI_SOCKET_ERROR',_0x4c1661[_0xb71a('0x1b')]));});_0x54929d['on']('close',function(){_0x35cb44[_0xb71a('0x9')](_0xb71a('0x1c'),new AGIError(_0xb71a('0x1d')));});_0x54929d['on']('timeout',function(){_0x35cb44[_0xb71a('0x9')](_0xb71a('0x1e'),new AGIError(_0xb71a('0x1f')));_0x54929d[_0xb71a('0x20')]();});_0x54929d[_0xb71a('0x21')](_0x3d5af9);this[_0xb71a('0x22')]=function(_0x17f600,_0x23d31b){var _0x17f600=_0x17f600||'',_0x23d31b=typeof _0x23d31b==_0xb71a('0x11')?_0x23d31b:new Function();_0x7a021d={'tx':_0x17f600,'rx':'','cb':_0x23d31b};_0x54929d[_0xb71a('0x23')](_0x17f600+'\x0a');},this[_0xb71a('0x1c')]=function(){_0x54929d[_0xb71a('0x20')]();};}util[_0xb71a('0x24')](AGIChannel,EventEmitter);AGIChannel[_0xb71a('0x25')]['sendRequest']=function(_0x277b31){return this[_0xb71a('0x22')][_0xb71a('0x26')](this,_0x277b31);};AGIChannel[_0xb71a('0x25')][_0xb71a('0x27')]=function(){return this['sendRequest'](_0xb71a('0x28'));};AGIChannel[_0xb71a('0x25')][_0xb71a('0x29')]=function(_0x319010,_0x2bbd6f,_0x9061c4){_0x319010=_0x319010===undefined?_0xb71a('0x2a'):_0x319010;_0x2bbd6f=_0x2bbd6f===undefined?'5':_0x2bbd6f;_0x9061c4=_0x9061c4===undefined?'1':_0x9061c4;return this[_0xb71a('0x2b')](util[_0xb71a('0x2c')](_0xb71a('0x2d'),_0x319010,_0x2bbd6f*0x3e8,_0x9061c4));};AGIChannel[_0xb71a('0x25')][_0xb71a('0x2e')]=function(_0x4da307){_0x4da307=_0x4da307||'NO\x20MESSAGE';return this[_0xb71a('0x2b')](util[_0xb71a('0x2c')](_0xb71a('0x2f'),_0x4da307));};AGIChannel[_0xb71a('0x25')][_0xb71a('0x30')]=function(_0x4768cd,_0x4a8844){if(_['isArray'](_0x4a8844)){return this['sendRequest'](util[_0xb71a('0x2c')](_0xb71a('0x31'),_0x4768cd,_0x4a8844[_0xb71a('0x32')](',')));}return this[_0xb71a('0x2b')](util[_0xb71a('0x2c')]('EXEC\x20%s\x20%s',_0x4768cd,_0x4a8844));};AGIChannel['prototype'][_0xb71a('0x33')]=function(_0x59d3f3){return this[_0xb71a('0x2b')](util['format'](_0xb71a('0x34'),_0x59d3f3));};AGIChannel[_0xb71a('0x25')][_0xb71a('0x35')]=function(_0x12a8b9){return this['sendRequest'](util[_0xb71a('0x2c')]('SET\x20EXTENSION\x20%s',_0x12a8b9));};AGIChannel[_0xb71a('0x25')][_0xb71a('0x36')]=function(_0x26f4ef){return this[_0xb71a('0x2b')](util[_0xb71a('0x2c')]('SET\x20PRIORITY\x20%s',_0x26f4ef));};AGIChannel[_0xb71a('0x25')][_0xb71a('0xc')]=function(){return this[_0xb71a('0x2b')](_0xb71a('0x37'));};AGIChannel[_0xb71a('0x25')][_0xb71a('0x38')]=function(_0x4bf09f,_0x3a643e){var _0x30393e=_[_0xb71a('0x39')](_0x3a643e)||_['isNumber'](_0x3a643e)?_0x3a643e[_0xb71a('0x3a')]():_0x3a643e;return this[_0xb71a('0x2b')](util[_0xb71a('0x2c')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x4bf09f,_0x30393e?_0x30393e[_0xb71a('0x3a')]()[_0xb71a('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xb71a('0x3b')]=function(_0x49e47a,_0x5e3807){return this['sendRequest'](util['format'](_0xb71a('0x3c'),_0x49e47a,_0x5e3807));};AGIChannel['prototype'][_0xb71a('0x3d')]=function(_0x43bcad,_0x3e3009){return this[_0xb71a('0x2b')](util[_0xb71a('0x2c')](_0xb71a('0x3e'),_0x43bcad,_0x3e3009));};AGIChannel['prototype'][_0xb71a('0x3f')]=function(_0x261270,_0x14b0df){return this['sendRequest'](util[_0xb71a('0x2c')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x261270,_0x14b0df));};AGIChannel[_0xb71a('0x25')][_0xb71a('0x40')]=function(_0x5c27c9,_0x244008,_0x5beca7){_0x244008=_0x244008||this['extension'];_0x5beca7=_0x5beca7||0x1;this[_0xb71a('0x33')](_0x5c27c9);this[_0xb71a('0x35')](_0x244008);this[_0xb71a('0x36')](_0x5beca7);return this[_0xb71a('0x2e')](util[_0xb71a('0x2c')]('GOTO\x20%s\x20%s\x20%s',_0x5c27c9,_0x244008,_0x5beca7));};AGIChannel['prototype'][_0xb71a('0x41')]=function(_0x104346){return this['sendRequest'](util[_0xb71a('0x2c')](_0xb71a('0x42'),_0x104346));};AGIChannel[_0xb71a('0x25')][_0xb71a('0x43')]=function(_0x30fc58,_0x4b5c03,_0x225ace,_0xe97480,_0x3776cf,_0x2526f5){_0x4b5c03=_0x4b5c03||_0xb71a('0x44');_0x225ace=_0x225ace||'';_0xe97480=_0xe97480===undefined?-0x1:_0xe97480==='-1'?-0x1:_0xe97480*0x3e8;_0x3776cf=_0x3776cf===undefined?'':'s='+_0x3776cf;_0x2526f5=_0x2526f5?_0xb71a('0x45'):'';return this[_0xb71a('0x2b')](util['format'](_0xb71a('0x46'),_0x30fc58,_0x4b5c03,_0x225ace,_0xe97480,_0x2526f5,_0x3776cf));};AGIChannel[_0xb71a('0x25')][_0xb71a('0x47')]=function(_0x209381,_0x189ba1){_0x189ba1=_0x189ba1||'';return this[_0xb71a('0x2b')](util[_0xb71a('0x2c')](_0xb71a('0x48'),_0x209381,_0x189ba1));};AGIChannel['prototype']['agi']=function(_0x217d05){return this[_0xb71a('0x30')](_0xb71a('0x49'),_0x217d05);};AGIChannel[_0xb71a('0x25')][_0xb71a('0x4a')]=function(_0x2dc912){return this['exec'](_0xb71a('0x4b'),_0x2dc912);};AGIChannel[_0xb71a('0x25')][_0xb71a('0x1a')]=function(_0x3ad5e9,_0x5c3c64){this[_0xb71a('0x2e')](util[_0xb71a('0x2c')](_0xb71a('0x4c'),_0x3ad5e9['id'],_0x3ad5e9['label'],_0x5c3c64));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xb71a('0x4d')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index fe33b2c..7cce76f 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 _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 +var _0x6a4a=['Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','name','exports','Undefined\x20error.'];(function(_0x156eb3,_0x1d2202){var _0x370bcd=function(_0x1af899){while(--_0x1af899){_0x156eb3['push'](_0x156eb3['shift']());}};_0x370bcd(++_0x1d2202);}(_0x6a4a,0xa7));var _0xa6a4=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x6a4a[_0x37c22c];return _0x119d79;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xa6a4('0x0'),'E_AGI_ARGUMENT_PORT':_0xa6a4('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xa6a4('0x2'),'E_AGI_SERVER_VOICE_DISABLED':_0xa6a4('0x3'),'E_AGI_SOCKET_ERROR':_0xa6a4('0x4'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xa6a4('0x5'),'E_AGI_COMMAND_EMPTY':_0xa6a4('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xa6a4('0x7'),'E_AGI_IVR_ENTRY':_0xa6a4('0x8')};function AGIError(_0x22f6be){var _0x22f6be=_0x22f6be||null,_0x57797a=_0x57797a||[],_0x32ccc2=0x1,_0x5d093c='';if(!error[_0x22f6be]){_0x22f6be='E_AGI_UNDEFINED';}_0x57797a[_0xa6a4('0x9')](error[_0x22f6be]);while(arguments[_0x32ccc2]){_0x57797a[_0xa6a4('0x9')](arguments[_0x32ccc2]);_0x32ccc2++;}_0x5d093c=util[_0xa6a4('0xa')][_0xa6a4('0xb')](util,_0x57797a);this['message']=_0x5d093c;this[_0xa6a4('0xc')]=_0x22f6be;}module[_0xa6a4('0xd')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 14b6a5f..aa3e3bf 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 _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 +var _0x7dc0=['events','EventEmitter','ioredis','./error','redis','defaults','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','message','parse','exports','lodash'];(function(_0x188165,_0x4de657){var _0x2ab64a=function(_0x2ac7d2){while(--_0x2ac7d2){_0x188165['push'](_0x188165['shift']());}};_0x2ab64a(++_0x4de657);}(_0x7dc0,0xb3));var _0x07dc=function(_0x31a938,_0x4daec6){_0x31a938=_0x31a938-0x0;var _0x1bf341=_0x7dc0[_0x31a938];return _0x1bf341;};'use strict';var _=require(_0x07dc('0x0'));var EventEmitter=require(_0x07dc('0x1'))[_0x07dc('0x2')];var Redis=require(_0x07dc('0x3'));var AGIError=require(_0x07dc('0x4'));var config=require('../../config/environment');config[_0x07dc('0x5')]=_[_0x07dc('0x6')](config[_0x07dc('0x5')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0x07dc('0x7')](_0x07dc('0x8'),function(_0x58b8b8){if(_0x58b8b8)return eventEmitter[_0x07dc('0x9')](_0x07dc('0xa'),new AGIError(_0x07dc('0xb'),_0x58b8b8));});sub['on'](_0x07dc('0xc'),function(_0x3dd050,_0xe3da33){if(_0x3dd050!==_0x07dc('0x8'))return;try{var _0x52bd97=JSON[_0x07dc('0xd')](_0xe3da33);eventEmitter[_0x07dc('0x9')]('projectUpdate',_0x52bd97);}catch(_0x162d94){eventEmitter['emit'](_0x07dc('0xa'),new AGIError(_0x07dc('0xb'),_0x162d94));}});module[_0x07dc('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 3fd4488..b7ebcb3 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 _0x8f37=['numberOfEdges','addVertex','edges','prototype','push','size','relations','getVertex','traverseBFS','info','stop\x20traverse','no\x20edge/s\x20available','length','condition','split','agicommand','vswitch','target','menu','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','getdigits','getsecretdigits','vertices'];(function(_0x5ed913,_0x26f514){var _0x3627c9=function(_0x26030b){while(--_0x26030b){_0x5ed913['push'](_0x5ed913['shift']());}};_0x3627c9(++_0x26f514);}(_0x8f37,0x100));var _0x78f3=function(_0x137c9b,_0x1d4882){_0x137c9b=_0x137c9b-0x0;var _0x2ebc62=_0x8f37[_0x137c9b];return _0x2ebc62;};'use strict';var _=require(_0x78f3('0x0'));var logger=require(_0x78f3('0x1'))('agi');var verticesWithRetry=['menu',_0x78f3('0x2'),_0x78f3('0x3')];var Graph=function(){this[_0x78f3('0x4')]={};this['edges']={};this[_0x78f3('0x5')]=0x0;};Graph['prototype'][_0x78f3('0x6')]=function(_0x5254ee){this[_0x78f3('0x4')][_0x5254ee['id']]=_0x5254ee;this[_0x78f3('0x7')][_0x5254ee['id']]=[];};Graph[_0x78f3('0x8')]['addEdge']=function(_0x62c113,_0x2644a9,_0x2a14ed){this[_0x78f3('0x7')][_0x62c113][_0x78f3('0x9')]({'target':_0x2644a9,'condition':_0x2a14ed});this[_0x78f3('0x5')]+=0x1;};Graph['prototype'][_0x78f3('0xa')]=function(){return _['size'](this[_0x78f3('0x4')]);};Graph[_0x78f3('0x8')][_0x78f3('0xb')]=function(){return this['numberOfEdges'];};Graph[_0x78f3('0x8')][_0x78f3('0xc')]=function(_0x2ac303){return this[_0x78f3('0x4')][_0x2ac303];};Graph['prototype'][_0x78f3('0xd')]=function(_0x41b530,_0x339b21){if(!this[_0x78f3('0x4')][_0x41b530]){return logger[_0x78f3('0xe')]('no\x20vertex\x20found');}var _0xd6a1f1=_0x339b21(this['vertices'][_0x41b530]);if(!_0xd6a1f1){return logger[_0x78f3('0xe')](_0x78f3('0xf'));}if(this[_0x78f3('0x7')][_0x41b530]['length']===0x0){return logger['info'](_0x78f3('0x10'));}for(var _0x14d009=0x0,_0x370a68=[],_0x4a4bf1=![];_0x14d009-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 +var _0x8044=['connection','syncho','util','../../config/environment','../../config/logger','../../config/license/util','./rpc','./project','./events','EventEmitter','agi','127.0.0.1','projectUpdate','nextTick','stack','findIndex','splice','push','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','[%s]\x20%s','[ERROR]\x20%s','info','arg_1','calleridname','callerid','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','handleNotFound','production','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','[LICENSE]','./server','listening'];(function(_0x1bf774,_0x1e42e4){var _0x48518f=function(_0x5b29be){while(--_0x5b29be){_0x1bf774['push'](_0x1bf774['shift']());}};_0x48518f(++_0x1e42e4);}(_0x8044,0x1d1));var _0x4804=function(_0x4fa489,_0x4cba6b){_0x4fa489=_0x4fa489-0x0;var _0x41d2ce=_0x8044[_0x4fa489];return _0x41d2ce;};'use strict';var _=require('lodash');var syncho=require(_0x4804('0x0'));var util=require(_0x4804('0x1'));var config=require(_0x4804('0x2'));var logger=require(_0x4804('0x3'))('agi');var utilLicense=require(_0x4804('0x4'));var rpc=require(_0x4804('0x5'));var Project=require(_0x4804('0x6'));var AGIEmitter=require(_0x4804('0x7'))[_0x4804('0x8')];var projects=[];config['agi']=_['defaults'](config[_0x4804('0x9')],{'ip':_0x4804('0xa'),'port':0x11dd});AGIEmitter['on'](_0x4804('0xb'),projectUpdateHandler);function connectionHandler(_0x35e6cc){process[_0x4804('0xc')](function(){syncho(function(){try{setChannelVariables(_0x35e6cc);agiHandler(_0x35e6cc);}catch(_0x453204){logger['error'](_0x453204[_0x4804('0xd')]);}});});}function projectUpdateHandler(_0x1be1d7){try{var _0x58b48c=_[_0x4804('0xe')](projects,['id',_0x1be1d7['id']]);if(_0x58b48c>-0x1){if(_0x1be1d7['deleted']===!![]){projects[_0x4804('0xf')](_0x58b48c,0x1);}else{projects[_0x58b48c]=_0x1be1d7;}}else{projects[_0x4804('0x10')](_0x1be1d7);}}catch(_0x571e63){logger[_0x4804('0x11')](_0x571e63[_0x4804('0xd')]);}}function listeningHandler(){console[_0x4804('0x12')](_0x4804('0x13'),config['agi'][_0x4804('0x14')]);logger['info'](util[_0x4804('0x15')](_0x4804('0x16'),config[_0x4804('0x9')]['ip'],config[_0x4804('0x9')][_0x4804('0x14')]));}function errorHandler(_0xbb0af4){if(_0xbb0af4&&_0xbb0af4[_0x4804('0x17')]&&_0xbb0af4['message']){logger[_0x4804('0x11')](util[_0x4804('0x15')](_0x4804('0x18'),_0xbb0af4[_0x4804('0x17')],_0xbb0af4['message']));}else{logger[_0x4804('0x11')](util[_0x4804('0x15')](_0x4804('0x19'),_0xbb0af4['stack']));}}function closeHandler(){logger[_0x4804('0x1a')](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x4804('0x1b')],this[_0x4804('0x1c')],this[_0x4804('0x1d')],this['dnid'],this['uniqueid']));try{createSquareReport(this);}catch(_0x6f30df){logger[_0x4804('0x11')](_0x6f30df['stack']);}}function timeoutHandler(){logger[_0x4804('0x1a')](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[_0x4804('0x1c')],this[_0x4804('0x1d')],this[_0x4804('0x1e')],this['uniqueid']));}function hangupHandler(){logger[_0x4804('0x1a')](util[_0x4804('0x15')](_0x4804('0x1f'),this[_0x4804('0x1b')],this['calleridname'],this[_0x4804('0x1d')],this[_0x4804('0x1e')],this[_0x4804('0x20')]));this[_0x4804('0x21')]=!![];}function createSquareReport(_0x284d93,_0x7f6127){rpc[_0x4804('0x22')](_0x284d93)[_0x4804('0x23')](function(_0x1a78e6){if(_0x7f6127){_0x7f6127(null,_0x1a78e6);}})[_0x4804('0x24')](function(_0x538a70){if(_0x7f6127){_0x7f6127(null,_0x538a70);}});}function setChannelVariables(_0x1bfe6b){for(var _0x2590b9 in _0x1bfe6b){if(_0x1bfe6b[_0x4804('0x25')](_0x2590b9)){if(_0x2590b9[_0x4804('0x26')](_0x4804('0x27'))===0x0){_0x1bfe6b[_0x2590b9[_0x4804('0x28')](0x4)]=_0x1bfe6b[_0x2590b9];delete _0x1bfe6b[_0x2590b9];}}}}function agiHandler(_0xd7dd8c){logger[_0x4804('0x29')](_0x4804('0x2a'),JSON[_0x4804('0x2b')](_0xd7dd8c,null,0x2));logger[_0x4804('0x1a')](util['format'](_0x4804('0x2c'),_0xd7dd8c[_0x4804('0x1b')],_0xd7dd8c[_0x4804('0x1c')],_0xd7dd8c[_0x4804('0x1d')],_0xd7dd8c['dnid'],_0xd7dd8c[_0x4804('0x20')]));_0xd7dd8c['on'](_0x4804('0x11'),errorHandler);_0xd7dd8c['on'](_0x4804('0x2d'),closeHandler);_0xd7dd8c['on'](_0x4804('0x2e'),timeoutHandler);_0xd7dd8c[_0x4804('0x21')]=![];_0xd7dd8c['on'](_0x4804('0x2f'),hangupHandler);var _0x595f39=_['find'](projects,[_0x4804('0x17'),_0xd7dd8c['arg_1']]);if(!_0x595f39)return Project[_0x4804('0x30')](_0xd7dd8c);if(!_0x595f39[_0x4804('0x31')])return Project['handleUnpublished'](_0xd7dd8c);return Project['initialize'](_0x595f39,_0xd7dd8c);}function main(){var _0x4331ae;return utilLicense[_0x4804('0x32')]()[_0x4804('0x23')](function(_0x4ab618){if(!_0x4ab618)return;if(_0x4ab618['voice']){if(_0x4ab618['callysquare']&&_0x4ab618[_0x4804('0x33')]>0x0){logger['info'](util[_0x4804('0x15')]('[LICENSE]\x20CHANNELS:\x20%s',_0x4ab618[_0x4804('0x33')]));_0x4331ae=_0x4ab618[_0x4804('0x33')];}else{logger[_0x4804('0x1a')](_0x4804('0x34'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x4331ae=-0x1;}})[_0x4804('0x23')](function(){return Project[_0x4804('0x35')]();})[_0x4804('0x23')](function(_0x3d20ab){projects=_0x3d20ab;return;})['catch'](function(_0x2f64ff){logger[_0x4804('0x11')](_0x4804('0x36'),_0x2f64ff[_0x4804('0xd')]);})['finally'](function(){var _0x52a74a=require(_0x4804('0x37'))(config['agi']['port'],config[_0x4804('0x9')]['ip'],_0x4331ae);_0x52a74a['on'](_0x4804('0x11'),errorHandler);_0x52a74a['on'](_0x4804('0x38'),listeningHandler);_0x52a74a['on'](_0x4804('0x39'),connectionHandler);_0x52a74a['on'](_0x4804('0x2d'),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 4973706..afa1284 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 _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 +var _0x230e=['then','error','result','catch','sendMailMessage','bluebird','client','http','request'];(function(_0xb4f6d6,_0x44b863){var _0x236dad=function(_0x2dbfd6){while(--_0x2dbfd6){_0xb4f6d6['push'](_0xb4f6d6['shift']());}};_0x236dad(++_0x44b863);}(_0x230e,0xdd));var _0xe230=function(_0x5a6eae,_0x2c9ea9){_0x5a6eae=_0x5a6eae-0x0;var _0x486ca5=_0x230e[_0x5a6eae];return _0x486ca5;};'use strict';var BPromise=require(_0xe230('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xe230('0x1')][_0xe230('0x2')]({'port':0x232b});function request(_0x41df2a,_0x3e7d47){return new BPromise(function(_0x3f3dc0,_0x3fe80a){return client[_0xe230('0x3')](_0x41df2a,_0x3e7d47)[_0xe230('0x4')](function(_0x3c06e2){if(_0x3c06e2['error']){return _0x3fe80a(_0x3c06e2[_0xe230('0x5')]['message']);}else{return _0x3f3dc0(_0x3c06e2[_0xe230('0x6')]);}})[_0xe230('0x7')](function(_0x54a6e3){return _0x3fe80a(_0x54a6e3);});});}exports[_0xe230('0x8')]=function(_0x1d9765,_0x22d85c){return request('SendMail',{'account':_0x1d9765,'message':_0x22d85c});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 7e3d057..4c444ec 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 _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 +var _0xb606=['error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','target','root','inspect','production','start','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','arg_1','calleridname','dnid','uniqueid','traverseBFS','clear','debug','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','finally','callerid','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','util','../../config/logger','agi','./rpc','./graph','./vertices','catch'];(function(_0x104c7a,_0x219911){var _0x2a7492=function(_0x40047e){while(--_0x40047e){_0x104c7a['push'](_0x104c7a['shift']());}};_0x2a7492(++_0x219911);}(_0xb606,0x193));var _0x6b60=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xb606[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0x6b60('0x0'));var moment=require(_0x6b60('0x1'));var parser=require(_0x6b60('0x2'));var util=require(_0x6b60('0x3'));var logger=require(_0x6b60('0x4'))(_0x6b60('0x5'));var rpc=require(_0x6b60('0x6'));var mailRpc=require('./mailRpc');var Graph=require(_0x6b60('0x7'));var Vertices=require(_0x6b60('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x6b60('0x9')](function(_0x13c37d){logger[_0x6b60('0xa')](_0x6b60('0xb'),_0x13c37d[_0x6b60('0xc')]);return[];});}function addVertex(_0x58614f,_0x1341de,_0x3156bd){_0x1341de[_0x6b60('0xd')]=_0x3156bd;if(_0x1341de[_0x6b60('0xe')](_0x6b60('0xf'))){_0x1341de[_0x6b60('0x10')]=parseInt(_0x1341de[_0x6b60('0xf')],0xa);}_0x58614f[_0x6b60('0x11')](_[_0x6b60('0x12')](_0x1341de,_0x6b60('0x13')));}function initGraph(_0x52e20c,_0xd03c99){var _0x4a845f=new Graph();for(var _0x49af68 in _0x52e20c){if(_0x52e20c[_0x6b60('0xe')](_0x49af68)){if(_['isArray'](_0x52e20c[_0x49af68])){for(var _0x55c8b7=0x0;_0x55c8b7<_0x52e20c[_0x49af68][_0x6b60('0x14')];_0x55c8b7+=0x1){addVertex(_0x4a845f,_0x52e20c[_0x49af68][_0x55c8b7],_0x49af68);}}else{addVertex(_0x4a845f,_0x52e20c[_0x49af68],_0x49af68);}}}for(var _0x5a2a7a=0x0;_0x5a2a7a<_0xd03c99[_0x6b60('0x14')];_0x5a2a7a+=0x1){if(_0xd03c99[_0x5a2a7a]['source']&&_0xd03c99[_0x5a2a7a][_0x6b60('0x15')]){_0x4a845f['addEdge'](_0xd03c99[_0x5a2a7a]['source'],_0xd03c99[_0x5a2a7a]['target'],_0xd03c99[_0x5a2a7a]['value']);}}return _0x4a845f;}function getRoot(_0x233e35){return parser['toJson'](_0x233e35,{'object':!![]})['mxGraphModel'][_0x6b60('0x16')];}function inspect(_0x429b74){return util[_0x6b60('0x17')](_0x429b74,{'showHidden':![],'depth':null});}function initialize(_0x3ae892,_0xfa8915){var _0x100f00=getRoot(_0x3ae892[_0x6b60('0x18')]);if(!_0x100f00||!_0x100f00[_0x6b60('0x19')])return;var _0x4cde5a,_0x22ff3c,_0x57b6f8;logger['debug'](_0x6b60('0x16'),JSON[_0x6b60('0x1a')](_0x100f00,null,0x2));_0xfa8915[_0x6b60('0x1b')]=moment()['format'](_0x6b60('0x1c'));_0x4cde5a=initGraph(_['omit'](_0x100f00,_0x6b60('0x13')),_0x100f00[_0x6b60('0x13')]);_0x22ff3c=new Vertices(_0xfa8915,rpc,mailRpc);logger[_0x6b60('0x1d')](util[_0x6b60('0x1e')](_0x6b60('0x1f'),_0xfa8915[_0x6b60('0x20')],_0xfa8915[_0x6b60('0x21')],_0xfa8915['callerid'],_0xfa8915[_0x6b60('0x22')],_0xfa8915[_0x6b60('0x23')]));_0x4cde5a[_0x6b60('0x24')](_0x100f00[_0x6b60('0x19')]['id'],function(_0x3ba005){try{_0x3ba005=_0x22ff3c[_0x6b60('0x25')](_0x3ba005);logger[_0x6b60('0x26')](_0x6b60('0x27'),JSON[_0x6b60('0x1a')](_0x3ba005,null,0x2));if(_0x3ba005[_0x6b60('0xd')]==='gotoc'){logger[_0x6b60('0x1d')](_0x6b60('0x28'));_0xfa8915[_0x6b60('0x29')]=_0x3ba005[_0x6b60('0x29')]||_0xfa8915[_0x6b60('0x29')];_0xfa8915['extension']=_0x3ba005[_0x6b60('0x2a')];_0xfa8915[_0x6b60('0x2b')]=_0x3ba005['priority']?_0x3ba005[_0x6b60('0x2b')]-0x1:0x1;return null;}else if(_0x3ba005&&_0x22ff3c[_0x3ba005[_0x6b60('0xd')]]){_0x57b6f8=_0x22ff3c[_0x3ba005[_0x6b60('0xd')]](_0x3ba005);logger[_0x6b60('0x1d')](_0x6b60('0x2c'),JSON[_0x6b60('0x1a')](_0x57b6f8,null,0x2));if(_0x57b6f8&&_0x57b6f8['code']===AGI_CODE_SUCCESS&&_0x57b6f8[_0x6b60('0x2d')]!==AGI_RESULT_ERROR&&!_0xfa8915[_0x6b60('0x2e')]){logger[_0x6b60('0x26')](_0x6b60('0x2c'),inspect(_0x57b6f8));return _[_0x6b60('0x2f')](_0x57b6f8[_0x6b60('0x2d')])?null:_0x57b6f8[_0x6b60('0x2d')][_0x6b60('0x30')]();}else{logger[_0x6b60('0xa')]('response',inspect(_0x57b6f8));return null;}}else{logger[_0x6b60('0xa')](_0x6b60('0x31'));return null;}}catch(_0x249259){logger[_0x6b60('0xa')](_0x249259[_0x6b60('0xc')]);return null;}});if(_0x100f00[_0x6b60('0x32')]){logger['info'](util[_0x6b60('0x1e')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xfa8915['arg_1'],_0xfa8915[_0x6b60('0x21')],_0xfa8915[_0x6b60('0x33')],_0xfa8915['dnid'],_0xfa8915[_0x6b60('0x23')]));_0x4cde5a[_0x6b60('0x24')](_0x100f00['finally']['id'],function(_0x38c415){try{_0x38c415=_0x22ff3c['clear'](_0x38c415);logger[_0x6b60('0x26')](_0x6b60('0x27'),JSON[_0x6b60('0x1a')](_0x38c415,null,0x2));if(_0x38c415&&_0x22ff3c[_0x38c415[_0x6b60('0xd')]]){_0x57b6f8=_0x22ff3c[_0x38c415[_0x6b60('0xd')]](_0x38c415);if(_0x57b6f8){logger['debug'](_0x6b60('0x2c'),inspect(_0x57b6f8));return _[_0x6b60('0x2f')](_0x57b6f8[_0x6b60('0x2d')])?null:_0x57b6f8[_0x6b60('0x2d')][_0x6b60('0x30')]();}else{logger[_0x6b60('0xa')](_0x6b60('0x2c'),inspect(_0x57b6f8));return null;}}else{logger['error'](_0x6b60('0x31'));return null;}}catch(_0x3804c3){logger[_0x6b60('0xa')](_0x3804c3[_0x6b60('0xc')]);return null;}});}logger[_0x6b60('0x1d')](util[_0x6b60('0x1e')](_0x6b60('0x34'),_0xfa8915[_0x6b60('0x20')],_0xfa8915['calleridname'],_0xfa8915['callerid'],_0xfa8915[_0x6b60('0x22')],_0xfa8915['uniqueid']));logger['info'](util[_0x6b60('0x1e')](_0x6b60('0x35'),_0xfa8915[_0x6b60('0x29')],_0xfa8915[_0x6b60('0x2a')],parseInt(_0xfa8915[_0x6b60('0x2b')],0xa)+0x1));_0xfa8915[_0x6b60('0x36')](_0xfa8915['context'],_0xfa8915[_0x6b60('0x2a')],parseInt(_0xfa8915[_0x6b60('0x2b')],0xa)+0x1);_0xfa8915[_0x6b60('0x37')]();}function handleNotFound(_0x1d9aef){logger['error'](util[_0x6b60('0x1e')](_0x6b60('0x38'),_0x1d9aef[_0x6b60('0x20')]));_0x1d9aef[_0x6b60('0x36')](_0x1d9aef[_0x6b60('0x29')],_0x1d9aef[_0x6b60('0x2a')],parseInt(_0x1d9aef[_0x6b60('0x2b')],0xa)+0x1);_0x1d9aef[_0x6b60('0x37')]();}function handleUnpublished(_0x1b0912){logger['error'](util['format'](_0x6b60('0x39'),_0x1b0912['arg_1']));_0x1b0912['continueAt'](_0x1b0912[_0x6b60('0x29')],_0x1b0912[_0x6b60('0x2a')],parseInt(_0x1b0912['priority'],0xa)+0x1);_0x1b0912[_0x6b60('0x37')]();}module[_0x6b60('0x3a')]={'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 a2d58f9..fb524f5 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 _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 +var _0xa503=['util','stream','Transform','call','_localBuffer','_inBody','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','trim','emit','headers','exports'];(function(_0x20a381,_0xc2de8d){var _0x2a7e09=function(_0x1fb172){while(--_0x1fb172){_0x20a381['push'](_0x20a381['shift']());}};_0x2a7e09(++_0xc2de8d);}(_0xa503,0x143));var _0x3a50=function(_0x19beb2,_0x3f68c0){_0x19beb2=_0x19beb2-0x0;var _0x4118dd=_0xa503[_0x19beb2];return _0x4118dd;};'use strict';var util=require(_0x3a50('0x0'));var Transform=require(_0x3a50('0x1'))[_0x3a50('0x2')];function AGIReply(_0x3fb8eb){Transform[_0x3a50('0x3')](this,_0x3fb8eb);this[_0x3a50('0x4')]='';this[_0x3a50('0x5')]=![];}util['inherits'](AGIReply,Transform);AGIReply['prototype'][_0x3a50('0x6')]=function(_0x352ef1,_0x574978,_0x5dc625){var _0x1956cd='\x0a',_0x3ad392=['\x0a\x0a',_0x3a50('0x7')],_0x44bd93=-0x1,_0x307280=-0x1,_0x3ffb2f='',_0x1cd114=0x0,_0x58b86e='',_0x2ed3f7='';this[_0x3a50('0x4')]+=_0x352ef1[_0x3a50('0x8')]();_0x58b86e=this[_0x3a50('0x4')];if(!this[_0x3a50('0x5')]){_0x1cd114=0x0;while(_0x3ad392[_0x1cd114]){while((_0x307280=_0x58b86e[_0x3a50('0x9')](_0x3ad392[_0x1cd114]))!=-0x1){_0x3ffb2f=_0x3ad392[_0x1cd114];_0x2ed3f7=_0x58b86e['substring'](0x0,_0x307280);_0x58b86e=_0x58b86e[_0x3a50('0xa')](_0x307280+_0x3ffb2f[_0x3a50('0xb')]);var _0x1c5a82=_0x2ed3f7[_0x3a50('0xc')](_0x1956cd),_0x59df99=0x0,_0x1bfd3f={},_0x4e9a5a='',_0x1719c8='',_0x401060=-0x1;while(_0x1c5a82[_0x59df99]){_0x401060=_0x1c5a82[_0x59df99][_0x3a50('0x9')](':');if(_0x401060!=-0x1){_0x4e9a5a=_0x1c5a82[_0x59df99]['slice'](0x0,_0x401060)[_0x3a50('0xd')]();_0x1719c8=_0x1c5a82[_0x59df99]['slice'](_0x401060+0x1)[_0x3a50('0xd')]();if(_0x4e9a5a[_0x3a50('0xb')]>0x0){_0x1bfd3f[_0x4e9a5a]=_0x1719c8;}}else{}_0x59df99++;}this[_0x3a50('0xe')](_0x3a50('0xf'),_0x1bfd3f);this['_inBody']=!![];}_0x1cd114++;}this[_0x3a50('0x4')]=_0x58b86e;}else{while((_0x44bd93=_0x58b86e['indexOf'](_0x1956cd))!=-0x1){_0x2ed3f7=_0x58b86e[_0x3a50('0xa')](0x0,_0x44bd93);this[_0x3a50('0xe')]('line',_0x2ed3f7);_0x58b86e=_0x58b86e['substring'](_0x44bd93+_0x1956cd[_0x3a50('0xb')]);}this['_localBuffer']=_0x58b86e;}_0x5dc625();};module[_0x3a50('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index daf0134..f12e99c 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 _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 +var _0x269f=['ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','http','request','then','error','message','result','catch','getSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','GetContactByPhone','save_name','getIntervalById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','ShowCmHopper','phone'];(function(_0x248bf0,_0x29a685){var _0x455c00=function(_0x44da4d){while(--_0x44da4d){_0x248bf0['push'](_0x248bf0['shift']());}};_0x455c00(++_0x29a685);}(_0x269f,0xee));var _0xf269=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x269f[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0xf269('0x0'));var moment=require(_0xf269('0x1'));var jayson=require(_0xf269('0x2'));var client=jayson['client'][_0xf269('0x3')]({'port':0x2329});function request(_0x59459a,_0x45b72d){return new Promise(function(_0x35e943,_0x230d12){return client[_0xf269('0x4')](_0x59459a,_0x45b72d)[_0xf269('0x5')](function(_0x527acd){if(_0x527acd[_0xf269('0x6')]){return _0x230d12(_0x527acd[_0xf269('0x6')][_0xf269('0x7')]);}else{return _0x35e943(_0x527acd[_0xf269('0x8')]);}})[_0xf269('0x9')](function(_0x43c60c){return _0x230d12(_0x43c60c);});});}exports[_0xf269('0xa')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0xf269('0xb'),_0xf269('0xc')]}});};exports[_0xf269('0xd')]=function(_0x2f7c95){return request(_0xf269('0xe'),{'options':{'raw':![],'where':{'name':_0x2f7c95},'attributes':[_0xf269('0xc')]}});};exports[_0xf269('0xf')]=function(_0x424103){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x424103},'include':[{'model':'MailServerOut','as':'Smtp','include':[{'model':'CloudProvider','as':'CloudProvider'}]}],'attributes':['id',_0xf269('0xb'),_0xf269('0x10')],'smtp':!![]}});};exports[_0xf269('0x11')]=function(_0x4d130e){return request(_0xf269('0xe'),{'options':{'where':{'id':_0x4d130e},'attributes':[_0xf269('0xb')]}});};exports[_0xf269('0x12')]=function(_0x34912d){return request(_0xf269('0x13'),{'options':{'where':{'id':_0x34912d},'attributes':[_0xf269('0xb')]}});};exports[_0xf269('0x14')]=function(_0x2bdeb9){return request(_0xf269('0x15'),{'options':{'where':{'id':_0x2bdeb9},'attributes':[_0xf269('0xb')]}});};exports[_0xf269('0x16')]=function(_0xa00717){return request(_0xf269('0x17'),{'options':{'where':{'id':_0xa00717},'attributes':[_0xf269('0x18')]}});};exports[_0xf269('0x19')]=function(_0x2910d0){return request(_0xf269('0x1a'),{'options':{'where':{'id':_0x2910d0},'attributes':[_0xf269('0xb')]}});};exports['getContactByPhone']=function(_0x60f3b0){return request(_0xf269('0x1b'),{'options':{'where':{'phone':_0x60f3b0['phone']},'attributes':['id']}});};exports['getTrunkById']=function(_0x3a7f06){return request('ShowTrunk',{'options':{'where':{'id':_0x3a7f06},'attributes':[_0xf269('0xb')]}});};exports['getSoundById']=function(_0x4e5f0d){return request('ShowSound',{'options':{'where':{'id':_0x4e5f0d},'attributes':[_0xf269('0x1c')]}});};exports[_0xf269('0x1d')]=function(_0x4cedf4){return request(_0xf269('0x1e'),{'options':{'raw':![],'where':{'id':_0x4cedf4},'include':[{'model':_0xf269('0x1f'),'as':'Intervals'}]}});};exports[_0xf269('0x20')]=function(_0x328973){return request(_0xf269('0x21'),{'options':{'where':{'id':_0x328973},'attributes':['id',_0xf269('0xb')]}});};exports[_0xf269('0x22')]=function(_0x30d9b0){return request('CreateSmsMessage',{'body':_0x30d9b0});};exports[_0xf269('0x23')]=function(_0x43b5f2){return request('CreateSquareDetailsReport',{'body':_0x43b5f2});};exports[_0xf269('0x24')]=function(_0x7812a2){return request(_0xf269('0x25'),{'body':_[_0xf269('0x26')](_0x7812a2,{'project_name':_0x7812a2[_0xf269('0x27')],'prev_project_name':_0x7812a2['arg_2']||'','is_subproject':_0x7812a2['arg_2']?!![]:![],'leaveAt':moment()[_0xf269('0x28')](_0xf269('0x29'))})});};exports[_0xf269('0x2a')]=function(_0x1b66ec){return request(_0xf269('0x2b'),{'body':_0x1b66ec});};exports[_0xf269('0x2c')]=function(_0xae9f32){return request('CreateSquareMessage',{'body':_0xae9f32});};exports['createCmContact']=function(_0xeac015){return request(_0xf269('0x2d'),{'options':{'raw':![],'where':{'phone':_0xeac015[_0xf269('0x2e')],'ListId':_0xeac015[_0xf269('0x2f')]}}})[_0xf269('0x5')](function(_0x3441df){if(_0x3441df){return _0x3441df;}return request(_0xf269('0x30'),{'body':_0xeac015});});};exports[_0xf269('0x31')]=function(_0x337050){return request(_0xf269('0x32'),{'options':{'where':{'id':_0x337050},'attributes':[_0xf269('0xb')]}});};exports[_0xf269('0x33')]=function(_0x517f89,_0x4c513d){return request(_0xf269('0x34'),{'body':{'interface':_0x4c513d},'options':{'where':_0x517f89}});};exports['agentPause']=function(_0x3619bd,_0x3eb25c,_0x4c90d5){return request(_0xf269('0x35'),{'body':{'type':_0x3eb25c,'uniqueid':_0x4c90d5},'options':{'where':_0x3619bd}});};exports['agentUnpause']=function(_0x2b3357){return request(_0xf269('0x36'),{'body':{},'options':{'where':_0x2b3357}});};exports[_0xf269('0x37')]=function(_0x233bce){return request(_0xf269('0x38'),{'body':{},'options':{'where':_0x233bce}});}; \ 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 920f91b..271708c 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 _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 +var _0x1766=['./polly'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1766,0x17d));var _0x6176=function(_0x175b43,_0x61d0ba){_0x175b43=_0x175b43-0x0;var _0x51d690=_0x1766[_0x175b43];return _0x51d690;};var polly=require(_0x6176('0x0'));var lex=require('./lex');module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 72a3827..6dfebe2 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 _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 +var _0xb688=['exports'];(function(_0x361b6d,_0x1ca997){var _0x561256=function(_0x1646f9){while(--_0x1646f9){_0x361b6d['push'](_0x361b6d['shift']());}};_0x561256(++_0x1ca997);}(_0xb688,0xcf));var _0x8b68=function(_0x5a71f7,_0xac2c09){_0x5a71f7=_0x5a71f7-0x0;var _0x488687=_0xb688[_0x5a71f7];return _0x488687;};'use strict';var lex=require('./lib/api');module[_0x8b68('0x0')]=function(_0x196cec,_0x266285,_0x1080e8,_0x23bbaa,_0x446b17,_0x4e281c){return lex(_0x196cec,_0x266285,_0x1080e8,_0x23bbaa,_0x446b17,_0x4e281c);}; \ 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 f487809..2d0b278 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(_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 +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x3a2323,_0x567d26){var _0x3bee6f=function(_0x43b20d){while(--_0x43b20d){_0x3a2323['push'](_0x3a2323['shift']());}};_0x3bee6f(++_0x567d26);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 7d117d0..4cb43e4 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 _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 +var _0xe2d8=['./lib/api','exports'];(function(_0x433d2a,_0x4bb957){var _0x1affe0=function(_0x120a25){while(--_0x120a25){_0x433d2a['push'](_0x433d2a['shift']());}};_0x1affe0(++_0x4bb957);}(_0xe2d8,0x14c));var _0x8e2d=function(_0x4c715a,_0x2d583d){_0x4c715a=_0x4c715a-0x0;var _0x5ceb9c=_0xe2d8[_0x4c715a];return _0x5ceb9c;};'use strict';var polly=require(_0x8e2d('0x0'));module[_0x8e2d('0x1')]=function(_0x2f82f8,_0xfb5e6f,_0x32a551,_0x5a7bc8,_0x19838e,_0x22d051,_0x4ac866){return polly(_0x2f82f8,_0xfb5e6f,_0x32a551,_0x5a7bc8,_0x19838e,_0x22d051,_0x4ac866);}; \ 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 e12af54..a30639e 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 _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 +var _0x6310=['aws-sdk','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path','bluebird','randomstring'];(function(_0xd9dda1,_0x260e39){var _0x57b03b=function(_0x3fd947){while(--_0x3fd947){_0xd9dda1['push'](_0xd9dda1['shift']());}};_0x57b03b(++_0x260e39);}(_0x6310,0xb1));var _0x0631=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x6310[_0x27af45];return _0x18df21;};'use strict';var fs=require('fs');var path=require(_0x0631('0x0'));var BPromise=require(_0x0631('0x1'));var rs=require(_0x0631('0x2'));var AWS=require(_0x0631('0x3'));function pollyResult(_0x14d36c,_0x51284a,_0x25a32d){return new BPromise(function(_0x45f3a6,_0x126955){_0x14d36c[_0x0631('0x4')](_0x51284a,function(_0xfa62f9,_0x507d6b){if(_0xfa62f9){_0x126955(_0xfa62f9);}else if(_0x507d6b){if(_0x507d6b['AudioStream']instanceof Buffer){fs[_0x0631('0x5')](_0x25a32d,_0x507d6b[_0x0631('0x6')],function(_0x11a389){if(_0x11a389){_0x126955(_0x11a389);}else{_0x45f3a6();}});}else{_0x126955(new Error(_0x0631('0x7')));}}else{_0x126955(new Error(_0x0631('0x8')));}});});}module[_0x0631('0x9')]=function(_0x2120ff,_0x7f922,_0x4189cc,_0x2e90d1,_0xbaa78,_0x411c67,_0x189805){var _0x37c55a=new AWS[(_0x0631('0xa'))]({'accessKeyId':_0x2120ff,'secretAccessKey':_0x7f922,'region':_0x4189cc});var _0x378a55={'Text':_0xbaa78,'TextType':_0x411c67||'text','OutputFormat':_0x0631('0xb'),'VoiceId':_0x2e90d1};return pollyResult(_0x37c55a,_0x378a55,_0x189805);}; \ 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 9b50acd..f75a741 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 _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 +var _0x210d=['./lib/api','exports'];(function(_0x49af52,_0x1ccd54){var _0x35b2af=function(_0x169cdb){while(--_0x169cdb){_0x49af52['push'](_0x49af52['shift']());}};_0x35b2af(++_0x1ccd54);}(_0x210d,0x12c));var _0xd210=function(_0x330414,_0x4f3207){_0x330414=_0x330414-0x0;var _0x99dbff=_0x210d[_0x330414];return _0x99dbff;};'use strict';var asr=require(_0xd210('0x0'));module[_0xd210('0x1')]=function(_0x37f62e,_0x1fdb37,_0xbe3470,_0x563ec2){return asr(_0x37f62e,_0x1fdb37,_0xbe3470);}; \ 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 ca5594d..5816cb5 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 _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 +var _0x803f=['/v1/speech:recognize?key=','8000','url','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST'];(function(_0x1aaa52,_0x442418){var _0x1a3b6a=function(_0x4a168a){while(--_0x4a168a){_0x1aaa52['push'](_0x1aaa52['shift']());}};_0x1a3b6a(++_0x442418);}(_0x803f,0x64));var _0xf803=function(_0x2301f0,_0x5a4621){_0x2301f0=_0x2301f0-0x0;var _0x4db480=_0x803f[_0x2301f0];return _0x4db480;};'use strict';var url=require(_0xf803('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xf803('0x1');module[_0xf803('0x2')]=function(_0x4ce875,_0x1a8691,_0x43fb3b){return new BPromise(function(_0x19ff73,_0x6baafe){var _0x5c2cd6;if(typeof _0x4ce875!=='string'||_0x4ce875[_0xf803('0x3')]===0x0){return _0x6baafe(_0xf803('0x4'));}if(typeof _0x1a8691!==_0xf803('0x5')||_0x1a8691['length']===0x0){return _0x6baafe(_0xf803('0x6'));}if(typeof _0x43fb3b!==_0xf803('0x7')&&(typeof _0x43fb3b!=='string'||_0x43fb3b[_0xf803('0x3')]===0x0)){return _0x6baafe(_0xf803('0x8'));}try{_0x5c2cd6=fs[_0xf803('0x9')](_0x4ce875)['toString'](_0xf803('0xa'));}catch(_0x5cd4b4){return _0x6baafe(_0x5cd4b4);}return _0x19ff73({'method':_0xf803('0xb'),'uri':host+_0xf803('0xc')+_0x1a8691,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xf803('0xd'),'languageCode':_0x43fb3b},'audio':{'content':_0x5c2cd6}},'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 71ccca7..10cb4be 100644 --- a/server/services/agi/scripts/google/index.js +++ b/server/services/agi/scripts/google/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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 +var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index ab5a0f3..ab42641 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 _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 +var _0x8295=['.wav','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','stringify','null','generic','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','writeFileSync','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','textRequest','result','source','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','isFallbackIntent','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','languageCode','queryText','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','nda','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','bluebird','dialogflow','http','https','md5','path','request-promise','randomstring','sox','url','util','./aws','./google','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','createWriteStream','info','finish\x20download\x20file','unlink','download\x20error','end','host','WHAT_EVER','data','transcode','wav','error\x20convert','start','resolve','generate','base64','then','chmodSync','777','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','tmp','.mp3','from','audioContent','writeFile'];(function(_0x17521d,_0x5ee0ba){var _0x283d4f=function(_0x4fdad5){while(--_0x4fdad5){_0x17521d['push'](_0x17521d['shift']());}};_0x283d4f(++_0x5ee0ba);}(_0x8295,0xd0));var _0x5829=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x8295[_0x565c49];return _0x20ca34;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x5829('0x0'));var dialogflow=require(_0x5829('0x1'));var fs=require('fs');var http=require(_0x5829('0x2'));var https=require(_0x5829('0x3'));var md5=require(_0x5829('0x4'));var path=require(_0x5829('0x5'));var querystring=require('querystring');var rp=require(_0x5829('0x6'));var rs=require(_0x5829('0x7'));var sox=require(_0x5829('0x8'));var tts=require('google-tts-api');var urlParse=require(_0x5829('0x9'))['parse'];var util=require(_0x5829('0xa'));var aws=require(_0x5829('0xb'));var google=require(_0x5829('0xc'));var sestek=require(_0x5829('0xd'));var tilde=require(_0x5829('0xe'));var logger=require(_0x5829('0xf'))('agi');var ISPEECH_API=_0x5829('0x10');function downloadFile(_0x3f3d5f,_0x4e35e6){return new BPromise(function(_0x153bb8,_0x52a335){var _0x11500e=urlParse(_0x3f3d5f);var _0x4cbe04=_0x11500e[_0x5829('0x11')]===_0x5829('0x12')?https:http;var _0x1d525a={'host':_0x11500e['host'],'path':_0x11500e[_0x5829('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x4cbe04[_0x5829('0x13')](_0x1d525a,function(_0x5303ee){if(_0x5303ee['statusCode']!==0xc8){logger[_0x5829('0x14')](_0x5829('0x15')+_0x3f3d5f+_0x5829('0x16')+_0x5303ee[_0x5829('0x17')]+'\x20('+_0x5303ee[_0x5829('0x18')]+')');_0x52a335(new Error(_0x5829('0x15')+_0x3f3d5f+'\x20failed,\x20status\x20code\x20=\x20'+_0x5303ee['statusCode']+'\x20('+_0x5303ee[_0x5829('0x18')]+')'));return;}var _0x93fba7=fs[_0x5829('0x19')](_0x4e35e6);_0x93fba7['on']('finish',function(){logger[_0x5829('0x1a')](_0x5829('0x1b'));_0x93fba7['close'](_0x153bb8);});_0x93fba7['on']('error',function(_0x1f26ef){fs[_0x5829('0x1c')](_0x4e35e6);logger[_0x5829('0x14')](_0x5829('0x1d'),_0x1f26ef);_0x52a335(_0x1f26ef);});_0x5303ee['pipe'](_0x93fba7);})['on'](_0x5829('0x14'),function(_0x3bca2b){logger[_0x5829('0x14')](_0x3bca2b);_0x52a335(_0x3bca2b);})[_0x5829('0x1e')]();});}function uploadFile(_0x49a42b){return new BPromise(function(_0x373b6b,_0x471512){var _0x1a7941=urlParse(_0x49a42b);var _0x56fc59=_0x1a7941[_0x5829('0x11')]===_0x5829('0x12')?https:http;var _0xe84845={'host':_0x1a7941[_0x5829('0x1f')],'path':_0x1a7941[_0x5829('0x5')],'headers':{'user-agent':_0x5829('0x20')}};_0x56fc59[_0x5829('0x13')](_0xe84845,function(_0x44fc61){if(_0x44fc61[_0x5829('0x17')]!==0xc8){_0x471512(new Error('request\x20to\x20'+_0x49a42b+_0x5829('0x16')+_0x44fc61['statusCode']+'\x20('+_0x44fc61[_0x5829('0x18')]+')'));return;}var _0x4e9145='';_0x44fc61['on'](_0x5829('0x21'),function(_0x19132a){_0x4e9145+=_0x19132a;});_0x44fc61['on']('end',function(){_0x373b6b(_0x4e9145);});})['on'](_0x5829('0x14'),function(_0x427aa2){_0x471512(_0x427aa2);})[_0x5829('0x1e')]();});}function convertFile(_0x45b76e,_0x3c8a53){return new BPromise(function(_0x2bd4ce,_0x3c5f3f){var _0x2667b1=sox[_0x5829('0x22')](_0x45b76e,_0x3c8a53,{'sampleRate':0x1f40,'format':_0x5829('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2667b1['on'](_0x5829('0x14'),function(_0x192628){logger[_0x5829('0x14')](_0x5829('0x24'),_0x192628);_0x3c5f3f(_0x192628);});_0x2667b1['on'](_0x5829('0x1e'),function(){logger[_0x5829('0x1a')]('finish\x20to\x20convert');_0x2bd4ce();});_0x2667b1[_0x5829('0x25')]();});}function base64Decode(_0x2336ef,_0x5338b0){var _0x536ed2=path[_0x5829('0x26')](__dirname,'tmp',rs[_0x5829('0x27')](0x4)+'.wav');fs['writeFileSync'](_0x536ed2,_0x2336ef,_0x5829('0x28'));return convertFile(_0x536ed2,_0x5338b0)[_0x5829('0x29')](function(){try{fs[_0x5829('0x1c')](_0x536ed2);fs[_0x5829('0x2a')](_0x5338b0,_0x5829('0x2b'));}catch(_0x417640){logger['error'](_0x417640);}return _0x5338b0[_0x5829('0x2c')]('.')[0x0];});}function base64Encode(_0x30c01b){var _0xb663bf=fs[_0x5829('0x2d')](_0x30c01b);return new Buffer(_0xb663bf)[_0x5829('0x2e')](_0x5829('0x28'));}exports['googleCloudTTS']=function(_0x11e92f,_0x4256db,_0x5b057a,_0x52fb96,_0x2838df,_0x542bc5){var _0x54f6d3,_0x409ad3;var _0x3d3a0d=_0x5829('0x2f');var _0x2fdb52=_0x5829('0x30')+_0x11e92f;var _0x34542d={};if(_0x4256db===_0x5829('0x31')){_0x34542d['input']={'ssml':_0x5b057a};}else{_0x34542d[_0x5829('0x32')]={'text':_0x5b057a};};_0x34542d[_0x5829('0x33')]={'languageCode':_0x52fb96,'ssmlGender':_0x2838df};_0x34542d[_0x5829('0x34')]={'audioEncoding':_0x5829('0x35'),'sampleRateHertz':0x1f40};var _0xfec57b={'url':_0x3d3a0d+_0x5829('0x36')+_0x2fdb52,'method':'POST','json':!![],'body':_0x34542d};return rp(_0xfec57b)[_0x5829('0x29')](function(_0x129dec){return new BPromise(function(_0x4dc24f,_0x9ef7f5){_0x54f6d3=path['resolve'](__dirname,_0x5829('0x37'),rs[_0x5829('0x27')](0x4)+_0x5829('0x38'));var _0x211a4a=Buffer[_0x5829('0x39')](_0x129dec[_0x5829('0x3a')],'base64');return fs[_0x5829('0x3b')](_0x54f6d3,_0x211a4a,function(_0x1c9b8f){_0x9ef7f5(_0x1c9b8f);},function(_0x3f88ea){fs['chmodSync'](_0x54f6d3,_0x5829('0x2b'));_0x4dc24f(_0x3f88ea);});});})[_0x5829('0x29')](function(_0x23a030){_0x409ad3=path['resolve'](__dirname,_0x5829('0x37'),rs[_0x5829('0x27')](0x4)+_0x5829('0x3c'));return convertFile(_0x54f6d3,_0x409ad3);})[_0x5829('0x29')](function(){try{fs['unlink'](_0x54f6d3);fs['chmodSync'](_0x409ad3,'777');}catch(_0x2a8e53){logger['error'](_0x2a8e53);}logger['info'](_0x5829('0x3d'),_0x409ad3[_0x5829('0x2c')]('.')[0x0]);return _0x409ad3['split']('.')[0x0];});};exports['googleTTS']=function(_0x597036,_0x2f106f){var _0x2f68da=_0x5829('0x3e');var _0x103722,_0x43f06e;var _0x193de6;var _0x5ab0ff={'encoding':_0x5829('0x3f'),'method':'POST','timeout':0x2710,'url':_0x2f68da,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON[_0x5829('0x40')]([[['jQ1olc',JSON[_0x5829('0x40')]([_0x597036,_0x2f106f||'en',![],_0x5829('0x41')]),null,_0x5829('0x42')]]]))};return rp(_0x5ab0ff)['then'](function(_0x1b08f5){try{_0x193de6=eval(_0x1b08f5['slice'](0x5))[0x0][0x2];}catch(_0x3bc38b){throw new Error(_0x5829('0x43')+_0x1b08f5[_0x5829('0x21')]);}if(!_0x193de6){if(_0x597036['length']>0xc8){throw new Error(_0x5829('0x44'));}else{throw new Error(_0x5829('0x45')+_0x2f106f+_0x5829('0x46'));}}try{_0x193de6=eval(_0x193de6)[0x0];}catch(_0x509043){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x5829('0x21')]);}const _0x5c04b6=_0x193de6;_0x103722=path[_0x5829('0x26')](__dirname,_0x5829('0x37'),rs['generate'](0x4)+_0x5829('0x38'));fs[_0x5829('0x47')](_0x103722,_0x193de6,{'encoding':_0x5829('0x28')});_0x43f06e=path[_0x5829('0x26')](__dirname,_0x5829('0x37'),rs[_0x5829('0x27')](0x4)+_0x5829('0x3c'));return convertFile(_0x103722,_0x43f06e);})['then'](function(){try{fs[_0x5829('0x1c')](_0x103722);fs['chmodSync'](_0x43f06e,'777');}catch(_0xa5a872){logger['error'](_0xa5a872);}logger['info'](_0x5829('0x48'),_0x43f06e[_0x5829('0x2c')]('.')[0x0]);return _0x43f06e[_0x5829('0x2c')]('.')[0x0];});};exports[_0x5829('0x49')]=function(_0x2e6b1d,_0x53d48a,_0x49766e){return google[_0x5829('0x4a')](_0x2e6b1d,_0x53d48a,_0x49766e)['then'](function(_0x50b24c){logger[_0x5829('0x1a')](_0x50b24c[_0x5829('0x4b')]);return rp(_0x50b24c);})['then'](function(_0x54f922){var _0x1d4573='';var _0x57a6d5=0x0;try{fs[_0x5829('0x1c')](_0x2e6b1d);}catch(_0x309d8f){logger[_0x5829('0x14')](_0x309d8f);}if(_0x54f922&&_0x54f922[_0x5829('0x4c')]){_0x1d4573=_0x54f922['results']['map'](function(_0x328c07){return _0x328c07&&_0x328c07[_0x5829('0x4d')][0x0]&&_0x328c07[_0x5829('0x4d')][0x0][_0x5829('0x4e')]?_0x328c07[_0x5829('0x4d')][0x0][_0x5829('0x4e')]:'';})['join']('\x0a');_0x57a6d5=_0x54f922[_0x5829('0x4c')][_0x5829('0x4f')](function(_0x4b1d7e){return _0x4b1d7e&&_0x4b1d7e[_0x5829('0x4d')][0x0]&&_0x4b1d7e[_0x5829('0x4d')][0x0][_0x5829('0x50')]?_0x4b1d7e['alternatives'][0x0][_0x5829('0x50')]:0x0;})['join']('\x0a');}logger[_0x5829('0x1a')](_0x5829('0x51'),_0x1d4573);logger[_0x5829('0x1a')](_0x5829('0x52'),_0x57a6d5);return{'transcript':_0x1d4573,'confidence':_0x57a6d5};})[_0x5829('0x53')](function(_0x304ff1){logger[_0x5829('0x14')](_0x5829('0x54'),_0x304ff1[_0x5829('0x17')],_0x304ff1[_0x5829('0x55')],_0x304ff1['message']);});};exports['googleDialogflow']=function(_0x1cf8fd,_0x4c5aaa,_0xb82299,_0x38d6a6){var _0x159b28=apiai(_0x4c5aaa,{'language':_0x38d6a6||'en'});return _0x159b28[_0x5829('0x56')](_0xb82299,{'sessionId':md5(_0x1cf8fd)})[_0x5829('0x29')](function(_0x37b31b){logger['info'](JSON['stringify'](_0x37b31b));return{'source':_0x37b31b[_0x5829('0x57')][_0x5829('0x58')],'resolvedQuery':_0x37b31b[_0x5829('0x57')]['resolvedQuery'],'action':_0x37b31b[_0x5829('0x57')][_0x5829('0x59')],'actionIncomplete':_0x37b31b[_0x5829('0x57')][_0x5829('0x5a')],'speech':_0x37b31b[_0x5829('0x57')][_0x5829('0x5b')][_0x5829('0x5c')],'score':_0x37b31b[_0x5829('0x57')][_0x5829('0x5d')],'statusCode':_0x37b31b[_0x5829('0x5e')][_0x5829('0x5f')],'endConversation':_0x37b31b['result'][_0x5829('0x60')]['endConversation']||![],'isFallbackIntent':_0x37b31b[_0x5829('0x57')]['metadata'][_0x5829('0x61')]};});};exports['googleDialogflowV2']=function(_0x1685f6,_0x2da0ae,_0x5a4e4d,_0x52f5c6,_0x37cec8,_0x16a5af){var _0x56b1c4=_0x52f5c6[_0x5829('0x62')](/\\n/g,'\x0a');var _0x357159={'credentials':{'private_key':_0x56b1c4,'client_email':_0x5a4e4d}};var _0x1967a2=new dialogflow[(_0x5829('0x63'))](_0x357159);var _0x3025b0=_0x1967a2[_0x5829('0x64')](_0x2da0ae,md5(_0x1685f6));var _0x4a97c3={'session':_0x3025b0,'queryInput':{'text':{'text':_0x37cec8,'languageCode':_0x16a5af}}};return _0x1967a2['detectIntent'](_0x4a97c3)[_0x5829('0x29')](function(_0x3cc7ef){if(_0x3cc7ef&&_0x3cc7ef['length']){logger['info'](_0x5829('0x65'),JSON[_0x5829('0x40')](_0x3cc7ef));var _0x31fb59=_0x3cc7ef[0x0];if(_0x31fb59){var _0x5b940d={'action':_0x31fb59[_0x5829('0x66')]['action'],'allRequiredParamsPresent':_0x31fb59['queryResult'][_0x5829('0x67')],'endConversation':_0x31fb59[_0x5829('0x66')]['diagnosticInfo']&&_0x31fb59[_0x5829('0x66')][_0x5829('0x68')]['fields']?_0x31fb59[_0x5829('0x66')][_0x5829('0x68')][_0x5829('0x69')][_0x5829('0x6a')][_0x5829('0x6b')]:![],'fulfillmentText':_0x31fb59['queryResult'][_0x5829('0x6c')],'intentName':_0x31fb59[_0x5829('0x66')][_0x5829('0x6d')][_0x5829('0x55')],'intentDisplayName':_0x31fb59[_0x5829('0x66')][_0x5829('0x6d')][_0x5829('0x6e')],'isFallbackIntent':_0x31fb59[_0x5829('0x66')]['intent']['isFallback'],'languageCode':_0x31fb59['queryResult'][_0x5829('0x6f')],'queryText':_0x31fb59[_0x5829('0x66')][_0x5829('0x70')],'responseId':_0x31fb59['responseId'],'score':_0x31fb59['queryResult']['intentDetectionConfidence'],'speech':_0x31fb59[_0x5829('0x66')][_0x5829('0x6c')],'providerResponse':JSON['stringify'](_0x3cc7ef)};return _0x5b940d;}}});};exports['tildeASR']=function(_0x5252af,_0x10c05d,_0x36b1cc,_0x2a6552){return tilde[_0x5829('0x4a')](_0x5252af,_0x10c05d,_0x36b1cc,_0x2a6552)[_0x5829('0x29')](function(_0x7ab8ab){try{fs[_0x5829('0x1c')](_0x5252af);}catch(_0x573864){logger['error'](_0x573864);}logger['info'](_0x5829('0x71'),_0x7ab8ab[_0x5829('0x4e')]);logger[_0x5829('0x1a')](_0x5829('0x72'),_0x7ab8ab[_0x5829('0x50')]);return _0x7ab8ab;});};exports[_0x5829('0x73')]=function(_0x33c51f,_0x34d4f7,_0x22012f,_0x5ba90b,_0x45730e,_0x5ea28b){var _0xf6c08e=path[_0x5829('0x26')](__dirname,_0x5829('0x37'),rs[_0x5829('0x27')](0x4)+_0x5829('0x38'));var _0x26cb5f;return aws[_0x5829('0x74')](_0x33c51f,_0x34d4f7,_0x22012f,_0x5ba90b,_0x45730e,_0x5ea28b,_0xf6c08e)[_0x5829('0x29')](function(){_0x26cb5f=path['resolve'](__dirname,_0x5829('0x37'),rs[_0x5829('0x27')](0x4)+_0x5829('0x3c'));return convertFile(_0xf6c08e,_0x26cb5f);})[_0x5829('0x29')](function(){try{fs[_0x5829('0x1c')](_0xf6c08e);fs[_0x5829('0x2a')](_0x26cb5f,'777');}catch(_0x373ec6){logger[_0x5829('0x14')](_0x373ec6);}return _0x26cb5f[_0x5829('0x2c')]('.')[0x0];});};exports['awsLex']=function(_0xb8be1b,_0x2a0ce3,_0x1ec739,_0x58df3c,_0x2da6e2,_0x1c3eb4){return aws[_0x5829('0x75')](_0xb8be1b,_0x2a0ce3,_0x1ec739,_0x58df3c,_0x2da6e2,_0x1c3eb4)[_0x5829('0x29')](function(_0x59efcb){logger[_0x5829('0x1a')](JSON[_0x5829('0x40')](_0x59efcb));return _0x59efcb;});};exports[_0x5829('0x76')]=function(_0x4f85f9,_0x41c66d,_0x58b51f,_0x105ef7){var _0x1c5dc8=util['format'](_0x5829('0x77'),ISPEECH_API,_0x4f85f9,encodeURIComponent(_0x41c66d),_0x58b51f,_0x105ef7);var _0x4e284b=path[_0x5829('0x26')](__dirname,_0x5829('0x37'),rs[_0x5829('0x27')](0x4)+'.mp3');var _0x15af87;return downloadFile(_0x1c5dc8,_0x4e284b)[_0x5829('0x29')](function(){_0x15af87=path[_0x5829('0x26')](__dirname,_0x5829('0x37'),rs[_0x5829('0x27')](0x4)+'.wav');return convertFile(_0x4e284b,_0x15af87);})[_0x5829('0x29')](function(){try{fs[_0x5829('0x1c')](_0x4e284b);fs[_0x5829('0x2a')](_0x15af87,_0x5829('0x2b'));}catch(_0x1ac650){logger[_0x5829('0x14')](_0x1ac650);}return _0x15af87[_0x5829('0x2c')]('.')[0x0];});};exports[_0x5829('0x78')]=function(_0x68338f,_0x39fad0,_0x11c74f,_0x28cc5c){var _0x12c08c=util[_0x5829('0x79')](_0x5829('0x7a'),ISPEECH_API,_0x39fad0,_0x11c74f,base64Encode(_0x68338f),_0x28cc5c?util[_0x5829('0x79')](_0x5829('0x7b'),encodeURIComponent(_0x28cc5c)):_0x5829('0x7c'));return uploadFile(_0x12c08c)[_0x5829('0x29')](function(_0x5f31a9){return querystring[_0x5829('0x7d')](_0x5f31a9);});};exports['sestekNDA']=function(_0x440534,_0x35d57c){return sestek[_0x5829('0x7e')](_0x440534,_0x35d57c)[_0x5829('0x29')](function(_0x59f4d7){logger['info'](JSON[_0x5829('0x40')](_0x59f4d7));var _0x51495d={'speech':_0x59f4d7[_0x5829('0x7f')],'action':_0x59f4d7[_0x5829('0x80')]?_0x59f4d7[_0x5829('0x80')][_0x5829('0x81')]:undefined,'actiondata':_0x59f4d7[_0x5829('0x80')]?_0x59f4d7['channelData']['CustomActionData']:undefined};if(_0x59f4d7[_0x5829('0x80')]&&_0x59f4d7[_0x5829('0x80')][_0x5829('0x82')]){return base64Decode(_0x59f4d7['channelData'][_0x5829('0x82')][_0x5829('0x83')],path[_0x5829('0x26')](__dirname,_0x5829('0x37'),rs['generate'](0x4)+'.wav'))[_0x5829('0x29')](function(_0xbff310){_0x51495d[_0x5829('0x84')]=_0xbff310;return _0x51495d;});}return _0x51495d;});};exports[_0x5829('0x85')]=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 b584e47..97ea379 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 _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 +var _0x9522=['exports'];(function(_0x33af94,_0x2744a7){var _0x34763e=function(_0x35654d){while(--_0x35654d){_0x33af94['push'](_0x33af94['shift']());}};_0x34763e(++_0x2744a7);}(_0x9522,0x126));var _0x2952=function(_0x438912,_0x3f7f74){_0x438912=_0x438912-0x0;var _0x18112f=_0x9522[_0x438912];return _0x18112f;};var nda=require('./nda');module[_0x2952('0x0')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index f828019..0cbfb94 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 _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 +var _0x4a3c=['exports','POST','ndauth_url','/token','password','username','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','../../../../../config/logger','agi'];(function(_0x3eb678,_0x3cd490){var _0x352b17=function(_0x1b6d68){while(--_0x1b6d68){_0x3eb678['push'](_0x3eb678['shift']());}};_0x352b17(++_0x3cd490);}(_0x4a3c,0x13c));var _0xc4a3=function(_0x42f676,_0x57b4e5){_0x42f676=_0x42f676-0x0;var _0x3a45fd=_0x4a3c[_0x42f676];return _0x3a45fd;};'use strict';var rp=require(_0xc4a3('0x0'));var url=require('url');var logger=require(_0xc4a3('0x1'))(_0xc4a3('0x2'));module[_0xc4a3('0x3')]=function(_0x132afa,_0x296209){var _0x123bc4={'method':_0xc4a3('0x4'),'uri':url['resolve'](_0x296209[_0xc4a3('0x5')],_0xc4a3('0x6')),'form':{'grant_type':_0xc4a3('0x7'),'username':_0x296209[_0xc4a3('0x8')],'password':_0x296209['password']},'json':!![]};return rp(_0x123bc4)['then'](function(_0x596b01){var _0xc11c29={'method':'POST','uri':url[_0xc4a3('0x9')](_0x296209[_0xc4a3('0xa')],_0xc4a3('0xb')),'body':{'type':_0x296209[_0xc4a3('0xc')]||_0xc4a3('0xd'),'channelId':_0xc4a3('0xe'),'conversation':{'id':_0x132afa[_0xc4a3('0xf')]},'from':{'id':_0x132afa['callerid'],'name':_0x132afa['calleridname']},'recipient':{'id':_0x132afa['dnid'],'name':_0x132afa['extension']},'text':_0x296209['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x596b01['access_token']},'json':!![]};if(_0x296209[_0xc4a3('0x10')]){_0xc11c29[_0xc4a3('0x11')][_0xc4a3('0x12')][_0xc4a3('0x13')]=_0x296209['project'];}if(_0x296209[_0xc4a3('0x14')]=='1'){_0xc11c29[_0xc4a3('0x11')]['channelData'][_0xc4a3('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xc4a3('0x16')};}if(_0x296209[_0xc4a3('0x17')]){_0xc11c29[_0xc4a3('0x11')][_0xc4a3('0x12')][_0xc4a3('0x18')]=_0x296209[_0xc4a3('0x17')];if(_0x296209[_0xc4a3('0x19')]){_0xc11c29[_0xc4a3('0x11')]['channelData'][_0xc4a3('0x1a')]=_0x296209[_0xc4a3('0x19')];}}logger[_0xc4a3('0x1b')](JSON[_0xc4a3('0x1c')](_0xc11c29));return rp(_0xc11c29);});}; \ 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 151ae8b..c433ffd 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 _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 +var _0x87d0=['exports','./lib/api'];(function(_0xabe4cc,_0x23f307){var _0x4e5111=function(_0x22112d){while(--_0x22112d){_0xabe4cc['push'](_0xabe4cc['shift']());}};_0x4e5111(++_0x23f307);}(_0x87d0,0xbd));var _0x087d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x87d0[_0x14add3];return _0x4a174f;};'use strict';var asr=require(_0x087d('0x0'));module[_0x087d('0x1')]=function(_0x25d75a,_0x545b5f,_0x19a76e,_0x58f4d8){return asr(_0x25d75a,_0x545b5f,_0x19a76e,_0x58f4d8);}; \ 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 d6d571b..a2d1996 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 _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 +var _0x97f3=['bluebird','lodash','moment','crypto','agi','exports','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','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','info','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','isObject','message'];(function(_0x3accf2,_0x248aa6){var _0x1b4ec8=function(_0x292294){while(--_0x292294){_0x3accf2['push'](_0x3accf2['shift']());}};_0x1b4ec8(++_0x248aa6);}(_0x97f3,0x118));var _0x397f=function(_0x3eb0b6,_0x2336a5){_0x3eb0b6=_0x3eb0b6-0x0;var _0x3d4dc6=_0x97f3[_0x3eb0b6];return _0x3d4dc6;};'use strict';var BPromise=require(_0x397f('0x0'));var _=require(_0x397f('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x397f('0x2'));var crypto=require(_0x397f('0x3'));var logger=require('../../../../../../config/logger')(_0x397f('0x4'));module[_0x397f('0x5')]=function(_0x5eca3f,_0xc9eced,_0x1158cd,_0x1df01e){return new BPromise(function(_0x322a07,_0x23ab31){logger['info']('Tilde\x20URI',_0x1df01e||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x553341=new WebSocket(_0x1df01e||_0x397f('0x6'),{'perMessageDeflate':![]});var _0x58d35a='';var _0x17e2ec='0';var _0x308ac5='1';var _0x4314d7=_0x397f('0x7');function _0x5ab223(_0x25e201){var _0x3e69f5=crypto[_0x397f('0x8')]('sha1');_0x3e69f5[_0x397f('0x9')](_0x25e201);return _0x3e69f5[_0x397f('0xa')]('hex');}function _0x4747a8(){try{logger['info'](_0x397f('0xb'));var _0x5ea1a0=moment()[_0x397f('0xc')]();var _0x11b985=_0x5ab223(_0x5ea1a0+_0xc9eced+_0x1158cd);_0x553341[_0x397f('0xd')](JSON[_0x397f('0xe')]({'appID':_0xc9eced,'timestamp':_0x5ea1a0,'appKey':_0x11b985}));var _0x184399=fs['createReadStream'](_0x5eca3f);_0x184399['on'](_0x397f('0xf'),function(_0x2d80a0){_0x553341['send'](_0x2d80a0);});_0x184399['on'](_0x397f('0x10'),function(){_0x553341[_0x397f('0xd')](_0x397f('0x11'));});}catch(_0x1cf49a){logger[_0x397f('0x12')](_0x397f('0x13'),JSON[_0x397f('0xe')](_0x1cf49a));_0x553341[_0x397f('0x14')]();}}function _0x2f549e(_0x4b7d2e){try{if(_0x4b7d2e){var _0x58e3ab=JSON['parse'](_0x4b7d2e);switch(_0x58e3ab['status']){case 0x0:if(_0x58e3ab[_0x397f('0x15')]){if(_0x58e3ab[_0x397f('0x15')][_0x397f('0x16')]){logger['info'](_0x397f('0x17'),JSON[_0x397f('0xe')](_0x58e3ab['result'][_0x397f('0x18')]));_0x58d35a=_0x58e3ab[_0x397f('0x15')][_0x397f('0x18')][0x0][_0x397f('0x19')];_0x17e2ec=_0x58e3ab[_0x397f('0x15')][_0x397f('0x18')][0x0]['likelihood'];_0x308ac5='0';_0x4314d7='Success.';_0x553341[_0x397f('0x14')]();}}break;case 0x1:logger[_0x397f('0x1a')](_0x397f('0x7'));_0x308ac5='1';_0x4314d7=_0x397f('0x7');break;case 0x2:logger[_0x397f('0x1a')](_0x397f('0x1b'));_0x308ac5='2';_0x4314d7=_0x397f('0x1b');break;case 0x9:logger[_0x397f('0x1a')](_0x397f('0x1c'));_0x308ac5='9';_0x4314d7=_0x397f('0x1c');break;case 0xa:logger[_0x397f('0x1a')]('Authentication\x20failed.');_0x308ac5='10';_0x4314d7=_0x397f('0x1d');break;case 0xb:logger[_0x397f('0x1a')](_0x397f('0x1e'));_0x308ac5='11';_0x4314d7=_0x397f('0x1e');}}}catch(_0x365d16){logger[_0x397f('0x12')](_0x397f('0x1f'),JSON[_0x397f('0xe')](_0x365d16));_0x553341[_0x397f('0x14')]();}}function _0xca588d(){logger[_0x397f('0x1a')]('Close\x20Tilde\x20ASR\x20socket');_0x322a07({'transcript':_0x58d35a,'confidence':_0x17e2ec,'status':_0x308ac5,'status_message':_0x4314d7});}function _0x10b27c(_0x4a1778){logger[_0x397f('0x12')](_0x397f('0x20'));if(!_['isNil'](_0x4a1778)){logger[_0x397f('0x12')](_[_0x397f('0x21')](_0x4a1778)?JSON['stringify'](_0x4a1778):_0x4a1778);}}_0x553341['on']('open',_0x4747a8);_0x553341['on'](_0x397f('0x22'),_0x2f549e);_0x553341['on'](_0x397f('0x10'),_0xca588d);_0x553341['on'](_0x397f('0x12'),_0x10b27c);});}; \ 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 cee6b98..911a96a 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 _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 +var _0xe10e=['./asr','exports'];(function(_0x42efa7,_0x2d5d92){var _0x5d1b50=function(_0x4d29bf){while(--_0x4d29bf){_0x42efa7['push'](_0x42efa7['shift']());}};_0x5d1b50(++_0x2d5d92);}(_0xe10e,0x156));var _0xee10=function(_0x5436a1,_0x43ce08){_0x5436a1=_0x5436a1-0x0;var _0x46c586=_0xe10e[_0x5436a1];return _0x46c586;};var asr=require(_0xee10('0x0'));module[_0xee10('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 369a6ff..65c1437 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 _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 +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(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index f246072..cd543bc 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 _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 +var _0x138d=['getTrunk','getTrunkById','getSoundPath','save_name','sendMailMessage','mailRpc','IntervalId','map','interval','format','%s/sounds/converted/%s','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','context','extension','dnid','createSquareMessage','createCmContact','isEmpty','callback_','random','isNil','lastName','phone','list_id','scheduledAt','callback','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogin','internal','LOCAL','shellCommand','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','audioEncoding','MP3','google_tts_language','restAPI','url','method','number','timeout','includes','POST','body','parse','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','options','googleDialogflow','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','isString','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','toString','getAndSetVariable','result','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','agi','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','lumenvoxasr','MRCPRecog','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','replace','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','getUser','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','out','dialogflow','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','DIALOGFLOW_%s','toUpperCase','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','no\x20file\x20audio\x20selected','getSound','file_id','no\x20file\x20audio\x20found','getData','response','test','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP','recordFile','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','intKey','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','toLowerCase','macro','gosub','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','debug','sendMail\x20message','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','getSmsAccount','sms_account_id','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','getSquareProject','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','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','googleTTS','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','util','lodash','odbc','randomstring','moment','mustache','request-promise','../../config/logger','../../config/environment','../../config/environment/shared','./scripts','rawHeaders','rawBody','menu','rpc','getVariable','then','name','catch','prototype','getVoiceQueue','getVoiceQueueById','getSquareProjectById','getSquareOdbc','getSquareOdbcById'];(function(_0xc14df7,_0x163f90){var _0x34a445=function(_0x1bbf28){while(--_0x1bbf28){_0xc14df7['push'](_0xc14df7['shift']());}};_0x34a445(++_0x163f90);}(_0x138d,0x1ab));var _0xd138=function(_0x2d8f6c,_0x44db4c){_0x2d8f6c=_0x2d8f6c-0x0;var _0x3a00f6=_0x138d[_0x2d8f6c];return _0x3a00f6;};'use strict';var fs=require('fs');var util=require(_0xd138('0x0'));var _=require(_0xd138('0x1'));var sh=require('shelljs');var odbc=require(_0xd138('0x2'))();var rs=require(_0xd138('0x3'));var moment=require(_0xd138('0x4'));var Mustache=require(_0xd138('0x5'));var rp=require(_0xd138('0x6'));var logger=require(_0xd138('0x7'))('agi');var config=require(_0xd138('0x8'));var shared=require(_0xd138('0x9'));var scripts=require(_0xd138('0xa'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xd138('0xb'),_0xd138('0xc')];var verticesWithRetry=[_0xd138('0xd'),'getdigits','getsecretdigits'];var AGIVertices=function(_0x10bdf3,_0x2137eb,_0x121cce){this['channel']=_0x10bdf3;this[_0xd138('0xe')]=_0x2137eb;this['mailRpc']=_0x121cce;};AGIVertices['prototype'][_0xd138('0xf')]=function(_0x765b1,_0x438504){this[_0xd138('0xe')]['getVariableById'](_0x765b1)[_0xd138('0x10')](function(_0x5361ec){_0x438504(null,_0x5361ec?_0x5361ec[_0xd138('0x11')]:![]);})[_0xd138('0x12')](function(_0x11ed68){_0x438504(_0x11ed68);});};AGIVertices[_0xd138('0x13')][_0xd138('0x14')]=function(_0x4339f0,_0x24f99){this[_0xd138('0xe')][_0xd138('0x15')](_0x4339f0)[_0xd138('0x10')](function(_0x44b99a){_0x24f99(null,_0x44b99a?_0x44b99a[_0xd138('0x11')]:![]);})['catch'](function(_0x1526e9){_0x24f99(_0x1526e9);});};AGIVertices[_0xd138('0x13')]['getSquareProject']=function(_0x5b67bf,_0x502d3b){this[_0xd138('0xe')][_0xd138('0x16')](_0x5b67bf)['then'](function(_0x43a67d){_0x502d3b(null,_0x43a67d?_0x43a67d[_0xd138('0x11')]:![]);})[_0xd138('0x12')](function(_0x4056d4){_0x502d3b(_0x4056d4);});};AGIVertices['prototype'][_0xd138('0x17')]=function(_0x36f021,_0x247254){this[_0xd138('0xe')][_0xd138('0x18')](_0x36f021)[_0xd138('0x10')](function(_0x1755e5){_0x247254(null,_0x1755e5?_0x1755e5['dsn']:![]);})[_0xd138('0x12')](function(_0x2a5bfb){_0x247254(_0x2a5bfb);});};AGIVertices['prototype']['getUser']=function(_0x20c57a,_0x5e0f89){this['rpc']['getUserById'](_0x20c57a)[_0xd138('0x10')](function(_0x1bc6ef){_0x5e0f89(null,_0x1bc6ef?_0x1bc6ef[_0xd138('0x11')]:![]);})[_0xd138('0x12')](function(_0x5bd0eb){_0x5e0f89(_0x5bd0eb);});};AGIVertices[_0xd138('0x13')][_0xd138('0x19')]=function(_0x3ed87c,_0x22afdc){this[_0xd138('0xe')][_0xd138('0x1a')](_0x3ed87c)[_0xd138('0x10')](function(_0x2dd210){_0x22afdc(null,_0x2dd210?_0x2dd210[_0xd138('0x11')]:![]);})[_0xd138('0x12')](function(_0x1d45b7){_0x22afdc(_0x1d45b7);});};AGIVertices[_0xd138('0x13')]['getSound']=function(_0x41370f,_0x550979){var _0x3003bb=this;this['rpc']['getSoundById'](_0x41370f)['then'](function(_0x15c73e){_0x550979(null,_0x15c73e?_0x3003bb[_0xd138('0x1b')](_0x15c73e[_0xd138('0x1c')]):![]);})[_0xd138('0x12')](function(_0x5d66e1){_0x550979(_0x5d66e1);});};AGIVertices[_0xd138('0x13')]['getMailAccount']=function(_0x355085,_0x2d60f4){this[_0xd138('0xe')]['getMailAccountById'](_0x355085)[_0xd138('0x10')](function(_0x219d07){_0x2d60f4(null,_0x219d07?_0x219d07:![]);})['catch'](function(_0x2dffcc){_0x2d60f4(_0x2dffcc);});};AGIVertices['prototype'][_0xd138('0x1d')]=function(_0x14e599,_0x896ee3,_0x108567){this[_0xd138('0x1e')][_0xd138('0x1d')](_0x14e599,_0x896ee3)['then'](function(){_0x108567(null);})[_0xd138('0x12')](function(_0x35cb59){_0x108567(_0x35cb59);});};AGIVertices[_0xd138('0x13')]['getIntervals']=function(_0x9bd5c,_0x5798f3){this[_0xd138('0xe')]['getIntervalById'](_0x9bd5c)[_0xd138('0x10')](function(_0xde9b2f){if(_0xde9b2f){if(_0xde9b2f[_0xd138('0x1f')]){_0x5798f3(null,[_0xde9b2f['interval']]);}else{_0x5798f3(null,_[_0xd138('0x20')](_0xde9b2f['Intervals'],_0xd138('0x21')));}}else{_0x5798f3(null,![]);}})[_0xd138('0x12')](function(_0x5a0b21){_0x5798f3(_0x5a0b21);});};AGIVertices['prototype'][_0xd138('0x1b')]=function(_0x584929){return util[_0xd138('0x22')](_0xd138('0x23'),FILES_PATH,_0x584929);};AGIVertices['prototype']['getQueryOdbc']=function(_0x47f545,_0x544cc9,_0x13f9fc){odbc['open'](_0x47f545,function(_0x1a3c43){if(_0x1a3c43){logger[_0xd138('0x24')](_0xd138('0x25'),_0x1a3c43);_0x13f9fc(_0x1a3c43);}else{logger[_0xd138('0x26')](_0xd138('0x27'));odbc[_0xd138('0x28')](_0x544cc9,function(_0x2372f9,_0x2da48f){if(_0x2372f9){logger['info']('Error\x20executing\x20query\x20%s',_0x544cc9);_0x13f9fc(_0x2372f9);}else{logger['info'](_0xd138('0x29'),_0x544cc9);odbc[_0xd138('0x2a')](function(_0x99a40e){if(_0x99a40e){logger[_0xd138('0x24')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x99a40e);}_0x13f9fc(null,_0x2da48f);});}});}});};AGIVertices[_0xd138('0x13')]['getSmsAccount']=function(_0x16680b,_0x4758ff){this[_0xd138('0xe')][_0xd138('0x2b')](_0x16680b)[_0xd138('0x10')](function(_0x429823){_0x4758ff(null,_0x429823?_0x429823:![]);})[_0xd138('0x12')](function(_0x346eeb){_0x4758ff(_0x346eeb);});};AGIVertices[_0xd138('0x13')]['createSmsMessage']=function(_0x2f7e05,_0x273136){this[_0xd138('0xe')][_0xd138('0x2c')](_0x2f7e05)[_0xd138('0x10')](function(_0x5d6eb9){_0x273136(null,_0x5d6eb9);})['catch'](function(_0x16c7e6){_0x273136(_0x16c7e6);});};AGIVertices[_0xd138('0x13')][_0xd138('0x2d')]=function(_0x95282e,_0xac08ed,_0x2ec5a0){this[_0xd138('0xe')][_0xd138('0x2d')]({'uniqueid':this[_0xd138('0x2e')][_0xd138('0x2f')],'node':_0x95282e[_0xd138('0x30')],'application':_0x95282e[_0xd138('0x31')],'data':_0xac08ed||null,'project_name':this['channel'][_0xd138('0x32')],'callerid':this[_0xd138('0x2e')][_0xd138('0x33')]})['then'](function(_0x19d804){if(_0x2ec5a0){_0x2ec5a0(null,_0x19d804);}})[_0xd138('0x12')](function(_0x2be7cf){if(_0x2ec5a0){_0x2ec5a0(_0x2be7cf);}});};AGIVertices[_0xd138('0x13')][_0xd138('0x34')]=function(_0x25430a,_0x4fae45,_0x54a80d,_0x275ed6){this['rpc'][_0xd138('0x34')]({'uniqueid':this['channel'][_0xd138('0x2f')],'callerid':this[_0xd138('0x2e')][_0xd138('0x33')],'calleridname':this['channel']['calleridname'],'context':this[_0xd138('0x2e')][_0xd138('0x35')],'extension':this[_0xd138('0x2e')][_0xd138('0x36')],'priority':this[_0xd138('0x2e')]['priority'],'accountcode':this['channel']['accountcode'],'dnid':this[_0xd138('0x2e')][_0xd138('0x37')],'projectName':this[_0xd138('0x2e')][_0xd138('0x32')],'saveName':_0x4fae45,'filename':_0x25430a['file']||_0x4fae45,'savePath':_0x54a80d})['then'](function(_0xd20679){_0x275ed6(null,_0xd20679);})[_0xd138('0x12')](function(_0x2ac4c5){_0x275ed6(_0x2ac4c5);});};AGIVertices[_0xd138('0x13')]['createSquareMessage']=function(_0x358b46,_0x1b63ea,_0x148299,_0x5a3327,_0x131df5){this[_0xd138('0xe')][_0xd138('0x38')]({'uniqueid':this['channel']['uniqueid'],'body':_0x358b46,'direction':_0x1b63ea,'providerName':_0x148299,'providerResponse':_0x5a3327})['then'](function(_0x295cfc){if(_0x131df5){_0x131df5(null,_0x295cfc);}})[_0xd138('0x12')](function(_0x41b163){if(_0x131df5){_0x131df5(_0x41b163);}});};AGIVertices[_0xd138('0x13')]['createCmContact']=function(_0x293baf,_0x15201a){this[_0xd138('0xe')][_0xd138('0x39')]({'firstName':_[_0xd138('0x3a')](_0x293baf['name'])||_['isNil'](_0x293baf[_0xd138('0x11')])?_0xd138('0x3b')+Math[_0xd138('0x3c')]():_0x293baf[_0xd138('0x11')],'lastName':_[_0xd138('0x3a')](_0x293baf['lastName'])||_[_0xd138('0x3d')](_0x293baf[_0xd138('0x3e')])?null:_0x293baf[_0xd138('0x3e')],'phone':_0x293baf[_0xd138('0x3f')],'ListId':_0x293baf[_0xd138('0x40')],'scheduledat':_0x293baf[_0xd138('0x41')],'callbackUniqueid':this[_0xd138('0x2e')][_0xd138('0x2f')],'tags':_0xd138('0x42'),'description':'Callback\x20scheduled\x20at\x20'+_0x293baf[_0xd138('0x41')]['toString'](),'priority':_0x293baf['callback_priority']})[_0xd138('0x10')](function(_0x594cc6){_0x15201a(null,_0x594cc6);})['catch'](function(_0x4f2c2a){_0x15201a(_0x4f2c2a);});};AGIVertices[_0xd138('0x13')][_0xd138('0x43')]=function(_0x5b752a,_0x815b0d){this[_0xd138('0xe')][_0xd138('0x44')](_0x5b752a)[_0xd138('0x10')](function(_0x11f66b){_0x815b0d(null,_0x11f66b?_0x11f66b[_0xd138('0x11')]:![]);})[_0xd138('0x12')](function(_0x33166d){_0x815b0d(_0x33166d);});};AGIVertices[_0xd138('0x13')][_0xd138('0x45')]=function(_0x547a08,_0xb43f59,_0x567f95){var _0x56f7f1={'role':_0xd138('0x46')};_0x56f7f1[_0x547a08]=this[_0xd138('0x2e')][_0xd138('0x33')];this[_0xd138('0xe')]['agentPause'](_0x56f7f1,_0xb43f59,this[_0xd138('0x2e')][_0xd138('0x2f')])['then'](function(_0x7bcbdd){_0x567f95(null,_['isNil'](_0x7bcbdd)?![]:!![]);})[_0xd138('0x12')](function(_0x4f18dc){logger[_0xd138('0x24')](_0x4f18dc);_0x567f95(null,![]);});};AGIVertices[_0xd138('0x13')][_0xd138('0x47')]=function(_0x1f9ca5,_0x3e23f1){var _0x1c7cf3={'role':_0xd138('0x46')};_0x1c7cf3[_0x1f9ca5]=this['channel'][_0xd138('0x33')];this[_0xd138('0xe')][_0xd138('0x47')](_0x1c7cf3)[_0xd138('0x10')](function(_0x11f7b0){_0x3e23f1(null,_[_0xd138('0x3d')](_0x11f7b0)?![]:!![]);})['catch'](function(_0x4a2e9d){logger['error'](_0x4a2e9d);_0x3e23f1(null,![]);});};AGIVertices[_0xd138('0x13')]['agentLogout']=function(_0x2bc85c,_0x22446b){var _0x472acb={'role':'agent'};_0x472acb[_0x2bc85c]=this[_0xd138('0x2e')]['callerid'];this[_0xd138('0xe')]['agentLogout'](_0x472acb)[_0xd138('0x10')](function(_0x15899f){_0x22446b(null,_[_0xd138('0x3d')](_0x15899f)?![]:!![]);})[_0xd138('0x12')](function(_0x42fc07){logger['error'](_0x42fc07);_0x22446b(null,![]);});};AGIVertices[_0xd138('0x13')][_0xd138('0x48')]=function(_0x55c768,_0x42b483){var _0x197fd4={'role':'agent'};_0x197fd4[_0x55c768]=this[_0xd138('0x2e')]['callerid'];var _0x41948f=_0x55c768!=_0xd138('0x49')?util[_0xd138('0x22')]('%s/%s@from-sip/n',_0xd138('0x4a'),this[_0xd138('0x2e')][_0xd138('0x33')]):undefined;this[_0xd138('0xe')][_0xd138('0x48')](_0x197fd4,_0x41948f)[_0xd138('0x10')](function(_0x37efce){_0x42b483(null,_[_0xd138('0x3d')](_0x37efce)?![]:!![]);})[_0xd138('0x12')](function(_0x447d84){logger[_0xd138('0x24')](_0x447d84);_0x42b483(null,![]);});};AGIVertices[_0xd138('0x13')][_0xd138('0x4b')]=function(_0x263208,_0xb549cf){sh[_0xd138('0x4c')](_[_0xd138('0x4d')](_0x263208),function(_0x4a16ab,_0x5bfe1d){var _0x1864bd=_0x5bfe1d['replace'](/(\r\n|\n|\r)/gm,'');_0xb549cf(null,_0x1864bd);});};AGIVertices[_0xd138('0x13')][_0xd138('0x4e')]=function(_0x15fc60,_0x2735dd){scripts[_0xd138('0x4e')](_0x15fc60[_0xd138('0x4f')],_0x15fc60[_0xd138('0x50')]||_0xd138('0x51'),_0x15fc60[_0xd138('0x51')],_0x15fc60[_0xd138('0x52')]||_0xd138('0x53'),_0x15fc60['ssmlGender']||'MALE',_0x15fc60[_0xd138('0x54')]||_0xd138('0x55'))[_0xd138('0x10')](function(_0x1e4ac2){_0x2735dd(null,_0x1e4ac2);})[_0xd138('0x12')](function(_0x3d3a47){_0x2735dd(_0x3d3a47);});};AGIVertices['prototype']['googleTTS']=function(_0x5d418f,_0x332cd6){scripts['googleTTS'](_0x5d418f[_0xd138('0x51')],_0x5d418f[_0xd138('0x56')]||'en',0x1)[_0xd138('0x10')](function(_0x27d24f){_0x332cd6(null,_0x27d24f);})[_0xd138('0x12')](function(_0x5e5c80){_0x332cd6(_0x5e5c80);});};AGIVertices[_0xd138('0x13')][_0xd138('0x57')]=function(_0x61ce05,_0x232c43){var _0x517da1={'uri':_0x61ce05[_0xd138('0x58')],'method':_0x61ce05[_0xd138('0x59')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x61ce05['timeout'])===_0xd138('0x5a')&&parseInt(_0x61ce05[_0xd138('0x5b')])>=0x1?parseInt(_0x61ce05[_0xd138('0x5b')])*0x3e8:0x5*0x3e8};if(_[_0xd138('0x5c')]([_0xd138('0x5d'),'PUT'],_0x517da1[_0xd138('0x59')]['toUpperCase']())){try{_0x517da1[_0xd138('0x5e')]=_0x61ce05['rawBody']?JSON[_0xd138('0x5f')](_0x61ce05[_0xd138('0xc')]):{};}catch(_0x5e43c9){logger[_0xd138('0x24')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5e43c9);}}try{_0x517da1[_0xd138('0x60')]=_0x61ce05[_0xd138('0xb')]?JSON[_0xd138('0x5f')](_0x61ce05[_0xd138('0xb')]):{};}catch(_0x1f2ca1){logger[_0xd138('0x24')](_0xd138('0x61'),_0x1f2ca1);}if(_0x61ce05[_0xd138('0x62')]){try{var _0x8fa43a=require(_0x61ce05[_0xd138('0x62')])[_0xd138('0x63')](this,_0x517da1);_0x517da1[_0xd138('0x64')]=Mustache[_0xd138('0x65')](_0x61ce05['url'],_0x8fa43a,{},['$$','$$']);if(_0x517da1[_0xd138('0x60')]){_0x517da1[_0xd138('0x60')]=JSON[_0xd138('0x5f')](Mustache[_0xd138('0x65')](JSON[_0xd138('0x66')](_0x517da1['headers']),_0x8fa43a,{},['$$','$$']));}if(_0x517da1[_0xd138('0x5e')]){_0x517da1['body']=JSON['parse'](Mustache['render'](JSON['stringify'](_0x517da1['body']),_0x8fa43a,{},['$$','$$']));}}catch(_0x1c5878){logger[_0xd138('0x24')](_0xd138('0x67'),_0x1c5878);}}rp(_0x517da1)['then'](function(_0x2a7d40){var _0x393bb2={'statusCode':_0x2a7d40[_0xd138('0x68')]||0xc8,'statusMessage':_0x2a7d40[_0xd138('0x69')]||'OK','headers':_0x2a7d40[_0xd138('0x60')]||{},'body':_0x2a7d40[_0xd138('0x5e')]||{}};_0x232c43(null,_0x393bb2);})[_0xd138('0x12')](function(_0x5807e7){var _0xaffe24={'statusCode':_0x5807e7['statusCode']||0x1f4,'statusMessage':_0x5807e7[_0xd138('0x6a')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x5807e7[_0xd138('0x6b')]['headers']||{},'body':_0x5807e7[_0xd138('0x6b')][_0xd138('0x5e')]||{}};_0x232c43(null,_0xaffe24);});};AGIVertices[_0xd138('0x13')][_0xd138('0x6c')]=function(_0x1b5b6b,_0x220eee){scripts[_0xd138('0x6c')](this['channel']['uniqueid'],_0x1b5b6b['key'],_0x1b5b6b[_0xd138('0x51')],_0x1b5b6b[_0xd138('0x6d')]||'en')[_0xd138('0x10')](function(_0x3ee0f9){_0x220eee(null,_0x3ee0f9);})[_0xd138('0x12')](function(_0x5caabe){_0x220eee(_0x5caabe);});};AGIVertices[_0xd138('0x13')]['googleDialogflowV2']=function(_0x11d725,_0x181bf9){scripts[_0xd138('0x6e')](this['channel'][_0xd138('0x2f')],_0x11d725['dialogflowV2_project_id'],_0x11d725[_0xd138('0x6f')],_0x11d725[_0xd138('0x70')],_0x11d725[_0xd138('0x51')],_0x11d725[_0xd138('0x71')]||'en')[_0xd138('0x10')](function(_0x771e6b){_0x181bf9(null,_0x771e6b);})[_0xd138('0x12')](function(_0x1fe7eb){_0x181bf9(_0x1fe7eb);});};AGIVertices[_0xd138('0x13')]['sestekNDA']=function(_0x53a4e6,_0x491600){scripts[_0xd138('0x72')](this[_0xd138('0x2e')],_0x53a4e6)[_0xd138('0x10')](function(_0x3fbbe9){_0x491600(null,_0x3fbbe9);})[_0xd138('0x12')](function(_0x411cd7){_0x491600(_0x411cd7);});};AGIVertices[_0xd138('0x13')][_0xd138('0x73')]=function(_0x19490a,_0x1e9c02){scripts['ispeechTTS'](_0x19490a[_0xd138('0x74')],_0x19490a[_0xd138('0x51')],_0x19490a[_0xd138('0x75')]||'en-US',_0x19490a[_0xd138('0x76')])[_0xd138('0x10')](function(_0x193cc5){_0x1e9c02(null,_0x193cc5);})['catch'](function(_0x575323){_0x1e9c02(_0x575323);});};AGIVertices[_0xd138('0x13')][_0xd138('0x77')]=function(_0x2987e1,_0x930852,_0x2d8084){scripts['ispeechASR'](_0x930852,_0x2987e1[_0xd138('0x74')],_0x2987e1[_0xd138('0x78')]||_0xd138('0x53'),this[_0xd138('0x79')](_0x2987e1[_0xd138('0x7a')])?_0x2987e1[_0xd138('0x7a')]:undefined)[_0xd138('0x10')](function(_0x2c27af){_0x2d8084(null,_0x2c27af);})[_0xd138('0x12')](function(_0x2706a4){_0x2d8084(_0x2706a4);});};AGIVertices[_0xd138('0x13')][_0xd138('0x7b')]=function(_0x398b2e,_0x41dc75){scripts[_0xd138('0x7b')](_0x398b2e[_0xd138('0x7c')],_0x398b2e[_0xd138('0x7d')],_0x398b2e[_0xd138('0x7e')],_0x398b2e['aws_polly_voice']||_0xd138('0x7f'),_0x398b2e[_0xd138('0x51')],_0x398b2e[_0xd138('0x80')]||_0xd138('0x51'))[_0xd138('0x10')](function(_0x3c9e5f){_0x41dc75(null,_0x3c9e5f);})[_0xd138('0x12')](function(_0x449608){_0x41dc75(_0x449608);});};AGIVertices[_0xd138('0x13')][_0xd138('0x81')]=function(_0xdbde9c,_0x46e67d){scripts[_0xd138('0x81')](this[_0xd138('0x2e')][_0xd138('0x2f')],_0xdbde9c[_0xd138('0x7c')],_0xdbde9c['aws_secret_access_key'],_0xdbde9c['aws_lex_region'],_0xdbde9c[_0xd138('0x51')],_0xdbde9c['aws_bot_name'])[_0xd138('0x10')](function(_0x244284){_0x46e67d(null,_0x244284);})[_0xd138('0x12')](function(_0x9b0a4b){_0x46e67d(_0x9b0a4b);});};AGIVertices['prototype'][_0xd138('0x82')]=function(_0x524ef6,_0x190576,_0x3944f5){scripts[_0xd138('0x82')](_0x190576,_0x524ef6[_0xd138('0x74')],_0x524ef6[_0xd138('0x83')]||'en-US')[_0xd138('0x10')](function(_0xdd9b49){_0x3944f5(null,_0xdd9b49);})[_0xd138('0x12')](function(_0x17a8c4){_0x3944f5(_0x17a8c4);});};AGIVertices[_0xd138('0x13')][_0xd138('0x84')]=function(_0x3e595a,_0x140fa1,_0x4b3117){scripts['tildeASR'](_0x140fa1,_0x3e595a[_0xd138('0x85')],_0x3e595a[_0xd138('0x86')],_0x3e595a[_0xd138('0x64')])[_0xd138('0x10')](function(_0x168222){_0x4b3117(null,_0x168222);})[_0xd138('0x12')](function(_0x2e42c0){_0x4b3117(_0x2e42c0);});};AGIVertices[_0xd138('0x13')][_0xd138('0x87')]=function(_0x23dbe5){var _0x136b65=_['includes'](verticesWithRetry,_0x23dbe5['agicommand'])?_0x23dbe5:_[_0xd138('0x88')](_0x23dbe5);for(var _0x18a5cd in _0x136b65){if(_0x136b65[_0xd138('0x89')](_0x18a5cd)){if(_0x136b65[_0x18a5cd]&&_['isString'](_0x136b65[_0x18a5cd])){if(_[_0xd138('0x5c')](recursiveMapAttributes,_0x18a5cd)){_0x136b65[_0x18a5cd]=this[_0xd138('0x8a')](_0x136b65[_0x18a5cd]);}else{_0x136b65[_0x18a5cd]=this['replaceAllVariables'](_0x136b65[_0x18a5cd]);}}}}return _0x136b65;};AGIVertices[_0xd138('0x13')][_0xd138('0x8b')]=function(_0x256e7d){for(var _0x482bb3 in _0x256e7d){if(_0x256e7d['hasOwnProperty'](_0x482bb3)){if(_[_0xd138('0x8c')](_0x256e7d[_0x482bb3])){this['recursiveNodeIndex'](_0x256e7d[_0x482bb3]);}else if(_[_0xd138('0x8d')](_0x256e7d[_0x482bb3])){for(var _0x4632da=0x0;_0x4632da<_0x256e7d[_0x482bb3][_0xd138('0x8e')];_0x4632da++){this[_0xd138('0x8b')](_0x256e7d[_0x482bb3][_0x4632da]);}}else if(_[_0xd138('0x8f')](_0x256e7d[_0x482bb3])){_0x256e7d[_0x482bb3]=this[_0xd138('0x90')](_0x256e7d[_0x482bb3]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x159517,_0x5a8b10){for(var _0x4fe803 in _0x159517){if(_0x159517[_0xd138('0x89')](_0x4fe803)){if(_[_0xd138('0x8c')](_0x159517[_0x4fe803])){if(!_[_0xd138('0x3a')](_0x159517[_0x4fe803])){this[_0xd138('0x91')](_0x159517[_0x4fe803],util[_0xd138('0x22')](_0xd138('0x92'),_0x5a8b10,_0x4fe803));}}else if(_[_0xd138('0x8d')](_0x159517[_0x4fe803])){for(var _0x2727b7=0x0;_0x2727b7<_0x159517[_0x4fe803][_0xd138('0x8e')];_0x2727b7++){this[_0xd138('0x91')](_0x159517[_0x4fe803][_0x2727b7],util[_0xd138('0x22')](_0xd138('0x92'),_0x5a8b10,_0x4fe803+'['+_0x2727b7+']'));}}else{if(!_[_0xd138('0x3d')](_0x159517[_0x4fe803])){this[_0xd138('0x2e')][_0xd138('0x93')](util[_0xd138('0x22')]('%s.%s',_0x5a8b10,_0x4fe803),_0x159517[_0x4fe803]);}}}}};AGIVertices[_0xd138('0x13')][_0xd138('0x8a')]=function(_0x352457){try{var _0x110d65=JSON[_0xd138('0x5f')](_0x352457);this['recursiveNodeIndex'](_0x110d65);return JSON[_0xd138('0x66')](_0x110d65);}catch(_0x586d9c){return this['replaceAllVariables'](_0x352457);}};AGIVertices[_0xd138('0x13')][_0xd138('0x90')]=function(_0x5e33af){var _0x196472=_0x5e33af[_0xd138('0x94')]('{');for(var _0x1d9b1e=0x1;_0x1d9b1e<_0x196472[_0xd138('0x8e')];_0x1d9b1e+=0x1){var _0x54236e=_0x196472[_0x1d9b1e]['split']('}');if(_0x54236e[_0xd138('0x8e')]>0x1){_0x5e33af=_0x5e33af[_0xd138('0x95')]('{'+_0x54236e[0x0]+'}',this[_0xd138('0x2e')][_0xd138('0xf')](_0x54236e[0x0])[_0xd138('0x96')]||_0x54236e[0x0]);}}if(_0x196472[_0xd138('0x8e')]===0x1){return _0x5e33af[_0xd138('0x97')]();}return this[_0xd138('0x90')](_0x5e33af);};AGIVertices[_0xd138('0x13')][_0xd138('0x98')]=function(_0x392951,_0x1c54fd){var _0x48a1d6=this[_0xd138('0x2e')]['getVariable'](_0x392951);if(_0x48a1d6[_0xd138('0x99')]===-0x1){return _0x48a1d6;}logger[_0xd138('0x26')](util[_0xd138('0x22')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x1c54fd,_0x48a1d6['extra']));return this['channel']['setVariable'](_0x1c54fd,_0x48a1d6['extra']);};AGIVertices[_0xd138('0x13')][_0xd138('0x79')]=function(_0x286600){return _0x286600&&_0x286600!=='0'&&_0x286600!=='-1'&&_0x286600!=='';};AGIVertices[_0xd138('0x13')][_0xd138('0x9a')]=function(_0x339041){this[_0xd138('0x2d')][_0xd138('0x63')](this,_0x339041,'-');_0x339041['retry']=_0x339041[_0xd138('0x9a')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xd138('0x13')][_0xd138('0x9b')]=function(_0x59f833){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x9c'),_0x59f833[_0xd138('0x30')]));if(!this['isConfigured'](_0x59f833[_0xd138('0x51')])){return this[_0xd138('0x2e')]['noop'](_0xd138('0x9d'));}var _0x102c0d='\x22'+_0x59f833[_0xd138('0x51')]+'\x22';if(this[_0xd138('0x79')](_0x59f833[_0xd138('0x6b')])){_0x102c0d+=','+_0x59f833['options'];}var _0x2f89eb=this[_0xd138('0x2e')][_0xd138('0x4c')](_0xd138('0x9e'),_0x102c0d);if(_0x2f89eb[_0xd138('0x99')]===-0x1){return _0x2f89eb;}return this[_0xd138('0x2e')][_0xd138('0x9f')](util['format'](_0xd138('0xa0'),_0x102c0d));};AGIVertices['prototype'][_0xd138('0xa1')]=function(_0x542881){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0xa2'),_0x542881[_0xd138('0x30')]));if(!this[_0xd138('0x79')](_0x542881[_0xd138('0xa3')])){return this['channel'][_0xd138('0x9f')](_0xd138('0xa4'));}var _0x32d0fe=_0x542881[_0xd138('0xa3')];if(this['isConfigured'](_0x542881[_0xd138('0x6b')])){_0x32d0fe+=','+_0x542881['options'];}var _0x1f4e4b=this[_0xd138('0x2e')][_0xd138('0x4c')]('MRCPRecog',_0x32d0fe);if(_0x1f4e4b[_0xd138('0x99')]===-0x1){return _0x1f4e4b;}var _0x344ef0=this[_0xd138('0x98')](_0xd138('0xa5'),'MRCP_RECOG_CONFIDENCE');if(_0x344ef0['result']===-0x1){return _0x344ef0;}var _0x549cfd=this[_0xd138('0x98')]('RECOG_INPUT()',_0xd138('0xa6'));if(_0x549cfd[_0xd138('0x99')]===-0x1){return _0x549cfd;}var _0x1b8cf2=this[_0xd138('0x98')](_0xd138('0xa7'),_0xd138('0xa8'));if(_0x1b8cf2[_0xd138('0x99')]===-0x1){return _0x1b8cf2;}return this['channel']['noop'](util[_0xd138('0x22')](_0xd138('0xa9'),_0x32d0fe));};AGIVertices[_0xd138('0x13')]['agi']=function(_0x4aa362){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0xaa'),_0x4aa362[_0xd138('0x30')]));return this[_0xd138('0x2e')][_0xd138('0xab')]([_0x4aa362[_0xd138('0xac')],_0x4aa362['args']]);};AGIVertices[_0xd138('0x13')][_0xd138('0xad')]=function(_0x324238){logger[_0xd138('0x26')](util['format'](_0xd138('0xae'),_0x324238[_0xd138('0x30')]));if(this['isConfigured'](_0x324238[_0xd138('0x5b')])){logger['info'](util[_0xd138('0x22')](_0xd138('0xaf'),_0x324238[_0xd138('0x5b')]));var _0x67c832=this[_0xd138('0x2e')][_0xd138('0xb0')](_0x324238[_0xd138('0x5b')]);if(_0x67c832[_0xd138('0x99')]===-0x1){return _0x67c832;}}return this[_0xd138('0x2e')][_0xd138('0xad')]();};AGIVertices[_0xd138('0x13')][_0xd138('0x42')]=function(_0x170394){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0xb1'),_0x170394[_0xd138('0x30')]));if(!this[_0xd138('0x79')](_0x170394[_0xd138('0x40')])){return this['channel'][_0xd138('0x24')](_0x170394,_0xd138('0xb2'));}_0x170394['scheduledAt']=moment();if(this[_0xd138('0x79')](_0x170394[_0xd138('0xb3')])){_0x170394['scheduledAt']=moment()[_0xd138('0xb4')](_0x170394[_0xd138('0xb3')],'minutes');}if(!this[_0xd138('0x79')](_0x170394[_0xd138('0xb5')])){_0x170394[_0xd138('0xb5')]=0x2;}this['createCmContact'][_0xd138('0x63')](this,_0x170394);return this[_0xd138('0x2e')]['noop'](util[_0xd138('0x22')](_0xd138('0xb6'),_0x170394[_0xd138('0x3f')],_0x170394[_0xd138('0x40')],_0x170394[_0xd138('0x41')]));};AGIVertices[_0xd138('0x13')]['custom_app']=function(_0x268efe){logger[_0xd138('0x26')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x268efe['label']));var _0x585d5c=this[_0xd138('0x2e')]['exec'](_0x268efe[_0xd138('0xb7')],_0x268efe[_0xd138('0x6b')]);if(_0x585d5c[_0xd138('0x99')]===-0x1){return _0x585d5c;}return this[_0xd138('0x2e')]['noop'](util[_0xd138('0x22')](_0xd138('0xb8'),_0x268efe['application'],_0x268efe[_0xd138('0x6b')]));};AGIVertices[_0xd138('0x13')][_0xd138('0xb9')]=function(_0x185719){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0xba'),_0x185719[_0xd138('0x30')]));if(!this[_0xd138('0x79')](_0x185719[_0xd138('0x51')])){return this[_0xd138('0x2e')][_0xd138('0x9f')]('no\x20text\x20configured');}var _0x4e2b7c='\x22'+_0x185719[_0xd138('0x51')]+'\x22';if(this[_0xd138('0x79')](_0x185719[_0xd138('0x6b')])){_0x4e2b7c+=','+_0x185719['options'];}var _0x14fdd3=this[_0xd138('0x2e')][_0xd138('0x4c')]('MRCPSynth',_0x4e2b7c);if(_0x14fdd3['result']===-0x1){return _0x14fdd3;}return this[_0xd138('0x2e')][_0xd138('0x9f')](util['format'](_0xd138('0xa0'),_0x4e2b7c));};AGIVertices[_0xd138('0x13')][_0xd138('0xbb')]=function(_0x5b848a){logger[_0xd138('0x26')](util[_0xd138('0x22')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x5b848a[_0xd138('0x30')]));if(!this[_0xd138('0x79')](_0x5b848a[_0xd138('0x51')])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0x9d'));}var _0x2bf712='\x22'+_0x5b848a['text']+'\x22';if(this[_0xd138('0x79')](_0x5b848a[_0xd138('0x6b')])){_0x2bf712+=','+_0x5b848a[_0xd138('0x6b')];}var _0x5f4495=this['channel'][_0xd138('0x4c')](_0xd138('0x9e'),_0x2bf712);if(_0x5f4495['result']===-0x1){return _0x5f4495;}return this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0xa0'),_0x2bf712));};AGIVertices[_0xd138('0x13')][_0xd138('0xbc')]=function(_0x345a7e){logger['info'](util[_0xd138('0x22')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x345a7e['label']));if(!this[_0xd138('0x79')](_0x345a7e[_0xd138('0xa3')])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0xa4'));}var _0x1a17e2=_0x345a7e[_0xd138('0xa3')];if(this['isConfigured'](_0x345a7e['options'])){_0x1a17e2+=','+_0x345a7e[_0xd138('0x6b')];}var _0x43c934=this[_0xd138('0x2e')][_0xd138('0x4c')](_0xd138('0xbd'),_0x1a17e2);if(_0x43c934[_0xd138('0x99')]===-0x1){return _0x43c934;}var _0x2abfb0=this[_0xd138('0x98')]('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x2abfb0['result']===-0x1){return _0x2abfb0;}var _0x58829f=this[_0xd138('0x98')](_0xd138('0xbe'),_0xd138('0xbf'));if(_0x58829f[_0xd138('0x99')]===-0x1){return _0x58829f;}var _0x57bad0=this['getAndSetVariable']('RECOG_INSTANCE()',_0xd138('0xc0'));if(_0x57bad0[_0xd138('0x99')]===-0x1){return _0x57bad0;}return this[_0xd138('0x2e')]['noop'](util[_0xd138('0x22')](_0xd138('0xa9'),_0x1a17e2));};AGIVertices[_0xd138('0x13')][_0xd138('0xc1')]=function(_0x8483b2){logger[_0xd138('0x26')](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x8483b2[_0xd138('0x30')]));if(!this[_0xd138('0x79')](_0x8483b2[_0xd138('0xa3')])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0xa4'));}var _0x510614=_0x8483b2[_0xd138('0xa3')];if(this[_0xd138('0x79')](_0x8483b2['options'])){_0x510614+=','+_0x8483b2[_0xd138('0x6b')];}var _0xe42fad=this['channel'][_0xd138('0x4c')](_0xd138('0xbd'),_0x510614);if(_0xe42fad['result']===-0x1){return _0xe42fad;}var _0x47f056=this[_0xd138('0x98')]('RECOG_CONFIDENCE()',_0xd138('0xc2'));if(_0x47f056[_0xd138('0x99')]===-0x1){return _0x47f056;}var _0x152abe=this['getAndSetVariable']('RECOG_INPUT()',_0xd138('0xc3'));if(_0x152abe['result']===-0x1){return _0x152abe;}var _0x3e7d1b=this['getAndSetVariable'](_0xd138('0xa7'),_0xd138('0xc4'));if(_0x3e7d1b[_0xd138('0x99')]===-0x1){return _0x3e7d1b;}return this[_0xd138('0x2e')]['noop'](util[_0xd138('0x22')]('Executed\x20command\x20MRCPRecog\x20%s',_0x510614));};AGIVertices[_0xd138('0x13')][_0xd138('0xc5')]=function(_0x4d84d9){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0xc6'),_0x4d84d9[_0xd138('0x30')]));if(!this['isConfigured'](_0x4d84d9[_0xd138('0xc7')])){return this[_0xd138('0x2e')]['error'](_0x4d84d9,_0xd138('0xc8'));}var _0x227ff3=this['getSquareOdbc'][_0xd138('0x63')](this,_0x4d84d9['odbc_id']);if(!_0x227ff3){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x4d84d9,'no\x20odbc\x20database\x20found');}if(!this[_0xd138('0x79')](_0x4d84d9[_0xd138('0x28')])){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x4d84d9,_0xd138('0xc9'));}var _0x3cccf1=_0x4d84d9[_0xd138('0x28')][_0xd138('0xca')](/(\r\n|\n|\r)/gm,'\x20');this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0xcb'),_0x3cccf1));var _0xab98ad=this[_0xd138('0xcc')][_0xd138('0x63')](this,_0x227ff3,_0x3cccf1);this[_0xd138('0x2d')][_0xd138('0x63')](this,_0x4d84d9,_0x3cccf1);if(!this[_0xd138('0x79')](_0x4d84d9[_0xd138('0xcd')])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0xce'));}var _0x5c16dc=this[_0xd138('0xf')][_0xd138('0x63')](this,_0x4d84d9[_0xd138('0xcd')]);if(!_0x5c16dc){return this['channel']['error'](_0x4d84d9,_0xd138('0xcf'));}var _0xceb2a8=this;_0xab98ad['forEach'](function(_0x1d6414,_0x1fcee8){Object['keys'](_0x1d6414)[_0xd138('0xd0')](function(_0x3b1ce1){_0xceb2a8[_0xd138('0x2e')][_0xd138('0x93')](util['format'](_0xd138('0xd1'),_0x5c16dc,_0x1fcee8,_0x3b1ce1),_0x1d6414[_0x3b1ce1]);});});this[_0xd138('0x2e')]['setVariable'](util[_0xd138('0x22')](_0xd138('0xd2'),_0x5c16dc),_0xab98ad[_0xd138('0x8e')]);return this['channel'][_0xd138('0x9f')](util[_0xd138('0x22')]('variable\x20%s\x20set',_0x5c16dc));};AGIVertices[_0xd138('0x13')]['dial']=function(_0x452626){logger['debug'](util['format'](_0xd138('0xd3'),_0x452626['label']));if(!this[_0xd138('0x79')](_0x452626[_0xd138('0xd4')])){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x452626,'no\x20user\x20selected');}var _0x31b439=this[_0xd138('0xd5')][_0xd138('0x63')](this,_0x452626['sip_id']);if(!_0x31b439){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x452626,_0xd138('0xd6'));}var _0x355fd5=this[_0xd138('0x2e')][_0xd138('0x4c')]('DIAL',[util[_0xd138('0x22')](_0xd138('0xd7'),_0x31b439),_0x452626[_0xd138('0x5b')],_0x452626[_0xd138('0xd8')],_0x452626[_0xd138('0x58')]]);if(_0x355fd5[_0xd138('0x99')]===-0x1){return _0x355fd5;}return this[_0xd138('0x2e')][_0xd138('0x9f')](util['format'](_0xd138('0xd9'),_0xd138('0xda')));};AGIVertices[_0xd138('0x13')]['dialogflow']=function(_0x463032){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0xdb'),_0x463032[_0xd138('0x30')]));if(!this[_0xd138('0x79')](_0x463032[_0xd138('0x74')])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0xdc'));}if(!this[_0xd138('0x79')](_0x463032[_0xd138('0x51')])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0x9d'));}this[_0xd138('0x2e')][_0xd138('0xdd')]=!![];this['createSquareDetailsReport'](_0x463032);this[_0xd138('0x38')](_0x463032[_0xd138('0x51')],'in','','');this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0xde'),_0x463032[_0xd138('0x51')]));var _0x54b777=this[_0xd138('0x6c')][_0xd138('0x63')](this,_0x463032);if(_0x54b777){for(var _0x198baf in _0x54b777){if(_0x54b777[_0xd138('0x89')](_0x198baf)){this[_0xd138('0x2e')]['setVariable'](util[_0xd138('0x22')]('DIALOGFLOW_%s',_0x198baf['toUpperCase']()),_0x54b777[_0x198baf]);}}this[_0xd138('0x38')](_0x54b777[_0xd138('0xdf')],_0xd138('0xe0'),_0xd138('0xe1'),'');return this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')]('Dialogflow\x20Result\x20%s',_0x54b777[_0xd138('0xdf')]));}return this[_0xd138('0x2e')][_0xd138('0x24')](_0x463032,_0xd138('0xe2'));};AGIVertices['prototype'][_0xd138('0xe3')]=function(_0x4ca290){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0xe4'),_0x4ca290[_0xd138('0x30')]));if(!this[_0xd138('0x79')](_0x4ca290['dialogflowV2_project_id'])){return this['channel'][_0xd138('0x9f')]('no\x20project_id\x20configured');}if(!this[_0xd138('0x79')](_0x4ca290['client_email'])){return this['channel'][_0xd138('0x9f')]('no\x20client_email\x20configured');}if(!this[_0xd138('0x79')](_0x4ca290[_0xd138('0x70')])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0xe5'));}if(!this[_0xd138('0x79')](_0x4ca290[_0xd138('0x71')])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0xe6'));}if(!this['isConfigured'](_0x4ca290[_0xd138('0x51')])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0x9d'));}this[_0xd138('0x2e')][_0xd138('0xdd')]=!![];this[_0xd138('0x2d')](_0x4ca290);this[_0xd138('0x38')](_0x4ca290[_0xd138('0x51')],'in','','');this[_0xd138('0x2e')]['noop'](util[_0xd138('0x22')](_0xd138('0xe7'),_0x4ca290[_0xd138('0x51')]));var _0x214720=this['googleDialogflowV2'][_0xd138('0x63')](this,_0x4ca290);if(_0x214720){for(var _0x29c649 in _0x214720){if(_0x214720[_0xd138('0x89')](_0x29c649)){if(_0x29c649!=='providerResponse'){this[_0xd138('0x2e')][_0xd138('0x93')](util[_0xd138('0x22')](_0xd138('0xe8'),_0x29c649[_0xd138('0xe9')]()),_0x214720[_0x29c649]);}}}this['createSquareMessage'](_0x214720[_0xd138('0xdf')],_0xd138('0xe0'),_0xd138('0xe3'),_0x214720[_0xd138('0xea')]);return this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0xeb'),_0x214720[_0xd138('0xdf')]));}return this[_0xd138('0x2e')][_0xd138('0x24')](_0x4ca290,_0xd138('0xec'));};AGIVertices['prototype'][_0xd138('0xed')]=function(_0x5af16d){logger[_0xd138('0x26')](util['format'](_0xd138('0xee'),_0x5af16d[_0xd138('0x30')]));if(!this['isConfigured'](_0x5af16d[_0xd138('0xef')])){return this['channel'][_0xd138('0x9f')](_0xd138('0xf0'));}if(!this[_0xd138('0x79')](_0x5af16d['username'])){return this[_0xd138('0x2e')]['noop']('no\x20username\x20configured');}if(!this[_0xd138('0x79')](_0x5af16d[_0xd138('0xf1')])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0xf2'));}if(!this['isConfigured'](_0x5af16d[_0xd138('0xf3')])){return this[_0xd138('0x2e')]['noop'](_0xd138('0x9d'));}this[_0xd138('0x2e')][_0xd138('0xdd')]=!![];this[_0xd138('0x2d')](_0x5af16d);this['createSquareMessage'](_0x5af16d['text'],'in','','');this[_0xd138('0x2e')]['noop'](util[_0xd138('0x22')]('Trying\x20SestekNDA:\x20%s',_0x5af16d[_0xd138('0x51')]));var _0x48ca9c=this[_0xd138('0x72')]['sync'](this,_0x5af16d);if(_0x48ca9c){for(var _0x11fe66 in _0x48ca9c){if(_0x48ca9c[_0xd138('0x89')](_0x11fe66)){this[_0xd138('0x2e')][_0xd138('0x93')](util['format'](_0xd138('0xf4'),_0x11fe66[_0xd138('0xe9')]()),_0x48ca9c[_0x11fe66]);}}this[_0xd138('0x38')](_0x48ca9c[_0xd138('0xdf')],_0xd138('0xe0'),_0xd138('0xed'),'');if(_0x48ca9c['audiofile']){this[_0xd138('0x2e')]['noop'](util[_0xd138('0x22')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x48ca9c[_0xd138('0xf5')]));var _0x1d39f1=this[_0xd138('0x2e')]['streamFile'](_0x48ca9c['audiofile']);try{fs[_0xd138('0xf6')](_0x48ca9c[_0xd138('0xf5')]+_0xd138('0xf7'));}catch(_0x40489f){logger['error'](_0x40489f);}return _0x1d39f1;}else{return this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0xf8'),_0x48ca9c['speech']));}}return this[_0xd138('0x2e')]['error'](_0x5af16d,_0xd138('0xf9'));};AGIVertices[_0xd138('0x13')]['end']=function(_0x5dad5a){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0xfa'),_0x5dad5a[_0xd138('0x30')]));return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0xfb'));};AGIVertices[_0xd138('0x13')][_0xd138('0xfc')]=function(_0x20ba68){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0xfd'),_0x20ba68[_0xd138('0x30')]));var _0x9032fc='';if(_0x20ba68[_0xd138('0xfe')]){if(!this[_0xd138('0x79')](_0x20ba68[_0xd138('0xfe')])){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x20ba68,'no\x20trunk\x20selected');}else{var _0x5efefc=parseInt(_0x20ba68[_0xd138('0xfe')],0xa);if(isNaN(_0x5efefc)){_0x9032fc=_0x20ba68[_0xd138('0xfe')];}else{_0x9032fc=this[_0xd138('0x19')][_0xd138('0x63')](this,_0x20ba68[_0xd138('0xfe')]);if(!_0x9032fc){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x20ba68,_0xd138('0xff'));}}}}else if(_0x20ba68[_0xd138('0x100')]){_0x9032fc=_0x20ba68['trunk_name'];}else{return this[_0xd138('0x2e')][_0xd138('0x24')](_0x20ba68,_0xd138('0x101'));}var _0x511815=this[_0xd138('0x2e')]['exec'](_0xd138('0xda'),[util[_0xd138('0x22')](_0xd138('0x102'),_0x9032fc,_0x20ba68[_0xd138('0x3f')]),_0x20ba68[_0xd138('0x5b')],_0x20ba68[_0xd138('0xd8')],_0x20ba68[_0xd138('0x58')]]);if(_0x511815[_0xd138('0x99')]===-0x1){return _0x511815;}return this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0xd9'),_0xd138('0xda')));};AGIVertices[_0xd138('0x13')][_0xd138('0x103')]=function(_0xac712d){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x104'),_0xac712d[_0xd138('0x30')]));return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0x103'));};AGIVertices['prototype'][_0xd138('0x105')]=function(_0x101407){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x106'),_0x101407[_0xd138('0x30')]));if(_0x101407[_0xd138('0x107')]===0x0){return this[_0xd138('0x9a')](_0x101407);}_0x101407[_0xd138('0x107')]-=0x1;if(!this[_0xd138('0x79')](_0x101407['file_id'])){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x101407,_0xd138('0x108'));}var _0x52f7be=this[_0xd138('0x109')][_0xd138('0x63')](this,_0x101407[_0xd138('0x10a')]);if(!_0x52f7be){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x101407,_0xd138('0x10b'));}if(!this[_0xd138('0x79')](_0x101407[_0xd138('0xcd')])){return this['channel'][_0xd138('0x24')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x393222=this[_0xd138('0x2e')][_0xd138('0x10c')](_0x52f7be,_0x101407[_0xd138('0x10d')],_0x101407['maxdigit']);var _0x471225=_0x393222[_0xd138('0x99')]?_0x393222['result'][_0xd138('0x97')]():'';logger[_0xd138('0x26')](_0xd138('0x10e'),JSON[_0xd138('0x66')](_0x393222));if(_0x393222[_0xd138('0x99')]===-0x1){this['createSquareDetailsReport'][_0xd138('0x63')](this,_0x101407,_0x471225);return _0x393222;}else if(_0x393222[_0xd138('0x96')]===_0xd138('0x5b')){_0x393222[_0xd138('0x99')]=_0x471225[_0xd138('0x8e')]>=parseInt(_0x101407[_0xd138('0x10f')])?'x':'i';}else{_0x393222[_0xd138('0x99')]=_0x471225[_0xd138('0x8e')]>=parseInt(_0x101407[_0xd138('0x10f')])&&_0x471225[_0xd138('0x8e')]<=parseInt(_0x101407['maxdigit'])?'x':'i';}var _0x223127=this[_0xd138('0xf')][_0xd138('0x63')](this,_0x101407[_0xd138('0xcd')]);if(!_0x223127){return this['channel']['error'](_0x101407,_0xd138('0xcf'));}this[_0xd138('0x2e')][_0xd138('0x93')](_0x223127,_0x471225);if(this[_0xd138('0x79')](_0x101407[_0xd138('0x110')])){var _0x575ccf=parseInt(_0x101407[_0xd138('0x110')],0xa);var _0xcb7826=rs['generate']({'charset':'*','length':_0x575ccf});var _0x230b98=_0x471225[_0xd138('0x8e')];if(_0x230b98>0x0){if(_0x230b98>_0x575ccf){this[_0xd138('0x2d')][_0xd138('0x63')](this,_0x101407,_0x101407[_0xd138('0x111')]===_0xd138('0x112')?_0xcb7826+_0x471225['substr'](_0x575ccf):_0x471225[_0xd138('0x113')](0x0,_0x230b98-_0x575ccf)+_0xcb7826);}else{this['createSquareDetailsReport'][_0xd138('0x63')](this,_0x101407,rs[_0xd138('0x114')]({'charset':'*','length':_0x230b98}));}}else{this['createSquareDetailsReport'][_0xd138('0x63')](this,_0x101407,'');}}else{this['createSquareDetailsReport'][_0xd138('0x63')](this,_0x101407,_0x471225);}return _0x393222;};AGIVertices[_0xd138('0x13')]['getsecretdigits']=function(_0xd6e13a){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x115'),_0xd6e13a['label']));return this[_0xd138('0x105')](_0xd6e13a);};AGIVertices['prototype'][_0xd138('0x116')]=function(_0xb6a0f0){logger[_0xd138('0x26')](util[_0xd138('0x22')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0xb6a0f0[_0xd138('0x30')]));this[_0xd138('0x2d')][_0xd138('0x63')](this,_0xb6a0f0,_0xb6a0f0[_0xd138('0x117')]);return this[_0xd138('0x2e')][_0xd138('0x9f')](util['format'](_0xd138('0x118'),_0xb6a0f0[_0xd138('0x117')]));};AGIVertices[_0xd138('0x13')]['awspolly']=function(_0x40311b){logger[_0xd138('0x26')](util[_0xd138('0x22')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x40311b[_0xd138('0x30')]));if(!this[_0xd138('0x79')](_0x40311b[_0xd138('0x7c')])||!this[_0xd138('0x79')](_0x40311b['aws_secret_access_key'])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0x119'));}if(!this[_0xd138('0x79')](_0x40311b[_0xd138('0x51')])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0x9d'));}this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0x11a'),_0x40311b[_0xd138('0x51')]));var _0x22b147=this[_0xd138('0x7b')][_0xd138('0x63')](this,_0x40311b);if(_0x22b147){this[_0xd138('0x2e')]['noop'](util[_0xd138('0x22')](_0xd138('0x11b'),_0x22b147));var _0x9b1041=this['channel'][_0xd138('0x11c')](_0x22b147);try{fs[_0xd138('0xf6')](_0x22b147+_0xd138('0xf7'));}catch(_0x5a6727){logger[_0xd138('0x24')](_0x5a6727);}return _0x9b1041;}return this['channel']['error'](_0x40311b,_0xd138('0x11d'));};AGIVertices[_0xd138('0x13')][_0xd138('0x11e')]=function(_0x208390){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x11f'),_0x208390[_0xd138('0x30')]));if(!this[_0xd138('0x79')](_0x208390[_0xd138('0x7c')])||!this[_0xd138('0x79')](_0x208390[_0xd138('0x7d')])){return this[_0xd138('0x2e')]['noop'](_0xd138('0x119'));}if(!this[_0xd138('0x79')](_0x208390[_0xd138('0x120')])){return this['channel'][_0xd138('0x9f')](_0xd138('0x121'));}if(!this[_0xd138('0x79')](_0x208390[_0xd138('0x51')])){return this[_0xd138('0x2e')][_0xd138('0x9f')]('no\x20text\x20configured');}this['channel']['bot']=!![];this[_0xd138('0x2d')](_0x208390);this[_0xd138('0x38')](_0x208390['text'],'in','','');this[_0xd138('0x2e')]['noop'](util[_0xd138('0x22')](_0xd138('0x122'),_0x208390[_0xd138('0x51')]));var _0x5d2064=this['awsLex'][_0xd138('0x63')](this,_0x208390);if(_0x5d2064){for(var _0x46a657 in _0x5d2064){if(_0x5d2064['hasOwnProperty'](_0x46a657)&&_['isString'](_0x5d2064[_0x46a657])){this['channel']['setVariable'](util[_0xd138('0x22')]('AWS_LEX_%s',_0x46a657[_0xd138('0xe9')]()),_0x5d2064[_0x46a657]);}}if(_['isNil'](_0x5d2064['message'])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0x123'));}else{this[_0xd138('0x38')](_0x5d2064[_0xd138('0x6a')],_0xd138('0xe0'),'amazonlex','');return this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')]('Amazon\x20Lex\x20Result\x20%s',_0x5d2064[_0xd138('0x6a')]));}}return this[_0xd138('0x2e')][_0xd138('0x24')](_0x208390,_0xd138('0x124'));};AGIVertices[_0xd138('0x13')][_0xd138('0x125')]=function(_0x409de3){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x126'),_0x409de3[_0xd138('0x30')],_0x409de3['timeout']));if(!this['isConfigured'](_0x409de3['key'])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0xdc'));}var _0x58b73e=_0xd138('0x127');var _0x1e0e87=util[_0xd138('0x22')](_0xd138('0x128'),FILES_PATH,rs['generate'](0x4));var _0x2670de=util['format']('%s.%s',_0x1e0e87,_0x58b73e);var _0x2bd0ac=!![];if(_0x409de3['beep']===_0xd138('0x129')){_0x2bd0ac=![];}var _0xdb93f5=this[_0xd138('0x2e')][_0xd138('0x12a')](_0x1e0e87,_0x58b73e,_0x409de3['intKey'],_0x409de3[_0xd138('0x5b')],undefined,_0x2bd0ac);if(_0xdb93f5[_0xd138('0x99')]!==-0x1){this[_0xd138('0x2e')]['noop'](util[_0xd138('0x22')]('google\x20%s\x20file\x20created',_0x2670de));var _0xe4e811=this[_0xd138('0x82')]['sync'](this,_0x409de3,_0x2670de);if(_0xe4e811){for(var _0x595d30 in _0xe4e811){if(_0xe4e811[_0xd138('0x89')](_0x595d30)){this[_0xd138('0x2e')][_0xd138('0x93')](util['format'](_0xd138('0x12b'),_0x595d30[_0xd138('0xe9')]()),_0xe4e811[_0x595d30]);}}return this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0x12c'),JSON[_0xd138('0x66')](_0xe4e811)));}}return _0xdb93f5;};AGIVertices[_0xd138('0x13')][_0xd138('0x12d')]=function(_0x496703){logger['info'](util[_0xd138('0x22')](_0xd138('0x12e'),_0x496703[_0xd138('0x30')]));if(!this[_0xd138('0x79')](_0x496703[_0xd138('0x85')])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0x12f'));}if(!this[_0xd138('0x79')](_0x496703[_0xd138('0x86')])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0x130'));}var _0x152e9c=_0xd138('0x127');var _0x32e04d=util[_0xd138('0x22')]('%s/recordings/%s',FILES_PATH,rs[_0xd138('0x114')](0x4));var _0x2eaf70=util[_0xd138('0x22')](_0xd138('0x92'),_0x32e04d,_0x152e9c);var _0x3986f5=!![];if(_0x496703[_0xd138('0x131')]===_0xd138('0x129')){_0x3986f5=![];}var _0x1aa62a=this[_0xd138('0x2e')][_0xd138('0x12a')](_0x32e04d,_0x152e9c,_0x496703[_0xd138('0x132')],_0x496703['timeout'],undefined,_0x3986f5);if(_0x1aa62a['result']!==-0x1){this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0x133'),_0x2eaf70));var _0x4bf1b5=this[_0xd138('0x84')][_0xd138('0x63')](this,_0x496703,_0x2eaf70);if(_0x4bf1b5){for(var _0x189ade in _0x4bf1b5){if(_0x4bf1b5[_0xd138('0x89')](_0x189ade)){this[_0xd138('0x2e')][_0xd138('0x93')](util[_0xd138('0x22')]('TILDE_ASR_%s',_0x189ade[_0xd138('0xe9')]()),_0x4bf1b5[_0x189ade]);}}return this['channel'][_0xd138('0x9f')](util['format'](_0xd138('0x134'),JSON['stringify'](_0x4bf1b5)));}}return _0x1aa62a;};AGIVertices[_0xd138('0x13')]['gotoc']=function(_0x12816b){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x135'),_0x12816b[_0xd138('0x30')]));return this[_0xd138('0x2e')][_0xd138('0x136')](_0x12816b[_0xd138('0x35')],_0x12816b[_0xd138('0x36')],_0x12816b[_0xd138('0x137')]);};AGIVertices[_0xd138('0x13')][_0xd138('0x138')]=function(_0x22b5b4){logger['info'](util[_0xd138('0x22')](_0xd138('0x139'),_0x22b5b4[_0xd138('0x30')]));if(!this[_0xd138('0x79')](_0x22b5b4[_0xd138('0x13a')])){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x22b5b4,_0xd138('0x13b'));}try{var _0x44f177=eval(_0x22b5b4[_0xd138('0x13a')])?_0xd138('0x13c'):'false';this[_0xd138('0x2e')][_0xd138('0x9f')](util['format'](_0xd138('0x13d'),_0x22b5b4[_0xd138('0x13a')],_0x44f177));return{'code':0xc8,'result':_0x44f177};}catch(_0x3d33f3){return{'code':0xc8,'result':_0xd138('0x13e')};}};AGIVertices[_0xd138('0x13')]['gotoiftime']=function(_0x2dda1c){logger['info'](util['format'](_0xd138('0x13f'),_0x2dda1c['label']));if(!this[_0xd138('0x79')](_0x2dda1c[_0xd138('0x140')])){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x2dda1c,_0xd138('0x141'));}var _0x19e8dc=this[_0xd138('0x142')][_0xd138('0x63')](this,_0x2dda1c['interval_id']);if(!_0x19e8dc){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x2dda1c,_0xd138('0x143'));}for(var _0x57e478=0x0;_0x57e478<_0x19e8dc['length'];_0x57e478+=0x1){var _0x3cf435=this[_0xd138('0x2e')][_0xd138('0xf')](util[_0xd138('0x22')]('IFTIME(%s?true:false)',_0x19e8dc[_0x57e478]));if(_0x3cf435[_0xd138('0x99')]===-0x1){return _0x3cf435;}logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x144'),_0x19e8dc[_0x57e478],_0x3cf435['extra']));if(_0x3cf435[_0xd138('0x96')]===_0xd138('0x13c')){logger['info'](util[_0xd138('0x22')](_0xd138('0x144'),_0x19e8dc[_0x57e478],_0xd138('0x13c')));this[_0xd138('0x2e')][_0xd138('0x9f')](util['format'](_0xd138('0x144'),_0x19e8dc[_0x57e478],_0xd138('0x13c')));return{'code':0xc8,'result':_0xd138('0x13c')};}else{logger['info'](util[_0xd138('0x22')](_0xd138('0x144'),_0x19e8dc[_0x57e478],'false'));this[_0xd138('0x2e')]['noop'](util['format'](_0xd138('0x144'),_0x19e8dc[_0x57e478],'false'));}}return{'code':0xc8,'result':_0xd138('0x13e')};};AGIVertices[_0xd138('0x13')]['hangup']=function(_0x51b1c6){logger[_0xd138('0x26')](util['format'](_0xd138('0x145'),_0x51b1c6[_0xd138('0x30')]));return this['channel'][_0xd138('0x146')]();};AGIVertices['prototype'][_0xd138('0x147')]=function(_0x51bc2d){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x148'),_0x51bc2d[_0xd138('0x30')]));if(!this[_0xd138('0x79')](_0x51bc2d[_0xd138('0x74')])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0xdc'));}var _0x5dcd1f=_0xd138('0x127');var _0xe02b1=util[_0xd138('0x22')](_0xd138('0x128'),FILES_PATH,rs['generate'](0x4));var _0x4989e4=util[_0xd138('0x22')](_0xd138('0x92'),_0xe02b1,_0x5dcd1f);var _0x5d948c=!![];if(_0x51bc2d['beep']===_0xd138('0x129')){_0x5d948c=![];}var _0x349612=this['channel'][_0xd138('0x12a')](_0xe02b1,_0x5dcd1f,_0x51bc2d['intKey'],_0x51bc2d[_0xd138('0x5b')],undefined,_0x5d948c);if(_0x349612[_0xd138('0x99')]!==-0x1){this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0x149'),_0x4989e4));var _0x5083dc=this[_0xd138('0x77')][_0xd138('0x63')](this,_0x51bc2d,_0x4989e4);if(_0x5083dc){for(var _0x1c463e in _0x5083dc){if(_0x5083dc['hasOwnProperty'](_0x1c463e)){this[_0xd138('0x2e')][_0xd138('0x93')](util[_0xd138('0x22')](_0xd138('0x14a'),_0x1c463e[_0xd138('0xe9')]()),_0x5083dc[_0x1c463e]);}}return this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0x14b'),JSON[_0xd138('0x66')](_0x5083dc)));}}return _0x349612;};AGIVertices[_0xd138('0x13')][_0xd138('0x14c')]=function(_0xe9b161){logger[_0xd138('0x26')](util['format'](_0xd138('0x14d'),_0xe9b161['label']));if(!this['isConfigured'](_0xe9b161[_0xd138('0x74')])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0xdc'));}if(!this[_0xd138('0x79')](_0xe9b161['text'])){return this['channel'][_0xd138('0x9f')](_0xd138('0x9d'));}this['channel'][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0x14e'),_0xe9b161[_0xd138('0x51')]));var _0x4f4a73=this[_0xd138('0x73')][_0xd138('0x63')](this,_0xe9b161);if(_0x4f4a73){this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0x149'),_0x4f4a73));var _0x4ad507=this[_0xd138('0x2e')][_0xd138('0x11c')](_0x4f4a73,_0xe9b161[_0xd138('0x132')]);try{fs[_0xd138('0xf6')](_0x4f4a73+'.wav');}catch(_0x58f778){logger['error'](_0x58f778);}return _0x4ad507;}return this[_0xd138('0x2e')][_0xd138('0x24')](_0xe9b161,_0xd138('0x14f'));};AGIVertices[_0xd138('0x13')][_0xd138('0x150')]=function(_0x10c6be){logger[_0xd138('0x26')](util['format'](_0xd138('0x151'),_0x10c6be[_0xd138('0x30')]));if(!this[_0xd138('0x79')](_0x10c6be['findBy'])){return this['channel'][_0xd138('0x24')](_0x10c6be,'no\x20find\x20by\x20configured');}logger['info'](util[_0xd138('0x22')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xd138('0x33')],_0x10c6be[_0xd138('0x152')]));var _0x459905=this[_0xd138('0x48')]['sync'](this,_0x10c6be[_0xd138('0x152')]);if(_0x459905){logger['info'](util[_0xd138('0x22')](_0xd138('0x153'),this['channel'][_0xd138('0x33')],_0x10c6be['findBy']));this[_0xd138('0x2e')]['noop'](util[_0xd138('0x22')](_0xd138('0x153'),this[_0xd138('0x2e')][_0xd138('0x33')],_0x10c6be[_0xd138('0x152')]));return{'code':0xc8,'result':_0xd138('0x154')};}else{logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x155'),this[_0xd138('0x2e')][_0xd138('0x33')],_0x10c6be[_0xd138('0x152')]));this[_0xd138('0x2e')]['noop'](util['format'](_0xd138('0x155'),this[_0xd138('0x2e')]['callerid'],_0x10c6be['findBy']));return{'code':0xc8,'result':_0xd138('0x156')};}};AGIVertices[_0xd138('0x13')][_0xd138('0x157')]=function(_0x24d862){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x158'),_0x24d862[_0xd138('0x30')]));if(!this['isConfigured'](_0x24d862['findBy'])){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x24d862,_0xd138('0x159'));}logger[_0xd138('0x26')](util[_0xd138('0x22')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x24d862[_0xd138('0x152')]));var _0x335aa9=this['agentLogout'][_0xd138('0x63')](this,_0x24d862[_0xd138('0x152')]);if(_0x335aa9){logger[_0xd138('0x26')](util['format'](_0xd138('0x153'),this[_0xd138('0x2e')][_0xd138('0x33')],_0x24d862[_0xd138('0x152')]));this['channel'][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0x153'),this[_0xd138('0x2e')][_0xd138('0x33')],_0x24d862[_0xd138('0x152')]));return{'code':0xc8,'result':_0xd138('0x154')};}else{logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x155'),this[_0xd138('0x2e')][_0xd138('0x33')],_0x24d862[_0xd138('0x152')]));this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0x155'),this['channel']['callerid'],_0x24d862[_0xd138('0x152')]));return{'code':0xc8,'result':_0xd138('0x156')};}};AGIVertices[_0xd138('0x13')]['math']=function(_0x20f261){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x15a'),_0x20f261['label']));if(!this['isConfigured'](_0x20f261['operation'])){return this[_0xd138('0x2e')]['error'](_0x20f261,_0xd138('0x15b'));}this['channel'][_0xd138('0x9f')](util['format'](_0xd138('0x15c'),_0x20f261[_0xd138('0x15d')]));var _0x49e3ce=eval(_0x20f261[_0xd138('0x15d')]);if(!this[_0xd138('0x79')](_0x20f261[_0xd138('0xcd')])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0xce'));}var _0x434680=this[_0xd138('0xf')][_0xd138('0x63')](this,_0x20f261[_0xd138('0xcd')]);if(!_0x434680){return this[_0xd138('0x2e')]['error'](_0x20f261,_0xd138('0xcf'));}if(_[_0xd138('0x8d')](_0x49e3ce)){var _0x51db0f=this;_0x49e3ce[_0xd138('0xd0')](function(_0x191c46,_0x1d5e14){_0x51db0f[_0xd138('0x2e')][_0xd138('0x93')](util[_0xd138('0x22')](_0xd138('0x15e'),_0x434680,_0x1d5e14),_0x191c46);});return this[_0xd138('0x2e')]['noop'](util[_0xd138('0x22')](_0xd138('0x15f'),_0x434680));}else{return this[_0xd138('0x2e')][_0xd138('0x93')](_0x434680,_0x49e3ce);}};AGIVertices[_0xd138('0x13')]['menu']=function(_0x1b2bd2){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x160'),_0x1b2bd2[_0xd138('0x30')]));if(_0x1b2bd2[_0xd138('0x107')]===0x0){return this[_0xd138('0x9a')](_0x1b2bd2);}_0x1b2bd2[_0xd138('0x107')]-=0x1;if(!this[_0xd138('0x79')](_0x1b2bd2[_0xd138('0x10a')])){return this[_0xd138('0x2e')]['error'](_0x1b2bd2,_0xd138('0x108'));}var _0x4526fc=this['getSound'][_0xd138('0x63')](this,_0x1b2bd2['file_id']);if(!_0x4526fc){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x1b2bd2,_0xd138('0x10b'));}var _0x1075df=this[_0xd138('0x2e')][_0xd138('0x10c')](_0x4526fc,_0x1b2bd2[_0xd138('0x10d')],_0x1b2bd2[_0xd138('0x161')]);var _0x1f4ebe=_0x1075df[_0xd138('0x99')];if(_0x1075df[_0xd138('0x99')]===-0x1){this[_0xd138('0x2d')][_0xd138('0x63')](this,_0x1b2bd2,'-1');return _0x1075df;}else if(_0x1075df[_0xd138('0x96')]===_0xd138('0x5b')){_0x1075df[_0xd138('0x99')]=_0x1075df[_0xd138('0x99')][_0xd138('0x8e')]>0x0?_0x1075df[_0xd138('0x99')]:'t';}else if(_[_0xd138('0x3a')](_0x1075df[_0xd138('0x99')])){_0x1075df['result']='#';_0x1f4ebe='#';}if(!this[_0xd138('0x79')](_0x1b2bd2[_0xd138('0xcd')])){this['channel'][_0xd138('0x9f')](_0xd138('0xce'));}else{var _0x56d906=this[_0xd138('0xf')][_0xd138('0x63')](this,_0x1b2bd2[_0xd138('0xcd')]);if(!_0x56d906){return this['channel'][_0xd138('0x24')](_0x1b2bd2,_0xd138('0xcf'));}this[_0xd138('0x2e')][_0xd138('0x93')](_0x56d906,_0x1f4ebe);}this[_0xd138('0x2d')][_0xd138('0x63')](this,_0x1b2bd2,_0x1f4ebe);return _0x1075df;};AGIVertices['prototype']['noop']=function(_0xe9076c){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x162'),_0xe9076c[_0xd138('0x30')]));return this[_0xd138('0x2e')]['noop'](_0xe9076c[_0xd138('0x163')]||_0xe9076c[_0xd138('0x30')]);};AGIVertices[_0xd138('0x13')][_0xd138('0x164')]=function(_0x4d1704){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x165'),_0x4d1704['label']));if(!this[_0xd138('0x79')](_0x4d1704[_0xd138('0x152')])){return this[_0xd138('0x2e')]['error'](_0x4d1704,'no\x20find\x20by\x20configured');}logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x166'),this[_0xd138('0x2e')][_0xd138('0x33')],_0x4d1704[_0xd138('0x152')]));var _0x3ad11f=this[_0xd138('0x43')][_0xd138('0x63')](this,_0x4d1704[_0xd138('0x167')]);var _0x279dc3=this[_0xd138('0x45')][_0xd138('0x63')](this,_0x4d1704[_0xd138('0x152')],_0x3ad11f);if(_0x279dc3){logger[_0xd138('0x26')](util[_0xd138('0x22')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xd138('0x2e')][_0xd138('0x33')],_0x4d1704[_0xd138('0x152')]));this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0x153'),this[_0xd138('0x2e')][_0xd138('0x33')],_0x4d1704[_0xd138('0x152')]));return{'code':0xc8,'result':'success'};}else{logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x155'),this[_0xd138('0x2e')][_0xd138('0x33')],_0x4d1704[_0xd138('0x152')]));this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0x153'),this[_0xd138('0x2e')][_0xd138('0x33')],_0x4d1704[_0xd138('0x152')]));return{'code':0xc8,'result':_0xd138('0x156')};}};AGIVertices[_0xd138('0x13')]['playback']=function(_0x1040ba){logger[_0xd138('0x26')](util['format'](_0xd138('0x168'),_0x1040ba['label']));if(!this[_0xd138('0x79')](_0x1040ba[_0xd138('0x10a')])){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x1040ba,'no\x20file\x20audio\x20selected');}var _0x5be05a=this[_0xd138('0x109')]['sync'](this,_0x1040ba[_0xd138('0x10a')]);if(!_0x5be05a){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x1040ba,_0xd138('0x10b'));}var _0x47845c=this['channel'][_0xd138('0x4c')](_0xd138('0x169'),[_0x5be05a,_0x1040ba[_0xd138('0xd8')]]);if(_0x47845c['result']===-0x1){return _0x47845c;}return this[_0xd138('0x2e')][_0xd138('0x9f')](util['format'](_0xd138('0xb8'),_0xd138('0x169'),_0x5be05a));};AGIVertices[_0xd138('0x13')]['queue']=function(_0x436cda){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x16a'),_0x436cda['label']));if(!this[_0xd138('0x79')](_0x436cda['queue_id'])){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x436cda,_0xd138('0x16b'));}var _0x449dc7='';var _0x2fed8e=parseInt(_0x436cda[_0xd138('0x16c')],0xa);if(isNaN(_0x2fed8e)){_0x449dc7=_0x436cda[_0xd138('0x16c')];}else{_0x449dc7=this[_0xd138('0x14')][_0xd138('0x63')](this,_0x436cda['queue_id']);if(!_0x449dc7){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x436cda,_0xd138('0x16d'));}}var _0x5cf006='';if(this[_0xd138('0x79')](_0x436cda[_0xd138('0x10a')])){var _0x72ed74=this[_0xd138('0x109')][_0xd138('0x63')](this,_0x436cda[_0xd138('0x10a')]);if(_0x72ed74){_0x5cf006=_0x72ed74;}}this['createSquareDetailsReport'][_0xd138('0x63')](this,_0x436cda,_0x449dc7);if(_0x436cda[_0xd138('0xd8')]['indexOf']('x')<0x0){_0x436cda['opts']+='x';}if(_0x436cda[_0xd138('0xd8')][_0xd138('0x16e')]('X')<0x0){_0x436cda['opts']+='X';}this[_0xd138('0x2e')][_0xd138('0x93')]('XMCS-QUEUE',_0x449dc7?_0x449dc7[_0xd138('0x16f')]():'');var _0x466c27=this[_0xd138('0x2e')]['exec']('QUEUE',[_0x449dc7,_0x436cda['opts'],_0x436cda[_0xd138('0x58')],_0x5cf006,_0x436cda[_0xd138('0x5b')],_0x436cda[_0xd138('0xab')],_0x436cda[_0xd138('0x170')],_0x436cda[_0xd138('0x171')],'',_0x436cda['position']]);if(_0x466c27[_0xd138('0x99')]===-0x1){return _0x466c27;}return this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0xb8'),_0xd138('0x172'),_0x449dc7));};AGIVertices[_0xd138('0x13')][_0xd138('0x173')]=function(_0x3306be){logger[_0xd138('0x26')](util['format'](_0xd138('0x174'),_0x3306be['label']));var _0x45189f=_0x3306be[_0xd138('0x175')]||_0xd138('0x127');var _0x54ad48=util[_0xd138('0x22')](_0xd138('0x176'),this['channel'][_0xd138('0x2f')],rs[_0xd138('0x114')](0x5));var _0x1445a0=util[_0xd138('0x22')]('%s/recordings/%s.%s',FILES_PATH,_0x54ad48,_0x45189f);var _0x14fac3=util[_0xd138('0x22')]('%s/recordings/%s',FILES_PATH,_0x54ad48);this[_0xd138('0x34')][_0xd138('0x63')](this,_0x3306be,_0x54ad48,_0x1445a0);this['channel']['setVariable'](_0xd138('0x177'),_0x54ad48);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x14fac3,_0x45189f,_0x3306be[_0xd138('0x178')],_0x3306be['timeout']);return this[_0xd138('0x2e')][_0xd138('0x12a')](_0x14fac3,_0x45189f,_0x3306be[_0xd138('0x178')],_0x3306be[_0xd138('0x5b')],undefined,!![]);};AGIVertices[_0xd138('0x13')][_0xd138('0x179')]=function(_0x5dabac){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x17a'),_0x5dabac[_0xd138('0x30')]));if(!this['isConfigured'](_0x5dabac[_0xd138('0x58')])){return this[_0xd138('0x2e')]['noop']('no\x20url\x20configured');}var _0x20a239=this[_0xd138('0x57')]['sync'](this,_0x5dabac);logger[_0xd138('0x26')](util['format'](_0xd138('0x17b'),util[_0xd138('0x17c')](_0x20a239,{'showHidden':![],'depth':null})));if(!this[_0xd138('0x79')](_0x5dabac[_0xd138('0xcd')])){return this[_0xd138('0x2e')]['noop'](_0xd138('0x17d'));}var _0x1944a5=this['getVariable'][_0xd138('0x63')](this,_0x5dabac['variable_id']);if(!_0x1944a5){return this[_0xd138('0x2e')]['error'](_0x5dabac,_0xd138('0xcf'));}this[_0xd138('0x2e')][_0xd138('0x93')](util[_0xd138('0x22')](_0xd138('0x17e'),_0x1944a5),_0x20a239['statusCode']?_0x20a239[_0xd138('0x68')]:_0xd138('0x17f'));this[_0xd138('0x2e')]['setVariable'](util['format'](_0xd138('0x180'),_0x1944a5),_0x20a239[_0xd138('0x69')]?_0x20a239[_0xd138('0x69')]:'OK');if(_0x20a239[_0xd138('0x5e')]){try{this[_0xd138('0x91')](_0x20a239[_0xd138('0x5e')],_0x1944a5);}catch(_0x47e690){logger['error'](util[_0xd138('0x22')](_0xd138('0x181'),_0x1944a5));}}return this[_0xd138('0x2e')][_0xd138('0x9f')](util['format'](_0xd138('0x182'),_0x1944a5));};AGIVertices[_0xd138('0x13')][_0xd138('0x183')]=function(_0x40902a){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x184'),_0x40902a['label']));return this['channel'][_0xd138('0x185')](_0x40902a[_0xd138('0x186')][_0xd138('0xca')](/\s+/g,''),_0x40902a['escape_digits']);};AGIVertices['prototype'][_0xd138('0x187')]=function(_0x70209e){logger['info'](util[_0xd138('0x22')](_0xd138('0x188'),_0x70209e[_0xd138('0x30')]));return this[_0xd138('0x2e')][_0xd138('0x189')](_0x70209e['number'][_0xd138('0xca')](/\s+/g,''),_0x70209e[_0xd138('0x178')]);};AGIVertices[_0xd138('0x13')][_0xd138('0x18a')]=function(_0x341433){logger[_0xd138('0x26')](util['format'](_0xd138('0x18b'),_0x341433[_0xd138('0x30')]));return this[_0xd138('0x2e')][_0xd138('0x18c')](_0x341433[_0xd138('0x51')],_0x341433[_0xd138('0x178')]);};AGIVertices[_0xd138('0x13')]['sendMail']=function(_0x13709f){logger['info'](util['format'](_0xd138('0x18d'),_0x13709f[_0xd138('0x30')]));if(!this[_0xd138('0x79')](_0x13709f[_0xd138('0x18e')])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0x18f'));}var _0x36d0eb=this['getMailAccount']['sync'](this,_0x13709f[_0xd138('0x18e')]);if(!_0x36d0eb||!_0x36d0eb[_0xd138('0x190')]){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x13709f,'no\x20mail\x20account\x20found');}var _0x17b4fe={'from':util['format'](_0xd138('0x191'),_0x36d0eb[_0xd138('0x11')],_0x36d0eb[_0xd138('0x192')]||_0x36d0eb['Smtp'][_0xd138('0x193')]),'to':_0x13709f['to']||'','cc':_0x13709f['cc']||'','bcc':_0x13709f[_0xd138('0x194')]||'','subject':_0x13709f['subject'],'html':_0x13709f['text'],'text':_0x13709f[_0xd138('0x51')]};if(this['isConfigured'](_0x13709f['template_id'])){}logger[_0xd138('0x195')](_0xd138('0x196'),JSON['stringify'](_0x17b4fe));this[_0xd138('0x2d')]['sync'](this,_0x13709f,_0x13709f[_0xd138('0x18e')]);this[_0xd138('0x2e')][_0xd138('0x9f')](util['format']('Trying\x20SendMail\x20with\x20account\x20%s',_0x36d0eb[_0xd138('0x11')]));this[_0xd138('0x1d')]['sync'](this,_0x36d0eb[_0xd138('0x197')],_0x17b4fe);return this['channel'][_0xd138('0x9f')](_0xd138('0x198'));};AGIVertices[_0xd138('0x13')]['sendFax']=function(_0x5f008a){logger['info'](util[_0xd138('0x22')](_0xd138('0x199'),_0x5f008a['label']));return this[_0xd138('0x2e')]['noop'](_0xd138('0x19a'));};AGIVertices[_0xd138('0x13')]['sendSMS']=function(_0x104685){logger['info'](util[_0xd138('0x22')](_0xd138('0x19b'),_0x104685[_0xd138('0x30')]));if(!this[_0xd138('0x79')](_0x104685['sms_account_id'])){return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0x19c'));}var _0x32d046=this[_0xd138('0x19d')]['sync'](this,_0x104685[_0xd138('0x19e')]);if(!_0x32d046){return this['channel'][_0xd138('0x24')](_0x104685,'no\x20sms\x20account\x20found');}var _0x36feff={'body':_0x104685['sms_text'],'phone':_0x104685['to']||'','SmsAccountId':_0x32d046['id']};logger[_0xd138('0x195')](_0xd138('0x19f'),JSON[_0xd138('0x66')](_0x36feff));this['createSquareDetailsReport']['sync'](this,_0x104685,_0x104685['sms_account_id']);this['channel'][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0x1a0'),_0x32d046[_0xd138('0x11')]));this[_0xd138('0x2c')][_0xd138('0x63')](this,_0x36feff);return this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0x1a1'));};AGIVertices[_0xd138('0x13')]['set']=function(_0x3c078d){logger[_0xd138('0x26')](util['format'](_0xd138('0x1a2'),_0x3c078d[_0xd138('0x30')]));if(!this[_0xd138('0x79')](_0x3c078d[_0xd138('0xcd')])){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x3c078d,_0xd138('0x1a3'));}var _0x1524b3=this['getVariable']['sync'](this,_0x3c078d[_0xd138('0xcd')]);if(!_0x1524b3){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x3c078d,'no\x20variable\x20found');}return this[_0xd138('0x2e')]['setVariable'](_0x1524b3,_0x3c078d[_0xd138('0x1a4')]);};AGIVertices[_0xd138('0x13')]['start']=function(_0x2219d4){logger['info'](util[_0xd138('0x22')](_0xd138('0x1a5'),_0x2219d4['label']));this[_0xd138('0x2e')][_0xd138('0x9f')]('START\x20CALLY\x20SQUARE');if(_0x2219d4[_0xd138('0xad')]===_0xd138('0x1a6')){this[_0xd138('0x2e')][_0xd138('0x9f')](_0xd138('0x1a7'));return this[_0xd138('0x2e')][_0xd138('0xad')]();}return this[_0xd138('0x2e')]['noop'](_0xd138('0x1a8'));};AGIVertices[_0xd138('0x13')][_0xd138('0x1a9')]=function(_0x2115e9){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x1aa'),_0x2115e9[_0xd138('0x30')]));if(!this['isConfigured'](_0x2115e9['project_id'])){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x2115e9,_0xd138('0x1ab'));}var _0x406f48=this[_0xd138('0x1ac')][_0xd138('0x63')](this,_0x2115e9[_0xd138('0x1ad')]);if(!this[_0xd138('0x79')](_0x406f48)){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x2115e9,util[_0xd138('0x22')](_0xd138('0x1ae'),_0x2115e9['project_id']));}if(_0x406f48===this[_0xd138('0x2e')]['arg_1']){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x2115e9,_0xd138('0x1af'));}this[_0xd138('0x2d')][_0xd138('0x63')](this,_0x2115e9,_0x406f48);var _0x46e9b7=this[_0xd138('0x2e')][_0xd138('0x4c')](_0xd138('0x1b0'),util['format'](_0xd138('0x1b1'),config['agi'][_0xd138('0x1b2')]||'127.0.0.1',_0x406f48,this['channel']['arg_1']));if(_0x46e9b7[_0xd138('0x99')]===-0x1){return _0x46e9b7;}return this['channel'][_0xd138('0x9f')](util['format']('Executed\x20command\x20%s\x20%s',_0xd138('0x1b0'),_0x406f48));};AGIVertices[_0xd138('0x13')][_0xd138('0x1b3')]=function(_0x28f212){logger[_0xd138('0x26')](util[_0xd138('0x22')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x28f212['label']));var _0x3aa216=this[_0xd138('0x4b')]['sync'](this,_0x28f212[_0xd138('0xac')]);this[_0xd138('0x2d')][_0xd138('0x63')](this,_0x28f212,_0x28f212[_0xd138('0xac')]);if(this[_0xd138('0x79')](_0x28f212[_0xd138('0xcd')])){var _0x56fef7=this[_0xd138('0xf')]['sync'](this,_0x28f212[_0xd138('0xcd')]);if(_0x56fef7){this[_0xd138('0x2e')][_0xd138('0x93')](_0x56fef7,_0x3aa216);return this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0x1b4'),_0x28f212[_0xd138('0xac')],_0x56fef7));}}return this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x28f212['command']));};AGIVertices['prototype']['google_cloud_tts']=function(_0x5f495b){logger[_0xd138('0x26')](util['format'](_0xd138('0x1b5'),_0x5f495b[_0xd138('0x30')]));_0x5f495b[_0xd138('0x51')]=_0x5f495b[_0xd138('0x51')][_0xd138('0xca')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd138('0x79')](_0x5f495b[_0xd138('0x4f')])){return this[_0xd138('0x2e')]['noop'](_0xd138('0x1b6'));}if(!this['isConfigured'](_0x5f495b[_0xd138('0x51')])){return this[_0xd138('0x2e')][_0xd138('0x9f')]('no\x20text\x20configured');}this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x5f495b[_0xd138('0x51')]));var _0x3f72b5=this[_0xd138('0x4e')][_0xd138('0x63')](this,_0x5f495b);if(_0x3f72b5){this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0x1b7'),_0x3f72b5));var _0x1ac579=this[_0xd138('0x2e')][_0xd138('0x11c')](_0x3f72b5);try{fs['unlink'](_0x3f72b5+_0xd138('0xf7'));}catch(_0x1bbb21){logger[_0xd138('0x24')](_0x1bbb21);}return _0x1ac579;}return this[_0xd138('0x2e')][_0xd138('0x24')](_0x5f495b,_0xd138('0x1b8'));};AGIVertices[_0xd138('0x13')][_0xd138('0x1b9')]=function(_0x5d4689){logger['info'](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x5d4689[_0xd138('0x30')]));_0x5d4689[_0xd138('0x51')]=_0x5d4689['text'][_0xd138('0xca')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd138('0x79')](_0x5d4689[_0xd138('0x51')])){return this[_0xd138('0x2e')]['noop'](_0xd138('0x9d'));}this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')]('Trying\x20Google\x20TTS\x20%s',_0x5d4689['text']));var _0x15c255=this[_0xd138('0x1ba')]['sync'](this,_0x5d4689);if(_0x15c255){this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0x1bb'),_0x15c255));var _0x28fc7d=this['channel'][_0xd138('0x11c')](_0x15c255);try{fs[_0xd138('0xf6')](_0x15c255+_0xd138('0xf7'));}catch(_0x7afedf){logger[_0xd138('0x24')](_0x7afedf);}return _0x28fc7d;}return this[_0xd138('0x2e')][_0xd138('0x24')](_0x5d4689,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xd138('0x13')][_0xd138('0x1bc')]=function(_0x2b6f44){logger['info'](util[_0xd138('0x22')](_0xd138('0x1bd'),_0x2b6f44[_0xd138('0x30')]));if(!this['isConfigured'](_0x2b6f44[_0xd138('0x152')])){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x2b6f44,_0xd138('0x159'));}logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x166'),this[_0xd138('0x2e')][_0xd138('0x33')],_0x2b6f44[_0xd138('0x152')]));var _0x4157fe=this[_0xd138('0x47')][_0xd138('0x63')](this,_0x2b6f44['findBy']);if(_0x4157fe){logger['info'](util[_0xd138('0x22')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xd138('0x2e')][_0xd138('0x33')],_0x2b6f44[_0xd138('0x152')]));this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0x153'),this['channel'][_0xd138('0x33')],_0x2b6f44[_0xd138('0x152')]));return{'code':0xc8,'result':'success'};}else{logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x155'),this[_0xd138('0x2e')][_0xd138('0x33')],_0x2b6f44[_0xd138('0x152')]));this[_0xd138('0x2e')][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0x155'),this[_0xd138('0x2e')]['callerid'],_0x2b6f44[_0xd138('0x152')]));return{'code':0xc8,'result':_0xd138('0x156')};}};AGIVertices[_0xd138('0x13')]['voicemail']=function(_0x4c2581){logger[_0xd138('0x26')](util[_0xd138('0x22')](_0xd138('0x1be'),_0x4c2581['label']));var _0x55c6f8=this['channel'][_0xd138('0x4c')]('VOICEMAIL',[_0x4c2581[_0xd138('0x1bf')],_0x4c2581[_0xd138('0x6b')]]);if(_0x55c6f8[_0xd138('0x99')]===-0x1){return _0x55c6f8;}return this['channel'][_0xd138('0x9f')](util[_0xd138('0x22')](_0xd138('0xb8'),_0xd138('0x1c0'),_0x4c2581[_0xd138('0x1bf')]));};AGIVertices[_0xd138('0x13')][_0xd138('0x1c1')]=function(_0x4009f0){logger['info'](util['format'](_0xd138('0x1c2'),_0x4009f0[_0xd138('0x30')]));if(!this[_0xd138('0x79')](_0x4009f0[_0xd138('0xcd')])){return this[_0xd138('0x2e')][_0xd138('0x24')](_0x4009f0,_0xd138('0x1a3'));}var _0x52a095=this[_0xd138('0xf')]['sync'](this,_0x4009f0['variable_id']);if(!_0x52a095){return this[_0xd138('0x2e')]['error'](_0x4009f0,_0xd138('0xcf'));}var _0x1ed2c2=this[_0xd138('0x2e')][_0xd138('0xf')](_0x52a095);return{'code':0xc8,'result':_0x1ed2c2['extra']?_0x1ed2c2['extra']:'-'};};String[_0xd138('0x13')][_0xd138('0x95')]=function(_0x3a153a,_0x3312eb){return this['split'](_0x3a153a)['join'](_0x3312eb);};module[_0xd138('0x1c3')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 9ac37fd..08fe192 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 _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 +var _0x754e=['[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','message','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x754e,0x7a));var _0xe754=function(_0x18e4d2,_0x3298e8){_0x18e4d2=_0x18e4d2-0x0;var _0x17d106=_0x754e[_0x18e4d2];return _0x17d106;};'use strict';var _=require(_0xe754('0x0'));var moment=require(_0xe754('0x1'));var ami=require('../ami');var logger=require(_0xe754('0x2'))(_0xe754('0x3'));var RpcUser=require(_0xe754('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x4cc4f2){this[_0xe754('0x5')]=_0x4cc4f2['voiceQueues'];this[_0xe754('0x6')]=_0x4cc4f2[_0xe754('0x6')];this[_0xe754('0x7')]=_0x4cc4f2[_0xe754('0x7')];this[_0xe754('0x8')]={};ami['on'](_0xe754('0x9'),this[_0xe754('0xa')][_0xe754('0xb')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0xe754('0xb')](this));ami['on'](_0xe754('0xc'),this[_0xe754('0xd')]['bind'](this));ami['on'](_0xe754('0xe'),this[_0xe754('0xf')][_0xe754('0xb')](this));ami['on'](_0xe754('0x10'),this[_0xe754('0x11')][_0xe754('0xb')](this));ami['on'](_0xe754('0x12'),this[_0xe754('0x13')][_0xe754('0xb')](this));ami['on']('custom:agentConnectPreview',this[_0xe754('0x14')][_0xe754('0xb')](this));}function getDiff(_0x36cf49){var _0x2047c6=moment()[_0xe754('0x15')](0x0);var _0x57d71e=moment(_0x36cf49)[_0xe754('0x15')](0x0);return _0x2047c6[_0xe754('0x16')](_0x57d71e,_0xe754('0x17'));}Acw[_0xe754('0x18')]['startAcw']=function(_0x3320fa){try{var _0x19bc8f=this;var _0x5d2112=this['channels'][_0x3320fa][_0xe754('0x19')];var _0x4c2d16=this['channels'][_0x3320fa][_0xe754('0x1a')];var _0x3796f4=this['voiceQueues'][_0x4c2d16];var _0x4b4172=![];var _0x13ba69=_0xe754('0x1b');if(_0x3796f4[_0xe754('0x1c')]){if(_0x3796f4[_0xe754('0x1d')]['name']){_0x4b4172=!![];_0x13ba69=_0x3796f4[_0xe754('0x1d')][_0xe754('0x1e')];}}return ami['Action']({'action':_0xe754('0x1f'),'interface':_0x5d2112,'paused':!![],'reason':_0x13ba69})[_0xe754('0x20')](function(){if(_0x19bc8f[_0xe754('0x6')][_0x5d2112]){return RpcUser[_0xe754('0x21')](_0x19bc8f[_0xe754('0x6')][_0x5d2112]['id'])[_0xe754('0x20')](function(_0x266cd2){if(_0x266cd2&&!_0x266cd2[_0xe754('0x22')]){logger[_0xe754('0x23')](_0xe754('0x24'),_0x3320fa,_0x5d2112,_0x4c2d16);var _0x44086d=_0x19bc8f[_0xe754('0x8')][_0x3320fa][_0xe754('0x25')]&&_0x19bc8f['channels'][_0x3320fa]['destlinkedid']?_0x19bc8f[_0xe754('0x8')][_0x3320fa][_0xe754('0x26')]:_0x3320fa;return RpcUser[_0xe754('0x27')](_0x19bc8f[_0xe754('0x6')][_0x5d2112],_0x13ba69,_0x44086d)['then'](function(){if(!_0x4b4172){_0x19bc8f[_0xe754('0x7')][_0x5d2112]={};logger[_0xe754('0x23')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x3320fa,_0x19bc8f[_0xe754('0x5')][_0x4c2d16][_0xe754('0x28')],_0x5d2112,_0x4c2d16);_0x19bc8f[_0xe754('0x7')][_0x5d2112][_0xe754('0x29')]=setTimeout(_0x19bc8f[_0xe754('0x2a')][_0xe754('0xb')](_0x19bc8f,_0x5d2112),_0x19bc8f[_0xe754('0x5')][_0x4c2d16]['acwTimeout']*0x3e8);_0x19bc8f[_0xe754('0x7')][_0x5d2112][_0xe754('0x2b')]=moment()[_0xe754('0x2c')](_0xe754('0x2d'));_0x19bc8f['timers'][_0x5d2112][_0xe754('0x2e')]=_0x3320fa;_0x19bc8f['timers'][_0x5d2112]['queue']=_0x4c2d16;_0x19bc8f['timers'][_0x5d2112][_0xe754('0x2f')]=function(){var _0x1bfa81=getDiff(_0x19bc8f['timers'][_0x5d2112]['lastPauseAt']);clearTimeout(_0x19bc8f[_0xe754('0x7')][_0x5d2112][_0xe754('0x29')]);_0x19bc8f[_0xe754('0x7')][_0x5d2112]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x1bfa81},_0x19bc8f[_0xe754('0x7')][_0x5d2112][_0xe754('0x2e')],_0x5d2112)[_0xe754('0x20')](function(_0x5740ec){logger[_0xe754('0x23')](_0xe754('0x30'),_0x3320fa,_0x1bfa81,_0x5740ec);})[_0xe754('0x31')](function(_0xe0fd2){logger['error'](_0xe754('0x32'),_0x3320fa,_0xe0fd2);});delete _0x19bc8f[_0xe754('0x7')][_0x5d2112];};}});}else{logger[_0xe754('0x23')](_0xe754('0x33'),_0x3320fa,_0x5d2112,_0x4c2d16);}});}})['catch'](function(){logger[_0xe754('0x34')](_0xe754('0x35'),_0x3320fa,_0x19bc8f[_0xe754('0x5')][_0x4c2d16][_0xe754('0x28')],_0x5d2112,_0x4c2d16);})[_0xe754('0x36')](function(){delete _0x19bc8f[_0xe754('0x8')][_0x3320fa];});}catch(_0x80a06b){logger[_0xe754('0x34')](_0xe754('0x37'),_0x80a06b['message']);}};Acw['prototype'][_0xe754('0x2a')]=function(_0x4df72f){try{var _0x417a6a=this;if(_0x417a6a[_0xe754('0x7')][_0x4df72f]){_0x417a6a[_0xe754('0x7')][_0x4df72f][_0xe754('0x29')]=![];var _0x3930be=_0x417a6a['timers'][_0x4df72f][_0xe754('0x2e')];var _0x39f5c9=_0x417a6a[_0xe754('0x7')][_0x4df72f][_0xe754('0x1a')];var _0x4499cc=_0x417a6a[_0xe754('0x5')][_0x39f5c9][_0xe754('0x28')];logger[_0xe754('0x23')]('[%s][TIMER][STOP][AGENT:%s]',_0x3930be,_0x4df72f);RpcUser[_0xe754('0x38')](this[_0xe754('0x6')][_0x4df72f]);RpcVoiceAgentReport[_0xe754('0x39')]({'acwtime':_0x4499cc,'agentacw':!![]},_0x3930be,_0x4df72f)['then'](function(_0x3dee94){logger[_0xe754('0x23')](_0xe754('0x30'),_0x3930be,_0x4499cc,_0x3dee94);})[_0xe754('0x31')](function(_0x963b31){logger[_0xe754('0x34')](_0xe754('0x32'),_0x3930be,_0x963b31);});}else{logger[_0xe754('0x34')](_0xe754('0x3a'),_0x4df72f);if(_0x417a6a[_0xe754('0x7')]){logger[_0xe754('0x23')]('[ACW][TIMERS]',JSON[_0xe754('0x3b')](_0x417a6a[_0xe754('0x7')]));}}}catch(_0x578d53){logger[_0xe754('0x34')](_0xe754('0x3c'),_0x578d53[_0xe754('0x3d')]);}};Acw[_0xe754('0x18')]['syncAgentConnect']=function(_0xfba5eb){try{if(this['voiceQueues'][_0xfba5eb[_0xe754('0x1a')]]&&(this[_0xe754('0x5')][_0xfba5eb['queue']]['acw']||this[_0xe754('0x5')][_0xfba5eb[_0xe754('0x1a')]][_0xe754('0x1c')])){if(this[_0xe754('0x6')][_0xfba5eb[_0xe754('0x19')]]){this[_0xe754('0x8')][_0xfba5eb[_0xe754('0x2e')]]={'queue':_0xfba5eb['queue'],'interface':_0xfba5eb[_0xe754('0x19')],'destlinkedid':_0xfba5eb[_0xe754('0x26')]};}}}catch(_0x8ed4c6){logger[_0xe754('0x34')]('[ACW][syncAgentConnect]\x20%s',_0x8ed4c6[_0xe754('0x3d')]);}};Acw[_0xe754('0x18')][_0xe754('0x14')]=function(_0x4f7dc3){try{if(this[_0xe754('0x5')][_0x4f7dc3[_0xe754('0x1a')]]&&(this['voiceQueues'][_0x4f7dc3[_0xe754('0x1a')]][_0xe754('0x3')]||this[_0xe754('0x5')][_0x4f7dc3[_0xe754('0x1a')]][_0xe754('0x1c')])){if(this[_0xe754('0x6')][_0x4f7dc3[_0xe754('0x19')]]){this[_0xe754('0x8')][_0x4f7dc3['uniqueid']]={'queue':_0x4f7dc3['queue'],'interface':_0x4f7dc3[_0xe754('0x19')]};}}}catch(_0x383766){logger[_0xe754('0x34')](_0xe754('0x3e'),_0x383766[_0xe754('0x3d')]);}};Acw['prototype'][_0xe754('0x3f')]=function(_0x133c79){try{if(this[_0xe754('0x8')][_0x133c79[_0xe754('0x2e')]]&&_[_0xe754('0x40')](this['channels'][_0x133c79[_0xe754('0x2e')]]['attended'])){logger[_0xe754('0x23')](_0xe754('0x41'),_0x133c79['uniqueid']);this[_0xe754('0x42')](_0x133c79['uniqueid']);}else if(this[_0xe754('0x8')][_0x133c79[_0xe754('0x43')]]&&_['isUndefined'](this[_0xe754('0x8')][_0x133c79[_0xe754('0x43')]]['attended'])){logger[_0xe754('0x23')](_0xe754('0x44'),_0x133c79['linkedid']);this[_0xe754('0x42')](_0x133c79[_0xe754('0x43')]);}}catch(_0x287480){logger['error'](_0xe754('0x45'),_0x287480[_0xe754('0x3d')]);}};Acw['prototype'][_0xe754('0xd')]=function(_0x1ee26a){try{if(this[_0xe754('0x8')][_0x1ee26a[_0xe754('0x2e')]]&&this[_0xe754('0x8')][_0x1ee26a[_0xe754('0x2e')]][_0xe754('0x25')]){logger[_0xe754('0x23')](_0xe754('0x46'),_0x1ee26a[_0xe754('0x2e')]);this[_0xe754('0x42')](_0x1ee26a[_0xe754('0x2e')]);}else if(this[_0xe754('0x8')][_0x1ee26a[_0xe754('0x43')]]&&this['channels'][_0x1ee26a['linkedid']][_0xe754('0x25')]){logger[_0xe754('0x23')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x1ee26a[_0xe754('0x43')]);this[_0xe754('0x42')](_0x1ee26a[_0xe754('0x43')]);}}catch(_0x1a2564){logger['error'](_0xe754('0x47'),_0x1a2564[_0xe754('0x3d')]);}};Acw[_0xe754('0x18')][_0xe754('0x11')]=function(_0xd25426){try{if(!_[_0xe754('0x48')](this[_0xe754('0x8')][_0xd25426[_0xe754('0x49')]])){this[_0xe754('0x42')](_0xd25426[_0xe754('0x49')]);if(this[_0xe754('0x8')][_0xd25426[_0xe754('0x4a')]]){this[_0xe754('0x8')][_0xd25426[_0xe754('0x4a')]][_0xe754('0x25')]=!![];this[_0xe754('0x8')][_0xd25426[_0xe754('0x4b')]]=this[_0xe754('0x8')][_0xd25426['secondtransfereruniqueid']];delete this['channels'][_0xd25426[_0xe754('0x4a')]];}}else if(!_[_0xe754('0x48')](this[_0xe754('0x8')][_0xd25426[_0xe754('0x4b')]])){this[_0xe754('0x42')](_0xd25426['transfertargetuniqueid']);if(this[_0xe754('0x8')][_0xd25426[_0xe754('0x4c')]]){this[_0xe754('0x8')][_0xd25426[_0xe754('0x4c')]][_0xe754('0x25')]=!![];this[_0xe754('0x8')][_0xd25426[_0xe754('0x49')]]=this[_0xe754('0x8')][_0xd25426['origtransfereruniqueid']];delete this[_0xe754('0x8')][_0xd25426['origtransfereruniqueid']];}}}catch(_0x292a54){logger[_0xe754('0x34')]('[ACW][syncAttendedTransfer]\x20%s',_0x292a54[_0xe754('0x3d')]);}};Acw[_0xe754('0x18')][_0xe754('0x13')]=function(_0x50d858){try{if(this[_0xe754('0x8')][_0x50d858[_0xe754('0x4d')]]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x50d858['transfereruniqueid']));this[_0xe754('0x42')](_0x50d858[_0xe754('0x4d')]);}else if(this['channels'][_0x50d858['transfererlinkedid']]){logger[_0xe754('0x23')](_0xe754('0x4e'),JSON['stringify'](_0x50d858['transfererlinkedid']));this[_0xe754('0x42')](_0x50d858[_0xe754('0x4f')]);}}catch(_0x461e58){logger[_0xe754('0x34')](_0xe754('0x50'),_0x461e58[_0xe754('0x3d')]);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x5cddb0){try{if(this[_0xe754('0x5')][_0x5cddb0[_0xe754('0x1a')]]&&this[_0xe754('0x5')][_0x5cddb0['queue']][_0xe754('0x51')]==='all'){if(this[_0xe754('0x6')][_0x5cddb0[_0xe754('0x19')]]){logger[_0xe754('0x23')](_0xe754('0x52'),_0x5cddb0[_0xe754('0x2e')],_0x5cddb0[_0xe754('0x19')],_0x5cddb0['queue']);return RpcUser['savePause'](this[_0xe754('0x6')][_0x5cddb0[_0xe754('0x19')]],_0xe754('0x53'),_0x5cddb0[_0xe754('0x2e')]);}}}catch(_0x26b35a){logger[_0xe754('0x34')](_0xe754('0x54'),_0x26b35a['message']);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 67ed66b..a525c1d 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 _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 +var _0x6843=['promisify','action','error','format','inspect','actionSipShowRegistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','once','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipPeerStatus','actionCoreShowChannels','catch','[ami.js][fullybooted]','close','exports','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','port','username','password','keepConnected','Action'];(function(_0x2cac05,_0x3c6cdf){var _0x2ea2ef=function(_0x1ff15a){while(--_0x1ff15a){_0x2cac05['push'](_0x2cac05['shift']());}};_0x2ea2ef(++_0x3c6cdf);}(_0x6843,0x14a));var _0x3684=function(_0x3d9330,_0x27955d){_0x3d9330=_0x3d9330-0x0;var _0x200eba=_0x6843[_0x3d9330];return _0x200eba;};'use strict';var Manager=require(_0x3684('0x0'));var BPromise=require(_0x3684('0x1'));var util=require(_0x3684('0x2'));var logger=require(_0x3684('0x3'))(_0x3684('0x4'));var config=require(_0x3684('0x5'));var ami=new Manager(config[_0x3684('0x6')][_0x3684('0x7')],config[_0x3684('0x6')]['ip'],config[_0x3684('0x6')][_0x3684('0x8')],config['asterisk'][_0x3684('0x9')],!![]);ami[_0x3684('0xa')]();ami[_0x3684('0xb')]=BPromise[_0x3684('0xc')](ami[_0x3684('0xd')]);function error(_0x2b9a87){logger[_0x3684('0xe')](util[_0x3684('0xf')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0x3684('0x8')],config['asterisk']['ip'],config[_0x3684('0x6')][_0x3684('0x7')],util[_0x3684('0x10')](_0x2b9a87,![],null)));}function close(){logger['error'](util[_0x3684('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x3684('0x6')]['username'],config[_0x3684('0x6')]['ip'],config[_0x3684('0x6')][_0x3684('0x7')]));}ami[_0x3684('0x11')]=function(){return function(){return ami[_0x3684('0xb')]({'action':'sipshowregistry'});};};ami[_0x3684('0x12')]=function(){return function(){return ami[_0x3684('0xb')]({'action':_0x3684('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x3684('0xb')]({'action':_0x3684('0x14')});};};ami[_0x3684('0x15')]=function(){return function(){return ami['Action']({'action':_0x3684('0x16')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x3684('0xb')]({'action':_0x3684('0x17')});};};function connect(){logger[_0x3684('0x18')](util[_0x3684('0xf')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config['asterisk']['username'],config[_0x3684('0x6')]['ip'],config['asterisk'][_0x3684('0x7')]));ami[_0x3684('0x19')](_0x3684('0xe'),error);ami[_0x3684('0x19')]('close',close);}ami['on'](_0x3684('0x1a'),connect);ami['on']('shutdown',function(_0x4f29d1){logger[_0x3684('0x18')](util[_0x3684('0xf')](_0x3684('0x1b'),config[_0x3684('0x6')]['username'],config[_0x3684('0x6')]['ip'],config['asterisk'][_0x3684('0x7')],util['inspect'](_0x4f29d1,![],null)));});ami['on'](_0x3684('0x1c'),function(){logger[_0x3684('0x18')](util[_0x3684('0xf')](_0x3684('0x1d'),config[_0x3684('0x6')]['username'],config[_0x3684('0x6')]['ip'],config[_0x3684('0x6')][_0x3684('0x7')]));return Promise[_0x3684('0x1e')]()['then'](ami[_0x3684('0x11')]())[_0x3684('0x1f')](ami[_0x3684('0x12')]())[_0x3684('0x1f')](ami[_0x3684('0x20')]())[_0x3684('0x1f')](ami[_0x3684('0x15')]())[_0x3684('0x1f')](ami[_0x3684('0x21')]())[_0x3684('0x22')](function(_0x4b73f5){logger['error'](_0x3684('0x23'),util[_0x3684('0x10')](_0x4b73f5,{'showHidden':![],'depth':null}));});});ami[_0x3684('0x19')](_0x3684('0xe'),error);ami[_0x3684('0x19')](_0x3684('0x24'),close);module[_0x3684('0x25')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 33b80f4..611639a 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 _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 +var _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0x3b7b8a,_0x52c3b0){var _0x441206=function(_0x5d34d3){while(--_0x5d34d3){_0x3b7b8a['push'](_0x3b7b8a['shift']());}};_0x441206(++_0x52c3b0);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5d97ec,_0x5649cf){_0x5d97ec=_0x5d97ec-0x0;var _0x3f3c5e=_0x9bde[_0x5d97ec];return _0x3f3c5e;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var client=jayson['client'][_0xe9bd('0x2')]({'port':0x2329});client[_0xe9bd('0x3')]=function(_0x131f6a,_0x1c1b34){return new BPromise(function(_0x10822d,_0x1a4d14){return client[_0xe9bd('0x4')](_0x131f6a,_0x1c1b34)['then'](function(_0x4763e9){logger[_0xe9bd('0x5')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x1c1b34,_0x4763e9);if(_0x4763e9[_0xe9bd('0x8')]){logger[_0xe9bd('0x8')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x4763e9[_0xe9bd('0x8')][_0xe9bd('0x9')],_0x1c1b34);return _0x1a4d14(_0x4763e9['error']['message']);}else{return _0x10822d(_0x4763e9[_0xe9bd('0xa')]);}})[_0xe9bd('0xb')](function(_0x2601ac){logger['error'](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x2601ac,_0x1c1b34);return _0x1a4d14(_0x2601ac);});});};module[_0xe9bd('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index b3cadb0..9e3b648 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 _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 +var _0x3615=['content','indexOf','true','catch','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','checkIsTrunkReachable','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','predictive','Queue','method\x20not\x20recognized','dialGlobalInterval','silly','Dialer::ifTime()','intervalIftime','Global:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueId','answertime','YYYY-MM-DD\x20HH:mm:ss','uniqueid','outboundAnswerCallsDay','reason','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','ivr','updateOriginated','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','statedesc','dropreason','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','rescheduleContact','add','ContactId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','dialAbandonedRetryFrequency','countabandonedretry','dialAbandonedMaxRetry','queueCallerAbandonCreateState','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','actions','channel','syncQueueMember','actionid','strategy','roundrobin','isNil','locked','paused','stateinterface','idHopper','syncQueueStatusComplete','rrmemory','preview','run','[Catch][Preview][syncQueueStatusComplete]','ListId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','getQueue','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','AMD','emit','custom:amd','amd','[syncHangupInAMD]','MACHINE','Machine','membername','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','[rescheduleContact][Machine]','dialAMDActive','value','buildObj','saveInDb','[syncHangupInAMDIvr]','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','outboundUnknownCallsDay','cause-txt','Unknow','queuesSummary','running','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','ACTIVE','[syncQueueSummary]','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','handleIvr','actionOriginate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','dialQueueOptions','dialAgiAfterHangupAgent','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','createdAt','updatedAt','%s%s','XMD-','toUpper','isTrunkReachable','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','originate','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','verifyAdditionalPhones','outboundNoSuchCallsDay','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','avgHandleTime','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAvgTalktime','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalHitRate','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','floor','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','voicePause','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','temp','maxNumberOriginate','getContactDialerIvr','dialOrderByScheduledAt','RUNNING','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','checkContactEmpty','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','checkContactLowerLimitOriginate','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts\x20=\x20','[abandonmentRate]','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]','m\x20=\x20','p\x20=\x20','exports','util','uuid','moment','ioredis','./utils/hopper','../../../config/environment/','../../../config/logger','dialer','booked','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','varset','syncVarSet','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','isUndefined','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','info','predictiveIntervalTotalCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','History\x20information\x20are\x20empty','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','merge','getSeconds','startProgressive','startProgressive\x20value\x20cleared','startPredictive','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','endtime','starttime','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','Intervals','\x20INTERVAL_IS_NULL','isEmpty','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','sendMessageOneNotActive','DISACTIVED','[ifTime][Action]','Error','SIP/%s','reachable','status','unmonitored','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','checkIfTime','checkIfTimeIntervals','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','isArray','length','push','Action','command','iftime\x20%s,%s','interval'];(function(_0x3b96c5,_0x407a7b){var _0x367426=function(_0x4b187b){while(--_0x4b187b){_0x3b96c5['push'](_0x3b96c5['shift']());}};_0x367426(++_0x407a7b);}(_0x3615,0x18a));var _0x5361=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x3615[_0x1035c1];return _0x308d67;};'use strict';var util=require(_0x5361('0x0'));var _=require('lodash');var uuid=require(_0x5361('0x1'));var moment=require(_0x5361('0x2'));var rr=require('rr');var Redis=require(_0x5361('0x3'));var utils=require('./utils');var hopperUtils=require(_0x5361('0x4'));var ut=require('../preview/util/util');var config=require(_0x5361('0x5'));var logger=require(_0x5361('0x6'))(_0x5361('0x7'));var loggerBooked=require(_0x5361('0x6'))(_0x5361('0x8'));var loggerPredictive=require(_0x5361('0x6'))('predictive');var loggerPredictiveCalls=require(_0x5361('0x6'))('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require('../ami');config[_0x5361('0x9')]=_['defaults'](config[_0x5361('0x9')],{'host':_0x5361('0xa'),'port':0x18eb});var io=require(_0x5361('0xb'))(new Redis(config['redis']));var cmHopper=require(_0x5361('0xc'));var voiceQueueRt=require(_0x5361('0xd'));var RpcSetting=require(_0x5361('0xe'));var Interval=require(_0x5361('0xf'));var Action=require(_0x5361('0x10'));var History=require('./models/history');var Final=require('./models/final');var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0x5361('0x11'));var Hangup=require(_0x5361('0x12'));var ipAgi=process[_0x5361('0x13')][_0x5361('0x14')]||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x5361('0x15')][_0x5361('0x16')]=function(_0x43704f){this[_0x5361('0x17')]=this['tail']?this[_0x5361('0x17')][_0x5361('0x18')](_0x43704f):_0x43704f();};function Dialer(_0x4d149c,_0x16103f){this[_0x5361('0x19')]=new Sequence();this['preview']=_0x16103f;this[_0x5361('0x1a')]=_0x4d149c[_0x5361('0x1a')];this['campaigns']=_0x4d149c[_0x5361('0x1b')];this[_0x5361('0x1c')]=_0x4d149c[_0x5361('0x1c')];this[_0x5361('0x1d')]=_0x4d149c[_0x5361('0x1d')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this['channels']={};this['actions']={};this['contactsId']={};this['uniqueId']={};this['optionPredictive']={};this['startPredictive']={};this['startProgressive']={};this['ivrOriginated']={};this[_0x5361('0x1e')]={};this[_0x5361('0x1f')]={};this['queuesSummary']={};ami['on'](_0x5361('0x20'),this[_0x5361('0x21')][_0x5361('0x22')](this));ami['on']('queuecallerabandon',this[_0x5361('0x23')][_0x5361('0x22')](this));ami['on'](_0x5361('0x24'),this[_0x5361('0x25')]['bind'](this));ami['on']('agentcomplete',this[_0x5361('0x26')]['bind'](this));ami['on'](_0x5361('0x27'),this[_0x5361('0x28')][_0x5361('0x22')](this));ami['on'](_0x5361('0x29'),this[_0x5361('0x2a')][_0x5361('0x22')](this));ami['on']('hangup',this[_0x5361('0x2b')][_0x5361('0x22')](this));ami['on'](_0x5361('0x2c'),this['syncNewExten'][_0x5361('0x22')](this));ami['on'](_0x5361('0x2d'),this[_0x5361('0x2e')][_0x5361('0x22')](this));ami['on']('queuemember',this['syncQueueMember'][_0x5361('0x22')](this));ami['on'](_0x5361('0x2f'),this['syncQueueStatusComplete']['bind'](this));this[_0x5361('0x30')]();this[_0x5361('0x31')]();RpcSetting[_0x5361('0x32')]()[_0x5361('0x33')](function(_0x8e92a8){previewRecallmeReminderInterval=_0x8e92a8['previewRecallmeReminderInterval'];});}function isNotNull(_0x1e0f5a){return _0x1e0f5a!==null&&!_[_0x5361('0x34')](_0x1e0f5a);}function msgResponse(_0x2b5910,_0x299980,_0x24c742){return{'action':_0x2b5910,'response':_0x299980,'message':_0x24c742,'stack':_0x24c742};}function emit(_0x5c231b,_0xf5f702,_0x4f138d){io['to'](_0x5c231b)['emit'](_0xf5f702,_0x4f138d);}function emitOutboundVoiceQueueSummary(_0x158198){if(_0x158198[_0x5361('0x35')]===_0x5361('0x36')){logger[_0x5361('0x37')](_0x5361('0x38'),util[_0x5361('0x39')](_0x158198,{'showHidden':![],'depth':null}));emit(util[_0x5361('0x3a')](_0x5361('0x3b'),_0x158198[_0x5361('0x3c')]),'voice_queue:save',_0x158198);}}function checkGetDataPredictive(_0x36604e){if(isNotNull(_0x36604e)&&!_['isEmpty'](_0x36604e)){loggerPredictive[_0x5361('0x3d')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x5361('0x3d')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x36604e[_0x5361('0x3e')]);loggerPredictive[_0x5361('0x3d')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x36604e['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x5361('0x3d')](_0x5361('0x3f'),_0x36604e[_0x5361('0x40')]);loggerPredictive[_0x5361('0x3d')](_0x5361('0x41'),_0x36604e['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x5361('0x3d')](_0x5361('0x42'),_0x36604e['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x5361('0x3d')](_0x5361('0x43'),_0x36604e['predictiveIntervalAvgTalktime']);loggerPredictive[_0x5361('0x3d')](_0x5361('0x44'));if(_0x36604e['predictiveIntervalTotalCalls']>0x0){if(!_[_0x5361('0x34')](_0x36604e['predictiveIntervalAvgTalktime'])&&_0x36604e['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x5361('0x3d')](_0x5361('0x45'));if(!_['isUndefined'](_0x36604e[_0x5361('0x46')])&&_0x36604e[_0x5361('0x46')]>0x0){return!![];}loggerPredictive[_0x5361('0x3d')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x5361('0x3d')](_0x5361('0x47'));}return![];}function mergeDataErlangB(_0x31d82d){return function(_0x215683){loggerPredictive[_0x5361('0x3d')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x5361('0x3d')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x215683[_0x5361('0x48')]);loggerPredictive['info'](_0x5361('0x49'),_0x215683['erlangCallToSecond']);loggerPredictive[_0x5361('0x3d')](_0x5361('0x4a'),_0x215683['erlangAbandonmentRate']);loggerPredictive[_0x5361('0x3d')](_0x5361('0x4b'),_0x215683['erlangBusyFactor']);loggerPredictive[_0x5361('0x3d')](_0x5361('0x4a'),_0x215683[_0x5361('0x4c')]);loggerPredictive[_0x5361('0x3d')](_0x5361('0x44'));_[_0x5361('0x4d')](_0x31d82d,_0x215683);};}function ifInterval(_0x2a0990,_0x3f89e9){if(_[_0x5361('0x34')](_0x3f89e9)){return![];}return utils[_0x5361('0x4e')](undefined,_0x3f89e9)<_0x2a0990*0x3c;}function clearPredictiveAttributes(_0x4b3a9b){if(_0x4b3a9b[_0x5361('0x4f')]){_0x4b3a9b[_0x5361('0x4f')]=undefined;loggerPredictive['debug'](_0x4b3a9b[_0x5361('0x3c')],_0x5361('0x50'));}if(_0x4b3a9b[_0x5361('0x51')]){_0x4b3a9b[_0x5361('0x51')]=undefined;loggerPredictive[_0x5361('0x37')](_0x4b3a9b[_0x5361('0x3c')],'startPredictive\x20value\x20cleared');}if(_0x4b3a9b[_0x5361('0x52')]){clearInterval(_0x4b3a9b[_0x5361('0x52')]);_0x4b3a9b['handlePredictive']=undefined;loggerPredictive[_0x5361('0x37')](_0x4b3a9b[_0x5361('0x3c')],_0x5361('0x53'));}}function loggerCatchPredictive(_0x433f96,_0x1f5b47){return function(_0x5934ed){loggerPredictive[_0x5361('0x54')](_0x1f5b47['name'],_0x433f96);loggerPredictive[_0x5361('0x54')](_0x5934ed[_0x5361('0x55')]);clearPredictiveAttributes(_0x1f5b47);};}function loggerCatch(_0x1eb932){return function(_0x356e7f){logger[_0x5361('0x54')](_0x1eb932,util['inspect'](_0x356e7f,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x497da4,_0x39401f,_0x5b4f85){return function(_0x553e66){utils['checkContactLowerLimitOriginate'](_0x39401f,_0x5b4f85,0x0);logger[_0x5361('0x54')](_0x497da4,util[_0x5361('0x39')](_0x553e66,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2da17f){return function(_0x5222ac){if(isNotNull(_0x5222ac)&&isNotNull(_0x5222ac[0x0])){if(_0x5222ac[0x0][_0x5361('0x56')]>0x0){_0x2da17f[_0x5361('0x57')]=utils[_0x5361('0x58')][_0x5361('0x59')];logger[_0x5361('0x3d')](_0x5361('0x5a')+_0x2da17f[_0x5361('0x3c')],_0x5222ac[0x0][_0x5361('0x56')],'contacts');}else{_0x2da17f[_0x5361('0x57')]=utils[_0x5361('0x58')][_0x5361('0x5b')];logger[_0x5361('0x3d')](_0x5361('0x5c')+_0x2da17f['name']);}}};}function createObjHistory(_0xa9cb55,_0x408a70,_0x5b1db8,_0x22a373,_0x2cf52c){_0xa9cb55['message']=_0x5b1db8;var _0xa762f9=new Action(_0xa9cb55,_0x408a70);var _0x45c6bf=new History(_0xa762f9);_0x45c6bf[_0x5361('0x5d')]=_0x22a373;_0x45c6bf['statedesc']=_0x2cf52c;_0x45c6bf[_0x5361('0x5e')]=_0xa762f9[_0x5361('0x5f')];return _0x45c6bf;}function unlockQueueStatus(_0x2e5d73,_0x50d4e5){setTimeout(function(){if(_[_0x5361('0x34')](_0x2e5d73[_0x5361('0x60')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x50d4e5);}_0x2e5d73['queueStatusComplete']=!![];loggerBooked[_0x5361('0x3d')](_0x5361('0x61'),_0x50d4e5,JSON[_0x5361('0x62')](_[_0x5361('0x63')](_0x2e5d73,[_0x5361('0x3c'),_0x5361('0x60')])));},0x1f3);}function checkInterval(_0xabef8d){return function(){if(!isNotNull(_0xabef8d[_0x5361('0x64')])){_0xabef8d[_0x5361('0x57')]=utils['CAMPAIGN_STATUS'][_0x5361('0x65')];throw _0xabef8d[_0x5361('0x3c')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0xabef8d[_0x5361('0x64')][_0x5361('0x66')])){_0xabef8d['message']=utils['CAMPAIGN_STATUS'][_0x5361('0x65')];throw _0xabef8d[_0x5361('0x3c')]+_0x5361('0x67');}if(!isNotNull(_[_0x5361('0x68')](_0xabef8d[_0x5361('0x64')]['Intervals']))){_0xabef8d[_0x5361('0x57')]=utils[_0x5361('0x58')]['NULL_INTERVAL'];throw _0xabef8d['name']+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x54bc24){return function(){if(!utils[_0x5361('0x69')](_0x54bc24)){_0x54bc24['message']=utils[_0x5361('0x58')][_0x5361('0x6a')];throw _0x54bc24['name']+_0x5361('0x6b');}};}function emitCampaignSummary(_0x1ac741){if(utils[_0x5361('0x6c')](_0x1ac741)){emit(util[_0x5361('0x3a')]('campaign:ivr:%s',_0x1ac741[_0x5361('0x3c')]),'campaign:save',_0x1ac741);}}function loggerCatchQueueSummary(_0x1272e2,_0x4b0ea6){return function(_0xb1bffc){clearPredictiveAttributes(_0x4b0ea6);emitCampaignSummary(_0x4b0ea6);loggerSyncQueueSummary[_0x5361('0x37')](_0x1272e2,util[_0x5361('0x39')](_0xb1bffc,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x15f195){if(_0x15f195['sendMessageOneNotActive']){if(_0x15f195['originated']===0x0){_0x15f195[_0x5361('0x6d')]=![];_0x15f195[_0x5361('0x57')]=utils[_0x5361('0x58')][_0x5361('0x6a')];loggerSyncQueueSummary[_0x5361('0x37')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x15f195[_0x5361('0x3c')],'is\x20not\x20active');}else{_0x15f195[_0x5361('0x57')]=utils['CAMPAIGN_STATUS'][_0x5361('0x6e')];loggerSyncQueueSummary[_0x5361('0x37')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x15f195[_0x5361('0x3c')],'is\x20disactive');}emitCampaignSummary(_0x15f195);}}function myreject(_0x1e711e){return function(_0x49ff48){return _0x1e711e(msgResponse(_0x5361('0x6f'),_0x5361('0x70'),JSON[_0x5361('0x62')](_0x49ff48)));};}Dialer[_0x5361('0x15')]['isTrunkReachable']=function(_0x2b7b46){return!_[_0x5361('0x34')](_0x2b7b46)&&_0x2b7b46&&!_[_0x5361('0x34')](_0x2b7b46[_0x5361('0x3c')])&&!_[_0x5361('0x34')](_0x2b7b46['active'])&&_0x2b7b46['active']&&(this[_0x5361('0x1d')][util[_0x5361('0x3a')](_0x5361('0x71'),_0x2b7b46['name'])]['status']===_0x5361('0x72')||this['trunks'][util[_0x5361('0x3a')]('SIP/%s',_0x2b7b46[_0x5361('0x3c')])][_0x5361('0x73')]===_0x5361('0x74'));};Dialer[_0x5361('0x15')]['checkIsTrunkReachable']=function(_0x35f5c4){var _0x31004a=this;return function(){if(!_0x31004a['isTrunkReachable'](_0x35f5c4[_0x5361('0x75')])){if(!_0x31004a['isTrunkReachable'](_0x35f5c4[_0x5361('0x76')])){_0x35f5c4[_0x5361('0x57')]=utils[_0x5361('0x58')][_0x5361('0x77')];throw _0x35f5c4['name']+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer['prototype'][_0x5361('0x78')]=function(_0x2b7162,_0x433c59,_0x2061c0,_0x3364db){var _0x4d422d=this;return function(){var _0x464167=!![];return _0x4d422d['ifTimeIvr'](_0x2b7162,_0x433c59,_0x2061c0,_0x3364db,_0x464167);};};Dialer[_0x5361('0x15')][_0x5361('0x79')]=function(_0x1f5aa2,_0x1e51fa,_0x1062e8,_0x2c2295){var _0x597766=this;return function(){var _0x4ca275=![];return _0x597766['ifTimeIvr'](_0x1f5aa2[_0x5361('0x66')],_0x1e51fa,_0x1062e8,_0x2c2295,_0x4ca275);};};Dialer[_0x5361('0x15')][_0x5361('0x7a')]=function(_0x375b3e,_0x4df03e,_0x3c4ff6,_0x1c5eaa,_0x225dd5){var _0x104264=[];return new Promise(function(_0x4996f6,_0x2d688d){if(!isNotNull(_0x375b3e)){_0x1c5eaa['message']=utils[_0x5361('0x58')][_0x5361('0x65')];return _0x2d688d(msgResponse(_0x5361('0x7b'),_0x5361('0x7c'),_0x3c4ff6+_0x5361('0x7d')));}if(_[_0x5361('0x68')](_0x375b3e)){_0x1c5eaa['message']=utils['CAMPAIGN_STATUS'][_0x5361('0x7e')];return _0x2d688d(msgResponse(_0x5361('0x7b'),_0x5361('0x7c'),_0x3c4ff6+_0x5361('0x7f')));}if(_0x4df03e&&_[_0x5361('0x34')](config[_0x5361('0x80')][_0x4df03e])){_0x1c5eaa['message']=utils['CAMPAIGN_STATUS'][_0x5361('0x81')];return _0x2d688d(msgResponse(_0x5361('0x7b'),_0x5361('0x7c'),_0x3c4ff6+'\x20Timezone\x20unknow\x20'+_0x4df03e));}if(_[_0x5361('0x82')](_0x375b3e)){for(var _0xcf300f=0x0;_0xcf300f<_0x375b3e[_0x5361('0x83')];_0xcf300f+=0x1){_0x104264[_0x5361('0x84')](ami[_0x5361('0x85')]({'action':_0x5361('0x86'),'command':util[_0x5361('0x3a')](_0x5361('0x87'),_0x375b3e[_0xcf300f][_0x5361('0x88')],!_['isUndefined'](config[_0x5361('0x80')][_0x4df03e])?_0x4df03e:'')})[_0x5361('0x33')](function(_0x1f02e7){return _0x1f02e7[_0x5361('0x89')][_0x5361('0x8a')](_0x5361('0x8b'))>=0x0;})[_0x5361('0x8c')](myreject(_0x2d688d)));}}else{_0x104264[_0x5361('0x84')](ami[_0x5361('0x85')]({'action':_0x5361('0x86'),'command':util['format'](_0x5361('0x87'),_0x375b3e,!_[_0x5361('0x34')](config['timezones'][_0x4df03e])?_0x4df03e:'')})['then'](function(_0x5a9126){return _0x5a9126[_0x5361('0x89')][_0x5361('0x8a')]('true')>=0x0;})[_0x5361('0x8c')](myreject(_0x2d688d)));}Promise['all'](_0x104264)[_0x5361('0x33')](function(_0x119678){var _0x46ed71=_[_0x5361('0x8d')](_0x119678);if(_0x46ed71){return _0x4996f6(_0x46ed71);}else{_0x1c5eaa[_0x5361('0x57')]=_0x225dd5?utils[_0x5361('0x58')][_0x5361('0x8e')]:utils[_0x5361('0x58')][_0x5361('0x8f')];return _0x2d688d(msgResponse(_0x5361('0x90'),'Failure','Global:\x20'+_0x225dd5+'\x20'+_0x3c4ff6+'\x20Interval\x20is\x20overtime:\x20'+util[_0x5361('0x39')](_0x375b3e,{'showHidden':![],'depth':null})+_0x5361('0x91')+_0x4df03e));}})[_0x5361('0x8c')](function(_0x3c1cbc){return _0x2d688d(msgResponse(_0x5361('0x7b'),_0x5361('0x7c'),JSON['stringify'](_0x3c1cbc)));});});};Dialer['prototype'][_0x5361('0x30')]=function(){var _0x119b52=this;return cmHopper[_0x5361('0x92')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x119b52[_0x5361('0x93')]();},0x3e8);});};Dialer['prototype'][_0x5361('0x93')]=function(){var _0x1d8198=this;var _0x32c71e;for(var _0x2ef793 in this[_0x5361('0x1b')]){if(typeof this[_0x5361('0x1b')][_0x2ef793]!==_0x5361('0x94')){_0x32c71e=this['campaigns'][_0x2ef793];if(utils['isIVRCampaign'](_0x32c71e)&&utils[_0x5361('0x69')](_0x32c71e)){_0x32c71e[_0x5361('0x6d')]=!![];Promise[_0x5361('0x95')]()[_0x5361('0x33')](checkIsIVRCampaignActive(_0x32c71e))[_0x5361('0x33')](checkInterval(_0x32c71e))['then'](_0x1d8198[_0x5361('0x96')](_0x32c71e))[_0x5361('0x33')](_0x1d8198[_0x5361('0x78')](_0x32c71e['dialGlobalInterval'],_0x32c71e[_0x5361('0x97')],_0x32c71e[_0x5361('0x3c')],_0x32c71e))[_0x5361('0x33')](_0x1d8198['checkIfTimeIntervals'](_0x32c71e[_0x5361('0x64')],_0x32c71e['dialTimezone'],_0x32c71e[_0x5361('0x3c')],_0x32c71e))[_0x5361('0x33')](_0x1d8198[_0x5361('0x98')](_0x32c71e))[_0x5361('0x8c')](loggerCatchQueueSummary(_0x5361('0x99'),_0x32c71e));}else{notSendMessagesCampaign(_0x32c71e);}}}};Dialer[_0x5361('0x15')][_0x5361('0x9a')]=function(_0x696f3b){if(_0x696f3b[_0x5361('0x9b')]!=='predictive'){clearPredictiveAttributes(_0x696f3b);}switch(_0x696f3b['dialMethod']){case _0x5361('0x9c'):this[_0x5361('0x9d')](_0x696f3b,0x1);break;case _0x5361('0x9e'):this[_0x5361('0x9d')](_0x696f3b,_0x696f3b['dialPowerLevel']);break;case'predictive':this[_0x5361('0x9f')](_0x696f3b);break;case _0x5361('0x8'):this['handlePower'](_0x696f3b,0x1);break;default:logger[_0x5361('0x54')](_0x5361('0xa0'),_0x696f3b['name'],_0x5361('0xa1'));}};Dialer[_0x5361('0x15')][_0x5361('0x7b')]=function(_0x33a14a,_0x42edbb){var _0x1eb962=_0x33a14a[_0x5361('0x97')];var _0xf13b02=_0x42edbb?_0x33a14a[_0x5361('0xa2')]:_0x33a14a[_0x5361('0x64')][_0x5361('0x66')];logger[_0x5361('0xa3')](_0x5361('0xa4'),_0xf13b02,_0x1eb962,_0x33a14a['name'],util['format']('Voice\x20Queue\x20%s\x20$s',_0x33a14a['name'],_0x33a14a['id']));var _0x110c72=null;return Interval[_0x5361('0xa5')](_0xf13b02,_0x1eb962)[_0x5361('0x33')](function(_0x55530e){if(_0x55530e===!![]){return _0x55530e;}else{_0x33a14a[_0x5361('0x57')]=_0x42edbb?utils[_0x5361('0x58')][_0x5361('0x8e')]:utils['CAMPAIGN_STATUS']['OVERTIME_INTERVAL'];_0x110c72=msgResponse(_0x5361('0x90'),'Failure',_0x5361('0xa6')+_0x42edbb+'\x20'+_0x33a14a[_0x5361('0x3c')]+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0xf13b02,{'showHidden':![],'depth':null})+_0x5361('0x91')+_0x1eb962);}if(_0x110c72!==null){logger[_0x5361('0xa3')](_0x5361('0xa7'),_0x110c72);_0x110c72[_0x5361('0xa8')]=_0x42edbb;throw _0x110c72;}})[_0x5361('0x8c')](function(_0x1ff4c1){logger['error'](_0x5361('0xa9'),_0x1ff4c1);throw msgResponse('[ifTime][Action]',_0x5361('0x70'),util[_0x5361('0x39')](_0x1ff4c1,{'showHidden':![],'depth':null}));});};Dialer[_0x5361('0x15')][_0x5361('0x21')]=function(_0x41004d){if(this[_0x5361('0x1a')][_0x41004d[_0x5361('0xaa')]]){if(this['uniqueId'][_0x41004d['uniqueid']]&&this[_0x5361('0xab')][_0x41004d['uniqueid']][_0x5361('0x35')]!=='ivr'){this['updateOriginated'](this[_0x5361('0x1a')][_0x41004d[_0x5361('0xaa')]]);this[_0x5361('0xab')][_0x41004d['uniqueid']][_0x5361('0xac')]=moment()[_0x5361('0x3a')](_0x5361('0xad'));}}};Dialer[_0x5361('0x15')][_0x5361('0x26')]=function(_0x2d2089){var _0x52c139=this[_0x5361('0xab')][_0x2d2089[_0x5361('0xae')]];if(this[_0x5361('0x1a')][_0x2d2089[_0x5361('0xaa')]]){if(_0x52c139&&_0x52c139[_0x5361('0x35')]!=='ivr'){delete this[_0x5361('0xab')][_0x2d2089[_0x5361('0xae')]];this[_0x5361('0x1a')][_0x2d2089[_0x5361('0xaa')]][_0x5361('0xaf')]+=0x1;var _0x512b3a=new AgentComplete(_0x52c139,_0x2d2089);if(_0x2d2089[_0x5361('0xb0')]==='agent'){_0x512b3a[_0x5361('0xb1')]=this['voiceQueues'][_0x2d2089[_0x5361('0xaa')]][_0x5361('0xb2')]&&this[_0x5361('0x1a')][_0x2d2089['queue']]['dialAgiAfterHangupAgent']?moment()[_0x5361('0x3a')](_0x5361('0xad')):undefined;}hopperUtils['createHistory'](_0x512b3a)['catch'](loggerCatch(_0x5361('0xb3')));hopperUtils[_0x5361('0xb4')](_0x512b3a)['catch'](loggerCatch(_0x5361('0xb5')));}}};Dialer[_0x5361('0x15')][_0x5361('0x23')]=function(_0xb29c18){var _0x593aee=this[_0x5361('0xab')][_0xb29c18[_0x5361('0xae')]];var _0xdda976=this;var _0x1a877c=![];var _0x24eb21;var _0x12844b;if(this[_0x5361('0x1a')][_0xb29c18[_0x5361('0xaa')]]){if(_0x593aee&&_0x593aee[_0x5361('0x35')]!==_0x5361('0xb6')){delete this['uniqueId'][_0xb29c18[_0x5361('0xae')]];this[_0x5361('0xb7')](this[_0x5361('0x1a')][_0xb29c18[_0x5361('0xaa')]]);_0x593aee[_0x5361('0xb8')]=moment()['format'](_0x5361('0xad'));var _0xcc554a=new QueueCallerAbandon(_0x593aee,_0xb29c18);if(utils[_0x5361('0x4e')](_0x593aee[_0x5361('0xb8')],_0x593aee[_0x5361('0xb9')])>=_0x593aee[_0x5361('0xba')]){this[_0x5361('0x1a')][_0xb29c18[_0x5361('0xaa')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x5361('0x1a')][_0xb29c18[_0x5361('0xaa')]][_0x5361('0xbb')]+=0x1;this[_0x5361('0x1a')][_0xb29c18[_0x5361('0xaa')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0xcc554a[_0x5361('0x5d')]=0xa;_0xcc554a[_0x5361('0xbc')]='Drop';_0xcc554a[_0x5361('0xbd')]='TIMEOUT';_0xcc554a[_0x5361('0xb1')]=this['voiceQueues'][_0xb29c18['queue']][_0x5361('0xb2')]?moment()[_0x5361('0x3a')](_0x5361('0xad')):undefined;_0xcc554a[_0x5361('0xbe')]+=0x1;_0xcc554a[_0x5361('0xbf')]+=0x1;_0x24eb21=this[_0x5361('0x1a')][_0xb29c18['queue']][_0x5361('0xc0')];_0x12844b=this[_0x5361('0x1a')][_0xb29c18[_0x5361('0xaa')]][_0x5361('0xc1')];hopperUtils['verifyAdditionalPhones'](_0xcc554a,_0xcc554a['state'],_0x593aee[_0x5361('0xc2')])[_0x5361('0x33')](function(_0x198773){_0x1a877c=_0x198773[_0x5361('0xc3')]==0x1;if(_0xcc554a[_0x5361('0xbe')]>=_0xdda976[_0x5361('0x1a')][_0xb29c18[_0x5361('0xaa')]][_0x5361('0xc4')]){_0xdda976['queueCallerAbandonCreateState'](_0xcc554a,_0x198773[_0x5361('0xc3')]);}else{hopperUtils[_0x5361('0xc5')]({'active':![],'countdropretry':_0xcc554a[_0x5361('0xbe')],'scheduledat':moment()[_0x5361('0xc6')](_0xdda976['voiceQueues'][_0xb29c18[_0x5361('0xaa')]][_0x5361('0xc0')],'minutes')[_0x5361('0x3a')](_0x5361('0xad')),'ContactId':_0x593aee[_0x5361('0xc7')],'ListId':_0x593aee['ListId'],'VoiceQueueId':_0x593aee[_0x5361('0xc8')]||undefined,'CampaignId':_0x593aee[_0x5361('0xc9')]||undefined})[_0x5361('0x8c')](loggerCatch(_0x5361('0xca')));var _0x27da63=new History(_0xcc554a);_0x27da63[_0x5361('0x5d')]=0xa;_0x27da63[_0x5361('0xbc')]=_0x5361('0xcb');_0x27da63[_0x5361('0x5f')]=moment()[_0x5361('0x3a')](_0x5361('0xad'));_0x27da63[_0x5361('0x5e')]=_0x27da63[_0x5361('0x5f')];_0x27da63[_0x5361('0xcc')]=_0xcc554a[_0x5361('0xcc')];_0x27da63[_0x5361('0xcd')]=_0xcc554a[_0x5361('0xcd')];hopperUtils[_0x5361('0xce')](_0x27da63)['catch'](loggerCatch(_0x5361('0xcf')));}})[_0x5361('0x33')](function(){if(_0x1a877c)hopperUtils[_0x5361('0xd0')](_0xcc554a,_0x24eb21,_0x12844b)[_0x5361('0x33')](function(){return 0x1;});});}else{this['voiceQueues'][_0xb29c18[_0x5361('0xaa')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x5361('0x1a')][_0xb29c18[_0x5361('0xaa')]][_0x5361('0xd1')]+=0x1;_0xcc554a[_0x5361('0x5d')]=0xb;_0xcc554a[_0x5361('0xbc')]=_0x5361('0xd2');_0xcc554a[_0x5361('0xbd')]='CALLEREXIT';_0xcc554a['countabandonedretry']+=0x1;_0xcc554a[_0x5361('0xbf')]+=0x1;_0x24eb21=this['voiceQueues'][_0xb29c18[_0x5361('0xaa')]][_0x5361('0xd3')];_0x12844b=this[_0x5361('0x1a')][_0xb29c18[_0x5361('0xaa')]]['callAdditionalPhoneAfterMin'];hopperUtils['verifyAdditionalPhones'](_0xcc554a,_0xcc554a['state'],_0x593aee[_0x5361('0xc2')])[_0x5361('0x33')](function(_0xc33120){if(_0xcc554a[_0x5361('0xd4')]>=_0xdda976[_0x5361('0x1a')][_0xb29c18['queue']][_0x5361('0xd5')]){_0xdda976[_0x5361('0xd6')](_0xcc554a,_0xc33120[_0x5361('0xc3')]);}else{hopperUtils[_0x5361('0xc5')]({'active':![],'countabandonedretry':_0xcc554a[_0x5361('0xd4')],'scheduledat':moment()['add'](_0xdda976['voiceQueues'][_0xb29c18['queue']][_0x5361('0xd3')],'minutes')[_0x5361('0x3a')](_0x5361('0xad')),'ContactId':_0x593aee[_0x5361('0xc7')],'ListId':_0x593aee['ListId'],'VoiceQueueId':_0x593aee['VoiceQueueId']||undefined,'CampaignId':_0x593aee[_0x5361('0xc9')]||undefined})[_0x5361('0x8c')](loggerCatch(_0x5361('0xd7')));var _0x5ab9b8=new History(_0xcc554a);_0x5ab9b8[_0x5361('0x5d')]=0xb;_0x5ab9b8[_0x5361('0xbc')]=_0x5361('0xd2');_0x5ab9b8[_0x5361('0x5f')]=moment()[_0x5361('0x3a')](_0x5361('0xad'));_0x5ab9b8['endtime']=_0x5ab9b8[_0x5361('0x5f')];_0x5ab9b8[_0x5361('0xcc')]=_0xcc554a[_0x5361('0xcc')];_0x5ab9b8[_0x5361('0xcd')]=_0xcc554a[_0x5361('0xcd')];hopperUtils['createHistory'](_0x5ab9b8)[_0x5361('0x8c')](loggerCatch(_0x5361('0xd8')));}})[_0x5361('0x33')](function(){if(_0x1a877c)hopperUtils[_0x5361('0xd0')](_0xcc554a,_0x24eb21,_0x12844b)[_0x5361('0x33')](function(){return 0x1;});});}}}};Dialer[_0x5361('0x15')][_0x5361('0xd9')]=function(_0x295a7c){if(this[_0x5361('0xda')][_0x295a7c[_0x5361('0xae')]]){this['actions'][_0x295a7c[_0x5361('0xae')]]['channel']=_0x295a7c[_0x5361('0xdb')];}if(this[_0x5361('0xab')][_0x295a7c['uniqueid']]){this[_0x5361('0xab')][_0x295a7c['uniqueid']][_0x5361('0xdb')]=_0x295a7c[_0x5361('0xdb')];}};Dialer[_0x5361('0x15')][_0x5361('0xdc')]=function(_0x9366c9){if(!this[_0x5361('0xda')][_0x9366c9[_0x5361('0xdd')]]){return;}var _0x1fe685=this[_0x5361('0x1a')][this[_0x5361('0xda')][_0x9366c9[_0x5361('0xdd')]][_0x5361('0xaa')]][_0x5361('0xde')]||'rrmemory';if(_0x1fe685===_0x5361('0xdf')){if(this[_0x5361('0xda')][_0x9366c9[_0x5361('0xdd')]]&&_[_0x5361('0xe0')](this[_0x5361('0xda')][_0x9366c9[_0x5361('0xdd')]][_0x5361('0xe1')])&&_0x9366c9['status']==='1'&&_0x9366c9[_0x5361('0xe2')]==='0'){if(this[_0x5361('0x1c')][_0x9366c9[_0x5361('0xe3')]]){if(!this[_0x5361('0x1c')][_0x9366c9[_0x5361('0xe3')]][_0x5361('0xe1')]){this['agents'][_0x9366c9[_0x5361('0xe3')]][_0x5361('0xe1')]=!![];this['actions'][_0x9366c9[_0x5361('0xdd')]]['locked']=!![];this[_0x5361('0xda')][_0x9366c9['actionid']][_0x5361('0xe3')]=_0x9366c9[_0x5361('0xe3')];}}}}else if(_0x1fe685==='rrmemory'){if(this['actions'][_0x9366c9['actionid']]){if(this[_0x5361('0x1c')][_0x9366c9[_0x5361('0xe3')]]){this[_0x5361('0xda')][_0x9366c9[_0x5361('0xdd')]][_0x5361('0xe3')]=_0x9366c9['stateinterface'];if(_['isNil'](this['queueBooked'][this[_0x5361('0xda')][_0x9366c9[_0x5361('0xdd')]][_0x5361('0xaa')]])){this[_0x5361('0x1e')][this[_0x5361('0xda')][_0x9366c9[_0x5361('0xdd')]]['queue']]=[];}this[_0x5361('0x1e')][this[_0x5361('0xda')][_0x9366c9[_0x5361('0xdd')]][_0x5361('0xaa')]]['push'](_[_0x5361('0x4d')](_[_0x5361('0x63')](this[_0x5361('0xda')][_0x9366c9[_0x5361('0xdd')]],[_0x5361('0xe4'),_0x5361('0xe3')]),{'status':_0x9366c9['status'],'paused':_0x9366c9[_0x5361('0xe2')]}));}}}};Dialer[_0x5361('0x15')][_0x5361('0xe5')]=function(_0xdd3d60){if(!this['actions'][_0xdd3d60[_0x5361('0xdd')]]){return;}var _0x10e5ff=this;var _0x4cb40e=this['voiceQueues'][this[_0x5361('0xda')][_0xdd3d60[_0x5361('0xdd')]][_0x5361('0xaa')]];var _0x529496=_0x4cb40e[_0x5361('0xde')]||_0x5361('0xe6');if(_0x529496===_0x5361('0xdf')){if(this['actions'][_0xdd3d60[_0x5361('0xdd')]]&&this[_0x5361('0xda')][_0xdd3d60['actionid']][_0x5361('0xe3')]){this[_0x5361('0xe7')][_0x5361('0xe8')](this[_0x5361('0xda')][_0xdd3d60['actionid']][_0x5361('0xe4')],this[_0x5361('0xda')][_0xdd3d60[_0x5361('0xdd')]][_0x5361('0xe3')])[_0x5361('0x8c')](function(_0x2b2799){logger['error'](_0x5361('0xe9'),util[_0x5361('0x39')](_0x2b2799,{'showHidden':![],'depth':null}));})[_0x5361('0x18')](function(){_0x10e5ff[_0x5361('0xb7')](_0x10e5ff[_0x5361('0x1a')][_0x10e5ff[_0x5361('0xda')][_0xdd3d60[_0x5361('0xdd')]][_0x5361('0xaa')]]);_0x10e5ff[_0x5361('0x1c')][_0x10e5ff['actions'][_0xdd3d60[_0x5361('0xdd')]]['stateinterface']]['locked']=![];delete _0x10e5ff[_0x5361('0xda')][_0xdd3d60[_0x5361('0xdd')]];unlockQueueStatus(_0x4cb40e);});}else{this['updateOriginated'](this['voiceQueues'][this[_0x5361('0xda')][_0xdd3d60['actionid']][_0x5361('0xaa')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x5361('0xda')][_0xdd3d60[_0x5361('0xdd')]][_0x5361('0xc7')],'ListId':this[_0x5361('0xda')][_0xdd3d60[_0x5361('0xdd')]][_0x5361('0xea')],'VoiceQueueId':this[_0x5361('0xda')][_0xdd3d60['actionid']][_0x5361('0xc8')]||undefined,'CampaignId':this[_0x5361('0xda')][_0xdd3d60[_0x5361('0xdd')]][_0x5361('0xc9')]||undefined})[_0x5361('0x8c')](loggerCatch(_0x5361('0xeb')));delete this[_0x5361('0xda')][_0xdd3d60[_0x5361('0xdd')]];unlockQueueStatus(_0x4cb40e);}}else if(_0x529496===_0x5361('0xe6')){var _0x58982f;if(this[_0x5361('0xda')][_0xdd3d60[_0x5361('0xdd')]]&&!_[_0x5361('0x68')](this[_0x5361('0x1e')][this[_0x5361('0xda')][_0xdd3d60[_0x5361('0xdd')]][_0x5361('0xaa')]])){if(this[_0x5361('0x1f')][_0x10e5ff['actions'][_0xdd3d60[_0x5361('0xdd')]]['queue']]){this['queueBookedRR'][_0x10e5ff[_0x5361('0xda')][_0xdd3d60[_0x5361('0xdd')]][_0x5361('0xaa')]]=this[_0x5361('0x1f')][this[_0x5361('0xda')][_0xdd3d60[_0x5361('0xdd')]][_0x5361('0xaa')]]?this[_0x5361('0x1f')][this['actions'][_0xdd3d60[_0x5361('0xdd')]][_0x5361('0xaa')]]:this[_0x5361('0x1e')][this[_0x5361('0xda')][_0xdd3d60[_0x5361('0xdd')]]['queue']]?this[_0x5361('0x1e')][this[_0x5361('0xda')][_0xdd3d60['actionid']][_0x5361('0xaa')]][_0x5361('0xec')]||0x0:0x0;}this[_0x5361('0x1e')][this[_0x5361('0xda')][_0xdd3d60['actionid']]['queue']]['_rr']=this['queueBookedRR'][this[_0x5361('0xda')][_0xdd3d60['actionid']][_0x5361('0xaa')]];for(var _0x42c591=0x0;_0x42c591=_0x2381d6['dialGlobalMaxRetry']){_0x48ad81['stateGlobal'](_0x419894,_0x4ead8b,_0x14c7ba,_0x5361('0x10c'));}else{if(_0x419894['countmachineretry']>=_0x2381d6['dialMachineMaxRetry']){_0x48ad81[_0x5361('0x10d')](_0x419894,_0x4ead8b,_0x14c7ba,_0x5361('0x10e'));}else{hopperUtils[_0x5361('0xc5')]({'active':![],'countmachineretry':_0x419894[_0x5361('0x10a')],'scheduledat':moment()[_0x5361('0xc6')](_0x2381d6[_0x5361('0x10f')],_0x5361('0x110'))[_0x5361('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x419894[_0x5361('0xc7')],'ListId':_0x419894[_0x5361('0xea')],'VoiceQueueId':_0x419894['VoiceQueueId']||undefined,'CampaignId':_0x419894[_0x5361('0xc9')]||undefined})[_0x5361('0x8c')](loggerCatch(_0x5361('0x111')));_0x4ead8b({'reschedule':0x1});}}});}if(_0x2067ea['type']===_0x5361('0xb6')&&this['campaigns'][_0x2067ea[_0x5361('0xaa')]][_0x5361('0x112')]&&_0x7458a7[_0x5361('0x113')]===_0x5361('0xfb')){delete this[_0x5361('0xab')][_0x7458a7['uniqueid']];this['updateOriginated'](this[_0x5361('0x1b')][_0x2067ea['queue']]);_0xeb48ab=new Hangup(_0x2067ea,_0x7458a7);_0xeb48ab[_0x5361('0x5d')]=0x12;_0xeb48ab[_0x5361('0xbc')]=_0x5361('0xfd');_0xeb48ab[_0x5361('0x105')]=_0x5361('0xfe');ami[_0x5361('0xff')](_0x5361('0x100'),ut[_0x5361('0x114')](_0xeb48ab,_0x5361('0x101')));this[_0x5361('0x115')](_0xeb48ab,'[syncHangupInAMDIvr][createHistory]',_0x5361('0x116'));}if(_0x2067ea['type']===_0x5361('0xb6')&&this['campaigns'][_0x2067ea[_0x5361('0xaa')]][_0x5361('0x112')]&&_0x7458a7['value']===_0x5361('0x103')){return new Promise(function(_0x9958a,_0x230d4b){delete _0x48ad81[_0x5361('0xab')][_0x7458a7[_0x5361('0xae')]];_0x48ad81[_0x5361('0xb7')](_0x48ad81['campaigns'][_0x2067ea['queue']]);_0x48ad81[_0x5361('0x1b')][_0x2067ea['queue']][_0x5361('0xaf')]+=0x1;_0x48ad81[_0x5361('0x1b')][_0x2067ea['queue']][_0x5361('0xfc')]+=0x1;var _0x582163=_0x48ad81['campaigns'][_0x2067ea['queue']];var _0x176ed7=new Hangup(_0x2067ea,_0x7458a7);_0x176ed7['state']=0x13;_0x176ed7[_0x5361('0xbc')]=_0x5361('0x104');_0x176ed7['membername']='AMD';_0x176ed7[_0x5361('0x10a')]+=0x1;_0x176ed7[_0x5361('0xbf')]+=0x1;_0x176ed7[_0x5361('0x101')]=!![];ami[_0x5361('0xff')](_0x5361('0x100'),ut[_0x5361('0x114')](_0x176ed7,_0x5361('0x101')));hopperUtils[_0x5361('0xce')](_0x176ed7)[_0x5361('0x8c')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x176ed7[_0x5361('0x106')]+_0x176ed7[_0x5361('0x107')]+_0x176ed7[_0x5361('0x108')]+_0x176ed7[_0x5361('0x109')]+_0x176ed7[_0x5361('0xbe')]+_0x176ed7['countabandonedretry']+_0x176ed7[_0x5361('0x10a')]+_0x176ed7[_0x5361('0x10b')]>=_0x582163[_0x5361('0x117')]){_0x48ad81[_0x5361('0x118')](_0x176ed7,_0x9958a,_0x230d4b,_0x5361('0x10c'));}else{if(_0x176ed7[_0x5361('0x10a')]>=_0x582163[_0x5361('0x119')]){_0x48ad81[_0x5361('0x10d')](_0x176ed7,_0x9958a,_0x230d4b,_0x5361('0x10e'));}else{hopperUtils[_0x5361('0xc5')]({'active':![],'countmachineretry':_0x176ed7[_0x5361('0x10a')],'scheduledat':moment()[_0x5361('0xc6')](_0x582163[_0x5361('0x10f')],_0x5361('0x110'))[_0x5361('0x3a')](_0x5361('0xad')),'ContactId':_0x176ed7['ContactId'],'ListId':_0x176ed7[_0x5361('0xea')],'VoiceQueueId':_0x176ed7[_0x5361('0xc8')]||undefined,'CampaignId':_0x176ed7[_0x5361('0xc9')]||undefined})[_0x5361('0x8c')](loggerCatch(_0x5361('0x111')));_0x9958a({'reschedule':0x1});}}});}}};Dialer[_0x5361('0x15')]['syncHangup']=function(_0x3dd077){var _0x5dded6=this[_0x5361('0xab')][_0x3dd077['uniqueid']];var _0x3eab28;if(_0x5dded6&&_0x5dded6[_0x5361('0x35')]==='ivr'){delete this[_0x5361('0xab')][_0x3dd077[_0x5361('0xae')]];this['updateOriginated'](this[_0x5361('0x1b')][_0x5dded6[_0x5361('0xaa')]]);this[_0x5361('0x1b')][_0x5dded6['queue']][_0x5361('0x11a')]+=0x1;_0x3eab28=new Hangup(_0x5dded6,_0x3dd077);hopperUtils[_0x5361('0xce')](_0x3eab28)['catch'](loggerCatch(_0x5361('0x11b')));hopperUtils[_0x5361('0xb4')](_0x3eab28)['catch'](loggerCatch(_0x5361('0x11c')));}if(_0x5dded6&&_0x5dded6[_0x5361('0x35')]!==_0x5361('0xb6')&&isNotNull(this[_0x5361('0x1a')][_0x5dded6[_0x5361('0xaa')]][_0x5361('0x11d')])){delete this['uniqueId'][_0x3dd077[_0x5361('0xae')]];this[_0x5361('0xb7')](this['voiceQueues'][_0x5dded6['queue']]);this[_0x5361('0x1a')][_0x5dded6[_0x5361('0xaa')]][_0x5361('0xaf')]+=0x1;this[_0x5361('0x1a')][_0x5dded6[_0x5361('0xaa')]][_0x5361('0xfc')]+=0x1;_0x3eab28=new Hangup(_0x5dded6,_0x3dd077);_0x3eab28[_0x5361('0x5d')]=0x10;_0x3eab28[_0x5361('0xbc')]=_0x5361('0x11e');_0x3eab28[_0x5361('0x105')]='AGI';hopperUtils[_0x5361('0xce')](_0x3eab28)[_0x5361('0x8c')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x5361('0xb4')](_0x3eab28)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x5dded6&&_0x5dded6[_0x5361('0x35')]!=='ivr'&&!isNotNull(this[_0x5361('0x1a')][_0x5dded6[_0x5361('0xaa')]][_0x5361('0x11d')])){delete this[_0x5361('0xab')][_0x3dd077[_0x5361('0xae')]];this['updateOriginated'](this[_0x5361('0x1a')][_0x5dded6[_0x5361('0xaa')]]);this['voiceQueues'][_0x5dded6[_0x5361('0xaa')]][_0x5361('0x11f')]+=0x1;_0x3eab28=new Hangup(_0x5dded6,_0x3dd077);_0x3eab28[_0x5361('0x5d')]=0xc;_0x3eab28[_0x5361('0xbc')]=_0x3dd077[_0x5361('0x120')];_0x3eab28[_0x5361('0x105')]=_0x5361('0x121');hopperUtils[_0x5361('0xce')](_0x3eab28)[_0x5361('0x8c')](loggerCatch(_0x5361('0x11b')));hopperUtils[_0x5361('0xb4')](_0x3eab28)['catch'](loggerCatch(_0x5361('0x11c')));}};Dialer['prototype'][_0x5361('0x28')]=function(_0x4f1131){var _0x350f0b=this;if(!_0x350f0b[_0x5361('0x122')][_0x4f1131[_0x5361('0x3c')]]){_0x350f0b[_0x5361('0x122')][_0x4f1131[_0x5361('0x3c')]]={'running':![]};}else if(_0x350f0b['queuesSummary'][_0x4f1131[_0x5361('0x3c')]][_0x5361('0x123')]===!![]){return;}else if(_0x350f0b['queuesSummary'][_0x4f1131[_0x5361('0x3c')]][_0x5361('0x123')]===![]){_0x350f0b['queuesSummary'][_0x4f1131[_0x5361('0x3c')]][_0x5361('0x123')]=!![];}var _0x598c90=_0x350f0b[_0x5361('0x1a')][_0x4f1131[_0x5361('0x3c')]];var _0x2815bf=_0x598c90[_0x5361('0x57')]!==utils[_0x5361('0x58')][_0x5361('0x6a')];var _0x9770f7=utils['isPreviewCampaign'](_0x598c90);_0x598c90[_0x5361('0x124')]=utils[_0x5361('0x125')](_0x598c90,_0x350f0b[_0x5361('0x1d')]);Promise[_0x5361('0x95')]()[_0x5361('0x33')](function(){if(_0x598c90['statusMessage']===utils[_0x5361('0x58')][_0x5361('0x6a')]){if(_0x2815bf){clearPredictiveAttributes(_0x598c90);_0x4f1131['startPredictive']=undefined;_0x4f1131[_0x5361('0x4f')]=undefined;}if(_0x598c90['statusMessage']===utils[_0x5361('0x58')][_0x5361('0x6a')]){_0x4f1131[_0x5361('0x126')]=0x0;_0x4f1131[_0x5361('0xe2')]=0x0;_0x4f1131[_0x5361('0x127')]=0x0;_0x4f1131[_0x5361('0x128')]=0x0;_0x4f1131['pTalking']=0x0;}}else if(_0x598c90[_0x5361('0x124')]===utils[_0x5361('0x58')][_0x5361('0x129')]&&!_0x9770f7){return _0x350f0b[_0x5361('0x7b')](_0x598c90,!![])['then'](function(){return _0x350f0b[_0x5361('0x7b')](_0x598c90,![]);})[_0x5361('0x33')](function(){return _0x350f0b[_0x5361('0x9a')](_0x598c90);})['catch'](function(_0xe9e8e2){loggerSyncQueueSummary[_0x5361('0x37')](_0x5361('0x12a'),util['inspect'](_0xe9e8e2,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x598c90);});}else{clearPredictiveAttributes(_0x598c90);}})[_0x5361('0x33')](function(){var _0x26774e=_0x4f1131['compareToOutboundQueue'](_0x598c90);if(_0x26774e||_0x598c90[_0x5361('0x12b')]){_0x598c90[_0x5361('0x12b')]=![];_0x4f1131[_0x5361('0x12c')](_0x598c90);Object[_0x5361('0x12d')](_0x598c90,_0x4f1131);emitOutboundVoiceQueueSummary(_0x4f1131);}_0x350f0b[_0x5361('0x122')][_0x598c90[_0x5361('0x3c')]][_0x5361('0x123')]=![];})['catch'](function(_0x3ab0dd){logger['error'](_0x5361('0x12a'),util['inspect'](_0x3ab0dd,{'showHidden':![],'depth':null}));_0x350f0b[_0x5361('0x122')][_0x598c90[_0x5361('0x3c')]]['running']=![];});};Dialer[_0x5361('0x15')][_0x5361('0x2a')]=_[_0x5361('0x12e')](function(){var _0xa4e36b=_[_0x5361('0x12f')](this[_0x5361('0x1a')],function(_0xadadb){return _0xadadb[_0x5361('0x130')];});var _0x521b12=_['filter'](this[_0x5361('0x1c')],function(_0x495b1a){return _0x495b1a[_0x5361('0x131')]&&_0x495b1a[_0x5361('0x73')]==='reachable';});if(_0xa4e36b[_0x5361('0x83')]>0x0&&_0x521b12[_0x5361('0x83')]>0x0){return Promise[_0x5361('0x95')]()[_0x5361('0x33')](cmHopper[_0x5361('0x132')](_['map'](_0xa4e36b,'id'),previewRecallmeReminderInterval,_[_0x5361('0x133')](_0x521b12,'id')))[_0x5361('0x33')](function(_0x326654){for(var _0x12c086=0x0;_0x12c086<_0x326654[_0x5361('0x83')];_0x12c086++){var _0x4a9978=_0x326654[_0x12c086][_0x5361('0x134')][_0x5361('0x3c')];if(_0x4a9978)io['to'](util[_0x5361('0x3a')](_0x5361('0x135'),_0x4a9978))['emit'](_0x5361('0x136'),{'hopper':_0x326654[_0x12c086]});}})[_0x5361('0x8c')](function(_0x461f08){logger['error'](_0x5361('0x137'),_0x461f08);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x5361('0x15')]['loopClearZombieChannels']=function(){var _0xb0bb51=this;setInterval(function(){_0xb0bb51[_0x5361('0x138')](_0xb0bb51['uniqueId'],_0x5361('0x139'));_0xb0bb51[_0x5361('0x138')](_0xb0bb51[_0x5361('0xda')],_0x5361('0x13a'));},0x32c8);};Dialer['prototype'][_0x5361('0x138')]=function(_0x28ef5e,_0x14dbe0){var _0xcbd6df=this;for(var _0x3528fd in _0x28ef5e){if(typeof _0x28ef5e[_0x3528fd]!==_0x5361('0x94')){this['sequence'][_0x5361('0x16')](function(){if(!_['isNil'](_0x28ef5e[_0x3528fd])){return ami['Action']({'action':_0x5361('0x73'),'channel':_0x28ef5e[_0x3528fd][_0x5361('0xdb')]})[_0x5361('0x8c')](function(_0x380b35){if(_0x380b35[_0x5361('0x57')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x28ef5e[_0x3528fd]&&_0x28ef5e[_0x3528fd][_0x5361('0x35')]!=='ivr'){_0xcbd6df['updateOriginated'](_0xcbd6df[_0x5361('0x1a')][_0x28ef5e[_0x3528fd][_0x5361('0xaa')]]);logger[_0x5361('0x54')](_0x5361('0x13b'),_0x14dbe0,_0x3528fd,_0x28ef5e[_0x3528fd][_0x5361('0xaa')]);delete _0x28ef5e[_0x3528fd];}if(_0x28ef5e[_0x3528fd]&&_0x28ef5e[_0x3528fd][_0x5361('0x35')]===_0x5361('0xb6')){_0xcbd6df[_0x5361('0xb7')](_0xcbd6df['campaigns'][_0x28ef5e[_0x3528fd]['queue']]);logger[_0x5361('0x54')](_0x5361('0x13c'),_0x14dbe0,_0x3528fd,_0x28ef5e[_0x3528fd][_0x5361('0xaa')]);delete _0x28ef5e[_0x3528fd];}},0x2328);}});}});}}};Dialer[_0x5361('0x15')][_0x5361('0x13d')]=function(_0x2ebd18){return Promise[_0x5361('0x95')]()[_0x5361('0x33')](voiceQueueRt[_0x5361('0x13d')](_0x2ebd18))[_0x5361('0x8c')](loggerCatch(_0x5361('0x13e')));};Dialer[_0x5361('0x15')][_0x5361('0xb7')]=function(_0x129962){if(!_[_0x5361('0x34')](_0x129962)&&_0x129962!==null){if(typeof _0x129962[_0x5361('0x13f')]!=='undefined'){if(_0x129962[_0x5361('0x13f')]>0x0){_0x129962['originated']-=0x1;}else{logger[_0x5361('0x54')](_0x5361('0x140'));}}}else{logger['error'](_0x5361('0x141'));}};Dialer[_0x5361('0x15')][_0x5361('0x142')]=function(_0x12e9c7,_0x2969cf){var _0x30e999=this;return function(_0xcc66d7){_0x30e999['updateOriginated'](_0x2969cf);logger['error'](_0x12e9c7,util[_0x5361('0x39')](_0xcc66d7,{'showHidden':![],'depth':null}));};};Dialer[_0x5361('0x15')][_0x5361('0x143')]=function(_0x331606,_0x1bc15a,_0x357ccf){var _0x54e0bf={'state':0x19,'statedesc':_0x5361('0x144')};this[_0x5361('0xb7')](_0x1bc15a);this[_0x5361('0x115')](_[_0x5361('0x4d')](_0x54e0bf,_['pick'](_0x357ccf,[_0x5361('0xc7'),_0x5361('0xea'),_0x5361('0x145'),_0x5361('0xc8'),'CampaignId'])),_0x5361('0x146'),_0x5361('0x147'));logger['error'](_0x331606);};Dialer[_0x5361('0x15')]['saveInDb']=function(_0x12498f,_0x2a22ae,_0x1f8d03){hopperUtils[_0x5361('0xce')](_0x12498f)[_0x5361('0x8c')](loggerCatch(_0x2a22ae));hopperUtils['moveContactManagedDialer'](_0x12498f)['catch'](loggerCatch(_0x1f8d03));};Dialer[_0x5361('0x15')][_0x5361('0xd6')]=function(_0x3b084c,_0x59c133){hopperUtils[_0x5361('0xce')](_0x3b084c)[_0x5361('0x8c')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x59c133==0x0){hopperUtils[_0x5361('0xb4')](_0x3b084c)[_0x5361('0x8c')](loggerCatch(_0x5361('0x148')));}};Dialer[_0x5361('0x15')][_0x5361('0x137')]=function(_0x1ec66c){return Promise[_0x5361('0x95')]()['then'](cmHopper[_0x5361('0x132')](_0x1ec66c['id'],previewRecallmeReminderInterval))[_0x5361('0x33')](function(_0x45500a){for(var _0x4c14de=0x0;_0x4c14de<_0x45500a[_0x5361('0x83')];_0x4c14de++){var _0x343574=_0x45500a[_0x4c14de][_0x5361('0x134')][_0x5361('0x3c')];if(_0x343574)io['to'](util['format'](_0x5361('0x135'),_0x343574))[_0x5361('0xff')](_0x5361('0x136'),{'hopper':_0x45500a[_0x4c14de]});}})[_0x5361('0x8c')](function(){});};Dialer[_0x5361('0x15')]['launchHandleIvr']=function(_0x53ef82){var _0x2503f2=this;return function(){_0x2503f2[_0x5361('0x149')](_0x53ef82);};};Dialer['prototype'][_0x5361('0x14a')]=function(_0x301792,_0x54bfdf){var _0x152a79=this;var _0x4e0158=uuid['v4']();this[_0x5361('0xda')][_0x4e0158]=new Action(_0x301792,_0x54bfdf,_0x4e0158);return new Promise(function(_0x4733c0,_0x4c18ce){if(_['isUndefined'](_0x301792)&&typeof _0x301792!=='object'){return _0x4c18ce(msgResponse('originate',_0x5361('0x7c'),_0x5361('0x14b')));}if(_[_0x5361('0x34')](_0x54bfdf[_0x5361('0x14c')])||_0x54bfdf[_0x5361('0x14c')]===null){return _0x4c18ce(msgResponse('originate',_0x5361('0x7c'),_0x5361('0x14d')));}var _0x3db3cb={'XMD-CALLERID':_0x152a79[_0x5361('0xda')][_0x4e0158]['getCaller'](),'XMD-AGI':_0x301792[_0x5361('0x11d')]?util[_0x5361('0x3a')](_0x5361('0x14e'),ipAgi,_0x301792[_0x5361('0x11d')]):_0x5361('0x14f'),'XMD-AGIAFTER':_0x301792[_0x5361('0xb2')]?util[_0x5361('0x3a')](_0x5361('0x14e'),ipAgi,_0x301792[_0x5361('0xb2')]):_0x5361('0x14f'),'XMD-QUEUE':utils[_0x5361('0x150')](_0x301792)?util['format']('\x22%s,%s%s,,,%s\x22',_0x301792[_0x5361('0x3c')],_0x301792[_0x5361('0x151')]||'',_0x301792[_0x5361('0x152')]?'c':'',_0x301792['dialQueueTimeout']||0x3):_0x5361('0x14f'),'XMD-CONTACTID':_0x54bfdf[_0x5361('0xc7')],'XMD-CDRTYPE':_0x5361('0x7'),'CALLERID(all)':_0x152a79['actions'][_0x4e0158]['getCaller'](),'XMD-AMD':_0x301792[_0x5361('0x112')]?'ACTIVE':_0x5361('0x14f'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x301792[_0x5361('0x112')]){_0x3db3cb[_0x5361('0x153')]=_0x301792['dialAMDInitialSilence']||0x9c4;_0x3db3cb[_0x5361('0x154')]=_0x301792[_0x5361('0x155')]||0x5dc;_0x3db3cb['XMD-AMDAFTERGREETINGSILENCE']=_0x301792[_0x5361('0x156')]||0x320;_0x3db3cb[_0x5361('0x157')]=_0x301792[_0x5361('0x158')]||0x1388;_0x3db3cb[_0x5361('0x159')]=_0x301792['dialAMDMinWordLength']||0x64;_0x3db3cb[_0x5361('0x15a')]=_0x301792[_0x5361('0x15b')]||0x32;_0x3db3cb[_0x5361('0x15c')]=_0x301792[_0x5361('0x15d')]||0x3;_0x3db3cb['XMD-AMDSILENCETHRESHOLD']=_0x301792['dialAMDSilenceThreshold']||0x100;_0x3db3cb['XMD-AMDMAXIMUMWORDLENGTH']=_0x301792[_0x5361('0x15e')]||0x1388;}if(utils[_0x5361('0x150')](_0x301792)){_0x3db3cb[_0x5361('0x15f')]=_0x54bfdf[_0x5361('0xc8')];}else{_0x3db3cb[_0x5361('0x160')]=_0x54bfdf['CampaignId'];}for(var _0x42875e in _0x54bfdf['Contact']){if(typeof _0x54bfdf[_0x5361('0x161')][_0x42875e]!==_0x5361('0x94')){if(isNotNull(_0x54bfdf[_0x5361('0x161')][_0x42875e])&&_0x42875e!=='id'&&_0x42875e!=='tags'&&_0x42875e!==_0x5361('0x162')&&_0x42875e!==_0x5361('0x163')){_0x3db3cb[util['format'](_0x5361('0x164'),_0x5361('0x165'),_[_0x5361('0x166')](_0x42875e))]=_0x54bfdf[_0x5361('0x161')][_0x42875e];}}}var _0x3a4e2c=_0x152a79[_0x5361('0x167')](_0x301792['Trunk'])?utils[_0x5361('0x168')](_0x301792[_0x5361('0x75')][_0x5361('0x169')],_0x301792[_0x5361('0x16a')],_0x301792[_0x5361('0x16b')]>0x0?utils[_0x5361('0x16c')](_0x301792['dialOriginateCallerIdNumber'],_0x301792[_0x5361('0x16b')]):_0x301792['dialOriginateCallerIdNumber']):utils[_0x5361('0x168')](_['isNil'](_0x301792[_0x5361('0x76')])?_0x301792[_0x5361('0x75')][_0x5361('0x169')]:_0x301792['TrunkBackup']['callerid'],_0x301792[_0x5361('0x16a')],_0x301792[_0x5361('0x16b')]>0x0?utils[_0x5361('0x16c')](_0x301792[_0x5361('0x16d')],_0x301792['dialRandomLastDigitCallerIdNumber']):_0x301792[_0x5361('0x16d')]);if(_0x3a4e2c){_0x3db3cb[_0x5361('0x16e')]=_0x152a79[_0x5361('0xda')][_0x4e0158][_0x5361('0x16f')]=utils['extractCalleridName'](_0x3a4e2c);_0x3db3cb[_0x5361('0x170')]=_0x54bfdf[_0x5361('0x14c')];}_0x301792[_0x5361('0x171')]=_0x3db3cb;return ami[_0x5361('0x85')]({'actionid':_0x4e0158,'action':_0x5361('0x172'),'channel':_0x152a79[_0x5361('0x167')](_0x301792['Trunk'])?util[_0x5361('0x3a')](_0x5361('0x173'),_0x301792['Trunk'][_0x5361('0x3c')],isNotNull(_0x301792[_0x5361('0x174')])?_0x301792[_0x5361('0x174')]['trim']()||'':'',_0x301792[_0x5361('0x175')]>0x0?_0x54bfdf['phone'][_0x5361('0x176')](_0x301792['dialCutDigit']):_0x54bfdf[_0x5361('0x14c')]):util[_0x5361('0x3a')](_0x5361('0x173'),_[_0x5361('0xe0')](_0x301792[_0x5361('0x76')])?_0x301792[_0x5361('0x75')][_0x5361('0x3c')]:_0x301792[_0x5361('0x76')][_0x5361('0x3c')],isNotNull(_0x301792[_0x5361('0x174')])?_0x301792[_0x5361('0x174')]['trim']()||'':'',_0x301792[_0x5361('0x175')]>0x0?_0x54bfdf[_0x5361('0x14c')]['substring'](_0x301792[_0x5361('0x175')]):_0x54bfdf[_0x5361('0x14c')]),'callerid':_0x3a4e2c,'Exten':_0x5361('0xfa'),'Context':_0x5361('0x177'),'Priority':'1','variable':_0x3db3cb,'timeout':(_0x301792['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x4e0158})['then'](function(_0x515964){return _0x4733c0(_0x515964);})[_0x5361('0x8c')](function(_0x2496bf){_0x301792[_0x5361('0x178')]+=0x1;var _0x18a80b=new History(_0x152a79['actions'][_0x4e0158]);logger[_0x5361('0x54')](util[_0x5361('0x3a')](_0x5361('0x179'),JSON[_0x5361('0x62')](_0x2496bf)));_0x18a80b[_0x5361('0x5d')]=0xe;_0x18a80b[_0x5361('0xbc')]=_0x5361('0x17a');_0x18a80b[_0x5361('0x5f')]=moment()[_0x5361('0x3a')](_0x5361('0xad'));_0x18a80b['endtime']=_0x18a80b[_0x5361('0x5f')];hopperUtils[_0x5361('0xce')](_0x18a80b)[_0x5361('0x8c')](loggerCatch(_0x5361('0x17b')));_0x152a79[_0x5361('0xb4')](_0x18a80b)[_0x5361('0x8c')](loggerCatch(_0x5361('0x17b')))[_0x5361('0x18')](function(){delete _0x152a79['actions'][_0x4e0158];return _0x4c18ce(msgResponse(_0x5361('0x172'),'Error',_0x5361('0x17c')));});});});};Dialer[_0x5361('0x15')][_0x5361('0x17d')]=function(_0x33c428,_0x29aef0,_0x429c0a){var _0x1c4a8c=new History(_0x29aef0);if(_0x1c4a8c[_0x5361('0x106')]+_0x1c4a8c[_0x5361('0x107')]+_0x1c4a8c[_0x5361('0x108')]+_0x1c4a8c[_0x5361('0x109')]+_0x1c4a8c[_0x5361('0xbe')]+_0x1c4a8c[_0x5361('0xd4')]+_0x1c4a8c['countmachineretry']+_0x1c4a8c[_0x5361('0x10b')]>=_0x429c0a[_0x5361('0x117')]-0x1){return!![];}switch(_0x33c428){case 0x3:if(_0x1c4a8c['countnoanswerretry']>=_0x429c0a['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x1c4a8c[_0x5361('0x108')]+=0x1,'scheduledat':moment()[_0x5361('0xc6')](_0x429c0a[_0x5361('0x17e')],'minutes')['format'](_0x5361('0xad')),'ContactId':_0x1c4a8c[_0x5361('0xc7')],'ListId':_0x1c4a8c[_0x5361('0xea')],'VoiceQueueId':_0x1c4a8c[_0x5361('0xc8')]||undefined,'CampaignId':_0x1c4a8c[_0x5361('0xc9')]||undefined})['catch'](loggerCatch(_0x5361('0x17f')));break;case 0x5:if(_0x1c4a8c[_0x5361('0x106')]>=_0x429c0a[_0x5361('0x180')]-0x1){return!![];}hopperUtils[_0x5361('0xc5')]({'active':![],'countbusyretry':_0x1c4a8c[_0x5361('0x106')]+=0x1,'scheduledat':moment()['add'](_0x429c0a[_0x5361('0x181')],_0x5361('0x110'))['format'](_0x5361('0xad')),'ContactId':_0x1c4a8c[_0x5361('0xc7')],'ListId':_0x1c4a8c[_0x5361('0xea')],'VoiceQueueId':_0x1c4a8c[_0x5361('0xc8')]||undefined,'CampaignId':_0x1c4a8c[_0x5361('0xc9')]||undefined})['catch'](loggerCatch(_0x5361('0x182')));break;case 0x8:if(_0x1c4a8c[_0x5361('0x107')]>=_0x429c0a[_0x5361('0x183')]-0x1){return!![];}hopperUtils[_0x5361('0xc5')]({'active':![],'countcongestionretry':_0x1c4a8c[_0x5361('0x107')]+=0x1,'scheduledat':moment()['add'](_0x429c0a[_0x5361('0x184')],_0x5361('0x110'))[_0x5361('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1c4a8c[_0x5361('0xc7')],'ListId':_0x1c4a8c['ListId'],'VoiceQueueId':_0x1c4a8c['VoiceQueueId']||undefined,'CampaignId':_0x1c4a8c[_0x5361('0xc9')]||undefined})['catch'](loggerCatch(_0x5361('0x185')));break;case 0x0:if(_0x1c4a8c[_0x5361('0x109')]>=_0x429c0a[_0x5361('0x186')]-0x1){return!![];}else{hopperUtils[_0x5361('0xc5')]({'active':![],'countnosuchnumberretry':_0x1c4a8c['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x5361('0xc6')](_0x429c0a[_0x5361('0x187')],'minutes')[_0x5361('0x3a')](_0x5361('0xad')),'ContactId':_0x1c4a8c[_0x5361('0xc7')],'ListId':_0x1c4a8c[_0x5361('0xea')],'VoiceQueueId':_0x1c4a8c[_0x5361('0xc8')]||undefined,'CampaignId':_0x1c4a8c['CampaignId']||undefined})[_0x5361('0x8c')](loggerCatch(_0x5361('0x188')));}break;case 0xa:if(_0x1c4a8c[_0x5361('0xbe')]>=_0x429c0a[_0x5361('0xc4')]-0x1){return!![];}hopperUtils[_0x5361('0xc5')]({'active':![],'countdropretry':_0x1c4a8c[_0x5361('0xbe')]+=0x1,'scheduledat':moment()[_0x5361('0xc6')](_0x429c0a['dialDropRetryFrequency'],_0x5361('0x110'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1c4a8c[_0x5361('0xc7')],'ListId':_0x1c4a8c[_0x5361('0xea')],'VoiceQueueId':_0x1c4a8c[_0x5361('0xc8')]||undefined,'CampaignId':_0x1c4a8c['CampaignId']||undefined})['catch'](loggerCatch(_0x5361('0xca')));break;case 0xb:if(_0x1c4a8c[_0x5361('0xd4')]>=_0x429c0a[_0x5361('0xd5')]-0x1){return!![];}hopperUtils[_0x5361('0xc5')]({'active':![],'countabandonedretry':_0x1c4a8c[_0x5361('0xd4')]+=0x1,'scheduledat':moment()[_0x5361('0xc6')](_0x429c0a[_0x5361('0xd3')],'minutes')[_0x5361('0x3a')](_0x5361('0xad')),'ContactId':_0x1c4a8c['ContactId'],'ListId':_0x1c4a8c[_0x5361('0xea')],'VoiceQueueId':_0x1c4a8c[_0x5361('0xc8')]||undefined,'CampaignId':_0x1c4a8c['CampaignId']||undefined})['catch'](loggerCatch(_0x5361('0xd7')));break;case 0x13:if(_0x1c4a8c[_0x5361('0x10a')]>=_0x429c0a['dialMachineMaxRetry']-0x1){return!![];}hopperUtils[_0x5361('0xc5')]({'active':![],'countmachineretry':_0x1c4a8c[_0x5361('0x10a')]+=0x1,'scheduledat':moment()[_0x5361('0xc6')](_0x429c0a['dialMachineRetryFrequency'],_0x5361('0x110'))[_0x5361('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1c4a8c[_0x5361('0xc7')],'ListId':_0x1c4a8c['ListId'],'VoiceQueueId':_0x1c4a8c[_0x5361('0xc8')]||undefined,'CampaignId':_0x1c4a8c[_0x5361('0xc9')]||undefined})[_0x5361('0x8c')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x1c4a8c[_0x5361('0x10b')]>=_0x429c0a[_0x5361('0x189')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x1c4a8c['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x5361('0xc6')](_0x429c0a[_0x5361('0x18a')],_0x5361('0x110'))[_0x5361('0x3a')](_0x5361('0xad')),'ContactId':_0x1c4a8c['ContactId'],'ListId':_0x1c4a8c['ListId'],'VoiceQueueId':_0x1c4a8c[_0x5361('0xc8')]||undefined,'CampaignId':_0x1c4a8c['CampaignId']||undefined})[_0x5361('0x8c')](loggerCatch(_0x5361('0x18b')));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x229164,_0x29cdb5,_0x185535){var _0x438f8b=this;var _0xfb2e80=new History(_0x229164);var _0x5d9e6e=![];var _0x4afb22;var _0x3e5290;return new Promise(function(_0x27f8a6,_0x2e0fdb){if(_['isUndefined'](_0x29cdb5)&&typeof _0x29cdb5!==_0x5361('0x18c')){return _0x2e0fdb(msgResponse('[callProgressDetecting]',_0x5361('0x7c'),_0x5361('0x18d')));}if(_[_0x5361('0x34')](_0x185535)&&typeof _0x185535!==_0x5361('0x18c')){return _0x2e0fdb(msgResponse(_0x5361('0x18e'),_0x5361('0x7c'),_0x5361('0x18f')));}hopperUtils[_0x5361('0x190')](_0xfb2e80,_0x185535[_0x5361('0xb0')],_0x29cdb5)[_0x5361('0x33')](function(_0x2a5cb9){if(_0x2a5cb9[_0x5361('0xc3')]==0x1)_0x5d9e6e=!![];switch(_0x185535[_0x5361('0xb0')]){case'0':_0x29cdb5[_0x5361('0x191')]+=0x1;_0xfb2e80[_0x5361('0x5d')]=0x0;_0xfb2e80[_0x5361('0xbc')]='NoSuchNumber';_0xfb2e80[_0x5361('0x109')]+=0x1;_0xfb2e80['countglobal']+=0x1;ami[_0x5361('0xff')](_0x5361('0x192'),ut[_0x5361('0x114')](_0x229164,'nosuchnumber'));_0x4afb22=_0x29cdb5[_0x5361('0x187')];_0x3e5290=_0x29cdb5[_0x5361('0xc1')];hopperUtils[_0x5361('0xce')](_0xfb2e80)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x438f8b['checkRetriveMax'](0x0,_0x229164,_0x29cdb5)&&!_0x5d9e6e){if(_0xfb2e80[_0x5361('0x109')]>=_0x29cdb5[_0x5361('0x186')]){_0x438f8b[_0x5361('0x10d')](_0xfb2e80,_0x27f8a6,_0x2e0fdb,_0x5361('0x193'));}else{_0x438f8b[_0x5361('0x118')](_0xfb2e80,_0x27f8a6,_0x2e0fdb,_0x5361('0x193'));}}break;case'3':_0x29cdb5[_0x5361('0x194')]+=0x1;_0xfb2e80[_0x5361('0x5d')]=0x3;_0xfb2e80[_0x5361('0xbc')]=_0x5361('0x195');_0xfb2e80['countnoanswerretry']+=0x1;_0xfb2e80['countglobal']+=0x1;var _0x3a01dc=ut[_0x5361('0x196')](_0x229164,_0x29cdb5);ami[_0x5361('0xff')](_0x5361('0x197'),_0x3a01dc);_0x4afb22=_0x29cdb5['dialNoAnswerRetryFrequency'];_0x3e5290=_0x29cdb5[_0x5361('0xc1')];hopperUtils[_0x5361('0xce')](_0xfb2e80)[_0x5361('0x8c')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x438f8b[_0x5361('0x17d')](0x3,_0x229164,_0x29cdb5)&&!_0x5d9e6e){if(_0xfb2e80[_0x5361('0x108')]>=_0x29cdb5[_0x5361('0x198')]){_0x438f8b[_0x5361('0x10d')](_0xfb2e80,_0x27f8a6,_0x2e0fdb,_0x5361('0x199'));}else{_0x438f8b['stateGlobal'](_0xfb2e80,_0x27f8a6,_0x2e0fdb,_0x5361('0x199'));}}break;case'5':_0x29cdb5[_0x5361('0x19a')]+=0x1;_0xfb2e80[_0x5361('0x5d')]=0x5;_0xfb2e80['statedesc']=_0x5361('0x19b');_0xfb2e80['countbusyretry']+=0x1;_0xfb2e80['countglobal']+=0x1;ami['emit'](_0x5361('0x19c'),ut[_0x5361('0x114')](_0x229164,_0x5361('0x19d')));_0x4afb22=_0x29cdb5[_0x5361('0x181')];_0x3e5290=_0x29cdb5[_0x5361('0xc1')];hopperUtils[_0x5361('0xce')](_0xfb2e80)[_0x5361('0x8c')](loggerCatch(_0x5361('0x19e')));if(_0x438f8b['checkRetriveMax'](0x5,_0x229164,_0x29cdb5)&&!_0x5d9e6e){if(_0xfb2e80[_0x5361('0x106')]>=_0x29cdb5[_0x5361('0x180')]){_0x438f8b[_0x5361('0x10d')](_0xfb2e80,_0x27f8a6,_0x2e0fdb,_0x5361('0x19f'));}else{_0x438f8b[_0x5361('0x118')](_0xfb2e80,_0x27f8a6,_0x2e0fdb,_0x5361('0x19f'));}}break;case'8':_0x29cdb5['outboundCongestionCallsDay']+=0x1;_0xfb2e80['state']=0x8;_0xfb2e80[_0x5361('0xbc')]=_0x5361('0x1a0');_0xfb2e80[_0x5361('0x107')]+=0x1;_0xfb2e80['countglobal']+=0x1;_0x4afb22=_0x29cdb5[_0x5361('0x184')];_0x3e5290=_0x29cdb5[_0x5361('0xc1')];ami[_0x5361('0xff')](_0x5361('0x1a1'),ut[_0x5361('0x114')](_0x229164,_0x5361('0x1a2')));hopperUtils[_0x5361('0xce')](_0xfb2e80)[_0x5361('0x8c')](loggerCatch(_0x5361('0x1a3')));if(_0x438f8b[_0x5361('0x17d')](0x8,_0x229164,_0x29cdb5)&&!_0x5d9e6e){if(_0xfb2e80['countcongestionretry']>=_0x29cdb5['dialCongestionMaxRetry']){_0x438f8b[_0x5361('0x10d')](_0xfb2e80,_0x27f8a6,_0x2e0fdb,_0x5361('0x1a4'));}else{_0x438f8b[_0x5361('0x118')](_0xfb2e80,_0x27f8a6,_0x2e0fdb,_0x5361('0x1a4'));}}break;case'11':_0x29cdb5[_0x5361('0x1a5')]+=0x1;_0xfb2e80[_0x5361('0x5d')]=0xb;_0xfb2e80[_0x5361('0xbc')]=_0x5361('0xd2');_0xfb2e80[_0x5361('0xd4')]+=0x1;_0xfb2e80[_0x5361('0xbf')]+=0x1;_0x4afb22=_0x29cdb5[_0x5361('0xd3')];_0x3e5290=_0x29cdb5[_0x5361('0xc1')];hopperUtils[_0x5361('0xce')](_0xfb2e80)[_0x5361('0x8c')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x438f8b[_0x5361('0x17d')](0xb,_0x229164,_0x29cdb5)&&!_0x5d9e6e){if(_0xfb2e80[_0x5361('0xd4')]>=_0x29cdb5[_0x5361('0xd5')]){_0x438f8b[_0x5361('0x10d')](_0xfb2e80,_0x27f8a6,_0x2e0fdb,'reason\x2011\x20abandoned');}else{_0x438f8b[_0x5361('0x118')](_0xfb2e80,_0x27f8a6,_0x2e0fdb,_0x5361('0x1a6'));}}break;case'20':_0x29cdb5[_0x5361('0x1a7')]+=0x1;_0xfb2e80[_0x5361('0x5d')]=0x14;_0xfb2e80[_0x5361('0xbc')]=_0x5361('0x1a8');_0xfb2e80[_0x5361('0x10b')]+=0x1;_0xfb2e80[_0x5361('0xbf')]+=0x1;_0x4afb22=_0x29cdb5[_0x5361('0x18a')];_0x3e5290=_0x29cdb5[_0x5361('0xc1')];ami['emit'](_0x5361('0x1a9'),ut[_0x5361('0x114')](_0x229164,_0x5361('0x1aa')));hopperUtils[_0x5361('0xce')](_0xfb2e80)[_0x5361('0x8c')](loggerCatch(_0x5361('0x1ab')));if(_0x438f8b[_0x5361('0x17d')](0x14,_0x229164,_0x29cdb5)&&!_0x5d9e6e){if(_0xfb2e80[_0x5361('0x10b')]>=_0x29cdb5[_0x5361('0x189')]){_0x438f8b[_0x5361('0x10d')](_0xfb2e80,_0x27f8a6,_0x2e0fdb,'reason\x2020\x20agentreject');}else{_0x438f8b[_0x5361('0x118')](_0xfb2e80,_0x27f8a6,_0x2e0fdb,_0x5361('0x1ac'));}}break;default:_0x29cdb5[_0x5361('0x11f')]+=0x1;_0xfb2e80[_0x5361('0x5d')]=0xc;_0xfb2e80[_0x5361('0xbc')]=_0x185535[_0x5361('0xb0')];_0x4afb22=_0x29cdb5[_0x5361('0x18a')];_0x3e5290=_0x29cdb5[_0x5361('0xc1')];hopperUtils[_0x5361('0xce')](_0xfb2e80)[_0x5361('0x8c')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x438f8b['checkRetriveMax'](_0x185535[_0x5361('0xb0')],_0x229164,_0x29cdb5)&&!_0x5d9e6e){if(_0xfb2e80[_0x5361('0x106')]+_0xfb2e80[_0x5361('0x107')]+_0xfb2e80[_0x5361('0x108')]+_0xfb2e80['countnosuchnumberretry']+_0xfb2e80[_0x5361('0xbe')]+_0xfb2e80[_0x5361('0xd4')]+_0xfb2e80['countmachineretry']+_0xfb2e80[_0x5361('0x10b')]>=_0x29cdb5[_0x5361('0x117')]){_0x438f8b['stateGlobal'](_0xfb2e80,_0x27f8a6,_0x2e0fdb,_0x185535[_0x5361('0xb0')]);}else{_0x438f8b[_0x5361('0x10d')](_0xfb2e80,_0x27f8a6,_0x2e0fdb,_0x185535[_0x5361('0xb0')]);}}}})[_0x5361('0x33')](function(){if(_0x5d9e6e){hopperUtils['swapAdditionalPhones'](_0xfb2e80,_0x4afb22,_0x3e5290)[_0x5361('0x33')](function(){return _0x27f8a6(0x1);});}});});};Dialer[_0x5361('0x15')][_0x5361('0x118')]=function(_0xf0024a,_0x2dcdcc,_0x2c398d,_0x305a3f){var _0x176f92=new Final(_0xf0024a);_0x176f92[_0x5361('0x5d')]=0xf;_0x176f92[_0x5361('0xbc')]='Global';this['createStateFinal'](_0x176f92,_0x2dcdcc,_0x2c398d,_0x305a3f);};Dialer[_0x5361('0x15')][_0x5361('0x10d')]=function(_0x4f1ba4,_0x111a4f,_0x13b5b7,_0x399610){hopperUtils['moveContactManagedDialer'](_0x4f1ba4)[_0x5361('0x33')](function(){return _0x111a4f(msgResponse('[callProgressDetecting]','Success',_0x399610));})[_0x5361('0x8c')](function(){return _0x13b5b7(msgResponse('[moveContactManagedDialer][0]',_0x5361('0x7c'),'contact\x20not\x20moved'));});};Dialer[_0x5361('0x15')][_0x5361('0x9f')]=function(_0x1d33fb){var _0x279126=_0x1d33fb[_0x5361('0x1ad')]/0x64;var _0x816782=_0x1d33fb[_0x5361('0xbb')]/(_0x1d33fb['outboundDropCallsDayTimeout']+_0x1d33fb[_0x5361('0xaf')]);var _0x5af75c=Math['round'](_0x1d33fb[_0x5361('0x1ae')]*(_0x1d33fb[_0x5361('0x1af')]/0x64));var _0x511eb7=Math[_0x5361('0x1b0')](_0x1d33fb[_0x5361('0x1ae')]*(_0x1d33fb[_0x5361('0x1b1')]/0x64));var _0x1e841c=_0x1d33fb[_0x5361('0x126')]+_0x1d33fb['talking'];var _0x36a53d=Math['floor'](_0x1d33fb['erlangCalls']*_0x1d33fb['erlangAbandonmentRate']*_0x1d33fb['predictiveIntervalHitRate']*_0x1d33fb[_0x5361('0x1b2')]);if(_[_0x5361('0x34')](_0x1d33fb[_0x5361('0x4f')])){if(!_[_0x5361('0x34')](_0x1d33fb[_0x5361('0x51')])){_0x1d33fb['startPredictive']=undefined;loggerPredictive['error'](_0x5361('0x1b3'),_0x5361('0x1b4'));}if(!_[_0x5361('0x34')](_0x1d33fb['handlePredictive'])){loggerPredictive[_0x5361('0x54')](_0x5361('0x1b3'),_0x5361('0x1b5'));clearInterval(_0x1d33fb[_0x5361('0x52')]);_0x1d33fb['handlePredictive']=undefined;}_0x1d33fb[_0x5361('0x4f')]=moment()[_0x5361('0x3a')](_0x5361('0xad'));loggerPredictive[_0x5361('0x3d')](_0x1d33fb[_0x5361('0x3c')],_0x5361('0x1b6'),_0x1d33fb[_0x5361('0x4f')]);this[_0x5361('0x9d')](_0x1d33fb,0x1);}else if(ifInterval(_0x1d33fb[_0x5361('0x1b7')],_0x1d33fb[_0x5361('0x4f')])){this['handlePower'](_0x1d33fb,0x1);loggerPredictiveCalls[_0x5361('0x3d')](_0x5361('0x1b8'),_0x1d33fb[_0x5361('0x4f')],_0x1d33fb['name']);_0x1d33fb[_0x5361('0x48')]=0x0;_0x1d33fb[_0x5361('0x1b9')]=0x0;}else if(_0x279126<_0x816782&&_0x1d33fb[_0x5361('0x1ba')]===_0x5361('0x1bb')){clearPredictiveAttributes(_0x1d33fb);loggerPredictive[_0x5361('0x3d')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x5361('0x1bc'),_0x816782,_0x5361('0x4f'),_0x1d33fb[_0x5361('0x3c')]);}else if(_0x36a53d<_0x1d33fb[_0x5361('0x1b9')]&&_0x1d33fb[_0x5361('0x1ba')]===_0x5361('0x1bb')){clearPredictiveAttributes(_0x1d33fb);loggerPredictive[_0x5361('0x3d')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x5361('0x1bd'),_0x36a53d,_0x5361('0x1be'),_0x1d33fb[_0x5361('0x1b9')],'startProgressive',_0x1d33fb[_0x5361('0x3c')]);}else if(!ifInterval(_0x1d33fb[_0x5361('0x1b7')],_0x1d33fb[_0x5361('0x4f')])&&_[_0x5361('0x34')](_0x1d33fb[_0x5361('0x51')])&&!_[_0x5361('0x34')](_0x1d33fb[_0x5361('0x4f')])){_0x1d33fb['startPredictive']=moment()['format'](_0x5361('0xad'));loggerPredictive[_0x5361('0x3d')](_0x1d33fb[_0x5361('0x3c')],'started\x20in\x20predictive\x20at',_0x1d33fb['startPredictive']);hopperUtils[_0x5361('0x1bf')](_0x1d33fb['dialPredictiveInterval'])[_0x5361('0x33')](this['getDataPredictive'](_0x1d33fb))[_0x5361('0x33')](mergeDataErlangB(_0x1d33fb))['then'](this[_0x5361('0x1c0')](_0x1d33fb))['catch'](loggerCatchPredictive(_0x5361('0x1c1'),_0x1d33fb));}else if(!ifInterval(_0x1d33fb[_0x5361('0x1b7')],_0x1d33fb[_0x5361('0x51')])){_0x1d33fb[_0x5361('0x1b9')]=0x0;_0x1d33fb[_0x5361('0x51')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x1d33fb[_0x5361('0x3c')],_0x5361('0x1c2'),_0x1d33fb[_0x5361('0x51')]);clearInterval(_0x1d33fb[_0x5361('0x52')]);_0x1d33fb['handlePredictive']=undefined;hopperUtils['avgHandleTime'](_0x1d33fb[_0x5361('0x1b7')])[_0x5361('0x33')](this[_0x5361('0x1c3')](_0x1d33fb))[_0x5361('0x33')](mergeDataErlangB(_0x1d33fb))[_0x5361('0x33')](this['startMethodPredictive'](_0x1d33fb))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x1d33fb));}else if(_0x1d33fb[_0x5361('0x1ae')]&&_0x1e841c<_0x1d33fb['predictiveIntervalAvailable']-_0x511eb7){clearPredictiveAttributes(_0x1d33fb);loggerPredictive[_0x5361('0x3d')](_0x1d33fb['name'],_0x5361('0x1c4'),_0x1e841c,_0x5361('0x1c5'),_0x1d33fb[_0x5361('0x1ae')],'-',_0x511eb7,'=',_0x1d33fb[_0x5361('0x1ae')]-_0x511eb7,')');}else if(_0x1d33fb[_0x5361('0x1ae')]&&_0x1e841c>_0x1d33fb[_0x5361('0x1ae')]+_0x5af75c){clearPredictiveAttributes(_0x1d33fb);loggerPredictive[_0x5361('0x3d')](_0x1d33fb[_0x5361('0x3c')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x1e841c,_0x5361('0x1c6'),_0x1d33fb[_0x5361('0x1ae')],'+',_0x5af75c,'=',_0x1d33fb[_0x5361('0x1ae')]+_0x5af75c,')');}};Dialer[_0x5361('0x15')][_0x5361('0x1c3')]=function(_0x5285b8){var _0x2e3784=this;return function(_0x337f21){return new Promise(function(_0x4c3185,_0x36a4c4){_[_0x5361('0x4d')](_0x5285b8,_0x337f21[0x0]);if(checkGetDataPredictive(_0x337f21[0x0])){var _0x49ef6c=_0x5285b8[_0x5361('0x1ae')]=_0x5285b8['talking']+_0x5285b8[_0x5361('0x126')];var _0x4aac79=_0x5285b8['dialPredictiveInterval']*0x3c;var _0x574a7f=_0x337f21[0x0][_0x5361('0x1c7')]+_0x337f21[0x0][_0x5361('0x46')];var _0x57fd42=(_0x337f21[0x0][_0x5361('0x1c8')]+_0x337f21[0x0][_0x5361('0x40')]+_0x337f21[0x0][_0x5361('0x1c9')])/_0x337f21[0x0][_0x5361('0x3e')];_0x5285b8[_0x5361('0x1ca')]=_0x57fd42>0x0?_0x57fd42:0x1;switch(_0x5285b8[_0x5361('0x1ba')]){case _0x5361('0x1bb'):var _0xbe64af=_0x5285b8[_0x5361('0x1ad')]/0x64;return _0x2e3784[_0x5361('0x1cb')](_0x49ef6c,_0x4aac79,_0x574a7f,_0x57fd42,_0xbe64af)['then'](function(_0x51c41){return _0x4c3185(_0x51c41);});case _0x5361('0x1cc'):var _0x39b897=_0x5285b8[_0x5361('0x1ad')]/0x64;return _0x2e3784[_0x5361('0x1cd')](_0x49ef6c,_0x4aac79,_0x574a7f,_0x57fd42,_0x39b897)[_0x5361('0x33')](function(_0x1c772c){return _0x4c3185(_0x1c772c);});default:return _0x36a4c4(msgResponse('[getDataPredictive]',_0x5361('0x7c'),_0x5361('0x1ce')));}}else{return _0x36a4c4(msgResponse('[getDataPredictive]',_0x5361('0x7c'),_0x5361('0x1cf')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x1fde42){var _0x58cde8=this;return function(_0x11e244){return new Promise(function(_0x52f5b6,_0x54c803){_[_0x5361('0x4d')](_0x1fde42,_0x11e244[0x0]);if(checkGetDataPredictive(_0x11e244[0x0])){loggerPredictive['info'](JSON['stringify'](_0x11e244[0x0]));if(_0x1fde42[_0x5361('0x1ba')]===_0x5361('0x1bb')){return _0x58cde8[_0x5361('0x13d')](_0x1fde42['id'])[_0x5361('0x33')](function(_0x5ad85c){var _0x3edbf0=_0x1fde42[_0x5361('0x1d0')]-_0x5ad85c[0x0][_0x5361('0x1d1')];var _0x14d2ec=_0x1fde42[_0x5361('0x1b7')]*0x3c;var _0x5a7837=_0x11e244[0x0][_0x5361('0x1c7')]+_0x11e244[0x0][_0x5361('0x46')];var _0x473151=(_0x11e244[0x0][_0x5361('0x1c8')]+_0x11e244[0x0][_0x5361('0x40')]+_0x11e244[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x11e244[0x0][_0x5361('0x3e')];var _0x1b3e8a=_0x1fde42[_0x5361('0x1ad')]/0x64;_0x1fde42[_0x5361('0x1d2')]=_0x5ad85c[0x0][_0x5361('0x1d1')]||0x0;_0x1fde42[_0x5361('0x1ca')]=_0x473151>0x0?_0x473151:0x1;return _0x58cde8[_0x5361('0x1cb')](_0x3edbf0,_0x14d2ec,_0x5a7837,_0x473151,_0x1b3e8a);})[_0x5361('0x33')](function(_0x4d2729){return _0x52f5b6(_0x4d2729);})[_0x5361('0x8c')](function(_0x5abb3f){return _0x54c803(msgResponse(_0x5361('0x1d3'),_0x5361('0x7c'),JSON[_0x5361('0x62')](_0x5abb3f)));});}if(_0x1fde42['dialPredictiveOptimization']===_0x5361('0x1cc')){return _0x58cde8[_0x5361('0x13d')](_0x1fde42['id'])[_0x5361('0x33')](function(_0xee9a4c){var _0x2f2ed1=_0x1fde42[_0x5361('0x1d0')]-_0xee9a4c[0x0][_0x5361('0x1d1')];var _0x2c040e=_0x1fde42['dialPredictiveInterval']*0x3c;var _0x97e9eb=_0x11e244[0x0]['predictiveIntervalAvgTalktime']+_0x11e244[0x0]['predictiveIntervalAvgHoldtime'];var _0x4a8be7=(_0x11e244[0x0]['predictiveIntervalAnsweredCalls']+_0x11e244[0x0][_0x5361('0x40')]+_0x11e244[0x0][_0x5361('0x1c9')])/_0x11e244[0x0][_0x5361('0x3e')];var _0x511392=_0x1fde42[_0x5361('0x1ad')]/0x64;_0x1fde42[_0x5361('0x1d2')]=_0xee9a4c[0x0]['outboundQueuePauses']||0x0;_0x1fde42[_0x5361('0x1ca')]=_0x4a8be7>0x0?_0x4a8be7:0x1;return _0x58cde8[_0x5361('0x1cd')](_0x2f2ed1,_0x2c040e,_0x97e9eb,_0x4a8be7,_0x511392);})[_0x5361('0x33')](function(_0x370ace){return _0x52f5b6(_0x370ace);})['catch'](function(_0x5ec4c9){return _0x54c803(msgResponse('[CatchErlangB]',_0x5361('0x7c'),JSON['stringify'](_0x5ec4c9)));});}}else{return _0x54c803(msgResponse('[getDataPredictive]','Failure',_0x5361('0x1cf')));}});};};Dialer[_0x5361('0x15')]['startMethodPredictive']=function(_0x30040d){var _0x473b71=this;return function(){var _0x3034f7=0x0;var _0x3571fa=Math[_0x5361('0x1d4')](_0x30040d['erlangCallToSecond']*0x3e8);if(_0x3571fa>0x0){_0x3571fa=_0x3571fa<0x64?0x64:_0x3571fa;loggerPredictive['info'](_0x30040d[_0x5361('0x3c')],_0x5361('0x1d5'),_0x3571fa,_0x5361('0x1d6'));_0x30040d['handlePredictive']=setInterval(function(){_0x473b71['handlePredictive'](_0x30040d);loggerPredictiveCalls[_0x5361('0x3d')](_0x5361('0x1d7'),_0x3034f7+=0x1);},_0x3571fa);}else{loggerPredictive['info'](_0x30040d[_0x5361('0x3c')],_0x5361('0x1d8'));}};};Dialer[_0x5361('0x15')][_0x5361('0x1d9')]=function(_0x270081,_0x244da9){var _0x10bce6=this;return function(_0x3c0912){if(_[_0x5361('0x68')](_0x3c0912)){if(_[_0x5361('0xe0')](_0x244da9['UserId'])||!_0x244da9[_0x5361('0x1da')]){if(_0x270081[_0x5361('0x9b')]===_0x5361('0x8')){_0x270081[_0x5361('0x60')]=_[_0x5361('0x34')](_0x270081['queueStatusComplete'])?!![]:_0x270081[_0x5361('0x60')];var _0x2bf19b=uuid['v4']();_0x10bce6[_0x5361('0xda')][_0x2bf19b]=new Action(_0x270081,_0x244da9,_0x2bf19b);loggerBooked[_0x5361('0x3d')]('[booked][checkContactBlack]',_0x2bf19b,'queueStatusComplete:\x20',JSON['stringify'](_0x270081[_0x5361('0x60')]),_0x5361('0x1db'),_0x270081[_0x5361('0x3c')]);if(_0x270081[_0x5361('0x60')]){_0x270081['queueStatusComplete']=![];_0x10bce6[_0x5361('0x1e')][_0x10bce6[_0x5361('0xda')][_0x2bf19b][_0x5361('0xaa')]]=[];ami[_0x5361('0x85')]({'actionid':_0x2bf19b,'action':'queuestatus','queue':_0x270081['name']})[_0x5361('0x8c')](function(){_0x10bce6['updateOriginated'](_0x270081);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x10bce6[_0x5361('0xda')][_0x2bf19b]['ContactId'],'ListId':_0x10bce6[_0x5361('0xda')][_0x2bf19b]['ListId'],'VoiceQueueId':_0x10bce6[_0x5361('0xda')][_0x2bf19b]['VoiceQueueId']||undefined,'CampaignId':_0x10bce6[_0x5361('0xda')][_0x2bf19b]['CampaignId']||undefined})[_0x5361('0x8c')](loggerCatch(_0x5361('0x1dc')));delete _0x10bce6[_0x5361('0xda')][_0x2bf19b];});}else{loggerBooked[_0x5361('0x3d')](_0x5361('0x1dd'),JSON['stringify'](_0x270081[_0x5361('0x60')]),_0x5361('0x1db'),_0x270081[_0x5361('0x3c')]);_0x10bce6[_0x5361('0xb7')](_0x270081);hopperUtils[_0x5361('0xc5')]({'active':![],'ContactId':_0x10bce6['actions'][_0x2bf19b][_0x5361('0xc7')],'ListId':_0x10bce6[_0x5361('0xda')][_0x2bf19b][_0x5361('0xea')],'VoiceQueueId':_0x10bce6[_0x5361('0xda')][_0x2bf19b][_0x5361('0xc8')]||undefined,'CampaignId':_0x10bce6['actions'][_0x2bf19b][_0x5361('0xc9')]||undefined})[_0x5361('0x8c')](loggerCatch(_0x5361('0x1dc')));delete _0x10bce6['actions'][_0x2bf19b];}}else{return _0x10bce6[_0x5361('0x14a')](_0x270081,_0x244da9);}}else{if(utils[_0x5361('0x4e')](undefined,_0x244da9['scheduledat'])<_0x270081[_0x5361('0x1de')]*0x3c){if(_0x244da9[_0x5361('0x134')]&&!_0x244da9[_0x5361('0x134')][_0x5361('0x1df')]){_0x10bce6['preview'][_0x5361('0xe8')](_0x244da9['id'])[_0x5361('0x18')](function(){_0x10bce6[_0x5361('0xb7')](_0x270081);});}else{hopperUtils[_0x5361('0x1e0')]({'active':![]},_0x244da9['id'],0x1)[_0x5361('0x18')](function(){_0x10bce6[_0x5361('0xb7')](_0x270081);});}}else{_0x270081['outboundReCallsDay']+=0x1;_0x10bce6['updateOriginated'](_0x270081);if(_0x270081[_0x5361('0x1e1')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x244da9[_0x5361('0xc7')],'ListId':_0x244da9[_0x5361('0xea')],'VoiceQueueId':_0x244da9[_0x5361('0xc8')]||undefined,'CampaignId':_0x244da9[_0x5361('0xc9')]||undefined})[_0x5361('0x8c')](loggerCatch(_0x5361('0x1e2')));hopperUtils[_0x5361('0xce')](createObjHistory(_0x270081,_0x244da9,utils[_0x5361('0x58')][_0x5361('0x1e3')],0x17,_0x5361('0x1e4')))[_0x5361('0x8c')](loggerCatch(_0x5361('0x1e5')));}else{_0x10bce6['saveInDb'](createObjHistory(_0x270081,_0x244da9,utils[_0x5361('0x58')][_0x5361('0x1e6')],0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]',_0x5361('0x1e7'));}}}}else{_0x270081[_0x5361('0x1e8')]+=0x1;_0x10bce6['saveInDb'](createObjHistory(_0x270081,_0x244da9,utils[_0x5361('0x58')]['BLACKLIST'],0xd,_0x5361('0x1e9')),_0x5361('0x1ea'),_0x5361('0x1eb'));throw _0x5361('0x1ec');}};};Dialer[_0x5361('0x15')]['handleIvr']=function(_0x362063){var _0x1a6896=this;var _0xb4a4a9=_0x362063['limitCalls']-_0x362063[_0x5361('0x13f')]-_0x362063[_0x5361('0x1ed')];emitCampaignSummary(_0x362063);if(_0xb4a4a9>0x0){if(_0xb4a4a9>this[_0x5361('0x1ee')]){_0xb4a4a9=this[_0x5361('0x1ee')];}_0x362063[_0x5361('0x1ed')]+=_0xb4a4a9;hopperUtils[_0x5361('0x1ef')](_0x362063['id'],_0xb4a4a9,_0x362063[_0x5361('0x1f0')],_0x362063)[_0x5361('0x33')](function(_0x28c89e){_0x362063[_0x5361('0x1ed')]-=_0xb4a4a9;_0x362063[_0x5361('0x1ed')]=_0x362063['temp']>0x0?_0x362063[_0x5361('0x1ed')]:0x0;if(!utils['checkContactEmpty'](_0x28c89e)){_0x362063['message']=utils['CAMPAIGN_STATUS']['NO_AVAILABLE_CONTACTS'];logger[_0x5361('0x3d')]('[getContactCampaign2][Empty]'+_0x362063[_0x5361('0x3c')]);}else{_0x362063[_0x5361('0x13f')]+=_0x28c89e[_0x5361('0x83')];_0x362063[_0x5361('0x57')]=utils['CAMPAIGN_STATUS'][_0x5361('0x1f1')];for(var _0xed11cb=0x0;_0xed11cb<_0x28c89e[_0x5361('0x83')];_0xed11cb+=0x1){_0x362063['ivrTotalCallsDays']+=0x1;if(_[_0x5361('0xe0')](_0x28c89e[_0xed11cb])||_[_0x5361('0xe0')](_0x28c89e[_0xed11cb][_0x5361('0x161')])||_['isNil'](_0x28c89e[_0xed11cb]['phone'])){_0x1a6896['emptyContact'](_0x5361('0x1f2'),_0x362063,_0x28c89e[_0xed11cb]);}else{hopperUtils[_0x5361('0x1f3')](_[_0x5361('0x63')](_0x28c89e[_0xed11cb],['CampaignId',_0x5361('0x14c')]))[_0x5361('0x33')](_0x1a6896[_0x5361('0x1d9')](_0x362063,_0x28c89e[_0xed11cb]))[_0x5361('0x8c')](_0x1a6896[_0x5361('0x142')](_0x5361('0x1f4'),_0x362063));}}}})[_0x5361('0x8c')](loggerGetContactDialer(_0x5361('0x1f5'),_0x362063,_0xb4a4a9));}};Dialer[_0x5361('0x15')]['handlePower']=function(_0x16b39f,_0x381931){var _0x3089f4=this;var _0x440d6b=[];if(_0x381931<0x1||_0x16b39f[_0x5361('0x9b')]===_0x5361('0x8')){_0x381931=0x1;}var _0xf2e7a6=Math[_0x5361('0x1d4')](_0x16b39f[_0x5361('0x126')]*_0x381931)-_0x16b39f[_0x5361('0x13f')]-_0x16b39f[_0x5361('0x1ed')];if(_0x16b39f[_0x5361('0x1f6')]>0x0){var _0x369f3c=_0x16b39f[_0x5361('0x1f6')]-_0x16b39f['originated']-_0x16b39f[_0x5361('0x128')]-_0x16b39f['temp']-_0x16b39f['pTalking'];if(_0xf2e7a6>_0x369f3c){_0xf2e7a6=_0x369f3c;}}if(_0xf2e7a6>0x0){if(_0x16b39f['dialMethod']===_0x5361('0x8')){_0xf2e7a6=0x1;}if(_0xf2e7a6>this[_0x5361('0x1ee')]){_0xf2e7a6=this[_0x5361('0x1ee')];}_0x16b39f[_0x5361('0x1ed')]+=_0xf2e7a6;for(var _0x2a7c29 in this[_0x5361('0x1c')]){if(typeof this['agents'][_0x2a7c29]!=='undefined'){if(this['agents'][_0x2a7c29][_0x5361('0x5d')]===_0x5361('0x1f7')&&this[_0x5361('0x1c')][_0x2a7c29][_0x5361('0x73')]===_0x5361('0x72')){_0x440d6b[_0x5361('0x84')](this[_0x5361('0x1c')][_0x2a7c29]['id']);}}}hopperUtils[_0x5361('0x1f8')](_0x16b39f,_0x440d6b,_0xf2e7a6)['then'](function(_0x177043){_0x16b39f[_0x5361('0x1ed')]-=_0xf2e7a6;_0x16b39f['temp']=_0x16b39f['temp']>0x0?_0x16b39f[_0x5361('0x1ed')]:0x0;if(!utils[_0x5361('0x1f9')](_0x177043)){hopperUtils['countReScheduled'](_0x16b39f)[_0x5361('0x33')](sendMessageReschedule(_0x16b39f))[_0x5361('0x8c')](loggerCatch(_0x5361('0x1fa')));}else{_0x16b39f[_0x5361('0x13f')]+=_0x177043[_0x5361('0x83')];_0x16b39f[_0x5361('0x57')]=_0x16b39f[_0x5361('0x9b')]===_0x5361('0x8')?utils[_0x5361('0x58')][_0x5361('0x129')]:utils[_0x5361('0x58')][_0x5361('0x1f1')];for(var _0x1ef76d=0x0;_0x1ef76d<_0x177043['length'];_0x1ef76d+=0x1){if(_[_0x5361('0xe0')](_0x177043[_0x1ef76d])||_['isNil'](_0x177043[_0x1ef76d][_0x5361('0x161')])||_[_0x5361('0xe0')](_0x177043[_0x1ef76d][_0x5361('0x14c')])){_0x3089f4['emptyContact'](_0x5361('0x1f2'),_0x16b39f,_0x177043[_0x1ef76d]);}else{hopperUtils[_0x5361('0x1fb')](_[_0x5361('0x63')](_0x177043[_0x1ef76d],['VoiceQueueId','phone']))[_0x5361('0x33')](_0x3089f4[_0x5361('0x1d9')](_0x16b39f,_0x177043[_0x1ef76d]))[_0x5361('0x8c')](_0x3089f4[_0x5361('0x142')](_0x5361('0x1f2'),_0x16b39f));}}}})[_0x5361('0x8c')](loggerGetContactDialer(_0x5361('0x1fc'),_0x16b39f,_0xf2e7a6));}};Dialer['prototype']['handlePredictive']=function(_0x399e0a){if(_0x399e0a[_0x5361('0x1f6')]>0x0){var _0x17f6db=_0x399e0a[_0x5361('0x1f6')]-_0x399e0a[_0x5361('0x13f')]-_0x399e0a['talking'];if(_0x17f6db>0x0){this['tryOriginatePredictive'](_0x399e0a);}else{loggerPredictiveCalls[_0x5361('0x3d')](_0x5361('0x1fd'));}}else{this[_0x5361('0x1fe')](_0x399e0a);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x3815e6){var _0x4c6e70=this;var _0x2fa828=[];_0x3815e6['originated']+=0x1;for(var _0x374e4a in this['agents']){if(typeof this[_0x5361('0x1c')][_0x374e4a]!=='undefined'){if(this[_0x5361('0x1c')][_0x374e4a][_0x5361('0x5d')]===_0x5361('0x1f7')&&this['agents'][_0x374e4a][_0x5361('0x73')]===_0x5361('0x72')){_0x2fa828['push'](this[_0x5361('0x1c')][_0x374e4a]['id']);}}}return this[_0x5361('0x1f8')](_0x3815e6['id'],_0x2fa828,0x1,_0x3815e6[_0x5361('0x1f0')],_0x3815e6)[_0x5361('0x33')](function(_0x43e7fe){if(!utils[_0x5361('0x1f9')](_0x43e7fe)){utils[_0x5361('0x1ff')](_0x3815e6,0x1,0x0);return hopperUtils['countReScheduled'](_0x3815e6)[_0x5361('0x33')](sendMessageReschedule(_0x3815e6))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x3815e6[_0x5361('0x57')]=utils[_0x5361('0x58')][_0x5361('0x1f1')];if(_[_0x5361('0xe0')](_0x43e7fe[0x0])||_[_0x5361('0xe0')](_0x43e7fe[0x0]['Contact'])||_[_0x5361('0xe0')](_0x43e7fe[0x0][_0x5361('0x14c')])){_0x4c6e70[_0x5361('0x143')](_0x5361('0x1f2'),_0x3815e6,_0x43e7fe[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0x5361('0x63')](_0x43e7fe[0x0],[_0x5361('0xc8'),_0x5361('0x14c')]))[_0x5361('0x33')](_0x4c6e70[_0x5361('0x1d9')](_0x3815e6,_0x43e7fe[0x0]))[_0x5361('0x8c')](_0x4c6e70['loggerHandler'](_0x5361('0x200'),_0x3815e6));}}})[_0x5361('0x8c')](loggerGetContactDialer(_0x5361('0x201'),_0x3815e6,0x1));};Dialer[_0x5361('0x15')][_0x5361('0x1cb')]=function(_0x2e66d2,_0x465b2d,_0x5600b7,_0x580ce,_0xd4f325,_0x161560){loggerPredictive[_0x5361('0x3d')](_0x5361('0x202'));loggerPredictive['info'](_0x5361('0x203'),_0x2e66d2);loggerPredictive[_0x5361('0x3d')](_0x5361('0x204'),_0x465b2d);loggerPredictive[_0x5361('0x3d')](_0x5361('0x205'),_0x5600b7);loggerPredictive[_0x5361('0x3d')](_0x5361('0x206'),_0x580ce);loggerPredictive[_0x5361('0x3d')](_0x5361('0x207'),_0xd4f325);loggerPredictive[_0x5361('0x3d')](_0x5361('0x44'));return new Promise(function(_0x36ae34,_0x4d97a9){if(_0x2e66d2<=0x0||isNaN(_0x2e66d2)){return _0x4d97a9(msgResponse('[abandonmentRate]',_0x5361('0x70'),'m\x20=\x20'+_0x2e66d2));}if(_0x5600b7<=0x0||isNaN(_0x5600b7)){return _0x4d97a9(msgResponse('[abandonmentRate]','Error',_0x5361('0x208')+_0x5600b7));}if(_0x580ce<=0x0||isNaN(_0x580ce)){return _0x4d97a9(msgResponse('[abandonmentRate]',_0x5361('0x70'),'p\x20=\x20'+_0x580ce));}if(_0x465b2d<=0x0||isNaN(_0x465b2d)){return _0x4d97a9(msgResponse(_0x5361('0x209'),'Error',_0x5361('0x20a')+_0x465b2d));}if(_0xd4f325<=0x0||isNaN(_0xd4f325)){return _0x4d97a9(msgResponse(_0x5361('0x209'),_0x5361('0x70'),_0x5361('0x20b')+_0xd4f325));}_0x161560=_0x161560||0x0;var _0x40230f=0x1/_0x5600b7;var _0xb43c1b=0x0;var _0x397e01=0x0;var _0x2a9a28=0x0;var _0xf57f0d=0x0;for(var _0x3d058d=0x0;_0x2a9a28<_0xd4f325;_0x3d058d+=0x1){_0x397e01=_0x3d058d/_0x465b2d;_0xb43c1b=(_0x580ce*_0x397e01+_0x161560)/_0x40230f;_0x2a9a28=utils['erlangb'](_0xb43c1b,_0x2e66d2);_0xf57f0d=_0xb43c1b/_0x2e66d2*(0x1-utils[_0x5361('0x20c')](_0xb43c1b,_0x2e66d2));}return _0x36ae34({'erlangCalls':_0x3d058d,'erlangCallToSecond':_0x465b2d/_0x3d058d,'erlangAbandonmentRate':_0x2a9a28,'erlangBusyFactor':_0xf57f0d});});};Dialer[_0x5361('0x15')]['busyFactor']=function(_0x4042a5,_0x10183a,_0x59d4fe,_0x23cd5d,_0x411490,_0x37b8ce){loggerPredictive['info'](_0x5361('0x20d'));loggerPredictive[_0x5361('0x3d')](_0x5361('0x203'),_0x4042a5);loggerPredictive['info'](_0x5361('0x204'),_0x10183a);loggerPredictive[_0x5361('0x3d')](_0x5361('0x205'),_0x59d4fe);loggerPredictive[_0x5361('0x3d')](_0x5361('0x206'),_0x23cd5d);loggerPredictive[_0x5361('0x3d')](_0x5361('0x20e'),_0x411490);loggerPredictive['info'](_0x5361('0x44'));return new Promise(function(_0xb0ca57,_0x15606d){if(_0x4042a5<=0x0||isNaN(_0x4042a5)){return _0x15606d(msgResponse(_0x5361('0x20f'),_0x5361('0x70'),_0x5361('0x210')+_0x4042a5));}if(_0x59d4fe<=0x0||isNaN(_0x59d4fe)){return _0x15606d(msgResponse(_0x5361('0x20f'),'Error',_0x5361('0x208')+_0x59d4fe));}if(_0x23cd5d<=0x0||isNaN(_0x23cd5d)){return _0x15606d(msgResponse('[busyFactor]',_0x5361('0x70'),_0x5361('0x211')+_0x23cd5d));}if(_0x10183a<=0x0||isNaN(_0x10183a)){return _0x15606d(msgResponse(_0x5361('0x20f'),_0x5361('0x70'),_0x5361('0x20a')+_0x10183a));}if(_0x411490<=0x0||isNaN(_0x411490)){return _0x15606d(msgResponse(_0x5361('0x20f'),_0x5361('0x70'),'Umin\x20=\x20'+_0x411490));}_0x37b8ce=_0x37b8ce||0x0;var _0x11dc21=0x1/_0x59d4fe;var _0x35fb93=0x0;var _0x177932=0x0;var _0x23fbe2=0x0;var _0x271433=0x0;for(var _0x58259c=0x0;_0x271433<_0x411490;_0x58259c+=0x1){_0x177932=_0x58259c/_0x10183a;_0x35fb93=(_0x23cd5d*_0x177932+_0x37b8ce)/_0x11dc21;_0x23fbe2=utils['erlangb'](_0x35fb93,_0x4042a5);_0x271433=_0x35fb93/_0x4042a5*(0x1-utils[_0x5361('0x20c')](_0x35fb93,_0x4042a5));}return _0xb0ca57({'erlangCalls':_0x58259c,'erlangCallToSecond':_0x10183a/_0x58259c,'erlangAbandonmentRate':_0x23fbe2,'erlangBusyFactor':_0x271433});});};module[_0x5361('0x212')]=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 0342986..442c20d 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 _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 +var _0x0672=['UserId','VoiceQueueId','CampaignId','firstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','dialCutDigit','getQueue','exports','moment','isNil','string','voiceQueue','uniqueid','Contact','lastName','number','phone','name','active','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId'];(function(_0x1edd1c,_0x44f430){var _0x16dde7=function(_0xe6adfd){while(--_0xe6adfd){_0x1edd1c['push'](_0x1edd1c['shift']());}};_0x16dde7(++_0x44f430);}(_0x0672,0x101));var _0x2067=function(_0x163f58,_0x1c8ae4){_0x163f58=_0x163f58-0x0;var _0x472ed9=_0x0672[_0x163f58];return _0x472ed9;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x2067('0x0'));function checkNameSurname(_0x5ef8f4,_0x206c1e,_0x706ac7){var _0x354719='';if(!_[_0x2067('0x1')](_0x206c1e)&&_0x2067('0x2')===typeof _0x206c1e){_0x354719+=_0x206c1e;}if(!_[_0x2067('0x1')](_0x706ac7)&&_0x2067('0x2')===typeof _0x706ac7){_0x354719+='\x20'+_0x706ac7;}if(_0x354719!==''){return _0x354719;}return _0x5ef8f4;}function Action(_0x71429a,_0xa4bcba,_0x47328d){this[_0x2067('0x3')]=_0x71429a;this[_0x2067('0x4')]=_0x47328d||undefined;this['name']=checkNameSurname(_0xa4bcba[_0x2067('0x5')]['phone'],_0xa4bcba[_0x2067('0x5')]['firstName'],_0xa4bcba[_0x2067('0x5')][_0x2067('0x6')]);this[_0x2067('0x7')]=_0xa4bcba[_0x2067('0x8')];this['queue']=_0x71429a[_0x2067('0x9')];this[_0x2067('0xa')]=_0xa4bcba[_0x2067('0xa')]||![];this['type']=_0x71429a['type'];this[_0x2067('0xb')]=_0x71429a[_0x2067('0xb')]||0x3;this[_0x2067('0xc')]=_0xa4bcba[_0x2067('0xc')];this[_0x2067('0xd')]=_0xa4bcba[_0x2067('0xd')];this['countcongestionretry']=_0xa4bcba[_0x2067('0xe')];this['countnoanswerretry']=_0xa4bcba[_0x2067('0xf')];this[_0x2067('0x10')]=_0xa4bcba[_0x2067('0x10')];this[_0x2067('0x11')]=_0xa4bcba[_0x2067('0x11')];this[_0x2067('0x12')]=_0xa4bcba[_0x2067('0x12')];this['countmachineretry']=_0xa4bcba[_0x2067('0x13')];this[_0x2067('0x14')]=_0xa4bcba['countagentrejectretry'];this['ContactId']=_0xa4bcba[_0x2067('0x15')];this[_0x2067('0x16')]=_0xa4bcba[_0x2067('0x16')];this[_0x2067('0x17')]=_0xa4bcba['UserId'];this[_0x2067('0x18')]=_0xa4bcba['VoiceQueueId'];this[_0x2067('0x19')]=_0xa4bcba[_0x2067('0x19')];this['idHopper']=_0xa4bcba['id'];this['ContactFirstName']=_0xa4bcba[_0x2067('0x5')][_0x2067('0x1a')]||'';this[_0x2067('0x1b')]=moment()[_0x2067('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2067('0x1d')]=_0xa4bcba[_0x2067('0x1d')];this['callbackuniqueid']=_0xa4bcba[_0x2067('0x1e')];this[_0x2067('0x1f')]=_0xa4bcba[_0x2067('0x1f')];this[_0x2067('0x20')]=_0xa4bcba[_0x2067('0x20')];this[_0x2067('0x21')]='';this[_0x2067('0x22')]='';}Action[_0x2067('0x23')][_0x2067('0x24')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x2067('0x9')],this[_0x2067('0x3')][_0x2067('0x25')]>0x0?this['number']['substring'](this[_0x2067('0x3')][_0x2067('0x25')]):this[_0x2067('0x7')]);};Action[_0x2067('0x23')][_0x2067('0x26')]=function(){return this['queue'];};module[_0x2067('0x27')]=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 da0cd0a..6811219 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 _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 +var _0x2330=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','../utils','state','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime'];(function(_0x925420,_0x17df34){var _0x8f5a4d=function(_0xde0e2e){while(--_0xde0e2e){_0x925420['push'](_0x925420['shift']());}};_0x8f5a4d(++_0x17df34);}(_0x2330,0x11c));var _0x0233=function(_0x4826f7,_0x14ab8b){_0x4826f7=_0x4826f7-0x0;var _0x88cdac=_0x2330[_0x4826f7];return _0x88cdac;};'use strict';var moment=require('moment');var utils=require(_0x0233('0x0'));function AgentComplete(_0x280517,_0xbf9953){this[_0x0233('0x1')]=0x4;this['statedesc']=_0x0233('0x2');this[_0x0233('0x3')]=_0x280517[_0x0233('0x3')];this[_0x0233('0x4')]=_0x280517[_0x0233('0x4')];this['campaigntype']=_0x280517[_0x0233('0x4')]===_0x0233('0x5')?_0x0233('0x6'):_0x280517[_0x0233('0x4')];this[_0x0233('0x7')]=_0x280517[_0x0233('0x7')];this[_0x0233('0x8')]=_0x280517[_0x0233('0x8')];this['countnoanswerretry']=_0x280517[_0x0233('0x9')];this[_0x0233('0xa')]=_0x280517[_0x0233('0x7')]+_0x280517[_0x0233('0x8')]+_0x280517[_0x0233('0x9')]+_0x280517[_0x0233('0xb')]+_0x280517[_0x0233('0xc')]+_0x280517[_0x0233('0xd')]+_0x280517[_0x0233('0xe')]+_0x280517[_0x0233('0xf')];this[_0x0233('0xb')]=_0x280517[_0x0233('0xb')];this[_0x0233('0xc')]=_0x280517[_0x0233('0xc')];this[_0x0233('0xd')]=_0x280517[_0x0233('0xd')];this['countmachineretry']=_0x280517[_0x0233('0xe')];this[_0x0233('0xf')]=_0x280517['countagentrejectretry'];this['uniqueid']=_0xbf9953[_0x0233('0x10')];this[_0x0233('0x11')]=_0x280517[_0x0233('0x12')];this[_0x0233('0x13')]=_0x280517[_0x0233('0x14')];this[_0x0233('0x15')]=_0x280517[_0x0233('0x15')];this[_0x0233('0x16')]=_0x280517['responsetime'];this[_0x0233('0x17')]=_0x280517[_0x0233('0x17')];this[_0x0233('0x18')]=moment()[_0x0233('0x19')](_0x0233('0x1a'));this[_0x0233('0x1b')]=utils[_0x0233('0x1c')](_0x280517['responsetime'],_0x280517[_0x0233('0x15')]);this['holdtime']=utils[_0x0233('0x1c')](_0x280517[_0x0233('0x17')],_0x280517[_0x0233('0x16')]);this[_0x0233('0x1d')]=utils[_0x0233('0x1c')](this[_0x0233('0x18')],_0x280517['answertime']);this[_0x0233('0x6')]=_0xbf9953[_0x0233('0x6')];this[_0x0233('0x1e')]=_0xbf9953[_0x0233('0x1e')];this['reason']=_0xbf9953[_0x0233('0x1f')];this[_0x0233('0x20')]=_0x280517['callback'];this[_0x0233('0x21')]=_0x280517[_0x0233('0x21')];this[_0x0233('0x22')]=_0x280517[_0x0233('0x22')];this['recallme']=_0x280517[_0x0233('0x23')];this[_0x0233('0x24')]=_0x280517[_0x0233('0x24')];this[_0x0233('0x25')]=_0x280517[_0x0233('0x25')];this['UserId']=_0x280517[_0x0233('0x26')];this[_0x0233('0x27')]=_0x280517[_0x0233('0x27')];this[_0x0233('0x28')]=_0x280517[_0x0233('0x28')];this[_0x0233('0x29')]=_0x280517[_0x0233('0x29')]||'';this[_0x0233('0x2a')]=_0x280517['originatecalleridname']||'';this[_0x0233('0x2b')]=_0x280517[_0x0233('0x2b')];}module['exports']=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 67c6084..7eec236 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 _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 +var _0x54b3=['calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x37ea15,_0x5a0470){var _0x453798=function(_0x47b5f9){while(--_0x47b5f9){_0x37ea15['push'](_0x37ea15['shift']());}};_0x453798(++_0x5a0470);}(_0x54b3,0x147));var _0x354b=function(_0x7356b3,_0x39a025){_0x7356b3=_0x7356b3-0x0;var _0x1ab291=_0x54b3[_0x7356b3];return _0x1ab291;};'use strict';function Final(_0x3c673e){this[_0x354b('0x0')]=_0x3c673e['uniqueid'];this[_0x354b('0x1')]=_0x3c673e[_0x354b('0x1')];this[_0x354b('0x2')]=_0x3c673e['type'];this['campaigntype']=_0x3c673e[_0x354b('0x2')]===_0x354b('0x3')?_0x354b('0x4'):_0x3c673e[_0x354b('0x2')];this['countbusyretry']=_0x3c673e[_0x354b('0x5')];this[_0x354b('0x6')]=_0x3c673e[_0x354b('0x6')];this[_0x354b('0x7')]=_0x3c673e['countnoanswerretry'];this['countglobal']=_0x3c673e[_0x354b('0x5')]+_0x3c673e[_0x354b('0x6')]+_0x3c673e[_0x354b('0x7')]+_0x3c673e[_0x354b('0x8')]+_0x3c673e[_0x354b('0x9')]+_0x3c673e[_0x354b('0xa')]+_0x3c673e[_0x354b('0xb')]+_0x3c673e['countagentrejectretry'];this[_0x354b('0x8')]=_0x3c673e[_0x354b('0x8')];this[_0x354b('0x9')]=_0x3c673e[_0x354b('0x9')];this[_0x354b('0xa')]=_0x3c673e[_0x354b('0xa')];this[_0x354b('0xb')]=_0x3c673e[_0x354b('0xb')];this[_0x354b('0xc')]=_0x3c673e['countagentrejectretry'];this[_0x354b('0x4')]=_0x3c673e['queue'];this[_0x354b('0xd')]=_0x3c673e['calleridname'];this['calleridnum']=_0x3c673e[_0x354b('0xe')];this['starttime']=_0x3c673e[_0x354b('0xf')];this[_0x354b('0x10')]=_0x3c673e[_0x354b('0x10')];this[_0x354b('0x11')]=_0x3c673e[_0x354b('0x10')];this['ringtime']=_0x3c673e[_0x354b('0x12')]||0x0;this['holdtime']=_0x3c673e[_0x354b('0x13')]||0x0;this['talktime']=_0x3c673e[_0x354b('0x14')]||0x0;this[_0x354b('0x15')]=_0x3c673e[_0x354b('0x15')];this[_0x354b('0x16')]=_0x3c673e[_0x354b('0x16')];this[_0x354b('0x17')]=_0x3c673e[_0x354b('0x17')];this['recallme']=_0x3c673e[_0x354b('0x18')];this[_0x354b('0x19')]=_0x3c673e[_0x354b('0x19')];this['ListId']=_0x3c673e['ListId'];this[_0x354b('0x1a')]=_0x3c673e[_0x354b('0x1a')];this[_0x354b('0x1b')]=_0x3c673e[_0x354b('0x1b')];this['CampaignId']=_0x3c673e[_0x354b('0x1c')];this[_0x354b('0x1d')]=_0x3c673e[_0x354b('0x1d')]||'';this[_0x354b('0x1e')]=_0x3c673e[_0x354b('0x1e')]||'';this[_0x354b('0x1f')]=_0x3c673e[_0x354b('0x1f')];this[_0x354b('0x20')]=_0x3c673e[_0x354b('0x20')];}module[_0x354b('0x21')]=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 fcf769d..f1b32a2 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 _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 +var _0x637d=['Answer','scheduledat','type','campaigntype','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','talktime','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','exports','moment','state','statedesc'];(function(_0x9b37de,_0x295218){var _0x3ebb37=function(_0x477a39){while(--_0x477a39){_0x9b37de['push'](_0x9b37de['shift']());}};_0x3ebb37(++_0x295218);}(_0x637d,0xe7));var _0xd637=function(_0x2db274,_0x387f62){_0x2db274=_0x2db274-0x0;var _0x246ab8=_0x637d[_0x2db274];return _0x246ab8;};'use strict';var moment=require(_0xd637('0x0'));var utils=require('../utils');function Hangup(_0x53bcf3,_0x7ab170){this[_0xd637('0x1')]=0x4;this[_0xd637('0x2')]=_0xd637('0x3');this['scheduledat']=_0x53bcf3[_0xd637('0x4')];this[_0xd637('0x5')]=_0x53bcf3[_0xd637('0x5')];this[_0xd637('0x6')]=_0x53bcf3[_0xd637('0x5')]==='outbound'?_0xd637('0x7'):_0x53bcf3[_0xd637('0x5')];this[_0xd637('0x8')]=_0x53bcf3[_0xd637('0x8')]||![];this[_0xd637('0x9')]=_0x53bcf3[_0xd637('0x9')];this[_0xd637('0xa')]=_0x53bcf3[_0xd637('0xa')];this[_0xd637('0xb')]=_0x53bcf3['countnoanswerretry'];this[_0xd637('0xc')]=_0x53bcf3[_0xd637('0x9')]+_0x53bcf3['countcongestionretry']+_0x53bcf3[_0xd637('0xb')]+_0x53bcf3[_0xd637('0xd')]+_0x53bcf3[_0xd637('0xe')]+_0x53bcf3[_0xd637('0xf')]+_0x53bcf3[_0xd637('0x10')]+_0x53bcf3[_0xd637('0x11')];this['countnosuchnumberretry']=_0x53bcf3[_0xd637('0xd')];this[_0xd637('0xe')]=_0x53bcf3[_0xd637('0xe')];this[_0xd637('0xf')]=_0x53bcf3[_0xd637('0xf')];this[_0xd637('0x10')]=_0x53bcf3[_0xd637('0x10')];this['countagentrejectretry']=_0x53bcf3[_0xd637('0x11')];this[_0xd637('0x12')]=_0x7ab170[_0xd637('0x12')];this['calleridname']=_0x53bcf3[_0xd637('0x13')];this['calleridnum']=_0x53bcf3['number'];this[_0xd637('0x14')]=_0x53bcf3['starttime'];this['responsetime']=_0x53bcf3[_0xd637('0x15')];this[_0xd637('0x16')]=moment()['format'](_0xd637('0x17'));this['ringtime']=utils[_0xd637('0x18')](_0x53bcf3[_0xd637('0x15')],_0x53bcf3[_0xd637('0x14')]);this[_0xd637('0x19')]=0x0;this[_0xd637('0x1a')]=utils['getSeconds'](this['endtime'],_0x53bcf3[_0xd637('0x15')]);this[_0xd637('0x7')]=_0x53bcf3[_0xd637('0x7')];this[_0xd637('0x1b')]=_0xd637('0x1c');this[_0xd637('0x1d')]=_0x7ab170['cause-txt'];this[_0xd637('0x1e')]=_0x53bcf3[_0xd637('0x1e')];this[_0xd637('0x1f')]=_0x53bcf3[_0xd637('0x1f')];this[_0xd637('0x20')]=_0x53bcf3[_0xd637('0x20')];this[_0xd637('0x21')]=_0x53bcf3[_0xd637('0x21')];this[_0xd637('0x22')]=_0x53bcf3[_0xd637('0x22')];this[_0xd637('0x23')]=_0x53bcf3[_0xd637('0x23')];this[_0xd637('0x24')]=_0x53bcf3[_0xd637('0x24')];this['VoiceQueueId']=_0x53bcf3['VoiceQueueId'];this[_0xd637('0x25')]=_0x53bcf3[_0xd637('0x25')];}module[_0xd637('0x26')]=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 ae34e2d..841bd86 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 _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 +var _0x8359=['../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countagentrejectretry','countdropretry','countabandonedretry','countmachineretry','calleridname','name','calleridnum','number','starttime','endtime','responsetime','ringtime','getSeconds','holdtime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','state','statedesc'];(function(_0x18b191,_0x4e0684){var _0x43e146=function(_0x4b464e){while(--_0x4b464e){_0x18b191['push'](_0x18b191['shift']());}};_0x43e146(++_0x4e0684);}(_0x8359,0x1e1));var _0x9835=function(_0x3f9ac2,_0x1b670b){_0x3f9ac2=_0x3f9ac2-0x0;var _0xe6a436=_0x8359[_0x3f9ac2];return _0xe6a436;};'use strict';var utils=require(_0x9835('0x0'));function History(_0x14fc43){this[_0x9835('0x1')]=_0x14fc43['uniqueid'];this[_0x9835('0x2')]=_0x14fc43['scheduledat']||undefined;this[_0x9835('0x3')]=_0x14fc43[_0x9835('0x3')];this[_0x9835('0x4')]=_0x14fc43['type']===_0x9835('0x5')?_0x9835('0x6'):_0x14fc43[_0x9835('0x3')];this['countbusyretry']=_0x14fc43[_0x9835('0x7')];this[_0x9835('0x8')]=_0x14fc43[_0x9835('0x8')];this[_0x9835('0x9')]=_0x14fc43['countnoanswerretry'];this[_0x9835('0xa')]=_0x14fc43[_0x9835('0x7')]+_0x14fc43['countcongestionretry']+_0x14fc43[_0x9835('0x9')]+_0x14fc43[_0x9835('0xb')]+_0x14fc43['countdropretry']+_0x14fc43['countabandonedretry']+_0x14fc43['countmachineretry']+_0x14fc43[_0x9835('0xc')];this[_0x9835('0xb')]=_0x14fc43[_0x9835('0xb')];this[_0x9835('0xd')]=_0x14fc43['countdropretry'];this[_0x9835('0xe')]=_0x14fc43['countabandonedretry'];this[_0x9835('0xf')]=_0x14fc43[_0x9835('0xf')];this[_0x9835('0xc')]=_0x14fc43['countagentrejectretry'];this['queue']=_0x14fc43[_0x9835('0x6')];this[_0x9835('0x10')]=_0x14fc43[_0x9835('0x11')];this[_0x9835('0x12')]=_0x14fc43[_0x9835('0x13')];this[_0x9835('0x14')]=_0x14fc43[_0x9835('0x14')];this['responsetime']=_0x14fc43['responsetime'];this[_0x9835('0x15')]=_0x14fc43[_0x9835('0x16')];this[_0x9835('0x17')]=utils[_0x9835('0x18')](_0x14fc43[_0x9835('0x16')],_0x14fc43[_0x9835('0x14')]);this[_0x9835('0x19')]=0x0;this['talktime']=0x0;this[_0x9835('0x1a')]=_0x14fc43['callback'];this[_0x9835('0x1b')]=_0x14fc43[_0x9835('0x1b')];this['callbackat']=_0x14fc43['callbackat'];this['recallme']=_0x14fc43[_0x9835('0x1c')];this[_0x9835('0x1d')]=_0x14fc43[_0x9835('0x1d')];this[_0x9835('0x1e')]=_0x14fc43[_0x9835('0x1e')];this[_0x9835('0x1f')]=_0x14fc43[_0x9835('0x1f')];this[_0x9835('0x20')]=_0x14fc43[_0x9835('0x20')];this['CampaignId']=_0x14fc43[_0x9835('0x21')];this['originatecalleridnum']=_0x14fc43[_0x9835('0x22')]||'';this['originatecalleridname']=_0x14fc43['originatecalleridname']||'';this[_0x9835('0x23')]=_0x14fc43['state'];this['statedesc']=_0x14fc43[_0x9835('0x24')];}module['exports']=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 a7af97f..9f13d26 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 _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 +var _0x12ce=['type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','getSeconds','holdtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','../utils','scheduledat'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0x12ce,0xaa));var _0xe12c=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x12ce[_0x297fd3];return _0x2af381;};'use strict';var utils=require(_0xe12c('0x0'));function QueueCallerAbandon(_0x1984ea,_0x4baa89){this[_0xe12c('0x1')]=_0x1984ea[_0xe12c('0x1')];this['type']=_0x1984ea[_0xe12c('0x2')];this[_0xe12c('0x3')]=_0x1984ea[_0xe12c('0x2')]===_0xe12c('0x4')?_0xe12c('0x5'):_0x1984ea[_0xe12c('0x2')];this[_0xe12c('0x6')]=_0x1984ea[_0xe12c('0x6')];this[_0xe12c('0x7')]=_0x1984ea[_0xe12c('0x7')];this[_0xe12c('0x8')]=_0x1984ea[_0xe12c('0x8')];this[_0xe12c('0x9')]=_0x1984ea[_0xe12c('0x6')]+_0x1984ea[_0xe12c('0x7')]+_0x1984ea['countnoanswerretry']+_0x1984ea['countnosuchnumberretry']+_0x1984ea['countdropretry']+_0x1984ea[_0xe12c('0xa')]+_0x1984ea[_0xe12c('0xb')]+_0x1984ea[_0xe12c('0xc')];this[_0xe12c('0xd')]=_0x1984ea['countnosuchnumberretry'];this[_0xe12c('0xe')]=_0x1984ea['countdropretry'];this[_0xe12c('0xa')]=_0x1984ea['countabandonedretry'];this[_0xe12c('0xb')]=_0x1984ea[_0xe12c('0xb')];this[_0xe12c('0xc')]=_0x1984ea[_0xe12c('0xc')];this[_0xe12c('0xf')]=_0x4baa89[_0xe12c('0xf')];this[_0xe12c('0x10')]=_0x1984ea[_0xe12c('0x11')];this[_0xe12c('0x12')]=_0x1984ea[_0xe12c('0x13')];this[_0xe12c('0x14')]=_0x1984ea[_0xe12c('0x14')];this[_0xe12c('0x15')]=_0x1984ea[_0xe12c('0x15')];this[_0xe12c('0x16')]=_0x1984ea[_0xe12c('0x16')];this[_0xe12c('0x17')]=_0x1984ea['dropreason'];this[_0xe12c('0x18')]=this[_0xe12c('0x16')];this['ringtime']=utils[_0xe12c('0x19')](_0x1984ea['responsetime'],_0x1984ea[_0xe12c('0x14')]);this[_0xe12c('0x1a')]=utils['getSeconds'](this[_0xe12c('0x16')],_0x1984ea[_0xe12c('0x15')]);this[_0xe12c('0x1b')]=0x0;this['queue']=_0x4baa89[_0xe12c('0x5')];this['membername']=_0x4baa89[_0xe12c('0x1c')];this[_0xe12c('0x1d')]=_0x4baa89[_0xe12c('0x1d')];this[_0xe12c('0x1e')]=_0x1984ea[_0xe12c('0x1e')];this[_0xe12c('0x1f')]=_0x1984ea[_0xe12c('0x1f')];this['callbackat']=_0x1984ea[_0xe12c('0x20')];this[_0xe12c('0x21')]=_0x1984ea[_0xe12c('0x21')];this[_0xe12c('0x22')]=_0x1984ea[_0xe12c('0x22')];this[_0xe12c('0x23')]=_0x1984ea[_0xe12c('0x23')];this[_0xe12c('0x24')]=_0x1984ea[_0xe12c('0x24')];this[_0xe12c('0x25')]=_0x1984ea[_0xe12c('0x25')];this['CampaignId']=_0x1984ea[_0xe12c('0x26')];this[_0xe12c('0x27')]=_0x1984ea[_0xe12c('0x27')]||'';this['originatecalleridname']=_0x1984ea[_0xe12c('0x28')]||'';this['agiafterat']=_0x1984ea['agiafterat'];this[_0xe12c('0x29')]=_0x1984ea[_0xe12c('0x29')];this[_0xe12c('0x2a')]=_0x1984ea[_0xe12c('0x2a')];}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 6eaed0b..f2753ff 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(_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 +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(_0x5bb243,_0x1fd470){var _0xb7589c=function(_0x579d5a){while(--_0x579d5a){_0x5bb243['push'](_0x5bb243['shift']());}};_0xb7589c(++_0x1fd470);}(_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 4a74c22..7e9d529 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 _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 +var _0x24e7=['unmonitored','includes','status','TrunkBackup','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','DISACTIVED','getQueueCampaignActiveStatusMessage','match','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','pow','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','lodash','moment','util','dialer','../../../../config/environment/shared','timezones','ACTIVE','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','preview','ivr','isIVRCampaign','type','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','getSeconds','dialMethod','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','UNKNOWN_TIMEZONE','SIP/','reachable'];(function(_0x57807e,_0xad9a3f){var _0x1f794a=function(_0x5c9420){while(--_0x5c9420){_0x57807e['push'](_0x57807e['shift']());}};_0x1f794a(++_0xad9a3f);}(_0x24e7,0x155));var _0x724e=function(_0x5833e7,_0x3d3958){_0x5833e7=_0x5833e7-0x0;var _0x5778a5=_0x24e7[_0x5833e7];return _0x5778a5;};'use strict';var _=require(_0x724e('0x0'));var moment=require(_0x724e('0x1'));var util=require(_0x724e('0x2'));var logger=require('../../../../config/logger')(_0x724e('0x3'));var timezones=require(_0x724e('0x4'))[_0x724e('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0x724e('0x6'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0x724e('0x7'),'DISACTIVED':_0x724e('0x8'),'EMPTY_INTERVAL':_0x724e('0x9'),'INACTIVE':_0x724e('0xa'),'NO_AGENTS_LOGGED':_0x724e('0xb'),'NO_AVAILABLE_CONTACTS':_0x724e('0xc'),'NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0x724e('0xd'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0x724e('0xe'),'RUNNING':_0x724e('0xf'),'UNKNOWN_TIMEZONE':_0x724e('0x10'),'UNREACHABLE_TRUNK':_0x724e('0x11')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x547b38){return _0x547b38['dialMethod']===_0x724e('0x12');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x5008bd){return _0x5008bd['type']===_0x724e('0x13');}exports[_0x724e('0x14')]=isIVRCampaign;function isOutboundQueue(_0x128e76){return _0x128e76[_0x724e('0x15')]==='outbound';}exports[_0x724e('0x16')]=isOutboundQueue;function isQueueCampaignActive(_0x46dce3){return _0x46dce3[_0x724e('0x17')];}exports[_0x724e('0x18')]=isQueueCampaignActive;function isIVRCampaignActive(_0x15226f){return _0x15226f[_0x724e('0x19')];}exports[_0x724e('0x1a')]=isIVRCampaignActive;function getSeconds(_0x3a8446,_0xe71ce2){var _0x376567=moment(_0x3a8446)[_0x724e('0x1b')](0x0);var _0x5d2468=moment(_0xe71ce2)[_0x724e('0x1b')](0x0);return _0x376567[_0x724e('0x1c')](_0x5d2468,'seconds');}exports[_0x724e('0x1d')]=getSeconds;function hasQueueCampaignDataChanged(_0x37ae12,_0x3886df){var _0x585a9f=![];var _0x1aef11=_0x37ae12[_0x724e('0x1e')]!==_0x3886df['dialMethod']||_0x37ae12['dialActive']!==_0x3886df['dialActive']||_0x37ae12['message']!==_0x3886df[_0x724e('0x1f')];var _0x16b533=_0x37ae12[_0x724e('0x20')]!==_0x3886df[_0x724e('0x20')]||_0x37ae12[_0x724e('0x21')]!==_0x3886df[_0x724e('0x21')]||_0x37ae12['loggedInDb']!==_0x3886df[_0x724e('0x22')]||_0x37ae12['paused']!==_0x3886df[_0x724e('0x23')]||_0x37ae12[_0x724e('0x24')]!==_0x3886df[_0x724e('0x24')]||_0x37ae12[_0x724e('0x25')]!==_0x3886df[_0x724e('0x25')]||_0x37ae12[_0x724e('0x26')]!==_0x3886df['waiting']||_0x37ae12[_0x724e('0x27')]!==_0x3886df[_0x724e('0x27')]||_0x37ae12[_0x724e('0x28')]!==_0x3886df[_0x724e('0x28')];if(_0x37ae12['Trunk']&&_0x3886df[_0x724e('0x29')]){_0x585a9f=_0x37ae12[_0x724e('0x29')][_0x724e('0x2a')]!==_0x3886df[_0x724e('0x29')][_0x724e('0x2a')]||_0x37ae12['Trunk'][_0x724e('0x19')]!==_0x3886df['Trunk'][_0x724e('0x19')];}return _0x1aef11||_0x16b533||_0x585a9f;}exports[_0x724e('0x2b')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0xc4bca8){var _0x3a4537=null;var _0x4ac781=_0xc4bca8[_0x724e('0x2c')];if(_[_0x724e('0x2d')](_0xc4bca8[_0x724e('0x2e')])||_[_0x724e('0x2d')](_0xc4bca8[_0x724e('0x2f')])||_['isNil'](_0xc4bca8[_0x724e('0x2f')][_0x724e('0x30')])){_0x3a4537=CAMPAIGN_STATUS[_0x724e('0x31')];}else if(_[_0x724e('0x32')](_0xc4bca8['dialGlobalInterval'])||_[_0x724e('0x32')](_0xc4bca8['Interval'][_0x724e('0x30')])){_0x3a4537=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x4ac781&&!timezones[_0x4ac781]){_0x3a4537=CAMPAIGN_STATUS[_0x724e('0x33')];}return _0x3a4537;}function checkAnyValidTrunk(_0x1d0666,_0x536226){var _0x3f4957=null;var _0x4623b2=_0x724e('0x34');var _0x4f3822=[_0x724e('0x35'),_0x724e('0x36')];var _0x127dea=!![];if(_0x1d0666['Trunk']&&_0x1d0666['Trunk']['active']){_0x4623b2+=_0x1d0666[_0x724e('0x29')][_0x724e('0x2a')];_0x3f4957=_0x536226[_0x4623b2];_0x127dea=_0x4f3822[_0x724e('0x37')](_0x3f4957[_0x724e('0x38')]);}else if(_0x1d0666[_0x724e('0x39')]&&_0x1d0666['TrunkBackup'][_0x724e('0x19')]){_0x4623b2+=_0x1d0666['TrunkBackup'][_0x724e('0x2a')];_0x3f4957=_0x536226[_0x4623b2];_0x127dea=_0x4f3822[_0x724e('0x37')](_0x3f4957[_0x724e('0x38')]);}return _0x127dea;}function getQueueCampaignStatusMessage(_0x4bdbfb,_0xa9dafa){var _0x5a5070=CAMPAIGN_STATUS[_0x724e('0x6')];var _0x182dd3=isPreviewCampaign(_0x4bdbfb);if(!isQueueCampaignActive(_0x4bdbfb)){if(_0x182dd3){_0x5a5070=CAMPAIGN_STATUS[_0x724e('0x3a')];}else{if(_0x4bdbfb[_0x724e('0x28')]===0x0&&_0x4bdbfb[_0x724e('0x24')]===0x0&&_0x4bdbfb['waiting']===0x0&&(_0x4bdbfb[_0x724e('0x25')]||0x0)===0x0){_0x5a5070=CAMPAIGN_STATUS['INACTIVE'];}else{_0x5a5070=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x4bdbfb['loggedIn']===0x0){_0x5a5070=CAMPAIGN_STATUS[_0x724e('0x3b')];}else if(!checkAnyValidTrunk(_0x4bdbfb,_0xa9dafa)){_0x5a5070=CAMPAIGN_STATUS[_0x724e('0x3c')];}else if(!isPreviewCampaign(_0x4bdbfb)){var _0x2509bd=checkAnyValidQueueCampaignInterval(_0x4bdbfb);if(_0x2509bd){_0x5a5070=_0x2509bd;}}return _0x5a5070;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x5e881f){var _0x3d639f=CAMPAIGN_STATUS[_0x724e('0x3d')];if(_0x5e881f[_0x724e('0x28')]===0x0&&_0x5e881f[_0x724e('0x24')]===0x0&&_0x5e881f[_0x724e('0x26')]===0x0&&(_0x5e881f[_0x724e('0x25')]||0x0)===0x0){_0x3d639f=CAMPAIGN_STATUS['INACTIVE'];}return _0x3d639f;}exports[_0x724e('0x3e')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x3bcbb4){var _0x5e65b6=_0x3bcbb4[_0x724e('0x3f')](/"(.*?)"/);return _0x5e65b6?_0x5e65b6[0x1]:_0x3bcbb4;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x1da289,_0xe30ecb,_0x3a52c3){if(!_['isUndefined'](_0x3a52c3)&&typeof _0x3a52c3==='string'&&!_[_0x724e('0x32')](_0x3a52c3)){if(!_[_0x724e('0x40')](_0xe30ecb)&&typeof _0xe30ecb===_0x724e('0x41')&&!_[_0x724e('0x32')](_0xe30ecb)){return util[_0x724e('0x42')](_0x724e('0x43'),_0xe30ecb,_0x3a52c3);}return util[_0x724e('0x42')](_0x724e('0x43'),_0x3a52c3,_0x3a52c3);}if(!_[_0x724e('0x40')](_0x1da289)&&typeof _0x1da289===_0x724e('0x41')&&!_[_0x724e('0x32')](_0x1da289)){return _0x1da289;}return _0x724e('0x44');}exports[_0x724e('0x45')]=getCallerId;function getCallerIdRandom(_0x3de499,_0x412101){var _0x51bb5f;var _0x1a79ea;var _0x39820f;if(_0x412101<=0x0){_0x412101=0x1;}_0x51bb5f=new RegExp('\x5cw{0,'+_0x412101+'}$');_0x1a79ea=Math[_0x724e('0x46')](0xa,_0x412101-0x1);_0x39820f=Math['pow'](0xa,_0x412101)-0x1;return util[_0x724e('0x42')]('%s',_['replace'](_0x3de499,_0x51bb5f,_['random'](_0x1a79ea,_0x39820f)['toString']()));}exports[_0x724e('0x47')]=getCallerIdRandom;function decrementOriginate(_0xd1eb84){if(_0xd1eb84[_0x724e('0x28')]&&_0xd1eb84[_0x724e('0x28')]>0x0){_0xd1eb84['originated']-=0x1;}else{logger[_0x724e('0x48')](_0x724e('0x49'));}}exports[_0x724e('0x4a')]=decrementOriginate;function checkContactEmpty(_0x669746){return _0x669746&&_0x669746[_0x724e('0x4b')]>0x0;}exports[_0x724e('0x4c')]=checkContactEmpty;function erlangb(_0x36a9e1,_0x33f9ef){if(_0x33f9ef===0x0){return 0x0;}var _0x52525e=0x1;for(var _0x247461=0x1;_0x247461<=_0x33f9ef;_0x247461+=0x1){_0x52525e=0x1+_0x52525e*_0x247461/_0x36a9e1;}return 0x1/_0x52525e;}exports[_0x724e('0x4d')]=erlangb;function checkContactLowerLimitOriginate(_0x303a49,_0x4fc340,_0x12341e){if(_0x4fc340>_0x12341e){for(var _0x1ef44b=0x0;_0x1ef44b<_0x4fc340-_0x12341e;_0x1ef44b+=0x1){decrementOriginate(_0x303a49);}}}exports[_0x724e('0x4e')]=checkContactLowerLimitOriginate; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 46de406..0a5c84f 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(_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 +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x526589,_0x2a463f){var _0x2895e6=function(_0x598141){while(--_0x598141){_0x526589['push'](_0x526589['shift']());}};_0x2895e6(++_0x2a463f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 53e8658..68bb019 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 _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 +var _0x0fa5=['pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','notify','catch','error','stringify','merge','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','checkTrunk','FaxAccountId','Trunk','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','trunks','format','reachable','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','fax','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','./rpcDb','./channel','./action','../rpc/faxMessage','channels','actions','syncNewchannel','bind','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','faxAccounts','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','hasOwnProperty','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid'];(function(_0x29b205,_0x19d5a7){var _0x10b233=function(_0x57c0fe){while(--_0x57c0fe){_0x29b205['push'](_0x29b205['shift']());}};_0x10b233(++_0x19d5a7);}(_0x0fa5,0x132));var _0x50fa=function(_0x5e709a,_0x1d7975){_0x5e709a=_0x5e709a-0x0;var _0x57401a=_0x0fa5[_0x5e709a];return _0x57401a;};'use strict';var util=require(_0x50fa('0x0'));var _=require(_0x50fa('0x1'));var BPromise=require(_0x50fa('0x2'));var uuid=require(_0x50fa('0x3'));var moment=require(_0x50fa('0x4'));var path=require(_0x50fa('0x5'));var tiff2pdf=require(_0x50fa('0x6'));var gs=require(_0x50fa('0x7'));var logger=require(_0x50fa('0x8'))('fax');var ami=require('../ami');var rpcDb=require(_0x50fa('0x9'));var Channel=require(_0x50fa('0xa'));var ut=require('./util/util');var Action=require(_0x50fa('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0x50fa('0xc'));function Fax(_0x4c1368){this[_0x50fa('0xd')]={};this['faxAccounts']=_0x4c1368['faxAccounts'];this['trunks']=_0x4c1368['trunks'];this[_0x50fa('0xe')]={};ami['on']('newchannel',this[_0x50fa('0xf')][_0x50fa('0x10')](this));ami['on']('varset',this[_0x50fa('0x11')][_0x50fa('0x10')](this));ami['on'](_0x50fa('0x12'),this[_0x50fa('0x13')][_0x50fa('0x10')](this));ami['on'](_0x50fa('0x14'),this[_0x50fa('0x15')][_0x50fa('0x10')](this));ami['on'](_0x50fa('0x16'),this['syncFaxStatus']['bind'](this));ami['on'](_0x50fa('0x17'),this[_0x50fa('0x18')][_0x50fa('0x10')](this));ami['on'](_0x50fa('0x19'),this[_0x50fa('0x1a')][_0x50fa('0x10')](this));ami['on'](_0x50fa('0x1b'),this[_0x50fa('0x1c')][_0x50fa('0x10')](this));}Fax[_0x50fa('0x1d')][_0x50fa('0xf')]=function(_0x4475c2){if(_0x4475c2[_0x50fa('0x1e')]===_0x50fa('0x1f')){for(var _0x64142f in this['faxAccounts']){if(this[_0x50fa('0x20')]['hasOwnProperty'](_0x64142f)){if(_0x4475c2[_0x50fa('0x21')]===this['faxAccounts'][_0x64142f][_0x50fa('0x22')]){this[_0x50fa('0xd')][_0x4475c2['uniqueid']]={};this[_0x50fa('0xd')][_0x4475c2[_0x50fa('0x23')]][_0x50fa('0x24')]=_0x4475c2['channel'];this[_0x50fa('0xd')][_0x4475c2[_0x50fa('0x23')]]['id']=this[_0x50fa('0x20')][_0x64142f]['id'];this[_0x50fa('0xd')][_0x4475c2[_0x50fa('0x23')]][_0x50fa('0x25')]=this['faxAccounts'][_0x64142f][_0x50fa('0x25')];logger[_0x50fa('0x26')](_0x4475c2[_0x50fa('0x23')],_0x50fa('0x27'));}}}}if(this[_0x50fa('0xe')][_0x4475c2[_0x50fa('0x23')]]){this['channels'][_0x4475c2['uniqueid']]={};this['channels'][_0x4475c2[_0x50fa('0x23')]][_0x50fa('0x24')]=_0x4475c2['channel'];logger[_0x50fa('0x26')](_0x4475c2['uniqueid'],_0x50fa('0x27'));}};Fax[_0x50fa('0x1d')][_0x50fa('0x11')]=function(_0x2d7958){if(this[_0x50fa('0xd')][_0x2d7958[_0x50fa('0x23')]]){for(var _0x30e6ba in _0x2d7958[_0x50fa('0x28')]){if(_0x2d7958[_0x50fa('0x28')]['hasOwnProperty'](_0x30e6ba)){this[_0x50fa('0xd')][_0x2d7958[_0x50fa('0x23')]][_0x30e6ba]=_0x2d7958[_0x50fa('0x29')];}}}};Fax[_0x50fa('0x1d')][_0x50fa('0x13')]=function(_0x78931d){if(this['channels'][_0x78931d[_0x50fa('0x23')]]){this['channels'][_0x78931d[_0x50fa('0x23')]]['channelstate']=_0x78931d[_0x50fa('0x2a')];this[_0x50fa('0xd')][_0x78931d[_0x50fa('0x23')]][_0x50fa('0x2b')]=_0x78931d[_0x50fa('0x2b')];}};Fax[_0x50fa('0x1d')][_0x50fa('0x15')]=function(_0x1917c2){if(this[_0x50fa('0xd')][_0x1917c2[_0x50fa('0x23')]]){for(var _0x539dbc in _0x1917c2[_0x50fa('0x28')]){if(_0x1917c2[_0x50fa('0x28')][_0x50fa('0x2c')](_0x539dbc)){this[_0x50fa('0xd')][_0x1917c2['uniqueid']][_0x539dbc]=_0x1917c2['value'];}}}};Fax[_0x50fa('0x1d')][_0x50fa('0x2d')]=function(_0x362926){if(this[_0x50fa('0xd')][_0x362926[_0x50fa('0x23')]]){this[_0x50fa('0xd')][_0x362926['uniqueid']][_0x50fa('0x2e')]=_0x362926[_0x50fa('0x2e')];this['channels'][_0x362926[_0x50fa('0x23')]][_0x50fa('0x2f')]=_0x362926[_0x50fa('0x2f')];this[_0x50fa('0xd')][_0x362926['uniqueid']]['localstationid']=_0x362926[_0x50fa('0x22')];this[_0x50fa('0xd')][_0x362926[_0x50fa('0x23')]][_0x50fa('0x30')]=_0x362926[_0x50fa('0x30')];logger[_0x50fa('0x26')](_0x362926['uniqueid'],_0x50fa('0x31'));}};Fax['prototype'][_0x50fa('0x18')]=function(_0x63175c){var _0x1fa674=this;if(this[_0x50fa('0xd')][_0x63175c[_0x50fa('0x23')]]){var _0x28a80d=this['channels'][_0x63175c[_0x50fa('0x23')]]['id'];this[_0x50fa('0xd')][_0x63175c[_0x50fa('0x23')]][_0x50fa('0x32')]=_0x63175c['remotestationid'];this['channels'][_0x63175c[_0x50fa('0x23')]]['pagestransferred']=_0x63175c[_0x50fa('0x33')];this[_0x50fa('0xd')][_0x63175c['uniqueid']][_0x50fa('0x22')]=_0x63175c[_0x50fa('0x22')];this[_0x50fa('0xd')][_0x63175c[_0x50fa('0x23')]][_0x50fa('0x34')]=_0x63175c[_0x50fa('0x34')];this[_0x50fa('0xd')][_0x63175c[_0x50fa('0x23')]]['transferrate']=_0x63175c[_0x50fa('0x35')];this['channels'][_0x63175c[_0x50fa('0x23')]][_0x50fa('0x30')]=_0x63175c['filename'];this['channels'][_0x63175c[_0x50fa('0x23')]][_0x50fa('0x36')]=_0x63175c[_0x50fa('0x36')];if(this[_0x50fa('0xd')][_0x63175c[_0x50fa('0x23')]][_0x50fa('0x33')]>0x0){tiff2pdf(_0x63175c[_0x50fa('0x30')],_0x50fa('0x37'),function(_0x124e7d){logger[_0x50fa('0x26')](_0x63175c[_0x50fa('0x23')],'\x20result\x20conversion\x20file\x20',_0x124e7d[_0x50fa('0x38')]);attachment[_0x50fa('0x39')]({'name':path[_0x50fa('0x3a')](_0x63175c[_0x50fa('0x30')])[_0x50fa('0x25')],'basename':path[_0x50fa('0x3a')](_0x63175c[_0x50fa('0x30')])[_0x50fa('0x25')]+_0x50fa('0x3b'),'type':_0x50fa('0x3c')})['then'](function(_0x3c1934){faxAccount[_0x50fa('0x3d')](_0x28a80d,{'from':_0x63175c['calleridnum'],'mapKey':'fax','body':path[_0x50fa('0x3a')](_0x63175c[_0x50fa('0x30')])['name']+_0x50fa('0x3b'),'AttachmentId':_0x3c1934['id']})[_0x50fa('0x3e')](function(_0x2f7034){logger[_0x50fa('0x3f')](_0x63175c[_0x50fa('0x23')],'\x20notify\x20',JSON['stringify'](_0x2f7034));});})[_0x50fa('0x3e')](function(_0x477b14){logger[_0x50fa('0x3f')](_0x63175c[_0x50fa('0x23')],'\x20receiveFax\x20',JSON[_0x50fa('0x40')](_0x477b14));});});}logger['info'](_0x63175c['uniqueid'],'\x20receiveFax\x20');}};Fax[_0x50fa('0x1d')][_0x50fa('0x1c')]=function(_0x236fd6){if(this[_0x50fa('0xe')][_0x236fd6[_0x50fa('0x23')]]){_[_0x50fa('0x41')](this['channels'][_0x236fd6[_0x50fa('0x23')]],_[_0x50fa('0x42')](_0x236fd6,[_0x50fa('0x43'),_0x50fa('0x44')]));}};function updateStatus(_0x578e16){if(_0x578e16[_0x50fa('0x45')]){faxMessage['update'](_0x578e16[_0x50fa('0x45')],{'failMessage':_0x50fa('0x46')})[_0x50fa('0x47')](function(_0x592376){ut[_0x50fa('0x48')](_0x50fa('0x49'),_0x592376);})[_0x50fa('0x3e')](function(_0x318378){ut['logger'](_0x50fa('0x4a'),_0x318378);});}else{ut[_0x50fa('0x48')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x50fa('0x1d')]['updateStatus']=function(_0x452010,_0x2b63bc,_0x4d36db){var _0x3496c6=this;var _0x3b983a={};if(_0x2b63bc){_0x3b983a={'read':_0x2b63bc};}else{_0x3b983a={'failMessage':_0x4d36db};}if(this[_0x50fa('0xe')][_0x452010]['AttachmentId']){faxMessage[_0x50fa('0x4b')](this[_0x50fa('0xe')][_0x452010][_0x50fa('0x45')],_0x3b983a)['then'](function(_0x45063d){ut[_0x50fa('0x48')](_0x50fa('0x4c'),_0x45063d);})[_0x50fa('0x3e')](function(_0x2b2146){ut[_0x50fa('0x48')](_0x50fa('0x4d'),_0x2b2146);})[_0x50fa('0x4e')](function(){delete _0x3496c6['channels'][_0x452010];delete _0x3496c6[_0x50fa('0xe')][_0x452010];});}else{ut[_0x50fa('0x48')](_0x50fa('0x4f'));delete this[_0x50fa('0xd')][_0x452010];delete this[_0x50fa('0xe')][_0x452010];}};Fax[_0x50fa('0x1d')][_0x50fa('0x1a')]=function(_0x3a2e88){var _0x2db71e=this;if(this['channels'][_0x3a2e88[_0x50fa('0x23')]]){if(this['actions'][_0x3a2e88['uniqueid']]){this['channels'][_0x3a2e88['uniqueid']]['id']=this[_0x50fa('0xe')][_0x3a2e88[_0x50fa('0x23')]]['id'];this['channels'][_0x3a2e88[_0x50fa('0x23')]]['name']=this['actions'][_0x3a2e88[_0x50fa('0x23')]]['name'];}logger[_0x50fa('0x26')](_0x3a2e88[_0x50fa('0x23')],this['actions'][_0x3a2e88[_0x50fa('0x23')]]?_0x50fa('0x50'):_0x50fa('0x51'),JSON[_0x50fa('0x40')](this[_0x50fa('0xd')][_0x3a2e88['uniqueid']]));if(this[_0x50fa('0xe')][_0x3a2e88[_0x50fa('0x23')]]){if(this['channels'][_0x3a2e88[_0x50fa('0x23')]]['faxpages']>0x0&&this['channels'][_0x3a2e88['uniqueid']][_0x50fa('0x16')]===_0x50fa('0x52')){this[_0x50fa('0x53')](_0x3a2e88[_0x50fa('0x23')],!![]);}else{this['updateStatus'](_0x3a2e88[_0x50fa('0x23')],![],this[_0x50fa('0xd')][_0x3a2e88[_0x50fa('0x23')]][_0x50fa('0x54')]?_0x50fa('0x55')+this['channels'][_0x3a2e88[_0x50fa('0x23')]][_0x50fa('0x54')]:_0x50fa('0x56'));}}}};Fax[_0x50fa('0x1d')][_0x50fa('0x57')]=function(_0x130282){var _0x1ccf26=this;return new BPromise(function(_0xd7c8bf,_0x50b399){_0x1ccf26[_0x50fa('0x58')](_0x130282,_0x1ccf26[_0x50fa('0x20')][_0x130282['FaxAccountId']])[_0x50fa('0x47')](function(_0x39d32c){ut[_0x50fa('0x48')](_0x50fa('0x59'),_0x39d32c);_0xd7c8bf(ut['message'](_0x50fa('0x5a')));})[_0x50fa('0x3e')](function(_0x548caa){ut[_0x50fa('0x48')](_0x50fa('0x5b'),_0x548caa);updateStatus(_0x130282);_0x50b399(ut[_0x50fa('0x38')]('Fax\x20failed'));});});};Fax[_0x50fa('0x1d')]['checkAfterSend']=function(_0x2e6579){var _0x16a832=this;return new BPromise(function(_0x48ad2d,_0x343f1f){var _0x57762b=_0x16a832[_0x50fa('0x5c')](_0x16a832['faxAccounts'][_0x2e6579[_0x50fa('0x5d')]][_0x50fa('0x5e')],_0x2e6579);if(_0x57762b['isValid']){_0x48ad2d(ut[_0x50fa('0x38')](_0x50fa('0x5f')));}else{_0x343f1f(ut[_0x50fa('0x38')](_0x57762b[_0x50fa('0x38')]));}});};function originate(_0x183a22,_0x1d55a3,_0x56d1ff){return new BPromise(function(_0xaaed6a,_0x400205){if(_0x56d1ff){var _0x36ae91=util['format'](_0x50fa('0x60'),path[_0x50fa('0x3a')](_0x183a22[_0x50fa('0x5')])[_0x50fa('0x25')],_0x183a22['path']);gs[_0x50fa('0x61')](_0x36ae91)['then'](function(){_0x183a22['path']=util['format'](_0x50fa('0x62'),path[_0x50fa('0x3a')](_0x183a22[_0x50fa('0x5')])['dir'],path[_0x50fa('0x3a')](_0x183a22[_0x50fa('0x5')])[_0x50fa('0x25')]);_0x1d55a3[_0x50fa('0x63')]=_0x183a22[_0x50fa('0x5')];ut[_0x50fa('0x48')](_0x50fa('0x64'),'');ami[_0x50fa('0x65')](ut[_0x50fa('0x66')](_0x183a22,_0x1d55a3))['then'](function(_0x55a9cb){_0xaaed6a(_0x55a9cb);})[_0x50fa('0x3e')](function(_0x463a7a){_0x400205(_0x463a7a);});})['catch'](function(_0x158cd4){_0x400205(_0x158cd4);});}else{ami[_0x50fa('0x65')](ut['variablesAction'](_0x183a22,_0x1d55a3))['then'](function(_0x62ada2){_0xaaed6a(_0x62ada2);})[_0x50fa('0x3e')](function(_0x1f8962){_0x400205(_0x1f8962);});}});}Fax[_0x50fa('0x1d')][_0x50fa('0x58')]=function(_0x3c8ed5,_0xe3eb98){var _0xdf0333=this;return new BPromise(function(_0x4676e2,_0x444c8c){var _0x2c7f2d=uuid['v4']();var _0x2f6776=ut[_0x50fa('0x67')](_0x3c8ed5,_0xe3eb98);_0xdf0333[_0x50fa('0xe')][_0x2c7f2d]=new Action(_0x2c7f2d,_0xe3eb98,_0x3c8ed5);var _0x3081cd=_0xdf0333[_0x50fa('0xe')][_0x2c7f2d];if(path[_0x50fa('0x3a')](_0x3c8ed5[_0x50fa('0x5')])[_0x50fa('0x68')]==='.pdf'){originate(_0x3081cd,_0x2f6776,!![])['then'](function(_0x2b4610){_0x4676e2(_0x2b4610);})['catch'](function(_0x5e66e5){_0x444c8c(_0x5e66e5);});}else{originate(_0x3081cd,_0x2f6776,![])[_0x50fa('0x47')](function(_0x537072){_0x4676e2(_0x537072);})['catch'](function(_0x31209b){_0x444c8c(_0x31209b);});}});};Fax[_0x50fa('0x1d')][_0x50fa('0x69')]=function(_0x762fc4){return!_['isNil'](_0x762fc4)&&!_[_0x50fa('0x6a')](_0x762fc4[_0x50fa('0x25')])&&!_[_0x50fa('0x6a')](_0x762fc4['active'])&&_0x762fc4[_0x50fa('0x6b')]&&!_[_0x50fa('0x6a')](this['trunks'][util['format'](_0x50fa('0x6c'),_0x762fc4['name'])])&&!_[_0x50fa('0x6a')](this[_0x50fa('0x6d')][util['format'](_0x50fa('0x6c'),_0x762fc4[_0x50fa('0x25')])][_0x50fa('0x2f')])&&(this[_0x50fa('0x6d')][util[_0x50fa('0x6e')](_0x50fa('0x6c'),_0x762fc4[_0x50fa('0x25')])][_0x50fa('0x2f')]===_0x50fa('0x6f')||this[_0x50fa('0x6d')][util[_0x50fa('0x6e')]('SIP/%s',_0x762fc4[_0x50fa('0x25')])]['status']==='unmonitored');};Fax[_0x50fa('0x1d')][_0x50fa('0x5c')]=function(_0x5bf952,_0x7280a4){if(!this[_0x50fa('0x69')](_0x5bf952)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x50fa('0x6a')](_0x5bf952)?'':_0x5bf952[_0x50fa('0x25')]+_0x50fa('0x70'));return{'isValid':![],'message':_0x50fa('0x71')};}if(_[_0x50fa('0x6a')](_0x7280a4[_0x50fa('0x72')])){ut[_0x50fa('0x48')](_0x50fa('0x73'),JSON[_0x50fa('0x40')](_0x7280a4));return{'isValid':![],'message':_0x50fa('0x74')};}if(_['isNil'](_0x7280a4[_0x50fa('0x5')])){ut[_0x50fa('0x48')](_0x50fa('0x75'),JSON['stringify'](_0x7280a4));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x50fa('0x76')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index cb8507f..fd45d43 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 _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 +var _0xb6ba=['inspect','util','preview','lodash','../rpc/faxAccount'];(function(_0x1bacf3,_0x17ba1b){var _0x48eedb=function(_0x4eabec){while(--_0x4eabec){_0x1bacf3['push'](_0x1bacf3['shift']());}};_0x48eedb(++_0x17ba1b);}(_0xb6ba,0x65));var _0xab6b=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xb6ba[_0x23e7c1];return _0x1add43;};'use strict';var util=require(_0xab6b('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0xab6b('0x1'));var _=require(_0xab6b('0x2'));var faxAccount=require(_0xab6b('0x3'));function loggerCatch(_0x116fe9){return function(_0x373f7e){logger['error'](_0x116fe9,util[_0xab6b('0x4')](_0x373f7e,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x2e0f8f,_0x21fdba){return BPromise['resolve']()['then'](faxAccount['notify'](_0x2e0f8f,_0x21fdba))['catch'](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 14ae661..f3544f7 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 _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 +var _0xfb23=['../../../../config/logger','fax','bluebird','child_process','Exec\x20gs','inspect','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb23,0x68));var _0x3fb2=function(_0x1641c9,_0x24ad29){_0x1641c9=_0x1641c9-0x0;var _0xa46bb6=_0xfb23[_0x1641c9];return _0xa46bb6;};'use strict';var util=require(_0x3fb2('0x0'));var logger=require(_0x3fb2('0x1'))(_0x3fb2('0x2'));var BPromise=require(_0x3fb2('0x3'));var exec=require(_0x3fb2('0x4'))['exec'];exports['execute']=function(_0x11c614){return new BPromise(function(_0x23a8a2,_0x11596c){exec(_0x11c614,function(_0x3ac009,_0x5c9570,_0x47b11a){logger['info'](_0x3fb2('0x5'),_0x5c9570);if(_0x3ac009){logger['info'](_0x3fb2('0x5'),'\x20Error\x20:',util[_0x3fb2('0x6')](_0x3ac009,{'showHidden':![],'depth':null}),_0x5c9570,_0x47b11a);_0x11596c(_0x3ac009);}_0x23a8a2(_0x5c9570);});});}; \ 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 4192506..4aa3b04 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 _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 +var _0xff34=['lodash','../../../../config/logger','fax','message','logger','info','addVariables','headerinfo','minrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>'];(function(_0x463123,_0x5ca25b){var _0x462071=function(_0x5ba258){while(--_0x5ba258){_0x463123['push'](_0x463123['shift']());}};_0x462071(++_0x5ca25b);}(_0xff34,0x150));var _0x4ff3=function(_0xc4376d,_0x2e6841){_0xc4376d=_0xc4376d-0x0;var _0x291524=_0xff34[_0xc4376d];return _0x291524;};'use strict';var util=require('util');var _=require(_0x4ff3('0x0'));var moment=require('moment');var logger=require(_0x4ff3('0x1'))(_0x4ff3('0x2'));exports[_0x4ff3('0x3')]=function(_0x83b0e2){return{'message':_0x83b0e2};};exports[_0x4ff3('0x4')]=function(_0x472c97,_0x5e4614){logger[_0x4ff3('0x5')](_0x472c97,util['inspect'](_0x5e4614,{'showHidden':![],'depth':null}));};exports[_0x4ff3('0x6')]=function(_0x3c9be5,_0x467e62){var _0x2c83da={'XMF-ECM':_0x467e62['ecm'],'XMF-HEADERINFO':_0x467e62[_0x4ff3('0x7')],'XMF-MINRATE':_0x467e62[_0x4ff3('0x8')],'XMF-MAXRATE':_0x467e62['maxrate'],'XMF-MODEM':util[_0x4ff3('0x9')](_0x4ff3('0xa'),_0x467e62[_0x4ff3('0xb')]),'XMF-GATEWAY':_0x467e62[_0x4ff3('0xc')],'XMF-FAXDETECT':_0x467e62[_0x4ff3('0xd')],'XMF-T38TIMEOUT':_0x467e62[_0x4ff3('0xe')],'XMF-LOCALSTATIONID':_0x467e62[_0x4ff3('0xf')],'XMF-PATH':_0x3c9be5[_0x4ff3('0x10')]};return _0x2c83da;};exports[_0x4ff3('0x11')]=function(_0x2178a1,_0x59c75e){return{'actionid':_0x2178a1[_0x4ff3('0x12')],'action':_0x4ff3('0x13'),'channel':_0x2178a1[_0x4ff3('0x14')],'Exten':_0x4ff3('0x15'),'Context':_0x4ff3('0x16'),'Priority':'1','callerid':util[_0x4ff3('0x9')](_0x4ff3('0x17'),_0x2178a1[_0x4ff3('0x7')]?_0x2178a1[_0x4ff3('0x7')]:'',_0x2178a1[_0x4ff3('0xf')]),'variable':_0x59c75e,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2178a1['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 6310a73..e8f233d 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 _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 +var _0xcade=['./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/servicenow','../../config/logger','ami','hour','get','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','listen','sync','[index.js][main]','inspect','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user'];(function(_0x15d668,_0x322ee5){var _0x595232=function(_0x3ef2e8){while(--_0x3ef2e8){_0x15d668['push'](_0x15d668['shift']());}};_0x595232(++_0x322ee5);}(_0xcade,0x1b7));var _0xecad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcade[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xecad('0x0'));var moment=require(_0xecad('0x1'));var server=require(_0xecad('0x2'));var Realtime=require(_0xecad('0x3'));var Report=require(_0xecad('0x4'));var Acw=require(_0xecad('0x5'));var Trigger=require(_0xecad('0x6'));var Dialer=require(_0xecad('0x7'));var Preview=require(_0xecad('0x8'));var Fax=require(_0xecad('0x9'));var user=require(_0xecad('0xa'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xecad('0xb'));var voiceCallReport=require(_0xecad('0xc'));var trunk=require(_0xecad('0xd'));var trigger=require(_0xecad('0xe'));var template=require(_0xecad('0xf'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xecad('0x10'));var voiceExtension=require(_0xecad('0x11'));var faxAccount=require(_0xecad('0x12'));var zendesk=require(_0xecad('0x13'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xecad('0x14'));var freshdesk=require(_0xecad('0x15'));var desk=require(_0xecad('0x16'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xecad('0x17'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xecad('0x18'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xecad('0x19'))(_0xecad('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xecad('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xecad('0x1c')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xecad('0x1d')]()[_0xecad('0x1e')](user[_0xecad('0x1f')]())[_0xecad('0x1e')](realtime[_0xecad('0x20')]())[_0xecad('0x1e')](user[_0xecad('0x21')]())['then'](realtime[_0xecad('0x22')]())[_0xecad('0x1e')](trunk[_0xecad('0x23')]())[_0xecad('0x1e')](realtime[_0xecad('0x24')]())[_0xecad('0x1e')](voiceQueue[_0xecad('0x25')]())[_0xecad('0x1e')](realtime['initVoiceQueues']())['then'](trigger[_0xecad('0x26')]())['then'](realtime[_0xecad('0x27')]())[_0xecad('0x1e')](template[_0xecad('0x28')]())[_0xecad('0x1e')](realtime[_0xecad('0x29')]())['then'](zendesk[_0xecad('0x2a')]())[_0xecad('0x1e')](realtime[_0xecad('0x2b')]())[_0xecad('0x1e')](salesforce[_0xecad('0x2c')]())[_0xecad('0x1e')](realtime[_0xecad('0x2d')]())[_0xecad('0x1e')](sugarcrm['getSugarcrmAccounts']())['then'](realtime[_0xecad('0x2e')]())['then'](freshdesk[_0xecad('0x2f')]())['then'](realtime['initFreshdeskAccounts']())['then'](desk[_0xecad('0x30')]())[_0xecad('0x1e')](realtime[_0xecad('0x31')]())[_0xecad('0x1e')](zoho[_0xecad('0x32')]())[_0xecad('0x1e')](realtime[_0xecad('0x33')]())[_0xecad('0x1e')](vtiger['getVtigerAccounts']())['then'](realtime[_0xecad('0x34')]())[_0xecad('0x1e')](freshsales[_0xecad('0x35')]())['then'](realtime['initFreshsalesAccounts']())['then'](servicenow['getServicenowAccounts']())['then'](realtime['initServicenowAccounts']())['then'](dynamics365[_0xecad('0x36')]())[_0xecad('0x1e')](realtime[_0xecad('0x37')]())['then'](campaign[_0xecad('0x38')]())[_0xecad('0x1e')](realtime['initCampaigns']())[_0xecad('0x1e')](voiceExtension[_0xecad('0x39')]())[_0xecad('0x1e')](realtime[_0xecad('0x3a')]())[_0xecad('0x1e')](faxAccount[_0xecad('0x3b')]())[_0xecad('0x1e')](realtime[_0xecad('0x3c')]())[_0xecad('0x1e')](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0xecad('0x1e')](voiceQueueReport[_0xecad('0x3d')]())[_0xecad('0x1e')](realtime[_0xecad('0x3e')]())[_0xecad('0x1e')](cmHopperHistory[_0xecad('0x3f')]())[_0xecad('0x1e')](realtime[_0xecad('0x40')]())[_0xecad('0x1e')](cmHopperHistory[_0xecad('0x41')]())['then'](realtime[_0xecad('0x42')]())['then'](voiceCallReport[_0xecad('0x43')]())[_0xecad('0x1e')](realtime[_0xecad('0x44')]())[_0xecad('0x45')](function(_0x596638){logger[_0xecad('0x46')]('[index.js][initParams]',util['inspect'](_0x596638,{'showHidden':![],'depth':null}));});}function main(){return server[_0xecad('0x47')](realtime,preview,fax)[_0xecad('0x1e')](function(){return initRealtime();})[_0xecad('0x1e')](function(){return initParams();})[_0xecad('0x1e')](function(){report[_0xecad('0x48')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x1e6571){logger['error'](_0xecad('0x49'),util[_0xecad('0x4a')](_0x1e6571,{'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 059f75f..827f4d2 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 _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 +var _0xe8ed=['email','accountcode','fullname','state','unknown','stateTime','address','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format','status','stringify','user:%s','emit','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x5d0609,_0x127562){var _0xaa3fd1=function(_0x47f457){while(--_0x47f457){_0x5d0609['push'](_0x5d0609['shift']());}};_0xaa3fd1(++_0x127562);}(_0xe8ed,0x8a));var _0xde8e=function(_0x447b93,_0x2670ae){_0x447b93=_0x447b93-0x0;var _0x1fd738=_0xe8ed[_0x447b93];return _0x1fd738;};'use strict';var _=require(_0xde8e('0x0'));var util=require('util');var moment=require(_0xde8e('0x1'));var md5=require(_0xde8e('0x2'));var Redis=require(_0xde8e('0x3'));var config=require(_0xde8e('0x4'));config[_0xde8e('0x5')]=_[_0xde8e('0x6')](config[_0xde8e('0x5')],{'host':_0xde8e('0x7'),'port':0x18eb});var io=require(_0xde8e('0x8'))(new Redis(config[_0xde8e('0x5')]));function Agent(_0x324cc3){this['id']=_0x324cc3['id']||0x0;this[_0xde8e('0x9')]=_0x324cc3['name']||'';this[_0xde8e('0xa')]=_0x324cc3[_0xde8e('0xa')]||'';this[_0xde8e('0xb')]=_0x324cc3[_0xde8e('0xb')]||'';this[_0xde8e('0xc')]=_0x324cc3[_0xde8e('0xc')]||'';this[_0xde8e('0xd')]=_0xde8e('0xe');this[_0xde8e('0xf')]=0x0;this['status']='unknown';this[_0xde8e('0x10')]='';this['phone']='';this[_0xde8e('0x11')]='';this[_0xde8e('0x12')]='';this[_0xde8e('0x13')]=_0x324cc3[_0xde8e('0x13')]||![];this[_0xde8e('0x14')]=_0xde8e('0xe');this[_0xde8e('0x15')]=0x0;this[_0xde8e('0x16')]='';this[_0xde8e('0x17')]='';this[_0xde8e('0x18')]=![];this['local']=![];this[_0xde8e('0x2')]='';}Agent['prototype']['updateStatusRealtime']=function(_0x2b7192){var _0x3d0ff2;if(_0x2b7192&&_0x2b7192[_0xde8e('0xd')]){_0x3d0ff2=_0x2b7192[_0xde8e('0xd')][_0xde8e('0x19')]();switch(_0x3d0ff2){case _0xde8e('0x1a'):_0x3d0ff2=_0xde8e('0x1b');break;case _0xde8e('0x1c'):_0x3d0ff2='talking';break;}}if(_0x3d0ff2&&this[_0xde8e('0x14')]!==_0x3d0ff2||_0x2b7192[_0xde8e('0x1d')]){this['voiceStatusTime']=_[_0xde8e('0x1e')](moment()[_0xde8e('0x1f')]('x'));}if(_0x3d0ff2){this[_0xde8e('0x14')]=_0x3d0ff2;}var _0x172d0b={'id':this['id'],'name':this[_0xde8e('0x9')],'email':this['email'],'accountcode':this['accountcode'],'fullname':this[_0xde8e('0xc')],'state':this[_0xde8e('0xd')],'stateTime':this[_0xde8e('0xf')],'status':this[_0xde8e('0x20')],'address':this[_0xde8e('0x10')],'online':this[_0xde8e('0x13')],'voiceStatus':this[_0xde8e('0x14')],'voiceStatusTime':this[_0xde8e('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0xde8e('0x17')],'interface':this[_0xde8e('0x12')],'onhold':this['onhold']};var _0x4b8352=md5(JSON[_0xde8e('0x21')](_0x172d0b));if(this[_0xde8e('0x2')]!==_0x4b8352){this['md5']=_0x4b8352;io['to'](util['format'](_0xde8e('0x22'),_0x172d0b[_0xde8e('0x9')]))[_0xde8e('0x23')]('user:save',_0x172d0b);io[_0xde8e('0x23')]('user:presence',_0x172d0b);}};module[_0xde8e('0x24')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 9dea67d..23d35b6 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 _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 +var _0xaf34=['dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry'];(function(_0x27c0e1,_0x14bf90){var _0x3a93d6=function(_0x2d5e35){while(--_0x2d5e35){_0x27c0e1['push'](_0x27c0e1['shift']());}};_0x3a93d6(++_0x14bf90);}(_0xaf34,0xd5));var _0x4af3=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xaf34[_0x46698a];return _0x356db0;};'use strict';function Campaign(_0x5e601a){this['id']=_0x5e601a['id']||0x0;this['name']=_0x5e601a[_0x4af3('0x0')]||'';this[_0x4af3('0x1')]=_0x5e601a[_0x4af3('0x1')]||'campaign';this[_0x4af3('0x2')]=0x0;this[_0x4af3('0x3')]=0x0;this[_0x4af3('0x4')]=0x0;this[_0x4af3('0x5')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this['active']=_0x5e601a[_0x4af3('0x6')];this[_0x4af3('0x7')]=_0x5e601a[_0x4af3('0x7')];this[_0x4af3('0x8')]=_0x5e601a[_0x4af3('0x8')]||null;this['dialGlobalInterval']=_0x5e601a[_0x4af3('0x9')]?_0x5e601a['dialGlobalInterval']:null;this[_0x4af3('0xa')]=_0x5e601a[_0x4af3('0xa')];this[_0x4af3('0xb')]=_0x5e601a[_0x4af3('0xb')];this[_0x4af3('0xc')]=_0x5e601a['dialOriginateTimeout']||0x1e;this[_0x4af3('0xd')]=_0x5e601a['dialCongestionMaxRetry'];this[_0x4af3('0xe')]=_0x5e601a['dialCongestionRetryFrequency'];this[_0x4af3('0xf')]=_0x5e601a[_0x4af3('0xf')];this[_0x4af3('0x10')]=_0x5e601a[_0x4af3('0x10')];this['dialNoAnswerMaxRetry']=_0x5e601a['dialNoAnswerMaxRetry'];this[_0x4af3('0x11')]=_0x5e601a[_0x4af3('0x11')];this[_0x4af3('0x12')]=_0x5e601a[_0x4af3('0x12')];this['dialNoSuchNumberMaxRetry']=_0x5e601a[_0x4af3('0x13')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x5e601a[_0x4af3('0x14')]||0x96;this[_0x4af3('0x15')]=_0x5e601a[_0x4af3('0x15')]||0x3;this[_0x4af3('0x16')]=_0x5e601a[_0x4af3('0x16')]||0x96;this[_0x4af3('0x17')]=_0x5e601a[_0x4af3('0x17')]||0x3;this[_0x4af3('0x18')]=_0x5e601a[_0x4af3('0x18')]||0x96;this['dialMachineMaxRetry']=_0x5e601a[_0x4af3('0x19')]||0x3;this[_0x4af3('0x1a')]=_0x5e601a[_0x4af3('0x1a')]||0x96;this[_0x4af3('0x1b')]=_0x5e601a[_0x4af3('0x1b')]||0x3;this[_0x4af3('0x1c')]=_0x5e601a[_0x4af3('0x1c')]||0x96;this['dialOrderByScheduledAt']=_0x5e601a['dialOrderByScheduledAt']||'DESC';this[_0x4af3('0x1d')]=_0x5e601a[_0x4af3('0x1d')]||undefined;this[_0x4af3('0x1e')]=_0x5e601a[_0x4af3('0x1e')]||undefined;this[_0x4af3('0x1f')]=_0x5e601a[_0x4af3('0x1f')]||undefined;this[_0x4af3('0x20')]=_0x5e601a[_0x4af3('0x20')]?_0x5e601a[_0x4af3('0x20')]:undefined;this[_0x4af3('0x21')]=_0x5e601a[_0x4af3('0x21')]?_0x5e601a['Trunk']:undefined;this[_0x4af3('0x22')]=_0x5e601a[_0x4af3('0x22')]?_0x5e601a[_0x4af3('0x22')]:undefined;this[_0x4af3('0x23')]=_0x5e601a[_0x4af3('0x23')]?_0x5e601a[_0x4af3('0x23')]:undefined;this[_0x4af3('0x24')]=_0x5e601a[_0x4af3('0x23')]?_0x5e601a[_0x4af3('0x23')][_0x4af3('0x0')]:undefined;this[_0x4af3('0x25')]=_0x5e601a[_0x4af3('0x25')]||![];this[_0x4af3('0x26')]=_0x5e601a[_0x4af3('0x26')];this[_0x4af3('0x27')]=_0x5e601a['dialAMDGreeting'];this[_0x4af3('0x28')]=_0x5e601a[_0x4af3('0x28')];this[_0x4af3('0x29')]=_0x5e601a[_0x4af3('0x29')];this[_0x4af3('0x2a')]=_0x5e601a[_0x4af3('0x2a')];this['dialAMDBetweenWordsSilence']=_0x5e601a[_0x4af3('0x2b')];this[_0x4af3('0x2c')]=_0x5e601a['dialAMDMaximumNumberOfWords'];this[_0x4af3('0x2d')]=_0x5e601a[_0x4af3('0x2d')];this[_0x4af3('0x2e')]=_0x5e601a[_0x4af3('0x2e')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 32b8bf0..fb4c9e4 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 _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 +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(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x32e7,0xc3));var _0x732e=function(_0x176c84,_0x489fb5){_0x176c84=_0x176c84-0x0;var _0xa68703=_0x32e7[_0x176c84];return _0xa68703;};'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 a9fa8c3..85a15eb 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 _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 +var _0x051e=['consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey'];(function(_0x5343a8,_0x7ff6a){var _0x107eed=function(_0x3eb62d){while(--_0x3eb62d){_0x5343a8['push'](_0x5343a8['shift']());}};_0x107eed(++_0x7ff6a);}(_0x051e,0xe4));var _0xe051=function(_0x31a0e2,_0x4350c1){_0x31a0e2=_0x31a0e2-0x0;var _0x56bc64=_0x051e[_0x31a0e2];return _0x56bc64;};'use strict';function DeskAccount(_0x2bb9bc){this['id']=_0x2bb9bc['id']||0x0;this[_0xe051('0x0')]=_0x2bb9bc[_0xe051('0x0')]||'';this[_0xe051('0x1')]=_0x2bb9bc[_0xe051('0x1')]||'';this[_0xe051('0x2')]=_0x2bb9bc[_0xe051('0x2')]||'';this[_0xe051('0x3')]=_0x2bb9bc[_0xe051('0x3')]||'';this[_0xe051('0x4')]=_0x2bb9bc['password']||'';this[_0xe051('0x5')]=_0x2bb9bc[_0xe051('0x5')]||'';this[_0xe051('0x6')]=_0x2bb9bc[_0xe051('0x6')]||'';this['token']=_0x2bb9bc[_0xe051('0x7')]||'';this['tokenSecret']=_0x2bb9bc[_0xe051('0x8')]||'';this[_0xe051('0x9')]=_0x2bb9bc[_0xe051('0x9')]||'';this[_0xe051('0xa')]=_0x2bb9bc['serverUrl']||'';this[_0xe051('0xb')]=_0x2bb9bc[_0xe051('0xb')]||{};}module[_0xe051('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 80e800f..7617fee 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 _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 +var _0xfd85=['serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x1ecca2,_0x5bea3e){var _0x89b862=function(_0x3b9c6c){while(--_0x3b9c6c){_0x1ecca2['push'](_0x1ecca2['shift']());}};_0x89b862(++_0x5bea3e);}(_0xfd85,0x13d));var _0x5fd8=function(_0x405868,_0x3b6e2c){_0x405868=_0x405868-0x0;var _0x51873d=_0xfd85[_0x405868];return _0x51873d;};'use strict';function Dynamics365Account(_0x480723){this['id']=_0x480723['id']||0x0;this[_0x5fd8('0x0')]=_0x480723[_0x5fd8('0x0')]||'';this[_0x5fd8('0x1')]=_0x480723[_0x5fd8('0x1')]||'';this[_0x5fd8('0x2')]=_0x480723[_0x5fd8('0x2')]||'';this[_0x5fd8('0x3')]=_0x480723[_0x5fd8('0x3')]||'';this[_0x5fd8('0x4')]=_0x480723[_0x5fd8('0x4')]||'';this[_0x5fd8('0x5')]=_0x480723[_0x5fd8('0x5')]||'';this[_0x5fd8('0x6')]=_0x480723[_0x5fd8('0x6')]||{};this[_0x5fd8('0x7')]=_0x480723[_0x5fd8('0x7')]||'';this[_0x5fd8('0x8')]=_0x480723[_0x5fd8('0x8')]||![];this[_0x5fd8('0x9')]=_0x480723[_0x5fd8('0x9')]||{};this[_0x5fd8('0xa')]=_0x480723[_0x5fd8('0xa')]||{};}module[_0x5fd8('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 0ea89ee..885cabe 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 _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 +var _0xffbe=['headerinfo','minrate','maxrate','modem','v17,v27,v29','gateway','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm'];(function(_0x4d5c3c,_0x1a17e9){var _0x1e9eca=function(_0x59ca6){while(--_0x59ca6){_0x4d5c3c['push'](_0x4d5c3c['shift']());}};_0x1e9eca(++_0x1a17e9);}(_0xffbe,0x13d));var _0xeffb=function(_0x481357,_0x1002f4){_0x481357=_0x481357-0x0;var _0x150ad8=_0xffbe[_0x481357];return _0x150ad8;};'use strict';function FaxAccount(_0xc43060){this['id']=_0xc43060['id']||0x0;this['name']=_0xc43060[_0xeffb('0x0')]||'';this[_0xeffb('0x1')]=_0xc43060[_0xeffb('0x1')];this[_0xeffb('0x2')]=_0xc43060['ecm'];this['headerinfo']=_0xc43060[_0xeffb('0x3')];this['localstationid']=_0xc43060['localstationid'];this[_0xeffb('0x4')]=_0xc43060[_0xeffb('0x4')]||0x960;this[_0xeffb('0x5')]=_0xc43060[_0xeffb('0x5')]||0x3840;this[_0xeffb('0x6')]=_0xc43060[_0xeffb('0x6')]||_0xeffb('0x7');this[_0xeffb('0x8')]=_0xc43060['gateway']||'no';this['faxdetect']=_0xc43060['faxdetect']||'no';this[_0xeffb('0x9')]=_0xc43060['t38timeout']||0x1388;this[_0xeffb('0xa')]=_0xc43060[_0xeffb('0xa')]||_0xeffb('0xb');this['Trunk']=_0xc43060[_0xeffb('0xc')]?_0xc43060['Trunk']:undefined;this['ListId']=_0xc43060[_0xeffb('0xd')];this[_0xeffb('0xe')]=_0xc43060[_0xeffb('0xe')];}module[_0xeffb('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 2d31a19..f90794a 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 _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 +var _0xb26e=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xb26e,0x1ea));var _0xeb26=function(_0x58d8d7,_0x108377){_0x58d8d7=_0x58d8d7-0x0;var _0x339d20=_0xb26e[_0x58d8d7];return _0x339d20;};'use strict';function FreshdeskAccount(_0x24d9e1){this['id']=_0x24d9e1['id']||0x0;this[_0xeb26('0x0')]=_0x24d9e1[_0xeb26('0x0')]||'';this['username']=_0x24d9e1[_0xeb26('0x1')]||'';this[_0xeb26('0x2')]=_0x24d9e1[_0xeb26('0x3')]||'';this['remoteUri']=_0x24d9e1[_0xeb26('0x4')]||'';this[_0xeb26('0x5')]=_0x24d9e1['serverUrl']||'';this[_0xeb26('0x6')]=_0x24d9e1['Configurations']||{};}module[_0xeb26('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index e1aa819..607230f 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 _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 +var _0x872a=['remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x4d43bf,_0x1d0cdc){var _0x14afee=function(_0x222cc3){while(--_0x222cc3){_0x4d43bf['push'](_0x4d43bf['shift']());}};_0x14afee(++_0x1d0cdc);}(_0x872a,0x100));var _0xa872=function(_0x29fcf2,_0x147fc9){_0x29fcf2=_0x29fcf2-0x0;var _0x1763f7=_0x872a[_0x29fcf2];return _0x1763f7;};'use strict';function FreshsalesAccount(_0x30eae3){this['id']=_0x30eae3['id']||0x0;this[_0xa872('0x0')]=_0x30eae3[_0xa872('0x0')]||'';this[_0xa872('0x1')]=_0x30eae3['username']||'';this['apiKey']=_0x30eae3['token']||'';this[_0xa872('0x2')]=_0x30eae3[_0xa872('0x2')]||'';this[_0xa872('0x3')]=_0x30eae3[_0xa872('0x3')]||'';this[_0xa872('0x4')]=_0x30eae3[_0xa872('0x4')]||{};}module[_0xa872('0x5')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index ca79fa5..26145c3 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 _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 +var _0xfc0d=['count','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','connectedlinenum','connectedlinename','accountcode','context','priority','holdtime','lastAssignedTo','motionChannel','routealias','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','position'];(function(_0x131614,_0x500b9a){var _0x13b897=function(_0x5863cb){while(--_0x5863cb){_0x131614['push'](_0x131614['shift']());}};_0x13b897(++_0x500b9a);}(_0xfc0d,0x8e));var _0xdfc0=function(_0x5b99dc,_0x269788){_0x5b99dc=_0x5b99dc-0x0;var _0x1f3df2=_0xfc0d[_0x5b99dc];return _0x1f3df2;};'use strict';function QueueReport(){this[_0xdfc0('0x0')]=_0xdfc0('0x1');this[_0xdfc0('0x2')]='';this[_0xdfc0('0x3')]='';this[_0xdfc0('0x4')]='';this[_0xdfc0('0x5')]='';this['queuecallerjoinAt']=null;this[_0xdfc0('0x6')]=null;this[_0xdfc0('0x7')]=0x1;this[_0xdfc0('0x8')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0xdfc0('0x9')]=![];this[_0xdfc0('0xa')]=null;this[_0xdfc0('0xb')]=![];this[_0xdfc0('0xc')]=null;this['originalposition']=0x1;this['channel']='';this[_0xdfc0('0xd')]='';this[_0xdfc0('0xe')]='';this[_0xdfc0('0xf')]='';this[_0xdfc0('0x10')]='';this['exten']='';this[_0xdfc0('0x11')]='';this[_0xdfc0('0x12')]=0x0;this['assigned']=![];this[_0xdfc0('0x13')]='';this[_0xdfc0('0x14')]='voice';this[_0xdfc0('0x15')]=null;this[_0xdfc0('0x16')]=0x0;this[_0xdfc0('0x17')]={};}module[_0xdfc0('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 6f402a2..5ddb879 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 _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 +var _0x176a=['securityToken','type','integrationTab','serverUrl','Configurations','exports','username','remoteUri','password','clientId','clientSecret'];(function(_0x1e6ed7,_0x547958){var _0x57952f=function(_0x86eef){while(--_0x86eef){_0x1e6ed7['push'](_0x1e6ed7['shift']());}};_0x57952f(++_0x547958);}(_0x176a,0x8a));var _0xa176=function(_0x33de28,_0x18208d){_0x33de28=_0x33de28-0x0;var _0x4723f7=_0x176a[_0x33de28];return _0x4723f7;};'use strict';function SalesforceAccount(_0x491f68){this['id']=_0x491f68['id']||0x0;this['name']=_0x491f68['name']||'';this['username']=_0x491f68[_0xa176('0x0')]||'';this[_0xa176('0x1')]=_0x491f68['remoteUri']||'';this[_0xa176('0x2')]=_0x491f68[_0xa176('0x2')]||'';this[_0xa176('0x3')]=_0x491f68[_0xa176('0x3')]||'';this[_0xa176('0x4')]=_0x491f68[_0xa176('0x4')]||'';this[_0xa176('0x5')]=_0x491f68[_0xa176('0x5')]||'';this[_0xa176('0x6')]=_0x491f68[_0xa176('0x6')]||_0xa176('0x7');this[_0xa176('0x8')]=_0x491f68[_0xa176('0x8')]||'';this[_0xa176('0x9')]=_0x491f68['Configurations']||{};}module[_0xa176('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 7ef7e80..3d0addc 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 _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 +var _0xa672=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0xac53d2,_0x121075){var _0x2e5759=function(_0x382b9e){while(--_0x382b9e){_0xac53d2['push'](_0xac53d2['shift']());}};_0x2e5759(++_0x121075);}(_0xa672,0xa6));var _0x2a67=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xa672[_0x1da527];return _0x40fc7c;};'use strict';function ServicenowAccount(_0x26a6f6){this['id']=_0x26a6f6['id']||0x0;this[_0x2a67('0x0')]=_0x26a6f6[_0x2a67('0x0')]||'';this[_0x2a67('0x1')]=_0x26a6f6[_0x2a67('0x1')]||'';this[_0x2a67('0x2')]=_0x26a6f6[_0x2a67('0x2')]||'';this['remoteUri']=_0x26a6f6[_0x2a67('0x3')]||'';this[_0x2a67('0x4')]=_0x26a6f6[_0x2a67('0x4')]||'';this[_0x2a67('0x5')]=_0x26a6f6[_0x2a67('0x5')]||{};}module[_0x2a67('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 228909f..1fe00ea 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 _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 +var _0x59ad=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0xd50ac1,_0x48173e){var _0x516afe=function(_0x83f3ec){while(--_0x83f3ec){_0xd50ac1['push'](_0xd50ac1['shift']());}};_0x516afe(++_0x48173e);}(_0x59ad,0xee));var _0xd59a=function(_0x9a72ce,_0x3b9865){_0x9a72ce=_0x9a72ce-0x0;var _0xb41f92=_0x59ad[_0x9a72ce];return _0xb41f92;};'use strict';function SugarcrmAccount(_0xc9ee44){this['id']=_0xc9ee44['id']||0x0;this[_0xd59a('0x0')]=_0xc9ee44[_0xd59a('0x0')]||'';this[_0xd59a('0x1')]=_0xc9ee44[_0xd59a('0x1')]||'';this[_0xd59a('0x2')]=_0xc9ee44[_0xd59a('0x2')]||'';this[_0xd59a('0x3')]=_0xc9ee44[_0xd59a('0x3')]||'';this[_0xd59a('0x4')]=_0xc9ee44[_0xd59a('0x4')]||'';this[_0xd59a('0x5')]=_0xc9ee44[_0xd59a('0x5')]||{};}module[_0xd59a('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 46cee3a..f632a5e 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 _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 +var _0x4f9b=['exports','name','accountcode','state','unknown','stateTime'];(function(_0x46440c,_0x4da44f){var _0x1cb968=function(_0x2f2b37){while(--_0x2f2b37){_0x46440c['push'](_0x46440c['shift']());}};_0x1cb968(++_0x4da44f);}(_0x4f9b,0x6d));var _0xb4f9=function(_0x523efb,_0x11f34c){_0x523efb=_0x523efb-0x0;var _0xa63c26=_0x4f9b[_0x523efb];return _0xa63c26;};'use strict';function Telephone(_0x250137){this['id']=_0x250137['id']||0x0;this[_0xb4f9('0x0')]=_0x250137[_0xb4f9('0x0')]||'';this[_0xb4f9('0x1')]=_0x250137[_0xb4f9('0x1')]||'';this[_0xb4f9('0x2')]=_0xb4f9('0x3');this[_0xb4f9('0x4')]=0x0;this['status']='unknown';this['address']='';}module[_0xb4f9('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index fb713d7..1329914 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(_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 +var _0xa9e0=['exports','name'];(function(_0x4aa97d,_0x263c37){var _0x1f772e=function(_0x38bb51){while(--_0x38bb51){_0x4aa97d['push'](_0x4aa97d['shift']());}};_0x1f772e(++_0x263c37);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 7d319cc..08f13fd 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 _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 +var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x409c8b,_0x4892d4){var _0x430500=function(_0x386132){while(--_0x386132){_0x409c8b['push'](_0x409c8b['shift']());}};_0x430500(++_0x4892d4);}(_0x4fc2,0x111));var _0x24fc=function(_0x1e474c,_0x35e2cb){_0x1e474c=_0x1e474c-0x0;var _0x4a769f=_0x4fc2[_0x1e474c];return _0x4a769f;};'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 5b1928a..bed1644 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 _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 +var _0x4c03=['split','host','port','domain','domainport','refresh','registrationtime','defaultuser','exports','active','name','state','unknown','status','registry','indexOf'];(function(_0x24e446,_0xb9828d){var _0x200d1e=function(_0x3be5d5){while(--_0x3be5d5){_0x24e446['push'](_0x24e446['shift']());}};_0x200d1e(++_0xb9828d);}(_0x4c03,0x1c9));var _0x34c0=function(_0x4b21e9,_0x34e84a){_0x4b21e9=_0x4b21e9-0x0;var _0x16d6e7=_0x4c03[_0x4b21e9];return _0x16d6e7;};'use strict';function Trunk(_0x2f802f){this['id']=_0x2f802f['id']||0x0;this[_0x34c0('0x0')]=_0x2f802f['active']||![];this[_0x34c0('0x1')]=_0x2f802f[_0x34c0('0x1')]||'';this[_0x34c0('0x2')]=_0x34c0('0x3');this['stateTime']=0x0;this[_0x34c0('0x4')]='unknown';this['registry']=_0x2f802f[_0x34c0('0x5')]&&_0x2f802f[_0x34c0('0x5')][_0x34c0('0x6')](':')?_0x2f802f[_0x34c0('0x5')][_0x34c0('0x7')](':')[0x0]:'';this[_0x34c0('0x8')]='';this[_0x34c0('0x9')]='';this[_0x34c0('0xa')]='';this[_0x34c0('0xb')]='';this[_0x34c0('0xc')]='';this['stateRegistry']='unknown';this[_0x34c0('0xd')]='';this['address']='';this[_0x34c0('0xe')]=_0x2f802f['defaultuser']||'';}module[_0x34c0('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 71b840d..d5fac9b 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 _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 +var _0x0651=['recordingFormat','none','exten'];(function(_0x3cca58,_0x532517){var _0xad9c74=function(_0x157e31){while(--_0x157e31){_0x3cca58['push'](_0x3cca58['shift']());}};_0xad9c74(++_0x532517);}(_0x0651,0x16d));var _0x1065=function(_0x38e8d6,_0x3fccc0){_0x38e8d6=_0x38e8d6-0x0;var _0x47d157=_0x0651[_0x38e8d6];return _0x47d157;};'use strict';function voiceExtension(_0xccbc39){this['id']=_0xccbc39['id']||0x0;this[_0x1065('0x0')]=_0xccbc39[_0x1065('0x0')]||'';this[_0x1065('0x1')]=_0xccbc39[_0x1065('0x1')]||_0x1065('0x2');this['mandatoryDisposition']=_0xccbc39['mandatoryDisposition']||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 21bf468..5ef2c30 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 _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 +var _0x58e5=['dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','leastrecent','linear','random','ringall','rrmemory','rrordered','wrandom','name','monitor_format','type','total','answered','sumDuration','sumHoldTime','unmanaged','abandoned','available','busy','inUse','invalid','loggedIn','notInUse','onHold','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue'];(function(_0x1cea2b,_0x5e2d5c){var _0x298602=function(_0xf96b75){while(--_0xf96b75){_0x1cea2b['push'](_0x1cea2b['shift']());}};_0x298602(++_0x5e2d5c);}(_0x58e5,0x167));var _0x558e=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x58e5[_0x51020b];return _0x371e47;};'use strict';var monitorFormat={'wav':_0x558e('0x0'),'wav49':_0x558e('0x1'),'gsm':_0x558e('0x2')};var strategy={'fewestcalls':_0x558e('0x3'),'leastrecent':_0x558e('0x4'),'linear':_0x558e('0x5'),'random':_0x558e('0x6'),'ringall':_0x558e('0x7'),'rr':'roundrobin','rrmemory':_0x558e('0x8'),'rrordered':_0x558e('0x9'),'wrandom':_0x558e('0xa')};function VoiceQueue(_0x57d8b5){this['id']=_0x57d8b5['id']||0x0;this[_0x558e('0xb')]=_0x57d8b5[_0x558e('0xb')]||'';this['monitor_format']=_0x57d8b5[_0x558e('0xc')]||'';this[_0x558e('0xd')]=_0x57d8b5[_0x558e('0xd')]||'inbound';this['waiting']=0x0;this[_0x558e('0xe')]=0x0;this[_0x558e('0xf')]=0x0;this[_0x558e('0x10')]=0x0;this[_0x558e('0x11')]=0x0;this['sumBillable']=0x0;this[_0x558e('0x12')]=0x0;this[_0x558e('0x13')]=0x0;this[_0x558e('0x14')]=0x0;this[_0x558e('0x15')]=0x0;this[_0x558e('0x16')]=0x0;this[_0x558e('0x17')]=0x0;this[_0x558e('0x18')]=0x0;this[_0x558e('0x19')]=0x0;this[_0x558e('0x1a')]=0x0;this['paused']=0x0;this[_0x558e('0x1b')]=0x0;this[_0x558e('0x1c')]=0x0;this[_0x558e('0x1d')]=0x0;this[_0x558e('0x1e')]=0x0;this[_0x558e('0x1f')]=0x0;this[_0x558e('0x20')]=_0x57d8b5[_0x558e('0x20')]||![];this[_0x558e('0x21')]=_0x57d8b5[_0x558e('0x21')]||0xa;this['autopause']=_0x57d8b5[_0x558e('0x22')]||'no';this[_0x558e('0x23')]=!![];this[_0x558e('0x24')]='';this[_0x558e('0x25')]='';this['originated']=0x0;this[_0x558e('0x26')]=0x0;this[_0x558e('0x27')]=_0x57d8b5['dialTimezone']||null;this[_0x558e('0x28')]=_0x57d8b5['dialGlobalInterval']?_0x57d8b5[_0x558e('0x28')]:null;this[_0x558e('0x29')]=_0x57d8b5[_0x558e('0x29')];this[_0x558e('0x2a')]=_0x57d8b5['dialMethod']||_0x558e('0x2b');this[_0x558e('0x2c')]=_0x57d8b5[_0x558e('0x2c')]||0x0;this['dialLimitQueue']=_0x57d8b5[_0x558e('0x2d')]||0x0;this['dialPowerLevel']=_0x57d8b5[_0x558e('0x2e')]||0x1;this[_0x558e('0x2f')]=_0x57d8b5[_0x558e('0x2f')]||'dropRate';this[_0x558e('0x30')]=_0x57d8b5[_0x558e('0x30')]||0.03;this[_0x558e('0x31')]=_0x57d8b5[_0x558e('0x31')]||0x258;this[_0x558e('0x32')]=_0x57d8b5[_0x558e('0x32')]||_0x558e('0x33');this['dialOriginateCallerIdNumber']=_0x57d8b5[_0x558e('0x34')]||_0x558e('0x33');this[_0x558e('0x35')]=_0x57d8b5['dialOriginateTimeout']||0x1e;this[_0x558e('0x36')]=_0x57d8b5[_0x558e('0x36')]||_0x558e('0x37');this['dialQueueTimeout']=_0x57d8b5[_0x558e('0x38')]||0x3;this[_0x558e('0x39')]=_0x57d8b5[_0x558e('0x39')]||undefined;this[_0x558e('0x3a')]=_0x57d8b5['dialCongestionMaxRetry']||0x3;this[_0x558e('0x3b')]=_0x57d8b5['dialCongestionRetryFrequency']||0x96;this[_0x558e('0x3c')]=_0x57d8b5[_0x558e('0x3c')]||0x3;this['dialBusyRetryFrequency']=_0x57d8b5[_0x558e('0x3d')]||0x96;this['dialNoAnswerMaxRetry']=_0x57d8b5[_0x558e('0x3e')]||0x3;this[_0x558e('0x3f')]=_0x57d8b5[_0x558e('0x3f')]||0x96;this[_0x558e('0x40')]=_0x57d8b5[_0x558e('0x40')]||0x3;this[_0x558e('0x41')]=_0x57d8b5[_0x558e('0x41')]||0x96;this[_0x558e('0x42')]=_0x57d8b5[_0x558e('0x42')]||0x3;this[_0x558e('0x43')]=_0x57d8b5[_0x558e('0x43')]||0x96;this['dialAbandonedMaxRetry']=_0x57d8b5[_0x558e('0x44')]||0x3;this[_0x558e('0x45')]=_0x57d8b5['dialAbandonedRetryFrequency']||0x96;this[_0x558e('0x46')]=_0x57d8b5['dialMachineMaxRetry']||0x3;this[_0x558e('0x47')]=_0x57d8b5[_0x558e('0x47')]||0x96;this[_0x558e('0x48')]=_0x57d8b5[_0x558e('0x48')]||0x3;this[_0x558e('0x49')]=_0x57d8b5['dialAgentRejectRetryFrequency']||0x96;this[_0x558e('0x4a')]=_0x57d8b5['callAdditionalPhoneAfterMin']||0x3;this[_0x558e('0x4b')]=_0x57d8b5[_0x558e('0x4b')]||0x4;this['Trunk']=_0x57d8b5[_0x558e('0x4c')]?_0x57d8b5['Trunk']:undefined;this[_0x558e('0x4d')]=_0x57d8b5['TrunkBackup']?_0x57d8b5[_0x558e('0x4d')]:undefined;this[_0x558e('0x4e')]=_0x57d8b5[_0x558e('0x4e')]||undefined;this[_0x558e('0x4f')]=_0x57d8b5['Interval']?_0x57d8b5[_0x558e('0x4f')]:undefined;this[_0x558e('0x50')]=_0x57d8b5[_0x558e('0x50')]||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x57d8b5[_0x558e('0x51')]||undefined;this[_0x558e('0x52')]=_0x57d8b5['dialCutDigit']||undefined;this[_0x558e('0x53')]=strategy[_0x57d8b5[_0x558e('0x53')]];this[_0x558e('0x54')]=!![];this[_0x558e('0x55')]=_0x57d8b5[_0x558e('0x55')]||![];this[_0x558e('0x56')]=_0x57d8b5['dialAMDInitialSilence'];this[_0x558e('0x57')]=_0x57d8b5[_0x558e('0x57')];this[_0x558e('0x58')]=_0x57d8b5['dialAMDAfterGreetingSilence'];this[_0x558e('0x59')]=_0x57d8b5[_0x558e('0x59')];this[_0x558e('0x5a')]=_0x57d8b5[_0x558e('0x5a')];this[_0x558e('0x5b')]=_0x57d8b5[_0x558e('0x5b')];this[_0x558e('0x5c')]=_0x57d8b5[_0x558e('0x5c')];this['dialAMDSilenceThreshold']=_0x57d8b5[_0x558e('0x5d')];this[_0x558e('0x5e')]=_0x57d8b5[_0x558e('0x5e')];this[_0x558e('0x5f')]=0x0;this[_0x558e('0x60')]=0x0;this[_0x558e('0x61')]=_0x57d8b5[_0x558e('0x61')];this[_0x558e('0x62')]=0x0;this[_0x558e('0x63')]=0x0;this[_0x558e('0x64')]=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x558e('0x65')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x558e('0x66')]=0x0;this[_0x558e('0x67')]=0x0;this[_0x558e('0x68')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x558e('0x69')]=0x0;this[_0x558e('0x6a')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x558e('0x6b')]=undefined;this[_0x558e('0x6c')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x558e('0x6d')]=0x0;this[_0x558e('0x6e')]=0x0;this[_0x558e('0x6f')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x558e('0x70')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x558e('0x71')]=0x0;this[_0x558e('0x72')]=0x0;this[_0x558e('0x73')]=_0x57d8b5['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x558e('0x74')]=_0x57d8b5['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x558e('0x75')]=0x0;this[_0x558e('0x76')]=0x0;this[_0x558e('0x77')]=0x1;this[_0x558e('0x78')]=0x0;this[_0x558e('0x79')]=0x0;this[_0x558e('0x7a')]=0x0;this[_0x558e('0x7b')]=0x0;this['dialRecallMeTimeout']=_0x57d8b5[_0x558e('0x7c')]||0x1e;this['dialRecallInQueue']=_0x57d8b5[_0x558e('0x7d')]||![];this[_0x558e('0x7e')]=!!_0x57d8b5[_0x558e('0x7e')]||![];this[_0x558e('0x7f')]=!!_0x57d8b5[_0x558e('0x7f')]||![];this[_0x558e('0x80')]=_0x57d8b5[_0x558e('0x80')]||undefined;this[_0x558e('0x81')]=_0x57d8b5[_0x558e('0x81')]||![];this['dialAgiAfterHangupAgent']=_0x57d8b5[_0x558e('0x82')]||![];this['monitor_format']=monitorFormat[_0x57d8b5[_0x558e('0xc')]]?monitorFormat[_0x57d8b5[_0x558e('0xc')]]:undefined;this[_0x558e('0x83')]=_0x57d8b5[_0x558e('0x83')]||![];this[_0x558e('0x84')]=_0x57d8b5[_0x558e('0x84')]?_0x57d8b5[_0x558e('0x84')]:undefined;this[_0x558e('0x85')]=![];}module[_0x558e('0x86')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 0db8327..5ad221b 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 _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 +var _0x04f1=['inUse','invalid','onHold','notInUse','paused','ringing','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','callers','length','online','includes','status','exten','xcally-motion-preview','some','compareToOutboundQueue','updateReportFromOutboundQueue','originated','preview','exports','available','loggedIn','loggedInDb','talking','waiting','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','pTalking','sumBillable','sumDuration','total','name','strategy','abandoned','answered','busy'];(function(_0x928ab1,_0x27a137){var _0x1fab80=function(_0x2040df){while(--_0x2040df){_0x928ab1['push'](_0x928ab1['shift']());}};_0x1fab80(++_0x27a137);}(_0x04f1,0x92));var _0x104f=function(_0x2f412,_0x3affba){_0x2f412=_0x2f412-0x0;var _0xe490f1=_0x04f1[_0x2f412];return _0xe490f1;};'use strict';var INBOUND_COUNTERS=[_0x104f('0x0'),_0x104f('0x1'),_0x104f('0x2'),'paused','ringing',_0x104f('0x3'),_0x104f('0x4')];var OUTBOUND_COUNTERS=[_0x104f('0x0'),'answered','inUse','loggedIn','loggedInDb','originated',_0x104f('0x5'),_0x104f('0x6'),_0x104f('0x7'),_0x104f('0x8'),'outboundCongestionCallsDay',_0x104f('0x9'),_0x104f('0xa'),_0x104f('0xb'),_0x104f('0xc'),'outboundUnknownCallsDay','paused',_0x104f('0xd'),_0x104f('0x3'),_0x104f('0xe'),_0x104f('0xf'),_0x104f('0x10'),_0x104f('0x4')];function VoiceQueueSummary(_0x395321){this['id']=_0x395321['id'];this[_0x104f('0x11')]=_0x395321[_0x104f('0x11')];this[_0x104f('0x12')]=_0x395321['strategy'];this[_0x104f('0x13')]=_0x395321[_0x104f('0x13')]||0x0;this[_0x104f('0x14')]=_0x395321[_0x104f('0x14')]||0x0;this[_0x104f('0x0')]=_0x395321[_0x104f('0x0')]||0x0;this[_0x104f('0x15')]=_0x395321[_0x104f('0x15')]||0x0;this[_0x104f('0x16')]=_0x395321[_0x104f('0x16')]||0x0;this[_0x104f('0x17')]=_0x395321[_0x104f('0x17')]||0x0;this[_0x104f('0x1')]=_0x395321[_0x104f('0x1')]||0x0;this['loggedInDb']=_0x395321[_0x104f('0x2')]||0x0;this[_0x104f('0x18')]=_0x395321[_0x104f('0x18')]||0x0;this[_0x104f('0x19')]=_0x395321['notInUse']||0x0;this[_0x104f('0x1a')]=_0x395321[_0x104f('0x1a')]||0x0;this['ringing']=_0x395321[_0x104f('0x1b')]||0x0;this[_0x104f('0x1c')]=_0x395321['ringInUse'];this[_0x104f('0xe')]=_0x395321[_0x104f('0xe')];this[_0x104f('0xf')]=_0x395321[_0x104f('0xf')];this[_0x104f('0x1d')]=_0x395321[_0x104f('0x1d')]||0x0;this['talking']=_0x395321[_0x104f('0x3')]||0x0;this['total']=_0x395321['total']||0x0;this[_0x104f('0x1e')]=_0x395321[_0x104f('0x1e')];this[_0x104f('0x1f')]=_0x395321['unavailable']||0x0;this['unknown']=_0x395321[_0x104f('0x20')]||0x0;this['unmanaged']=_0x395321[_0x104f('0x21')]||0x0;this[_0x104f('0x4')]=_0x395321[_0x104f('0x4')]||0x0;if(_0x395321['type']===_0x104f('0x22')){this['pTalking']=_0x395321[_0x104f('0xd')]||0x0;this[_0x104f('0x23')]=_0x395321[_0x104f('0x23')];this['dialMethod']=_0x395321[_0x104f('0x24')];this[_0x104f('0x25')]=_0x395321[_0x104f('0x25')];this[_0x104f('0x26')]=_0x395321['dialOriginateCallerIdNumber'];this[_0x104f('0x27')]=_0x395321['dialOriginateTimeout'];this[_0x104f('0x28')]=_0x395321[_0x104f('0x28')];this['temp']=_0x395321[_0x104f('0x29')];this['outboundAnswerAgiCallsDay']=_0x395321[_0x104f('0x2a')];this[_0x104f('0x6')]=_0x395321[_0x104f('0x6')];this[_0x104f('0x7')]=_0x395321[_0x104f('0x7')];this[_0x104f('0x8')]=_0x395321[_0x104f('0x8')];this[_0x104f('0x2b')]=_0x395321[_0x104f('0x2b')];this[_0x104f('0x2c')]=_0x395321['outboundDropCallsDayACS'];this['outboundDropCallsDayCallersExit']=_0x395321[_0x104f('0x2d')];this[_0x104f('0x2e')]=_0x395321[_0x104f('0x2e')];this[_0x104f('0x9')]=_0x395321[_0x104f('0x9')];this[_0x104f('0xa')]=_0x395321['outboundNoSuchCallsDay'];this['outboundOriginateFailureCallsDay']=_0x395321[_0x104f('0x2f')];this[_0x104f('0xb')]=_0x395321[_0x104f('0xb')];this[_0x104f('0xc')]=_0x395321[_0x104f('0xc')];this[_0x104f('0x30')]=_0x395321['outboundUnknownCallsDay'];this['predictiveIntervalAnsweredCalls']=_0x395321['predictiveIntervalAnsweredCalls'];this[_0x104f('0x31')]=_0x395321[_0x104f('0x31')];this['predictiveIntervalAvgTalktime']=_0x395321[_0x104f('0x32')];this['predictiveIntervalDroppedCallsCallersExit']=_0x395321['predictiveIntervalDroppedCallsCallersExit'];this[_0x104f('0x33')]=_0x395321['predictiveIntervalDroppedCallsTimeout'];this['predictiveIntervalErlangCalls']=_0x395321['predictiveIntervalErlangCalls'];this[_0x104f('0x34')]=_0x395321['predictiveIntervalErlangCallsDroppedCalls'];this[_0x104f('0x35')]=_0x395321[_0x104f('0x35')];this['predictiveIntervalMultiplicativeFactor']=_0x395321['predictiveIntervalMultiplicativeFactor'];this[_0x104f('0x36')]=_0x395321['predictiveIntervalPauses'];this[_0x104f('0x37')]=_0x395321[_0x104f('0x37')];this['predictiveIntervalTotalCalls']=_0x395321[_0x104f('0x38')];this['originated']=_0x395321['originated'];this['erlangCalls']=_0x395321[_0x104f('0x39')];this[_0x104f('0x3a')]=_0x395321['erlangCallToSecond'];this['erlangAbandonmentRate']=_0x395321[_0x104f('0x3b')];this[_0x104f('0x3c')]=_0x395321[_0x104f('0x3c')];this[_0x104f('0x3d')]=_0x395321[_0x104f('0x3d')];this[_0x104f('0x3e')]=_0x395321['startProgressive'];this[_0x104f('0x3f')]=_0x395321['message'];this[_0x104f('0x40')]=_0x395321['statusMessage'];}if(_0x395321[_0x104f('0x41')]){this['Trunk']={'id':_0x395321['Trunk']['id'],'name':_0x395321[_0x104f('0x41')][_0x104f('0x11')],'active':_0x395321[_0x104f('0x41')][_0x104f('0x42')],'callerid':_0x395321['Trunk'][_0x104f('0x43')]};}}VoiceQueueSummary[_0x104f('0x44')][_0x104f('0x45')]=function(_0xcf740f,_0x2046ad,_0x18cdbd,_0x58fe76){this['loggedInDb']=0x0;this[_0x104f('0x3')]=0x0;this[_0x104f('0x1a')]=0x0;this[_0x104f('0x20')]=0x0;this[_0x104f('0x19')]=0x0;this[_0x104f('0x16')]=0x0;this[_0x104f('0x15')]=0x0;this['invalid']=0x0;this[_0x104f('0x1f')]=0x0;this['ringing']=0x0;this['ringInUse']=0x0;this['onHold']=0x0;if(_0x18cdbd){if(_0x18cdbd[_0x104f('0x0')]){this['available']=Number(_0x18cdbd[_0x104f('0x0')]);}if(_0x18cdbd[_0x104f('0x46')]){this[_0x104f('0x1')]=Number(_0x18cdbd[_0x104f('0x46')]);}if(_0x18cdbd[_0x104f('0x47')]){this[_0x104f('0x4')]=Number(_0x18cdbd[_0x104f('0x47')]);}}for(var _0x5d5ebf=0x0;_0x5d5ebf<_0xcf740f[_0x104f('0x48')];_0x5d5ebf++){var _0x39266b=_0x2046ad['SIP/'+_0xcf740f[_0x5d5ebf][_0x104f('0x11')]];if(_0x39266b&&_0x39266b[_0x104f('0x49')]){this[_0x104f('0x2')]+=0x1;}if(_0xcf740f[_0x5d5ebf]['incall']==='1'){this[_0x104f('0x3')]+=0x1;}if(_0xcf740f[_0x5d5ebf][_0x104f('0x1a')]==='1'&&!['2','7','8'][_0x104f('0x4a')](_0xcf740f[_0x5d5ebf][_0x104f('0x4b')])){this['paused']+=0x1;}switch(_0xcf740f[_0x5d5ebf][_0x104f('0x4b')]){case'0':this[_0x104f('0x20')]+=0x1;break;case'1':this[_0x104f('0x19')]+=0x1;break;case'2':this[_0x104f('0x16')]+=0x1;break;case'3':this[_0x104f('0x15')]+=0x1;break;case'4':this[_0x104f('0x17')]+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this[_0x104f('0x1b')]+=0x1;break;case'7':this[_0x104f('0x1c')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0x104f('0x24')]==='booked'){var _0x79ba52=Object['keys'](_0x58fe76);for(var _0x4e9458=0x0;_0x4e9458<_0x79ba52[_0x104f('0x48')];_0x4e9458++){var _0x5eb872=_0x79ba52[_0x4e9458];var _0x576e8f=_0x58fe76[_0x5eb872];if(_0x576e8f['queue']===this[_0x104f('0x11')]&&_0x576e8f[_0x104f('0x1e')]==='dialer'&&_0x576e8f[_0x104f('0x4c')]===_0x104f('0x4d')){this[_0x104f('0x3')]+=0x1;}}if(this[_0x104f('0x3')]>this['inUse']){this[_0x104f('0x3')]=this[_0x104f('0x16')];}this[_0x104f('0xd')]=0x0;}return this;};VoiceQueueSummary[_0x104f('0x44')]['compareToInboundQueue']=function(_0x4a88f3){var _0x24e0c9=![];if(_0x4a88f3){_0x24e0c9=INBOUND_COUNTERS[_0x104f('0x4e')](function(_0x51b0d5){return this[_0x51b0d5]!==_0x4a88f3[_0x51b0d5];},this);}return _0x24e0c9;};VoiceQueueSummary['prototype'][_0x104f('0x4f')]=function(_0x36eb30){var _0x510453=![];var _0x220818=![];var _0x2f2494=![];if(_0x36eb30){_0x510453=this[_0x104f('0x24')]!==_0x36eb30[_0x104f('0x24')]||this[_0x104f('0x23')]!==_0x36eb30[_0x104f('0x23')]||this['message']!==_0x36eb30['message']||this['statusMessage']!==_0x36eb30[_0x104f('0x40')];_0x220818=OUTBOUND_COUNTERS[_0x104f('0x4e')](function(_0x2de210){return this[_0x2de210]!==_0x36eb30[_0x2de210];},this);if(this['Trunk']&&_0x36eb30[_0x104f('0x41')]){_0x2f2494=this[_0x104f('0x41')][_0x104f('0x11')]!==_0x36eb30['Trunk'][_0x104f('0x11')]||this[_0x104f('0x41')][_0x104f('0x42')]!==_0x36eb30['Trunk']['active'];}}return _0x510453||_0x220818||_0x2f2494;};VoiceQueueSummary[_0x104f('0x44')][_0x104f('0x50')]=function(_0x49ac55){this['answered']=_0x49ac55[_0x104f('0x14')];this['message']=_0x49ac55[_0x104f('0x3f')];this[_0x104f('0x40')]=_0x49ac55[_0x104f('0x40')];this[_0x104f('0x51')]=_0x49ac55['originated'];this['outboundAbandonedCallsDay']=_0x49ac55[_0x104f('0x5')];this['outboundAnswerCallsDay']=_0x49ac55[_0x104f('0x6')];this[_0x104f('0x7')]=_0x49ac55[_0x104f('0x7')];this[_0x104f('0x8')]=_0x49ac55[_0x104f('0x8')];this[_0x104f('0x2b')]=_0x49ac55['outboundCongestionCallsDay'];this[_0x104f('0x9')]=_0x49ac55['outboundNoAnswerCallsDay'];this[_0x104f('0xa')]=_0x49ac55[_0x104f('0xa')];this[_0x104f('0xb')]=_0x49ac55[_0x104f('0xb')];this[_0x104f('0xc')]=_0x49ac55[_0x104f('0xc')];this['outboundUnknownCallsDay']=_0x49ac55[_0x104f('0x30')];this[_0x104f('0xe')]=_0x49ac55[_0x104f('0xe')];this['sumDuration']=_0x49ac55[_0x104f('0xf')];this[_0x104f('0x10')]=_0x49ac55[_0x104f('0x10')];if(this[_0x104f('0x24')]===_0x104f('0x52')){this[_0x104f('0xd')]=_0x49ac55['pTalking'];}};module[_0x104f('0x53')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 833392a..beb365a 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 _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 +var _0x26b6=['accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x4cf3a0,_0xc29e73){var _0x25adb7=function(_0x1a1052){while(--_0x1a1052){_0x4cf3a0['push'](_0x4cf3a0['shift']());}};_0x25adb7(++_0xc29e73);}(_0x26b6,0x7d));var _0x626b=function(_0x134065,_0x413494){_0x134065=_0x134065-0x0;var _0x46865c=_0x26b6[_0x134065];return _0x46865c;};'use strict';function VtigerAccount(_0x132ce1){this['id']=_0x132ce1['id']||0x0;this['name']=_0x132ce1['name']||'';this['username']=_0x132ce1['username']||'';this[_0x626b('0x0')]=_0x132ce1[_0x626b('0x0')]||'';this[_0x626b('0x1')]=_0x132ce1[_0x626b('0x1')]||'';this['serverUrl']=_0x132ce1[_0x626b('0x2')]||'';this[_0x626b('0x3')]=_0x132ce1[_0x626b('0x3')]||{};}module[_0x626b('0x4')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index c6a1de9..57fcaf8 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 _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 +var _0x2644=['type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x293056,_0x14807a){var _0xcefea6=function(_0x3f0808){while(--_0x3f0808){_0x293056['push'](_0x293056['shift']());}};_0xcefea6(++_0x14807a);}(_0x2644,0x186));var _0x4264=function(_0x20118a,_0x3dbdf3){_0x20118a=_0x20118a-0x0;var _0x538b5f=_0x2644[_0x20118a];return _0x538b5f;};'use strict';function ZendeskAccount(_0x33b153){this['id']=_0x33b153['id']||0x0;this[_0x4264('0x0')]=_0x33b153['name']||'';this[_0x4264('0x1')]=_0x33b153['username']||'';this[_0x4264('0x2')]=_0x33b153[_0x4264('0x2')]||'';this[_0x4264('0x3')]=_0x33b153[_0x4264('0x3')]||'';this[_0x4264('0x4')]=_0x33b153[_0x4264('0x4')]||'';this['authType']=_0x33b153[_0x4264('0x5')]||'';this['type']=_0x33b153[_0x4264('0x6')]||_0x4264('0x7');this[_0x4264('0x8')]=_0x33b153[_0x4264('0x8')]||'';this[_0x4264('0x9')]=_0x33b153['Configurations']||{};}module[_0x4264('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 1681468..ca850f5 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 _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 +var _0xc3b5=['code','refreshToken','Configurations','exports','name','description','host','zone','clientId','serverUrl'];(function(_0x59f202,_0x4ae020){var _0x4fc27b=function(_0x150477){while(--_0x150477){_0x59f202['push'](_0x59f202['shift']());}};_0x4fc27b(++_0x4ae020);}(_0xc3b5,0x1c6));var _0x5c3b=function(_0x161b7e,_0x222ef7){_0x161b7e=_0x161b7e-0x0;var _0x2e21f6=_0xc3b5[_0x161b7e];return _0x2e21f6;};'use strict';function ZohoAccount(_0x389c16){this['id']=_0x389c16['id']||0x0;this[_0x5c3b('0x0')]=_0x389c16['name']||'';this[_0x5c3b('0x1')]=_0x389c16[_0x5c3b('0x1')]||'';this[_0x5c3b('0x2')]=_0x389c16[_0x5c3b('0x2')]||'';this[_0x5c3b('0x3')]=_0x389c16[_0x5c3b('0x3')]||'';this[_0x5c3b('0x4')]=_0x389c16[_0x5c3b('0x4')]||'';this['clientSecret']=_0x389c16['clientSecret']||'';this['serverUrl']=_0x389c16[_0x5c3b('0x5')]||'';this[_0x5c3b('0x6')]=_0x389c16[_0x5c3b('0x6')]||'';this['refreshToken']=_0x389c16[_0x5c3b('0x7')]||'';this['Configurations']=_0x389c16[_0x5c3b('0x8')]||{};}module[_0x5c3b('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index a1e4195..43c9b0c 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 _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 +var _0x8f4c=['lodash','moment','isNil','string','idContact','queue','name','type','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','util'];(function(_0x5bb50e,_0x3f03e0){var _0x46950c=function(_0x1fe690){while(--_0x1fe690){_0x5bb50e['push'](_0x5bb50e['shift']());}};_0x46950c(++_0x3f03e0);}(_0x8f4c,0x113));var _0xc8f4=function(_0x1eebd1,_0x5960dd){_0x1eebd1=_0x1eebd1-0x0;var _0x3f49e9=_0x8f4c[_0x1eebd1];return _0x3f49e9;};'use strict';var util=require(_0xc8f4('0x0'));var _=require(_0xc8f4('0x1'));var moment=require(_0xc8f4('0x2'));function checkNameSurname(_0x43926b,_0x19893b,_0x134d73){var _0x580083='';if(!_[_0xc8f4('0x3')](_0x19893b)&&_0xc8f4('0x4')===typeof _0x19893b){_0x580083+=_0x19893b;}if(!_[_0xc8f4('0x3')](_0x134d73)&&'string'===typeof _0x134d73){_0x580083+='\x20'+_0x134d73;}if(_0x580083!==''){return _0x580083;}return _0x43926b;}function Action(_0x32cd80,_0x5208da,_0x4c86f8,_0x520063,_0x373506){this['uniqueid']=_0x4c86f8||undefined;this[_0xc8f4('0x5')]=_0x32cd80['id'];this[_0xc8f4('0x6')]=_0x5208da[_0xc8f4('0x7')];this[_0xc8f4('0x8')]=_0x5208da[_0xc8f4('0x8')];this['campaigntype']=_0xc8f4('0x6');this[_0xc8f4('0x9')]=![];this[_0xc8f4('0xa')]=_[_0xc8f4('0x3')](_0x32cd80['Agent'])?undefined:_0x32cd80[_0xc8f4('0xb')]['name'];this[_0xc8f4('0xc')]=this[_0xc8f4('0xa')]?util[_0xc8f4('0xd')](_0xc8f4('0xe'),this[_0xc8f4('0xa')]):_0x520063||undefined;this['calleridname']=checkNameSurname(_0x32cd80[_0xc8f4('0xf')][_0xc8f4('0x10')],_0x32cd80[_0xc8f4('0xf')][_0xc8f4('0x11')],_0x32cd80[_0xc8f4('0xf')][_0xc8f4('0x12')]);this['active']=_0x32cd80[_0xc8f4('0x13')]||![];this[_0xc8f4('0x14')]=_0x32cd80[_0xc8f4('0x10')];this[_0xc8f4('0x15')]=_0x32cd80[_0xc8f4('0x15')];this['countbusyretry']=_0x32cd80[_0xc8f4('0x16')]||0x0;this['countcongestionretry']=_0x32cd80['countcongestionretry']||0x0;this[_0xc8f4('0x17')]=_0x32cd80[_0xc8f4('0x17')]||0x0;this[_0xc8f4('0x18')]=(_0x32cd80[_0xc8f4('0x16')]||0x0)+(_0x32cd80[_0xc8f4('0x19')]||0x0)+(_0x32cd80[_0xc8f4('0x17')]||0x0)+(_0x32cd80[_0xc8f4('0x1a')]||0x0)+(_0x32cd80[_0xc8f4('0x1b')]||0x0)+(_0x32cd80[_0xc8f4('0x1c')]||0x0)+(_0x32cd80[_0xc8f4('0x1d')]||0x0)+(_0x32cd80[_0xc8f4('0x1e')]||0x0);this[_0xc8f4('0x1a')]=_0x32cd80[_0xc8f4('0x1a')]||0x0;this['countdropretry']=_0x32cd80[_0xc8f4('0x1b')]||0x0;this[_0xc8f4('0x1c')]=_0x32cd80[_0xc8f4('0x1c')]||0x0;this[_0xc8f4('0x1d')]=_0x32cd80[_0xc8f4('0x1d')]||0x0;this[_0xc8f4('0x1e')]=_0x32cd80[_0xc8f4('0x1e')]||0x0;this[_0xc8f4('0x1f')]=_0x32cd80['callback'];this[_0xc8f4('0x20')]=_0x32cd80[_0xc8f4('0x20')];this[_0xc8f4('0x21')]=_0x32cd80[_0xc8f4('0x21')];this['recallme']=_0x32cd80[_0xc8f4('0x22')];this['ContactId']=_0x32cd80[_0xc8f4('0x23')];this['ListId']=_0x32cd80[_0xc8f4('0x24')];this[_0xc8f4('0x25')]=_['isNil'](_0x32cd80[_0xc8f4('0xb')])?_0x32cd80[_0xc8f4('0x25')]:_0x32cd80[_0xc8f4('0xb')]['id'];this[_0xc8f4('0x26')]=_0x32cd80['VoiceQueueId'];this[_0xc8f4('0x27')]='';this[_0xc8f4('0x28')]='';}Action['prototype'][_0xc8f4('0x29')]=function(){return util[_0xc8f4('0xd')](_0xc8f4('0x2a'),this[_0xc8f4('0x2b')],this[_0xc8f4('0x2c')]);};module[_0xc8f4('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index e8bbe47..1bdd916 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 _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 +var _0x34e8=['localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangupRequest','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','name','emit','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','paused','INACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','message','CAMPAIGN_STATUS','DEACTIVATED','syncCampaigns','hasOwnProperty','dialMethod','booked','outbound','clearZombieChannels','type','dialActive','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','[clearZombieChannels][talking]','Queue','actions','queue','originated:\x20','stringify','dialAnswer','VoiceQueueId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','agentReadyId','isNil','length','getDiff','scheduledat','Agent','voicePause','run','then','logger2','[RecallMe]','disableContact','starttime','format','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','setMessage','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','isActive','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','[syncHangup][talking][increment]','uniqueid','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','linkedid','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','outboundNoAnswerCallsDay','countnoanswerretry','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','outboundCongestionCallsDay','countcongestionretry','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','outboundRejectCallsDay','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','called','Calling','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','isTrunkReachable','active','SIP/%s','reachable','unmonitored','unlock','unlockContact','pick','execRun','recallme','isValid','checkIsBlackList','logger','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','dialOriginateCallerIdName','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variables','[originated][increment]','OriginateError','syncNewExten','syncOriginateResponse','lookAgent','logLookAgent','responsetime','isFailure','custom:agentringnoanswer','rejected','syncHangup','[syncHangup][talking]','cause','statedesc','isUndefined','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destuniqueid','filterKey','keys','addVariable','variable','value','error','inspect','transfertargetlinkedid','transfer','transfererlinkedid','exports','util','lodash','uuid','moment','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','../dialer/utils','redis','defaults'];(function(_0x2da357,_0x1f9b2f){var _0x138fdd=function(_0xe3077d){while(--_0xe3077d){_0x2da357['push'](_0x2da357['shift']());}};_0x138fdd(++_0x1f9b2f);}(_0x34e8,0x12c));var _0x834e=function(_0x48b387,_0x55d1a9){_0x48b387=_0x48b387-0x0;var _0x3fb54b=_0x34e8[_0x48b387];return _0x3fb54b;};'use strict';var util=require(_0x834e('0x0'));var _=require(_0x834e('0x1'));var uuid=require(_0x834e('0x2'));var moment=require(_0x834e('0x3'));var Redis=require('ioredis');var config=require(_0x834e('0x4'));var logger=require(_0x834e('0x5'))(_0x834e('0x6'));var loggerAction=require(_0x834e('0x5'))(_0x834e('0x7'));var ami=require(_0x834e('0x8'));var rpcDb=require(_0x834e('0x9'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x834e('0xa'));var ut=require('./util/util');var utils=require(_0x834e('0xb'));config[_0x834e('0xc')]=_[_0x834e('0xd')](config[_0x834e('0xc')],{'host':_0x834e('0xe'),'port':0x18eb});var io=require(_0x834e('0xf'))(new Redis(config[_0x834e('0xc')]));var Sequence=function(){};Sequence[_0x834e('0x10')][_0x834e('0x11')]=function(_0x186b3b){this[_0x834e('0x12')]=this[_0x834e('0x12')]?this[_0x834e('0x12')][_0x834e('0x13')](_0x186b3b):_0x186b3b();};function Preview(_0x293514){this[_0x834e('0x14')]=new Sequence();this[_0x834e('0x15')]=_0x293514['voiceQueues'];this[_0x834e('0x16')]=_0x293514[_0x834e('0x16')];this['actions']={};this[_0x834e('0x17')]=_0x293514[_0x834e('0x17')];this[_0x834e('0x18')]=0x0;ami['on'](_0x834e('0x19'),this['syncOriginateResponse'][_0x834e('0x1a')](this));ami['on'](_0x834e('0x1b'),this['syncHangup'][_0x834e('0x1a')](this));ami['on']('hanguprequest',this[_0x834e('0x1c')][_0x834e('0x1a')](this));ami['on']('dialend',this[_0x834e('0x1d')][_0x834e('0x1a')](this));ami['on'](_0x834e('0x1e'),this['syncNewExten'][_0x834e('0x1a')](this));ami['on'](_0x834e('0x1f'),this[_0x834e('0x20')][_0x834e('0x1a')](this));ami['on'](_0x834e('0x21'),this[_0x834e('0x22')][_0x834e('0x1a')](this));ami['on']('blindtransfer',this[_0x834e('0x23')][_0x834e('0x1a')](this));this[_0x834e('0x24')](this[_0x834e('0x15')]);}function emit(_0x4ab05d,_0x45a630,_0x62f8f1){io['to'](_0x4ab05d)['emit'](_0x45a630,_0x62f8f1);}function emitVoiceQueueChannelRemove(_0x1b4bdf){logger[_0x834e('0x25')](_0x834e('0x26'),JSON['stringify'](_0x1b4bdf));emit(util['format'](_0x834e('0x27'),_0x1b4bdf[_0x834e('0x28')]),'voice_queue_channel:remove',_0x1b4bdf);io[_0x834e('0x29')](_0x834e('0x2a'),_0x1b4bdf);}function notSendMessagesQueue(_0x58f4fd){if(_0x58f4fd[_0x834e('0x2b')]){if(_0x58f4fd[_0x834e('0x2c')]===0x0&&_0x58f4fd[_0x834e('0x2d')]===0x0){_0x58f4fd['sendMessageOneNotActive']=![];_0x58f4fd[_0x834e('0x2e')]=0x0;_0x58f4fd[_0x834e('0x2f')]=0x0;_0x58f4fd['message']=utils['CAMPAIGN_STATUS'][_0x834e('0x30')];ut['logger'](_0x834e('0x31'),_0x58f4fd[_0x834e('0x28')]+_0x834e('0x32'));}else{_0x58f4fd[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x35')];ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x58f4fd['name']+'\x20is\x20deactivated');}}}Preview[_0x834e('0x10')][_0x834e('0x24')]=function(){var _0x106d6a=this;setInterval(function(){_0x106d6a['syncCampaigns']();},0x7cf);};Preview[_0x834e('0x10')][_0x834e('0x36')]=function(){var _0x1f3671=this[_0x834e('0x15')];this[_0x834e('0x18')]+=0x1;for(var _0x390119 in _0x1f3671){if(_0x1f3671[_0x834e('0x37')](_0x390119)&&(_0x1f3671[_0x390119][_0x834e('0x38')]===_0x834e('0x6')||_0x1f3671[_0x390119]['dialMethod']===_0x834e('0x39'))&&_0x1f3671[_0x390119]['type']===_0x834e('0x3a')){if(this[_0x834e('0x18')]>0x7){this[_0x834e('0x18')]=0x0;this[_0x834e('0x3b')]();}}if(_0x1f3671[_0x834e('0x37')](_0x390119)&&_0x1f3671[_0x390119][_0x834e('0x38')]===_0x834e('0x6')&&_0x1f3671[_0x390119][_0x834e('0x3c')]===_0x834e('0x3a')){if(_0x1f3671[_0x390119][_0x834e('0x3d')]){this['setMessage'](_0x1f3671[_0x390119]);if(_0x1f3671[_0x390119][_0x834e('0x3e')])this[_0x834e('0x3f')](_0x1f3671[_0x390119]);}else{notSendMessagesQueue(_0x1f3671[_0x390119]);}}}};Preview[_0x834e('0x10')][_0x834e('0x40')]=function(_0x595cc0){var _0x3f88ad=this;this[_0x834e('0x14')]['enqueue'](function(){if(!_['isNil'](_0x3f88ad['actions'][_0x595cc0])){loggerAction[_0x834e('0x25')](_0x834e('0x41'),_0x595cc0,_0x834e('0x42'),_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x44')],_0x834e('0x45'),JSON['stringify'](_0x3f88ad[_0x834e('0x15')][_0x3f88ad['actions'][_0x595cc0][_0x834e('0x44')]][_0x834e('0x2c')]),'pTalking:\x20',JSON[_0x834e('0x46')](_0x3f88ad[_0x834e('0x15')][_0x3f88ad['actions'][_0x595cc0]['queue']][_0x834e('0x2d')]),JSON[_0x834e('0x46')](_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x47')]),JSON[_0x834e('0x46')](_['pick'](_0x3f88ad[_0x834e('0x43')][_0x595cc0],['contactId','UserId',_0x834e('0x48'),'ListId'])));return ami[_0x834e('0x49')]({'action':_0x834e('0x4a'),'channel':_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x4b')]})[_0x834e('0x4c')](function(_0x574ea8){if(_0x574ea8[_0x834e('0x33')]===_0x834e('0x4d')){setTimeout(function(){if(_0x3f88ad[_0x834e('0x43')][_0x595cc0]){ut['updateOriginated'](_0x3f88ad[_0x834e('0x15')][_0x3f88ad[_0x834e('0x43')][_0x595cc0]['queue']],_0x834e('0x4e'));if(_0x3f88ad['actions'][_0x595cc0][_0x834e('0x47')]===!![]){ut[_0x834e('0x4f')](_0x3f88ad['campaignsPreview'][_0x3f88ad['actions'][_0x595cc0][_0x834e('0x44')]],_0x834e('0x4e'));ut[_0x834e('0x50')](_0x834e('0x51')+_0x595cc0,_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x44')]);}ut[_0x834e('0x50')]('[Dialer][checkChannel][Preview]'+_0x595cc0,_0x3f88ad[_0x834e('0x43')][_0x595cc0]['queue']);delete _0x3f88ad[_0x834e('0x43')][_0x595cc0];}},0x2328);}});}});};Preview['prototype'][_0x834e('0x3b')]=function(){var _0x5a5807=this;loggerAction[_0x834e('0x25')](_0x834e('0x52'),_['size'](this[_0x834e('0x43')]));for(var _0x3f2321 in this[_0x834e('0x43')]){if(_0x5a5807[_0x834e('0x43')][_0x834e('0x37')](_0x3f2321)){_0x5a5807[_0x834e('0x40')](_0x3f2321);}}};Preview[_0x834e('0x10')][_0x834e('0x3f')]=function(_0x5dc63b){var _0x279ea1=this;rpcDb['getContactRecallMe'](_0x5dc63b['id'],ut[_0x834e('0x53')](this[_0x834e('0x17')]))['then'](function(_0x112306){if(!_[_0x834e('0x54')](_0x112306)){for(var _0x25b035=0x0;_0x25b035<_0x112306[_0x834e('0x55')];_0x25b035+=0x1){if(ut[_0x834e('0x56')](_0x112306[_0x25b035][_0x834e('0x57')])<_0x5dc63b['dialRecallMeTimeout']*0x3c){if(_0x112306[_0x25b035]['Agent']&&!_0x112306[_0x25b035][_0x834e('0x58')][_0x834e('0x59')]){_0x279ea1[_0x834e('0x5a')](_0x112306[_0x25b035]['id'])[_0x834e('0x5b')](ut[_0x834e('0x5c')](_0x834e('0x5d')))[_0x834e('0x4c')](ut[_0x834e('0x5c')](_0x834e('0x5d')));}else{rpcDb[_0x834e('0x5e')](_0x112306[_0x25b035]['id']);}}else{var _0xf02f0d=new Action(_0x112306[_0x25b035],_0x5dc63b);_0xf02f0d[_0x834e('0x5f')]=moment()[_0x834e('0x60')](_0x834e('0x61'));_0x5dc63b[_0x834e('0x62')]+=0x1;ut[_0x834e('0x63')](_0xf02f0d,0x17,_0x834e('0x64'));if(_0x5dc63b[_0x834e('0x65')]){rpcDb[_0x834e('0x66')](ut[_0x834e('0x67')](_0x112306[_0x25b035]));rpcDb['createCustomerHistory'](_0xf02f0d,_0x834e('0x68'));}else{ut[_0x834e('0x63')](_0xf02f0d,0x16,'RecallFailedTimeout');rpcDb[_0x834e('0x69')](_0xf02f0d,_0x834e('0x6a'));rpcDb['createCustomerFinal'](_0xf02f0d,_0x834e('0x6a'));}}}}})[_0x834e('0x4c')](ut[_0x834e('0x5c')](_0x834e('0x6b')));};Preview[_0x834e('0x10')][_0x834e('0x6c')]=function(_0x4549ba){_0x4549ba['sendMessageOneNotActive']=!![];if(ut[_0x834e('0x6d')](_0x4549ba[_0x834e('0x6e')])){_0x4549ba[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x6f')];}else if(!ut[_0x834e('0x70')](_0x4549ba[_0x834e('0x3d')])){_0x4549ba[_0x834e('0x33')]=utils['CAMPAIGN_STATUS'][_0x834e('0x30')];}else if(!this['isTrunkReachable'](_0x4549ba[_0x834e('0x71')])){if(!this['isTrunkReachable'](_0x4549ba[_0x834e('0x72')])){_0x4549ba['message']=utils['CAMPAIGN_STATUS'][_0x834e('0x73')];}else{_0x4549ba[_0x834e('0x33')]=utils['CAMPAIGN_STATUS']['ACTIVE'];}}else{_0x4549ba[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x74')];}};Preview[_0x834e('0x10')][_0x834e('0x75')]=function(_0x315858,_0x3d3f2b,_0x4273f1){var _0x528e66=this;var _0x142334=this[_0x834e('0x43')][_0x3d3f2b];var _0x5d5ac2=this[_0x834e('0x15')][_0x142334['queue']];var _0x3e58ef;var _0x45eceb=![];var _0x5160c4=0x2;var _0x41ef86=0x3;if(_0x5d5ac2){switch(_0x4273f1){case'1':_0x5d5ac2[_0x834e('0x76')]+=0x1;_0x142334[_0x834e('0x77')]+=0x1;_0x142334[_0x834e('0x78')]=ut['totalGlobal'](_0x142334);ut[_0x834e('0x63')](_0x142334,0x0,_0x834e('0x79'));ami[_0x834e('0x29')]('custom:agentnosuchnumber',ut[_0x834e('0x7a')](_0x142334,_0x834e('0x7b')));rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0x7c'));_0x528e66[_0x834e('0x7d')](_0x142334,'0',_0x5d5ac2)[_0x834e('0x5b')](function(_0x3a1426){_0x45eceb=_0x3a1426[_0x834e('0x7e')]==0x1;_0x5160c4=_0x5d5ac2[_0x834e('0x7f')];_0x41ef86=_0x5d5ac2[_0x834e('0x80')];if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0x86'));}else{if(_0x142334[_0x834e('0x77')]>=_0x5d5ac2[_0x834e('0x87')]){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0x86'));}else{rpcDb[_0x834e('0x88')](ut[_0x834e('0x89')](_0x142334,'countnosuchnumberretry',_0x5d5ac2[_0x834e('0x7f')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}delete this[_0x834e('0x43')][_0x315858['linkedid']];}else{_0x142334[_0x834e('0x77')]++;logger['info']('actioncountonusuch',_0x142334[_0x834e('0x77')]);logger[_0x834e('0x25')]('id',_0x142334[_0x834e('0x8c')]);_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnosuchnumberretry':_0x142334[_0x834e('0x77')]}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});});}});break;case _0x834e('0x8f'):var _0x5a99e6=moment()[_0x834e('0x60')](_0x834e('0x61'));_0x142334['responsetime']=_0x5a99e6;_0x142334['answertime']=_0x5a99e6;_0x142334[_0x834e('0x47')]=!![];_0x5d5ac2[_0x834e('0x2d')]+=0x1;logger[_0x834e('0x25')](_0x834e('0x90'),_0x142334[_0x834e('0x91')],'\x20Queue',_0x5d5ac2[_0x834e('0x28')],_0x834e('0x92'),_0x5d5ac2[_0x834e('0x2d')]);ami[_0x834e('0x29')](_0x834e('0x93'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0x94'),this[_0x834e('0x15')][_0x142334[_0x834e('0x44')]]));if(_0x5d5ac2[_0x834e('0x95')]){ami['emit'](_0x834e('0x96'),ut[_0x834e('0x97')](_0x142334));}break;case'16':ami[_0x834e('0x29')](_0x834e('0x98'),ut['buildObj'](_0x142334,_0x834e('0x99'),this['campaignsPreview'][_0x142334['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x142334,_0x834e('0x99')));_0x5d5ac2[_0x834e('0x9a')]+=0x1;_0x5d5ac2['total']+=0x1;_0x5d5ac2[_0x834e('0x9b')]+=0x1;ut[_0x834e('0x4f')](_0x5d5ac2,'[16]');_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut['logCustomer'](_0x142334,0x4,'Answer');rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0x9c'));rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0x9d'));rpcDb[_0x834e('0x9e')](_0x142334);_0x5d5ac2['sumDuration']+=_0x142334[_0x834e('0x9f')];_0x5d5ac2['sumBillable']+=_0x142334[_0x834e('0x9f')];logger[_0x834e('0x25')](_0x834e('0xa0'),_0x142334['uniqueid'],_0x834e('0xa1'),_0x5d5ac2[_0x834e('0x28')],'pTalking:\x20',_0x5d5ac2[_0x834e('0x2d')]);delete this[_0x834e('0x43')][_0x315858[_0x834e('0xa2')]];break;case'BUSY':_0x5d5ac2[_0x834e('0xa3')]+=0x1;_0x142334[_0x834e('0xa4')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x5,_0x834e('0xa5'));_0x5160c4=_0x5d5ac2[_0x834e('0xa6')];_0x41ef86=_0x5d5ac2[_0x834e('0x80')];ami[_0x834e('0x29')](_0x834e('0xa7'),ut['buildObj'](_0x142334,'busy'));rpcDb['createCustomerHistory'](_0x142334,_0x834e('0xa8'));_0x528e66[_0x834e('0x7d')](_0x142334,'5',_0x5d5ac2)[_0x834e('0x5b')](function(_0x37fa2c){_0x45eceb=_0x37fa2c[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2['dialGlobalMaxRetry']){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xa9'));}else{if(_0x142334[_0x834e('0xa4')]>=_0x5d5ac2['dialBusyMaxRetry']){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xa8'));}else{rpcDb[_0x834e('0x88')](ut['scheduledAt'](_0x142334,_0x834e('0xa4'),_0x5d5ac2[_0x834e('0xa6')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xa4')]++;_0x528e66['incrementPreviewCounters']({'id':_0x142334['idContact'],'field':{'countbusyretry':_0x142334[_0x834e('0xa4')]}})[_0x834e('0x5b')](function(){_0x528e66['swapAdditionalPhones'](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});break;case'NOANSWER':_0x5d5ac2[_0x834e('0xaa')]+=0x1;_0x142334[_0x834e('0xab')]+=0x1;_0x142334[_0x834e('0x78')]=ut['totalGlobal'](_0x142334);ut[_0x834e('0x63')](_0x142334,0x3,'NoAnswer');_0x5160c4=_0x5d5ac2['dialNoAnswerRetryFrequency'];_0x41ef86=_0x5d5ac2['callAdditionalPhoneAfterMin'];var _0x6735e6=ut[_0x834e('0xac')](_0x142334,_0x5d5ac2);ami[_0x834e('0x29')](_0x834e('0xad'),_0x6735e6);rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0xae'));_0x528e66[_0x834e('0x7d')](_0x142334,'3',_0x5d5ac2)[_0x834e('0x5b')](function(_0x17e61a){_0x45eceb=_0x17e61a['additional']==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2['dialGlobalMaxRetry']){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xaf'));}else{if(_0x142334[_0x834e('0xab')]>=_0x5d5ac2[_0x834e('0xb0')]){rpcDb['createCustomerFinal'](_0x142334,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x834e('0x88')](ut[_0x834e('0x89')](_0x142334,'countnoanswerretry',_0x5d5ac2[_0x834e('0xb1')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334['idContact'],'field':{'countnoanswerretry':_0x142334[_0x834e('0xab')]}})[_0x834e('0x5b')](function(){_0x528e66['swapAdditionalPhones'](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});});}});break;case'CONGESTION':_0x5d5ac2[_0x834e('0xb2')]+=0x1;_0x142334[_0x834e('0xb3')]+=0x1;_0x142334['countglobal']=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x8,'Congestion');_0x5160c4=_0x5d5ac2[_0x834e('0xb4')];_0x41ef86=_0x5d5ac2['callAdditionalPhoneAfterMin'];ami['emit'](_0x834e('0xb5'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xb6')));rpcDb[_0x834e('0x69')](_0x142334,'[callProgressDetectingCustomer][logCongestion]');_0x528e66[_0x834e('0x7d')](_0x142334,'8',_0x5d5ac2)[_0x834e('0x5b')](function(_0x260934){_0x45eceb=_0x260934[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xb7'));}else{if(_0x142334[_0x834e('0xb3')]>=_0x5d5ac2[_0x834e('0xb8')]){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xb9'));}else{rpcDb[_0x834e('0x88')](ut[_0x834e('0x89')](_0x142334,_0x834e('0xb3'),_0x5d5ac2[_0x834e('0xa6')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xb3')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334['idContact'],'field':{'countcongestionretry':_0x142334[_0x834e('0xb3')]}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});break;case _0x834e('0xba'):_0x5d5ac2[_0x834e('0xbb')]+=0x1;_0x142334[_0x834e('0xbc')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut['logCustomer'](_0x142334,0x14,'AgentReject');_0x5160c4=_0x5d5ac2['dialAgentRejectRetryFrequency'];_0x41ef86=_0x5d5ac2[_0x834e('0x80')];ami['emit'](_0x834e('0xbd'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xbe')));rpcDb['createCustomerHistory'](_0x142334,_0x834e('0xbf'));_0x528e66[_0x834e('0x7d')](_0x142334,'20',_0x5d5ac2)[_0x834e('0x5b')](function(_0x1594ef){_0x45eceb=_0x1594ef[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2['dialGlobalMaxRetry']){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0x14,_0x834e('0xc0'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xc1'));}else{if(_0x142334[_0x834e('0xbc')]>=_0x5d5ac2['dialAgentRejectMaxRetry']){rpcDb['createCustomerFinal'](_0x142334,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut[_0x834e('0x89')](_0x142334,_0x834e('0xbc'),_0x5d5ac2['dialAgentRejectRetryFrequency']),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334['countnoanswerretry']++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnoanswerretry':_0x142334[_0x834e('0xab')]}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});break;case'ABANDONED':_0x5d5ac2['outboundAbandonedCallsDay']+=0x1;_0x142334[_0x834e('0xc2')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut['logCustomer'](_0x142334,0xb,_0x834e('0xc3'));rpcDb[_0x834e('0x69')](_0x142334,'[callProgressDetectingCustomer][logAbandoned]');_0x528e66[_0x834e('0x7d')](_0x142334,'11',_0x5d5ac2)[_0x834e('0x5b')](function(_0x216d1f){_0x45eceb=_0x216d1f[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut['cloneAction'](_0x142334,0xf,'Global');rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xc4'));}else{if(_0x142334[_0x834e('0xc5')]>=_0x5d5ac2[_0x834e('0xc6')]){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xc4'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x142334,_0x834e('0xc2'),_0x5d5ac2[_0x834e('0xc7')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnoanswerretry':_0x142334['countnoanswerretry']}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});});}});break;case'18':_0x5d5ac2[_0x834e('0xc8')]+=0x1;_0x142334[_0x834e('0xc9')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x12,_0x315858[_0x834e('0xca')]||_0x315858[_0x834e('0xcb')]);ami[_0x834e('0x29')](_0x834e('0xcc'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xcd')));rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0xce'));_0x528e66[_0x834e('0x7d')](_0x142334,'18',_0x5d5ac2)['then'](function(_0x5f1e3b){_0x45eceb=_0x5f1e3b[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut['cloneAction'](_0x142334,0x12,_0x834e('0x84'));rpcDb['createCustomerFinal'](_0x3e58ef,_0x834e('0xce'));}else{rpcDb['createCustomerFinal'](_0x142334,_0x834e('0xce'));}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnoanswerretry':_0x142334['countnoanswerretry']}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});delete this[_0x834e('0x43')][_0x315858[_0x834e('0xa2')]];break;case'19':_0x5d5ac2[_0x834e('0xc8')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x13,_0x315858[_0x834e('0xca')]||_0x315858[_0x834e('0xcb')]);ami[_0x834e('0x29')](_0x834e('0xcc'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xcd')));rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0xcf'));_0x528e66['verifyAdditionalPhones'](_0x142334,'18',_0x5d5ac2)['then'](function(_0x2df814){_0x45eceb=_0x2df814[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xcf'));}else{rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xcf'));}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334['idContact'],'field':{'countnoanswerretry':_0x142334[_0x834e('0xab')]}})['then'](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});delete this[_0x834e('0x43')][_0x315858['linkedid']];break;default:if(_0x142334[_0x834e('0x47')]){ut[_0x834e('0x4f')](_0x5d5ac2,'[default]');ut['loggerError'](_0x834e('0xd0')+_0x5d5ac2[_0x834e('0x28')],_0x315858);}_0x5d5ac2['outboundUnknownCallsDay']+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0xc,_0x315858[_0x834e('0xca')]||_0x315858[_0x834e('0xcb')]);_0x5160c4=_0x5d5ac2['dialAgentRejectRetryFrequency'];_0x41ef86=_0x5d5ac2['callAdditionalPhoneAfterMin'];rpcDb[_0x834e('0x69')](_0x142334,'[callProgressDetectingCustomer][logUnknown]');_0x528e66['verifyAdditionalPhones'](_0x142334,'20',_0x5d5ac2)['then'](function(_0xac9d00){_0x45eceb=_0xac9d00[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xd1'));}delete this[_0x834e('0x43')][_0x315858['linkedid']];}else{_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});}});}if(!(_0x142334[_0x834e('0x47')]&&_0x4273f1==='16')){ut['updateOriginated'](_0x5d5ac2,_0x834e('0xd2'));logger[_0x834e('0x25')]('[originated][decrement][callProgressDetectingCustomer]',_0x142334[_0x834e('0x91')],_0x834e('0xa1'),_0x5d5ac2[_0x834e('0x28')],_0x834e('0x45'),_0x5d5ac2[_0x834e('0x2c')]);}if(_0x4273f1!==_0x834e('0x8f')){delete this['actions'][_0x315858[_0x834e('0xa2')]];delete this[_0x834e('0x43')][_0x315858[_0x834e('0xd3')]];}_0x5d5ac2[_0x834e('0xd4')]=!![];}};Preview[_0x834e('0x10')][_0x834e('0xd5')]=function(_0x5d3c6d,_0x448420,_0x490a57){if(_['isUndefined'](_0x448420)&&_0x834e('0xd6')!==typeof _0x448420){return;}if(_['isUndefined'](_0x490a57)&&'object'!==typeof _0x490a57){return;}switch(_0x490a57[_0x834e('0xd7')]){case'0':ut[_0x834e('0xd8')](_0x5d3c6d,0x0,_0x834e('0x79'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xda'));break;case'3':ut[_0x834e('0xd8')](_0x5d3c6d,0x3,_0x834e('0xdb'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xdc'));break;case'5':ut[_0x834e('0xd8')](_0x5d3c6d,0x5,_0x834e('0xa5'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xdd'));break;case'8':ut[_0x834e('0xd8')](_0x5d3c6d,0x8,'Congestion');rpcDb[_0x834e('0xd9')](_0x5d3c6d,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x834e('0xd8')](_0x5d3c6d,0x16,_0x834e('0xde'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xdf'));break;default:ut['logAgent'](_0x5d3c6d,0xc,_0x490a57['reason']);rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xe0'));}ut['updateOriginated'](_0x448420,_0x834e('0xe1'));logger[_0x834e('0x25')]('[originated][decrement][callProgressDetectingAgent]',_0x5d3c6d[_0x834e('0x91')],_0x834e('0xa1'),_0x448420[_0x834e('0x28')],_0x834e('0x45'),_0x448420['originated']);delete this['actions'][_0x5d3c6d['uniqueid']];};Preview['prototype'][_0x834e('0x7d')]=function(_0x3c4847,_0x47891e,_0x41ba0c){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x3c4847,_0x47891e,_0x41ba0c)[_0x834e('0x4c')](logger[_0x834e('0x25')](_0x834e('0xe2')));};Preview[_0x834e('0x10')][_0x834e('0x8e')]=function(_0xfa6cdb,_0x3c775f,_0x4fc61d){return cmHopperAdditionalPhone[_0x834e('0x8e')](_0xfa6cdb,_0x3c775f,_0x4fc61d)[_0x834e('0x4c')](logger['info'](_0x834e('0xe3')));};Preview[_0x834e('0x10')]['incrementPreviewCounters']=function(_0x486c18){return Promise['resolve']()[_0x834e('0x5b')](cmHopperAdditionalPhone[_0x834e('0x8d')](_0x486c18))[_0x834e('0x4c')](logger['info'](_0x834e('0xe4')));};Preview[_0x834e('0x10')][_0x834e('0xe5')]=function(_0x17e729,_0x4b4f7c,_0xad7b72,_0x19cb0b,_0x13af70){var _0x8804a8=this;return new Promise(function(_0x102640,_0x48b6c4){if(_['isNil'](_0x4b4f7c)||_[_0x834e('0x54')](_0x4b4f7c[_0x834e('0xe6')])||_[_0x834e('0x54')](_0x4b4f7c[_0x834e('0xe7')])||_[_0x834e('0x54')](_0x4b4f7c[_0x834e('0x48')])){_0x48b6c4(ut[_0x834e('0x33')](_0x834e('0xe8'),_0x19cb0b,_0x13af70));return;}var _0x38151c=uuid['v4']();var _0x97a4b2=_0x8804a8[_0x834e('0x15')][_0x4b4f7c[_0x834e('0x42')][_0x834e('0x28')]];var _0x4b12cd=_0xad7b72?_0x8804a8[_0x834e('0x17')][_0xad7b72]['id']:undefined;_0x8804a8[_0x834e('0x43')][_0x38151c]=new Action(_0x4b4f7c,_0x97a4b2,_0x38151c,_0xad7b72,_0x4b12cd);var _0x3f5b2e=_0x8804a8[_0x834e('0x43')][_0x38151c];_0x3f5b2e['unlockAgent']=_0x19cb0b;_0x3f5b2e['activeContact']=_0x13af70;_0x3f5b2e['lookAgent']=_0xad7b72;if(_[_0x834e('0xe9')](_0x17e729)){_0x8804a8[_0x834e('0xea')](_0x3f5b2e,_0x97a4b2,_0x4b4f7c,_0xad7b72)[_0x834e('0x5b')](function(_0x23d7e6){logger[_0x834e('0x25')](_0x834e('0xeb'),_0x834e('0xec')+_0x3f5b2e[_0x834e('0x44')]+'\x20IdHopper:\x20'+_0x3f5b2e['idContact'],JSON['stringify'](_0x23d7e6));ami['emit'](_0x834e('0xed'),ut[_0x834e('0x7a')](_0x3f5b2e,_0x834e('0xee'),_0x8804a8[_0x834e('0x15')][_0x3f5b2e[_0x834e('0x44')]]));_0x102640(ut[_0x834e('0x33')](_0x834e('0xef')));})[_0x834e('0x4c')](function(_0x33757d){ut['logger']('[Preview][execCall][failure]',_0x33757d);_0x48b6c4(ut['message']('Call\x20failed',_0x19cb0b,_0x13af70));});}else{_0x97a4b2[_0x834e('0xf0')]+=0x1;ut[_0x834e('0xf1')](_0x3f5b2e);rpcDb[_0x834e('0xf2')](_0x3f5b2e,_0x834e('0xf3'));delete _0x8804a8[_0x834e('0x43')][_0x38151c];_0x48b6c4(ut[_0x834e('0x33')](_0x834e('0xf4'),_0x19cb0b,_0x13af70));}});};Preview[_0x834e('0x10')][_0x834e('0xf5')]=function(_0xcd64c2){return!_[_0x834e('0x54')](_0xcd64c2)&&!_[_0x834e('0x54')](_0xcd64c2[_0x834e('0x28')])&&!_[_0x834e('0x54')](_0xcd64c2[_0x834e('0xf6')])&&_0xcd64c2[_0x834e('0xf6')]&&!_['isNil'](this[_0x834e('0x16')][util['format'](_0x834e('0xf7'),_0xcd64c2[_0x834e('0x28')])])&&!_[_0x834e('0x54')](this['trunks'][util[_0x834e('0x60')](_0x834e('0xf7'),_0xcd64c2['name'])]['status'])&&(this[_0x834e('0x16')][util[_0x834e('0x60')](_0x834e('0xf7'),_0xcd64c2[_0x834e('0x28')])][_0x834e('0x4a')]===_0x834e('0xf8')||this[_0x834e('0x16')][util[_0x834e('0x60')]('SIP/%s',_0xcd64c2[_0x834e('0x28')])][_0x834e('0x4a')]===_0x834e('0xf9'));};Preview[_0x834e('0x10')][_0x834e('0x5a')]=function(_0x614e15,_0x17aaae){return this['execRun'](_0x614e15,_0x17aaae)[_0x834e('0x5b')](function(_0x59e298){return _['pick'](_0x59e298,[_0x834e('0x33')]);})[_0x834e('0x4c')](function(_0x4b16fa){if(_0x4b16fa[_0x834e('0xfa')]){rpcDb[_0x834e('0xfb')](_0x614e15);}if(_0x4b16fa['active']){rpcDb[_0x834e('0x5e')](_0x614e15);}throw _[_0x834e('0xfc')](_0x4b16fa,['message']);});};Preview['prototype'][_0x834e('0xfd')]=function(_0x2ec9f1,_0x4e6525){var _0x58a935=this;var _0x269ff6,_0xa496aa;return rpcDb['getContactPreview'](_0x2ec9f1)['then'](function(_0x495352){if(!_['isNil'](_0x495352[0x0])){_0xa496aa=_0x495352[0x0][_0x834e('0xfe')]?![]:!![];_0x269ff6=_0x495352[0x0]['recallme']?!![]:![];_0x269ff6=_0x4e6525?!![]:_0x269ff6;}var _0x3be4c3=_0x58a935['validateContact'](_0x495352);if(_0x3be4c3[_0x834e('0xff')]){rpcDb[_0x834e('0x100')](_[_0x834e('0xfc')](_0x495352[0x0],[_0x834e('0x48'),'phone']))[_0x834e('0x5b')](function(_0x446d89){_0x58a935[_0x834e('0xe5')](_0x446d89,_0x495352[0x0],_0x4e6525,_0xa496aa,_0x269ff6)[_0x834e('0x5b')](function(_0x3a3a6c){return _0x3a3a6c;})[_0x834e('0x4c')](function(_0x3d8abb){throw _0x3d8abb;});})[_0x834e('0x4c')](function(_0x464ae6){ut[_0x834e('0x101')]('[Preview][checkIsBlackList]',_0x464ae6);throw ut[_0x834e('0x33')]('Call\x20unsuccessful',_0xa496aa,_0x269ff6);});}else{throw ut[_0x834e('0x33')](_0x3be4c3[_0x834e('0x33')],_0xa496aa,_0x269ff6);}})[_0x834e('0x4c')](function(_0x31a7ae){ut[_0x834e('0x101')]('[Preview][getContactPreview]',_0x31a7ae);throw ut[_0x834e('0x33')]('Call\x20unsuccessful',![],!![]);});};Preview['prototype'][_0x834e('0x102')]=function(_0x30ecb9){if(_[_0x834e('0x54')](_0x30ecb9)||_['isEmpty'](_0x30ecb9)||!_[_0x834e('0x54')](_0x30ecb9[0x0][_0x834e('0x58')])&&_[_0x834e('0x54')](_0x30ecb9[0x0][_0x834e('0x58')][_0x834e('0x28')])){ut[_0x834e('0x101')](_0x834e('0x103'),_0x30ecb9);return{'isValid':![],'message':_0x834e('0x104')};}var _0x125787=this[_0x834e('0x15')][_0x30ecb9[0x0][_0x834e('0x42')]['name']];_0x125787[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x74')];if(_[_0x834e('0x54')](_0x125787)){ut[_0x834e('0x101')](_0x834e('0x105'),_0x125787);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x834e('0xf5')](_0x125787[_0x834e('0x71')])){ut[_0x834e('0x101')](_0x834e('0x106'),_0x834e('0x107')+_0x125787[_0x834e('0x28')]+_0x834e('0x108'));if(!this[_0x834e('0xf5')](_0x125787[_0x834e('0x72')])){ut[_0x834e('0x101')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x125787['name']+_0x834e('0x109'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x834e('0x70')](_0x125787[_0x834e('0x3d')])){ut[_0x834e('0x101')](_0x834e('0x10a'),_0x125787[_0x834e('0x28')]+_0x834e('0x10b'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x125787[_0x834e('0x28')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0x834e('0xea')]=function(_0x3b9429,_0x52cdd5,_0x5cb379,_0x494e08){var _0x2515f6=this;return new Promise(function(_0x45c8e6,_0x3512d8){var _0x5e0bfe=_0x3b9429[_0x834e('0x91')];var _0x21cb1d=_0x2515f6[_0x834e('0xf5')](_0x52cdd5[_0x834e('0x71')])?util[_0x834e('0x60')](_0x834e('0x10c'),_0x52cdd5['Trunk']['name'],_['isNil'](_0x52cdd5['dialPrefix'])?'':_0x52cdd5[_0x834e('0x10d')][_0x834e('0x10e')]()||'',_0x52cdd5[_0x834e('0x10f')]>0x0?_0x5cb379[_0x834e('0xe7')][_0x834e('0x110')](_0x52cdd5[_0x834e('0x10f')]):_0x5cb379[_0x834e('0xe7')]):util[_0x834e('0x60')](_0x834e('0x10c'),_[_0x834e('0x54')](_0x52cdd5[_0x834e('0x72')])?_0x52cdd5[_0x834e('0x71')][_0x834e('0x28')]:_0x52cdd5[_0x834e('0x72')][_0x834e('0x28')],_['isNil'](_0x52cdd5['dialPrefix'])?'':_0x52cdd5[_0x834e('0x10d')][_0x834e('0x10e')]()||'',_0x52cdd5[_0x834e('0x10f')]>0x0?_0x5cb379['phone'][_0x834e('0x110')](_0x52cdd5[_0x834e('0x10f')]):_0x5cb379[_0x834e('0xe7')]);var _0x431f18=_0x2515f6[_0x834e('0xf5')](_0x52cdd5[_0x834e('0x71')])?ut[_0x834e('0x111')](_0x52cdd5[_0x834e('0x71')][_0x834e('0x112')],_0x52cdd5['dialOriginateCallerIdName'],_0x52cdd5[_0x834e('0x113')]>0x0?ut[_0x834e('0x114')](_0x52cdd5[_0x834e('0x115')],_0x52cdd5[_0x834e('0x113')]):_0x52cdd5['dialOriginateCallerIdNumber']):ut[_0x834e('0x111')](_[_0x834e('0x54')](_0x52cdd5[_0x834e('0x72')])?_0x52cdd5[_0x834e('0x71')][_0x834e('0x112')]:_0x52cdd5[_0x834e('0x72')][_0x834e('0x112')],_0x52cdd5[_0x834e('0x116')],_0x52cdd5[_0x834e('0x113')]>0x0?ut['getCallerIdRandom'](_0x52cdd5[_0x834e('0x115')],_0x52cdd5['dialRandomLastDigitCallerIdNumber']):_0x52cdd5[_0x834e('0x115')]);if(_0x431f18){_0x3b9429['originatecalleridname']=ut[_0x834e('0x117')](_0x431f18);_0x3b9429[_0x834e('0x118')]=ut[_0x834e('0x119')](_0x431f18);}var _0x2d2268=ut[_0x834e('0x11a')](_0x52cdd5,_0x5cb379,_0x21cb1d,_0x431f18,_0x5e0bfe,_0x3b9429);_['merge'](_0x3b9429,ut[_0x834e('0x11b')](_0x2d2268));_0x3b9429[_0x834e('0x5f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x52cdd5[_0x834e('0x11c')]=_0x2d2268;var _0x4db3c5=ut['variablesAction'](_0x3b9429,_0x52cdd5,_0x2d2268,_0x3b9429['activeContact'],_0x494e08);return ami[_0x834e('0x49')](_0x4db3c5)[_0x834e('0x5b')](function(_0xbd9400){_0x52cdd5[_0x834e('0x2c')]+=0x1;logger[_0x834e('0x25')](_0x834e('0x11d'),_0x5e0bfe,_0x834e('0xa1'),_0x52cdd5['name'],_0x834e('0x45'),_0x52cdd5[_0x834e('0x2c')]);_0x45c8e6(_0xbd9400);})['catch'](function(_0x5df60f){ut[_0x834e('0xd8')](_0x3b9429,0xe,_0x834e('0x11e'));rpcDb['createAgentHistory'](_0x3b9429,'[originateFailure][logOriginateFailure]');_0x3512d8(_0x5df60f);});});};Preview[_0x834e('0x10')][_0x834e('0x11f')]=function(_0x42305c){if(this['actions'][_0x42305c[_0x834e('0xa2')]]){this[_0x834e('0x43')][_0x42305c[_0x834e('0xa2')]]['channel']=_0x42305c[_0x834e('0x4b')];}};Preview['prototype'][_0x834e('0x120')]=function(_0x1debf7){var _0x3a1328=this;var _0x10971d=this[_0x834e('0x43')][_0x1debf7['actionid']];if(_0x10971d){if(_0x10971d[_0x834e('0x121')]&&this[_0x834e('0x17')][_0x10971d[_0x834e('0x121')]]){ut[_0x834e('0x122')](_0x10971d,this[_0x834e('0x17')][_0x10971d['lookAgent']]['name'],this[_0x834e('0x17')][_0x10971d[_0x834e('0x121')]]['id']);}var _0x13d670=_['clone'](_0x10971d);_0x13d670[_0x834e('0x123')]=moment()[_0x834e('0x60')](_0x834e('0x61'));var _0x386b73=_0x3a1328['campaignsPreview'][_0x10971d[_0x834e('0x44')]];if(ut[_0x834e('0x124')](_0x1debf7['response'])){if(_0x10971d[_0x834e('0x8a')]){rpcDb[_0x834e('0xfb')](_0x10971d[_0x834e('0x8c')]);}if(_0x10971d[_0x834e('0x8b')]){rpcDb['disableContact'](_0x10971d[_0x834e('0x8c')]);}ami['emit'](_0x834e('0x125'),ut[_0x834e('0x7a')](_0x10971d,_0x834e('0x126'),this[_0x834e('0x15')][_0x10971d[_0x834e('0x44')]]));this[_0x834e('0xd5')](_0x13d670,_0x386b73,_0x1debf7);}else{_0x10971d['starttime']=moment()['format'](_0x834e('0x61'));ut[_0x834e('0xd8')](_0x13d670,0x4,'Answer');rpcDb[_0x834e('0xd9')](_0x13d670,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x834e('0x10')][_0x834e('0x127')]=function(_0x319d6c){var _0x151b58=this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]];var _0x36836f;if(_0x151b58){_0x36836f=this['campaignsPreview'][_0x151b58[_0x834e('0x44')]];logger[_0x834e('0x25')](_0x834e('0x128'),_0x319d6c[_0x834e('0xa2')],_0x834e('0xa1'),_0x36836f['name'],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);}if(this[_0x834e('0x43')][_0x319d6c['linkedid']]&&_0x319d6c['linkedid']!==_0x319d6c['uniqueid']){if(_0x319d6c[_0x834e('0x129')]==='16'&&this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){this[_0x834e('0x75')](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')]);}else if(this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){logger[_0x834e('0x25')]('[syncHangup][talking][cause]',_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')],_0x834e('0xa1'),_0x36836f[_0x834e('0x28')],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);this[_0x834e('0x75')](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c['cause']);}}else if(_0x151b58&&_[_0x834e('0x54')](_0x151b58[_0x834e('0x12a')])&&_0x36836f['dialQueueProject']&&_0x319d6c[_0x834e('0xa2')]===_0x319d6c[_0x834e('0x91')]&&_[_0x834e('0x54')](_0x319d6c[_0x834e('0xd7')])&&_0x319d6c['cause']==='16'&&_0x319d6c['channelstate']==='6'&&_[_0x834e('0x12b')](_0x151b58['transfer'])){if(_0x151b58[_0x834e('0x8a')]){rpcDb[_0x834e('0xfb')](_0x151b58[_0x834e('0x8c')]);}if(_0x151b58[_0x834e('0x8b')]){rpcDb[_0x834e('0x5e')](_0x151b58['idContact']);}_0x319d6c[_0x834e('0xd7')]='22';this['callProgressDetectingAgent'](_0x151b58,_0x36836f,_0x319d6c);}else if(_0x151b58&&_0x151b58['transfer']){if(_0x319d6c[_0x834e('0x129')]==='16'&&this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){logger[_0x834e('0x25')](_0x834e('0x12c'),_0x319d6c['linkedid'],_0x319d6c[_0x834e('0x129')],_0x834e('0xa1'),_0x36836f['name'],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);this['callProgressDetectingCustomer'](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')]);}else if(this['actions'][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){logger[_0x834e('0x25')](_0x834e('0x12d'),_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')],_0x834e('0xa1'),_0x36836f[_0x834e('0x28')],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);this['callProgressDetectingCustomer'](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')]);}}};Preview[_0x834e('0x10')][_0x834e('0x1d')]=function(_0x371767){if(this[_0x834e('0x43')][_0x371767[_0x834e('0xd3')]]&&_0x371767[_0x834e('0xd3')]!==_0x371767[_0x834e('0x12e')]){this[_0x834e('0x75')](_0x371767,_0x371767[_0x834e('0xd3')],_0x371767[_0x834e('0xcb')]);}};Preview['prototype'][_0x834e('0x1c')]=function(_0x1cd122){if(this['actions'][_0x1cd122['linkedid']]&&_0x1cd122['linkedid']!==_0x1cd122[_0x834e('0x91')]&&!this[_0x834e('0x43')][_0x1cd122[_0x834e('0xa2')]][_0x834e('0x47')]){if(_0x1cd122[_0x834e('0x129')]==='1'){this[_0x834e('0x75')](_0x1cd122,_0x1cd122[_0x834e('0xa2')],_0x1cd122['cause']);}}};Preview['prototype']['addVariable']=function(_0x47947b,_0x684a97,_0x3c8fc2){if(this[_0x834e('0x43')][_0x47947b]){if(_['isNil'](this['actions'][_0x47947b]['variables'])){this[_0x834e('0x43')][_0x47947b]['variables']={};}this['actions'][_0x47947b][_0x834e('0x11c')][_0x684a97]=_0x3c8fc2;}};Preview[_0x834e('0x10')][_0x834e('0x20')]=function(_0x1acdbd){try{if(!_[_0x834e('0x54')](_0x1acdbd)){if(ut[_0x834e('0x12f')](_[_0x834e('0x130')](_0x1acdbd['variable'])[0x0])){this[_0x834e('0x131')](_0x1acdbd[_0x834e('0x91')],_[_0x834e('0x130')](_0x1acdbd[_0x834e('0x132')])[0x0],_0x1acdbd[_0x834e('0x133')]);}}}catch(_0x488f82){logger[_0x834e('0x134')]('[syncVarSet][Preview]',util[_0x834e('0x135')](_0x488f82,{'showHidden':![],'depth':null}));}};Preview[_0x834e('0x10')][_0x834e('0x22')]=function(_0x57714a){if(_0x57714a){if(this['actions'][_0x57714a['transfertargetlinkedid']]){this['actions'][_0x57714a[_0x834e('0x136')]][_0x834e('0x137')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x20d61c){if(_0x20d61c){if(this[_0x834e('0x43')][_0x20d61c[_0x834e('0x138')]]){this['actions'][_0x20d61c[_0x834e('0x138')]][_0x834e('0x137')]=!![];}}};module[_0x834e('0x139')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 1da303b..76cb577 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 _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 +var _0xa1ac=['../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','catch','[createHistory]\x20','resolve','then','createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','active','countReScheduled','[countReScheduled]\x20','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','membername','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird'];(function(_0x2ea9fd,_0x45d80b){var _0x27d18e=function(_0x20a0c9){while(--_0x20a0c9){_0x2ea9fd['push'](_0x2ea9fd['shift']());}};_0x27d18e(++_0x45d80b);}(_0xa1ac,0x136));var _0xca1a=function(_0x4836db,_0xfcad08){_0x4836db=_0x4836db-0x0;var _0x25f52b=_0xa1ac[_0x4836db];return _0x25f52b;};'use strict';var util=require(_0xca1a('0x0'));var BPromise=require(_0xca1a('0x1'));var logger=require('../../../config/logger')('preview');var cmHopper=require(_0xca1a('0x2'));var cmHopperHistory=require(_0xca1a('0x3'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require(_0xca1a('0x4'));var voiceQueueReport=require(_0xca1a('0x5'));function loggerCatch(_0xa554f0){return function(_0x211ddc){logger[_0xca1a('0x6')](_0xa554f0,util[_0xca1a('0x7')](_0x211ddc,{'showHidden':![],'depth':null}));};}function create(_0x55f07b){return cmHopperHistory['createHistory'](_0x55f07b)[_0xca1a('0x8')](loggerCatch(_0xca1a('0x9')));}function createAgent(_0x383ea6){return BPromise[_0xca1a('0xa')]()[_0xca1a('0xb')](agentReportPreview[_0xca1a('0xc')](_0x383ea6))[_0xca1a('0x8')](loggerCatch(_0xca1a('0x9')));}function moveContact(_0x2f8a70){return cmHopper[_0xca1a('0xd')](_0x2f8a70,!![])[_0xca1a('0x8')](loggerCatch(_0xca1a('0xe')));}exports[_0xca1a('0xf')]=function(_0x4aaee7){return cmHopperBlack[_0xca1a('0xf')](_0x4aaee7)['catch'](loggerCatch(_0xca1a('0x10')));};exports[_0xca1a('0x11')]=function(_0x47aedb){return BPromise['resolve']()[_0xca1a('0xb')](cmHopper[_0xca1a('0x11')](_0x47aedb))[_0xca1a('0x8')](loggerCatch(_0xca1a('0x12')));};exports[_0xca1a('0xc')]=function(_0x13ef04,_0x1efd5c){create(_0x13ef04)[_0xca1a('0x8')](loggerCatch(_0x1efd5c));moveContact(_0x13ef04)[_0xca1a('0x8')](loggerCatch(_0x1efd5c));};exports[_0xca1a('0x13')]=function(_0x3ddc58,_0x4e69ed){createAgent(_0x3ddc58)['catch'](loggerCatch(_0x4e69ed));};exports[_0xca1a('0x14')]=function(_0x5b294e,_0x38f39a){create(_0x5b294e)[_0xca1a('0x8')](loggerCatch(_0x38f39a));};exports['createCustomerFinal']=function(_0x550f9c,_0x95878b){moveContact(_0x550f9c)[_0xca1a('0x8')](loggerCatch(_0x95878b));};exports[_0xca1a('0x15')]=function(_0x32864e,_0x4b235a,_0x39ce3d){if(_0x4b235a){_0x32864e['UserId']=null;}if(_0x39ce3d){_0x32864e[_0xca1a('0x16')]=![];}return cmHopper['rescheduleContact'](_0x32864e)[_0xca1a('0x8')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xca1a('0x17')]=function(_0x203359){return cmHopper[_0xca1a('0x17')](_0x203359)['catch'](loggerCatch(_0xca1a('0x18')));};exports['unlockContact']=function(_0x7633fc){return cmHopper[_0xca1a('0x19')]({'UserId':null},_0x7633fc,0x1)['catch'](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x4972df){return cmHopper[_0xca1a('0x19')]({'active':![]},_0x4972df,0x1)[_0xca1a('0x8')](loggerCatch(_0xca1a('0x1a')));};exports[_0xca1a('0x1b')]=function(_0x510da5){var _0x3a036b={};_0x3a036b[_0xca1a('0x1c')]=_0x510da5[_0xca1a('0x1c')];_0x3a036b[_0xca1a('0x1d')]=_0x510da5['uniqueid'];_0x3a036b[_0xca1a('0x1e')]=_0x510da5['calleridnum'];_0x3a036b[_0xca1a('0x1f')]=_0x510da5[_0xca1a('0x1f')];_0x3a036b[_0xca1a('0x20')]=_0x510da5[_0xca1a('0x20')];_0x3a036b[_0xca1a('0x21')]=_0x510da5['answertime'];_0x3a036b['queuecallerleaveAt']=_0x510da5[_0xca1a('0x22')];_0x3a036b[_0xca1a('0x23')]=0x1;_0x3a036b[_0xca1a('0x24')]=_0x510da5[_0xca1a('0x25')];_0x3a036b['connectedlinename']=_0x510da5[_0xca1a('0x26')];_0x3a036b[_0xca1a('0x27')]='from-sip';_0x3a036b[_0xca1a('0x28')]=_0xca1a('0x29');_0x3a036b[_0xca1a('0x2a')]=0x0;_0x3a036b[_0xca1a('0x2b')]=0x1;_0x3a036b[_0xca1a('0x2c')]=_0x510da5[_0xca1a('0x26')];_0x3a036b[_0xca1a('0x2d')]=_0xca1a('0x2e');return BPromise[_0xca1a('0xa')]()['then'](voiceQueueReport[_0xca1a('0x2f')](_0x3a036b))['catch'](loggerCatch(_0xca1a('0x30')));};exports[_0xca1a('0x31')]=function(_0x244c17,_0x1b6f3c){return BPromise[_0xca1a('0xa')]()[_0xca1a('0xb')](cmHopper[_0xca1a('0x31')](_0x244c17,_0x1b6f3c))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xca1a('0x32')]=function(_0x8a588d){return cmHopper[_0xca1a('0x15')](_0x8a588d,!![],!![])[_0xca1a('0x8')](loggerCatch(_0xca1a('0x33')));}; \ 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 512d6ce..e20c807 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 _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 +var _0x3db9=['getDiff','milliseconds','createBody','CampaignId','idContact','type','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqos','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','buildNoAnswerEventPayload','util','lodash','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','loggerCatch','error','inspect','logger','info','loggerError','logger2','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','addVariables','name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','membername','talktime','answertime','getSeconds','isFailure','Failure','variablesAction','RECALL','calleridname','uniqueid','originate','channelAgent','from-sip','timeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','Global','active','scheduledat','minutes','ListId','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','agentReadyId','not_inuse','status','reachable','push'];(function(_0x51beba,_0x202d19){var _0x167ee0=function(_0x2d5b21){while(--_0x2d5b21){_0x51beba['push'](_0x51beba['shift']());}};_0x167ee0(++_0x202d19);}(_0x3db9,0x1eb));var _0x93db=function(_0x5c1fcd,_0x121471){_0x5c1fcd=_0x5c1fcd-0x0;var _0x4b1065=_0x3db9[_0x5c1fcd];return _0x4b1065;};'use strict';var util=require(_0x93db('0x0'));var _=require(_0x93db('0x1'));var moment=require('moment');var logger=require(_0x93db('0x2'))('preview');var ipAgi=process[_0x93db('0x3')][_0x93db('0x4')]||_0x93db('0x5');var utils=require('../../dialer/utils');exports[_0x93db('0x6')]=function(_0x59460b){return function(_0x5675ba){logger[_0x93db('0x7')](_0x59460b,util[_0x93db('0x8')](_0x5675ba,{'showHidden':![],'depth':null}));};};exports[_0x93db('0x9')]=function(_0x3879e3,_0x187419){logger[_0x93db('0xa')](_0x3879e3,util[_0x93db('0x8')](_0x187419,{'showHidden':![],'depth':null}));};exports[_0x93db('0xb')]=function(_0x33f9cc,_0x53f293){logger[_0x93db('0x7')](_0x33f9cc,util[_0x93db('0x8')](_0x53f293,{'showHidden':![],'depth':null}));};exports[_0x93db('0xc')]=function(_0x145097){return function(_0x358ff1){logger[_0x93db('0xa')](_0x145097,util[_0x93db('0x8')](_0x358ff1,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x5c1a3e,_0x565698,_0x289b05){return{'message':_0x5c1a3e,'unlock':_0x565698,'active':_0x289b05};};exports[_0x93db('0xd')]=function(_0x452059,_0x25d184,_0x493319){if(!_[_0x93db('0xe')](_0x493319)&&_0x93db('0xf')===typeof _0x493319&&!_[_0x93db('0x10')](_0x493319)){if(!_[_0x93db('0xe')](_0x25d184)&&_0x93db('0xf')===typeof _0x25d184&&!_[_0x93db('0x10')](_0x25d184)){return util['format'](_0x93db('0x11'),_0x25d184,_0x493319);}return util[_0x93db('0x12')](_0x93db('0x11'),_0x493319,_0x493319);}if(!_[_0x93db('0xe')](_0x452059)&&_0x93db('0xf')===typeof _0x452059&&!_[_0x93db('0x10')](_0x452059)){return _0x452059;}return _0x93db('0x13');};exports[_0x93db('0x14')]=function(_0x1347b3){if(_[_0x93db('0x15')](_0x1347b3)){return![];}return _0x1347b3;};exports[_0x93db('0x16')]=function(_0x1c1800,_0x515107,_0x14c224,_0x252c30,_0x5a767b,_0x53ef2b){var _0x48d317={'XMD-QUEUE':_0x515107['Queue']?_0x515107['Queue'][_0x93db('0x17')]:'','XMD-CALLERID':_0x252c30,'XMD-CALLERID-PREVIEW':_0x53ef2b?util[_0x93db('0x12')](_0x93db('0x11'),_0x53ef2b['calleridname'],_0x53ef2b[_0x93db('0x18')]):_0x252c30,'XMD-DIALID':_0x5a767b,'XMD-CONTACTID':_0x515107[_0x93db('0x19')],'XMD-CDRTYPE':_0x93db('0x1a'),'CALLERID(all)':_0x252c30,'XMD-VOICEQUEUEID':_0x515107[_0x93db('0x1b')],'XMD-DIALCHANNEL':_0x14c224,'XMD-DIALTIMEOUT':_0x1c1800[_0x93db('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x93db('0x12')](_0x93db('0x1d'),_0x1c1800[_0x93db('0x1e')]?'g':'',_[_0x93db('0x10')](_0x1c1800[_0x93db('0x1f')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x1c1800[_0x93db('0x20')]||'','XMD-AGI':_0x1c1800['dialQueueProject']?util[_0x93db('0x12')](_0x93db('0x21'),ipAgi,_0x1c1800[_0x93db('0x22')]):_0x93db('0x23'),'XMD-AGIAFTER':_0x1c1800['dialQueueProject2']?util[_0x93db('0x12')](_0x93db('0x21'),ipAgi,_0x1c1800[_0x93db('0x1e')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x53ef2b?_0x53ef2b[_0x93db('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x53ef2b?_0x53ef2b[_0x93db('0x25')]:'','XMD-DESTINATION':_0x93db('0x26'),'SIPADDHEADER':_0x93db('0x27')};if(!_[_0x93db('0x10')](_0x1c1800[_0x93db('0x1f')])){_0x48d317[util[_0x93db('0x12')]('%s',_0x93db('0x28'))]=_0x1c1800[_0x93db('0x1f')];_0x48d317[util[_0x93db('0x12')]('%s',_0x93db('0x29'))]=_0x5a767b;}if(_0x515107&&_0x515107[_0x93db('0x2a')]){for(var _0x4d3560 in _0x515107[_0x93db('0x2a')]){if(_0x515107[_0x93db('0x2a')][_0x93db('0x2b')](_0x4d3560)){if(!_['isNil'](_0x515107[_0x93db('0x2a')][_0x4d3560])&&_0x4d3560!=='id'&&_0x4d3560!=='tags'&&_0x4d3560!==_0x93db('0x2c')&&_0x4d3560!==_0x93db('0x2d')){_0x48d317[util[_0x93db('0x12')](_0x93db('0x2e'),'XMD-',_['toUpper'](_0x4d3560))]=_0x515107[_0x93db('0x2a')][_0x4d3560];}}}}return _0x48d317;};exports['toLowerVariables']=function(_0x4b64a8){var _0x39d288={};for(var _0x5b7ccf in _0x4b64a8){if(_0x4b64a8[_0x93db('0x2b')](_0x5b7ccf)){_0x39d288[util[_0x93db('0x12')]('%s',_[_0x93db('0x2f')](_0x5b7ccf))]=_0x4b64a8[_0x5b7ccf];}}return{'variables':_0x39d288};};exports[_0x93db('0x30')]=function(_0x26a40,_0x374f47){if(!_['isNil'](_0x26a40)){if(_0x26a40[_0x93db('0x2b')](_0x93db('0x31'))){if(_0x26a40[_0x93db('0x31')]>0x0){_0x26a40[_0x93db('0x31')]-=0x1;}else{logger['error'](_0x93db('0x32'),_0x374f47);}}}else{logger['error'](_0x93db('0x33'),_0x374f47);}};exports[_0x93db('0x34')]=function(_0x42ab1f){var _0x2786bf=moment()[_0x93db('0x12')](_0x93db('0x35'));_0x42ab1f[_0x93db('0x36')]=0xd;_0x42ab1f[_0x93db('0x37')]=_0x93db('0x38');_0x42ab1f[_0x93db('0x39')]=_0x2786bf;_0x42ab1f[_0x93db('0x3a')]=_0x2786bf;_0x42ab1f[_0x93db('0x3b')]=_0x2786bf;};exports[_0x93db('0x3c')]=function(_0x3cc5c0,_0x10e4b1,_0x457502){var _0x156963=moment()[_0x93db('0x12')](_0x93db('0x35'));_0x3cc5c0[_0x93db('0x36')]=_0x10e4b1;_0x3cc5c0['statedesc']=_0x457502;_0x3cc5c0[_0x93db('0x3a')]=_0x156963;_0x3cc5c0[_0x93db('0x3d')]=utils['getSeconds'](_0x3cc5c0[_0x93db('0x3a')],_0x3cc5c0[_0x93db('0x39')]);};exports['logLookAgent']=function(_0x2fb2bd,_0x5ce573,_0x4a20f2){_0x2fb2bd[_0x93db('0x3e')]=_0x5ce573;_0x2fb2bd['UserId']=_0x4a20f2;};exports['logCustomer']=function(_0x582906,_0x4e308e,_0xff983){var _0x2e3e49=moment()[_0x93db('0x12')](_0x93db('0x35'));_0x582906[_0x93db('0x36')]=_0x4e308e;_0x582906['statedesc']=_0xff983;_0x582906[_0x93db('0x3a')]=_0x582906['responsetime']?_0x582906[_0x93db('0x3a')]:_0x2e3e49;_0x582906['endtime']=_0x582906[_0x93db('0x3b')]?_0x582906[_0x93db('0x3b')]:_0x2e3e49;_0x582906[_0x93db('0x3d')]=utils['getSeconds'](_0x582906['responsetime']||0x0,_0x582906[_0x93db('0x39')]||0x0);_0x582906[_0x93db('0x3f')]=_0x582906[_0x93db('0x40')]?utils[_0x93db('0x41')](_0x582906[_0x93db('0x3b')],_0x582906[_0x93db('0x40')]):0x0;};exports[_0x93db('0x42')]=function(_0x4fcbb8){return _0x4fcbb8===_0x93db('0x43');};exports[_0x93db('0x44')]=function(_0x5f552c,_0x2f257f,_0x2bed94,_0x155f6d,_0x3cd05d){var _0x3d8ac1=_0x155f6d?_0x93db('0x45'):_0x5f552c[_0x93db('0x46')];_0x3d8ac1=_0x3cd05d?'BOOKED':_0x3d8ac1;return{'actionid':_0x5f552c[_0x93db('0x47')],'action':_0x93db('0x48'),'channel':_0x5f552c[_0x93db('0x49')],'callerid':util[_0x93db('0x12')](_0x93db('0x11'),_0x3d8ac1,_0x5f552c[_0x93db('0x18')]),'Exten':_0x93db('0x26'),'Context':_0x93db('0x4a'),'Priority':'1','variable':_0x2bed94,'timeout':(_0x2f257f[_0x93db('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5f552c[_0x93db('0x47')]};};exports['totalGlobal']=function(_0x4450cb){return _0x4450cb[_0x93db('0x4c')]+_0x4450cb[_0x93db('0x4d')]+_0x4450cb[_0x93db('0x4e')]+_0x4450cb['countagentrejectretry']+_0x4450cb[_0x93db('0x4f')];};exports[_0x93db('0x50')]=function(_0x230a70){var _0x1c2bad=_[_0x93db('0x51')](_0x230a70);_0x1c2bad[_0x93db('0x36')]=0xf;_0x1c2bad['statedesc']=_0x93db('0x52');return _0x1c2bad;};exports['scheduledAt']=function(_0x19a704,_0x598c67,_0x30e60a){var _0x1e296c={};_0x1e296c[_0x598c67]=_0x19a704[_0x598c67];_0x1e296c[_0x93db('0x53')]=![];_0x1e296c[_0x93db('0x54')]=moment()['add'](_0x30e60a,_0x93db('0x55'))[_0x93db('0x12')](_0x93db('0x35'));_0x1e296c[_0x93db('0x19')]=_0x19a704[_0x93db('0x19')];_0x1e296c[_0x93db('0x56')]=_0x19a704[_0x93db('0x56')];_0x1e296c[_0x93db('0x1b')]=_0x19a704[_0x93db('0x1b')]||undefined;return _0x1e296c;};exports['decrementTalkink']=function(_0x548e5c,_0x1b9344){if(!_['isNil'](_0x548e5c)){if(_0x548e5c['pTalking']>0x0){_0x548e5c['pTalking']-=0x1;}else{logger[_0x93db('0x7')](_0x1b9344,_0x93db('0x57'));}}else{logger[_0x93db('0x7')](_0x1b9344,_0x93db('0x58'));}};exports[_0x93db('0x59')]=function(_0x5f1640){if(_0x5f1640<=0x0){return!![];}return![];};function buildObj(_0x39b1fe,_0x5b07e5,_0x1a0443){_0x39b1fe[_0x93db('0x5a')]=_0x5b07e5;_0x39b1fe[_0x93db('0x17')]=_0x39b1fe[_0x93db('0x5b')];_0x39b1fe[_0x93db('0x5c')]=_0x39b1fe['channelAgent'];_0x39b1fe[_0x93db('0x5d')]=_0x93db('0x5e');if(_0x1a0443){_0x39b1fe[_0x93db('0x5f')]=_0x1a0443['mandatoryDisposition'];}return _0x39b1fe;}exports['buildObj']=buildObj;exports['buildAcw']=function(_0x5c7d5d){var _0x1532be={};_0x1532be[_0x93db('0x5b')]=_0x5c7d5d['queue'];_0x1532be[_0x93db('0x5c')]=_0x5c7d5d[_0x93db('0x49')];_0x1532be['uniqueid']=_0x5c7d5d[_0x93db('0x47')];return _0x1532be;};exports[_0x93db('0x60')]=function(_0x52ffcb){var _0x48c7dd=[];for(var _0x181f26 in _0x52ffcb){if(_0x52ffcb[_0x93db('0x2b')](_0x181f26)){if(!_['isNil'](_0x52ffcb[_0x181f26])&&_0x52ffcb[_0x181f26][_0x93db('0x36')]===_0x93db('0x61')&&_0x52ffcb[_0x181f26][_0x93db('0x62')]===_0x93db('0x63')){_0x48c7dd[_0x93db('0x64')](_0x52ffcb[_0x181f26]['id']);}}}return _0x48c7dd;};exports[_0x93db('0x65')]=function(_0x133133){var _0x2bb998=moment()['milliseconds'](0x0);var _0x37fed7=moment(_0x133133)[_0x93db('0x66')](0x0);return _0x2bb998['diff'](_0x37fed7,'seconds');};exports[_0x93db('0x67')]=function(_0x33bb66){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x33bb66[_0x93db('0x19')],'ListId':_0x33bb66[_0x93db('0x56')],'VoiceQueueId':_0x33bb66[_0x93db('0x1b')]||undefined,'CampaignId':_0x33bb66[_0x93db('0x68')]||undefined};};exports['filterKey']=function(_0x492747){if(_0x492747==='uniqueid'||_0x492747===_0x93db('0x69')||_0x492747===_0x93db('0x5b')||_0x492747===_0x93db('0x6a')||_0x492747===_0x93db('0x6b')||_0x492747===_0x93db('0x6c')||_0x492747===_0x93db('0x3e')||_0x492747===_0x93db('0x49')||_0x492747===_0x93db('0x46')||_0x492747===_0x93db('0x53')||_0x492747===_0x93db('0x18')||_0x492747===_0x93db('0x54')||_0x492747===_0x93db('0x4c')||_0x492747===_0x93db('0x4d')||_0x492747==='countnoanswerretry'||_0x492747===_0x93db('0x6d')||_0x492747===_0x93db('0x6e')||_0x492747===_0x93db('0x6f')||_0x492747===_0x93db('0x70')||_0x492747===_0x93db('0x71')||_0x492747==='ContactId'||_0x492747===_0x93db('0x56')||_0x492747===_0x93db('0x72')||_0x492747==='VoiceQueueId'||_0x492747===_0x93db('0x73')||_0x492747===_0x93db('0x74')||_0x492747===_0x93db('0x75')||_0x492747===_0x93db('0x76')||_0x492747===_0x93db('0x77')||_0x492747==='xmd-dialurl'||_0x492747===_0x93db('0x78')||_0x492747===_0x93db('0x79')||_0x492747===_0x93db('0x7a')||_0x492747===_0x93db('0x7b')||_0x492747==='xmd-contactid'||_0x492747===_0x93db('0x7c')||_0x492747==='xmd-callerid'||_0x492747===_0x93db('0x7d')||_0x492747===_0x93db('0x7e')||_0x492747==='rtpaudioqos'||_0x492747===_0x93db('0x7f')||_0x492747==='rtpaudioqosjitter'||_0x492747===_0x93db('0x80')||_0x492747===_0x93db('0x81')||_0x492747==='rtpaudioqoslossbridged'||_0x492747===_0x93db('0x82')||_0x492747==='rtpaudioqosrttbridged'||_0x492747===_0x93db('0x83')||_0x492747==='rtpaudioqosbridged'||_0x492747===_0x93db('0x84')||_0x492747===_0x93db('0x80')||_0x492747===_0x93db('0x81')||_0x492747===_0x93db('0x85')||_0x492747==='rtpaudioqosrtt'||_0x492747===_0x93db('0x86')||_0x492747==='bridgepeer'||_0x492747===_0x93db('0x87')||_0x492747===_0x93db('0x36')||_0x492747==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x35058a,_0x276f38){var _0x22e528,_0x3207c7,_0x4509ad;if(_0x276f38<=0x0){_0x276f38=0x1;}_0x22e528=new RegExp(_0x93db('0x88')+_0x276f38+'}$');_0x3207c7=Math[_0x93db('0x89')](0xa,_0x276f38-0x1);_0x4509ad=Math[_0x93db('0x89')](0xa,_0x276f38)-0x1;return util[_0x93db('0x12')]('%s',_[_0x93db('0x8a')](_0x35058a,_0x22e528,_[_0x93db('0x8b')](_0x3207c7,_0x4509ad)));};exports[_0x93db('0x8c')]=function(_0xa64290){var _0x1d61fc=_0xa64290[_0x93db('0x8d')](/"(.*?)"/);return _0x1d61fc?_0x1d61fc[0x1]:_0xa64290;};exports[_0x93db('0x8e')]=function(_0x37a76f){var _0x162780=_0x37a76f[_0x93db('0x8d')](/<(.*?)>/);return _0x162780?_0x162780[0x1]:_0x37a76f;};function buildNoAnswerEventPayload(_0x44d6db,_0x439813){var _0x4b4c16=buildObj(_0x44d6db,_0x93db('0x8f'));if(!_['isEmpty'](_0x439813[_0x93db('0x90')])){Object[_0x93db('0x91')](_0x439813[_0x93db('0x90')])[_0x93db('0x92')](function(_0x40167c){_0x4b4c16[_0x40167c['toLowerCase']()]=_0x439813['variables'][_0x40167c];});}return _0x4b4c16;}exports[_0x93db('0x93')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 6de8b1e..21dc843 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 _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 +var _0xbff0=['queuepause','voicechannel','voicequeuechannelhangup','queueadd','string','number','boolean','queueremove'];(function(_0x17df18,_0x5825d6){var _0x8b9727=function(_0x37187d){while(--_0x37187d){_0x17df18['push'](_0x17df18['shift']());}};_0x8b9727(++_0x5825d6);}(_0xbff0,0xdb));var _0x0bff=function(_0x4696db,_0x119f94){_0x4696db=_0x4696db-0x0;var _0x10a7e0=_0xbff0[_0x4696db];return _0x10a7e0;};'use strict';exports[_0x0bff('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x0bff('0x1'),'required':!![]},'membername':{'type':_0x0bff('0x1'),'required':!![]},'penalty':{'type':_0x0bff('0x2'),'required':![]},'paused':{'type':_0x0bff('0x3'),'required':![]}};exports[_0x0bff('0x4')]={'queue':{'type':_0x0bff('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x0bff('0x5')]={'interface':{'type':_0x0bff('0x1'),'required':!![]},'paused':{'type':_0x0bff('0x3')},'reason':{'type':_0x0bff('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x0bff('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x0bff('0x1'),'required':!![]}};exports[_0x0bff('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x0bff('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x0bff('0x1')}};exports[_0x0bff('0x7')]={'uniqueid':{'type':_0x0bff('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 5258bef..2b642de 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 _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 +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(_0x209748,_0x5bc8dd){var _0x472943=function(_0x553858){while(--_0x553858){_0x209748['push'](_0x209748['shift']());}};_0x472943(++_0x5bc8dd);}(_0xb10b,0x12a));var _0xbb10=function(_0x47195e,_0x347734){_0x47195e=_0x47195e-0x0;var _0x571abb=_0xb10b[_0x47195e];return _0x571abb;};'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 diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 4f3a535..635a9ff 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 _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 +var _0x9bc3=['assign','mergeDBDataToRealtime'];(function(_0x522c6d,_0x4d250d){var _0x26300d=function(_0x3ab228){while(--_0x3ab228){_0x522c6d['push'](_0x522c6d['shift']());}};_0x26300d(++_0x4d250d);}(_0x9bc3,0x148));var _0x39bc=function(_0xaa336e,_0x2febee){_0xaa336e=_0xaa336e-0x0;var _0x53f378=_0x9bc3[_0xaa336e];return _0x53f378;};'use strict';function mergeDBDataToRealtime(_0x409e46,_0x260357){var _0x1905c1=Object[_0x39bc('0x0')]({},_0x409e46);for(var _0x556f21 in _0x260357){if(_0x1905c1['hasOwnProperty'](_0x556f21)){_0x1905c1[_0x556f21]=_0x260357[_0x556f21];}}return _0x1905c1;}exports[_0x39bc('0x1')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index acfb076..30f81a8 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 _0x7345=['attendedtransfer','findAgent','accountcode','name','find','interface','SIP/%s','length','connectedlinenum','assigned','format','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','getAgentByInternal','keys','getCallType','split','calleridnum','internal','destination','exten','type','dialer','lastapplication','queue','lastdata','from-voip-provider','callerid','context','from-sip','calleridpreview','originatecalleridnum','channel','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','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;_0x5d50da','transfers','linkedid','transfereelinkedid','uniqueid','UserId','getAgentByInternal','monitor','monitorFilename','monitors','filename','createdAt'];(function(_0x41b463,_0x223cb0){var _0x566854=function(_0x2725b8){while(--_0x2725b8){_0x41b463['push'](_0x41b463['shift']());}};_0x566854(++_0x223cb0);}(_0x9c55,0x68));var _0x59c5=function(_0x5bff0,_0x20716d){_0x5bff0=_0x5bff0-0x0;var _0x3ead2e=_0x9c55[_0x5bff0];return _0x3ead2e;};'use strict';var _=require(_0x59c5('0x0'));var moment=require('moment');var util=require(_0x59c5('0x1'));var config=require(_0x59c5('0x2'));var ami=require(_0x59c5('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x59c5('0x4'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x59c5('0x5'));var RpcVoiceQueueReport=require(_0x59c5('0x6'));var RpcVoiceRecording=require(_0x59c5('0x7'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x59c5('0x8'));var VoiceCallReport=require(_0x59c5('0x9'));var VoiceAgentReport=require(_0x59c5('0xa'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x3f4117){this[_0x59c5('0xb')]=_0x3f4117;this['agents']=_0x3f4117['agents'];this[_0x59c5('0xc')]=_0x3f4117[_0x59c5('0xc')];}Report[_0x59c5('0xd')][_0x59c5('0xe')]=function(_0x3612f5){var _0x2e7969=new VoiceQueueReport(this['realtime']);var _0x576139=new VoiceAgentReport(this[_0x59c5('0xb')]);var _0x2019a2=new VoiceDialReport(this['realtime']);var _0x32e2c9=new VoiceCallReport(this['realtime']);var _0x32257a=new UserReport(this['realtime']);if(config[_0x59c5('0xf')]&&config[_0x59c5('0xf')][_0x59c5('0x10')]){ami['on']('custom:voiceQueueReport',this[_0x59c5('0x11')]['bind'](this));ami['on'](_0x59c5('0x12'),this[_0x59c5('0x13')][_0x59c5('0x14')](this));ami['on'](_0x59c5('0x15'),this[_0x59c5('0x16')]['bind'](this));ami['on'](_0x59c5('0x17'),this[_0x59c5('0x18')][_0x59c5('0x14')](this));ami['on'](_0x59c5('0x19'),this[_0x59c5('0x1a')]['bind'](this));ami['on']('attendedtransfer',this[_0x59c5('0x1b')][_0x59c5('0x14')](this));}};Report[_0x59c5('0xd')][_0x59c5('0x1c')]=function(_0x2f3c39){var _0x1f0f8d;_0x1f0f8d=_[_0x59c5('0x1d')](this['agents'],function(_0x51f818){return _0x51f818[_0x59c5('0x1e')]==_0x2f3c39||_0x51f818[_0x59c5('0x1f')]==_0x2f3c39;});if(_[_0x59c5('0x20')](_0x1f0f8d)){var _0x2906d9=_[_0x59c5('0x1d')](this['telephones'],function(_0xa8543f){return _0xa8543f[_0x59c5('0x1e')]==_0x2f3c39||_0xa8543f[_0x59c5('0x1f')]==_0x2f3c39;});if(_0x2906d9){_0x1f0f8d=_[_0x59c5('0x1d')](this[_0x59c5('0x21')],function(_0x14d529){return _0x14d529['interface']==util['format'](_0x59c5('0x22'),_0x2906d9[_0x59c5('0x1f')]);});}}return _0x1f0f8d;};Report[_0x59c5('0xd')][_0x59c5('0x11')]=function(_0x3e7eca){for(var _0x231917=0x0;_0x231917<_0x3e7eca[_0x59c5('0x23')];_0x231917+=0x1){var _0x3f5765=this[_0x59c5('0x1c')](_0x3e7eca[_0x231917]['connectedlinenum']);if(_0x3f5765){_0x3e7eca[_0x231917][_0x59c5('0x1e')]=_0x3f5765[_0x59c5('0x1e')];_0x3e7eca[_0x231917][_0x59c5('0x24')]=!![];_0x3e7eca[_0x231917][_0x59c5('0x25')]=_0x3f5765['name'];_0x3e7eca[_0x231917][_0x59c5('0x26')]=_[_0x59c5('0x20')](_0x3f5765[_0x59c5('0x26')])?util['format']('SIP/%s',_0x3f5765['name']):_0x3f5765['interface'];if(_0x3e7eca[_0x231917][_0x59c5('0x27')]){_0x3e7eca[_0x231917][_0x59c5('0x28')]=moment()[_0x59c5('0x29')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3e7eca[_0x231917]['queuecallerexit']){_0x3e7eca[_0x231917][_0x59c5('0x2a')]=moment()['format'](_0x59c5('0x2b'));}RpcMemberReport['voiceQueueReport'](_0x3e7eca[_0x231917]);}RpcVoiceQueueReport['create'](_0x3e7eca[_0x231917]);}};function extractCalleridNumber(_0x376843){var _0x431b27=_0x376843['match'](/<(.*?)>/);return _0x431b27?_0x431b27[0x1]:_0x376843;}Report[_0x59c5('0xd')]['getAgentByInternal']=function(_0x40d180){for(var _0x2dca8b=0x0;_0x2dca8b0x0?!![]:![];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;_0x18ae4c0x0?!![]:![];if(!_0x16b01a){return this['syncQueueSummaryComplete'](this[_0x9141('0x17')][_0x9141('0x66')]);}};VoiceQueueReport[_0x9141('0xb')][_0x9141('0x1e')]=function(_0x1ac412){var _0x50c302=this[_0x9141('0x17')]['id'];if(this[_0x9141('0x17')]['queuestatus'][_0x50c302]&&this['summary'][_0x9141('0x5c')][_0x50c302][_0x1ac412[_0x9141('0x5b')]]){this[_0x9141('0x17')][_0x9141('0x5c')][_0x50c302][_0x1ac412[_0x9141('0x5b')]][_0x9141('0x12')]['push'](_0x1ac412);}};VoiceQueueReport[_0x9141('0xb')][_0x9141('0x1a')]=function(_0x10a1f8){var _0xcdf152=this;try{if(this['isNotNull'](_0x10a1f8)&&this[_0x9141('0x55')](_0x10a1f8[_0x9141('0x4a')])){logger[_0x9141('0x4d')](_0x9141('0x67'),util[_0x9141('0x3d')](_0x10a1f8,{'showHidden':![],'depth':null}));var _0x61fed9=this[_0x9141('0x15')][_0x10a1f8['queue']];if(_0x61fed9){logger[_0x9141('0x68')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x61fed9[_0x9141('0x53')]);this[_0x9141('0x17')][_0x9141('0x5d')][_0x61fed9[_0x9141('0x53')]]={'summaryEvent':_0x10a1f8};this[_0x9141('0x17')][_0x9141('0x65')]+=0x1;return ami[_0x9141('0x5a')]({'action':_0x9141('0x5c'),'queue':_0x61fed9['name']})[_0x9141('0x69')](function(_0x29821e){if(!_0xcdf152[_0x9141('0x17')]['queuestatus'][_0x10a1f8[_0x9141('0x5b')]]){_0xcdf152[_0x9141('0x17')][_0x9141('0x5c')][_0x10a1f8[_0x9141('0x5b')]]={};}_0xcdf152[_0x9141('0x17')]['queuestatus'][_0x10a1f8['actionid']][_0x29821e['actionid']]={'queue':_0x61fed9[_0x9141('0x53')],'agents':[]};})[_0x9141('0x57')](function(_0x426623){throw _0x426623;});}}}catch(_0x37f651){logger['error'](_0x9141('0x6a'),util[_0x9141('0x3d')](_0x37f651,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9141('0x1b')]=function(_0x1692a1){if(this[_0x9141('0x17')][_0x9141('0x65')]>0x0){this[_0x9141('0x17')][_0x9141('0x66')]=_0x1692a1;return;}logger[_0x9141('0x4d')](_0x9141('0x6b'),util[_0x9141('0x3d')](_0x1692a1,{'showHidden':![],'depth':null}));this[_0x9141('0x17')]=initializeSummary();ami[_0x9141('0x43')](_0x9141('0x6c'),{});};VoiceQueueReport[_0x9141('0xb')][_0x9141('0x6d')]=function(_0x3bbdb4){try{if(this['isNotNull'](_0x3bbdb4)){logger[_0x9141('0x4d')](_0x9141('0x6e'),_0x3bbdb4[_0x9141('0x47')],util[_0x9141('0x3d')](_0x3bbdb4,{'showHidden':![],'depth':null}));if(_[_0x9141('0x56')](this['queueReports'][_0x3bbdb4[_0x9141('0x47')]])){this[_0x9141('0x10')][_0x3bbdb4[_0x9141('0x47')]]=[];}if(_[_0x9141('0x56')](this[_0x9141('0x13')][_0x3bbdb4[_0x9141('0x47')]])){this[_0x9141('0x13')][_0x3bbdb4[_0x9141('0x47')]]={};}var _0x5a6f4e=new QueueReport();_0x5a6f4e['queue']=_0x3bbdb4[_0x9141('0x4a')];_0x5a6f4e[_0x9141('0x52')]=this[_0x9141('0x15')][_0x5a6f4e[_0x9141('0x4a')]]&&this[_0x9141('0x15')][_0x5a6f4e[_0x9141('0x4a')]]['type']?this['voiceQueues'][_0x5a6f4e['queue']][_0x9141('0x52')]||_0x9141('0x63'):_0x9141('0x63');_0x5a6f4e[_0x9141('0x6f')]=moment()[_0x9141('0x48')](_0x9141('0x70'));_0x5a6f4e[_0x9141('0x71')]=_0x3bbdb4[_0x9141('0x71')];_0x5a6f4e[_0x9141('0x72')]=_0x3bbdb4[_0x9141('0x72')];_0x5a6f4e['uniqueid']=_0x3bbdb4['uniqueid'];_0x5a6f4e[_0x9141('0x73')]=this['channels'][_0x3bbdb4[_0x9141('0x47')]][_0x9141('0x73')];logger[_0x9141('0x68')](_0x9141('0x74'),_0x5a6f4e['queue'],_0x5a6f4e[_0x9141('0x52')]);_[_0x9141('0x75')](_0x5a6f4e,_[_0x9141('0x76')](_0x3bbdb4,_['keys'](_0x5a6f4e)));this['queueReports'][_0x3bbdb4[_0x9141('0x47')]]['push'](_0x5a6f4e);this['channels'][_0x3bbdb4['uniqueid']]=_0x5a6f4e;this[_0x9141('0x44')](_0x5a6f4e,_0x9141('0x21'));}}catch(_0x1247eb){logger[_0x9141('0x3b')](_0x9141('0x6e'),_0x3bbdb4[_0x9141('0x47')],util[_0x9141('0x3d')](_0x1247eb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9141('0x77')]=function(_0x25581f){try{if(this['isNotNull'](_0x25581f)){logger[_0x9141('0x4d')](_0x9141('0x78'),_0x25581f[_0x9141('0x47')],util[_0x9141('0x3d')](_0x25581f,{'showHidden':![],'depth':null}));if(this[_0x9141('0x10')][_0x25581f[_0x9141('0x47')]]){var _0x473429=_[_0x9141('0x79')](this[_0x9141('0x10')][_0x25581f[_0x9141('0x47')]]);_0x473429['queuecallercomplete']=![];_0x473429[_0x9141('0x7a')]=null;_0x473429[_0x9141('0x7b')]=_0x25581f['holdtime'];_0x473429[_0x9141('0x7c')]=_0x25581f['originalposition'];_0x473429[_0x9141('0x22')]=!![];_0x473429['queuecallerabandonAt']=moment()[_0x9141('0x48')](_0x9141('0x70'));_0x473429[_0x9141('0x4f')]=_0x9141('0x7d');_0x473429[_0x9141('0x7e')]=null;logger[_0x9141('0x68')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x473429[_0x9141('0x4a')],_0x473429['type']);this[_0x9141('0x13')][_0x25581f['uniqueid']]=_0x473429;this[_0x9141('0x42')](_0x473429,_0x9141('0x22'));}}}catch(_0x272b5a){logger['error'](_0x9141('0x78'),_0x25581f[_0x9141('0x47')],util[_0x9141('0x3d')](_0x272b5a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9141('0xb')][_0x9141('0x7f')]=function(_0x1bae72){try{if(this['isNotNull'](_0x1bae72)){logger[_0x9141('0x4d')](_0x9141('0x80'),_0x1bae72[_0x9141('0x47')],util[_0x9141('0x3d')](_0x1bae72,{'showHidden':![],'depth':null}));if(this[_0x9141('0x10')][_0x1bae72[_0x9141('0x47')]]){var _0x16613a=_[_0x9141('0x79')](this[_0x9141('0x10')][_0x1bae72[_0x9141('0x47')]]);_0x16613a[_0x9141('0x81')]=moment()[_0x9141('0x48')](_0x9141('0x70'));_0x16613a[_0x9141('0x82')]=_0x1bae72['connectedlinenum'];_0x16613a[_0x9141('0x83')]=_0x1bae72[_0x9141('0x83')];logger['info'](_0x9141('0x84'),_0x16613a[_0x9141('0x4a')],_0x16613a['type'],_0x1bae72[_0x9141('0x82')],_0x1bae72[_0x9141('0x83')]);this['channels'][_0x1bae72['uniqueid']]=_0x16613a;this[_0x9141('0x44')](_0x16613a,_0x9141('0x23'));}}}catch(_0x87cea0){logger[_0x9141('0x3b')](_0x9141('0x80'),_0x1bae72[_0x9141('0x47')],util[_0x9141('0x3d')](_0x87cea0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9141('0x85')]=function(_0x4a5829){try{if(this[_0x9141('0x55')](_0x4a5829)){logger[_0x9141('0x4d')](_0x9141('0x86'),_0x4a5829[_0x9141('0x47')],util[_0x9141('0x3d')](_0x4a5829,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4a5829['uniqueid']]){var _0x5e7933=_[_0x9141('0x79')](this[_0x9141('0x10')][_0x4a5829[_0x9141('0x47')]]);_0x5e7933['queuecallercomplete']=!![];_0x5e7933[_0x9141('0x4f')]=_0x9141('0x87');logger[_0x9141('0x68')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x5e7933[_0x9141('0x4a')],_0x5e7933[_0x9141('0x52')]);}}}catch(_0x22c927){logger['error'](_0x9141('0x86'),_0x4a5829['uniqueid'],util[_0x9141('0x3d')](_0x22c927,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x374875){try{if(this[_0x9141('0x55')](_0x374875)){logger[_0x9141('0x4d')]('[%s][voiceQueueReport][agentcomplete]',_0x374875[_0x9141('0x47')],util['inspect'](_0x374875,{'showHidden':![],'depth':null}));if(this[_0x9141('0x10')][_0x374875['uniqueid']]){var _0x55e6c1=_['last'](this['queueReports'][_0x374875[_0x9141('0x47')]]);_0x55e6c1[_0x9141('0x22')]=![];_0x55e6c1[_0x9141('0x88')]=null;_0x55e6c1['assigned']=!![];_0x55e6c1[_0x9141('0x7e')]=_0x374875[_0x9141('0x89')];_0x55e6c1[_0x9141('0x7b')]=_0x374875[_0x9141('0x7b')];_0x55e6c1[_0x9141('0x8a')]=!![];_0x55e6c1['queuecallerexit']=![];_0x55e6c1[_0x9141('0x8b')]=null;if(!_0x55e6c1[_0x9141('0x8c')]){if(_0x374875[_0x9141('0x8d')]==_0x9141('0x8c')){_0x55e6c1[_0x9141('0x4f')]=_0x9141('0x8e');logger[_0x9141('0x68')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x55e6c1['queue'],_0x55e6c1[_0x9141('0x52')]);}else{if(_[_0x9141('0x8f')](_0x374875[_0x9141('0x38')][_0x9141('0x90')](),_0x9141('0x91'))){if(this[_0x9141('0x10')][_0x374875[_0x9141('0x92')]]){var _0x1cecb4=_[_0x9141('0x79')](this[_0x9141('0x10')][_0x374875[_0x9141('0x92')]]);_0x1cecb4['queuecallercomplete']=![];_0x1cecb4['queuecallerexit']=!![];_0x1cecb4[_0x9141('0x8b')]=moment(_0x55e6c1[_0x9141('0x6f')])[_0x9141('0x93')](_0x374875['holdtime'],_0x9141('0x94'))['format'](_0x9141('0x70'));_0x1cecb4[_0x9141('0x4f')]=_0x9141('0x95');_0x1cecb4['transfer']=!![];_0x1cecb4[_0x9141('0x96')]=_0x9141('0x97');_0x1cecb4[_0x9141('0x98')]=_0x374875['destexten'];_0x1cecb4[_0x9141('0x99')]=_0x374875[_0x9141('0x47')];logger[_0x9141('0x68')](_0x9141('0x9a'),_0x1cecb4[_0x9141('0x4a')],_0x1cecb4[_0x9141('0x52')]);var _0x2a50e7=this['queueReports'][_0x374875[_0x9141('0x92')]];this[_0x9141('0x10')][_0x374875['linkedid']]=this[_0x9141('0x10')][_0x374875[_0x9141('0x47')]];this[_0x9141('0x10')][_0x374875[_0x9141('0x47')]]=_0x2a50e7;}}else{_0x55e6c1[_0x9141('0x4f')]=_0x9141('0x9b')+_0x374875[_0x9141('0x8d')][_0x9141('0x9c')]();logger[_0x9141('0x68')](_0x9141('0x9d'),_0x55e6c1[_0x9141('0x4a')],_0x55e6c1['type'],_0x55e6c1[_0x9141('0x4f')]);}}}this['channels'][_0x374875['uniqueid']]=_0x55e6c1;this[_0x9141('0x42')](_0x55e6c1,'agentcomplete');}}}catch(_0x3e9c8c){logger[_0x9141('0x3b')](_0x9141('0x9e'),_0x374875['uniqueid'],util[_0x9141('0x3d')](_0x3e9c8c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9141('0x24')]=function(_0x27194c){try{if(this['isNotNull'](_0x27194c)){logger[_0x9141('0x4d')]('[%s][voiceQueueReport][varset]',_0x27194c['uniqueid'],util['inspect'](_0x27194c,{'showHidden':![],'depth':null}));this[_0x9141('0x9f')](_0x27194c[_0x9141('0x47')],_[_0x9141('0xa0')](_0x27194c['variable'])[0x0],_0x27194c[_0x9141('0xa1')]);if(this[_0x9141('0x10')][_0x27194c[_0x9141('0x47')]]){var _0x4aec6c=_['last'](this[_0x9141('0x10')][_0x27194c[_0x9141('0x47')]]);if(_0x4aec6c){if(this[_0x9141('0x55')](_0x27194c[_0x9141('0xa2')])&&this[_0x9141('0x55')](_0x27194c[_0x9141('0xa2')][_0x9141('0x5c')])){switch(_0x27194c[_0x9141('0xa1')]){case _0x9141('0xa3'):_0x4aec6c[_0x9141('0xa4')]=![];_0x4aec6c[_0x9141('0x8b')]=null;break;case'TIMEOUT':_0x4aec6c[_0x9141('0xa5')]='timeout';_0x4aec6c[_0x9141('0xa4')]=!![];_0x4aec6c['queuecallerexitAt']=moment()[_0x9141('0x48')](_0x9141('0x70'));_0x4aec6c[_0x9141('0x81')]=moment()[_0x9141('0x48')](_0x9141('0x70'));logger['debug'](_0x9141('0xa6'),_0x27194c[_0x9141('0x47')],util[_0x9141('0x3d')](_0x4aec6c,{'showHidden':![],'depth':null}));ami[_0x9141('0x43')](_0x9141('0xa7'),_0x4aec6c);break;default:_0x4aec6c[_0x9141('0xa4')]=!![];_0x4aec6c[_0x9141('0x8b')]=moment()[_0x9141('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x4aec6c[_0x9141('0x81')]=moment()[_0x9141('0x48')](_0x9141('0x70'));}_0x4aec6c[_0x9141('0x22')]=![];_0x4aec6c[_0x9141('0x88')]=null;_0x4aec6c['queuecallerexitreason']=_0x27194c[_0x9141('0xa1')];this[_0x9141('0x13')][_0x27194c['uniqueid']]=_0x4aec6c;this[_0x9141('0x42')](_0x4aec6c,_0x9141('0xa8'));}else if(this[_0x9141('0x55')](_0x27194c['variable'])&&this[_0x9141('0x55')](_0x27194c[_0x9141('0xa2')][_0x9141('0xa9')])){if(!_0x4aec6c['queuecallerabandon']){_0x4aec6c['queuecallerexit']=!![];_0x4aec6c[_0x9141('0x8b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4aec6c[_0x9141('0x4f')]=_0x9141('0xaa');_0x4aec6c[_0x9141('0x81')]=moment()[_0x9141('0x48')](_0x9141('0x70'));this[_0x9141('0x13')][_0x27194c[_0x9141('0x47')]]=_0x4aec6c;}}logger[_0x9141('0x68')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x27194c[_0x9141('0x47')],_0x4aec6c[_0x9141('0x4a')],_0x4aec6c[_0x9141('0x52')],_[_0x9141('0xa0')](_0x27194c[_0x9141('0xa2')])[0x0],_0x27194c[_0x9141('0xa1')]);_0x4aec6c[_0x9141('0x18')]=this['variables'][_0x27194c['uniqueid']];}}}}catch(_0x35ec31){logger['error'](_0x9141('0xab'),_0x27194c[_0x9141('0x47')],util[_0x9141('0x3d')](_0x35ec31,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9141('0xb')][_0x9141('0x9f')]=function(_0x4d4e1f,_0x12139e,_0x2556ec){var _0x3a2ffc=['rtpaudioqos',_0x9141('0xac'),_0x9141('0xad'),_0x9141('0xae'),_0x9141('0xaf'),'rtpaudioqoslossbridged',_0x9141('0xb0'),'rtpaudioqosrttbridged','sipcallid',_0x9141('0xb1'),'bridgepeer',_0x9141('0xb2'),'membercalls',_0x9141('0xb3'),'memberinterface',_0x9141('0xb4'),_0x9141('0x89'),_0x9141('0xb5'),_0x9141('0xb6')];if(!_[_0x9141('0x37')](_0x12139e)&&!_[_0x9141('0xb7')](_0x3a2ffc,_0x12139e)){if(_['isUndefined'](this[_0x9141('0x18')][_0x4d4e1f])){this['variables'][_0x4d4e1f]={};}this[_0x9141('0x18')][_0x4d4e1f][_0x12139e]=_0x2556ec;}};VoiceQueueReport[_0x9141('0xb')][_0x9141('0xb8')]=function(_0x555575,_0x56325b,_0x5ae111){var _0x114244={};for(var _0x59b45b=0x0;_0x59b45b=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 +var _0x4f31=['accountcode','uniqueid','membername','TALKING','starttime','endtime','outbound','dialstring','toNumber','moment','lodash','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','interface','format','queuecallerleaveAt','diff','seconds','calleridnum','exten','agent'];(function(_0x5b6f1c,_0x4e32e9){var _0x4ef65f=function(_0x27e89f){while(--_0x27e89f){_0x5b6f1c['push'](_0x5b6f1c['shift']());}};_0x4ef65f(++_0x4e32e9);}(_0x4f31,0xd9));var _0x14f3=function(_0x216b60,_0xe5d834){_0x216b60=_0x216b60-0x0;var _0x4406ad=_0x4f31[_0x216b60];return _0x4406ad;};'use strict';var moment=require(_0x14f3('0x0'));var _=require(_0x14f3('0x1'));var util=require('util');var client=require('../client');exports[_0x14f3('0x2')]=function(_0x3b0f3b){var _0x52fd9e=_0x3b0f3b[_0x14f3('0x3')]||_0x3b0f3b[_0x14f3('0x4')];return client[_0x14f3('0x5')](_0x14f3('0x6'),{'body':{'channel':_0x14f3('0x7'),'membername':_0x3b0f3b[_0x14f3('0x8')],'interface':_['isNil'](_0x3b0f3b[_0x14f3('0x9')])?util[_0x14f3('0xa')]('SIP/%s',_0x3b0f3b['lastAssignedTo']):_0x3b0f3b[_0x14f3('0x9')],'type':'TALKING','enterAt':_0x3b0f3b[_0x14f3('0xb')],'exitAt':_0x52fd9e,'duration':moment(_0x52fd9e)[_0x14f3('0xc')](_0x3b0f3b['queuecallerleaveAt'],_0x14f3('0xd')),'data1':'inbound','data2':_0x3b0f3b[_0x14f3('0xe')],'data3':_0x3b0f3b[_0x14f3('0xf')],'data4':null,'data5':_0x3b0f3b['queue'],'role':_0x14f3('0x10'),'internal':_0x3b0f3b['accountcode']?_['toNumber'](_0x3b0f3b[_0x14f3('0x11')]):undefined,'uniqueid':_0x3b0f3b[_0x14f3('0x12')]},'log':_0x14f3('0x6')});};exports['voiceDialReport']=function(_0x1f15da){return client[_0x14f3('0x5')](_0x14f3('0x6'),{'body':{'channel':_0x14f3('0x7'),'membername':_0x1f15da[_0x14f3('0x13')],'interface':_0x1f15da[_0x14f3('0x9')],'type':_0x14f3('0x14'),'enterAt':_0x1f15da[_0x14f3('0x15')],'exitAt':_0x1f15da[_0x14f3('0x16')],'duration':moment(_0x1f15da['endtime'])[_0x14f3('0xc')](_0x1f15da[_0x14f3('0x15')],_0x14f3('0xd'))>=0x0?moment(_0x1f15da[_0x14f3('0x16')])[_0x14f3('0xc')](_0x1f15da[_0x14f3('0x15')],_0x14f3('0xd')):null,'data1':_0x14f3('0x17'),'data2':_0x1f15da['accountcode'],'data3':_0x1f15da[_0x14f3('0xf')],'data4':_0x1f15da[_0x14f3('0x18')]||null,'role':_0x14f3('0x10'),'internal':_0x1f15da['accountcode']?_[_0x14f3('0x19')](_0x1f15da['accountcode']):undefined,'uniqueid':_0x1f15da[_0x14f3('0x12')]},'log':_0x14f3('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 1d745b9..a252f9c 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 _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 +var _0xbff2=['ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request'];(function(_0x171c89,_0x55bb44){var _0x1fec26=function(_0x2f490c){while(--_0x2f490c){_0x171c89['push'](_0x171c89['shift']());}};_0x1fec26(++_0x55bb44);}(_0xbff2,0x10e));var _0x2bff=function(_0x5b55b1,_0x485316){_0x5b55b1=_0x5b55b1-0x0;var _0x3668de=_0xbff2[_0x5b55b1];return _0x3668de;};'use strict';var client=require(_0x2bff('0x0'));exports[_0x2bff('0x1')]=function(){return client[_0x2bff('0x2')](_0x2bff('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x2bff('0x4'),_0x2bff('0x5')]},'log':_0x2bff('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 5383308..5bd3644 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 _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 +var _0x3bbd=['getTemplates','Request','GetTemplate','name','../client'];(function(_0x529a98,_0x554b38){var _0x170bee=function(_0x507dd6){while(--_0x507dd6){_0x529a98['push'](_0x529a98['shift']());}};_0x170bee(++_0x554b38);}(_0x3bbd,0x1b2));var _0xd3bb=function(_0x17d4a4,_0x24c32b){_0x17d4a4=_0x17d4a4-0x0;var _0x28b29e=_0x3bbd[_0x17d4a4];return _0x28b29e;};'use strict';var client=require(_0xd3bb('0x0'));exports[_0xd3bb('0x1')]=function(_0x1fa2aa){return function(_0x1a2b09){return client[_0xd3bb('0x2')](_0xd3bb('0x3'),{'options':{'raw':!![],'attributes':['id',_0xd3bb('0x4'),'html']},'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 4a3dbfd..8c83e37 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 _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 +var _0xbf3c=['value','Action','Actions','action','data1','data2','data3','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','field','operator','Condition','AnyConditions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf3c,0xfd));var _0xcbf3=function(_0x5e9684,_0x105399){_0x5e9684=_0x5e9684-0x0;var _0x3e09a1=_0xbf3c[_0x5e9684];return _0x3e09a1;};'use strict';var client=require(_0xcbf3('0x0'));exports[_0xcbf3('0x1')]=function(_0x5966f5){return function(_0x188339){return client[_0xcbf3('0x2')](_0xcbf3('0x3'),{'options':{'raw':![],'attributes':['id',_0xcbf3('0x4'),_0xcbf3('0x5'),_0xcbf3('0x6')],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0xcbf3('0x7'),_0xcbf3('0x8'),'value']},{'model':_0xcbf3('0x9'),'as':_0xcbf3('0xa'),'attributes':['id','field',_0xcbf3('0x8'),_0xcbf3('0xb')]},{'model':_0xcbf3('0xc'),'as':_0xcbf3('0xd'),'attributes':['id',_0xcbf3('0xe'),_0xcbf3('0xf'),_0xcbf3('0x10'),_0xcbf3('0x11'),_0xcbf3('0x12'),_0xcbf3('0x13'),_0xcbf3('0x14'),_0xcbf3('0x15')]}]},'log':_0xcbf3('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index b0e2b14..e777da9 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 _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 +var _0x368c=['registry','defaultuser','../client','getTrunks','Request','GetTrunk','name'];(function(_0x5f2a5a,_0x246a36){var _0x3a7621=function(_0x320a5f){while(--_0x320a5f){_0x5f2a5a['push'](_0x5f2a5a['shift']());}};_0x3a7621(++_0x246a36);}(_0x368c,0x1b4));var _0xc368=function(_0x2df121,_0x28a27c){_0x2df121=_0x2df121-0x0;var _0x5d9725=_0x368c[_0x2df121];return _0x5d9725;};'use strict';var client=require(_0xc368('0x0'));exports[_0xc368('0x1')]=function(_0x5ab796){return function(_0x499e5b){return client[_0xc368('0x2')](_0xc368('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xc368('0x4'),_0xc368('0x5'),_0xc368('0x6')]},'log':_0xc368('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 672b69e..48eb3e0 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_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 +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(_0x4f13b6,_0x45015f){var _0x3876c5=function(_0xda8b0){while(--_0xda8b0){_0x4f13b6['push'](_0x4f13b6['shift']());}};_0x3876c5(++_0x45015f);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'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 07bfb4e..ec03063 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 _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 +var _0x1091=['update','UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x1091,0x7f));var _0x1109=function(_0x48f405,_0x4bdf54){_0x48f405=_0x48f405-0x0;var _0x344ce6=_0x1091[_0x48f405];return _0x344ce6;};'use strict';var client=require(_0x1109('0x0'));exports['create']=function(_0x1b9359){return client[_0x1109('0x1')]('CreateVoiceAgentReport',{'body':_0x1b9359,'log':_0x1109('0x2')});};exports[_0x1109('0x3')]=function(_0x34391e,_0x372821,_0x528d33){return client[_0x1109('0x1')](_0x1109('0x4'),{'body':_0x34391e,'options':{'where':{'uniqueid':_0x372821,'interface':_0x528d33,'agentcomplete':!![]}},'log':_0x1109('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index c5345ce..832b91a 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 _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 +var _0x4b96=['Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','GetVoiceCallReports','moment','util','lodash','../client'];(function(_0x363606,_0x4bcd42){var _0x177fcf=function(_0x5d6da5){while(--_0x5d6da5){_0x363606['push'](_0x363606['shift']());}};_0x177fcf(++_0x4bcd42);}(_0x4b96,0x10d));var _0x64b9=function(_0x2edfeb,_0x373629){_0x2edfeb=_0x2edfeb-0x0;var _0xeea58a=_0x4b96[_0x2edfeb];return _0xeea58a;};'use strict';var moment=require(_0x64b9('0x0'));var util=require(_0x64b9('0x1'));var _=require(_0x64b9('0x2'));var client=require(_0x64b9('0x3'));exports['create']=function(_0xd743bc){return client[_0x64b9('0x4')](_0x64b9('0x5'),{'body':_[_0x64b9('0x6')](_0xd743bc,{'source':_0xd743bc[_0x64b9('0x7')],'destinationcontext':_0xd743bc[_0x64b9('0x8')],'callerid':_0xd743bc[_0x64b9('0x9')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0x64b9('0xa')]=function(){return function(){return client[_0x64b9('0x4')](_0x64b9('0xb'),{'options':{'where':{'type':[_0x64b9('0xc')],'createdAt':{'$between':[moment()[_0x64b9('0xd')](_0x64b9('0xe'))[_0x64b9('0xf')](_0x64b9('0x10')),moment()['endOf'](_0x64b9('0xe'))['format'](_0x64b9('0x10'))]}},'attributes':[_0x64b9('0x11'),_0x64b9('0x12'),_0x64b9('0x13'),'billableseconds']},'log':_0x64b9('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 7b261f6..4f12e4b 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 _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 +var _0x93a2=['CreateVoiceDialReport','../client','create'];(function(_0x9cc044,_0x21446e){var _0x1dadd9=function(_0x495356){while(--_0x495356){_0x9cc044['push'](_0x9cc044['shift']());}};_0x1dadd9(++_0x21446e);}(_0x93a2,0x14e));var _0x293a=function(_0x2892da,_0x191a40){_0x2892da=_0x2892da-0x0;var _0x28cff2=_0x93a2[_0x2892da];return _0x28cff2;};'use strict';var client=require(_0x293a('0x0'));exports[_0x293a('0x1')]=function(_0x1619c0){return client['Request'](_0x293a('0x2'),{'body':_0x1619c0,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 7a776eb..41fb5c8 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 _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 +var _0xc901=['getVoiceExtensions','../client','recordingFormat'];(function(_0x366e12,_0xa81ea3){var _0x1e96cd=function(_0x1f4186){while(--_0x1f4186){_0x366e12['push'](_0x366e12['shift']());}};_0x1e96cd(++_0xa81ea3);}(_0xc901,0x142));var _0x1c90=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc901[_0x57b54c];return _0x59cc19;};'use strict';var client=require(_0x1c90('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten',_0x1c90('0x1')],'where':{'VoiceExtensionId':null}},'log':_0x1c90('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 8c64a66..b16d513 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 _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 +var _0x29a0=['getVoiceQueues','Request','name','acw','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialQueueProject','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDSilenceThreshold','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client'];(function(_0x1e50ea,_0x2b0b0d){var _0x3a57ae=function(_0x291771){while(--_0x291771){_0x1e50ea['push'](_0x1e50ea['shift']());}};_0x3a57ae(++_0x2b0b0d);}(_0x29a0,0xef));var _0x029a=function(_0x54d0bb,_0x38924f){_0x54d0bb=_0x54d0bb-0x0;var _0x1f4df0=_0x29a0[_0x54d0bb];return _0x1f4df0;};'use strict';var client=require(_0x029a('0x0'));exports[_0x029a('0x1')]=function(){return function(){return client[_0x029a('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x029a('0x3'),_0x029a('0x4'),'acwTimeout','autopause','monitor_format',_0x029a('0x5'),_0x029a('0x6'),_0x029a('0x7'),_0x029a('0x8'),_0x029a('0x9'),_0x029a('0xa'),'dialPredictiveOptimization',_0x029a('0xb'),_0x029a('0xc'),'dialOriginateCallerIdName',_0x029a('0xd'),'dialOriginateTimeout','dialQueueOptions','dialQueueTimeout',_0x029a('0xe'),_0x029a('0xf'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0x029a('0x10'),_0x029a('0x11'),_0x029a('0x12'),_0x029a('0x13'),'dialTimezone',_0x029a('0x14'),_0x029a('0x15'),_0x029a('0x16'),_0x029a('0x17'),_0x029a('0x18'),_0x029a('0x19'),_0x029a('0x1a'),'dialAMDTotalAnalysisTime',_0x029a('0x1b'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0x029a('0x1c'),'dialAMDMaximumWordLength',_0x029a('0x1d'),'dialRecallMeTimeout',_0x029a('0x1e'),_0x029a('0x1f'),'dialAgiAfterHangupAgent',_0x029a('0x20'),_0x029a('0x21'),_0x029a('0x22'),_0x029a('0x23'),_0x029a('0x24'),_0x029a('0x25'),_0x029a('0x26'),_0x029a('0x27'),_0x029a('0x28'),_0x029a('0x29'),'dialAbandonedMaxRetry',_0x029a('0x2a'),_0x029a('0x2b'),_0x029a('0x2c'),_0x029a('0x2d'),'dialAgentRejectRetryFrequency',_0x029a('0x2e'),_0x029a('0x2f'),_0x029a('0x30'),_0x029a('0x31'),_0x029a('0x32')],'include':[{'model':_0x029a('0x33'),'as':_0x029a('0x33'),'attributes':['id','name',_0x029a('0x34'),_0x029a('0x35')]},{'model':_0x029a('0x36'),'as':_0x029a('0x37'),'attributes':['id',_0x029a('0x3')]},{'model':'Trunk','as':_0x029a('0x38'),'attributes':['id','name',_0x029a('0x34'),_0x029a('0x35')]},{'model':_0x029a('0x39'),'as':_0x029a('0x39'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0x029a('0x3a'),'attributes':['id',_0x029a('0x3'),_0x029a('0x3b')]}]}]},'log':_0x029a('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index e950d4f..d22909b 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(_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 +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(_0x96df96,_0x1284e4){var _0x40054e=function(_0x597ade){while(--_0x597ade){_0x96df96['push'](_0x96df96['shift']());}};_0x40054e(++_0x1284e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 9ed40ae..a1e8351 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 _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 +var _0x6bc5=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x1e0dc1,_0x2792a3){var _0x25cc70=function(_0x2e0ad0){while(--_0x2e0ad0){_0x1e0dc1['push'](_0x1e0dc1['shift']());}};_0x25cc70(++_0x2792a3);}(_0x6bc5,0xbd));var _0x56bc=function(_0x1e3156,_0x2327a6){_0x1e3156=_0x1e3156-0x0;var _0x7e9e4=_0x6bc5[_0x1e3156];return _0x7e9e4;};'use strict';var client=require(_0x56bc('0x0'));exports[_0x56bc('0x1')]=function(_0x5dad67){return function(){return client[_0x56bc('0x2')](_0x56bc('0x3'),{'options':{'where':{'VoiceQueueId':_0x5dad67,'paused':!![]},'raw':!![]},'log':_0x56bc('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 85019fb..de78d29 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(_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 +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x1c38e4,_0xbbda1d){var _0x39dc71=function(_0x332737){while(--_0x332737){_0x1c38e4['push'](_0x1c38e4['shift']());}};_0x39dc71(++_0xbbda1d);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 10e89f2..e951e58 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 _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 +var _0x4550=['attended','../client','transfers','Request','result','transfererchannel','transferercalleridnum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','extension','blind','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','isexternal','origtransfererexten'];(function(_0xbe4a74,_0x314726){var _0x2b1b8c=function(_0x41d033){while(--_0x41d033){_0xbe4a74['push'](_0xbe4a74['shift']());}};_0x2b1b8c(++_0x314726);}(_0x4550,0x1b9));var _0x0455=function(_0x57deb0,_0xcfa42){_0x57deb0=_0x57deb0-0x0;var _0x21941a=_0x4550[_0x57deb0];return _0x21941a;};'use strict';var client=require(_0x0455('0x0'));exports[_0x0455('0x1')]={};exports['blindTransfer']=function(_0x3f73d4){return client[_0x0455('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x3f73d4[_0x0455('0x3')],'transfererchannel':_0x3f73d4[_0x0455('0x4')],'transferercalleridnum':_0x3f73d4[_0x0455('0x5')],'transferercalleridname':_0x3f73d4['transferercalleridname'],'transfererconnectedlinenum':_0x3f73d4['transfererconnectedlinenum'],'transfererconnectedlinename':_0x3f73d4[_0x0455('0x6')],'transfereraccountcode':_0x3f73d4[_0x0455('0x7')],'transferercontext':_0x3f73d4[_0x0455('0x8')],'transfererexten':_0x3f73d4[_0x0455('0x9')],'transfererlinkedid':_0x3f73d4[_0x0455('0xa')],'transfereechannel':_0x3f73d4['transfereechannel'],'transfereecalleridnum':_0x3f73d4['transfereecalleridnum'],'transfereecalleridname':_0x3f73d4[_0x0455('0xb')],'transfereeconnectedlinenum':_0x3f73d4[_0x0455('0xc')],'transfereeconnectedlinename':_0x3f73d4[_0x0455('0xd')],'transfereeaccountcode':_0x3f73d4[_0x0455('0xe')],'transfereecontext':_0x3f73d4['transfereecontext'],'transfereeexten':_0x3f73d4[_0x0455('0xf')],'transfereelinkedid':_0x3f73d4[_0x0455('0x10')],'isexternal':_0x3f73d4['isexternal'],'context':_0x3f73d4['context'],'extension':_0x3f73d4[_0x0455('0x11')],'type':_0x0455('0x12')},'log':_0x0455('0x13')});};exports[_0x0455('0x14')]=function(_0x393c4d){return client[_0x0455('0x2')](_0x0455('0x13'),{'body':{'result':_0x393c4d[_0x0455('0x3')],'transfererchannel':_0x393c4d[_0x0455('0x15')],'transferercalleridnum':_0x393c4d[_0x0455('0x16')],'transferercalleridname':_0x393c4d[_0x0455('0x17')],'transfererconnectedlinenum':_0x393c4d[_0x0455('0x18')],'transfererconnectedlinename':_0x393c4d[_0x0455('0x19')],'transfereraccountcode':_0x393c4d[_0x0455('0x1a')],'transferercontext':_0x393c4d[_0x0455('0x1b')],'transfererexten':_0x393c4d[_0x0455('0x1c')],'transfererlinkedid':_0x393c4d[_0x0455('0x1d')],'transfereechannel':_0x393c4d[_0x0455('0x1e')],'transfereecalleridnum':_0x393c4d[_0x0455('0x1f')],'transfereecalleridname':_0x393c4d[_0x0455('0x20')],'transfereeconnectedlinenum':_0x393c4d[_0x0455('0x21')],'transfereeconnectedlinename':_0x393c4d['transfertargetconnectedlinename'],'transfereeaccountcode':_0x393c4d[_0x0455('0x22')],'transfereecontext':_0x393c4d[_0x0455('0x23')],'transfereeexten':_0x393c4d['transfertargetexten'],'transfereelinkedid':_0x393c4d[_0x0455('0x24')],'isexternal':_0x393c4d[_0x0455('0x25')],'context':_0x393c4d['origtransferercontext'],'extension':_0x393c4d[_0x0455('0x26')],'type':_0x0455('0x27')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 856bcbc..57e4107 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 _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 +var _0x6b8f=['validate','../properties','../ami','listen','format','SIP','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','ami\x20disconnected','pick','keys','reload','module','action','then','message','catch','username','join','command','Action','content','voiceQueues','hasOwnProperty','find','omit','undefined','values','length','isConnected','voicechannel','channels','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','resolve','destinationchannel','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','type','inbound','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','rows','voicequeuechannel','map','Hangup','voicequeuechannelredirect','Redirect','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util'];(function(_0x434080,_0x3bfe3b){var _0x4c4f6a=function(_0x15a668){while(--_0x15a668){_0x434080['push'](_0x434080['shift']());}};_0x4c4f6a(++_0x3bfe3b);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x39f7c8,_0x227602){_0x39f7c8=_0x39f7c8-0x0;var _0x22de4e=_0x6b8f[_0x39f7c8];return _0x22de4e;};'use strict';var _=require('lodash');var util=require(_0xf6b8('0x0'));var jayson=require('jayson/promise');var schema=require(_0xf6b8('0x1'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0xf6b8('0x2'));var ami=require(_0xf6b8('0x3'));var VoiceQueueSummary=require('../model/voiceQueueSummary');exports[_0xf6b8('0x4')]=function(_0xf25536,_0x347a0b,_0x549eac){return new Promise(function(_0x2d035e,_0x79c66d){var _0x446336={'QueuePause':function(_0x3c3430){return new Promise(function(_0x557910){var _0x5f07f4=util[_0xf6b8('0x5')]('%s/%s',_0xf6b8('0x6'),_0x3c3430[_0xf6b8('0x7')]);if(_0xf25536[_0xf6b8('0x8')]&&_0xf25536[_0xf6b8('0x8')][_0x5f07f4]&&_0xf25536[_0xf6b8('0x8')][_0x5f07f4][_0xf6b8('0x9')]){_0xf25536['timers'][_0x5f07f4]['updateAcw']();}if(_0xf25536['agents'][_0x5f07f4]){_0xf25536[_0xf6b8('0xa')][_0x5f07f4][_0xf6b8('0xb')]({'statePause':_0x3c3430[_0xf6b8('0xc')]?!![]:![]});}_0x557910({'code':0xc8,'message':_0xf6b8('0xd')});});},'Reload':function(_0x5a6118){var _0x4e5235=this;return new Promise(function(_0x748e77,_0x3899a9){if(ami['isConnected']()==![]){return _0x3899a9(_0x4e5235[_0xf6b8('0xe')](0x1f4,[config[_0xf6b8('0xf')]['ip'],config[_0xf6b8('0xf')]['username'],_0xf6b8('0x10')]['join']('\x20')));}_0x5a6118=_[_0xf6b8('0x11')](_0x5a6118,_[_0xf6b8('0x12')](properties[_0xf6b8('0x13')][_0xf6b8('0x14')]));_0x5a6118[_0xf6b8('0x15')]='Reload';return ami['Action'](_0x5a6118)[_0xf6b8('0x16')](function(_0x56508b){_0x748e77({'code':0xc8,'message':_0x56508b[_0xf6b8('0x17')]});})[_0xf6b8('0x18')](function(_0x4a93a8){_0x3899a9(_0x4e5235['error'](0x1f5,_0x4a93a8[_0xf6b8('0x17')]));});});},'Command':function(_0x2e2b29){var _0x3081db=this;return new Promise(function(_0x2cac60,_0x4df5f4){if(ami['isConnected']()==![]){return _0x4df5f4(_0x3081db['error'](0x1f4,[config[_0xf6b8('0xf')]['ip'],config[_0xf6b8('0xf')][_0xf6b8('0x19')],'ami\x20disconnected'][_0xf6b8('0x1a')]('\x20')));}_0x2e2b29=_[_0xf6b8('0x11')](_0x2e2b29,_0xf6b8('0x1b'));_0x2e2b29[_0xf6b8('0x15')]='Command';return ami[_0xf6b8('0x1c')](_0x2e2b29)['then'](function(_0x22c52d){_0x2cac60({'code':0xc8,'message':_0x22c52d[_0xf6b8('0x1d')]});})[_0xf6b8('0x18')](function(_0x4127c9){_0x4df5f4(_0x3081db[_0xf6b8('0xe')](0x1f5,_0x4127c9[_0xf6b8('0x17')]));});});},'VoiceQueues':function(){return new Promise(function(_0x4edd29){var _0x1aca8a=[];for(var _0x1ebfea in _0xf25536['voiceQueues']){if(_0xf25536[_0xf6b8('0x1e')][_0xf6b8('0x1f')](_0x1ebfea)){var _0x324057=_0xf25536[_0xf6b8('0x1e')][_0x1ebfea];var _0x3365b8=new VoiceQueueSummary(_0x324057);_0x1aca8a['push'](_0x3365b8);}}_0x4edd29({'count':_0x1aca8a['length'],'rows':_0x1aca8a});});},'UpdateVoiceQueue':function(_0xfa77d3){return new Promise(function(_0x9050c6,_0x5a9514){var _0x459ed0=_[_0xf6b8('0x20')](_0xf25536[_0xf6b8('0x1e')],{'id':parseInt(_0xfa77d3['id'])});var _0x5a7f55=_[_0xf6b8('0x21')](_0xfa77d3,['id']);if(_0x459ed0){for(var _0xc958f4 in _0x5a7f55){if(typeof _0x5a7f55[_0xc958f4]!=='undefined'&&typeof _0x459ed0[_0xc958f4]!==_0xf6b8('0x22')){_0x459ed0[_0xc958f4]=_0x5a7f55[_0xc958f4];}}_0x9050c6(_0x459ed0);}else{_0x5a9514();}});},'VoiceChannels':function(){return new Promise(function(_0xfdf601){var _0x324eeb=_[_0xf6b8('0x23')](_0xf25536['channels']);_0xfdf601({'count':_0x324eeb[_0xf6b8('0x24')],'rows':_0x324eeb});});},'VoiceChannelMixMonitor':function(_0xd984c0){var _0x4006a6=this;return new Promise(function(_0x48b07f,_0x7c7546){if(ami[_0xf6b8('0x25')]()==![]){return _0x7c7546(_0x4006a6[_0xf6b8('0xe')](0x1f4,[config['asterisk']['ip'],config[_0xf6b8('0xf')][_0xf6b8('0x19')],_0xf6b8('0x10')][_0xf6b8('0x1a')]('\x20')));}var _0x4be3cb=schema(properties[_0xf6b8('0x26')])[_0xf6b8('0x1')](_0xd984c0);if(_0x4be3cb[_0xf6b8('0x24')]>0x0){return _0x7c7546(_0x4006a6['error'](0x1f4,_['map'](_0x4be3cb,_0xf6b8('0x17'))[_0xf6b8('0x1a')](',\x20')));}var _0x258e69=_[_0xf6b8('0x20')](_0xf25536[_0xf6b8('0x27')],{'uniqueid':_0xd984c0[_0xf6b8('0x28')]});if(_0x258e69&&_0x258e69[_0xf6b8('0x29')]){var _0x7aaa3c=util[_0xf6b8('0x5')](_0xf6b8('0x2a'),_0xd984c0[_0xf6b8('0x2b')]||_0xd984c0[_0xf6b8('0x28')],_0xd984c0[_0xf6b8('0x5')]||_0xf6b8('0x2c'));return ami[_0xf6b8('0x1c')]({'action':_0xf6b8('0x2d'),'channel':_0x258e69[_0xf6b8('0x29')],'file':_0x7aaa3c,'options':_0xf6b8('0x2e')})['then'](function(_0x54a675){var _0x2b1e36=_[_0xf6b8('0x20')](_0x258e69[_0xf6b8('0x2f')],{'filename':_0xf6b8('0x30')+_0x7aaa3c[_0xf6b8('0x31')]()});if(_[_0xf6b8('0x32')](_0x2b1e36)){_0x258e69[_0xf6b8('0x2f')][_0xf6b8('0x33')]({'filename':_0xf6b8('0x30')+_0x7aaa3c[_0xf6b8('0x31')](),'createdAt':moment()[_0xf6b8('0x5')](_0xf6b8('0x34')),'mixmonitorid':_0x54a675['mixmonitorid'],'status':_0xf6b8('0x35')});}else{_0x2b1e36[_0xf6b8('0x36')]=_0x54a675['mixmonitorid'];_0x2b1e36[_0xf6b8('0x37')]=_0xf6b8('0x35');}_0x48b07f({'code':0xc8,'message':[_0xd984c0[_0xf6b8('0x28')],_0xf6b8('0x38'),_0x54a675[_0xf6b8('0x36')]][_0xf6b8('0x1a')]('\x20'),'mixmonitorid':_0x54a675[_0xf6b8('0x36')]});})[_0xf6b8('0x18')](function(_0x1c42fe){_0x7c7546(_0x4006a6[_0xf6b8('0xe')](0x1f5,[_0xd984c0[_0xf6b8('0x28')],_0x1c42fe[_0xf6b8('0x17')][_0xf6b8('0x31')]()][_0xf6b8('0x1a')]('\x20')));});}else{return _0x7c7546(_0x4006a6['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x5f42c2){var _0x3bb212=this;return new Promise(function(_0x2c68f5,_0x45daea){if(ami[_0xf6b8('0x25')]()==![]){return _0x45daea(_0x3bb212[_0xf6b8('0xe')](0x1f4,[config[_0xf6b8('0xf')]['ip'],config[_0xf6b8('0xf')]['username'],_0xf6b8('0x10')]['join']('\x20')));}var _0x2040fb=schema(properties[_0xf6b8('0x26')])[_0xf6b8('0x1')](_0x5f42c2);if(_0x2040fb[_0xf6b8('0x24')]>0x0){return _0x45daea(_0x3bb212[_0xf6b8('0xe')](0x1f4,_['map'](_0x2040fb,_0xf6b8('0x17'))[_0xf6b8('0x1a')](',\x20')));}var _0x126850=_[_0xf6b8('0x20')](_0xf25536[_0xf6b8('0x27')],{'uniqueid':_0x5f42c2['uniqueid']});if(_0x126850){return Promise[_0xf6b8('0x39')]()[_0xf6b8('0x16')](function(){if(_0x126850[_0xf6b8('0x29')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x126850[_0xf6b8('0x29')],'mixmonitorid':_0x5f42c2[_0xf6b8('0x36')]})[_0xf6b8('0x18')](function(){});}})[_0xf6b8('0x16')](function(){if(_0x126850['destinationchannel']){return ami['Action']({'action':'StopMixMonitor','channel':_0x126850[_0xf6b8('0x3a')],'mixmonitorid':_0x5f42c2['mixmonitorid']})[_0xf6b8('0x18')](function(){});}})[_0xf6b8('0x16')](function(){var _0x12f582=_[_0xf6b8('0x20')](_0x126850[_0xf6b8('0x2f')],{'mixmonitorid':_0x5f42c2[_0xf6b8('0x36')]});if(_0x12f582){_0x12f582[_0xf6b8('0x37')]=_0xf6b8('0x3b');}})[_0xf6b8('0x16')](function(){var _0x597511=util[_0xf6b8('0x5')]('%s.%s',_0x5f42c2[_0xf6b8('0x2b')]||_0x5f42c2[_0xf6b8('0x28')],_0x5f42c2[_0xf6b8('0x5')]||_0xf6b8('0x2c'));var _0x1abf17=_[_0xf6b8('0x20')](_0x126850[_0xf6b8('0x2f')],{'filename':'/var/spool/asterisk/monitor/'+_0x597511[_0xf6b8('0x31')]()});if(_0x1abf17){_0x1abf17[_0xf6b8('0x37')]=_0xf6b8('0x3b');}})[_0xf6b8('0x16')](function(){_0x2c68f5({'code':0xc8,'message':[_0x5f42c2['uniqueid'],_0xf6b8('0x3c')][_0xf6b8('0x1a')]('\x20')});})['catch'](function(_0x3a38eb){_0x45daea(_0x3bb212[_0xf6b8('0xe')](0x1f5,[_0x5f42c2[_0xf6b8('0x28')],_0x3a38eb[_0xf6b8('0x17')][_0xf6b8('0x31')]()]['join']('\x20')));});}else{return _0x45daea(_0x3bb212[_0xf6b8('0xe')](0x1f5,_0xf6b8('0x3d')));}});},'VoiceQueuesChannels':function(_0x5754eb){var _0x497b26=this;return new Promise(function(_0x55c392){var _0x22c1eb=_[_0xf6b8('0x23')](_0xf25536[_0xf6b8('0x3e')]);var _0xc20eee={'count':_0x22c1eb['length'],'rows':_0x22c1eb};if(_0x5754eb&&_0x5754eb[_0xf6b8('0x3f')]){if(![_0xf6b8('0x40'),_0xf6b8('0x41')][_0xf6b8('0x42')](_0x5754eb[_0xf6b8('0x3f')])){return _0x79c66d(_0x497b26[_0xf6b8('0xe')](0x190,_0xf6b8('0x43')));}var _0x4e4c90=_['filter'](_0x22c1eb,function(_0x4b81a0){return _0x4b81a0[_0xf6b8('0x3f')]===_0x5754eb['type'];});_0xc20eee['count']=_0x4e4c90[_0xf6b8('0x24')];_0xc20eee[_0xf6b8('0x44')]=_0x4e4c90;}_0x55c392(_0xc20eee);});},'VoiceQueuesChannel':function(_0x15965a){var _0x25cf3d=this;return new Promise(function(_0x34ca51,_0x1190f3){var _0x4f78e0=schema(properties[_0xf6b8('0x45')])[_0xf6b8('0x1')](_0x15965a);if(_0x4f78e0[_0xf6b8('0x24')]>0x0){return _0x1190f3(_0x25cf3d[_0xf6b8('0xe')](0x1f4,_['map'](_0x4f78e0,_0xf6b8('0x17'))[_0xf6b8('0x1a')](',\x20')));}var _0x5c27b1=_[_0xf6b8('0x20')](_0xf25536[_0xf6b8('0x3e')],{'uniqueid':_0x15965a[_0xf6b8('0x28')]});if(_0x5c27b1){_0x34ca51(_0x5c27b1);}else{return _0x1190f3(_0x25cf3d['error'](0x1f5,_0xf6b8('0x3d')));}});},'VoiceQueuesChannelHangup':function(_0x38720f){var _0x3e8213=this;return new Promise(function(_0x8c5d73,_0x37db90){if(ami[_0xf6b8('0x25')]()==![]){return _0x37db90(_0x3e8213[_0xf6b8('0xe')](0x1f4,[config[_0xf6b8('0xf')]['ip'],config[_0xf6b8('0xf')][_0xf6b8('0x19')],_0xf6b8('0x10')][_0xf6b8('0x1a')]('\x20')));}var _0x5d124b=schema(properties['voicequeuechannelhangup'])['validate'](_0x38720f);if(_0x5d124b[_0xf6b8('0x24')]>0x0){return _0x37db90(_0x3e8213[_0xf6b8('0xe')](0x1f4,_[_0xf6b8('0x46')](_0x5d124b,_0xf6b8('0x17'))['join'](',\x20')));}var _0x1b7c82=_[_0xf6b8('0x20')](_0xf25536[_0xf6b8('0x3e')],{'uniqueid':_0x38720f['uniqueid']});if(_0x1b7c82&&_0x1b7c82[_0xf6b8('0x29')]){return ami[_0xf6b8('0x1c')]({'action':_0xf6b8('0x47'),'channel':_0x1b7c82['channel']})['then'](function(_0x9105bb){_0x8c5d73({'code':0xc8,'message':[_0x38720f[_0xf6b8('0x28')],_0x9105bb[_0xf6b8('0x17')][_0xf6b8('0x31')]()]['join']('\x20')});})[_0xf6b8('0x18')](function(_0x5ebf65){_0x37db90(_0x3e8213[_0xf6b8('0xe')](0x1f5,[_0x38720f[_0xf6b8('0x28')],_0x5ebf65[_0xf6b8('0x17')][_0xf6b8('0x31')]()][_0xf6b8('0x1a')]('\x20')));});}else{return _0x37db90(_0x3e8213['error'](0x1f5,_0xf6b8('0x3d')));}});},'VoiceQueuesChannelRedirect':function(_0x1f869b){var _0x227f5e=this;return new Promise(function(_0x28e1d7,_0x1980de){if(ami[_0xf6b8('0x25')]()==![]){return _0x1980de(_0x227f5e[_0xf6b8('0xe')](0x1f4,[config[_0xf6b8('0xf')]['ip'],config[_0xf6b8('0xf')][_0xf6b8('0x19')],'ami\x20disconnected'][_0xf6b8('0x1a')]('\x20')));}var _0x135ce3=schema(properties[_0xf6b8('0x48')])['validate'](_0x1f869b);if(_0x135ce3[_0xf6b8('0x24')]>0x0){return _0x1980de(_0x227f5e['error'](0x1f4,_[_0xf6b8('0x46')](_0x135ce3,'message')['join'](',\x20')));}var _0x3c4e8a=_[_0xf6b8('0x20')](_0xf25536[_0xf6b8('0x3e')],{'uniqueid':_0x1f869b[_0xf6b8('0x28')]});if(_0x3c4e8a&&_0x3c4e8a[_0xf6b8('0x29')]){return ami['Action']({'action':_0xf6b8('0x49'),'channel':_0x3c4e8a[_0xf6b8('0x29')],'exten':_0x1f869b['exten'],'context':_0x1f869b['context']||_0x3c4e8a[_0xf6b8('0x4a')],'priority':0x1})[_0xf6b8('0x16')](function(_0xdb1c77){_0x28e1d7({'code':0xc8,'message':[_0x1f869b[_0xf6b8('0x28')],_0xdb1c77[_0xf6b8('0x17')]['toLowerCase']()]['join']('\x20')});})[_0xf6b8('0x18')](function(_0x2d86fc){_0x1980de(_0x227f5e[_0xf6b8('0xe')](0x1f5,[_0x1f869b[_0xf6b8('0x28')],_0x2d86fc['message'][_0xf6b8('0x31')]()][_0xf6b8('0x1a')]('\x20')));});}else{return _0x1980de(_0x227f5e[_0xf6b8('0xe')](0x1f5,_0xf6b8('0x3d')));}});},'Agents':function(_0x3b06c8){return new Promise(function(_0x2e43a1){var _0x7a8ae6=_['values'](_0xf25536['agents']);if(_0x3b06c8&&_0x3b06c8['id']){var _0x2d32bb=_[_0xf6b8('0x20')](_0x7a8ae6,function(_0x3f3969){return _0x3f3969['id']===_0x3b06c8['id'];});_0x2e43a1(_0x2d32bb);}else{_0x2e43a1({'count':_0x7a8ae6[_0xf6b8('0x24')],'rows':_0x7a8ae6});}});},'Telephones':function(){return new Promise(function(_0x4707ff){var _0x19c149=_[_0xf6b8('0x23')](_0xf25536[_0xf6b8('0x4b')]);_0x4707ff({'count':_0x19c149['length'],'rows':_0x19c149});});},'Trunks':function(){return new Promise(function(_0x2d3bae){var _0x213a14=_[_0xf6b8('0x23')](_0xf25536[_0xf6b8('0x4c')]);_0x2d3bae({'count':_0x213a14[_0xf6b8('0x24')],'rows':_0x213a14});});},'OutboundChannels':function(){return new Promise(function(_0x55f2ae){var _0x3af46c=_['values'](_0xf25536[_0xf6b8('0x4d')]);_0x55f2ae({'count':_0x3af46c[_0xf6b8('0x24')],'rows':_0x3af46c});});},'Outbound':function(){return new Promise(function(_0x2d6261){_0x2d6261(_0xf25536[_0xf6b8('0x41')]);});},'Campaigns':function(){return new Promise(function(_0x141d6a){var _0x4492f6=_['values'](_0xf25536[_0xf6b8('0x4e')]);_0x141d6a({'count':_0x4492f6[_0xf6b8('0x24')],'rows':_0x4492f6});});},'VoiceQueuesPreview':function(_0x1c6692){var _0x3d76ee=this;return new Promise(function(_0x396a7c,_0x3d6e09){_0x347a0b[_0xf6b8('0x4f')](_0x1c6692['id'])['then'](function(_0x288449){_0x396a7c({'code':0xc8,'message':_0x288449[_0xf6b8('0x17')]});})['catch'](function(_0x286e8d){_0x3d6e09(_0x3d76ee[_0xf6b8('0xe')](0x1f4,_0x286e8d[_0xf6b8('0x17')]));});});},'EventManager':function(_0x288b94){var _0x57fcdb=this;return new Promise(function(_0x23ef5e,_0x452de0){if(!_0x288b94[_0xf6b8('0x50')]){return _0x452de0(_0x57fcdb['error'](0x1f4,_0xf6b8('0x51')));}ami['emit']('custom:'+_0x288b94[_0xf6b8('0x50')],_0x288b94[_0xf6b8('0x17')]);_0x23ef5e({'code':0xc8,'message':_0x288b94});});},'FaxAccounts':function(){return new Promise(function(_0x36a84c){var _0x2b1c7d=_[_0xf6b8('0x23')](_0xf25536[_0xf6b8('0x52')]);_0x36a84c({'count':_0x2b1c7d[_0xf6b8('0x24')],'rows':_0x2b1c7d});});},'SendFax':function(_0x2e66bf){var _0x3292d3=this;return new Promise(function(_0x18949a,_0xa03ad3){_0x549eac[_0xf6b8('0x53')](_0x2e66bf)[_0xf6b8('0x16')](function(_0x4684b2){_0x18949a({'code':0xc8,'message':_0x4684b2[_0xf6b8('0x17')]});})['catch'](function(_0x4d9845){_0xa03ad3(_0x3292d3[_0xf6b8('0xe')](0x1f4,_0x4d9845[_0xf6b8('0x17')]));});});},'CheckAfterSend':function(_0x5b113b){var _0x171db9=this;return new Promise(function(_0x1b4dee,_0x3b4df4){_0x549eac[_0xf6b8('0x54')](_0x5b113b)['then'](function(_0x3cd8fc){_0x1b4dee({'code':0xc8,'message':_0x3cd8fc[_0xf6b8('0x17')]});})[_0xf6b8('0x18')](function(_0x48829d){_0x3b4df4(_0x171db9['error'](0x1f4,_0x48829d['message']));});});}};var _0x3e174b=jayson[_0xf6b8('0x55')](_0x446336)['http']();_0x3e174b['on'](_0xf6b8('0xe'),function(_0x51800b){return _0x79c66d(_0x51800b);});_0x3e174b[_0xf6b8('0x4')](0x232a,_0xf6b8('0x56'),function(){console['log'](_0xf6b8('0x57'),0x232a);return _0x2d035e(_0xf6b8('0x58')+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 2620360..7638e64 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 _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 +var _0xf53b=['map','destcalleridnum','calleridnum','firstName','lastName','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','phone','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','routeId','calleridname','','destcalleridname','Unknown','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','format','name','action','merge','lodash','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','info','[CM][%s][%s]','emit','exec','data2','data5','xmd-contactid','ListId','data3'];(function(_0x1a870b,_0x47da55){var _0x2f883e=function(_0x3be2ca){while(--_0x3be2ca){_0x1a870b['push'](_0x1a870b['shift']());}};_0x2f883e(++_0x47da55);}(_0xf53b,0x12d));var _0xbf53=function(_0x223fce,_0x5292fe){_0x223fce=_0x223fce-0x0;var _0x4ab12c=_0xf53b[_0x223fce];return _0x4ab12c;};'use strict';var _=require(_0xbf53('0x0'));var BPromise=require('bluebird');var Redis=require(_0xbf53('0x1'));var util=require('util');var config=require(_0xbf53('0x2'));var logger=require(_0xbf53('0x3'))(_0xbf53('0x4'));var cmContactRpc=require(_0xbf53('0x5'));config[_0xbf53('0x6')]=_['defaults'](config['redis'],{'host':_0xbf53('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x1912f4,_0x337abb,_0x1ebb66,_0x21b755,_0x14a255){logger[_0xbf53('0x8')](_0xbf53('0x9'),_0x1912f4,_0x337abb['id'],_0x1ebb66,_0x21b755,JSON['stringify'](_0x14a255));io['to'](_0x1ebb66)[_0xbf53('0xa')](_0x21b755,_0x14a255);}exports[_0xbf53('0xb')]=function(_0x1ea610,_0x235459,_0x231171,_0x3e318f){var _0x169806,_0x394214;var _0x831e26={};var _0xbbb4f6;var _0x1d18b8=Number(_0x231171['data1']);var _0x2668d0=_0x231171['data2']?Boolean(Number(_0x231171[_0xbf53('0xc')])):![];var _0x1653e9;var _0x1bab6a=![];if(!_['isNil'](_0x231171[_0xbf53('0xd')])){if(_0x231171['data5']=='1')_0x1bab6a=!![];}if(!_0x1bab6a){if(_0x3e318f[_0xbf53('0xe')]){_0x831e26['id']=_0x3e318f[_0xbf53('0xe')];}}if(!_0x831e26['id']){_0x831e26[_0xbf53('0xf')]=_0x1d18b8;_0x1653e9=_0x231171[_0xbf53('0x10')]&&_0x231171[_0xbf53('0x10')]!=='0'?_0x231171[_0xbf53('0x10')]['split'](','):['phone'];_0x831e26['$or']=_[_0xbf53('0x11')](_0x1653e9,function(_0x4af86f){var _0x2ca94c={};_0x2ca94c[_0x4af86f]=_0x3e318f['routeId']?_0x3e318f[_0xbf53('0x12')]:_0x3e318f[_0xbf53('0x13')];return _0x2ca94c;});_0xbbb4f6=_0x3e318f['routeId']?_0x3e318f[_0xbf53('0x12')]:_0x3e318f[_0xbf53('0x13')];}var _0x16a8cc=['id',_0xbf53('0x14'),_0xbf53('0x15'),'phone','mobile',_0xbf53('0x16'),_0xbf53('0xf'),_0xbf53('0x17'),_0xbf53('0x18'),_0xbf53('0x19')];var _0x8c66fc=_[_0xbf53('0x1a')](_0x16a8cc,_0x1653e9);BPromise[_0xbf53('0x1b')]()[_0xbf53('0x1c')](cmContactRpc['getContacts']({'attributes':_0x8c66fc,'where':_0x831e26,'phone':_0xbbb4f6}))['then'](function(_0x330885){_0x394214=_0x330885;if(!_[_0xbf53('0x1d')](_0x394214)){if(_0x394214[_0xbf53('0x1e')]===0x1){_0x169806=_0x394214[0x0];logger['info'](_0xbf53('0x1f'),_0x3e318f[_0xbf53('0x20')],_0x235459['id'],_0x169806['id']);}else{logger[_0xbf53('0x8')](_0xbf53('0x21'),_0x3e318f[_0xbf53('0x20')],_0x235459['id'],_[_0xbf53('0x11')](_0x394214,'id')[_0xbf53('0x22')](','));}return;}else{logger[_0xbf53('0x8')](_0xbf53('0x23'),_0x3e318f['uniqueid'],_0x235459['id']);var _0x1fec03={'ListId':_0x1d18b8};var _0x8eacf2=_0x231171[_0xbf53('0x24')]&&_0x231171[_0xbf53('0x24')]!=='0'?_0x231171[_0xbf53('0x24')]:_0xbf53('0x25');if(_0x2668d0){logger[_0xbf53('0x8')](_0xbf53('0x26'),_0x3e318f[_0xbf53('0x20')],_0x235459['id']);_0x1fec03[_0x8eacf2]=_[_0xbf53('0x27')](_0x3e318f[_0xbf53('0x28')])?_0x3e318f[_0xbf53('0x13')]:_0x3e318f['destcalleridnum'];if(_['isNil'](_0x3e318f[_0xbf53('0x28')])){_0x1fec03[_0xbf53('0x14')]=_0x3e318f[_0xbf53('0x29')]&&_0x3e318f[_0xbf53('0x29')]!==_0xbf53('0x2a')?_0x3e318f[_0xbf53('0x29')]:'Unknown';}else{_0x1fec03[_0xbf53('0x14')]=_0x3e318f[_0xbf53('0x2b')]&&_0x3e318f['destcalleridname']!==_0xbf53('0x2a')?_0x3e318f[_0xbf53('0x2b')]:_0xbf53('0x2c');}return BPromise[_0xbf53('0x1b')]()[_0xbf53('0x1c')](cmContactRpc[_0xbf53('0x2d')](_0x1fec03))[_0xbf53('0x1c')](function(_0xe6a535){_0x169806=_0xe6a535;_0x394214['push'](_0xe6a535);if(_0x169806){logger[_0xbf53('0x8')](_0xbf53('0x2e'),_0x3e318f[_0xbf53('0x20')],_0x235459['id'],_0x169806['id']);}return;});}else{logger[_0xbf53('0x8')](_0xbf53('0x2f'),_0x3e318f[_0xbf53('0x20')],_0x235459['id']);_0x1fec03[_0x8eacf2]=_['isNil'](_0x3e318f[_0xbf53('0x28')])?_0x3e318f[_0xbf53('0x13')]:_0x3e318f[_0xbf53('0x12')];if(_[_0xbf53('0x27')](_0x3e318f[_0xbf53('0x28')])){_0x1fec03[_0xbf53('0x14')]=_0x3e318f[_0xbf53('0x29')]&&_0x3e318f[_0xbf53('0x29')]!==''?_0x3e318f['calleridname']:_0xbf53('0x2c');}else{_0x1fec03['firstName']=_0x3e318f[_0xbf53('0x2b')]&&_0x3e318f[_0xbf53('0x2b')]!==_0xbf53('0x2a')?_0x3e318f[_0xbf53('0x2b')]:_0xbf53('0x2c');}_0x169806=_0x1fec03;_0x394214[_0xbf53('0x30')](_0x1fec03);return;}}})['then'](function(){if(_0x1ea610){emit(_0x3e318f['uniqueid'],_0x235459,util[_0xbf53('0x31')]('user:%s',_0x1ea610[_0xbf53('0x32')]),util[_0xbf53('0x31')]('trigger:%s',_0x231171[_0xbf53('0x33')]['toLowerCase']()),{'evt':_[_0xbf53('0x34')](_0x3e318f,{'autoCreate':_0x2668d0}),'contact':_0x169806===undefined?{}:_0x169806,'contacts':_0x394214[_0xbf53('0x1e')]===0x0?undefined:_0x394214});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 6f151f7..4a4319f 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 _0x15a4=['url','mustache','ioredis','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','accounts','zohoAccounts','custom:agentcalled','custom:agentconnect','syncCustomEvent','bind','custom:agentcomplete','custom:agentnoanswer','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','prototype','emit','clone','undefined','motionChannel','voice','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','length','Actions','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','buildUri','data3','isNil','data4','location','uriLocation','800','data5','windowHeight','data6','600','winApplication','winArguments','format','user:%s','jscripty','name','trigger:%s','exec','integration','queue','voiceExtensions','routeId','urlforward','parse','query','channel','AllConditions','every','checkConditions','AnyConditions','some','field','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','mailSubstatus','null','substatus','created','exports','util','lodash'];(function(_0x25510d,_0x27644d){var _0x59dc8b=function(_0x326bc5){while(--_0x326bc5){_0x25510d['push'](_0x25510d['shift']());}};_0x59dc8b(++_0x27644d);}(_0x15a4,0x178));var _0x415a=function(_0x23de6d,_0xb9088e){_0x23de6d=_0x23de6d-0x0;var _0x2231cf=_0x15a4[_0x23de6d];return _0x2231cf;};'use strict';var util=require(_0x415a('0x0'));var _=require(_0x415a('0x1'));var url=require(_0x415a('0x2'));var Mustache=require(_0x415a('0x3'));var Redis=require(_0x415a('0x4'));var urlforward=require('./urlforward');var integration=require(_0x415a('0x5'));var cmContact=require(_0x415a('0x6'));var script=require(_0x415a('0x7'));var config=require(_0x415a('0x8'));var logger=require(_0x415a('0x9'))(_0x415a('0xa'));var ami=require(_0x415a('0xb'));config[_0x415a('0xc')]=_[_0x415a('0xd')](config[_0x415a('0xc')],{'host':_0x415a('0xe'),'port':0x18eb});var io=require(_0x415a('0xf'))(new Redis(config[_0x415a('0xc')]));var operators={'equals':function(_0x444297,_0x1bac6b){return _0x444297==_0x1bac6b;},'not_equals':function(_0x239cfc,_0xac8be0){return _0x239cfc!=_0xac8be0;}};var barAndWebActions=[_0x415a('0x10'),'url',_0x415a('0x11')];function Trigger(_0x296b08){this[_0x415a('0x12')]=_0x296b08['triggers'];this[_0x415a('0x13')]=_0x296b08[_0x415a('0x13')];this['voiceQueues']=_0x296b08[_0x415a('0x14')];this[_0x415a('0x15')]=_0x296b08['templates'];this['voiceExtensions']=_0x296b08['voiceExtensions'];this[_0x415a('0x16')]=_0x296b08[_0x415a('0x16')];this['freshdeskAccounts']=_0x296b08[_0x415a('0x17')];this[_0x415a('0x18')]=_0x296b08[_0x415a('0x18')];this['sugarcrmAccounts']=_0x296b08[_0x415a('0x19')];this['zohoAccounts']=_0x296b08['zohoAccounts'];this[_0x415a('0x1a')]=_0x296b08[_0x415a('0x1a')];this[_0x415a('0x1b')]=_0x296b08[_0x415a('0x1b')];this[_0x415a('0x1c')]=_0x296b08['servicenowAccounts'];this['dynamics365Accounts']=_0x296b08[_0x415a('0x1d')];this['freshsalesAccounts']=_0x296b08['freshsalesAccounts'];this[_0x415a('0x1e')]={'zendesk':this[_0x415a('0x16')],'salesforce':this[_0x415a('0x18')],'freshdesk':this[_0x415a('0x17')],'sugarcrm':this[_0x415a('0x19')],'zoho':this[_0x415a('0x1f')],'desk':this[_0x415a('0x1a')],'vtiger':this['vtigerAccounts'],'dynamics365':this['dynamics365Accounts'],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x415a('0x1c')]};ami['on'](_0x415a('0x20'),this['syncCustomEvent']['bind'](this));ami['on'](_0x415a('0x21'),this[_0x415a('0x22')][_0x415a('0x23')](this));ami['on']('custom:agentringnoanswer',this[_0x415a('0x22')][_0x415a('0x23')](this));ami['on'](_0x415a('0x24'),this[_0x415a('0x22')]['bind'](this));ami['on']('custom:agentnosuchnumber',this[_0x415a('0x22')][_0x415a('0x23')](this));ami['on'](_0x415a('0x25'),this[_0x415a('0x22')][_0x415a('0x23')](this));ami['on']('custom:agentbusy',this[_0x415a('0x22')][_0x415a('0x23')](this));ami['on'](_0x415a('0x26'),this[_0x415a('0x22')][_0x415a('0x23')](this));ami['on']('custom:agentreject',this[_0x415a('0x22')][_0x415a('0x23')](this));ami['on'](_0x415a('0x27'),this[_0x415a('0x22')]['bind'](this));ami['on'](_0x415a('0x28'),this['syncCustomEvent']['bind'](this));ami['on'](_0x415a('0x29'),this[_0x415a('0x22')]['bind'](this));ami['on']('custom:dialbegin',this[_0x415a('0x2a')][_0x415a('0x23')](this));ami['on'](_0x415a('0x2b'),this[_0x415a('0x2a')][_0x415a('0x23')](this));ami['on'](_0x415a('0x2c'),this[_0x415a('0x2a')][_0x415a('0x23')](this));ami['on'](_0x415a('0x2d'),this['syncCustomEvent'][_0x415a('0x23')](this));ami['on'](_0x415a('0x2e'),this[_0x415a('0x22')][_0x415a('0x23')](this));ami['on']('custom:substatus',this['syncCustomEvent']['bind'](this));ami['on'](_0x415a('0x2f'),this[_0x415a('0x22')][_0x415a('0x23')](this));ami['on'](_0x415a('0x30'),this[_0x415a('0x22')]['bind'](this));ami['on']('custom:acceptmessage',this[_0x415a('0x22')]['bind'](this));ami['on'](_0x415a('0x31'),this[_0x415a('0x22')][_0x415a('0x23')](this));ami['on']('custom:offlineMessage',this['syncCustomEvent'][_0x415a('0x23')](this));}Trigger[_0x415a('0x32')]['emit']=function(_0x54e4a7,_0x2b3165,_0x17ef6b){logger['info'](_0x54e4a7,_0x2b3165,JSON['stringify'](_0x17ef6b));io['to'](_0x54e4a7)[_0x415a('0x33')](_0x2b3165,_0x17ef6b);};Trigger[_0x415a('0x32')][_0x415a('0x22')]=function(_0x1a8db8){var _0x5bc3de=_[_0x415a('0x34')](_0x1a8db8);if(typeof _0x5bc3de['motionChannel']===_0x415a('0x35')){_0x5bc3de[_0x415a('0x36')]=_0x415a('0x37');}this[_0x415a('0x38')](_0x5bc3de);};Trigger['prototype']['syncAgentDial']=function(_0x5332a5){if(this[_0x415a('0x13')][_0x5332a5[_0x415a('0x39')]]){this[_0x415a('0x22')](_0x5332a5);}};Trigger['prototype'][_0x415a('0x38')]=function(_0x5f940d){var _0x29be9f;for(var _0x352fc2 in this['triggers']){if(this[_0x415a('0x12')][_0x415a('0x3a')](_0x352fc2)){if(this[_0x415a('0x12')][_0x352fc2][_0x415a('0x3b')]){_0x29be9f=this[_0x415a('0x3c')](this[_0x415a('0x12')][_0x352fc2],_0x5f940d);if(_0x29be9f){_[_0x415a('0x3d')](_0x5f940d,_0x5f940d[_0x415a('0x3e')]);for(var _0x4adafc=0x0,_0x3c4318,_0x2b98fa,_0x5599a7;_0x4adafc0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file +var _0xe14b=['CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','integrationTab','newTab','catch','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','validateEmail','format','%s/users','then','total_entries','find','_embedded','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','%s/customers','remoteUri','POST','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','custom_fields','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe14b,0x93));var _0xbe14=function(_0xe0965,_0x20ae6e){_0xe0965=_0xe0965-0x0;var _0x4f6e26=_0xe14b[_0xe0965];return _0x4f6e26;};'use strict';var _=require(_0xbe14('0x0'));var rp=require(_0xbe14('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xbe14('0x2'));var intUtil=require(_0xbe14('0x3'));var config=require('../../../../config/environment');var logger=require(_0xbe14('0x4'))('desk');config['redis']=_[_0xbe14('0x5')](config[_0xbe14('0x6')],{'host':_0xbe14('0x7'),'port':0x18eb});var io=require(_0xbe14('0x8'))(new Redis(config[_0xbe14('0x6')]));function emit(_0x39387e,_0x196fca,_0x566ae7){io['to'](_0x39387e)['emit'](_0x196fca,_0x566ae7);}var headers={'Content-Type':'application/json','Accept':_0xbe14('0x9')};function getUser(_0x6fceff,_0xd68cd7){if(intUtil[_0xbe14('0xa')](_0xd68cd7)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0xd68cd7);return request({'uri':util[_0xbe14('0xb')](_0xbe14('0xc'),_0x6fceff['remoteUri'])})[_0xbe14('0xd')](function(_0x35aa19){if(_0x35aa19[_0xbe14('0xe')]){return _[_0xbe14('0xf')](_0x35aa19[_0xbe14('0x10')][_0xbe14('0x11')],{'email':_0xd68cd7});}})[_0xbe14('0xd')](function(_0x2850cb){if(_0x2850cb){logger[_0xbe14('0x12')](_0xbe14('0x13'));return _0x2850cb;}else{logger[_0xbe14('0x12')](_0xbe14('0x14'));return request({'uri':util[_0xbe14('0xb')]('%s/users/me',_0x6fceff['remoteUri'])});}});}else{logger[_0xbe14('0x12')](_0xbe14('0x15'));return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x16'),_0x6fceff['remoteUri'])});}}function request(_0x21c789){logger[_0xbe14('0x17')](_0xbe14('0x18'),JSON[_0xbe14('0x19')](_0x21c789));return rp(_[_0xbe14('0x5')](_0x21c789,{'method':_0xbe14('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x17ae86){var _0x5ea1f8;if(_0x17ae86[_0xbe14('0x1b')]===_0xbe14('0x1c')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x1d'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x1f')]);}else if(_0x17ae86['authType']===_0xbe14('0x20')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x21'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x20')]);}return util['format'](_0xbe14('0x22'),new Buffer(_0x5ea1f8)['toString'](_0xbe14('0x23')));}function getEndUser(_0x56e80c,_0x32e8eb,_0x4a25fa){logger[_0xbe14('0x12')](_0xbe14('0x24'),_0x4a25fa);return request({'uri':util['format'](_0xbe14('0x25'),_0x56e80c['remoteUri']),'qs':{'phone':_0x4a25fa}})[_0xbe14('0xd')](function(_0x4851f8){if(_0x4851f8[_0xbe14('0xe')]){logger[_0xbe14('0x12')](_0xbe14('0x26'));return _0x4851f8[_0xbe14('0x10')][_0xbe14('0x11')][0x0];}else{logger[_0xbe14('0x12')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x27'),_0x56e80c[_0xbe14('0x28')]),'method':_0xbe14('0x29'),'body':{'first_name':_0x32e8eb,'title':_0x32e8eb,'phone_numbers':[{'type':'work','value':_0x4a25fa}]}});}});}function getTags(_0x16f884,_0x29fc64){var _0x59bf34=[];if(_0x16f884&&_0x16f884[_0xbe14('0x2a')]>0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ 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 d493e6f..2236991 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 _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 +var _0x60a5=['Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','none','[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','unmanaged','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','md5','ioredis','../../../../config/environment','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','tenantId','data5','POST','clientId','username','password','clientSecret','access_token','catch','error',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','isNil','internalemailaddress','email','isdisabled',']\x20Agent\x20found\x20','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','length','toLowerCase','outbound','calleridnum','/systemusers(','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','enduserId','destcalleridnum','telephone1','&$filter=','replace','contactid','info','toUpperCase','includes','string','picklist','customField','indexOf','content','ticketType','incident','assign','getString'];(function(_0x404b5a,_0x255e99){var _0x33bd94=function(_0x5517bb){while(--_0x5517bb){_0x404b5a['push'](_0x404b5a['shift']());}};_0x33bd94(++_0x255e99);}(_0x60a5,0x1b3));var _0x560a=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x60a5[_0x46aff0];return _0x9d78cf;};'use strict';var _=require('lodash');var rp=require(_0x560a('0x0'));var util=require(_0x560a('0x1'));var intUtil=require(_0x560a('0x2'));var md5=require(_0x560a('0x3'));var Redis=require(_0x560a('0x4'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0x560a('0x5'));config[_0x560a('0x6')]=_['defaults'](config[_0x560a('0x6')],{'host':_0x560a('0x7'),'port':0x18eb});var io=require(_0x560a('0x8'))(new Redis(config[_0x560a('0x6')]));function getAuthToken(_0x4a9b3d,_0x4e1a97,_0x29afb2){if(_0x4a9b3d[_0x560a('0x9')]){_0x4a9b3d[_0x560a('0xa')]=_0x4a9b3d[_0x560a('0xb')]['data7'];_0x4a9b3d[_0x560a('0xc')]=_0x4a9b3d[_0x560a('0xb')]['data2'];return Promise['resolve'](_0x4a9b3d[_0x560a('0xb')][_0x560a('0xd')]);}var _0x3a624d={'method':_0x560a('0xe'),'uri':_0x4e1a97,'form':{'client_id':_0x4a9b3d[_0x560a('0xf')],'resource':_0x4a9b3d[_0x560a('0xa')],'username':_0x4a9b3d[_0x560a('0x10')],'password':_0x4a9b3d[_0x560a('0x11')],'grant_type':_0x560a('0x11'),'client_secret':_0x4a9b3d[_0x560a('0x12')]},'json':!![]};return rp(_0x3a624d)['then'](function(_0x629575){return _0x629575[_0x560a('0x13')];})[_0x560a('0x14')](function(_0x21aa93){logger[_0x560a('0x15')]('['+[_0x29afb2['toUpperCase']()]+_0x560a('0x16'));return _0x21aa93[_0x560a('0x17')];});}function getUser(_0x2435da,_0xacbb48,_0x5d79e7,_0x8967f0,_0x1cce37,_0x55deae){return new Promise(function(_0x129291,_0x411a84){return getAuthToken(_0xacbb48,_0x8967f0,_0x55deae)[_0x560a('0x18')](function(_0x3c8085){var _0xf77f54={'method':_0x560a('0x19'),'uri':_0x1cce37+_0x560a('0x1a'),'headers':{'Authorization':'Bearer\x20'+_0x3c8085,'OData-Version':_0x560a('0x1b')},'json':!![]};return rp(_0xf77f54);})[_0x560a('0x18')](function(_0x2c3f60){var _0x257c34=_0x2c3f60['value'];var _0x4acda7=![];var _0x460729=null;if(!_[_0x560a('0x1c')](_0x5d79e7)){if(intUtil['validateEmail'](_0x5d79e7['email'])){_0x2435da['userEmail']=_0x5d79e7['email'];for(_0x460729=0x0;_0x460729<_0x257c34['length'];_0x460729++){if(_0x257c34[_0x460729][_0x560a('0x1d')]===_0x5d79e7[_0x560a('0x1e')]&&!_0x257c34[_0x460729][_0x560a('0x1f')]){_0x4acda7=!![];logger['info']('['+[_0x55deae['toUpperCase']()]+_0x560a('0x20')+_0x257c34[_0x460729]['systemuserid']+'!');_0x2435da[_0x560a('0x21')]=_0x257c34[_0x460729][_0x560a('0x22')];}}}}if(!_0x4acda7){logger['info']('['+[_0x55deae['toUpperCase']()]+_0x560a('0x23'));_0x2435da[_0x560a('0x24')]=_0xacbb48[_0x560a('0x10')];for(_0x460729=0x0;_0x460729<_0x257c34[_0x560a('0x25')];_0x460729++){if(_0x257c34[_0x460729][_0x560a('0x1d')]===_0xacbb48['username']){_0x2435da[_0x560a('0x21')]=_0x257c34[_0x460729]['systemuserid'];}}}_0x129291(_0x2435da);})[_0x560a('0x14')](function(_0x50fa87){_0x411a84(_0x50fa87[_0x560a('0x17')]);});});}function createEndUser(_0x20ad45,_0x33d6fa,_0x392183,_0xb7422,_0x3ce51f,_0x325388,_0x44fe49){return new Promise(function(_0x5033ec,_0xd8bf38){return getAuthToken(_0x33d6fa,_0x392183,_0x325388)[_0x560a('0x18')](function(_0x3c1c94){var _0x5e723a=_0x325388[_0x560a('0x26')]()===_0x560a('0x27')?_0x3ce51f['destcalleridnum']:_0x3ce51f[_0x560a('0x28')];var _0x2f6dc1={'method':_0x560a('0xe'),'uri':_0xb7422+'contacts','body':{'fullname':_0x5e723a,'firstname':_0x5e723a,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x560a('0x29')+_0x20ad45['userId']+')'},'headers':{'Authorization':_0x560a('0x2a')+_0x3c1c94,'OData-Version':_0x560a('0x1b')},'json':!![],'resolveWithFullResponse':!![]};_0x2f6dc1['body'][_0x44fe49]=_0x5e723a;return rp(_0x2f6dc1);})[_0x560a('0x18')](function(_0x5d04b4){var _0x23674b=_0x5d04b4[_0x560a('0x2b')][_0x560a('0x2c')];var _0x19275d=_0x23674b[_0x560a('0x2d')](_0x23674b[_0x560a('0x2e')]('(')+0x1,_0x23674b['lastIndexOf'](')'));_0x20ad45[_0x560a('0x2f')]=_0x19275d;_0x5033ec(_0x20ad45);})[_0x560a('0x14')](function(_0x4a8db3){_0xd8bf38(_0x4a8db3[_0x560a('0x17')]);});});}function getEndUser(_0x81a0b1,_0x1c3ea1,_0x258dbc,_0x1c560a,_0x18596e,_0x11ef5a,_0x3b9736,_0x53ca1d){var _0x2d0bc1=_0x11ef5a[_0x560a('0x26')]()==='outbound'?_0x18596e[_0x560a('0x30')]:_0x18596e[_0x560a('0x28')];return getAuthToken(_0x1c3ea1,_0x258dbc,_0x11ef5a)['then'](function(_0x266402){_0x53ca1d=_0x53ca1d?_0x53ca1d:_0x560a('0x31');var _0x56be81={'method':'GET','uri':_0x1c560a+'contacts?$select='+_0x53ca1d+_0x560a('0x32')+_0x53ca1d+'\x20eq\x20\x27'+_0x2d0bc1[_0x560a('0x33')]('+','%2b')+'\x27','headers':{'Authorization':_0x560a('0x2a')+_0x266402,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x56be81);})[_0x560a('0x18')](function(_0x322817){var _0x1c5c2b=![];if(!_0x322817)return _0x1c5c2b;var _0x14f68c=_0x322817['value'];for(var _0xd8250b=0x0;_0xd8250b<_0x14f68c[_0x560a('0x25')];_0xd8250b++){if(_0x14f68c[_0xd8250b][_0x53ca1d]===_0x2d0bc1){_0x1c5c2b=!![];_0x81a0b1[_0x560a('0x2f')]=_0x14f68c[_0xd8250b][_0x560a('0x34')];}}return _0x1c5c2b;})['then'](function(_0x2a8ef6){if(_0x2a8ef6)return _0x81a0b1;if(_0x3b9736==='nothing'){logger[_0x560a('0x35')]('['+[_0x11ef5a[_0x560a('0x36')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x81a0b1;}return createEndUser(_0x81a0b1,_0x1c3ea1,_0x258dbc,_0x1c560a,_0x18596e,_0x11ef5a,_0x53ca1d)['then'](function(_0x19a8ed){logger[_0x560a('0x35')]('['+[_0x11ef5a[_0x560a('0x36')]()]+']\x20Enduser\x20created!',_0x19a8ed[_0x560a('0x2f')]);return _0x19a8ed;});});}function getCustomFields(_0x11de4b,_0x14023b,_0x1ea71a){var _0x88986b={};if(_0x11de4b[_0x560a('0x25')]>0x0){_['forEach'](_0x11de4b,function(_0x478139){if(_[_0x560a('0x37')]([_0x560a('0x38'),_0x560a('0x39')],_0x478139['type'])&&_0x478139['nameField']&&!_0x478139[_0x560a('0x3a')]){var _0x2e73ac=_0x478139['idField']['toLowerCase']();var _0x10143d=_0x2e73ac['substring'](0x0,_0x2e73ac[_0x560a('0x3b')]('_'));var _0x5e087f=_0x2e73ac[_0x560a('0x2d')](_0x2e73ac[_0x560a('0x3b')]('_')+0x1);if(_0x10143d===_0x1ea71a){_0x88986b[_0x5e087f]=_0x478139[_0x560a('0x3c')];}}});}return _0x88986b;}function getTicket(_0x5b5efa,_0x484e08,_0x432aa7,_0x2b65d4,_0x471623,_0x418966,_0x23a784){return new Promise(function(_0xc432b0,_0x322343){var _0x12c4e8;return getAuthToken(_0x484e08,_0x432aa7,_0x23a784)[_0x560a('0x18')](function(_0x248eea){if(_0x418966[_0x560a('0x3d')]===_0x560a('0x3e')){_0x12c4e8={'method':_0x560a('0xe'),'uri':_0x2b65d4+'incidents','body':Object[_0x560a('0x3f')]({},{'title':intUtil[_0x560a('0x40')](_0x418966[_0x560a('0x41')],_0x471623,'\x20'),'description':intUtil[_0x560a('0x40')](_0x418966[_0x560a('0x42')],_0x471623,'\x0a'),'customerid_contact@odata.bind':_0x5b5efa[_0x560a('0x2f')]?_0x560a('0x43')+_0x5b5efa[_0x560a('0x2f')]+')':undefined,'ownerid@odata.bind':_0x560a('0x29')+_0x5b5efa[_0x560a('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x418966[_0x560a('0x44')],_0x471623,_0x418966['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x248eea,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x418966[_0x560a('0x3d')]===_0x560a('0x45')){var _0x9fd85=_0x5b5efa['enduserId']?[{'partyid_systemuser@odata.bind':_0x560a('0x29')+_0x5b5efa[_0x560a('0x21')]+')','participationtypemask':_0x5b5efa[_0x560a('0x46')]===_0x560a('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0x560a('0x43')+_0x5b5efa[_0x560a('0x2f')]+')','participationtypemask':_0x5b5efa[_0x560a('0x46')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x560a('0x29')+_0x5b5efa[_0x560a('0x21')]+')','participationtypemask':_0x5b5efa[_0x560a('0x46')]===_0x560a('0x47')?0x2:0x1}];_0x12c4e8={'method':_0x560a('0xe'),'uri':_0x2b65d4+'phonecalls','body':Object[_0x560a('0x3f')]({},{'subject':intUtil[_0x560a('0x40')](_0x418966[_0x560a('0x41')],_0x471623,'\x20'),'phonenumber':String(_0x471623[_0x560a('0x28')]),'description':intUtil['getString'](_0x418966['Descriptions'],_0x471623,'\x0a'),'regardingobjectid_contact@odata.bind':_0x5b5efa['enduserId']?_0x560a('0x43')+_0x5b5efa[_0x560a('0x2f')]+')':undefined,'ownerid@odata.bind':_0x560a('0x29')+_0x5b5efa['userId']+')','directioncode':_0x5b5efa['callDirection']===_0x560a('0x47')?![]:!![],'phonecall_activity_parties':_0x9fd85},getCustomFields(_0x418966[_0x560a('0x44')],_0x471623,_0x418966[_0x560a('0x3d')])),'headers':{'Authorization':_0x560a('0x2a')+_0x248eea,'OData-Version':_0x560a('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x12c4e8);})[_0x560a('0x18')](function(_0xd35726){var _0x22c979=_0xd35726[_0x560a('0x2b')][_0x560a('0x2c')];var _0x4bcdc6=_0x22c979[_0x560a('0x2d')](_0x22c979[_0x560a('0x2e')]('(')+0x1,_0x22c979[_0x560a('0x2e')](')'));_0x5b5efa[_0x560a('0x48')]=_0x4bcdc6;_0xc432b0(_0x5b5efa);})[_0x560a('0x14')](function(_0xce238d){_0x322343(_0xce238d[_0x560a('0x17')]);});});}function emit(_0x369014,_0x5ae8c1,_0x49674a,_0x2f7f49){var _0x240a8c={'uri':util[_0x560a('0x49')](_0x560a('0x4a'),_0x369014,_0x49674a,_0x2f7f49)};io['to'](util['format'](_0x560a('0x4b'),_0x5ae8c1))[_0x560a('0x4c')]('trigger:browser:url',_0x240a8c);}exports['cs']=function(_0x3688b6,_0x71bdcb,_0x3ab286,_0x5a103b,_0x9b59e7,_0x47e7bb,_0x58184e,_0x4e51ab){var _0x3afd8f={};_0x47e7bb[_0x560a('0xa')]=_0x47e7bb['modernAuthentication']?intUtil['stripTrailingSlash'](_0x47e7bb['CloudProvider']['data7']):intUtil[_0x560a('0x4d')](_0x47e7bb[_0x560a('0xa')]);_0x47e7bb[_0x560a('0x4e')]=intUtil[_0x560a('0x4d')](_0x47e7bb[_0x560a('0x4e')]);_0x3afd8f[_0x560a('0x46')]=_0x4e51ab==='queue'||_0x4e51ab==='unmanaged'?_0x560a('0x47'):_0x560a('0x27');var _0x343e80=_0x47e7bb[_0x560a('0x9')]?util['format'](_0x560a('0x4f'),_0x47e7bb['CloudProvider']['data7']):util['format']('%s/api/data/v9.0/',_0x47e7bb[_0x560a('0xa')]);var _0x5e9c0f=util[_0x560a('0x49')](_0x560a('0x50'),_0x47e7bb[_0x560a('0xc')]);var _0x264a14=util[_0x560a('0x49')](_0x560a('0x51'),_0x47e7bb[_0x560a('0x4e')],_0x71bdcb[_0x560a('0x52')],md5(_0x71bdcb[_0x560a('0x52')]));if(_0x9b59e7&&_0x9b59e7[_0x560a('0x53')]){logger[_0x560a('0x35')]('[QUEUE]',_0x560a('0x54'));_0x71bdcb[_0x560a('0x55')]=_0x264a14;}else if(_0x58184e&&_0x58184e['recordingFormat']&&_0x58184e['recordingFormat']!==_0x560a('0x56')){logger[_0x560a('0x35')](_0x560a('0x57'),_0x560a('0x54'));_0x71bdcb[_0x560a('0x55')]=_0x264a14;}else{_0x71bdcb[_0x560a('0x55')]='';}return getUser(_0x3afd8f,_0x47e7bb,_0x5a103b,_0x5e9c0f,_0x343e80,_0x4e51ab)[_0x560a('0x18')](function(_0x1aa393){logger[_0x560a('0x35')]('['+_0x4e51ab[_0x560a('0x36')]()+_0x560a('0x58'),_0x1aa393[_0x560a('0x21')]);logger[_0x560a('0x35')]('['+_0x4e51ab[_0x560a('0x36')]()+_0x560a('0x59'),_0x1aa393[_0x560a('0x24')]);return getEndUser(_0x1aa393,_0x47e7bb,_0x5e9c0f,_0x343e80,_0x71bdcb,_0x4e51ab,_0x3ab286[_0x560a('0x5a')],_0x3ab286[_0x560a('0x5b')]);})['then'](function(_0x41d9e7){logger[_0x560a('0x35')]('['+_0x4e51ab[_0x560a('0x36')]()+_0x560a('0x5c'),_0x41d9e7[_0x560a('0x2f')]);logger[_0x560a('0x35')]('['+_0x4e51ab[_0x560a('0x36')]()+_0x560a('0x5d'),_0x71bdcb['calleridnum']);return getTicket(_0x41d9e7,_0x47e7bb,_0x5e9c0f,_0x343e80,_0x71bdcb,_0x3ab286,_0x4e51ab);})[_0x560a('0x18')](function(_0x450a0a){logger[_0x560a('0x35')](util[_0x560a('0x49')]('['+_0x4e51ab[_0x560a('0x36')]()+_0x560a('0x5e'),_0x3ab286['ticketType'],_0x450a0a[_0x560a('0x48')]));logger['info'](util['format']('['+_0x4e51ab[_0x560a('0x36')]()+']\x20Call\x20direction:\x20%s',_0x4e51ab));if(_0x4e51ab!==_0x560a('0x5f')&&_0x3ab286[_0x560a('0x60')]){logger[_0x560a('0x35')]('['+_0x4e51ab[_0x560a('0x36')]()+']',_0x560a('0x61'));emit(_0x47e7bb[_0x560a('0xa')],_0x5a103b[_0x560a('0x62')],_0x3ab286['ticketType'],_0x450a0a[_0x560a('0x48')]);}})[_0x560a('0x14')](function(_0x3ee9a8){logger[_0x560a('0x15')]('['+_0x4e51ab[_0x560a('0x36')]()+_0x560a('0x63'),_0x3ee9a8[_0x560a('0x17')]);console[_0x560a('0x15')]('Error\x20running\x20Dynamics365\x20integration',_0x3ee9a8);});}; \ 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 7569777..ca10863 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 _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 +var _0x81a1=['mapValues','keyBy','value','format','remoteUri','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','toString','base64','debug','[HTTP]','GET','map','type','customField','toLowerCase','content','includes','string','picklist','idField','push','variable','variableName','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','stringify','recordingFormat','none','destcalleridname','The\x20Enduser\x20ID\x20is:','[OUTBOUND]','trigger:browser:url','unmanaged','lastevent','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridname','error','lodash','request-promise','util','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridnum','Subjects','
','Tags','Fields','custom_fields'];(function(_0x5ab558,_0x129080){var _0x4b1d0c=function(_0x122916){while(--_0x122916){_0x5ab558['push'](_0x5ab558['shift']());}};_0x4b1d0c(++_0x129080);}(_0x81a1,0xf5));var _0x181a=function(_0xb68bd6,_0x1ba287){_0xb68bd6=_0xb68bd6-0x0;var _0x45f0bb=_0x81a1[_0xb68bd6];return _0x45f0bb;};'use strict';var _=require(_0x181a('0x0'));var rp=require(_0x181a('0x1'));var md5=require('md5');var util=require(_0x181a('0x2'));var Redis=require(_0x181a('0x3'));var intUtil=require(_0x181a('0x4'));var config=require(_0x181a('0x5'));var logger=require('../../../../config/logger')(_0x181a('0x6'));config[_0x181a('0x7')]=_[_0x181a('0x8')](config[_0x181a('0x7')],{'host':_0x181a('0x9'),'port':0x18eb});var io=require(_0x181a('0xa'))(new Redis(config[_0x181a('0x7')]));var headers={'Content-Type':_0x181a('0xb'),'Accept':_0x181a('0xb')};function emit(_0x41ea71,_0x21769c,_0x1e00a2){io['to'](_0x41ea71)[_0x181a('0xc')](_0x21769c,_0x1e00a2);}function getTicket(_0x5ec094,_0x1b34c6,_0x310b8c,_0x4153fa,_0x14e1ca){logger[_0x181a('0xd')](_0x181a('0xe'));var _0x5357e1=_['merge']({'responder_id':_0x1b34c6['id'],'requester_id':_0x310b8c['id'],'name':util['format'](_0x181a('0xf'),_0x14e1ca['calleridname']),'phone':_0x14e1ca[_0x181a('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x4153fa[_0x181a('0x11')],_0x14e1ca,'\x20'),'description':intUtil['getString'](_0x4153fa['Descriptions'],_0x14e1ca,_0x181a('0x12')),'tags':getTags(_0x4153fa[_0x181a('0x13')],'name')},getCustomFields(_0x4153fa[_0x181a('0x14')],_0x14e1ca));_0x5357e1[_0x181a('0x15')]=_[_0x181a('0x16')](_[_0x181a('0x17')](_0x5357e1[_0x181a('0x15')],'id'),_0x181a('0x18'));return request({'uri':util[_0x181a('0x19')]('%s/api/v2/tickets',_0x5ec094[_0x181a('0x1a')]),'method':'POST','body':_0x5357e1})[_0x181a('0x1b')](function(_0x4c2a98){logger[_0x181a('0xd')](_0x181a('0x1c'));return _0x4c2a98;});}function getUser(_0xac810f,_0xfd0a78){if(intUtil[_0x181a('0x1d')](_0xfd0a78)){return request({'uri':util['format'](_0x181a('0x1e'),_0xac810f[_0x181a('0x1a')]),'qs':{'email':_0xfd0a78}})['then'](function(_0x2969a0){if(_0x2969a0[_0x181a('0x1f')]){logger[_0x181a('0xd')]('Agent\x20found!');return _[_0x181a('0x20')](_0x2969a0,function(_0x31581c){return _0x31581c['contact']['email']===_0xfd0a78;});}else{logger[_0x181a('0xd')](_0x181a('0x21'));return request({'uri':util['format'](_0x181a('0x22'),_0xac810f[_0x181a('0x1a')])})['then'](function(_0x440933){logger['info']('Admin\x20account\x20selected.');return _0x440933;});}});}else{logger[_0x181a('0xd')](_0x181a('0x23'));return request({'uri':util[_0x181a('0x19')](_0x181a('0x22'),_0xac810f[_0x181a('0x1a')])})[_0x181a('0x1b')](function(_0x20dc3a){logger[_0x181a('0xd')](_0x181a('0x24'));return _0x20dc3a;});}}function getEndUser(_0x5d8585,_0x150871,_0x5329c3){logger[_0x181a('0xd')](_0x181a('0x25'),_0x5329c3);return request({'uri':util[_0x181a('0x19')](_0x181a('0x26'),_0x5d8585['remoteUri']),'qs':{'phone':_0x5329c3}})['then'](function(_0x42b862){if(_0x42b862[_0x181a('0x1f')]){logger[_0x181a('0xd')]('Enduser\x20found!');return _['find'](_0x42b862,{'phone':_0x5329c3});}else{logger[_0x181a('0xd')](_0x181a('0x27'));return request({'uri':util[_0x181a('0x19')]('%s/api/v2/contacts',_0x5d8585['remoteUri']),'method':_0x181a('0x28'),'body':{'name':_0x150871,'phone':_0x5329c3}})[_0x181a('0x1b')](function(_0x38559c){logger[_0x181a('0xd')](_0x181a('0x29'));return _0x38559c;});}});}function getAuth(_0x4d20e9){return util[_0x181a('0x19')](_0x181a('0x2a'),new Buffer(_0x4d20e9['apiKey']+':X')[_0x181a('0x2b')](_0x181a('0x2c')));}function request(_0xe80629){logger[_0x181a('0x2d')](_0x181a('0x2e'),JSON['stringify'](_0xe80629));return rp(_['defaults'](_0xe80629,{'method':_0x181a('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x4cadef,_0x5a81d7){var _0xb09370=[];if(_0x4cadef&&_0x4cadef['length']>0x0){_0xb09370=_[_0x181a('0x30')](_0x4cadef,_0x5a81d7);}return _0xb09370;}function getCustomFields(_0x3fb372,_0xcf63e2){var _0x32d6aa=[];var _0x498bbb={'custom_fields':[]};if(_0x3fb372[_0x181a('0x1f')]>0x0){_['forEach'](_0x3fb372,function(_0x41467c){if(_['includes'](['string','picklist'],_0x41467c[_0x181a('0x31')])&&_0x41467c['nameField']&&!_0x41467c[_0x181a('0x32')]){_0x498bbb[_0x41467c['nameField'][_0x181a('0x33')]()]=_0x41467c[_0x181a('0x34')][_0x181a('0x2b')]();}else if(_[_0x181a('0x35')]([_0x181a('0x36'),_0x181a('0x37')],_0x41467c['type'])&&_0x41467c[_0x181a('0x38')]&&_0x41467c[_0x181a('0x32')]){_0x498bbb[_0x181a('0x15')][_0x181a('0x39')]({'id':_0x41467c[_0x181a('0x38')],'value':_0x41467c['content'][_0x181a('0x2b')]()});}else if(_0x41467c[_0x181a('0x31')]===_0x181a('0x3a')&&_0x41467c[_0x181a('0x3b')]&&_0x41467c['idField']&&_0x41467c[_0x181a('0x32')]){_0xcf63e2[_0x41467c[_0x181a('0x3b')]]&&_0x498bbb['custom_fields'][_0x181a('0x39')]({'id':_0x41467c['idField'],'value':_0xcf63e2[_0x41467c[_0x181a('0x3b')]][_0x181a('0x2b')]()});}else if(_0x41467c[_0x181a('0x31')]==='customVariable'&&_0x41467c[_0x181a('0x3c')]&&_0x41467c[_0x181a('0x3c')]['name']&&_0x41467c[_0x181a('0x38')]&&_0x41467c[_0x181a('0x32')]){_0xcf63e2[_0x41467c[_0x181a('0x3c')][_0x181a('0x3d')][_0x181a('0x33')]()]&&_0x498bbb[_0x181a('0x15')][_0x181a('0x39')]({'id':_0x41467c[_0x181a('0x38')],'value':_0xcf63e2[_0x41467c[_0x181a('0x3c')][_0x181a('0x3d')][_0x181a('0x33')]()][_0x181a('0x2b')]()});}});}return _0x498bbb;}exports[_0x181a('0x3e')]=function(_0x11bca3,_0x3b1667,_0xda7eea,_0x4aa3fd,_0x4b0b18,_0x1ba824){var _0x35749b,_0x977a16;_0x1ba824[_0x181a('0x1a')]=intUtil[_0x181a('0x3f')](_0x1ba824['remoteUri']);_0x1ba824[_0x181a('0x40')]=intUtil[_0x181a('0x3f')](_0x1ba824[_0x181a('0x40')]);if(_0x4b0b18&&_0x4b0b18[_0x181a('0x41')]){logger[_0x181a('0xd')](_0x181a('0x42'),_0x181a('0x43'));_0x3b1667[_0x181a('0x44')]=util[_0x181a('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1ba824[_0x181a('0x40')],_0x3b1667[_0x181a('0x45')],md5(_0x3b1667[_0x181a('0x45')]));}else{_0x3b1667['recordingURL']='';}headers[_0x181a('0x46')]=getAuth(_0x1ba824);return getUser(_0x1ba824,_0x4aa3fd[_0x181a('0x47')])[_0x181a('0x1b')](function(_0x4c4bef){_0x35749b=_0x4c4bef;logger[_0x181a('0xd')](_0x181a('0x48'),_0x35749b['id']);return getEndUser(_0x1ba824,_0x3b1667['calleridname'],_0x3b1667['calleridnum']);})[_0x181a('0x1b')](function(_0x4b124c){_0x977a16=_0x4b124c;logger[_0x181a('0xd')]('The\x20Enduser\x20ID\x20is:',_0x977a16['id']);return getTicket(_0x1ba824,_0x35749b,_0x977a16,_0xda7eea,_0x3b1667);})[_0x181a('0x1b')](function(_0x610a9){if(_0x610a9&&_0x610a9['id']){logger['info']('Ticket\x20created!');logger[_0x181a('0xd')](_0x181a('0x49'),_0x610a9['id']);logger['info'](_0x181a('0x42'),_0x181a('0x4a'));emit(util['format'](_0x181a('0x4b'),_0x4aa3fd[_0x181a('0x3d')]),'trigger:browser:url',{'uri':util[_0x181a('0x19')]('%s/helpdesk/tickets/%d',_0x1ba824[_0x181a('0x1a')],_0x610a9['id'])});}})[_0x181a('0x4c')](function(_0x2543fa){logger['error'](_0x181a('0x42'),JSON[_0x181a('0x4d')](_0x2543fa));});};exports['outbound']=function(_0x43e27a,_0x580b7e,_0x2e8456,_0x3d5572,_0x503598,_0x50b2c7,_0x481ee2){var _0x472a0e,_0x1105a0;_0x50b2c7[_0x181a('0x1a')]=intUtil['stripTrailingSlash'](_0x50b2c7[_0x181a('0x1a')]);_0x50b2c7['serverUrl']=intUtil[_0x181a('0x3f')](_0x50b2c7[_0x181a('0x40')]);if(_0x481ee2&&_0x481ee2[_0x181a('0x4e')]&&_0x481ee2[_0x181a('0x4e')]!==_0x181a('0x4f')){logger[_0x181a('0xd')]('[OUTBOUND]',_0x181a('0x43'));_0x580b7e[_0x181a('0x44')]=util[_0x181a('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x50b2c7[_0x181a('0x40')],_0x580b7e[_0x181a('0x45')],md5(_0x580b7e[_0x181a('0x45')]));}headers[_0x181a('0x46')]=getAuth(_0x50b2c7);return getUser(_0x50b2c7,_0x3d5572[_0x181a('0x47')])['then'](function(_0x482dbb){_0x472a0e=_0x482dbb;logger['info'](_0x181a('0x48'),_0x472a0e['id']);return getEndUser(_0x50b2c7,_0x580b7e[_0x181a('0x50')],_0x580b7e['destcalleridnum']);})['then'](function(_0x3b5900){_0x1105a0=_0x3b5900;logger[_0x181a('0xd')](_0x181a('0x51'),_0x1105a0['id']);return getTicket(_0x50b2c7,_0x472a0e,_0x1105a0,_0x2e8456,_0x580b7e);})['then'](function(_0x1d079d){if(_0x1d079d&&_0x1d079d['id']){logger[_0x181a('0xd')](_0x181a('0x1c'));logger[_0x181a('0xd')](_0x181a('0x49'),_0x1d079d['id']);logger[_0x181a('0xd')](_0x181a('0x52'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x181a('0x19')]('user:%s',_0x3d5572[_0x181a('0x3d')]),_0x181a('0x53'),{'uri':util[_0x181a('0x19')]('%s/helpdesk/tickets/%d',_0x50b2c7['remoteUri'],_0x1d079d['id'])});}})[_0x181a('0x4c')](function(_0x4c3202){logger['error'](_0x181a('0x52'),JSON[_0x181a('0x4d')](_0x4c3202));});};exports[_0x181a('0x54')]=function(_0x44afb4,_0xc9224c,_0x3b06e9,_0x7f8fbb,_0x4ff242,_0x2f1cf4){var _0x16e853,_0x596024;_0x2f1cf4[_0x181a('0x1a')]=intUtil[_0x181a('0x3f')](_0x2f1cf4['remoteUri']);_0x2f1cf4[_0x181a('0x40')]=intUtil[_0x181a('0x3f')](_0x2f1cf4['serverUrl']);if(_0x4ff242&&_0x4ff242[_0x181a('0x41')]){logger['info']('['+_0xc9224c[_0x181a('0x55')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0xc9224c[_0x181a('0x44')]=util[_0x181a('0x19')](_0x181a('0x56'),_0x2f1cf4['serverUrl'],_0xc9224c[_0x181a('0x45')],md5(_0xc9224c[_0x181a('0x45')]));}else{_0xc9224c['recordingURL']='';}headers[_0x181a('0x46')]=getAuth(_0x2f1cf4);return getUser(_0x2f1cf4,'')[_0x181a('0x1b')](function(_0xb64be1){_0x16e853=_0xb64be1;logger[_0x181a('0xd')](_0x181a('0x48'),_0x16e853['id']);return getEndUser(_0x2f1cf4,_0xc9224c[_0x181a('0x57')],_0xc9224c[_0x181a('0x10')]);})[_0x181a('0x1b')](function(_0x56d033){_0x596024=_0x56d033;logger[_0x181a('0xd')](_0x181a('0x51'),_0x596024['id']);return getTicket(_0x2f1cf4,_0x16e853,_0x596024,_0x3b06e9,_0xc9224c);})[_0x181a('0x1b')](function(_0x3de1db){if(_0x3de1db){logger[_0x181a('0xd')](_0x181a('0x1c'));logger[_0x181a('0xd')]('The\x20Ticket\x20ID\x20is:',_0x3de1db['id']);}})['catch'](function(_0x79959b){logger[_0x181a('0x58')]('['+_0xc9224c[_0x181a('0x55')]['toUpperCase']()+']',JSON[_0x181a('0x4d')](_0x79959b));});}; \ 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 e76c0f3..347b428 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 _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 +var _0x7ae8=['message','/api/selector/owners','Getting\x20user\x20list','users','agentEmail','userId','Admin\x20selected','userEmail','toUpperCase','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','Subjects','getString','Descriptions','Contact','add','task','ticketId','error','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','outbound','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','util','moment','../../../../config/environment','redis','defaults','socket.io-emitter','GET','headers','info','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch'];(function(_0x4fa8f4,_0x5799ac){var _0x51e873=function(_0x2b272c){while(--_0x2b272c){_0x4fa8f4['push'](_0x4fa8f4['shift']());}};_0x51e873(++_0x5799ac);}(_0x7ae8,0x1cd));var _0x87ae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7ae8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x87ae('0x0'));var rp=require(_0x87ae('0x1'));var md5=require('md5');var util=require(_0x87ae('0x2'));var moment=require(_0x87ae('0x3'));var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x87ae('0x4'));var logger=require('../../../../config/logger')('freshsales');config[_0x87ae('0x5')]=_[_0x87ae('0x6')](config[_0x87ae('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x87ae('0x7'))(new Redis(config[_0x87ae('0x5')]));function getAdminId(_0x191676,_0x500b92,_0x4d1252,_0x17412b){return new Promise(function(_0x26038a,_0x35b381){var _0x5a3488=![];var _0x58e982={'method':_0x87ae('0x8'),'uri':_0x17412b+'/api/selector/owners','json':!![]};_0x58e982[_0x87ae('0x9')]=_0x4d1252;logger[_0x87ae('0xa')](_0x87ae('0xb'));return rp(_0x58e982)[_0x87ae('0xc')](function(_0x57982c){if(_0x57982c){var _0x5e36e2=_0x57982c['users'];var _0x14f3d4=null;for(_0x14f3d4=0x0;_0x14f3d4<_0x5e36e2[_0x87ae('0xd')];_0x14f3d4++){if(_0x5e36e2[_0x14f3d4][_0x87ae('0xe')]===_0x191676[_0x87ae('0xf')]){_0x191676[_0x87ae('0x10')]=_0x5e36e2[_0x14f3d4]['id'];_0x5a3488=!![];}}if(_0x5a3488){logger[_0x87ae('0xa')]('Admin\x20found:',_0x191676[_0x87ae('0x10')]);_0x26038a(_0x191676);}else{_0x35b381({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x35b381({'statusCode':0x194,'message':_0x87ae('0x11')});}})[_0x87ae('0x12')](function(_0x1a4eb1){logger['error']('['+[_0x500b92['toUpperCase']()]+']',_0x1a4eb1[_0x87ae('0x13')]);_0x35b381(_0x1a4eb1);});});}function getUser(_0x27a0cb,_0x55c2b4,_0x34f8d0){return function(_0x4aba80){return new Promise(function(_0x271370,_0x1c3f60){var _0x5c5dcd={'method':_0x87ae('0x8'),'uri':_0x34f8d0+_0x87ae('0x14'),'json':!![]};_0x5c5dcd[_0x87ae('0x9')]=_0x55c2b4;logger[_0x87ae('0xa')](_0x87ae('0x15'));return rp(_0x5c5dcd)[_0x87ae('0xc')](function(_0x45d5e6){if(_0x45d5e6){var _0x162fae=_0x45d5e6[_0x87ae('0x16')];var _0x498a82=![];var _0x6a16cc=null;if(_0x4aba80[_0x87ae('0x17')]!==null){logger['info']('Getting\x20user\x20with\x20email',_0x4aba80['agentEmail']);_0x4aba80['userEmail']=_0x4aba80[_0x87ae('0x17')];for(_0x6a16cc=0x0;_0x6a16cc<_0x162fae[_0x87ae('0xd')];_0x6a16cc++){if(_0x162fae[_0x6a16cc][_0x87ae('0xe')]===_0x4aba80['agentEmail']){_0x498a82=!![];_0x4aba80[_0x87ae('0x18')]=_0x162fae[_0x6a16cc]['id'];logger[_0x87ae('0xa')]('User\x20found:',_0x4aba80[_0x87ae('0x18')]);}}}if(!_0x498a82){logger[_0x87ae('0xa')](_0x87ae('0x19'));_0x4aba80[_0x87ae('0x1a')]=_0x4aba80[_0x87ae('0xf')];_0x4aba80[_0x87ae('0x18')]=_0x4aba80[_0x87ae('0x10')];_0x498a82=!![];}if(_0x498a82){_0x271370(_0x4aba80);}else{_0x1c3f60({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x1c3f60({'statusCode':0x194,'message':_0x87ae('0x11')});}})[_0x87ae('0x12')](function(_0x28cd3c){logger['error']('['+[_0x27a0cb[_0x87ae('0x1b')]()]+']',_0x28cd3c['message']);_0x1c3f60(_0x28cd3c);});});};}function searchContact(_0x3fcf73,_0x4114da,_0x5b4d74,_0x161d9){return new Promise(function(_0x351bd7,_0x2e9fa4){var _0x3591df={'method':_0x87ae('0x8'),'headers':_0x4114da,'uri':_0x3fcf73+_0x87ae('0x1c')+_0x161d9+_0x87ae('0x1d')+_0x5b4d74+'&entities=contact','json':!![]};rp(_0x3591df)[_0x87ae('0xc')](function(_0xe5e646){var _0x8398ae=_[_0x87ae('0x1e')](_0xe5e646[_0x87ae('0x1f')][_0x87ae('0x1f')],[_0x5b4d74,_0x161d9]);_0x351bd7(_0x8398ae);})['catch'](function(_0x5bff32){_0x2e9fa4(_0x5bff32);});});}function getEndUser(_0x17651d,_0x12f28f,_0x7def5c){return function(_0x3be903){return new Promise(function(_0x5ccc80,_0xd55b16){logger[_0x87ae('0xa')](util[_0x87ae('0x20')](_0x87ae('0x21'),_0x3be903['contactNumber']));searchContact(_0x7def5c,_0x12f28f,_0x87ae('0x22'),_0x3be903[_0x87ae('0x23')])[_0x87ae('0xc')](function(_0x38aab3){if(_0x38aab3){_0x3be903[_0x87ae('0x24')]=_0x38aab3['id'];logger[_0x87ae('0xa')]('Contact\x20found\x20mobile_number:',_0x3be903[_0x87ae('0x24')]);return _0x5ccc80(_0x3be903);}searchContact(_0x7def5c,_0x12f28f,'work_number',_0x3be903[_0x87ae('0x23')])[_0x87ae('0xc')](function(_0x2a427a){if(_0x2a427a){_0x3be903[_0x87ae('0x24')]=_0x2a427a['id'];logger[_0x87ae('0xa')](_0x87ae('0x25'),_0x3be903['endUserId']);return _0x5ccc80(_0x3be903);}createEndUser(_0x3be903,_0x17651d,_0x12f28f,_0x7def5c)[_0x87ae('0xc')](function(_0x547648){logger[_0x87ae('0xa')](_0x87ae('0x26'),_0x547648['endUserId']);return _0x5ccc80(_0x547648);});});})[_0x87ae('0x12')](function(_0xf74ca0){_0xd55b16(_0xf74ca0);});});};}function createEndUser(_0x318185,_0x453cae,_0x5ac743,_0x48dcbc){return new Promise(function(_0x5a336b,_0x7e00a4){var _0x33e44a=moment();var _0x4d915d={'method':_0x87ae('0x27'),'uri':_0x48dcbc+'/api/contacts','body':{'contact':{'last_name':_0x318185[_0x87ae('0x23')],'work_number':_0x318185['contactNumber'],'mobile_number':_0x318185[_0x87ae('0x23')],'owner_id':_0x318185[_0x87ae('0x18')],'created_at':_0x33e44a[_0x87ae('0x20')](_0x87ae('0x28'))}},'json':!![]};_0x4d915d[_0x87ae('0x9')]=_0x5ac743;logger[_0x87ae('0xa')](_0x87ae('0x29'));return rp(_0x4d915d)['then'](function(_0x4c3631){_0x318185[_0x87ae('0x24')]=_0x4c3631[_0x87ae('0x2a')]['id'];_0x5a336b(_0x318185);})[_0x87ae('0x12')](function(_0x38f0fe){logger['error']('['+[_0x453cae[_0x87ae('0x1b')]()]+']',_0x38f0fe[_0x87ae('0x13')]);_0x7e00a4(_0x38f0fe[_0x87ae('0x13')]);});});}function getTicket(_0x17bb65,_0x386420,_0x3b0dbe,_0x9feb41,_0x58eb55){return function(_0x43cb0f){logger[_0x87ae('0xa')](_0x87ae('0x2b'));return new Promise(function(_0x38e781,_0x2418a6){var _0x3c0b17=moment();var _0xa596d4={'method':_0x87ae('0x27'),'uri':_0x3b0dbe+_0x87ae('0x2c'),'body':{'title':intUtil['getString'](_0x9feb41[_0x87ae('0x2d')],_0x58eb55,'\x20'),'description':intUtil[_0x87ae('0x2e')](_0x9feb41[_0x87ae('0x2f')],_0x58eb55,'\x0a'),'owner_id':_0x43cb0f[_0x87ae('0x18')],'creater_id':_0x43cb0f[_0x87ae('0x10')],'targetable_id':_0x43cb0f[_0x87ae('0x24')],'targetable_type':_0x87ae('0x30'),'created_at':_0x3c0b17[_0x87ae('0x20')](_0x87ae('0x28')),'due_date':_0x3c0b17[_0x87ae('0x31')](0x1e,'m')['format'](_0x87ae('0x28'))},'json':!![]};_0xa596d4['headers']=_0x386420;return rp(_0xa596d4)[_0x87ae('0xc')](function(_0x3e89b4){_0x43cb0f['ticketId']=_0x3e89b4[_0x87ae('0x32')]['id'];logger[_0x87ae('0xa')]('Task\x20created:',_0x43cb0f[_0x87ae('0x33')]);_0x38e781(_0x43cb0f);})['catch'](function(_0x43663f){logger[_0x87ae('0x34')]('['+[_0x17bb65['toUpperCase']()]+']',_0x43663f[_0x87ae('0x13')]);_0x2418a6(_0x43663f[_0x87ae('0x13')]);});});};}function emit(_0x7085a0,_0x15f4be,_0x44bdc3){var _0x5451aa={'uri':_0x7085a0+_0x87ae('0x35')+_0x44bdc3};io['to'](util[_0x87ae('0x20')](_0x87ae('0x36'),_0x15f4be))[_0x87ae('0x37')](_0x87ae('0x38'),_0x5451aa);}exports['cs']=function(_0x2471be,_0x1b4e67,_0x220e24,_0x254c24,_0xe8bc68,_0x7cef2c,_0x13c889,_0x42e29f){var _0x3f822a={};var _0x51a669={'Authorization':_0x87ae('0x39')+_0x7cef2c[_0x87ae('0x3a')]};_0x7cef2c[_0x87ae('0x3b')]=intUtil['stripTrailingSlash'](_0x7cef2c['remoteUri']);_0x7cef2c[_0x87ae('0x3c')]=intUtil[_0x87ae('0x3d')](_0x7cef2c[_0x87ae('0x3c')]);var _0x34db0a=_0x7cef2c[_0x87ae('0x3b')];_0x3f822a[_0x87ae('0xf')]=_0x7cef2c[_0x87ae('0x3e')];_0x3f822a[_0x87ae('0x23')]=_0x42e29f[_0x87ae('0x3f')]()===_0x87ae('0x40')?_0x1b4e67[_0x87ae('0x41')]:_0x1b4e67[_0x87ae('0x42')];_0x3f822a['callDirection']=_0x42e29f===_0x87ae('0x43')||_0x42e29f===_0x87ae('0x44')?_0x87ae('0x43'):_0x87ae('0x40');if(_0x254c24){_0x3f822a['agentEmail']=_0x254c24[_0x87ae('0xe')];}var _0xd9a7a4=util['format'](_0x87ae('0x45'),_0x7cef2c[_0x87ae('0x3c')],_0x1b4e67['uniqueid'],md5(_0x1b4e67['uniqueid']));if(_0xe8bc68&&_0xe8bc68[_0x87ae('0x46')]){logger[_0x87ae('0xa')](_0x87ae('0x47'),'Recording\x20is\x20enabled!');_0x1b4e67['recordingURL']=_0xd9a7a4;}else if(_0x13c889&&_0x13c889[_0x87ae('0x48')]&&_0x13c889[_0x87ae('0x48')]!==_0x87ae('0x49')){logger[_0x87ae('0xa')](_0x87ae('0x4a'),_0x87ae('0x4b'));_0x1b4e67['recordingURL']=_0xd9a7a4;}else{_0x1b4e67['recordingURL']='';}return getAdminId(_0x3f822a,_0x42e29f,_0x51a669,_0x34db0a)[_0x87ae('0xc')](getUser(_0x42e29f,_0x51a669,_0x34db0a))['then'](getEndUser(_0x42e29f,_0x51a669,_0x34db0a))[_0x87ae('0xc')](getTicket(_0x42e29f,_0x51a669,_0x34db0a,_0x220e24,_0x1b4e67))['then'](function(_0x3be322){logger[_0x87ae('0xa')](util[_0x87ae('0x20')](_0x87ae('0x4c'),_0x3be322[_0x87ae('0x33')]));if(_0x42e29f!=='unmanaged'){logger['info']('['+[_0x42e29f[_0x87ae('0x1b')]()]+']',_0x87ae('0x4d'));emit(_0x34db0a,_0x254c24[_0x87ae('0x4e')],_0x3be322['endUserId']);}})[_0x87ae('0x12')](function(_0x4be401){logger[_0x87ae('0x34')]('['+[_0x42e29f['toUpperCase']()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x87ae('0x4f')](_0x4be401,{'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 565b3f2..d6d3158 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 _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 +var _0x1dd4=['./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','freshdesk','zoho','desk','servicenow','exec','includes','data1','data2','find','Configurations','data3','queue','routeId','EVENT\x20UNKNOWN','unmanaged','toLowerCase','sugarcrm','vtiger','freshsales','log','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','error','lodash','util','./salesforce'];(function(_0x365905,_0x84e027){var _0x7403e8=function(_0x4f00c7){while(--_0x4f00c7){_0x365905['push'](_0x365905['shift']());}};_0x7403e8(++_0x84e027);}(_0x1dd4,0x14a));var _0x41dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dd4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41dd('0x0'));var util=require(_0x41dd('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x41dd('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x41dd('0x3'));var zoho=require(_0x41dd('0x4'));var desk=require(_0x41dd('0x5'));var vtiger=require(_0x41dd('0x6'));var servicenow=require(_0x41dd('0x7'));var dynamics365=require(_0x41dd('0x8'));var freshsales=require('./freshsales');var integrations=[_0x41dd('0x9'),_0x41dd('0xa'),'sugarcrm',_0x41dd('0xb'),_0x41dd('0xc'),_0x41dd('0xd'),'vtiger','dynamics365','freshsales',_0x41dd('0xe')];exports[_0x41dd('0xf')]=function(_0x5a06e7,_0x5ae203,_0xadec1e,_0x118f0b,_0x3e6290,_0x31d1d8){if(_0xadec1e){if(_[_0x41dd('0x10')](integrations,_0x5a06e7[_0x41dd('0x11')]['toLowerCase']())){try{var _0x258c12=null;var _0x442e92='';var _0x51c55e=_0xadec1e[_0x5a06e7[_0x41dd('0x11')]['toLowerCase']()];if(_0x51c55e){var _0x5bbef3=_0x51c55e[_0x5a06e7[_0x41dd('0x12')]];if(_0x5bbef3){var _0x2a8541=_[_0x41dd('0x13')](_0x5bbef3[_0x41dd('0x14')],{'id':parseInt(_0x5a06e7[_0x41dd('0x15')],0xa)});if(_0x2a8541){if(_0x118f0b){if(_0x3e6290&&_0x5ae203[_0x41dd('0x16')]){_0x442e92=_0x41dd('0x16');}else if(_0x5ae203[_0x41dd('0x17')]){_0x442e92='outbound';}else{console['log'](_0x41dd('0x18'),_0x5ae203);}}else{_0x442e92=_0x41dd('0x19');}switch(_0x5a06e7['data1'][_0x41dd('0x1a')]()){case _0x41dd('0x9'):zendesk[_0x442e92](_0x5a06e7,_0x5ae203,_0x2a8541,_0x118f0b,_0x3e6290,_0x5bbef3,_0x31d1d8);break;case _0x41dd('0xa'):salesforce[_0x442e92](_0x5a06e7,_0x5ae203,_0x2a8541,_0x118f0b,_0x3e6290,_0x5bbef3,_0x31d1d8);break;case _0x41dd('0x1b'):sugarcrm[_0x442e92](_0x5a06e7,_0x5ae203,_0x2a8541,_0x118f0b,_0x3e6290,_0x5bbef3,_0x31d1d8);break;case _0x41dd('0xb'):freshdesk[_0x442e92](_0x5a06e7,_0x5ae203,_0x2a8541,_0x118f0b,_0x3e6290,_0x5bbef3,_0x31d1d8);break;case'zoho':zoho[_0x442e92](_0x5a06e7,_0x5ae203,_0x2a8541,_0x118f0b,_0x3e6290,_0x5bbef3,_0x31d1d8);break;case _0x41dd('0xd'):desk[_0x442e92](_0x5a06e7,_0x5ae203,_0x2a8541,_0x118f0b,_0x3e6290,_0x5bbef3,_0x31d1d8);break;case _0x41dd('0x1c'):vtiger[_0x442e92](_0x5a06e7,_0x5ae203,_0x2a8541,_0x118f0b,_0x3e6290,_0x5bbef3,_0x31d1d8);break;case _0x41dd('0x1d'):freshsales['cs'](_0x5a06e7,_0x5ae203,_0x2a8541,_0x118f0b,_0x3e6290,_0x5bbef3,_0x31d1d8,_0x442e92);break;case _0x41dd('0xe'):servicenow['cs'](_0x5a06e7,_0x5ae203,_0x2a8541,_0x118f0b,_0x3e6290,_0x5bbef3,_0x31d1d8,_0x442e92);break;case'dynamics365':dynamics365['cs'](_0x5a06e7,_0x5ae203,_0x2a8541,_0x118f0b,_0x3e6290,_0x5bbef3,_0x31d1d8,_0x442e92);break;default:console[_0x41dd('0x1e')](_0x41dd('0x1f'));}}else{_0x258c12=require(_0x41dd('0x20'))(_0x5a06e7['data1'][_0x41dd('0x1a')]());_0x258c12['error'](_0x41dd('0x21'),util[_0x41dd('0x22')](_0x41dd('0x23'),_0x5a06e7[_0x41dd('0x11')][_0x41dd('0x1a')](),_0x5a06e7[_0x41dd('0x15')]));}}else{_0x258c12=require('../../../../config/logger')(_0x5a06e7['data1']['toLowerCase']());_0x258c12[_0x41dd('0x24')](_0x41dd('0x21'),util[_0x41dd('0x22')]('%s\x20account\x20#%s\x20not\x20found',_0x5a06e7['data1'][_0x41dd('0x1a')](),_0x5a06e7[_0x41dd('0x12')]));}}else{}}catch(_0x11d6b1){console[_0x41dd('0x24')](_0x11d6b1);}}}}; \ 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 552d60a..8507dba 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 _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 +var _0xaf6f=['Salesforce\x20account\x20type\x20not\x20recognized','[OUTBOUND]','unmanaged','toUpperCase','lastevent',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','bluebird','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','Subjects','Descriptions','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','Case','ContactId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','User','find','execute','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','merge','$or','Contact','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','additionalSearchContact','Name','Phone','attributes','type','toLowerCase','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','clientId','clientSecret','login','username','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','outbound','recordingFormat','none','uniqueid','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab'];(function(_0x1ad07b,_0x551d55){var _0x2c447f=function(_0x43340b){while(--_0x43340b){_0x1ad07b['push'](_0x1ad07b['shift']());}};_0x2c447f(++_0x551d55);}(_0xaf6f,0x83));var _0xfaf6=function(_0x363044,_0x5d5c70){_0x363044=_0x363044-0x0;var _0xad109b=_0xaf6f[_0x363044];return _0xad109b;};'use strict';var _=require(_0xfaf6('0x0'));var rp=require(_0xfaf6('0x1'));var moment=require(_0xfaf6('0x2'));var BPromise=require(_0xfaf6('0x3'));var md5=require(_0xfaf6('0x4'));var jsforce=require(_0xfaf6('0x5'));var util=require(_0xfaf6('0x6'));var Redis=require('ioredis');var intUtil=require(_0xfaf6('0x7'));var config=require(_0xfaf6('0x8'));var logger=require(_0xfaf6('0x9'))(_0xfaf6('0xa'));config[_0xfaf6('0xb')]=_[_0xfaf6('0xc')](config[_0xfaf6('0xb')],{'host':_0xfaf6('0xd'),'port':0x18eb});var io=require(_0xfaf6('0xe'))(new Redis(config['redis']));function emit(_0x52daed,_0x557315,_0x2761a0){io['to'](_0x52daed)[_0xfaf6('0xf')](_0x557315,_0x2761a0);}function getTicket(_0x29c4ed,_0x3430a4,_0x166800,_0x584a7b,_0x200b76,_0xa0c2dc,_0x3a11e9,_0x3884df){var _0x570448=Object[_0xfaf6('0x10')]({},{'OwnerId':_0x3430a4['id'],'Subject':intUtil['getString'](_0x584a7b[_0xfaf6('0x11')],_0x200b76,'\x20'),'Description':intUtil['getString'](_0x584a7b[_0xfaf6('0x12')],_0x200b76,'\x0a')},getCustomFields(_0xa0c2dc,_0x200b76));if(_0x166800){if(_0x584a7b['ticketType']===_0xfaf6('0x13')){_0x570448[_0xfaf6('0x14')]=moment['utc']();_0x570448[_0xfaf6('0x15')]=![];_0x570448[_0xfaf6('0x16')]=![];if(_0x166800[_0xfaf6('0x17')]===_0xfaf6('0x18')||_0x166800['endUserType']===_0xfaf6('0x19')){_0x570448[_0xfaf6('0x1a')]=_0x166800['id'];}else if(_0x166800[_0xfaf6('0x17')]===_0xfaf6('0x1b')){_0x570448['WhatId']=_0x166800['id'];}}else if(_0x584a7b['ticketType']===_0xfaf6('0x1c')){if(_0x166800['endUserType']===_0xfaf6('0x18')){_0x570448[_0xfaf6('0x1d')]=_0x166800['id'];}else if(_0x166800['endUserType']===_0xfaf6('0x1b')){_0x570448['AccountId']=_0x166800['id'];}else if(_0x166800[_0xfaf6('0x17')]===_0xfaf6('0x19')&&_0x584a7b[_0xfaf6('0x1e')]){_0x570448[_0x584a7b[_0xfaf6('0x1e')]]=_0x166800['id'];}else{logger[_0xfaf6('0x1f')](_0xfaf6('0x20'));}}}return _0x3a11e9[_0xfaf6('0x21')](_0x584a7b['ticketType'])[_0xfaf6('0x22')](_0x570448);}function getUser(_0x538e62,_0x30a228,_0x102a7c){if(!_['isNil'](_0x30a228)&&intUtil['validateEmail'](_0x30a228)){var _0x4b8359={'Email':_0x30a228};var _0x28e4c6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x102a7c[_0xfaf6('0x21')](_0xfaf6('0x23'))[_0xfaf6('0x24')](_0x4b8359,_0x28e4c6)[_0xfaf6('0x25')]()['then'](function(_0xc30c7c){if(_0xc30c7c['length']){var _0xcdff81=_[_0xfaf6('0x24')](_0xc30c7c,function(_0x41219c){return _0x41219c['Email']===_0x30a228;});if(_0xcdff81){logger[_0xfaf6('0x1f')]('Agent\x20%s\x20found.',_0x30a228);return BPromise['resolve']({'id':_0xcdff81['Id'],'name':_0xcdff81['Name']});}}else{logger[_0xfaf6('0x1f')](_0xfaf6('0x26'),_0x30a228);return _0x102a7c[_0xfaf6('0x27')]()[_0xfaf6('0x28')](function(_0x2300cf){return BPromise[_0xfaf6('0x29')]({'id':_0x2300cf[_0xfaf6('0x2a')],'name':_0x2300cf[_0xfaf6('0x2b')]});});}});}else{logger[_0xfaf6('0x1f')](_0xfaf6('0x26'),_0x30a228);return _0x102a7c[_0xfaf6('0x27')]()[_0xfaf6('0x28')](function(_0x16b52c){return BPromise[_0xfaf6('0x29')]({'id':_0x16b52c[_0xfaf6('0x2a')],'name':_0x16b52c[_0xfaf6('0x2b')]});});}}function getEndUser(_0x2bb21d,_0x1b91a6,_0x49d84f,_0x1fac83,_0x3592bc){var _0x3872bf={'$or':{'Phone':_0x1fac83}};var _0x3250f6={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xfaf6('0x29')]()[_0xfaf6('0x28')](function(){logger[_0xfaf6('0x1f')](_0xfaf6('0x2c'),_0x1fac83,_0x1b91a6[_0xfaf6('0x2d')]);switch(_0x1b91a6[_0xfaf6('0x2d')]){case'contact_lead':var _0x534a03=_[_0xfaf6('0x2e')](_0x3872bf);if(_0x1b91a6['additionalSearchContact']){var _0x2d634f={};_0x2d634f[_0x1b91a6['additionalSearchContact']]=_0x1fac83;_[_0xfaf6('0x2f')](_0x534a03[_0xfaf6('0x30')],_0x2d634f);}return _0x3592bc[_0xfaf6('0x21')](_0xfaf6('0x31'))[_0xfaf6('0x24')](_0x534a03,_0x3250f6)['execute']()['then'](function(_0x15c0df){if(_0x15c0df&&_0x15c0df[_0xfaf6('0x32')]){return _0x15c0df;}else{var _0x392d6b=_[_0xfaf6('0x2e')](_0x3872bf);if(_0x1b91a6[_0xfaf6('0x33')]){var _0x4492a4={};_0x4492a4[_0x1b91a6[_0xfaf6('0x33')]]=_0x1fac83;_[_0xfaf6('0x2f')](_0x392d6b[_0xfaf6('0x30')],_0x4492a4);}return _0x3592bc[_0xfaf6('0x21')](_0xfaf6('0x34'))[_0xfaf6('0x24')](_0x392d6b,_0x3250f6);}});case _0xfaf6('0x35'):var _0x1ea372=_['cloneDeep'](_0x3872bf);if(_0x1b91a6['additionalSearchAccount']){var _0x2d634f={};_0x2d634f[_0x1b91a6[_0xfaf6('0x36')]]=_0x1fac83;_[_0xfaf6('0x2f')](_0x1ea372[_0xfaf6('0x30')],_0x2d634f);}return _0x3592bc[_0xfaf6('0x21')](_0xfaf6('0x37'))[_0xfaf6('0x24')](_0x1ea372,_0x3250f6)[_0xfaf6('0x25')]()['then'](function(_0x2695a5){if(_0x2695a5&&_0x2695a5['length']){return _0x2695a5;}else{var _0xd5f8fd=_[_0xfaf6('0x2e')](_0x3872bf);if(_0x1b91a6[_0xfaf6('0x38')]){var _0x5e671f={};_0x5e671f[_0x1b91a6[_0xfaf6('0x38')]]=_0x1fac83;_[_0xfaf6('0x2f')](_0xd5f8fd[_0xfaf6('0x30')],_0x5e671f);}return _0x3592bc['sobject'](_0xfaf6('0x31'))[_0xfaf6('0x24')](_0xd5f8fd,_0x3250f6)[_0xfaf6('0x28')](function(_0x265119){if(_0x265119&&_0x265119[_0xfaf6('0x32')]){return _0x265119;}else{var _0x33cbf=_[_0xfaf6('0x2e')](_0x3872bf);if(_0x1b91a6[_0xfaf6('0x33')]){var _0x1e7e85={};_0x1e7e85[_0x1b91a6[_0xfaf6('0x33')]]=_0x1fac83;_[_0xfaf6('0x2f')](_0x33cbf[_0xfaf6('0x30')],_0x1e7e85);}return _0x3592bc['sobject']('Lead')['find'](_0x33cbf,_0x3250f6);}});}});case _0xfaf6('0x18'):var _0x534a03=_[_0xfaf6('0x2e')](_0x3872bf);if(_0x1b91a6[_0xfaf6('0x38')]){var _0x2d634f={};_0x2d634f[_0x1b91a6['additionalSearchContact']]=_0x1fac83;_['merge'](_0x534a03[_0xfaf6('0x30')],_0x2d634f);}return _0x3592bc[_0xfaf6('0x21')]('Contact')[_0xfaf6('0x24')](_0x534a03,_0x3250f6)[_0xfaf6('0x25')]();case _0xfaf6('0x19'):var _0xf3dacc=_['cloneDeep'](_0x3872bf);if(_0x1b91a6[_0xfaf6('0x33')]){var _0x2d634f={};_0x2d634f[_0x1b91a6['additionalSearchLead']]=_0x1fac83;_['merge'](_0xf3dacc[_0xfaf6('0x30')],_0x2d634f);}return _0x3592bc['sobject']('Lead')['find'](_0xf3dacc,_0x3250f6);case _0xfaf6('0x1b'):var _0x1ea372=_[_0xfaf6('0x2e')](_0x3872bf);if(_0x1b91a6[_0xfaf6('0x36')]){var _0x2d634f={};_0x2d634f[_0x1b91a6[_0xfaf6('0x36')]]=_0x1fac83;_[_0xfaf6('0x2f')](_0x1ea372[_0xfaf6('0x30')],_0x2d634f);}return _0x3592bc[_0xfaf6('0x21')]('Account')[_0xfaf6('0x24')](_0x1ea372,_0x3250f6);default:return null;}})['then'](function(_0x347f6e){if(_0x347f6e&&_0x347f6e[_0xfaf6('0x32')]){var _0x215ecc=_['first'](_0x347f6e);if(_0x215ecc){return BPromise[_0xfaf6('0x29')]({'id':_0x215ecc['Id'],'name':_0x215ecc[_0xfaf6('0x39')],'phone':_0x215ecc[_0xfaf6('0x3a')],'endUserType':_0x215ecc[_0xfaf6('0x3b')][_0xfaf6('0x3c')][_0xfaf6('0x3d')]()});}}})['then'](function(_0x3cb7c1){if(_0x3cb7c1){logger[_0xfaf6('0x1f')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x3cb7c1[_0xfaf6('0x17')],_0x1fac83);return BPromise[_0xfaf6('0x29')](_0x3cb7c1);}else{logger[_0xfaf6('0x1f')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x1fac83);var _0x527824={'Phone':_0x1fac83};if(_0x1b91a6[_0xfaf6('0x3e')]){if(_0x1b91a6[_0xfaf6('0x3e')]==='contact'){logger[_0xfaf6('0x1f')](_0xfaf6('0x3f'),_0x1fac83,_0x1b91a6['moduleCreate']);_0x527824[_0xfaf6('0x40')]=_0x49d84f!==_0xfaf6('0x41')?_0x49d84f:util[_0xfaf6('0x42')](_0xfaf6('0x43'),_0x1fac83);}else if(_0x1b91a6[_0xfaf6('0x3e')]===_0xfaf6('0x19')){logger['info'](_0xfaf6('0x3f'),_0x1fac83,_0x1b91a6[_0xfaf6('0x3e')]);_0x527824['LastName']=_0x49d84f!==''?_0x49d84f:util[_0xfaf6('0x42')](_0xfaf6('0x43'),_0x1fac83);_0x527824[_0xfaf6('0x44')]='No\x20Company';}else if(_0x1b91a6[_0xfaf6('0x3e')]===_0xfaf6('0x1b')){logger['info'](_0xfaf6('0x3f'),_0x1fac83,_0x1b91a6[_0xfaf6('0x3e')]);_0x527824[_0xfaf6('0x39')]=_0x49d84f!==_0xfaf6('0x41')?_0x49d84f:util['format']('Caller\x20-\x20%s',_0x1fac83);}else{return null;}}return _0x3592bc[_0xfaf6('0x21')](_['upperFirst'](_0x1b91a6[_0xfaf6('0x3e')]))[_0xfaf6('0x22')](_0x527824)[_0xfaf6('0x28')](function(_0x3ec5fb){return BPromise[_0xfaf6('0x29')]({'id':_0x3ec5fb['id'],'endUserType':_0x1b91a6[_0xfaf6('0x3e')]});});}});}function getCustomFields(_0x3a46db,_0x5e685a){var _0x195bda={};if(_0x3a46db[_0xfaf6('0x32')]>0x0){_[_0xfaf6('0x45')](_0x3a46db,function(_0x4ebadd){if(_[_0xfaf6('0x46')]([_0xfaf6('0x47'),_0xfaf6('0x48')],_0x4ebadd[_0xfaf6('0x3c')])&&_0x4ebadd[_0xfaf6('0x49')]){_0x195bda[_0x4ebadd[_0xfaf6('0x49')]]=_0x4ebadd[_0xfaf6('0x4a')][_0xfaf6('0x4b')]();}else if(_0x4ebadd[_0xfaf6('0x3c')]===_0xfaf6('0x4c')&&_0x4ebadd['variableName']&&_0x4ebadd[_0xfaf6('0x49')]){_0x5e685a[_0x4ebadd[_0xfaf6('0x4d')]]&&(_0x195bda[_0x4ebadd['idField']]=_0x5e685a[_0x4ebadd[_0xfaf6('0x4d')]]['toString']());}else if(_0x4ebadd[_0xfaf6('0x3c')]===_0xfaf6('0x4e')&&_0x4ebadd[_0xfaf6('0x4f')]&&_0x4ebadd[_0xfaf6('0x4f')]['name']&&_0x4ebadd[_0xfaf6('0x49')]){_0x5e685a[_0x4ebadd['Variable'][_0xfaf6('0x50')][_0xfaf6('0x3d')]()]&&(_0x195bda[_0x4ebadd[_0xfaf6('0x49')]]=_0x5e685a[_0x4ebadd[_0xfaf6('0x4f')][_0xfaf6('0x50')][_0xfaf6('0x3d')]()][_0xfaf6('0x4b')]());}});}return _0x195bda;}function getConnection(_0xd8cfd){var _0x5e0447=_0xd8cfd[_0xfaf6('0x51')][_0xfaf6('0x52')](_0xd8cfd[_0xfaf6('0x53')]);var _0x3cedde=new jsforce[(_0xfaf6('0x54'))]({'oauth2':{'loginUrl':_0xd8cfd[_0xfaf6('0x55')]||'https://login.salesforce.com','clientId':_0xd8cfd[_0xfaf6('0x56')],'clientSecret':_0xd8cfd[_0xfaf6('0x57')]}});return _0x3cedde[_0xfaf6('0x58')](_0xd8cfd[_0xfaf6('0x59')],_0x5e0447)[_0xfaf6('0x28')](function(){logger[_0xfaf6('0x1f')]('Connection\x20established.');return _0x3cedde;});}exports[_0xfaf6('0x5a')]=function(_0x44467a,_0x633277,_0x1a7571,_0x404037,_0x310dfe,_0x22df86){var _0x624f92,_0x138455,_0x1494ba,_0x253882;_0x22df86['serverUrl']=intUtil[_0xfaf6('0x5b')](_0x22df86[_0xfaf6('0x5c')]);_0x22df86[_0xfaf6('0x55')]=intUtil['stripTrailingSlash'](_0x22df86['remoteUri']);if(_0x310dfe&&_0x310dfe['monitor_format']){logger['info'](_0xfaf6('0x5d'),_0xfaf6('0x5e'));_0x633277[_0xfaf6('0x5f')]=util[_0xfaf6('0x42')](_0xfaf6('0x60'),_0x22df86['serverUrl'],_0x633277['uniqueid'],md5(_0x633277['uniqueid']));}else{_0x633277[_0xfaf6('0x5f')]='';}return getConnection(_0x22df86)[_0xfaf6('0x28')](function(_0x479cda){_0x253882=_0x479cda;return getUser(_0x22df86,_0x404037[_0xfaf6('0x61')],_0x253882);})[_0xfaf6('0x28')](function(_0x4f9868){_0x624f92=_0x4f9868;return getEndUser(_0x22df86,_0x1a7571,_0x633277[_0xfaf6('0x62')],_0x633277[_0xfaf6('0x63')],_0x253882);})[_0xfaf6('0x28')](function(_0x5ee651){_0x138455=_0x5ee651;return getTicket(_0x22df86,_0x624f92,_0x138455,_0x1a7571,_0x633277,_0x1a7571[_0xfaf6('0x64')],_0x253882,'queue');})[_0xfaf6('0x28')](function(_0x514e38){_0x1494ba=_0x514e38;logger[_0xfaf6('0x1f')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x1494ba['id']);logger[_0xfaf6('0x1f')](_0xfaf6('0x65'),_0x1494ba['id'],_0x404037[_0xfaf6('0x50')],_0x22df86[_0xfaf6('0x3c')]);switch(_0x22df86[_0xfaf6('0x3c')]){case _0xfaf6('0x66'):emit(util[_0xfaf6('0x42')](_0xfaf6('0x67'),_0x404037[_0xfaf6('0x50')]),_0xfaf6('0x68'),{'recordId':_0x1494ba['id']});break;case'newTab':emit(util['format'](_0xfaf6('0x67'),_0x404037[_0xfaf6('0x50')]),_0xfaf6('0x69'),{'uri':util[_0xfaf6('0x42')](_0xfaf6('0x6a'),_0x253882[_0xfaf6('0x6b')],_0x1494ba['id'])});break;default:logger[_0xfaf6('0x6c')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xfaf6('0x6d')](function(_0xa7f12e){logger[_0xfaf6('0x6c')](_0xfaf6('0x5d'),_0xa7f12e);});};exports[_0xfaf6('0x6e')]=function(_0x503ee4,_0x7e1a57,_0x3450fb,_0x46024a,_0x572609,_0x56304e,_0x12ab67){var _0x41932b,_0x127262,_0x1da6d2,_0x3b63f4;_0x56304e[_0xfaf6('0x5c')]=intUtil['stripTrailingSlash'](_0x56304e[_0xfaf6('0x5c')]);_0x56304e[_0xfaf6('0x55')]=intUtil[_0xfaf6('0x5b')](_0x56304e[_0xfaf6('0x55')]);if(_0x12ab67&&_0x12ab67[_0xfaf6('0x6f')]&&_0x12ab67[_0xfaf6('0x6f')]!==_0xfaf6('0x70')){logger[_0xfaf6('0x1f')]('[OUTBOUND]',_0xfaf6('0x5e'));_0x7e1a57['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x56304e[_0xfaf6('0x5c')],_0x7e1a57[_0xfaf6('0x71')],md5(_0x7e1a57[_0xfaf6('0x71')]));}return getConnection(_0x56304e)[_0xfaf6('0x28')](function(_0x568b7c){_0x3b63f4=_0x568b7c;return getUser(_0x56304e,_0x46024a['email'],_0x3b63f4);})[_0xfaf6('0x28')](function(_0x1cb6b6){_0x41932b=_0x1cb6b6;return getEndUser(_0x56304e,_0x3450fb,_0x7e1a57[_0xfaf6('0x72')],_0x7e1a57[_0xfaf6('0x73')],_0x3b63f4);})[_0xfaf6('0x28')](function(_0x540754){_0x127262=_0x540754;return getTicket(_0x56304e,_0x41932b,_0x127262,_0x3450fb,_0x7e1a57,_0x3450fb[_0xfaf6('0x64')],_0x3b63f4,'outbound');})[_0xfaf6('0x28')](function(_0x1b576e){_0x1da6d2=_0x1b576e;logger[_0xfaf6('0x1f')](_0xfaf6('0x74'),_0x1da6d2['id']);logger[_0xfaf6('0x1f')](_0xfaf6('0x75'),_0x1da6d2['id'],_0x46024a[_0xfaf6('0x50')],_0x56304e['type']);switch(_0x56304e['type']){case'integrationTab':emit(util[_0xfaf6('0x42')]('user:%s',_0x46024a[_0xfaf6('0x50')]),_0xfaf6('0x68'),{'recordId':_0x1da6d2['id']});break;case _0xfaf6('0x76'):emit(util[_0xfaf6('0x42')](_0xfaf6('0x67'),_0x46024a[_0xfaf6('0x50')]),_0xfaf6('0x69'),{'uri':util[_0xfaf6('0x42')](_0xfaf6('0x6a'),_0x3b63f4['instanceUrl'],_0x1da6d2['id'])});break;default:logger[_0xfaf6('0x6c')]('[OUTBOUND]',_0xfaf6('0x77'));}})[_0xfaf6('0x6d')](function(_0x4f304a){logger[_0xfaf6('0x6c')](_0xfaf6('0x78'),_0x4f304a);});};exports[_0xfaf6('0x79')]=function(_0x2bebb5,_0x4d96d5,_0xfed7a9,_0x4909fc,_0x698610,_0x4f8645){var _0x55911a,_0x302d38,_0x147f2d,_0x1908a0;_0x4f8645[_0xfaf6('0x5c')]=intUtil[_0xfaf6('0x5b')](_0x4f8645['serverUrl']);_0x4f8645[_0xfaf6('0x55')]=intUtil[_0xfaf6('0x5b')](_0x4f8645['remoteUri']);if(_0x698610&&_0x698610['monitor_format']){logger['info']('['+_0x4d96d5['lastevent'][_0xfaf6('0x7a')]()+']',_0xfaf6('0x5e'));_0x4d96d5['recordingURL']=util[_0xfaf6('0x42')](_0xfaf6('0x60'),_0x4f8645[_0xfaf6('0x5c')],_0x4d96d5[_0xfaf6('0x71')],md5(_0x4d96d5['uniqueid']));}else{_0x4d96d5['recordingURL']='';}return getConnection(_0x4f8645)[_0xfaf6('0x28')](function(_0x51e3aa){_0x1908a0=_0x51e3aa;if(!_['isNil'](_0x4909fc)){return getUser(_0x4f8645,_0x4909fc[_0xfaf6('0x50')],_0x1908a0);}else{return getUser(_0x4f8645,null,_0x1908a0);}})['then'](function(_0x534a1a){_0x55911a=_0x534a1a;return getEndUser(_0x4f8645,_0xfed7a9,_0x4d96d5[_0xfaf6('0x62')],_0x4d96d5[_0xfaf6('0x63')],_0x1908a0);})[_0xfaf6('0x28')](function(_0x5ead3e){_0x302d38=_0x5ead3e;return getTicket(_0x4f8645,_0x55911a,_0x302d38,_0xfed7a9,_0x4d96d5,_0xfed7a9['Fields'],_0x1908a0);})['then'](function(_0x14bdc5){_0x147f2d=_0x14bdc5;logger[_0xfaf6('0x1f')]('['+_0x4d96d5[_0xfaf6('0x7b')][_0xfaf6('0x7a')]()+_0xfaf6('0x7c'),_0x147f2d['id']);logger['info']('['+_0x4d96d5[_0xfaf6('0x7b')]['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x4f8645[_0xfaf6('0x3c')]);})[_0xfaf6('0x6d')](function(_0x57bb15){logger['error']('['+_0x4d96d5[_0xfaf6('0x7b')][_0xfaf6('0x7a')]()+']',_0x57bb15);});}; \ 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 56b6a4c..5ed2dda 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 _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 +var _0xe7e5=['remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','error','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','toString','type','idField','variable','variableName','customVariable','Variable','name','POST','incident','assign','Subjects','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','Incident','ticketId','Incident\x20-\x20','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','/nav_to.do?uri=incident.do?sys_id%3D','format','username','password','sysparm_limit=1','sysparm_display_value=true'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xe7e5,0x15d));var _0x5e7e=function(_0x26b5aa,_0x2bbac5){_0x26b5aa=_0x26b5aa-0x0;var _0x3171f6=_0xe7e5[_0x26b5aa];return _0x3171f6;};'use strict';var _=require(_0x5e7e('0x0'));var Promise=require(_0x5e7e('0x1'));var rp=require(_0x5e7e('0x2'));var util=require(_0x5e7e('0x3'));var md5=require('md5');var Redis=require(_0x5e7e('0x4'));var intUtil=require(_0x5e7e('0x5'));var config=require(_0x5e7e('0x6'));var logger=require(_0x5e7e('0x7'))('servicenow');config[_0x5e7e('0x8')]=_['defaults'](config['redis'],{'host':_0x5e7e('0x9'),'port':0x18eb});var io=require(_0x5e7e('0xa'))(new Redis(config[_0x5e7e('0x8')]));function getAdminUser(_0x19815a,_0x4c4d53,_0x53133d,_0x3b816a,_0x2deae0,_0x44c809){return new Promise(function(_0x238d19,_0xeab710){var _0x1ea3f4={'method':'GET','uri':_0x3b816a+_0x5e7e('0xb')+'&'+_0x2deae0+'&'+_0x44c809,'auth':_0x4c4d53,'json':!![]};return rp(_0x1ea3f4)[_0x5e7e('0xc')](function(_0x504cb1){if(_0x504cb1[_0x5e7e('0xd')][_0x5e7e('0xe')]>0x0){_0x53133d[_0x5e7e('0xf')]=_0x504cb1[_0x5e7e('0xd')][0x0][_0x5e7e('0x10')];}logger[_0x5e7e('0x11')]('['+[_0x19815a[_0x5e7e('0x12')]()]+_0x5e7e('0x13'),_0x53133d);_0x238d19(_0x53133d);})[_0x5e7e('0x14')](function(_0x2aa917){logger['error']('['+[_0x19815a['toUpperCase']()]+']',_0x2aa917[_0x5e7e('0x15')]);_0xeab710(_0x2aa917[_0x5e7e('0x15')]);});});}function getUser(_0x3aa077,_0x584757,_0x589398,_0x5b49b9,_0x33d712){return function(_0x3a80e7){logger[_0x5e7e('0x11')]('['+[_0x3aa077['toUpperCase']()]+_0x5e7e('0x16'),_0x3a80e7);return new Promise(function(_0x2f0ba3,_0x306ade){if(intUtil[_0x5e7e('0x17')](_0x3a80e7[_0x5e7e('0x18')])){var _0x4e7885={'method':_0x5e7e('0x19'),'uri':_0x589398+'sys_user?sysparm_query=email%3D'+_0x3a80e7[_0x5e7e('0x18')]+'&'+_0x5b49b9+'&'+_0x33d712,'auth':_0x584757,'json':!![]};logger['info']('['+[_0x3aa077[_0x5e7e('0x12')]()]+_0x5e7e('0x1a'),_0x4e7885);return rp(_0x4e7885)[_0x5e7e('0xc')](function(_0x4d85f5){logger[_0x5e7e('0x11')]('['+[_0x3aa077['toUpperCase']()]+_0x5e7e('0x1b'),_0x4d85f5);if(_0x4d85f5[_0x5e7e('0xd')]['length']>0x0&&String(_0x4d85f5['result'][0x0][_0x5e7e('0x1c')])===_0x5e7e('0x1d')){_0x3a80e7[_0x5e7e('0x1e')]=_0x4d85f5[_0x5e7e('0xd')][0x0]['sys_id'];}else{_0x3a80e7[_0x5e7e('0x1e')]=_0x3a80e7[_0x5e7e('0xf')];_0x3a80e7[_0x5e7e('0x18')]=_0x3a80e7[_0x5e7e('0x1f')];}logger[_0x5e7e('0x11')]('['+[_0x3aa077['toUpperCase']()]+_0x5e7e('0x20'),_0x3a80e7);_0x2f0ba3(_0x3a80e7);})[_0x5e7e('0x14')](function(_0xcc9444){logger['error']('['+[_0x3aa077['toUpperCase']()]+']',_0xcc9444['message']);_0x306ade(_0xcc9444[_0x5e7e('0x15')]);});}else{logger[_0x5e7e('0x11')]('['+[_0x3aa077[_0x5e7e('0x12')]()]+_0x5e7e('0x21'));_0x3a80e7[_0x5e7e('0x1e')]=_0x3a80e7[_0x5e7e('0xf')];_0x3a80e7['userEmail']=_0x3a80e7[_0x5e7e('0x1f')];_0x2f0ba3(_0x3a80e7);}});};}function createEndUser(_0x325497,_0x50dd70,_0x34b85b,_0x222b3b,_0x41214f){logger[_0x5e7e('0x11')]('['+[_0x325497['toUpperCase']()]+_0x5e7e('0x22'),_0x34b85b);return new Promise(function(_0x4dac11,_0x12e00b){var _0x162b7d={'method':'POST','uri':_0x222b3b+'sys_user?'+_0x41214f,'body':{'user_name':_0x34b85b[_0x5e7e('0x23')],'roles':_0x5e7e('0x24'),'first_name':_0x34b85b['endUserNumber'],'active':_0x5e7e('0x1d'),'date_format':_0x5e7e('0x25'),'phone':_0x34b85b[_0x5e7e('0x23')]},'auth':_0x50dd70,'json':!![]};return rp(_0x162b7d)[_0x5e7e('0xc')](function(_0x1a52e9){logger['info']('['+[_0x325497[_0x5e7e('0x12')]()]+_0x5e7e('0x26'),_0x1a52e9[_0x5e7e('0xd')]);_0x34b85b[_0x5e7e('0x27')]=_0x1a52e9[_0x5e7e('0xd')][_0x5e7e('0x10')];_0x4dac11(_0x34b85b);})[_0x5e7e('0x14')](function(_0xb0e8d2){logger[_0x5e7e('0x28')]('['+[_0x325497[_0x5e7e('0x12')]()]+']',_0xb0e8d2[_0x5e7e('0x15')]);_0x12e00b(_0xb0e8d2[_0x5e7e('0x15')]);});});}function getEndUser(_0xb5f2d,_0x6887c4,_0x25cb58,_0x1903e9,_0x13d217){return function(_0x290626){logger[_0x5e7e('0x11')]('['+[_0xb5f2d[_0x5e7e('0x12')]()]+_0x5e7e('0x29'),_0x290626);return new Promise(function(_0x48008c,_0xb77567){var _0x31c207={'method':_0x5e7e('0x19'),'uri':_0x25cb58+'sys_user?sysparm_query=phone%3D'+_0x290626[_0x5e7e('0x23')]+'&'+_0x1903e9+'&'+_0x13d217,'auth':_0x6887c4,'json':!![]};return rp(_0x31c207)[_0x5e7e('0xc')](function(_0x3dcd45){if(_0x3dcd45['result'][_0x5e7e('0xe')]>0x0){_0x290626[_0x5e7e('0x27')]=_0x3dcd45[_0x5e7e('0xd')][0x0][_0x5e7e('0x10')];logger[_0x5e7e('0x11')]('['+[_0xb5f2d[_0x5e7e('0x12')]()]+_0x5e7e('0x2a'),_0x290626);_0x48008c(_0x290626);}else{return createEndUser(_0xb5f2d,_0x6887c4,_0x290626,_0x25cb58,_0x1903e9)[_0x5e7e('0xc')](function(_0x208c94){logger[_0x5e7e('0x11')]('['+[_0xb5f2d[_0x5e7e('0x12')]()]+'],\x20createEndUser\x20crm',_0x208c94);_0x48008c(_0x208c94);});}})[_0x5e7e('0x14')](function(_0x20dabe){logger['error']('['+[_0xb5f2d[_0x5e7e('0x12')]()]+']',_0x20dabe['message']);_0xb77567(_0x20dabe[_0x5e7e('0x15')]);});});};}function getCustomFields(_0x14e21b,_0x38474c){var _0x17ccd7={};if(_0x14e21b[_0x5e7e('0xe')]>0x0){_[_0x5e7e('0x2b')](_0x14e21b,function(_0x43f91d){if(_[_0x5e7e('0x2c')]([_0x5e7e('0x2d'),_0x5e7e('0x2e')],_0x43f91d['type'])&&_0x43f91d[_0x5e7e('0x2f')]&&!_0x43f91d[_0x5e7e('0x30')]){_0x17ccd7[_0x43f91d['nameField'][_0x5e7e('0x31')]()]=_0x43f91d[_0x5e7e('0x32')][_0x5e7e('0x33')]();}else if(_[_0x5e7e('0x2c')](['string',_0x5e7e('0x2e')],_0x43f91d[_0x5e7e('0x34')])&&_0x43f91d[_0x5e7e('0x35')]&&_0x43f91d[_0x5e7e('0x30')]){_0x17ccd7[_0x43f91d[_0x5e7e('0x35')][_0x5e7e('0x31')]()]=_0x43f91d['content'][_0x5e7e('0x33')]();}else if(_0x43f91d[_0x5e7e('0x34')]===_0x5e7e('0x36')&&_0x43f91d[_0x5e7e('0x37')]&&_0x43f91d[_0x5e7e('0x35')]&&_0x43f91d[_0x5e7e('0x30')]){_0x17ccd7[_0x43f91d['idField'][_0x5e7e('0x31')]()]=_0x38474c[_0x43f91d['variableName']][_0x5e7e('0x33')]();}else if(_0x43f91d['type']===_0x5e7e('0x38')&&_0x43f91d[_0x5e7e('0x39')]&&_0x43f91d[_0x5e7e('0x39')]['name']&&_0x43f91d[_0x5e7e('0x35')]&&_0x43f91d[_0x5e7e('0x30')]){_0x17ccd7[_0x43f91d[_0x5e7e('0x35')]['toLowerCase']()]=_0x38474c[_0x43f91d[_0x5e7e('0x39')][_0x5e7e('0x3a')][_0x5e7e('0x31')]()][_0x5e7e('0x33')]();}});}return _0x17ccd7;}function getTicket(_0x3a50b0,_0x4fe661,_0x2bcaa1,_0x1d9ee6,_0x505d77,_0x16c0b8){return function(_0x5d6883){logger[_0x5e7e('0x11')]('['+[_0x3a50b0[_0x5e7e('0x12')]()]+']\x20getTicket\x20input\x20crm',_0x5d6883);return new Promise(function(_0x28502f,_0xe5bb46){var _0x314beb=_0x3a50b0['toLowerCase']()==='outbound'?_0x5d6883[_0x5e7e('0x1e')]:_0x5d6883[_0x5e7e('0x27')];var _0x55217c={'method':_0x5e7e('0x3b'),'uri':_0x2bcaa1+_0x5e7e('0x3c')+'?'+_0x16c0b8,'body':Object[_0x5e7e('0x3d')]({},{'active':_0x5e7e('0x1d'),'caller_id':_0x314beb,'assigned_to':_0x5d6883['userId'],'short_description':intUtil['getString'](_0x1d9ee6[_0x5e7e('0x3e')],_0x505d77,'\x20'),'description':intUtil[_0x5e7e('0x3f')](_0x1d9ee6[_0x5e7e('0x40')],_0x505d77,'\x0a')},getCustomFields(_0x1d9ee6[_0x5e7e('0x41')],_0x505d77)),'auth':_0x4fe661,'json':!![]};return rp(_0x55217c)[_0x5e7e('0xc')](function(_0x3f78c3){logger[_0x5e7e('0x11')]('['+[_0x3a50b0[_0x5e7e('0x12')]()]+_0x5e7e('0x42'),_0x3f78c3['result']);_0x5d6883['ticketId']=_0x3f78c3[_0x5e7e('0xd')][_0x5e7e('0x10')];_0x5d6883[_0x5e7e('0x43')]=_0x3f78c3[_0x5e7e('0xd')][_0x5e7e('0x44')];logger['info']('['+[_0x3a50b0[_0x5e7e('0x12')]()]+_0x5e7e('0x45'),_0x5d6883);_0x28502f(_0x5d6883);})[_0x5e7e('0x14')](function(_0x3de8a7){logger[_0x5e7e('0x28')]('['+[_0x3a50b0[_0x5e7e('0x12')]()]+']',_0x3de8a7[_0x5e7e('0x15')]);_0xe5bb46(_0x3de8a7[_0x5e7e('0x15')]);});});};}function createRemoteTag(_0x46e507,_0x41f7d0,_0x323403,_0x23dd13){return new Promise(function(_0x5a4e80,_0x437ef0){var _0x35106d={'method':_0x5e7e('0x3b'),'uri':_0x323403+_0x5e7e('0x46')+'?'+_0x23dd13,'body':{'short_description':_0x46e507,'global':!![],'active':!![],'name':_0x46e507},'auth':_0x41f7d0,'json':!![]};return rp(_0x35106d)[_0x5e7e('0xc')](function(_0x3ebdbe){var _0x49de2c=_0x3ebdbe[_0x5e7e('0xd')][_0x5e7e('0x10')];_0x5a4e80(_0x49de2c);});});}function getRemoteTag(_0x92be30,_0x1b18e1,_0x3e4ac5,_0x94ec7f,_0x83fd82){return new Promise(function(_0x468386,_0x237b99){var _0x2be03f={'method':_0x5e7e('0x19'),'uri':_0x3e4ac5+_0x5e7e('0x46')+'?sysparm_query=name%3D'+_0x92be30+'&'+_0x94ec7f,'auth':_0x1b18e1,'json':!![]};return rp(_0x2be03f)[_0x5e7e('0xc')](function(_0x4b13ee){if(_0x4b13ee[_0x5e7e('0xd')][_0x5e7e('0xe')]>0x0){var _0x19f720=_0x4b13ee[_0x5e7e('0xd')][0x0][_0x5e7e('0x10')];_0x468386(_0x19f720);}else{return createRemoteTag(_0x92be30,_0x1b18e1,_0x3e4ac5,_0x94ec7f)[_0x5e7e('0xc')](function(_0x35bd58){_0x468386(_0x35bd58);});}});});}function assignTagToIncident(_0x359b6e,_0x3e714c,_0x580be2,_0x19ec97,_0x527daf){return new Promise(function(_0x4f008f,_0xa4e788){var _0x267209={'method':'POST','uri':_0x580be2+_0x5e7e('0x47')+'?'+_0x527daf,'body':{'label':_0x359b6e,'table':_0x5e7e('0x3c'),'id_type':_0x5e7e('0x48'),'table_key':_0x19ec97[_0x5e7e('0x49')],'title':_0x5e7e('0x4a')+_0x19ec97['ticketNumber'],'id_display':_0x19ec97['ticketNumber']},'auth':_0x3e714c,'json':!![]};return rp(_0x267209)[_0x5e7e('0xc')](function(_0xac5bbe){_0x4f008f();})[_0x5e7e('0x14')](function(){_0x4f008f();});});}function manageTags(_0xd1e425,_0x510aca,_0x2d943e,_0x6cdebe,_0x5a0c59,_0x1a0450,_0x357aa5){return new Promise(function(_0x21173a,_0x51536d){var _0x1e95eb=[];_0x510aca[_0x5e7e('0x2b')](function(_0x31263f){_0x1e95eb[_0x5e7e('0x4b')](getRemoteTag(_0x31263f,_0x2d943e,_0x6cdebe,_0x1a0450,_0x357aa5));});return Promise[_0x5e7e('0x4c')](_0x1e95eb)['then'](function(_0x3614f4){if(_0x3614f4[_0x5e7e('0xe')]){logger[_0x5e7e('0x11')]('['+[_0xd1e425[_0x5e7e('0x12')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x3614f4);var _0x441c3b=[];_0x3614f4[_0x5e7e('0x2b')](function(_0x424b51){_0x441c3b[_0x5e7e('0x4b')](assignTagToIncident(_0x424b51,_0x2d943e,_0x6cdebe,_0x5a0c59,_0x1a0450));});return Promise['all'](_0x441c3b)[_0x5e7e('0xc')](function(){_0x21173a();})[_0x5e7e('0x14')](function(){_0x21173a();});}else{_0x21173a();}});});}function getTags(_0x1b7ea4,_0x25b4ec,_0x580ea8,_0x2a04ca,_0x4a1a27,_0x420c34){return function(_0x2783d6){return new Promise(function(_0x5d58b9,_0x5eacf8){var _0x20465e=[];var _0x4b361a=_0x2a04ca[_0x5e7e('0x4d')];if(_0x4b361a&&_0x4b361a[_0x5e7e('0xe')]>0x0){_0x20465e=_[_0x5e7e('0x4e')](_0x4b361a,_0x5e7e('0x3a'));}if(_0x20465e[_0x5e7e('0xe')]>0x0){return manageTags(_0x1b7ea4,_0x20465e,_0x25b4ec,_0x580ea8,_0x2783d6,_0x4a1a27,_0x420c34)[_0x5e7e('0xc')](function(){_0x5d58b9(_0x2783d6);});}else{_0x5d58b9(_0x2783d6);}});};}function emit(_0x43dafe,_0x5ef53a,_0x2fccb6){var _0x215c33=_0x5e7e('0x4f')+_0x5e7e('0x50')+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x510846={'uri':_0x43dafe+_0x5e7e('0x51')+_0x2fccb6+_0x215c33};io['to'](util[_0x5e7e('0x52')]('user:%s',_0x5ef53a))['emit']('trigger:browser:url',_0x510846);}exports['cs']=function(_0x8724c,_0x53ddb9,_0x2a39d9,_0x4dcff5,_0x27d19a,_0xf959a1,_0x3f8ff9,_0x5bfac5){var _0x46f790={};var _0x5652c0={'user':_0xf959a1[_0x5e7e('0x53')],'pass':_0xf959a1[_0x5e7e('0x54')]};var _0x2b7918=_0x5e7e('0x55');var _0x11ebd4=_0x5e7e('0x56');_0xf959a1[_0x5e7e('0x57')]=intUtil[_0x5e7e('0x58')](_0xf959a1[_0x5e7e('0x57')]);_0xf959a1[_0x5e7e('0x59')]=intUtil[_0x5e7e('0x58')](_0xf959a1['serverUrl']);var _0x43c740=util['format'](_0x5e7e('0x5a'),_0xf959a1['remoteUri']);_0x46f790[_0x5e7e('0x18')]=!_['isNil'](_0x4dcff5)?_0x4dcff5[_0x5e7e('0x5b')]:null;_0x46f790[_0x5e7e('0x1f')]=_0xf959a1[_0x5e7e('0x5b')];_0x46f790[_0x5e7e('0x23')]=_0x5bfac5[_0x5e7e('0x31')]()==='outbound'?_0x53ddb9[_0x5e7e('0x5c')]:_0x53ddb9[_0x5e7e('0x5d')];_0x46f790[_0x5e7e('0x5e')]=_0x5bfac5===_0x5e7e('0x5f')||_0x5bfac5===_0x5e7e('0x60')?'queue':_0x5e7e('0x61');var _0x4b9711=util[_0x5e7e('0x52')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xf959a1['serverUrl'],_0x53ddb9[_0x5e7e('0x62')],md5(_0x53ddb9[_0x5e7e('0x62')]));if(_0x27d19a&&_0x27d19a[_0x5e7e('0x63')]){logger['info'](_0x5e7e('0x64'),_0x5e7e('0x65'));_0x53ddb9[_0x5e7e('0x66')]=_0x4b9711;}else if(_0x3f8ff9&&_0x3f8ff9['recordingFormat']&&_0x3f8ff9[_0x5e7e('0x67')]!==_0x5e7e('0x68')){logger[_0x5e7e('0x11')](_0x5e7e('0x69'),_0x5e7e('0x65'));_0x53ddb9['recordingURL']=_0x4b9711;}else{_0x53ddb9[_0x5e7e('0x66')]='';}return getAdminUser(_0x5bfac5,_0x5652c0,_0x46f790,_0x43c740,_0x11ebd4,_0x2b7918)[_0x5e7e('0xc')](getUser(_0x5bfac5,_0x5652c0,_0x43c740,_0x11ebd4,_0x2b7918))[_0x5e7e('0xc')](getEndUser(_0x5bfac5,_0x5652c0,_0x43c740,_0x11ebd4,_0x2b7918))[_0x5e7e('0xc')](getTicket(_0x5bfac5,_0x5652c0,_0x43c740,_0x2a39d9,_0x53ddb9,_0x11ebd4))[_0x5e7e('0xc')](function(_0xd42ee2){logger[_0x5e7e('0x11')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0xd42ee2[_0x5e7e('0x49')]));logger[_0x5e7e('0x11')](util[_0x5e7e('0x52')]('call\x20direction:\x20%s',_0x5bfac5));if(_0x5bfac5!==_0x5e7e('0x60')){logger['info']('['+[_0x5bfac5['toUpperCase']()]+']',_0x5e7e('0x6a'));emit(_0xf959a1['remoteUri'],_0x4dcff5[_0x5e7e('0x3a')],_0xd42ee2[_0x5e7e('0x49')]);}})['catch'](function(_0x553188){logger[_0x5e7e('0x28')]('['+[_0x5bfac5[_0x5e7e('0x12')]()]+_0x5e7e('0x6b'),util[_0x5e7e('0x6c')](_0x553188,{'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 4b028a3..fc84ddf 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 _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 +var _0x229a=['toLowerCase','content','idField','variable','custom_fields','customVariable','Variable','push','login','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','destcalleridname','destcalleridnum','Outbound','version','[OUTBOUND]','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','calleridname','lodash','request-promise','bluebird','ioredis','./util','../../../../config/environment','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','created_by','description','getString','Descriptions','toISOString','slice','duration_hours','duration_minutes','parent_type','Contacts','direction','forEach','variableName','set_entry','JSON','Basic\x20%s','apiKey','toString','base64','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','value','Agent\x20found!','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','phone_home','length','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','type','string','nameField','customField'];(function(_0x31713a,_0x33d4a6){var _0x1f8505=function(_0x278445){while(--_0x278445){_0x31713a['push'](_0x31713a['shift']());}};_0x1f8505(++_0x33d4a6);}(_0x229a,0x12d));var _0xa229=function(_0x2295a2,_0x1ad405){_0x2295a2=_0x2295a2-0x0;var _0x371f46=_0x229a[_0x2295a2];return _0x371f46;};'use strict';var _=require(_0xa229('0x0'));var rp=require(_0xa229('0x1'));var BPromise=require(_0xa229('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0xa229('0x3'));var intUtil=require(_0xa229('0x4'));var config=require(_0xa229('0x5'));var logger=require('../../../../config/logger')(_0xa229('0x6'));config[_0xa229('0x7')]=_[_0xa229('0x8')](config[_0xa229('0x7')],{'host':_0xa229('0x9'),'port':0x18eb});var io=require(_0xa229('0xa'))(new Redis(config[_0xa229('0x7')]));var def={'method':_0xa229('0xb'),'json':!![]};function emit(_0xc4ad54,_0x4fe06f,_0x4410e4){io['to'](_0xc4ad54)[_0xa229('0xc')](_0x4fe06f,_0x4410e4);}function getTicket(_0x42a7d0,_0x281ee3,_0x4a3f36,_0x3a70b9,_0x55e76c,_0x260973,_0x12132c,_0xffeedd){logger[_0xa229('0xd')](_0xa229('0xe'));var _0x32e5bf=new Date();var _0x37102a=[{'name':_0xa229('0xf'),'value':intUtil['getString'](_0x3a70b9[_0xa229('0x10')],_0x55e76c,'\x20')},{'name':_0xa229('0x11'),'value':_0x281ee3['id']},{'name':_0xa229('0x12'),'value':_0x281ee3['id']},{'name':_0xa229('0x13'),'value':intUtil[_0xa229('0x14')](_0x3a70b9[_0xa229('0x15')],_0x55e76c,'\x0a')},{'name':'date_start','value':_0x32e5bf[_0xa229('0x16')]()[_0xa229('0x17')](0x0,0x13)['replace']('T','\x20')},{'name':_0xa229('0x18'),'value':'0'},{'name':_0xa229('0x19'),'value':'15'},{'name':'parent_id','value':_0x4a3f36['id']},{'name':_0xa229('0x1a'),'value':_0xa229('0x1b')},{'name':'parent_name','value':_0x4a3f36[_0xa229('0xf')]},{'name':_0xa229('0x1c'),'value':_0xffeedd}];if(_0x260973['length']){_[_0xa229('0x1d')](_0x260973,function(_0x251c09){if(_0x55e76c[_0x251c09['variableName']]){_0x37102a['push']({'name':_0x251c09['idField'],'value':_0x55e76c[_0x251c09[_0xa229('0x1e')]]});}});}return request({'form':{'method':_0xa229('0x1f'),'input_type':_0xa229('0x20'),'response_type':_0xa229('0x20'),'rest_data':JSON['stringify']({'session':_0x12132c['id'],'module_name':'Calls','name_value_list':_0x37102a})}});}function getAuth(_0x10ccdc){return util['format'](_0xa229('0x21'),new Buffer(_0x10ccdc[_0xa229('0x22')]+':X')[_0xa229('0x23')](_0xa229('0x24')));}function getServerInfo(_0x4b17d3){return request({'form':{'method':_0xa229('0x25'),'input_type':_0xa229('0x20'),'response_type':'JSON','rest_data':JSON[_0xa229('0x26')]({'session':_0x4b17d3['id']})}});}function getUser(_0x9433f1,_0x10b46d,_0x2bb022){if(!_[_0xa229('0x27')](_0x10b46d)){logger[_0xa229('0xd')](_0xa229('0x28'),_0x10b46d);return request({'form':{'method':_0xa229('0x29'),'input_type':_0xa229('0x20'),'response_type':_0xa229('0x20'),'rest_data':JSON[_0xa229('0x26')]({'session':_0x2bb022['id'],'module_name':_0xa229('0x2a'),'query':util[_0xa229('0x2b')](_0xa229('0x2c'),_0x10b46d),'order_by':'','offset':'0','select_fields':['id',_0xa229('0xf'),_0xa229('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa229('0x2e')](function(_0x20282b){if(_0x20282b[_0xa229('0x2f')]['length']){var _0x247ade=_['find'](_0x20282b[_0xa229('0x2f')],function(_0x12a9b1){return _0x12a9b1['name_value_list']['user_name'][_0xa229('0x30')]===_0x10b46d;});if(_0x247ade){logger['info'](_0xa229('0x31'));return BPromise['resolve']({'id':_0x247ade[_0xa229('0x32')]['id']['value'],'name':_0x247ade['name_value_list'][_0xa229('0xf')][_0xa229('0x30')]});}}logger['info'](_0xa229('0x33'));return BPromise[_0xa229('0x34')]({'id':_0x2bb022[_0xa229('0x32')]['user_id'][_0xa229('0x30')],'name':_0x2bb022[_0xa229('0x32')]['user_name'][_0xa229('0x30')]});});}else{logger[_0xa229('0xd')](_0xa229('0x35'));return BPromise[_0xa229('0x34')]({'id':_0x2bb022[_0xa229('0x32')][_0xa229('0x36')][_0xa229('0x30')],'name':_0x2bb022['name_value_list'][_0xa229('0x2d')][_0xa229('0x30')]});}}function getEndUser(_0x556032,_0x42a2a,_0x3853a1,_0x5a36cb){logger[_0xa229('0xd')]('Searching\x20enduser\x20with\x20phone',_0x3853a1);return request({'form':{'method':_0xa229('0x29'),'input_type':_0xa229('0x20'),'response_type':_0xa229('0x20'),'rest_data':JSON[_0xa229('0x26')]({'session':_0x5a36cb['id'],'module_name':_0xa229('0x1b'),'query':util[_0xa229('0x2b')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x3853a1),'order_by':'','offset':'0','select_fields':['id',_0xa229('0xf'),_0xa229('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa229('0x2e')](function(_0x2841d2){if(_0x2841d2[_0xa229('0x2f')][_0xa229('0x38')]){var _0x47b51b=_[_0xa229('0x39')](_0x2841d2[_0xa229('0x2f')],function(_0x226ac6){return _0x226ac6[_0xa229('0x32')]['phone_home'][_0xa229('0x30')]===_0x3853a1;});if(_0x47b51b){logger[_0xa229('0xd')](_0xa229('0x3a'));return BPromise[_0xa229('0x34')]({'id':_0x47b51b[_0xa229('0x32')]['id'][_0xa229('0x30')],'name':_0x47b51b[_0xa229('0x32')][_0xa229('0xf')][_0xa229('0x30')],'phone':_0x47b51b[_0xa229('0x32')]['phone_home'][_0xa229('0x30')]});}}else{logger[_0xa229('0xd')](_0xa229('0x3b'));return request({'form':{'method':_0xa229('0x1f'),'input_type':_0xa229('0x20'),'response_type':_0xa229('0x20'),'rest_data':JSON[_0xa229('0x26')]({'session':_0x5a36cb['id'],'module_name':_0xa229('0x1b'),'name_value_list':[{'name':_0xa229('0x3c'),'value':_0x42a2a!==_0xa229('0x3d')?_0x42a2a:util['format'](_0xa229('0x3e'),_0x3853a1)},{'name':_0xa229('0x37'),'value':_0x3853a1}]})}})['then'](function(_0x483082){logger[_0xa229('0xd')](_0xa229('0x3f'));return BPromise['resolve']({'id':_0x483082['id'],'name':_0x483082[_0xa229('0x2f')][_0xa229('0x3c')][_0xa229('0x30')],'phone':_0x483082[_0xa229('0x2f')]['phone_home']['value']});});}});}function request(_0x4b80a1){logger[_0xa229('0x40')](_0xa229('0x41'),JSON[_0xa229('0x26')](_0x4b80a1));return rp(_[_0xa229('0x42')](def,_0x4b80a1));}function getTags(_0x1c685b,_0x45f23a){var _0x5124db=[];if(_0x1c685b&&_0x1c685b[_0xa229('0x38')]>0x0){_0x5124db=_['map'](_0x1c685b,_0x45f23a);}return _0x5124db;}function getCustomFields(_0x45f4d4,_0x44f26f){var _0x260829=[];var _0x3d587d={'custom_fields':[]};if(_0x45f4d4[_0xa229('0x38')]>0x0){_['forEach'](_0x45f4d4,function(_0x2d67f2){if(_0x2d67f2[_0xa229('0x43')]===_0xa229('0x44')&&_0x2d67f2[_0xa229('0x45')]&&!_0x2d67f2[_0xa229('0x46')]){_0x3d587d[_0x2d67f2[_0xa229('0x45')][_0xa229('0x47')]()]=_0x2d67f2[_0xa229('0x48')][_0xa229('0x23')]();}else if(_0x2d67f2[_0xa229('0x43')]==='string'&&_0x2d67f2[_0xa229('0x49')]&&_0x2d67f2[_0xa229('0x46')]){_0x3d587d['custom_fields']['push']({'id':_0x2d67f2[_0xa229('0x49')],'value':_0x2d67f2['content'][_0xa229('0x23')]()});}else if(_0x2d67f2[_0xa229('0x43')]===_0xa229('0x4a')&&_0x2d67f2[_0xa229('0x1e')]&&_0x2d67f2[_0xa229('0x49')]&&_0x2d67f2[_0xa229('0x46')]){_0x44f26f[_0x2d67f2['variableName']]&&_0x3d587d[_0xa229('0x4b')]['push']({'id':_0x2d67f2['idField'],'value':_0x44f26f[_0x2d67f2[_0xa229('0x1e')]][_0xa229('0x23')]()});}else if(_0x2d67f2[_0xa229('0x43')]===_0xa229('0x4c')&&_0x2d67f2[_0xa229('0x4d')]&&_0x2d67f2[_0xa229('0x4d')][_0xa229('0xf')]&&_0x2d67f2[_0xa229('0x49')]&&_0x2d67f2[_0xa229('0x46')]){_0x44f26f[_0x2d67f2[_0xa229('0x4d')]['name'][_0xa229('0x47')]()]&&_0x3d587d[_0xa229('0x4b')][_0xa229('0x4e')]({'id':_0x2d67f2[_0xa229('0x49')],'value':_0x44f26f[_0x2d67f2[_0xa229('0x4d')]['name']['toLowerCase']()][_0xa229('0x23')]()});}});}return _0x3d587d;}function getConnection(_0x558d0b){return request({'method':'POST','form':{'method':_0xa229('0x4f'),'input_type':_0xa229('0x20'),'response_type':_0xa229('0x20'),'rest_data':JSON[_0xa229('0x26')]({'user_auth':{'user_name':_0x558d0b['username'],'password':_0x558d0b[_0xa229('0x50')],'encryption':'PLAIN'},'application':_0xa229('0x51')})}})['then'](function(_0x267e69){var _0x27670e=_0x267e69;if(_0x27670e['id']){def[_0xa229('0x52')]=_0x27670e['id'];return BPromise[_0xa229('0x34')](_0x27670e);}else{throw new Error(util['format'](_0xa229('0x53'),_0x558d0b['id']));}});}function setRelationship(_0x3c1a97,_0x278661,_0x1c8d37,_0x3b9027){return request({'form':{'method':_0xa229('0x54'),'input_type':'JSON','response_type':_0xa229('0x20'),'rest_data':JSON['stringify']({'session':_0x3c1a97['id'],'module_name':_0xa229('0x55'),'module_id':_0x1c8d37['id'],'link_field_name':_0x3b9027,'related_ids':[_0x278661['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x47813f,_0x3c9416,_0x5e1838,_0x5d51d7,_0x21857c,_0x9b7fda){var _0x472c16,_0x12ca58,_0x2e03fa,_0x1ba02b;_0x9b7fda[_0xa229('0x56')]=intUtil[_0xa229('0x57')](_0x9b7fda[_0xa229('0x56')]);_0x9b7fda[_0xa229('0x58')]=intUtil[_0xa229('0x57')](_0x9b7fda['serverUrl']);def[_0xa229('0x59')]=util['format'](_0xa229('0x5a'),_0x9b7fda[_0xa229('0x56')]);if(_0x21857c&&_0x21857c[_0xa229('0x5b')]){logger[_0xa229('0xd')](_0xa229('0x5c'),_0xa229('0x5d'));_0x3c9416[_0xa229('0x5e')]=util[_0xa229('0x2b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x9b7fda['serverUrl'],_0x3c9416[_0xa229('0x5f')],md5(_0x3c9416[_0xa229('0x5f')]));}else{_0x3c9416[_0xa229('0x5e')]='';}return getConnection(_0x9b7fda)['then'](function(_0x184cfd){_0x1ba02b=_0x184cfd;return getUser(_0x9b7fda,_0x5d51d7['name'],_0x1ba02b);})[_0xa229('0x2e')](function(_0x5e2159){_0x472c16=_0x5e2159;logger[_0xa229('0xd')]('The\x20User\x20ID\x20is:',_0x472c16['id']);return getEndUser(_0x9b7fda,_0x3c9416['calleridname'],_0x3c9416[_0xa229('0x60')],_0x1ba02b);})[_0xa229('0x2e')](function(_0x303ce4){_0x12ca58=_0x303ce4;logger[_0xa229('0xd')](_0xa229('0x61'),_0x12ca58['id']);return getTicket(_0x9b7fda,_0x472c16,_0x12ca58,_0x5e1838,_0x3c9416,_0x5e1838[_0xa229('0x62')],_0x1ba02b,_0xa229('0x63'));})['then'](function(_0x5efe87){_0x2e03fa=_0x5efe87;logger[_0xa229('0xd')](_0xa229('0x64'));logger[_0xa229('0xd')](_0xa229('0x65'),_0x2e03fa['id']);return setRelationship(_0x1ba02b,_0x472c16,_0x2e03fa,_0xa229('0x66'));})[_0xa229('0x2e')](function(){return setRelationship(_0x1ba02b,_0x12ca58,_0x2e03fa,_0xa229('0x67'));})[_0xa229('0x2e')](function(){return getServerInfo(_0x1ba02b);})[_0xa229('0x2e')](function(_0x555311){var _0xe68c47=parseInt(_0x555311['version'][_0xa229('0x68')](0x0));var _0x1156ee=util[_0xa229('0x2b')](_0xa229('0x69'),_0x9b7fda[_0xa229('0x56')],_0x2e03fa['id']);if(_0xe68c47>0x6){_0x1156ee=util['format'](_0xa229('0x6a'),_0x9b7fda[_0xa229('0x56')],_0x2e03fa['id']);}logger[_0xa229('0xd')](_0xa229('0x5c'),_0xa229('0x6b'));emit(util[_0xa229('0x2b')](_0xa229('0x6c'),_0x5d51d7[_0xa229('0xf')]),_0xa229('0x6d'),{'uri':_0x1156ee});})[_0xa229('0x6e')](function(_0xfa9ac2){logger[_0xa229('0x6f')](_0xa229('0x5c'),JSON[_0xa229('0x26')](_0xfa9ac2));});};exports[_0xa229('0x70')]=function(_0x45d809,_0x46d44b,_0xac0369,_0x3fa30a,_0x3dd708,_0x2d4402,_0x5f5c12){var _0x40e6c1,_0x1675b1,_0x4fdf80,_0x438af9;_0x2d4402[_0xa229('0x56')]=intUtil[_0xa229('0x57')](_0x2d4402[_0xa229('0x56')]);_0x2d4402['serverUrl']=intUtil[_0xa229('0x57')](_0x2d4402[_0xa229('0x58')]);def[_0xa229('0x59')]=util[_0xa229('0x2b')]('%s/service/v4_1/rest.php',_0x2d4402[_0xa229('0x56')]);if(_0x5f5c12&&_0x5f5c12[_0xa229('0x71')]&&_0x5f5c12[_0xa229('0x71')]!=='none'){logger['info']('[OUTBOUND]',_0xa229('0x5d'));_0x46d44b[_0xa229('0x5e')]=util[_0xa229('0x2b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2d4402[_0xa229('0x58')],_0x46d44b['uniqueid'],md5(_0x46d44b[_0xa229('0x5f')]));}return getConnection(_0x2d4402)[_0xa229('0x2e')](function(_0x4738f0){_0x438af9=_0x4738f0;return getUser(_0x2d4402,_0x3fa30a[_0xa229('0xf')],_0x438af9);})[_0xa229('0x2e')](function(_0x6e4d8d){_0x40e6c1=_0x6e4d8d;logger['info']('The\x20User\x20ID\x20is:',_0x40e6c1['id']);return getEndUser(_0x2d4402,_0x46d44b[_0xa229('0x72')],_0x46d44b[_0xa229('0x73')],_0x438af9);})[_0xa229('0x2e')](function(_0x551d71){_0x1675b1=_0x551d71;logger[_0xa229('0xd')](_0xa229('0x61'),_0x1675b1['id']);return getTicket(_0x2d4402,_0x40e6c1,_0x1675b1,_0xac0369,_0x46d44b,_0xac0369[_0xa229('0x62')],_0x438af9,_0xa229('0x74'));})[_0xa229('0x2e')](function(_0x4e31d8){_0x4fdf80=_0x4e31d8;logger['info']('Ticket\x20created!');logger[_0xa229('0xd')]('The\x20Ticket\x20ID\x20is:',_0x4fdf80['id']);return setRelationship(_0x438af9,_0x40e6c1,_0x4fdf80,'users');})[_0xa229('0x2e')](function(){return setRelationship(_0x438af9,_0x1675b1,_0x4fdf80,_0xa229('0x67'));})[_0xa229('0x2e')](function(){return getServerInfo(_0x438af9);})[_0xa229('0x2e')](function(_0x176dd7){var _0x652929=parseInt(_0x176dd7[_0xa229('0x75')][_0xa229('0x68')](0x0));var _0x24e912=util['format'](_0xa229('0x69'),_0x2d4402['remoteUri'],_0x4fdf80['id']);if(_0x652929>0x6){_0x24e912=util['format'](_0xa229('0x6a'),_0x2d4402[_0xa229('0x56')],_0x4fdf80['id']);}logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xa229('0x2b')](_0xa229('0x6c'),_0x3fa30a['name']),_0xa229('0x6d'),{'uri':_0x24e912});})[_0xa229('0x6e')](function(_0x597854){logger[_0xa229('0x6f')](_0xa229('0x76'),JSON[_0xa229('0x26')](_0x597854));});};exports['unmanaged']=function(_0x38cf27,_0x230d27,_0x18b486,_0x42d315,_0x4f7ff9,_0x58863b){var _0x172a78,_0x5d9e1a,_0x150d7c,_0x18fd4e;_0x58863b[_0xa229('0x56')]=intUtil['stripTrailingSlash'](_0x58863b['remoteUri']);_0x58863b[_0xa229('0x58')]=intUtil[_0xa229('0x57')](_0x58863b[_0xa229('0x58')]);def[_0xa229('0x59')]=util[_0xa229('0x2b')](_0xa229('0x5a'),_0x58863b['remoteUri']);if(_0x4f7ff9&&_0x4f7ff9[_0xa229('0x5b')]){logger['info']('['+_0x230d27[_0xa229('0x77')][_0xa229('0x78')]()+']',_0xa229('0x5d'));_0x230d27['recordingURL']=util[_0xa229('0x2b')](_0xa229('0x79'),_0x58863b[_0xa229('0x58')],_0x230d27[_0xa229('0x5f')],md5(_0x230d27[_0xa229('0x5f')]));}else{_0x230d27[_0xa229('0x5e')]='';}return getConnection(_0x58863b)[_0xa229('0x2e')](function(_0x5298a6){_0x18fd4e=_0x5298a6;if(!_[_0xa229('0x27')](_0x42d315)){return getUser(_0x58863b,_0x42d315[_0xa229('0xf')],_0x18fd4e);}else{return getUser(_0x58863b,null,_0x18fd4e);}})[_0xa229('0x2e')](function(_0x1bda06){_0x172a78=_0x1bda06;logger['info'](_0xa229('0x7a'),_0x172a78['id']);return getEndUser(_0x58863b,_0x230d27[_0xa229('0x7b')],_0x230d27[_0xa229('0x60')],_0x18fd4e);})[_0xa229('0x2e')](function(_0x2e50f6){_0x5d9e1a=_0x2e50f6;logger['info'](_0xa229('0x61'),_0x5d9e1a['id']);return getTicket(_0x58863b,_0x172a78,_0x5d9e1a,_0x18b486,_0x230d27,_0x18b486[_0xa229('0x62')],_0x18fd4e,_0xa229('0x63'));})[_0xa229('0x2e')](function(_0x46c482){_0x150d7c=_0x46c482;logger[_0xa229('0xd')](_0xa229('0x64'));logger[_0xa229('0xd')](_0xa229('0x65'),_0x150d7c['id']);return setRelationship(_0x18fd4e,_0x172a78,_0x150d7c,'users');})[_0xa229('0x2e')](function(){return setRelationship(_0x18fd4e,_0x5d9e1a,_0x150d7c,_0xa229('0x67'));})[_0xa229('0x2e')](function(){return getServerInfo(_0x18fd4e);})['catch'](function(_0x588070){logger[_0xa229('0x6f')]('['+_0x230d27[_0xa229('0x77')]['toUpperCase']()+']',JSON['stringify'](_0x588070));});}; \ 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 3427d47..788b6e1 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 _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 +var _0x29f4=['keyValue','keyType','format','%s:\x20%s','key','keyContent','join','slice','substring','lastIndexOf','isNil','test','lodash','util','length','sortBy','type','string','variableName','toString','customVariable','Variable','name','toLowerCase','push'];(function(_0x37222f,_0x25a5ab){var _0x5c5a6d=function(_0x27218b){while(--_0x27218b){_0x37222f['push'](_0x37222f['shift']());}};_0x5c5a6d(++_0x25a5ab);}(_0x29f4,0x19c));var _0x429f=function(_0x2367e1,_0xb325a0){_0x2367e1=_0x2367e1-0x0;var _0x356dc8=_0x29f4[_0x2367e1];return _0x356dc8;};'use strict';var _=require(_0x429f('0x0'));var util=require(_0x429f('0x1'));exports['getString']=function(_0x16c605,_0x444d6e,_0x33295e){var _0x27c46a=[];if(_0x16c605[_0x429f('0x2')]>0x0){var _0x10e3ca=_[_0x429f('0x3')](_0x16c605,['id']);for(var _0x491048=0x0;_0x491048<_0x10e3ca[_0x429f('0x2')];_0x491048++){var _0x12c2d5=_0x10e3ca[_0x491048];if(_0x12c2d5[_0x429f('0x4')]===_0x429f('0x5')){_0x27c46a['push'](_0x12c2d5['content']);}else if(_0x12c2d5[_0x429f('0x4')]==='variable'&&_0x12c2d5[_0x429f('0x6')]){_0x444d6e[_0x12c2d5[_0x429f('0x6')]]&&_0x27c46a['push'](_0x444d6e[_0x12c2d5['variableName']][_0x429f('0x7')]());}else if(_0x12c2d5[_0x429f('0x4')]===_0x429f('0x8')&&_0x12c2d5[_0x429f('0x9')]&&_0x12c2d5[_0x429f('0x9')][_0x429f('0xa')]){_0x444d6e[_0x12c2d5[_0x429f('0x9')]['name'][_0x429f('0xb')]()]&&_0x27c46a[_0x429f('0xc')](_0x444d6e[_0x12c2d5[_0x429f('0x9')][_0x429f('0xa')]['toLowerCase']()][_0x429f('0x7')]());}else if(_0x12c2d5[_0x429f('0x4')]===_0x429f('0xd')){if(_0x12c2d5[_0x429f('0xe')]===_0x429f('0x5')&&_0x12c2d5['key']){_0x27c46a[_0x429f('0xc')](util[_0x429f('0xf')](_0x429f('0x10'),_0x12c2d5[_0x429f('0x11')],_0x12c2d5[_0x429f('0x12')]));}else if(_0x12c2d5[_0x429f('0xe')]==='variable'&&_0x12c2d5[_0x429f('0x6')]&&_0x12c2d5[_0x429f('0x11')]){_0x444d6e[_0x12c2d5[_0x429f('0x6')]]&&_0x27c46a[_0x429f('0xc')](util[_0x429f('0xf')](_0x429f('0x10'),_0x12c2d5[_0x429f('0x11')],_0x444d6e[_0x12c2d5[_0x429f('0x6')]]));}else if(_0x12c2d5[_0x429f('0xe')]==='customVariable'&&_0x12c2d5[_0x429f('0x9')]&&_0x12c2d5[_0x429f('0x9')][_0x429f('0xa')]&&_0x12c2d5[_0x429f('0x11')]){_0x444d6e[_0x12c2d5[_0x429f('0x9')][_0x429f('0xa')]['toLowerCase']()]&&_0x27c46a[_0x429f('0xc')](util['format'](_0x429f('0x10'),_0x12c2d5['key'],_0x444d6e[_0x12c2d5[_0x429f('0x9')][_0x429f('0xa')][_0x429f('0xb')]()]));}}}}return _0x27c46a[_0x429f('0x13')](_0x33295e);};exports['stripTrailingSlash']=function(_0x267e4f){var _0x58d211=_0x267e4f[_0x429f('0x14')](-0x1);if(_0x58d211==='/'){_0x267e4f=_0x267e4f[_0x429f('0x15')](0x0,_0x267e4f[_0x429f('0x16')](_0x58d211));}return _0x267e4f;};exports['validateEmail']=function(_0xa49bb){if(!_[_0x429f('0x17')](_0xa49bb)&&_0xa49bb!==''){var _0x1a5111=/^(([^<>()\[\]\\.,;:\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 _0x1a5111[_0x429f('0x18')](String(_0xa49bb)[_0x429f('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 01cddea..91918fa 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(_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 +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(_0x9c6a31,_0x15d7c6){var _0x37b2d2=function(_0x245576){while(--_0x245576){_0x9c6a31['push'](_0x9c6a31['shift']());}};_0x37b2d2(++_0x15d7c6);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'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 9fdfe61..40964ea 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 _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 +var _0xc38c=['Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','POST','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','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','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','%s/users/me.json','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','end-user','Caller\x20-\x20%s','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','stringify','GET','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','[QUEUE]'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xc38c,0x1e0));var _0xcc38=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc38c[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var rp=require(_0xcc38('0x0'));var md5=require('md5');var util=require(_0xcc38('0x1'));var Redis=require(_0xcc38('0x2'));var intUtil=require(_0xcc38('0x3'));var config=require(_0xcc38('0x4'));var logger=require(_0xcc38('0x5'))('zendesk');config[_0xcc38('0x6')]=_[_0xcc38('0x7')](config[_0xcc38('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xcc38('0x8'))(new Redis(config[_0xcc38('0x6')]));function emit(_0x42942b,_0xce5c44,_0x53aeb1){io['to'](_0x42942b)[_0xcc38('0x9')](_0xce5c44,_0x53aeb1);}var headers={'Content-Type':_0xcc38('0xa'),'Accept':_0xcc38('0xa')};function getTicket(_0x20b7a3,_0x17725f,_0x5e1868,_0x356b37,_0x5bbc6c){logger[_0xcc38('0xb')](_0xcc38('0xc'));return request({'uri':util[_0xcc38('0xd')](_0xcc38('0xe'),_0x20b7a3[_0xcc38('0xf')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x5e1868['id'],'submitter_id':_0x17725f?_0x17725f['id']:undefined,'assignee_id':_0x17725f?_0x17725f['id']:undefined,'tags':getTags(_0x356b37[_0xcc38('0x10')],_0xcc38('0x11')),'subject':intUtil[_0xcc38('0x12')](_0x356b37[_0xcc38('0x13')],_0x5bbc6c,'\x20'),'description':intUtil[_0xcc38('0x12')](_0x356b37['Descriptions'],_0x5bbc6c,'\x0a'),'comment':{'public':![],'body':intUtil[_0xcc38('0x12')](_0x356b37[_0xcc38('0x14')],_0x5bbc6c,'\x0a')}},getCustomFields(_0x356b37[_0xcc38('0x15')],_0x5bbc6c))}})[_0xcc38('0x16')](function(_0x1d7e6f){logger[_0xcc38('0xb')](_0xcc38('0x17'));return _0x1d7e6f[_0xcc38('0x18')];});}function getUser(_0x12dff3,_0x282682){if(intUtil[_0xcc38('0x19')](_0x282682)){logger['info'](_0xcc38('0x1a'),_0x282682);return request({'uri':util['format']('%s/search.json',_0x12dff3[_0xcc38('0xf')]),'qs':{'query':util[_0xcc38('0xd')](_0xcc38('0x1b'),_0x282682)}})[_0xcc38('0x16')](function(_0x3b2227){if(_0x3b2227[_0xcc38('0x1c')]){logger['info'](_0xcc38('0x1d'));return _[_0xcc38('0x1e')](_0x3b2227[_0xcc38('0x1f')],{'email':_0x282682,'role':_0xcc38('0x20')});}else{logger[_0xcc38('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xcc38('0xd')](_0xcc38('0x21'),_0x12dff3['remoteUri'])})[_0xcc38('0x16')](function(_0xfd3d22){logger[_0xcc38('0xb')]('Admin\x20account\x20selected.');return _0xfd3d22['user'];});}});}else{logger['info'](_0xcc38('0x22'));return request({'uri':util['format'](_0xcc38('0x21'),_0x12dff3[_0xcc38('0xf')])})[_0xcc38('0x16')](function(_0x58f157){logger['info']('Admin\x20account\x20selected.');return _0x58f157[_0xcc38('0x23')];});}}function getEndUser(_0x302a0f,_0x153d96,_0x3e1511){logger['info'](_0xcc38('0x24'),_0x3e1511);return request({'uri':util[_0xcc38('0xd')]('%s/search.json',_0x302a0f[_0xcc38('0xf')]),'qs':{'query':util[_0xcc38('0xd')](_0xcc38('0x25'),_0x3e1511)}})[_0xcc38('0x16')](function(_0x2d1279){var _0x4f63b2;if(_0x2d1279[_0xcc38('0x1f')]['length']){_0x2d1279[_0xcc38('0x1f')]=_[_0xcc38('0x26')](_0x2d1279['results'],{'suspended':![],'role':'end-user'});if(_0x2d1279[_0xcc38('0x1f')][_0xcc38('0x27')]){_0x4f63b2=_['first'](_0x2d1279['results']);}}if(_0x4f63b2){logger[_0xcc38('0xb')](_0xcc38('0x28'));return _0x4f63b2;}else{logger[_0xcc38('0xb')](_0xcc38('0x29'));return request({'uri':util[_0xcc38('0xd')]('%s/users.json',_0x302a0f[_0xcc38('0xf')]),'method':'POST','body':{'user':{'role':_0xcc38('0x2a'),'name':util[_0xcc38('0xd')](_0xcc38('0x2b'),_0x153d96||_0x3e1511),'phone':_0x3e1511}}})[_0xcc38('0x16')](function(_0x503945){logger['info']('Enduser\x20created.');return _0x503945[_0xcc38('0x23')];});}});}function getAuth(_0x23ecf2){var _0xb21763;if(_0x23ecf2[_0xcc38('0x2c')]===_0xcc38('0x2d')){_0xb21763=util[_0xcc38('0xd')](_0xcc38('0x2e'),_0x23ecf2[_0xcc38('0x2f')],_0x23ecf2[_0xcc38('0x2d')]);}else if(_0x23ecf2[_0xcc38('0x2c')]===_0xcc38('0x30')){_0xb21763=util[_0xcc38('0xd')](_0xcc38('0x31'),_0x23ecf2[_0xcc38('0x2f')],_0x23ecf2['token']);}return util[_0xcc38('0xd')](_0xcc38('0x32'),new Buffer(_0xb21763)[_0xcc38('0x33')](_0xcc38('0x34')));}function request(_0x476da2){logger[_0xcc38('0x35')]('[HTTP]',JSON[_0xcc38('0x36')](_0x476da2));return rp(_[_0xcc38('0x7')](_0x476da2,{'method':_0xcc38('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x262963,_0x4c77a9){var _0x229b06=[];if(_0x262963&&_0x262963[_0xcc38('0x27')]>0x0){_0x229b06=_['map'](_0x262963,_0x4c77a9);}return _0x229b06;}function getCustomFields(_0x16f8d6,_0x5386fb){var _0x5dc71c=[];var _0x3f78be={'custom_fields':[]};if(_0x16f8d6['length']>0x0){_['forEach'](_0x16f8d6,function(_0x2361a3){if(_[_0xcc38('0x38')]([_0xcc38('0x39'),_0xcc38('0x3a')],_0x2361a3[_0xcc38('0x3b')])&&_0x2361a3[_0xcc38('0x3c')]&&!_0x2361a3[_0xcc38('0x3d')]){_0x3f78be[_0x2361a3[_0xcc38('0x3c')][_0xcc38('0x3e')]()]=_0x2361a3[_0xcc38('0x3f')][_0xcc38('0x33')]();}else if(_['includes']([_0xcc38('0x39'),'picklist'],_0x2361a3[_0xcc38('0x3b')])&&_0x2361a3[_0xcc38('0x40')]&&_0x2361a3[_0xcc38('0x3d')]){_0x3f78be[_0xcc38('0x41')][_0xcc38('0x42')]({'id':_0x2361a3['idField'],'value':_0x2361a3[_0xcc38('0x3f')][_0xcc38('0x33')]()});}else if(_0x2361a3[_0xcc38('0x3b')]===_0xcc38('0x43')&&_0x2361a3[_0xcc38('0x44')]&&_0x2361a3['idField']&&_0x2361a3[_0xcc38('0x3d')]){_0x5386fb[_0x2361a3[_0xcc38('0x44')]]&&_0x3f78be[_0xcc38('0x41')]['push']({'id':_0x2361a3[_0xcc38('0x40')],'value':_0x5386fb[_0x2361a3['variableName']][_0xcc38('0x33')]()});}else if(_0x2361a3['type']===_0xcc38('0x45')&&_0x2361a3[_0xcc38('0x46')]&&_0x2361a3[_0xcc38('0x46')][_0xcc38('0x11')]&&_0x2361a3[_0xcc38('0x40')]&&_0x2361a3['customField']){_0x5386fb[_0x2361a3[_0xcc38('0x46')][_0xcc38('0x11')][_0xcc38('0x3e')]()]&&_0x3f78be[_0xcc38('0x41')][_0xcc38('0x42')]({'id':_0x2361a3['idField'],'value':_0x5386fb[_0x2361a3[_0xcc38('0x46')][_0xcc38('0x11')][_0xcc38('0x3e')]()][_0xcc38('0x33')]()});}});}return _0x3f78be;}exports[_0xcc38('0x47')]=function(_0x4f6090,_0x504d98,_0x1c5a3b,_0x1c88f3,_0x277af9,_0xbc315a){var _0x12f5da,_0x47ed1e;_0xbc315a[_0xcc38('0xf')]=intUtil['stripTrailingSlash'](_0xbc315a[_0xcc38('0xf')]);_0xbc315a[_0xcc38('0x48')]=intUtil[_0xcc38('0x49')](_0xbc315a[_0xcc38('0x48')]);if(_0x277af9&&_0x277af9['monitor_format']){logger[_0xcc38('0xb')](_0xcc38('0x4a'),_0xcc38('0x4b'));_0x504d98[_0xcc38('0x4c')]=util[_0xcc38('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xbc315a[_0xcc38('0x48')],_0x504d98['uniqueid'],md5(_0x504d98[_0xcc38('0x4d')]));}else{_0x504d98['recordingURL']='';}headers[_0xcc38('0x4e')]=getAuth(_0xbc315a);return getUser(_0xbc315a,_0x1c88f3['email'])['then'](function(_0xd873f9){_0x12f5da=_0xd873f9;logger[_0xcc38('0xb')](_0xcc38('0x4f'),_0x12f5da['id']);return getEndUser(_0xbc315a,_0x504d98[_0xcc38('0x50')],_0x504d98[_0xcc38('0x51')]);})[_0xcc38('0x16')](function(_0x576410){_0x47ed1e=_0x576410;logger[_0xcc38('0xb')](_0xcc38('0x52'),_0x47ed1e['id']);return getTicket(_0xbc315a,_0x12f5da,_0x47ed1e,_0x1c5a3b,_0x504d98);})['then'](function(_0x530c8e){if(_0x530c8e){logger['info'](_0xcc38('0x53'),_0x530c8e['id']);switch(_0xbc315a['type']){case _0xcc38('0x54'):logger[_0xcc38('0xb')]('[QUEUE]',_0xcc38('0x55'));return request({'uri':util[_0xcc38('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0xbc315a['remoteUri'],_0x12f5da['id'],_0x530c8e['id']),'method':_0xcc38('0x56')});case _0xcc38('0x57'):logger[_0xcc38('0xb')](_0xcc38('0x4a'),_0xcc38('0x58'));emit(util['format']('user:%s',_0x1c88f3[_0xcc38('0x11')]),_0xcc38('0x59'),{'uri':util[_0xcc38('0xd')](_0xcc38('0x5a'),_0xbc315a['remoteUri']['replace'](_0xcc38('0x5b'),''),_0x530c8e['id'])});break;default:logger[_0xcc38('0x5c')]('[QUEUE]',_0xcc38('0x5d'));}}})[_0xcc38('0x5e')](function(_0x81d000){logger[_0xcc38('0x5c')](_0xcc38('0x5f'),util[_0xcc38('0x60')](_0x81d000,{'showHidden':!![],'depth':null}));});};exports[_0xcc38('0x61')]=function(_0x405289,_0x2ccfee,_0x1d9a6e,_0x46c0ca,_0x3610bf,_0x5acd12,_0x1195fd){var _0x1c84e1,_0x3e4988;_0x5acd12['remoteUri']=intUtil[_0xcc38('0x49')](_0x5acd12[_0xcc38('0xf')]);_0x5acd12[_0xcc38('0x48')]=intUtil[_0xcc38('0x49')](_0x5acd12[_0xcc38('0x48')]);if(_0x1195fd&&_0x1195fd[_0xcc38('0x62')]&&_0x1195fd[_0xcc38('0x62')]!==_0xcc38('0x63')){logger['info'](_0xcc38('0x64'),_0xcc38('0x4b'));_0x2ccfee[_0xcc38('0x4c')]=util[_0xcc38('0xd')](_0xcc38('0x65'),_0x5acd12['serverUrl'],_0x2ccfee['uniqueid'],md5(_0x2ccfee[_0xcc38('0x4d')]));}headers[_0xcc38('0x4e')]=getAuth(_0x5acd12);return getUser(_0x5acd12,_0x46c0ca[_0xcc38('0x66')])[_0xcc38('0x16')](function(_0x117dca){_0x1c84e1=_0x117dca;logger[_0xcc38('0xb')](_0xcc38('0x4f'),_0x1c84e1['id']);return getEndUser(_0x5acd12,_0x2ccfee[_0xcc38('0x67')],_0x2ccfee['destcalleridnum']);})[_0xcc38('0x16')](function(_0x1cfc1e){_0x3e4988=_0x1cfc1e;logger[_0xcc38('0xb')](_0xcc38('0x52'),_0x3e4988['id']);return getTicket(_0x5acd12,_0x1c84e1,_0x3e4988,_0x1d9a6e,_0x2ccfee);})[_0xcc38('0x16')](function(_0xc8937e){if(_0xc8937e){logger[_0xcc38('0xb')]('The\x20Ticket\x20ID\x20is:',_0xc8937e['id']);switch(_0x5acd12[_0xcc38('0x3b')]){case _0xcc38('0x54'):logger['info'](_0xcc38('0x64'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xcc38('0xd')](_0xcc38('0x68'),_0x5acd12[_0xcc38('0xf')],_0x1c84e1['id'],_0xc8937e['id']),'method':_0xcc38('0x56')});case _0xcc38('0x57'):logger['info'](_0xcc38('0x64'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xcc38('0xd')](_0xcc38('0x69'),_0x46c0ca[_0xcc38('0x11')]),'trigger:browser:url',{'uri':util[_0xcc38('0xd')]('%s/agent/tickets/%s',_0x5acd12[_0xcc38('0xf')][_0xcc38('0x6a')](_0xcc38('0x5b'),''),_0xc8937e['id'])});break;default:logger[_0xcc38('0x5c')](_0xcc38('0x64'),_0xcc38('0x5d'));}}})['catch'](function(_0x166e72){logger[_0xcc38('0x5c')](_0xcc38('0x6b'),util[_0xcc38('0x60')](_0x166e72,{'showHidden':!![],'depth':null}));});};exports[_0xcc38('0x6c')]=function(_0x19a881,_0x55972f,_0x2252c0,_0xee84ce,_0x39b576,_0x1a280c){var _0x44db38,_0x10c1b2;_0x1a280c[_0xcc38('0xf')]=intUtil[_0xcc38('0x49')](_0x1a280c['remoteUri']);_0x1a280c[_0xcc38('0x48')]=intUtil[_0xcc38('0x49')](_0x1a280c['serverUrl']);if(_0x39b576&&_0x39b576['monitor_format']){logger[_0xcc38('0xb')]('['+_0x55972f['lastevent'][_0xcc38('0x6d')]()+']',_0xcc38('0x4b'));_0x55972f[_0xcc38('0x4c')]=util['format'](_0xcc38('0x65'),_0x1a280c[_0xcc38('0x48')],_0x55972f[_0xcc38('0x4d')],md5(_0x55972f[_0xcc38('0x4d')]));}else{_0x55972f[_0xcc38('0x4c')]='';}headers[_0xcc38('0x4e')]=getAuth(_0x1a280c);return getUser(_0x1a280c)['then'](function(_0x25fe62){_0x44db38=_0x25fe62;logger['info'](_0xcc38('0x4f'),_0x44db38['id']);return getEndUser(_0x1a280c,_0x55972f[_0xcc38('0x50')],_0x55972f[_0xcc38('0x51')]);})['then'](function(_0x1bab55){_0x10c1b2=_0x1bab55;logger['info']('The\x20Enduser\x20ID\x20is:',_0x10c1b2['id']);return getTicket(_0x1a280c,_0x44db38,_0x10c1b2,_0x2252c0,_0x55972f);})[_0xcc38('0x16')](function(_0x1eaa43){if(_0x1eaa43){logger[_0xcc38('0xb')]('The\x20Ticket\x20ID\x20is:',_0x1eaa43['id']);}})['catch'](function(_0x5b65d5){logger[_0xcc38('0x5c')]('['+_0x55972f['lastevent'][_0xcc38('0x6d')]()+']'+_0xcc38('0x6e'),util['inspect'](_0x5b65d5,{'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 d01be6b..43abe47 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 _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 +var _0xe95f=['Using\x20the\x20admin\x20account!','profile','user','Administrator','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','catch','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','details','enduserType','Error:\x20','log','CREATE\x20ERROR','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','lead','nothing','Creating\x20new\x20call...','Subject','Subjects','Description','getString','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','talktime','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','SUCCESS','err','queue','host','stripTrailingSlash','serverUrl','recordingURL','uniqueid','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','/api/voice/recordings/','zoho.eu','destcalleridname','destcalleridnum','Outbound','https://crm.','/crm/EntityInfo.do?module=Calls&id=','monitor_format','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/logger','zoho','redis','defaults','localhost','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','content','variable','variableName','Variable','name','toLowerCase','toString','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!'];(function(_0x4dd8fe,_0x18c473){var _0x2d8aca=function(_0x50d70d){while(--_0x50d70d){_0x4dd8fe['push'](_0x4dd8fe['shift']());}};_0x2d8aca(++_0x18c473);}(_0xe95f,0x64));var _0xfe95=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe95f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfe95('0x0'));var rp=require(_0xfe95('0x1'));var md5=require(_0xfe95('0x2'));var util=require(_0xfe95('0x3'));var intUtil=require(_0xfe95('0x4'));var moment=require(_0xfe95('0x5'));var Redis=require(_0xfe95('0x6'));var BPromise=require(_0xfe95('0x7'));var config=require('../../../../config/environment');var logger=require(_0xfe95('0x8'))(_0xfe95('0x9'));config[_0xfe95('0xa')]=_[_0xfe95('0xb')](config[_0xfe95('0xa')],{'host':_0xfe95('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfe95('0xa')]));function emit(_0x2dbb30,_0xa208a1,_0x580c10){io['to'](_0x2dbb30)['emit'](_0xa208a1,_0x580c10);}function request(_0x300254){logger[_0xfe95('0xd')](_0xfe95('0xe'),JSON[_0xfe95('0xf')](_0x300254));return rp(_0x300254);}function getCustomFields(_0x258cdf,_0x2ff69e){var _0x1fe7db={};if(_0x258cdf[_0xfe95('0x10')]>0x0){_[_0xfe95('0x11')](_0x258cdf,function(_0x1ad17f){if(_[_0xfe95('0x12')]([_0xfe95('0x13'),_0xfe95('0x14')],_0x1ad17f[_0xfe95('0x15')])&&_0x1ad17f[_0xfe95('0x16')]){_0x1fe7db[_0x1ad17f[_0xfe95('0x16')]]=_0x1ad17f[_0xfe95('0x17')]['toString']();}else if(_0x1ad17f[_0xfe95('0x15')]===_0xfe95('0x18')&&_0x1ad17f[_0xfe95('0x19')]&&_0x1ad17f[_0xfe95('0x16')]&&_0x2ff69e[_0x1ad17f['variableName']]){_0x1fe7db[_0x1ad17f['idField']]=_0x2ff69e[_0x1ad17f[_0xfe95('0x19')]]['toString']();}else if(_0x1ad17f[_0xfe95('0x15')]==='customVariable'&&_0x1ad17f[_0xfe95('0x1a')]&&_0x1ad17f[_0xfe95('0x1a')]['name']&&_0x1ad17f[_0xfe95('0x16')]&&_0x2ff69e[_0x1ad17f[_0xfe95('0x1a')][_0xfe95('0x1b')][_0xfe95('0x1c')]()]){_0x1fe7db[_0x1ad17f[_0xfe95('0x16')]]=_0x2ff69e[_0x1ad17f[_0xfe95('0x1a')][_0xfe95('0x1b')]['toLowerCase']()][_0xfe95('0x1d')]();}});}return _0x1fe7db;}function getName(_0xf951ac){if(_0xf951ac[_0xfe95('0x1e')]('\x20')>0x0){var _0xb565f0=_0xf951ac[_0xfe95('0x1f')](/ (.+)/);if(_0xb565f0[0x1]){return _0xb565f0;}}return[_0xf951ac,_0xf951ac];}var accountsTokens={};function getAccessToken(_0x48a731){return new Promise(function(_0x4319d6,_0x10c6f8){if(!_['isNil'](accountsTokens[_0x48a731['id']])&&!_[_0xfe95('0x20')](accountsTokens[_0x48a731['id']][_0xfe95('0x21')])){if(moment()['isBefore'](accountsTokens[_0x48a731['id']][_0xfe95('0x22')])){_0x4319d6(accountsTokens[_0x48a731['id']][_0xfe95('0x21')]);}}var _0x199e1e;switch(_0x48a731[_0xfe95('0x23')]){case'US':_0x199e1e=_0xfe95('0x24');break;case'AU':_0x199e1e=_0xfe95('0x25');break;case'EU':_0x199e1e=_0xfe95('0x26');break;case'IN':_0x199e1e=_0xfe95('0x27');break;case'CN':_0x199e1e=_0xfe95('0x28');break;default:_0x199e1e='https://accounts.zoho.eu';break;}var _0x4418c0={'method':_0xfe95('0x29'),'uri':_0x199e1e+_0xfe95('0x2a'),'qs':{'refresh_token':_0x48a731[_0xfe95('0x2b')],'client_id':_0x48a731[_0xfe95('0x2c')],'client_secret':_0x48a731[_0xfe95('0x2d')],'grant_type':_0xfe95('0x2e')},'json':!![]};return rp(_0x4418c0)[_0xfe95('0x2f')](function(_0x45b121){accountsTokens[_0x48a731['id']]={'access_token':_0x45b121['access_token'],'expires_in':moment()[_0xfe95('0x30')](_0x45b121['expires_in'],_0xfe95('0x31'))};_0x4319d6(_0x45b121['access_token']);})['catch'](function(_0xaa9431){logger[_0xfe95('0x32')](_0xfe95('0x33'),_0xaa9431['stack']);_0x10c6f8(_0xaa9431);});});}function getUser(_0x59a69d,_0x333a75,_0x2e9d7f,_0x2a627c){logger[_0xfe95('0x34')](_0xfe95('0x35'));return request({'method':'GET','uri':util[_0xfe95('0x36')](_0xfe95('0x37'),_0x333a75),'qs':{'type':_0xfe95('0x38')},'headers':{'Authorization':_0xfe95('0x39')+_0x59a69d},'json':!![]})[_0xfe95('0x2f')](function(_0x545588){if(_0x545588[_0xfe95('0x3a')]){var _0x3e5f95=-0x1;if(_[_0xfe95('0x3b')](_0x545588[_0xfe95('0x3a')])){if(!_[_0xfe95('0x20')](_0x2a627c)){_0x3e5f95=_[_0xfe95('0x3c')](_0x545588[_0xfe95('0x3a')],function(_0x2e7171){return _0x2e7171[_0xfe95('0x3d')]===_0x2a627c;});}if(_0x3e5f95>=0x0){logger[_0xfe95('0x34')](_0xfe95('0x3e'));}else{logger[_0xfe95('0x34')](_0xfe95('0x3f'));_0x3e5f95=_[_0xfe95('0x3c')](_0x545588[_0xfe95('0x3a')],function(_0xd651bc){return _0xd651bc[_0xfe95('0x40')][_0xfe95('0x1b')]==='Administrator';});}return _0x545588['users'][_0x3e5f95];}else{if(_0x545588[_0xfe95('0x41')]['profile']['name']===_0xfe95('0x42')){logger[_0xfe95('0x34')](_0xfe95('0x3f'));user=_0x545588[_0xfe95('0x41')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0xfe95('0xf')](_0x545588));throw new Error(_0xfe95('0x43')+JSON[_0xfe95('0xf')](_0x545588));}}}else{logger[_0xfe95('0x32')](_0xfe95('0x44'),JSON[_0xfe95('0xf')](_0x545588));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xfe95('0xf')](_0x545588));}})['catch'](function(_0x1beaaf){console['error'](_0x1beaaf);});}function getZohoUser(_0x3590aa,_0x40aa5f){return new BPromise(function(_0x1bce44,_0x58c3e8){request(_0x3590aa)['then'](function(_0x52ec6e){var _0x432b07=null;if(_0x52ec6e){_0x432b07=_0x52ec6e[_0xfe95('0x45')][0x0];_0x432b07['enduserType']=_0x40aa5f;}_0x1bce44(_0x432b07);})[_0xfe95('0x46')](function(_0x30189d){_0x58c3e8(_0x30189d);});});}function createEndUser(_0x400701,_0x4cbcd2,_0x261072,_0x3986e3,_0x44d147,_0xf2083a){var _0x261072=getName(_0x261072);return request({'method':_0xfe95('0x29'),'uri':_0xfe95('0x47')+_0x4cbcd2+_0xfe95('0x48')+_[_0xfe95('0x49')](_0xf2083a[_0xfe95('0x4a')])+'s','body':{'data':[{'Last_Name':_0x261072[0x1],'First_Name':_0x261072[0x0],'Phone':_0x3986e3,'Owner':{'name':!_[_0xfe95('0x20')](_0x44d147[_0xfe95('0x4b')][_0xfe95('0x1b')])?_0x44d147['role']['name']:!_[_0xfe95('0x20')](_0x44d147[_0xfe95('0x4c')])?_0x44d147[_0xfe95('0x4c')]+'\x20'+_0x44d147[_0xfe95('0x4d')]:_0x44d147[_0xfe95('0x4d')],'id':_0x44d147['id']}}]},'headers':{'Authorization':_0xfe95('0x39')+_0x400701},'json':!![]})['then'](function(_0x11980e){if(_0x11980e&&_0x11980e[_0xfe95('0x45')][0x0][_0xfe95('0x4e')]==='SUCCESS'){var _0x23d420=_0x11980e['data'][0x0][_0xfe95('0x4f')];_0x23d420[_0xfe95('0x50')]=_['startCase'](_0xf2083a[_0xfe95('0x4a')])+'s';return _0x23d420;}logger[_0xfe95('0x32')](_0xfe95('0x44'),JSON[_0xfe95('0xf')](data));throw new Error(_0xfe95('0x51')+JSON[_0xfe95('0xf')](data));})[_0xfe95('0x46')](function(_0x3d0de9){console[_0xfe95('0x52')](_0xfe95('0x53'),_0x3d0de9);});}function getEndUser(_0x1092f6,_0x5c1fb1,_0x3f14c5,_0x2c335c,_0xae67a5,_0x54da20,_0x19c5fa){var _0x9484e6={'method':'GET','uri':'','headers':{'Authorization':_0xfe95('0x39')+_0x1092f6},'json':!![]};switch(_0x19c5fa['moduleSearch']){case _0xfe95('0x54'):_0x9484e6[_0xfe95('0x55')]='https://www.zohoapis.'+_0x5c1fb1+_0xfe95('0x56')+_0xae67a5+'))';return getZohoUser(_0x9484e6,_0xfe95('0x57'))[_0xfe95('0x2f')](function(_0x472732){if(_0x472732)return _0x472732;_0x9484e6[_0xfe95('0x55')]='https://www.zohoapis.'+_0x5c1fb1+_0xfe95('0x58')+_0xae67a5+'))';return getZohoUser(_0x9484e6,_0xfe95('0x59'))[_0xfe95('0x2f')](function(_0xcc0f07){if(_0xcc0f07)return _0xcc0f07;if(_0x19c5fa[_0xfe95('0x4a')]!='nothing'){return createEndUser(_0x1092f6,_0x5c1fb1,_0x2c335c,_0xae67a5,_0x54da20,_0x19c5fa);}else{return{};}});});break;case _0xfe95('0x5a'):_0x9484e6[_0xfe95('0x55')]='https://www.zohoapis.'+_0x5c1fb1+_0xfe95('0x56')+_0xae67a5+'))';return getZohoUser(_0x9484e6,_0xfe95('0x57'))['then'](function(_0x111fcb){if(_0x111fcb)return _0x111fcb;if(_0x19c5fa[_0xfe95('0x4a')]!='nothing'){return createEndUser(_0x1092f6,_0x5c1fb1,_0x2c335c,_0xae67a5,_0x54da20,_0x19c5fa);}else{return{};}});break;case _0xfe95('0x5b'):_0x9484e6[_0xfe95('0x55')]='https://www.zohoapis.'+_0x5c1fb1+_0xfe95('0x58')+_0xae67a5+'))';return getZohoUser(_0x9484e6,_0xfe95('0x59'))[_0xfe95('0x2f')](function(_0x143f31){if(_0x143f31)return _0x143f31;if(_0x19c5fa[_0xfe95('0x4a')]!=_0xfe95('0x5c')){return createEndUser(_0x1092f6,_0x5c1fb1,_0x2c335c,_0xae67a5,_0x54da20,_0x19c5fa);}else{return{};}});break;}}function getCall(_0x3bc387,_0x345f8b,_0x139aeb,_0x327c3f,_0x75a308,_0x35db9e,_0x17e8b2,_0x13bbc5){logger['info'](_0xfe95('0x5d'));var _0xa7308a={};_0xa7308a['Owner']={'name':!_[_0xfe95('0x20')](_0x327c3f[_0xfe95('0x4b')][_0xfe95('0x1b')])&&!_[_0xfe95('0x20')](_0x327c3f[_0xfe95('0x40')][_0xfe95('0x1b')])&&_0x327c3f[_0xfe95('0x40')][_0xfe95('0x1b')]==='administrator'?_0x327c3f[_0xfe95('0x4b')]['name']:!_[_0xfe95('0x20')](_0x327c3f[_0xfe95('0x4c')])?_0x327c3f[_0xfe95('0x4c')]+'\x20'+_0x327c3f[_0xfe95('0x4d')]:_0x327c3f[_0xfe95('0x4d')],'id':_0x327c3f['id']};_0xa7308a[_0xfe95('0x5e')]=intUtil['getString'](_0x35db9e[_0xfe95('0x5f')],_0x17e8b2,'\x20');_0xa7308a[_0xfe95('0x60')]=intUtil[_0xfe95('0x61')](_0x35db9e[_0xfe95('0x62')],_0x17e8b2,'\x0a');if(_0x75a308[_0xfe95('0x50')]===_0xfe95('0x57')){_0xa7308a['Who_Id']={'name':!_['isNil'](_0x75a308['Full_Name'])?_0x75a308[_0xfe95('0x63')]:!_['isNil'](_0x75a308[_0xfe95('0x64')])?_0x75a308[_0xfe95('0x64')]+'\x20'+_0x75a308[_0xfe95('0x65')]:_0x75a308[_0xfe95('0x65')],'id':_0x75a308['id']};}if(_0x75a308['enduserType']===_0xfe95('0x59')){_0xa7308a[_0xfe95('0x66')]={'name':!_['isNil'](_0x75a308[_0xfe95('0x63')])?_0x75a308['Full_Name']:!_[_0xfe95('0x20')](_0x75a308['First_Name'])?_0x75a308[_0xfe95('0x64')]+'\x20'+_0x75a308[_0xfe95('0x65')]:_0x75a308[_0xfe95('0x65')],'id':_0x75a308['id']};_0xa7308a[_0xfe95('0x67')]=_[_0xfe95('0x49')](_0x75a308['enduserType']);}if(_0x17e8b2['talktime']){_0xa7308a[_0xfe95('0x68')]=moment[_0xfe95('0x69')](parseInt(_0x17e8b2[_0xfe95('0x6a')])*0x3e8)[_0xfe95('0x36')](_0xfe95('0x6b'));}else if(_0x17e8b2[_0xfe95('0x6c')]&&_0x17e8b2[_0xfe95('0x6d')]){_0xa7308a[_0xfe95('0x68')]=moment[_0xfe95('0x69')](moment(_0x17e8b2['endtime'],_0xfe95('0x6e'))[_0xfe95('0x6f')](moment(_0x17e8b2[_0xfe95('0x70')],_0xfe95('0x6e'))))[_0xfe95('0x36')](_0xfe95('0x6b'));}switch(_0x17e8b2['lastevent']){case _0xfe95('0x71'):_0xa7308a[_0xfe95('0x72')]=_0xfe95('0x73');break;case _0xfe95('0x74'):case _0xfe95('0x75'):_0xa7308a[_0xfe95('0x72')]=_0xfe95('0x76');break;case _0xfe95('0x77'):_0xa7308a[_0xfe95('0x72')]=_0xfe95('0x78');break;case _0xfe95('0x79'):_0xa7308a[_0xfe95('0x72')]=_0xfe95('0x7a');break;case _0xfe95('0x7b'):_0xa7308a[_0xfe95('0x72')]='Timeout';default:}_0xa7308a[_0xfe95('0x7c')]=(_0x13bbc5===_0xfe95('0x7d')?moment(_0x17e8b2[_0xfe95('0x70')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x17e8b2[_0xfe95('0x7e')])[_0xfe95('0x36')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xfe95('0x36')](_0xfe95('0x6e'));_0xa7308a[_0xfe95('0x7f')]=_0x13bbc5||_0xfe95('0x80');_0xa7308a=_['merge'](_0xa7308a,getCustomFields(_0x35db9e[_0xfe95('0x81')],_0x17e8b2));return request({'method':'POST','uri':_0xfe95('0x47')+_0x345f8b+_0xfe95('0x82'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3bc387},'body':{'data':[_0xa7308a]},'json':!![]})['then'](function(_0x3da38c){if(_0x3da38c&&_0x3da38c[_0xfe95('0x45')][0x0][_0xfe95('0x4e')]===_0xfe95('0x83')){logger['info']('Call\x20created!');return{'id':_0x3da38c[_0xfe95('0x45')][0x0][_0xfe95('0x4f')]['id']};}})['catch'](function(_0x8874f1){logger['info']('err',_0x8874f1['stack']);console[_0xfe95('0x52')](_0xfe95('0x84'),_0x8874f1);});}exports[_0xfe95('0x85')]=function(_0xd8d31c,_0x146338,_0x1ebe9a,_0x3c3e70,_0x4db536,_0x1fd0e5){var _0x478cc7,_0x299010,_0x1177b1;_0x1fd0e5[_0xfe95('0x86')]=intUtil[_0xfe95('0x87')](_0x1fd0e5['host']);_0x1fd0e5[_0xfe95('0x88')]=intUtil[_0xfe95('0x87')](_0x1fd0e5['serverUrl']);if(_0x4db536&&_0x4db536['monitor_format']){logger[_0xfe95('0x34')]('[QUEUE]','Recording\x20is\x20enabled!');_0x146338[_0xfe95('0x89')]=_0x1fd0e5[_0xfe95('0x88')]+'/api/voice/recordings/'+_0x146338[_0xfe95('0x8a')]+_0xfe95('0x8b')+md5(_0x146338['uniqueid']);}else{_0x146338[_0xfe95('0x89')]='';}var _0xac16f0=_0x1fd0e5[_0xfe95('0x86')]==='zoho.eu'?'eu':_0xfe95('0x8c');return getAccessToken(_0x1fd0e5)[_0xfe95('0x2f')](function(_0xa91395){_0x1177b1=_0xa91395;return getUser(_0x1177b1,_0xac16f0,_0x1fd0e5,_0x3c3e70[_0xfe95('0x3d')]);})[_0xfe95('0x2f')](function(_0x403819){_0x478cc7=_0x403819;logger[_0xfe95('0x34')](_0xfe95('0x8d'),_0x478cc7['id']);return getEndUser(_0x1177b1,_0xac16f0,_0x1fd0e5,_0x146338[_0xfe95('0x8e')],_0x146338[_0xfe95('0x8f')],_0x478cc7,_0x1ebe9a);})[_0xfe95('0x2f')](function(_0x2513dc){_0x299010=_0x2513dc;return getCall(_0x1177b1,_0xac16f0,_0x1fd0e5,_0x478cc7,_0x299010,_0x1ebe9a,_0x146338,'Inbound');})[_0xfe95('0x2f')](function(_0x1c003f){if(_0x1c003f){logger[_0xfe95('0x34')](_0xfe95('0x90'),_0x1c003f['id']);logger['info'](_0xfe95('0x91'),_0xfe95('0x92'));emit(util[_0xfe95('0x36')](_0xfe95('0x93'),_0x3c3e70[_0xfe95('0x1b')]),_0xfe95('0x94'),{'uri':'https://crm.'+_0x1fd0e5[_0xfe95('0x86')]+'/crm/EntityInfo.do?module=Calls&id='+_0x1c003f['id']});}})[_0xfe95('0x46')](function(_0xfae944){logger[_0xfe95('0x32')]('[QUEUE]',JSON[_0xfe95('0xf')](_0xfae944));});};exports[_0xfe95('0x7d')]=function(_0x4c74df,_0x5e7951,_0x588987,_0x4d9744,_0x12e4fc,_0x20d8a3,_0x491874){var _0x4bc38c,_0xf39ba5,_0x49f1a7;_0x20d8a3['host']=intUtil['stripTrailingSlash'](_0x20d8a3[_0xfe95('0x86')]);_0x20d8a3[_0xfe95('0x88')]=intUtil['stripTrailingSlash'](_0x20d8a3[_0xfe95('0x88')]);if(_0x491874&&_0x491874['recordingFormat']&&_0x491874[_0xfe95('0x95')]!==_0xfe95('0x96')){logger['info'](_0xfe95('0x97'),_0xfe95('0x98'));_0x5e7951[_0xfe95('0x89')]=_0x20d8a3['serverUrl']+_0xfe95('0x99')+_0x5e7951['uniqueid']+_0xfe95('0x8b')+md5(_0x5e7951['uniqueid']);}var _0x2fe9c7=_0x20d8a3[_0xfe95('0x86')]===_0xfe95('0x9a')?'eu':'com';return getAccessToken(_0x20d8a3)[_0xfe95('0x2f')](function(_0x18ddd){_0x49f1a7=_0x18ddd;return getUser(_0x49f1a7,_0x2fe9c7,_0x20d8a3,_0x4d9744['email']);})[_0xfe95('0x2f')](function(_0x5f56b6){_0x4bc38c=_0x5f56b6;logger[_0xfe95('0x34')](_0xfe95('0x8d'),_0x4bc38c['id']);return getEndUser(_0x49f1a7,_0x2fe9c7,_0x20d8a3,_0x5e7951[_0xfe95('0x9b')],_0x5e7951[_0xfe95('0x9c')],_0x4bc38c,_0x588987);})['then'](function(_0x5b6619){_0xf39ba5=_0x5b6619;return getCall(_0x49f1a7,_0x2fe9c7,_0x20d8a3,_0x4bc38c,_0xf39ba5,_0x588987,_0x5e7951,_0xfe95('0x9d'));})[_0xfe95('0x2f')](function(_0x42fbd9){if(_0x42fbd9){logger[_0xfe95('0x34')]('The\x20Call\x20ID\x20is:',_0x42fbd9['id']);logger['info'](_0xfe95('0x97'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xfe95('0x36')]('user:%s',_0x4d9744[_0xfe95('0x1b')]),'trigger:browser:url',{'uri':_0xfe95('0x9e')+_0x20d8a3[_0xfe95('0x86')]+_0xfe95('0x9f')+_0x42fbd9['id']});}})[_0xfe95('0x46')](function(_0x253815){logger[_0xfe95('0x32')]('[OUTBOUND]',JSON[_0xfe95('0xf')](_0x253815));});};exports['unmanaged']=function(_0x482013,_0xbc25d9,_0x23f0d2,_0x2e0b8a,_0x20e9fa,_0x598c47){var _0x408022,_0x3df3f0,_0x493d8e;_0x598c47['host']=intUtil[_0xfe95('0x87')](_0x598c47['host']);_0x598c47[_0xfe95('0x88')]=intUtil['stripTrailingSlash'](_0x598c47['serverUrl']);if(_0x20e9fa&&_0x20e9fa[_0xfe95('0xa0')]){logger[_0xfe95('0x34')]('['+_0xbc25d9[_0xfe95('0xa1')][_0xfe95('0xa2')]()+']',_0xfe95('0x98'));_0xbc25d9[_0xfe95('0x89')]=_0x598c47[_0xfe95('0x88')]+_0xfe95('0x99')+_0xbc25d9[_0xfe95('0x8a')]+_0xfe95('0x8b')+md5(_0xbc25d9[_0xfe95('0x8a')]);}else{_0xbc25d9[_0xfe95('0x89')]='';}var _0x2cf39f=_0x598c47[_0xfe95('0x86')]===_0xfe95('0x9a')?'eu':'com';return getAccessToken(_0x598c47)[_0xfe95('0x2f')](function(_0x54e99e){_0x493d8e=_0x54e99e;return getUser(_0x493d8e,_0x2cf39f,_0x598c47);})[_0xfe95('0x2f')](function(_0x571194){_0x408022=_0x571194;logger[_0xfe95('0x34')]('The\x20User\x20ID\x20is:',_0x408022['id']);return getEndUser(_0x493d8e,_0x2cf39f,_0x598c47,_0xbc25d9[_0xfe95('0x8e')],_0xbc25d9[_0xfe95('0x8f')],_0x408022,_0x23f0d2);})[_0xfe95('0x2f')](function(_0x3f8f39){_0x3df3f0=_0x3f8f39;return getCall(_0x493d8e,_0x2cf39f,_0x598c47,_0x408022,_0x3df3f0,_0x23f0d2,_0xbc25d9,_0xfe95('0x80'));})['then'](function(_0x2e7fe1){if(_0x2e7fe1){logger[_0xfe95('0x34')](_0xfe95('0x90'),_0x2e7fe1['id']);}})[_0xfe95('0x46')](function(_0x68df98){logger[_0xfe95('0x32')]('['+_0xbc25d9[_0xfe95('0xa1')][_0xfe95('0xa2')]()+']',JSON[_0xfe95('0xf')](_0x68df98));});}; \ 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 384b2e3..a142c5d 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 _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 +var _0xd9e8=['format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','mustache','../../../../config/logger','exec','data2','render','data3'];(function(_0x436c73,_0x26951e){var _0x1f34f7=function(_0xbe6ef3){while(--_0xbe6ef3){_0x436c73['push'](_0x436c73['shift']());}};_0x1f34f7(++_0x26951e);}(_0xd9e8,0x1cf));var _0x8d9e=function(_0x234a25,_0x2d2a4f){_0x234a25=_0x234a25-0x0;var _0x3247f0=_0xd9e8[_0x234a25];return _0x3247f0;};'use strict';var util=require(_0x8d9e('0x0'));var sh=require('shelljs');var Mustache=require(_0x8d9e('0x1'));var logger=require(_0x8d9e('0x2'))('trigger');exports[_0x8d9e('0x3')]=function(_0x301f25,_0x48ae99){var _0x3fb980=_0x301f25[_0x8d9e('0x4')]?_0x301f25['data2']:'Script';var _0x3f32d5=_0x301f25['data3']?Mustache[_0x8d9e('0x5')](_0x301f25[_0x8d9e('0x6')],_0x48ae99):_0x48ae99;sh[_0x8d9e('0x3')](_0x3f32d5,function(_0x210d4b,_0x4ade1a,_0x4c7244){if(_0x210d4b!==0x0){logger['error'](util[_0x8d9e('0x7')](_0x8d9e('0x8'),_0x3fb980,_0x3f32d5,_0x210d4b,_0x4c7244));}else{logger['info'](util[_0x8d9e('0x7')](_0x8d9e('0x9'),_0x3fb980,_0x3f32d5,_0x4ade1a));}});}; \ 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 7207f3d..2d8a5b0 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 _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 +var _0xf08d=['render','data2','data5','headers','parse','data6','toUpperCase','POST','PUT','data7','error','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data1','stringify','then','isNil','body','object','%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','name','request-promise','lodash','mustache','trigger','exec'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf08d,0x163));var _0xdf08=function(_0x368df2,_0x43786a){_0x368df2=_0x368df2-0x0;var _0x21f70b=_0xf08d[_0x368df2];return _0x21f70b;};'use strict';var rp=require(_0xdf08('0x0'));var util=require('util');var _=require(_0xdf08('0x1'));var Mustache=require(_0xdf08('0x2'));var logger=require('../../../../config/logger')(_0xdf08('0x3'));exports[_0xdf08('0x4')]=function(_0x13eb25,_0x23d08a){var _0x5a9a8e,_0x393ae3;var _0x145a0f={'method':_0x13eb25['data1']['toUpperCase'](),'uri':Mustache[_0xdf08('0x5')](_0x13eb25[_0xdf08('0x6')],_0x23d08a),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x13eb25['data5'])==='number'&&parseInt(_0x13eb25['data5'])>=0x1&&parseInt(_0x13eb25['data5'])<=0xa?parseInt(_0x13eb25[_0xdf08('0x7')])*0x3e8:0x5*0x3e8};try{_0x145a0f[_0xdf08('0x8')]=_0x13eb25['data6']?JSON[_0xdf08('0x9')](Mustache['render'](_0x13eb25[_0xdf08('0xa')],_0x23d08a)):{};}catch(_0x3eefa5){logger['error'](_0x3eefa5['stack']);}switch(_0x13eb25['data1'][_0xdf08('0xb')]()){case'GET':case'DELETE':_0x5a9a8e=null;_0x145a0f['qs']=_0x23d08a;break;case _0xdf08('0xc'):case _0xdf08('0xd'):if(_0x13eb25[_0xdf08('0xe')]){try{_0x5a9a8e=JSON[_0xdf08('0x9')](Mustache[_0xdf08('0x5')](_0x13eb25[_0xdf08('0xe')],_0x23d08a));_0x145a0f['body']=_0x5a9a8e;}catch(_0x205dcd){logger[_0xdf08('0xf')](_0x205dcd[_0xdf08('0x10')]);logger[_0xdf08('0xf')](_0xdf08('0x11'));}}else{_0x5a9a8e=_0x23d08a;_0x145a0f['body']=_0x5a9a8e;}break;}logger['info'](util[_0xdf08('0x12')](_0xdf08('0x13'),_0x13eb25[_0xdf08('0x14')],_0x13eb25['data2'],JSON[_0xdf08('0x15')](_0x145a0f)));rp(_0x145a0f)[_0xdf08('0x16')](function(_0x5d80f4){_0x5a9a8e=!_[_0xdf08('0x17')](_0x5a9a8e)?',\x20request\x20body:\x20'+_0x5a9a8e:'';_0x393ae3=typeof _0x5d80f4[_0xdf08('0x18')]===_0xdf08('0x19')?JSON[_0xdf08('0x15')](_0x5d80f4['body']):_0x5d80f4[_0xdf08('0x18')];logger['info'](util[_0xdf08('0x12')](_0xdf08('0x1a'),_0x13eb25[_0xdf08('0x14')],_0x13eb25[_0xdf08('0x6')],_0x5d80f4[_0xdf08('0x1b')],_0x393ae3));})['catch'](function(_0xb98ac3){logger[_0xdf08('0xf')](util[_0xdf08('0x12')](_0xdf08('0x1c'),_0x13eb25[_0xdf08('0x14')],_0x13eb25['data2'],_0xb98ac3[_0xdf08('0x1b')],_0xb98ac3[_0xdf08('0x1d')],_0xb98ac3['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index a026b6d..372784d 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 _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 +var _0xa16c=['rpc','error','routing','message','result','catch','exports','jayson/promise','../../config/logger','client','http','Request','request','debug'];(function(_0x294da8,_0x18715f){var _0x2ed178=function(_0x3cb1d6){while(--_0x3cb1d6){_0x294da8['push'](_0x294da8['shift']());}};_0x2ed178(++_0x18715f);}(_0xa16c,0x165));var _0xca16=function(_0x5f40a8,_0x4216cc){_0x5f40a8=_0x5f40a8-0x0;var _0x2b5f65=_0xa16c[_0x5f40a8];return _0x2b5f65;};'use strict';var jayson=require(_0xca16('0x0'));var BPromise=require('bluebird');var logger=require(_0xca16('0x1'))('routing');var client=jayson[_0xca16('0x2')][_0xca16('0x3')]({'port':0x2329});client[_0xca16('0x4')]=function(_0x3c0904,_0x59d03a){return new BPromise(function(_0x2516d9,_0x13058a){return client[_0xca16('0x5')](_0x3c0904,_0x59d03a)['then'](function(_0x46ddb2){logger[_0xca16('0x6')](_0xca16('0x7'),'routing',_0x3c0904,_0x59d03a,_0x46ddb2);if(_0x46ddb2[_0xca16('0x8')]){logger[_0xca16('0x8')](_0xca16('0x7'),_0xca16('0x9'),_0x3c0904,_0x46ddb2['error'][_0xca16('0xa')],_0x59d03a);return _0x13058a(_0x46ddb2[_0xca16('0x8')][_0xca16('0xa')]);}else{return _0x2516d9(_0x46ddb2[_0xca16('0xb')]);}})[_0xca16('0xc')](function(_0x2b741d){logger[_0xca16('0x8')]('rpc',_0xca16('0x9'),_0x3c0904,_0x2b741d,_0x59d03a);return _0x13058a(_0x2b741d);});});};module[_0xca16('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index dcaffda..2b4209a 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 _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 +var _0x776b=['error','./server','./realtime','./rpc/mailAccount','./rpc/setting','email','resolve','then','getMailAccounts','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','catch'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x776b,0x6a));var _0xb776=function(_0x43c94c,_0x4fcb70){_0x43c94c=_0x43c94c-0x0;var _0x564455=_0x776b[_0x43c94c];return _0x564455;};'use strict';var server=require(_0xb776('0x0'));var Realtime=require(_0xb776('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xb776('0x2'));var setting=require(_0xb776('0x3'));var logger=require('../../config/logger')(_0xb776('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xb776('0x5')]()[_0xb776('0x6')](mailAccount[_0xb776('0x7')]())[_0xb776('0x6')](realtime[_0xb776('0x8')]())[_0xb776('0x6')](function(){email['refresh'](realtime[_0xb776('0x9')]);return realtime;});}function main(){return server[_0xb776('0xa')](realtime,email)[_0xb776('0x6')](function(){return initRealtime();})[_0xb776('0x6')](function(){return setting[_0xb776('0xb')]();})[_0xb776('0x6')](function(_0x1537c6){return setInterval(initRealtime,_0x1537c6[_0xb776('0xc')]*0x3e8);})[_0xb776('0xd')](function(_0x12a81f){logger[_0xb776('0xe')]('Email\x20service\x20initialization',_0x12a81f);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index d197ea7..3299abc 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 _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 +var _0x2351=['ioredis','../../../config/environment','email','defaults','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','imapAccounts','smtp','prototype','mailAccounts','key','active','Imap','status','isNil','stringify','emit','mailAccount:update','hasOwnProperty','service','provider','custom','box','handleImapBox','handleImapEmail','bind','end','handleImapError','messageStatus','name','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','error','sendMail','send','verifySmtp','Smtp','verify','exports','lodash','moment','bluebird','md5'];(function(_0x36669e,_0x563963){var _0x5da66e=function(_0x2245e5){while(--_0x2245e5){_0x36669e['push'](_0x36669e['shift']());}};_0x5da66e(++_0x563963);}(_0x2351,0x14c));var _0x1235=function(_0x494c77,_0x3d5943){_0x494c77=_0x494c77-0x0;var _0x3c55ad=_0x2351[_0x494c77];return _0x3c55ad;};'use strict';var _=require(_0x1235('0x0'));var moment=require(_0x1235('0x1'));var BPromise=require(_0x1235('0x2'));var md5=require(_0x1235('0x3'));var Redis=require(_0x1235('0x4'));var config=require(_0x1235('0x5'));var logger=require('../../../config/logger')(_0x1235('0x6'));config['redis']=_[_0x1235('0x7')](config[_0x1235('0x8')],{'host':_0x1235('0x9'),'port':0x18eb});var io=require(_0x1235('0xa'))(new Redis(config[_0x1235('0x8')]));var EmailImap=require(_0x1235('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x1235('0xc'));var md5Accounts={};function EmailChannel(_0x4a326a){logger[_0x1235('0xd')](_0x1235('0xe'));this['mailAccounts']=_0x4a326a['mailAccounts'];this[_0x1235('0xf')]={};this[_0x1235('0x10')]=new EmailSmtp();}EmailChannel[_0x1235('0x11')]['emit']=function(_0x37b295){var _0x2b31f5=this[_0x1235('0x12')][_0x37b295];var _0x11bd9f={'id':_0x2b31f5['id'],'name':_0x2b31f5['name'],'key':_0x2b31f5[_0x1235('0x13')],'active':_0x2b31f5[_0x1235('0x14')],'Imap':{'status':_0x2b31f5[_0x1235('0x15')][_0x1235('0x16')],'messageStatus':_0x2b31f5['Imap']['messageStatus'],'total':_0x2b31f5['Imap']['total']}};if(_[_0x1235('0x17')](md5Accounts[_0x37b295])){md5Accounts[_0x37b295]={};}var _0x4a7870=md5(JSON[_0x1235('0x18')](_0x11bd9f));if(md5Accounts[_0x37b295][_0x1235('0x3')]!==_0x4a7870){md5Accounts[_0x37b295]['md5']=_0x4a7870;io[_0x1235('0x19')](_0x1235('0x1a'),_0x11bd9f);}};EmailChannel['prototype']['refresh']=function(_0x3741ec){for(var _0x2be420 in _0x3741ec){if(_0x3741ec[_0x1235('0x1b')](_0x2be420)){if(_0x3741ec[_0x2be420]['Imap']&&_0x3741ec[_0x2be420][_0x1235('0x14')]){var _0x4714b8=_0x3741ec[_0x2be420][_0x1235('0x15')];if(!_0x4714b8[_0x1235('0x1c')]&&_0x3741ec[_0x2be420][_0x1235('0x1d')]!==_0x1235('0x1e'))_0x4714b8['service']=_0x3741ec[_0x2be420]['provider'];if(!this[_0x1235('0xf')][_0x1235('0x1b')](_0x4714b8['id'])){this[_0x1235('0xf')][_0x4714b8['id']]=new EmailImap(_0x4714b8,_0x3741ec[_0x2be420][_0x1235('0x6')]);this[_0x1235('0xf')][_0x4714b8['id']]['on'](_0x1235('0x1f'),this[_0x1235('0x20')]['bind'](this,_0x2be420));this['imapAccounts'][_0x4714b8['id']]['on'](_0x1235('0x6'),this[_0x1235('0x21')][_0x1235('0x22')](this,_0x2be420));this[_0x1235('0xf')][_0x4714b8['id']]['on'](_0x1235('0x23'),this['handleImapEnd'][_0x1235('0x22')](this,_0x2be420));this['imapAccounts'][_0x4714b8['id']]['on']('error',this[_0x1235('0x24')][_0x1235('0x22')](this,_0x2be420));}}else{if(_[_0x1235('0x17')](this[_0x1235('0x12')][_0x2be420]['Imap'])){this['mailAccounts'][_0x2be420][_0x1235('0x15')]={};}this[_0x1235('0x12')][_0x2be420][_0x1235('0x15')][_0x1235('0x16')]='disabled';this[_0x1235('0x12')][_0x2be420]['Imap'][_0x1235('0x25')]='';this[_0x1235('0x19')](_0x2be420);}}}};EmailChannel[_0x1235('0x11')][_0x1235('0x20')]=function(_0x5d031a,_0x2a6856){if(this['mailAccounts'][_0x5d031a]){this['mailAccounts'][_0x5d031a]['Imap'][_0x1235('0x16')]='connected';this[_0x1235('0x12')][_0x5d031a][_0x1235('0x15')]['messageStatus']=_0x2a6856[_0x1235('0x26')];if(_0x2a6856['messages']){this[_0x1235('0x12')][_0x5d031a][_0x1235('0x15')]['total']=_0x2a6856['messages'][_0x1235('0x27')];}return this[_0x1235('0x19')](_0x5d031a);}};EmailChannel[_0x1235('0x11')][_0x1235('0x21')]=function(_0x4ae0fe,_0x13e40a){logger[_0x1235('0xd')](_0x1235('0x28'),_0x13e40a['firstName'],_0x13e40a['lastName'],_0x13e40a[_0x1235('0x29')],_0x4ae0fe);if(this['mailAccounts'][_0x4ae0fe]){return mailAccount[_0x1235('0x2a')](_0x4ae0fe,_0x13e40a)[_0x1235('0x2b')](function(_0x41746a){if(_0x41746a){logger['info'](_0x1235('0x2c'));}})[_0x1235('0x2d')](function(_0x5894ba){logger['error'](_0x1235('0x2e'),JSON[_0x1235('0x18')](_0x5894ba));});}};EmailChannel['prototype'][_0x1235('0x2f')]=function(_0x4ec448){if(this[_0x1235('0x12')][_0x4ec448]&&this[_0x1235('0x12')][_0x4ec448]['Imap']){if(this[_0x1235('0xf')][this[_0x1235('0x12')][_0x4ec448][_0x1235('0x15')]['id']]){delete this[_0x1235('0xf')][this['mailAccounts'][_0x4ec448]['Imap']['id']];}this[_0x1235('0x12')][_0x4ec448][_0x1235('0x15')][_0x1235('0x30')]=moment();this[_0x1235('0x19')](_0x4ec448);}};EmailChannel[_0x1235('0x11')][_0x1235('0x24')]=function(_0x582e99,_0x490e90){if(this[_0x1235('0x12')][_0x582e99]){this['mailAccounts'][_0x582e99]['Imap'][_0x1235('0x16')]=_0x1235('0x31');this[_0x1235('0x12')][_0x582e99][_0x1235('0x15')]['messageStatus']=_0x490e90;return this[_0x1235('0x19')](_0x582e99);}};EmailChannel[_0x1235('0x11')][_0x1235('0x32')]=function(_0x5d9baa,_0x3e4353){return this[_0x1235('0x10')][_0x1235('0x33')](_0x5d9baa,_0x3e4353);};EmailChannel[_0x1235('0x11')][_0x1235('0x34')]=function(_0x2c49a5){var _0x441ac6=this;if(this[_0x1235('0x12')][_0x2c49a5['id']]){if(_[_0x1235('0x17')](this[_0x1235('0x12')][_0x2c49a5['id']][_0x1235('0x35')])){this['mailAccounts'][_0x2c49a5['id']]['Smtp']={};}this[_0x1235('0x12')][_0x2c49a5['id']][_0x1235('0x35')][_0x1235('0x30')]=moment();return new BPromise(function(_0x3a0313,_0x2fd51b){return _0x441ac6[_0x1235('0x10')][_0x1235('0x36')](_0x2c49a5)['then'](function(_0x4b8eda){_0x441ac6['mailAccounts'][_0x2c49a5['id']]['Smtp'][_0x1235('0x16')]='verified';_0x441ac6[_0x1235('0x12')][_0x2c49a5['id']][_0x1235('0x35')][_0x1235('0x25')]='';_0x441ac6['emit'](_0x2c49a5['id']);_0x3a0313(_0x4b8eda);})[_0x1235('0x2d')](function(_0x22d48f){_0x441ac6[_0x1235('0x12')][_0x2c49a5['id']][_0x1235('0x35')][_0x1235('0x16')]=_0x1235('0x31');_0x441ac6['mailAccounts'][_0x2c49a5['id']][_0x1235('0x35')][_0x1235('0x25')]=_0x22d48f;_0x441ac6[_0x1235('0x19')](_0x2c49a5['id']);_0x2fd51b(_0x22d48f);});});}return this[_0x1235('0x10')][_0x1235('0x36')](_0x2c49a5);};module[_0x1235('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 96b3e22..e009ec6 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 _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 +var _0x3391=['handleFetchMessage','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','handleFetchEnd','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','ready','handleReady','bind','once','end','handleEnd','error','connect','inherits','prototype','connTimeout','authTimeout','service','modernAuthentication','xoauth2','generateXOAuth2Token','user','password','authentication','host','port','tls','handleError','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0x3391,0x17d));var _0x1339=function(_0x3b419e,_0x4109bc){_0x3b419e=_0x3b419e-0x0;var _0x1c0147=_0x3391[_0x3b419e];return _0x1c0147;};'use strict';var _=require(_0x1339('0x0'));var util=require(_0x1339('0x1'));var Imap=require(_0x1339('0x2'));var simpleParser=require(_0x1339('0x3'))[_0x1339('0x4')];var Iconv=require(_0x1339('0x5'))[_0x1339('0x6')];var EventEmitter=require(_0x1339('0x7'))[_0x1339('0x8')];var utils=require(_0x1339('0x9'));var logger=require(_0x1339('0xa'))(_0x1339('0xb'));function EmailImap(_0x1a111b,_0x3bad30){this[_0x1339('0xc')]=_0x1a111b[_0x1339('0xc')];this[_0x1339('0xd')]=this[_0x1339('0xe')](_0x1a111b,_0x3bad30);this[_0x1339('0x2')]=new Imap(this[_0x1339('0xd')]);this[_0x1339('0x2')]['once'](_0x1339('0xf'),this[_0x1339('0x10')][_0x1339('0x11')](this));this[_0x1339('0x2')][_0x1339('0x12')](_0x1339('0x13'),this[_0x1339('0x14')][_0x1339('0x11')](this));this[_0x1339('0x2')]['on'](_0x1339('0x15'),this['handleError'][_0x1339('0x11')](this));this[_0x1339('0x2')][_0x1339('0x16')]();}util[_0x1339('0x17')](EmailImap,EventEmitter);EmailImap[_0x1339('0x18')][_0x1339('0xe')]=function(_0x1c09b1,_0x10921c){var _0x2acd4d={'connTimeout':_0x1c09b1['connTimeout']?_0x1c09b1[_0x1339('0x19')]*0x3e8:0x2710,'authTimeout':_0x1c09b1[_0x1339('0x1a')]?_0x1c09b1[_0x1339('0x1a')]*0x3e8:0x1388};if(_0x1c09b1[_0x1339('0x1b')]){_0x2acd4d['user']=_0x1c09b1['user'];if(_0x1c09b1[_0x1339('0x1c')]){_0x2acd4d[_0x1339('0x1d')]=utils[_0x1339('0x1e')](_0x1c09b1['CloudProvider']['data5'],_0x1c09b1[_0x1339('0x1f')]);}else{_0x2acd4d[_0x1339('0x20')]=_0x1c09b1[_0x1339('0x20')];}}else{if(_0x1c09b1[_0x1339('0x21')]){_0x2acd4d[_0x1339('0x1f')]=_0x1c09b1[_0x1339('0x1f')];_0x2acd4d[_0x1339('0x20')]=_0x1c09b1['password'];}}_0x2acd4d[_0x1339('0xb')]=_0x10921c||_0x1c09b1[_0x1339('0x1f')]||'anonymous@xcally.com';_0x2acd4d[_0x1339('0x22')]=_0x1c09b1['host'];_0x2acd4d[_0x1339('0x23')]=_0x1c09b1[_0x1339('0x23')]||0x3e1;if(_0x1c09b1[_0x1339('0x24')]){_0x2acd4d['tls']=!![];}else{_0x2acd4d[_0x1339('0x24')]=![];_0x2acd4d['autotls']='required';}return _0x2acd4d;};EmailImap[_0x1339('0x18')][_0x1339('0x10')]=function(){this[_0x1339('0x2')]['openBox'](this[_0x1339('0xc')],![],this['handleOpenBox'][_0x1339('0x11')](this));};EmailImap[_0x1339('0x18')]['handleOpenBox']=function(_0x9fd40d,_0x47fad3){if(_0x9fd40d){this[_0x1339('0x25')](_0x9fd40d,!![]);}else{this['emit']('box',_0x47fad3);this[_0x1339('0x26')]();}};EmailImap['prototype'][_0x1339('0x27')]=function(_0x218094){if(_0x218094){this[_0x1339('0x25')](_0x218094,!![]);}else{this[_0x1339('0x2')][_0x1339('0x13')]();}};EmailImap[_0x1339('0x18')][_0x1339('0x26')]=function(){this[_0x1339('0x2')][_0x1339('0x28')]([_0x1339('0x29')],this[_0x1339('0x2a')][_0x1339('0x11')](this));};EmailImap[_0x1339('0x18')][_0x1339('0x2a')]=function(_0x5e9faa,_0x47b87e){if(_0x5e9faa){this[_0x1339('0x25')](_0x5e9faa,!![]);}else{if(_0x47b87e[_0x1339('0x2b')]){try{var _0x29c691=this[_0x1339('0x2')][_0x1339('0x2c')](_0x47b87e,{'bodies':'','markSeen':!![]});_0x29c691['on'](_0x1339('0x2d'),this[_0x1339('0x2e')][_0x1339('0x11')](this));_0x29c691[_0x1339('0x12')]('error',this['handleFetchError'][_0x1339('0x11')](this));_0x29c691[_0x1339('0x12')](_0x1339('0x13'),this['handleFetchEnd']['bind'](this));}catch(_0x1978cf){logger[_0x1339('0x15')](_0x1978cf);}}else{this[_0x1339('0x2')][_0x1339('0x2f')](!![],this[_0x1339('0x27')][_0x1339('0x11')](this));}}};EmailImap[_0x1339('0x18')]['handleFetchMessage']=function(_0x38815c){_0x38815c['on']('body',this[_0x1339('0x30')][_0x1339('0x11')](this));_0x38815c[_0x1339('0x12')](_0x1339('0x31'),this[_0x1339('0x32')][_0x1339('0x11')](this));_0x38815c[_0x1339('0x12')]('end',this[_0x1339('0x33')]['bind'](this));};EmailImap[_0x1339('0x18')]['handleMessageBody']=function(_0x51dc5b){simpleParser(_0x51dc5b,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap[_0x1339('0x18')][_0x1339('0x32')]=function(){};EmailImap[_0x1339('0x18')]['handleMessageEnd']=function(){};EmailImap['prototype'][_0x1339('0x34')]=function(_0x36d7a7,_0x30e8d4){if(_0x36d7a7){logger[_0x1339('0x15')](_0x36d7a7);}else{var _0x3f836b=this;utils[_0x1339('0x35')](this['account'],_0x30e8d4,function(_0x48c3f2){_0x3f836b[_0x1339('0x36')](_0x1339('0xb'),_0x48c3f2);});}};EmailImap[_0x1339('0x18')][_0x1339('0x37')]=function(){this[_0x1339('0x2')][_0x1339('0x2f')](!![],this[_0x1339('0x27')][_0x1339('0x11')](this));};EmailImap['prototype'][_0x1339('0x38')]=function(_0x1cca97){this[_0x1339('0x25')](_0x1cca97);this['imap']['closeBox'](!![],this[_0x1339('0x27')][_0x1339('0x11')](this));};EmailImap[_0x1339('0x18')][_0x1339('0x14')]=function(){this[_0x1339('0x36')](_0x1339('0x13'));};EmailImap[_0x1339('0x18')]['handleError']=function(_0x1a1508,_0x300561){logger[_0x1339('0x15')](_0x1339('0x25'),this['account'][_0x1339('0xb')],JSON[_0x1339('0x39')](_0x1a1508));var _0x2b4c92='';if(_0x1a1508){if(_0x1a1508[_0x1339('0x3a')]){_0x2b4c92=_0x1a1508[_0x1339('0x3a')];}else{for(var _0x5ad2df in _0x1a1508){if(_0x1a1508[_0x1339('0x3b')](_0x5ad2df)){_0x2b4c92+=_[_0x1339('0x3c')](_0x5ad2df)+':\x20'+_0x1a1508[_0x5ad2df]+'\x0a';}}}}if(_0x300561){this[_0x1339('0x2')][_0x1339('0x13')]();}else{this['emit']('error',_0x2b4c92);this['emit'](_0x1339('0x13'));}};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 833dca9..8c46aca 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 _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 +var _0x79d3=['nodemailer','nodemailer-plugin-inline-base64','send','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired'];(function(_0x19505d,_0x59e380){var _0x455fdb=function(_0x2a68a9){while(--_0x2a68a9){_0x19505d['push'](_0x19505d['shift']());}};_0x455fdb(++_0x59e380);}(_0x79d3,0xd2));var _0x379d=function(_0x32bbb1,_0xa0e27e){_0x32bbb1=_0x32bbb1-0x0;var _0x42b415=_0x79d3[_0x32bbb1];return _0x42b415;};'use strict';var nodemailer=require(_0x379d('0x0'));var inlineBase64=require(_0x379d('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x379d('0x2')]=function(_0xb14d92,_0x1dcabb){return new Promise(function(_0x29666d,_0x1e7194){var _0xfa0bc5=nodemailer[_0x379d('0x3')](_0xb14d92);_0xfa0bc5[_0x379d('0x4')](_0x379d('0x5'),inlineBase64());_0xfa0bc5[_0x379d('0x6')](_0x1dcabb,function(_0x8a00c,_0x3c93e1){if(_0x8a00c){_0x1e7194(_0x8a00c[_0x379d('0x7')]());}else{_0x29666d(_0x3c93e1);}});});};EmailSmtp['prototype'][_0x379d('0x8')]=function(_0x6b9a73){return new Promise(function(_0x35fbfa,_0x4be47d){var _0x20a124=nodemailer[_0x379d('0x3')](_0x6b9a73);_0x20a124[_0x379d('0x8')](function(_0x2fd684,_0x6f1a80){if(_0x2fd684){_0x4be47d(_0x2fd684[_0x379d('0x7')]());}else{if(_0x6f1a80){_0x35fbfa(_0x6f1a80);}else{_0x4be47d(_0x379d('0x9'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 886d81c..71ca3ab 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 _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 +var _0xbf6f=['head','value','address','anonymous','generate','@xcally.com','name','substring','split','length','slice','join','Anonymous','pop','html','test','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','auth=Bearer\x20','toString','lodash','moment','randomstring','util','../../../config/logger','email','../../../config/environment'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xbf6f,0x157));var _0xfbf6=function(_0x5c52e6,_0x2a98fa){_0x5c52e6=_0x5c52e6-0x0;var _0x48c5ef=_0xbf6f[_0x5c52e6];return _0x48c5ef;};'use strict';var _=require(_0xfbf6('0x0'));var moment=require(_0xfbf6('0x1'));var random=require(_0xfbf6('0x2'));var fs=require('fs');var path=require('path');var util=require(_0xfbf6('0x3'));var tnef=require('node-tnef');var logger=require(_0xfbf6('0x4'))(_0xfbf6('0x5'));var config=require(_0xfbf6('0x6'));function getAddress(_0x3f6fc3){var _0x41053d=_[_0xfbf6('0x7')](_0x3f6fc3[_0xfbf6('0x8')]);return _0x41053d&&_0x41053d[_0xfbf6('0x9')]?_0x41053d[_0xfbf6('0x9')]:_0xfbf6('0xa')+random[_0xfbf6('0xb')](0x6)+_0xfbf6('0xc');}function getFirstName(_0x1c97d1){var _0x4cfae1=_[_0xfbf6('0x7')](_0x1c97d1[_0xfbf6('0x8')]);if(_0x4cfae1&&_0x4cfae1['name']){if(_0x4cfae1[_0xfbf6('0xd')]==_0x4cfae1[_0xfbf6('0x9')]){return _0x4cfae1['name'][_0xfbf6('0xe')](0x0,_0x4cfae1['name']['indexOf']('@'));}var _0x4db9b3=_0x4cfae1[_0xfbf6('0xd')][_0xfbf6('0xf')](/\s+/);return _0x4db9b3[_0xfbf6('0x10')]>0x1?_0x4db9b3[_0xfbf6('0x11')](0x0,-0x1)[_0xfbf6('0x12')]('\x20'):_0x4cfae1[_0xfbf6('0xd')];}return _0xfbf6('0x13');}function getLastName(_0x16d13e){var _0x454553=_[_0xfbf6('0x7')](_0x16d13e[_0xfbf6('0x8')]);if(_0x454553&&_0x454553[_0xfbf6('0xd')]){var _0x1ebfeb=_0x454553['name']['split'](/\s+/);return _0x1ebfeb['length']>0x1?_0x1ebfeb[_0xfbf6('0x14')]():'';}return'';}function getMails(_0x128ce0,_0x94393a){var _0x2bbdf4='';for(var _0x45aed8=0x0;_0x45aed8<_0x94393a[_0xfbf6('0x8')][_0xfbf6('0x10')];_0x45aed8+=0x1){if(_0x94393a[_0xfbf6('0x8')][_0x45aed8]['address']!==_0x128ce0){if(!_['isEmpty'](_0x2bbdf4)){_0x2bbdf4+=',';}_0x2bbdf4+=_0x94393a[_0xfbf6('0x8')][_0x45aed8][_0xfbf6('0xd')]||_0x94393a[_0xfbf6('0x8')][_0x45aed8][_0xfbf6('0x9')]||'';_0x2bbdf4+='\x20<';_0x2bbdf4+=_0x94393a[_0xfbf6('0x8')][_0x45aed8][_0xfbf6('0x9')]?_0x94393a['value'][_0x45aed8][_0xfbf6('0x9')]:_0xfbf6('0xa')+random[_0xfbf6('0xb')](0x6)+_0xfbf6('0xc');_0x2bbdf4+='>';}}return _0x2bbdf4;}function parseEmail(_0x4ebd4c,_0x52414e,_0x4a4374){if(_0x52414e[_0xfbf6('0x15')]){var _0x581789=/)<[^<]*)*<\/script>/gi;while(_0x581789[_0xfbf6('0x16')](_0x52414e[_0xfbf6('0x15')])){_0x52414e[_0xfbf6('0x15')]=_0x52414e[_0xfbf6('0x15')]['replace'](_0x581789,'');}if(_0x52414e[_0xfbf6('0x15')][_0xfbf6('0x17')](_0xfbf6('0x18'))){var _0x272bc7=[];_0x52414e[_0xfbf6('0x19')]['forEach'](_0x42c644=>{_0x272bc7[_0xfbf6('0x1a')](_0x42c644[_0xfbf6('0x1b')]);});var _0x1222ca=/]+>/g;var _0x283461=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x3694ca=_0x52414e[_0xfbf6('0x15')][_0xfbf6('0x1c')](_0x283461,'_SRC');var _0x308cc8=_0x3694ca[_0xfbf6('0x1c')](_0x1222ca,_0xfbf6('0x1d'));for(let _0xce065=0x0;_0xce065<_0x272bc7['length'];_0xce065++){var _0x1ede15=_0x308cc8[_0xfbf6('0x1c')](_0xfbf6('0x1d'),_0xfbf6('0x1e')+_0x272bc7[_0xce065]+_0xfbf6('0x1f'));_0x308cc8=_0x1ede15;}_0x52414e[_0xfbf6('0x15')]=_0x308cc8;}_0x4a4374[_0xfbf6('0x20')]=_0x52414e[_0xfbf6('0x15')];}else{_0x4a4374[_0xfbf6('0x20')]=_0x52414e[_0xfbf6('0x21')];}if(_0x4a4374[_0xfbf6('0x20')]){_0x4a4374[_0xfbf6('0x20')]=_0x4a4374[_0xfbf6('0x20')][_0xfbf6('0x1c')](/0x0){var _0x511abf=[_0xfbf6('0x2f'),'X-Auto-Response-Suppress:\x20All',_0xfbf6('0x30')];for(var _0x318e51=0x0;_0x318e51<_0x52414e['headerLines'][_0xfbf6('0x10')];_0x318e51++){var _0x10f042=_['indexOf'](_0x511abf,_0x52414e['headerLines'][_0x318e51][_0xfbf6('0x31')]);if(_0x10f042>=0x0){_0x4a4374[_0xfbf6('0x32')]=!![];}}}return _0x4a4374;}exports[_0xfbf6('0x33')]=function(_0x454ba1,_0x49a70b,_0x4c197b){var _0x14c0e4={'from':getAddress(_0x49a70b['from']),'firstName':getFirstName(_0x49a70b[_0xfbf6('0x34')]),'lastName':getLastName(_0x49a70b[_0xfbf6('0x34')]),'mapKey':_0xfbf6('0x5'),'message':{'from':getMails(_0x454ba1[_0xfbf6('0x5')],_0x49a70b['from']),'to':_0x454ba1['email'],'cc':'','subject':_0x49a70b[_0xfbf6('0x35')]||'','messageId':_0x49a70b[_0xfbf6('0x36')],'inReplyTo':_0x49a70b[_0xfbf6('0x37')],'sentAt':moment(_0x49a70b[_0xfbf6('0x38')])[_0xfbf6('0x39')](_0xfbf6('0x3a')),'attach':![],'attachments':[]}};if(!_0x49a70b[_0xfbf6('0x15')]&&!_0x49a70b[_0xfbf6('0x21')]){var _0x264474=_[_0xfbf6('0x3b')](_0x49a70b[_0xfbf6('0x19')],{'contentType':'application/ms-tnef'});if(_0x264474['length']){logger[_0xfbf6('0x3c')](util[_0xfbf6('0x39')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x49a70b[_0xfbf6('0x36')]));tnef[_0xfbf6('0x3d')](_['first'](_0x264474)['content'],function(_0x45ae8c,_0x39862c){if(_0x39862c){_0x49a70b[_0xfbf6('0x15')]=_0x39862c[_0xfbf6('0x3e')]||_0xfbf6('0x3f');if(_0x39862c['Attachments']){for(var _0x5d00ab=0x0;_0x5d00ab<_0x39862c['Attachments'][_0xfbf6('0x10')];_0x5d00ab++){var _0x5ca842=_0x39862c[_0xfbf6('0x40')][_0x5d00ab];_0x14c0e4[_0xfbf6('0x23')][_0xfbf6('0x19')][_0xfbf6('0x1a')]({'filename':_0x5ca842[_0xfbf6('0x41')],'content':Buffer['from'](_0x5ca842[_0xfbf6('0x42')])});}}}_0x4c197b(parseEmail(_0x454ba1,_0x49a70b,_0x14c0e4));});}else{_0x49a70b[_0xfbf6('0x15')]=_0xfbf6('0x3f');_0x4c197b(parseEmail(_0x454ba1,_0x49a70b,_0x14c0e4));}}else{_0x4c197b(parseEmail(_0x454ba1,_0x49a70b,_0x14c0e4));}};exports[_0xfbf6('0x43')]=function(_0xad670b,_0x291433){var _0x4d4e8d=['user='+(_0x291433||''),_0xfbf6('0x44')+_0xad670b,'',''];return Buffer['from'](_0x4d4e8d['join'](''),'utf-8')[_0xfbf6('0x45')]('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 551e961..831d3e3 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 _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 +var _0xa727=['lodash','name','key','SERV','active','Imap','Smtp','exports'];(function(_0xed36d2,_0x49cb7b){var _0x18bdd5=function(_0x1e522f){while(--_0x1e522f){_0xed36d2['push'](_0xed36d2['shift']());}};_0x18bdd5(++_0x49cb7b);}(_0xa727,0x190));var _0x7a72=function(_0x2031c1,_0x593e31){_0x2031c1=_0x2031c1-0x0;var _0x4dfeba=_0xa727[_0x2031c1];return _0x4dfeba;};'use strict';var _=require(_0x7a72('0x0'));function MailAccount(_0xb09165){this['id']=_0xb09165['id']||0x0;this[_0x7a72('0x1')]=_0xb09165[_0x7a72('0x1')]||'Service';this[_0x7a72('0x2')]=_0xb09165[_0x7a72('0x2')]||_0x7a72('0x3');this[_0x7a72('0x4')]=_0xb09165[_0x7a72('0x4')]||![];this['Imap']=_0xb09165[_0x7a72('0x5')]||[];this[_0x7a72('0x6')]=_0xb09165[_0x7a72('0x6')]||[];}module[_0x7a72('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index de4236d..260088a 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 _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 +var _0x5c4c=['exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','merge'];(function(_0x311686,_0x3e6112){var _0x1b47f8=function(_0x5161c5){while(--_0x5161c5){_0x311686['push'](_0x311686['shift']());}};_0x1b47f8(++_0x3e6112);}(_0x5c4c,0x156));var _0xc5c4=function(_0x4f5b0c,_0xc3d777){_0x4f5b0c=_0x4f5b0c-0x0;var _0x29b45d=_0x5c4c[_0x4f5b0c];return _0x29b45d;};'use strict';var _=require(_0xc5c4('0x0'));var MailAccount=require(_0xc5c4('0x1'));var Realtime=function(){this[_0xc5c4('0x2')]={};};function freeIsNotKey(_0x53f708,_0x4dbead,_0x6fb0b3){var _0x29dcf0=_[_0xc5c4('0x3')](_0x53f708,function(_0x2d53cf,_0x4e879a){return _0x2d53cf[_0x6fb0b3];});for(var _0x53eac6 in _0x4dbead){if(_0x4dbead[_0xc5c4('0x4')](_0x53eac6)){if(!_0x29dcf0[_0x53eac6]){delete _0x4dbead[_0x53eac6];}}}}Realtime[_0xc5c4('0x5')][_0xc5c4('0x6')]=function(_0x4799e9,_0x56011e){for(var _0x35ccfc in _0x56011e){if(_0x4799e9[_0xc5c4('0x4')](_0x35ccfc)){_0x4799e9[_0x35ccfc]=_0x56011e[_0x35ccfc];}}};Realtime[_0xc5c4('0x5')][_0xc5c4('0x7')]=function(){var _0x171c8c=this;return function(_0x1164bd){if(_0x1164bd){freeIsNotKey(_0x1164bd,_0x171c8c['mailAccounts'],'id');for(var _0x22e89a=0x0,_0x3d17f6={},_0x27faf3={};_0x22e89a<_0x1164bd[_0xc5c4('0x8')];_0x22e89a+=0x1){_0x3d17f6=_0x1164bd[_0x22e89a];if(_['isUndefined'](_0x171c8c['mailAccounts'][_0x3d17f6['id']])){_0x171c8c[_0xc5c4('0x2')][_0x3d17f6['id']]=new MailAccount(_0x3d17f6);}else{_[_0xc5c4('0x9')](_0x171c8c['mailAccounts'][_0x3d17f6['id']],_0x3d17f6);}}}return _0x171c8c[_0xc5c4('0x2')];};};module[_0xc5c4('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 7a799f2..9462286 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 _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 +var _0x8991=['ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','MailServerOut','data5','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','name','provider','service','email','active','key'];(function(_0x5e3b59,_0x242eb3){var _0x5c3434=function(_0x1c9bc5){while(--_0x1c9bc5){_0x5e3b59['push'](_0x5e3b59['shift']());}};_0x5c3434(++_0x242eb3);}(_0x8991,0x1b0));var _0x1899=function(_0xbc9b18,_0x4b8e42){_0xbc9b18=_0xbc9b18-0x0;var _0x432f8a=_0x8991[_0xbc9b18];return _0x432f8a;};'use strict';var client=require(_0x1899('0x0'));exports[_0x1899('0x1')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0x1899('0x2'),_0x1899('0x3'),_0x1899('0x4'),_0x1899('0x5'),_0x1899('0x6'),_0x1899('0x7'),_0x1899('0x8'),_0x1899('0x9')],'raw':![],'include':[{'model':_0x1899('0xa'),'as':_0x1899('0xb'),'include':[{'model':_0x1899('0xc'),'attributes':['id',_0x1899('0x2'),_0x1899('0x4'),_0x1899('0xd'),'data5'],'as':_0x1899('0xc')}]},{'model':_0x1899('0xe'),'as':'Smtp','include':[{'model':_0x1899('0xc'),'attributes':['id',_0x1899('0x2'),_0x1899('0x4'),'type',_0x1899('0xf')],'as':_0x1899('0xc')}]}]},'log':_0x1899('0x10')});};};exports[_0x1899('0x11')]=function(_0x56fa3a,_0x4811fb){return client[_0x1899('0x12')]('NotifyMailAccount',{'account':{'id':_0x56fa3a},'body':_0x4811fb,'log':_0x1899('0x13')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 52263ab..2019958 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 _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 +var _0x7453=['../client','getSettings','Request','loginMailFrequency','GetSettings'];(function(_0x248976,_0x3b4c98){var _0x115255=function(_0x5a15e5){while(--_0x5a15e5){_0x248976['push'](_0x248976['shift']());}};_0x115255(++_0x3b4c98);}(_0x7453,0x91));var _0x3745=function(_0x4e68a4,_0x99d9f6){_0x4e68a4=_0x4e68a4-0x0;var _0x125c9b=_0x7453[_0x4e68a4];return _0x125c9b;};'use strict';var client=require(_0x3745('0x0'));exports[_0x3745('0x1')]=function(){return client[_0x3745('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3745('0x3')]},'log':_0x3745('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index eb21a02..a00112a 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(_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 +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 fd5f4a7..997ed0f 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 _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 +var _0xff54=['socket.io','websocket','polling','redis','defaults','socket.io-redis','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port'];(function(_0x2fb3a3,_0x27c589){var _0x18f665=function(_0x36bb1a){while(--_0x36bb1a){_0x2fb3a3['push'](_0x2fb3a3['shift']());}};_0x18f665(++_0x27c589);}(_0xff54,0x122));var _0x4ff5=function(_0x32cca2,_0x3ad320){_0x32cca2=_0x32cca2-0x0;var _0x4a8600=_0xff54[_0x32cca2];return _0x4a8600;};'use strict';var _=require(_0x4ff5('0x0'));var http=require(_0x4ff5('0x1'));var express=require(_0x4ff5('0x2'));var sticky=require(_0x4ff5('0x3'));var Redis=require(_0x4ff5('0x4'));var config=require(_0x4ff5('0x5'));var app=express();var server=http[_0x4ff5('0x6')](app);server[_0x4ff5('0x7')]=0xdbba0;if(sticky[_0x4ff5('0x8')](server,config[_0x4ff5('0x9')])){var socketio=require(_0x4ff5('0xa'))(server,{'transports':[_0x4ff5('0xb'),_0x4ff5('0xc')]});config[_0x4ff5('0xd')]=_[_0x4ff5('0xe')](config['redis'],{'host':'localhost','port':0x18eb});socketio['adapter'](require(_0x4ff5('0xf'))({'pubClient':new Redis(config[_0x4ff5('0xd')]),'subClient':new Redis(config[_0x4ff5('0xd')])}));require('../../config/triggers')[_0x4ff5('0x10')]();require(_0x4ff5('0x11'))['default'](socketio);require(_0x4ff5('0x12'))['default'](app);require(_0x4ff5('0x13'))['default'](app);}else{server[_0x4ff5('0x14')](_0x4ff5('0x15'),function(){console[_0x4ff5('0x16')](_0x4ff5('0x17'),config['port']);});}exports=module[_0x4ff5('0x18')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 7639b6d..46dc3e1 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 _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 +var _0x7cea=['rpc','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','http','Request','then','debug','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7cea,0x12b));var _0xa7ce=function(_0x53b01f,_0x19b7fa){_0x53b01f=_0x53b01f-0x0;var _0x447dea=_0x7cea[_0x53b01f];return _0x447dea;};'use strict';var jayson=require(_0xa7ce('0x0'));var BPromise=require(_0xa7ce('0x1'));var logger=require(_0xa7ce('0x2'))(_0xa7ce('0x3'));var client=jayson['client'][_0xa7ce('0x4')]({'port':0x2329});client[_0xa7ce('0x5')]=function(_0x165b93,_0x2ad0c7){return new BPromise(function(_0x3069ef,_0x3b576f){return client['request'](_0x165b93,_0x2ad0c7)[_0xa7ce('0x6')](function(_0x2a8700){logger[_0xa7ce('0x7')]('rpc',_0xa7ce('0x3'),_0x165b93,_0x2ad0c7,_0x2a8700);if(_0x2a8700[_0xa7ce('0x8')]){logger[_0xa7ce('0x8')](_0xa7ce('0x9'),_0xa7ce('0x3'),_0x165b93,_0x2a8700['error'][_0xa7ce('0xa')],_0x2ad0c7);return _0x3b576f(_0x2a8700[_0xa7ce('0x8')][_0xa7ce('0xa')]);}else{return _0x3069ef(_0x2a8700[_0xa7ce('0xb')]);}})[_0xa7ce('0xc')](function(_0x321ca5){logger[_0xa7ce('0x8')]('rpc',_0xa7ce('0x3'),_0x165b93,_0x321ca5,_0x2ad0c7);return _0x3b576f(_0x321ca5);});});};module[_0xa7ce('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 4b9cb14..5dced1e 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 _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 +var _0x7c3e=['getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x7c3e,0x140));var _0xe7c3=function(_0x151002,_0x1c9af6){_0x151002=_0x151002-0x0;var _0x1a7a58=_0x7c3e[_0x151002];return _0x1a7a58;};'use strict';var BPromise=require(_0xe7c3('0x0'));var server=require(_0xe7c3('0x1'));var Realtime=require(_0xe7c3('0x2'));var user=require(_0xe7c3('0x3'));var interval=require(_0xe7c3('0x4'));var openchannelQueue=require(_0xe7c3('0x5'));var chatQueue=require(_0xe7c3('0x6'));var smsQueue=require(_0xe7c3('0x7'));var mailQueue=require(_0xe7c3('0x8'));var faxQueue=require(_0xe7c3('0x9'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xe7c3('0xa')]()[_0xe7c3('0xb')](user[_0xe7c3('0xc')]())['then'](realtime[_0xe7c3('0xd')]())[_0xe7c3('0xb')](interval[_0xe7c3('0xe')]())['then'](realtime[_0xe7c3('0xf')]())['then'](openchannelQueue[_0xe7c3('0x10')]())['then'](realtime[_0xe7c3('0x11')]())['then'](chatQueue[_0xe7c3('0x12')]())['then'](realtime[_0xe7c3('0x13')]())[_0xe7c3('0xb')](smsQueue[_0xe7c3('0x14')]())['then'](realtime['initSmsQueues']())[_0xe7c3('0xb')](mailQueue[_0xe7c3('0x15')]())[_0xe7c3('0xb')](realtime[_0xe7c3('0x16')]())[_0xe7c3('0xb')](faxQueue[_0xe7c3('0x17')]())[_0xe7c3('0xb')](realtime['initFaxQueues']())[_0xe7c3('0xb')](whatsappQueue[_0xe7c3('0x18')]())['then'](realtime[_0xe7c3('0x19')]())[_0xe7c3('0xb')](function(){return realtime;});}function main(){return server[_0xe7c3('0x1a')](realtime)['then'](function(_0x3306ab){return initRealtime();})['then'](function(_0x534322){return setInterval(initRealtime,0x1388);})[_0xe7c3('0x1b')](function(_0x5dbbe5){console['log'](_0x5dbbe5);});}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 97ac0a2..91ad714 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_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 +var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x5ec896,_0x4c06cc){var _0x5b553b=function(_0x33afdc){while(--_0x33afdc){_0x5ec896['push'](_0x5ec896['shift']());}};_0x5b553b(++_0x4c06cc);}(_0x814b,0x1a2));var _0xb814=function(_0x21b706,_0x1022f4){_0x21b706=_0x21b706-0x0;var _0x13b94a=_0x814b[_0x21b706];return _0x13b94a;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 5b48646..b1693d3 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 _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 +var _0xe00e=['sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message','catch'];(function(_0x2ac4af,_0x288c53){var _0x3a36df=function(_0x271b11){while(--_0x271b11){_0x2ac4af['push'](_0x2ac4af['shift']());}};_0x3a36df(++_0x288c53);}(_0xe00e,0xa7));var _0xee00=function(_0x5ecd5b,_0x5bc4a9){_0x5ecd5b=_0x5ecd5b-0x0;var _0x471c75=_0xe00e[_0x5ecd5b];return _0x471c75;};'use strict';var BPromise=require(_0xee00('0x0'));var jayson=require(_0xee00('0x1'));var client=jayson[_0xee00('0x2')][_0xee00('0x3')]({'port':0x232b});function request(_0x536d1e,_0x1df1dd){return new BPromise(function(_0x3528b2,_0x370d1d){return client[_0xee00('0x4')](_0x536d1e,_0x1df1dd)[_0xee00('0x5')](function(_0x50e6e8){if(_0x50e6e8[_0xee00('0x6')]){return _0x370d1d(_0x50e6e8[_0xee00('0x6')][_0xee00('0x7')]);}else{return _0x3528b2(_0x50e6e8['result']);}})[_0xee00('0x8')](function(_0x3473a8){return _0x370d1d(_0x3473a8);});});}exports[_0xee00('0x9')]=function(_0x1b6e5a,_0x52628e){return request(_0xee00('0xa'),{'account':_0x1b6e5a,'message':_0x52628e});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 2d5e42d..26cc4b8 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 _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 +var _0x3f4f=['faxWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','updateRealtime','prototype','getChannelStatus','Capacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','length','toNumber','format','Status','chatCapacity','chatCurrentCapacity','smsStatus','smsCurrentCapacity','openchannelWaitingInteractions','whatsappWaitingInteractions','stringify','user:save','moment','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','chatWaitingInteractions'];(function(_0x10f626,_0x58bd25){var _0x5373aa=function(_0x2dd84e){while(--_0x2dd84e){_0x10f626['push'](_0x10f626['shift']());}};_0x5373aa(++_0x58bd25);}(_0x3f4f,0xdb));var _0xf3f4=function(_0x2c082b,_0x25a5de){_0x2c082b=_0x2c082b-0x0;var _0x35d22b=_0x3f4f[_0x2c082b];return _0x35d22b;};'use strict';var _=require('lodash');var moment=require(_0xf3f4('0x0'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0xf3f4('0x1'));config['redis']=_['defaults'](config[_0xf3f4('0x2')],{'host':_0xf3f4('0x3'),'port':0x18eb});var io=require(_0xf3f4('0x4'))(new Redis(config[_0xf3f4('0x2')]));function Agent(_0x44676c){this['id']=_0x44676c['id']||0x0;this[_0xf3f4('0x5')]=_0x44676c[_0xf3f4('0x5')]||'';this[_0xf3f4('0x6')]=_0x44676c[_0xf3f4('0x6')]||!![];this[_0xf3f4('0x7')]=_0x44676c[_0xf3f4('0x7')]||![];this[_0xf3f4('0x8')]=_0x44676c['chatPause']||![];this[_0xf3f4('0x9')]=_0x44676c[_0xf3f4('0x9')]||![];this['faxPause']=_0x44676c[_0xf3f4('0xa')]||![];this[_0xf3f4('0xb')]=_0x44676c['smsPause']||![];this['openchannelPause']=_0x44676c[_0xf3f4('0xc')]||![];this[_0xf3f4('0xd')]='unknown';this[_0xf3f4('0xe')]=0x0;this['chatCapacity']=_0x44676c['chatCapacity']||0x0;this['chatCurrentCapacity']=0x0;this[_0xf3f4('0xf')]=_0xf3f4('0x10');this[_0xf3f4('0x11')]=0x0;this['mailCapacity']=_0x44676c[_0xf3f4('0x12')]||0x0;this[_0xf3f4('0x13')]=0x0;this[_0xf3f4('0x14')]='unknown';this[_0xf3f4('0x15')]=0x0;this[_0xf3f4('0x16')]=_0x44676c[_0xf3f4('0x16')]||0x0;this[_0xf3f4('0x17')]=0x0;this['smsStatus']='unknown';this[_0xf3f4('0x18')]=0x0;this[_0xf3f4('0x19')]=_0x44676c['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']=_0xf3f4('0x10');this[_0xf3f4('0x1a')]=0x0;this[_0xf3f4('0x1b')]=_0x44676c[_0xf3f4('0x1b')]||0x0;this[_0xf3f4('0x1c')]=0x0;this[_0xf3f4('0x1d')]=_0xf3f4('0x10');this[_0xf3f4('0x1e')]=0x0;this['openchannelCapacity']=_0x44676c[_0xf3f4('0x1f')]||0x0;this[_0xf3f4('0x20')]=0x0;this[_0xf3f4('0x21')]=![];this[_0xf3f4('0x22')]=undefined;this[_0xf3f4('0x23')]='';this[_0xf3f4('0x24')]={};this[_0xf3f4('0x25')]={};this[_0xf3f4('0x26')]={};this['openchannelWaitingInteractions']={};this[_0xf3f4('0x27')]={};this['whatsappWaitingInteractions']={};this[_0xf3f4('0x28')]();}Agent[_0xf3f4('0x29')][_0xf3f4('0x2a')]=function(_0x511063){if(this[_0x511063+'CurrentCapacity']>0x0){if(this[_0x511063+_0xf3f4('0x2b')]>0x0&&this[_0x511063+'CurrentCapacity']>=this[_0x511063+_0xf3f4('0x2b')]){return _0xf3f4('0x2c');}else{return _0xf3f4('0x2d');}}else{return _0xf3f4('0x2e');}};Agent['prototype'][_0xf3f4('0x28')]=function(){var _0x3e07d0=[_0xf3f4('0x2f'),_0xf3f4('0x30'),_0xf3f4('0x31'),_0xf3f4('0x32'),_0xf3f4('0x33'),'whatsapp'];for(var _0x3f7dcc=0x0;_0x3f7dcc<_0x3e07d0[_0xf3f4('0x34')];_0x3f7dcc+=0x1){var _0x5f15a9=this['getChannelStatus'](_0x3e07d0[_0x3f7dcc]);if(this[_0x3e07d0[_0x3f7dcc]+'Status']!==_0x5f15a9){this[_0x3e07d0[_0x3f7dcc]+'StatusTime']=_[_0xf3f4('0x35')](moment()[_0xf3f4('0x36')]('x'));}this[_0x3e07d0[_0x3f7dcc]+_0xf3f4('0x37')]=_0x5f15a9;}var _0x53c875={'id':this['id'],'name':this[_0xf3f4('0x5')],'online':this[_0xf3f4('0x6')],'voicePause':this['voicePause'],'chatPause':this[_0xf3f4('0x8')],'mailPause':this[_0xf3f4('0x9')],'smsPause':this[_0xf3f4('0xb')],'faxPause':this['faxPause'],'openchannelPause':this[_0xf3f4('0xc')],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xf3f4('0x38')],'chatCurrentCapacity':this[_0xf3f4('0x39')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xf3f4('0x11')],'mailCapacity':this[_0xf3f4('0x12')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xf3f4('0x15')],'faxCapacity':this[_0xf3f4('0x16')],'faxCurrentCapacity':this[_0xf3f4('0x17')],'smsStatus':this[_0xf3f4('0x3a')],'smsStatusTime':this[_0xf3f4('0x18')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0xf3f4('0x3b')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xf3f4('0x1a')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xf3f4('0x20')],'busy':this['busy'],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0xf3f4('0x24')],'faxWaitingInteractions':this[_0xf3f4('0x25')],'mailWaitingInteractions':this[_0xf3f4('0x26')],'openchannelWaitingInteractions':this[_0xf3f4('0x3c')],'smsWaitingInteractions':this[_0xf3f4('0x27')],'whatsappWaitingInteractions':this[_0xf3f4('0x3d')]};var _0x5138f2=md5(JSON[_0xf3f4('0x3e')](_0x53c875));if(this[_0xf3f4('0x23')]!==_0x5138f2){this['md5']=_0x5138f2;io['emit'](_0xf3f4('0x3f'),_0x53c875);}};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 6ec6f9f..5e85047 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 _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 +var _0x1f88=['paused','length','available','loggedIn','stringify','format','emit','chat_queue:save','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','map'];(function(_0x1a7714,_0x2869e5){var _0x30922a=function(_0x55be45){while(--_0x55be45){_0x1a7714['push'](_0x1a7714['shift']());}};_0x30922a(++_0x2869e5);}(_0x1f88,0xc5));var _0x81f8=function(_0x525a0e,_0x3377eb){_0x525a0e=_0x525a0e-0x0;var _0x4ca845=_0x1f88[_0x525a0e];return _0x4ca845;};'use strict';var _=require('lodash');var md5=require(_0x81f8('0x0'));var util=require(_0x81f8('0x1'));var Redis=require(_0x81f8('0x2'));var config=require(_0x81f8('0x3'));config[_0x81f8('0x4')]=_[_0x81f8('0x5')](config[_0x81f8('0x4')],{'host':_0x81f8('0x6'),'port':0x18eb});var io=require(_0x81f8('0x7'))(new Redis(config[_0x81f8('0x4')]));function ChatQueue(_0x56e619){this['id']=_0x56e619['id']||0x0;this['name']=_0x56e619[_0x81f8('0x8')]||'';this[_0x81f8('0x9')]=_0x56e619['timeout']||0xa;this['strategy']=_0x56e619[_0x81f8('0xa')]||_0x81f8('0xb');this['Agents']=_0x56e619[_0x81f8('0xc')];this[_0x81f8('0xd')]={};this[_0x81f8('0xe')]=0x0;this[_0x81f8('0x0')]='';this['updateRouting']();this[_0x81f8('0xf')]();}ChatQueue[_0x81f8('0x10')]['updateRouting']=function(){var _0x4f3d27=this[_0x81f8('0xd')][_0x81f8('0x11')];this[_0x81f8('0xd')]=_[_0x81f8('0x12')](this[_0x81f8('0xc')],'id');this['mapAgentsId'][_0x81f8('0x11')]=_0x4f3d27;};ChatQueue[_0x81f8('0x10')][_0x81f8('0xf')]=function(){this['loggedIn']=0x0;this[_0x81f8('0x13')]=0x0;for(var _0xdf950e=0x0;_0xdf950e=0x0?this['available']:0x0;var _0x2e3362={'id':this['id'],'available':this[_0x81f8('0x15')],'loggedIn':this[_0x81f8('0x16')],'name':this[_0x81f8('0x8')],'paused':this[_0x81f8('0x13')],'waiting':this[_0x81f8('0xe')]};var _0x21732f=md5(JSON[_0x81f8('0x17')](_0x2e3362));if(this[_0x81f8('0x0')]!==_0x21732f){this[_0x81f8('0x0')]=_0x21732f;io['to'](util[_0x81f8('0x18')]('chat:queue:%s',_0x2e3362[_0x81f8('0x8')]))[_0x81f8('0x19')](_0x81f8('0x1a'),_0x2e3362);}};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 6a7aeeb..188170a 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 _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 +var _0xaed1=['fax_queue:save','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','faxPause','available','name','stringify','format','emit'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xaed1,0x72));var _0x1aed=function(_0x5f8000,_0x4a56b1){_0x5f8000=_0x5f8000-0x0;var _0xc8f261=_0xaed1[_0x5f8000];return _0xc8f261;};'use strict';var _=require('lodash');var md5=require(_0x1aed('0x0'));var util=require('util');var Redis=require(_0x1aed('0x1'));var config=require(_0x1aed('0x2'));config[_0x1aed('0x3')]=_[_0x1aed('0x4')](config[_0x1aed('0x3')],{'host':_0x1aed('0x5'),'port':0x18eb});var io=require(_0x1aed('0x6'))(new Redis(config[_0x1aed('0x3')]));function FaxQueue(_0x4e1a3c){this['id']=_0x4e1a3c['id']||0x0;this['name']=_0x4e1a3c['name']||'';this[_0x1aed('0x7')]=_0x4e1a3c['timeout']||0xa;this[_0x1aed('0x8')]=_0x4e1a3c[_0x1aed('0x8')]||_0x1aed('0x9');this[_0x1aed('0xa')]=_0x4e1a3c[_0x1aed('0xa')];this[_0x1aed('0xb')]={};this[_0x1aed('0xc')]=0x0;this[_0x1aed('0x0')]='';this[_0x1aed('0xd')]();this[_0x1aed('0xe')]();}FaxQueue[_0x1aed('0xf')]['updateRouting']=function(){var _0x171264=this[_0x1aed('0xb')][_0x1aed('0x10')];this[_0x1aed('0xb')]=_['map'](this[_0x1aed('0xa')],'id');this[_0x1aed('0xb')]['_rr']=_0x171264;};FaxQueue['prototype'][_0x1aed('0xe')]=function(){this[_0x1aed('0x11')]=0x0;this[_0x1aed('0x12')]=0x0;for(var _0x254570=0x0;_0x254570=0x0?this['available']:0x0;var _0xb22f41={'id':this['id'],'available':this[_0x1aed('0x15')],'loggedIn':this[_0x1aed('0x11')],'name':this[_0x1aed('0x16')],'paused':this[_0x1aed('0x12')],'waiting':this['waiting']};var _0xc5bb70=md5(JSON[_0x1aed('0x17')](_0xb22f41));if(this['md5']!==_0xc5bb70){this['md5']=_0xc5bb70;io['to'](util[_0x1aed('0x18')]('fax:queue:%s',_0xb22f41['name']))[_0x1aed('0x19')](_0x1aed('0x1a'),_0xb22f41);}};module[_0x1aed('0x1b')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 4d84637..608ba7c 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 _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 +var _0xc8f1=['name','Intervals','exports'];(function(_0x47a104,_0x212bfe){var _0x38d671=function(_0x56dda1){while(--_0x56dda1){_0x47a104['push'](_0x47a104['shift']());}};_0x38d671(++_0x212bfe);}(_0xc8f1,0x171));var _0x1c8f=function(_0x4df168,_0x42777c){_0x4df168=_0x4df168-0x0;var _0x48e60b=_0xc8f1[_0x4df168];return _0x48e60b;};'use strict';function Interval(_0x25d11c){this['id']=_0x25d11c['id']||0x0;this['name']=_0x25d11c[_0x1c8f('0x0')]||'';this[_0x1c8f('0x1')]=_0x25d11c['Intervals']||{};}module[_0x1c8f('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 4fe340c..72751c1 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 _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 +var _0x740a=['emit','mail_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','_rr','map','updateRealtime','loggedIn','paused','length','online','mailPause','available','waiting','stringify','format'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x740a,0xeb));var _0xa740=function(_0x4c8cc2,_0x22c17c){_0x4c8cc2=_0x4c8cc2-0x0;var _0xcf1186=_0x740a[_0x4c8cc2];return _0xcf1186;};'use strict';var _=require(_0xa740('0x0'));var md5=require(_0xa740('0x1'));var util=require(_0xa740('0x2'));var Redis=require('ioredis');var config=require(_0xa740('0x3'));config[_0xa740('0x4')]=_[_0xa740('0x5')](config[_0xa740('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xa740('0x6'))(new Redis(config[_0xa740('0x4')]));function MailQueue(_0x3475a4){this['id']=_0x3475a4['id']||0x0;this['name']=_0x3475a4[_0xa740('0x7')]||'';this['timeout']=_0x3475a4[_0xa740('0x8')]||0xa;this[_0xa740('0x9')]=_0x3475a4[_0xa740('0x9')]||_0xa740('0xa');this[_0xa740('0xb')]=_0x3475a4[_0xa740('0xb')];this[_0xa740('0xc')]={};this['waiting']=0x0;this[_0xa740('0x1')]='';this[_0xa740('0xd')]();this['updateRealtime']();}MailQueue['prototype'][_0xa740('0xd')]=function(){var _0x46b2b4=this['mapAgentsId'][_0xa740('0xe')];this[_0xa740('0xc')]=_[_0xa740('0xf')](this[_0xa740('0xb')],'id');this['mapAgentsId'][_0xa740('0xe')]=_0x46b2b4;};MailQueue['prototype'][_0xa740('0x10')]=function(){this[_0xa740('0x11')]=0x0;this[_0xa740('0x12')]=0x0;for(var _0x5865be=0x0;_0x5865be=0x0?this[_0xa740('0x16')]:0x0;var _0x218625={'id':this['id'],'available':this[_0xa740('0x16')],'loggedIn':this[_0xa740('0x11')],'name':this[_0xa740('0x7')],'paused':this[_0xa740('0x12')],'waiting':this[_0xa740('0x17')]};var _0xcff713=md5(JSON[_0xa740('0x18')](_0x218625));if(this[_0xa740('0x1')]!==_0xcff713){this[_0xa740('0x1')]=_0xcff713;io['to'](util[_0xa740('0x19')]('mail:queue:%s',_0x218625[_0xa740('0x7')]))[_0xa740('0x1a')](_0xa740('0x1b'),_0x218625);}};module[_0xa740('0x1c')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index a5fcf4d..b3c78eb 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(_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 +var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x1c44d7,_0x48634c){var _0x5ec1a0=function(_0x23e09b){while(--_0x23e09b){_0x1c44d7['push'](_0x1c44d7['shift']());}};_0x5ec1a0(++_0x48634c);}(_0x814b,0x1a2));var _0xb814=function(_0x13ff53,_0x5e1424){_0x13ff53=_0x13ff53-0x0;var _0x290228=_0x814b[_0x13ff53];return _0x290228;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index fe55e04..aef9f99 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 _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 +var _0x4d46=['exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','Agents','online','smsPause','available','waiting','format','sms:queue:%s','sms_queue:save'];(function(_0x13a81d,_0x124336){var _0x2389ab=function(_0x553e0d){while(--_0x553e0d){_0x13a81d['push'](_0x13a81d['shift']());}};_0x2389ab(++_0x124336);}(_0x4d46,0x197));var _0x64d4=function(_0x35fdff,_0x58bf32){_0x35fdff=_0x35fdff-0x0;var _0x44b12a=_0x4d46[_0x35fdff];return _0x44b12a;};'use strict';var _=require(_0x64d4('0x0'));var md5=require(_0x64d4('0x1'));var util=require(_0x64d4('0x2'));var Redis=require(_0x64d4('0x3'));var config=require(_0x64d4('0x4'));config[_0x64d4('0x5')]=_['defaults'](config[_0x64d4('0x5')],{'host':_0x64d4('0x6'),'port':0x18eb});var io=require(_0x64d4('0x7'))(new Redis(config[_0x64d4('0x5')]));function SmsQueue(_0x1f7d33){this['id']=_0x1f7d33['id']||0x0;this[_0x64d4('0x8')]=_0x1f7d33['name']||'';this[_0x64d4('0x9')]=_0x1f7d33[_0x64d4('0x9')]||0xa;this['strategy']=_0x1f7d33[_0x64d4('0xa')]||_0x64d4('0xb');this['Agents']=_0x1f7d33['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0x64d4('0xc')]();this[_0x64d4('0xd')]();}SmsQueue[_0x64d4('0xe')][_0x64d4('0xc')]=function(){var _0x766524=this[_0x64d4('0xf')][_0x64d4('0x10')];this[_0x64d4('0xf')]=_[_0x64d4('0x11')](this['Agents'],'id');this[_0x64d4('0xf')]['_rr']=_0x766524;};SmsQueue[_0x64d4('0xe')][_0x64d4('0xd')]=function(){this[_0x64d4('0x12')]=0x0;this[_0x64d4('0x13')]=0x0;for(var _0x13b111=0x0;_0x13b111=0x0?this[_0x64d4('0x17')]:0x0;var _0x155b60={'id':this['id'],'available':this[_0x64d4('0x17')],'loggedIn':this[_0x64d4('0x12')],'name':this[_0x64d4('0x8')],'paused':this[_0x64d4('0x13')],'waiting':this[_0x64d4('0x18')]};var _0x2549e9=md5(JSON['stringify'](_0x155b60));if(this[_0x64d4('0x1')]!==_0x2549e9){this[_0x64d4('0x1')]=_0x2549e9;io['to'](util[_0x64d4('0x19')](_0x64d4('0x1a'),_0x155b60['name']))['emit'](_0x64d4('0x1b'),_0x155b60);}};module[_0x64d4('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 5768f10..7dcb140 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 _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 +var _0x5d61=['updateRealtime','prototype','_rr','loggedIn','paused','length','whatsappPause','available','name','emit','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting'];(function(_0x1b7cc1,_0x4b224e){var _0x141a92=function(_0x2345f8){while(--_0x2345f8){_0x1b7cc1['push'](_0x1b7cc1['shift']());}};_0x141a92(++_0x4b224e);}(_0x5d61,0x12a));var _0x15d6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5d61[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x15d6('0x0'));var md5=require(_0x15d6('0x1'));var util=require(_0x15d6('0x2'));var Redis=require(_0x15d6('0x3'));var config=require(_0x15d6('0x4'));config[_0x15d6('0x5')]=_[_0x15d6('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x15d6('0x5')]));function WhatsappQueue(_0x1cf2fc){this['id']=_0x1cf2fc['id']||0x0;this['name']=_0x1cf2fc['name']||'';this['timeout']=_0x1cf2fc[_0x15d6('0x7')]||0xa;this[_0x15d6('0x8')]=_0x1cf2fc[_0x15d6('0x8')]||_0x15d6('0x9');this['Agents']=_0x1cf2fc[_0x15d6('0xa')];this[_0x15d6('0xb')]={};this[_0x15d6('0xc')]=0x0;this[_0x15d6('0x1')]='';this[_0x15d6('0xd')]();this[_0x15d6('0xe')]();}WhatsappQueue[_0x15d6('0xf')][_0x15d6('0xd')]=function(){var _0x255a1a=this['mapAgentsId'][_0x15d6('0x10')];this[_0x15d6('0xb')]=_['map'](this['Agents'],'id');this[_0x15d6('0xb')][_0x15d6('0x10')]=_0x255a1a;};WhatsappQueue[_0x15d6('0xf')][_0x15d6('0xe')]=function(){this[_0x15d6('0x11')]=0x0;this[_0x15d6('0x12')]=0x0;for(var _0x34c056=0x0;_0x34c056=0x0?this[_0x15d6('0x15')]:0x0;var _0x24ee4b={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x15d6('0x16')],'paused':this[_0x15d6('0x12')],'waiting':this[_0x15d6('0xc')]};var _0x3cca50=md5(JSON['stringify'](_0x24ee4b));if(this['md5']!==_0x3cca50){this[_0x15d6('0x1')]=_0x3cca50;io['to'](util['format']('whatsapp:queue:%s',_0x24ee4b['name']))[_0x15d6('0x17')]('whatsapp_queue:save',_0x24ee4b);}};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 8bd1758..196464f 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(_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 +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x41afee,_0x4f3f48){var _0xc574f9=function(_0x10988e){while(--_0x10988e){_0x41afee['push'](_0x41afee['shift']());}};_0xc574f9(++_0x4f3f48);}(_0xb10b,0x12a));var _0xbb10=function(_0x101152,_0x397ab0){_0x101152=_0x101152-0x0;var _0xe1c465=_0xb10b[_0x101152];return _0xe1c465;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 4f27bde..e996664 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 _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 +var _0x37ea=['../client','Request','UpdateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x1474e8,_0xeb6790){var _0x282d40=function(_0x23b1d2){while(--_0x23b1d2){_0x1474e8['push'](_0x1474e8['shift']());}};_0x282d40(++_0xeb6790);}(_0x37ea,0x154));var _0xa37e=function(_0x1b5b28,_0x5b0630){_0x1b5b28=_0x1b5b28-0x0;var _0x3fe596=_0x37ea[_0x1b5b28];return _0x3fe596;};'use strict';var client=require(_0xa37e('0x0'));exports['update']=function(_0x1fd526,_0x440423){return client[_0xa37e('0x1')](_0xa37e('0x2'),{'body':_0x440423,'options':{'where':{'id':_0x1fd526}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x10832f,_0x20df0a){return client['Request'](_0xa37e('0x3'),{'body':_0x20df0a,'options':{'where':{'id':_0x10832f}},'log':_0xa37e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 97b0ed9..7e9b7e9 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 _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 +var _0x8c5d=['Request','../client','create'];(function(_0x58d5ac,_0x11c4bc){var _0x37985c=function(_0x419671){while(--_0x419671){_0x58d5ac['push'](_0x58d5ac['shift']());}};_0x37985c(++_0x11c4bc);}(_0x8c5d,0x199));var _0xd8c5=function(_0x7db524,_0x4d0675){_0x7db524=_0x7db524-0x0;var _0x2fdbfa=_0x8c5d[_0x7db524];return _0x2fdbfa;};'use strict';var client=require(_0xd8c5('0x0'));exports[_0xd8c5('0x1')]=function(_0x504db2){return client[_0xd8c5('0x2')]('CreateChatMessage',{'body':_0x504db2,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index aca7350..6d91952 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 _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 +var _0x2e65=['User','online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy'];(function(_0x4f02e,_0x4ac328){var _0x5a09cd=function(_0x358155){while(--_0x358155){_0x4f02e['push'](_0x4f02e['shift']());}};_0x5a09cd(++_0x4ac328);}(_0x2e65,0x193));var _0x52e6=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x2e65[_0x38ced4];return _0x547c07;};'use strict';var client=require(_0x52e6('0x0'));exports[_0x52e6('0x1')]=function(){return function(){return client[_0x52e6('0x2')](_0x52e6('0x3'),{'options':{'raw':![],'attributes':['id',_0x52e6('0x4'),_0x52e6('0x5'),_0x52e6('0x6')],'include':[{'model':_0x52e6('0x7'),'as':'Agents','attributes':['id',_0x52e6('0x4'),_0x52e6('0x8'),_0x52e6('0x9')]}]},'log':_0x52e6('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 1a7add9..4a79bc0 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 _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 +var _0xc7b4=['DESC','UpdateChatQueueReport','../client','Request','CreateChatQueueReport','update'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc7b4,0x15e));var _0x4c7b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc7b4[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x4c7b('0x0'));exports['create']=function(_0x6edfa6){return client[_0x4c7b('0x1')]('CreateChatQueueReport',{'body':_0x6edfa6,'log':_0x4c7b('0x2')});};exports[_0x4c7b('0x3')]=function(_0x279c21,_0x2a8b1d){return client[_0x4c7b('0x1')]('UpdateChatQueueReport',{'body':_0x2a8b1d,'options':{'where':{'uniqueid':_0x279c21},'order':[['id',_0x4c7b('0x4')]],'limit':0x1},'log':_0x4c7b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 8ae5a76..7305c2e 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_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 +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x2a7202,_0x4be59d){var _0xc463b1=function(_0x3e7a5b){while(--_0x3e7a5b){_0x2a7202['push'](_0x2a7202['shift']());}};_0xc463b1(++_0x4be59d);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 6c9a312..7fffb1d 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 _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 +var _0x07d8=['CreateFaxMessage','createFaxMessage'];(function(_0x520236,_0x5c8564){var _0x4d6664=function(_0x398c51){while(--_0x398c51){_0x520236['push'](_0x520236['shift']());}};_0x4d6664(++_0x5c8564);}(_0x07d8,0x174));var _0x807d=function(_0x263a16,_0x489c01){_0x263a16=_0x263a16-0x0;var _0x251824=_0x07d8[_0x263a16];return _0x251824;};'use strict';var client=require('../client');exports['create']=function(_0x1e03f6){return client['Request'](_0x807d('0x0'),{'body':_0x1e03f6,'log':_0x807d('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index f8e378f..f126acf 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 _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 +var _0x8b6b=['GetFaxQueue','name','strategy','User','Agents','online','faxPause','Request'];(function(_0x4b0de6,_0x5e4036){var _0x170e0f=function(_0x30ef44){while(--_0x30ef44){_0x4b0de6['push'](_0x4b0de6['shift']());}};_0x170e0f(++_0x5e4036);}(_0x8b6b,0x1c7));var _0xb8b6=function(_0x417249,_0x5b462a){_0x417249=_0x417249-0x0;var _0x5c5fa5=_0x8b6b[_0x417249];return _0x5c5fa5;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0xb8b6('0x0')](_0xb8b6('0x1'),{'options':{'raw':![],'attributes':['id',_0xb8b6('0x2'),'timeout',_0xb8b6('0x3')],'include':[{'model':_0xb8b6('0x4'),'as':_0xb8b6('0x5'),'attributes':['id',_0xb8b6('0x2'),_0xb8b6('0x6'),_0xb8b6('0x7')]}]},'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 03e0951..33b8322 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 _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 +var _0xa2a3=['CreateFaxQueueReport','update','Request','DESC','UpdateFaxQueueReport','../client','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa2a3,0x194));var _0x3a2a=function(_0x5dfee3,_0x5e3bbe){_0x5dfee3=_0x5dfee3-0x0;var _0x1e1785=_0xa2a3[_0x5dfee3];return _0x1e1785;};'use strict';var client=require(_0x3a2a('0x0'));exports[_0x3a2a('0x1')]=function(_0x530306){return client['Request']('CreateFaxQueueReport',{'body':_0x530306,'log':_0x3a2a('0x2')});};exports[_0x3a2a('0x3')]=function(_0x4ad5c4,_0x2fcbb9){return client[_0x3a2a('0x4')]('UpdateFaxQueueReport',{'body':_0x2fcbb9,'options':{'where':{'uniqueid':_0x4ad5c4},'order':[['id',_0x3a2a('0x5')]],'limit':0x1},'log':_0x3a2a('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 034e790..f634f35 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 _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 +var _0xdda4=['interval','../client','getIntervals','Request','GetInterval','name','Interval'];(function(_0x2e092e,_0x1bbef3){var _0x4d4f52=function(_0x260843){while(--_0x260843){_0x2e092e['push'](_0x2e092e['shift']());}};_0x4d4f52(++_0x1bbef3);}(_0xdda4,0x94));var _0x4dda=function(_0x11dc39,_0x491115){_0x11dc39=_0x11dc39-0x0;var _0x457277=_0xdda4[_0x11dc39];return _0x457277;};'use strict';var client=require(_0x4dda('0x0'));exports[_0x4dda('0x1')]=function(){return function(){return client[_0x4dda('0x2')](_0x4dda('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x4dda('0x4')],'include':[{'model':_0x4dda('0x5'),'as':'Intervals','attributes':['id',_0x4dda('0x4'),_0x4dda('0x6')]}]},'log':_0x4dda('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 7007c5f..d653e8b 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 _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 +var _0x7916=['Request','addTagsToChatInteraction','../client','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x301348,_0x1a08a6){var _0x3b4a76=function(_0x361360){while(--_0x361360){_0x301348['push'](_0x301348['shift']());}};_0x3b4a76(++_0x1a08a6);}(_0x7916,0x128));var _0x6791=function(_0x8f82c5,_0x163934){_0x8f82c5=_0x8f82c5-0x0;var _0x12f69c=_0x7916[_0x8f82c5];return _0x12f69c;};'use strict';var client=require(_0x6791('0x0'));exports['update']=function(_0xeb0b9f,_0xdaaf2b){return client['Request'](_0x6791('0x1'),{'body':_0xdaaf2b,'options':{'where':{'id':_0xeb0b9f}},'log':_0x6791('0x2')});};exports[_0x6791('0x3')]=function(_0x330476,_0x5e6303){return client[_0x6791('0x4')]('AddTagsToMailInteraction',{'body':_0x5e6303,'options':{'where':{'id':_0x330476}},'log':_0x6791('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index cb20ae9..6c4aea3 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 _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 +var _0x86b0=['CreateMailMessage','../client','create','Request'];(function(_0x123d83,_0x273569){var _0x1d8af6=function(_0x297eb7){while(--_0x297eb7){_0x123d83['push'](_0x123d83['shift']());}};_0x1d8af6(++_0x273569);}(_0x86b0,0x89));var _0x086b=function(_0x5b31fb,_0x38009b){_0x5b31fb=_0x5b31fb-0x0;var _0x42f7e7=_0x86b0[_0x5b31fb];return _0x42f7e7;};'use strict';var client=require(_0x086b('0x0'));exports[_0x086b('0x1')]=function(_0x10219b){return client[_0x086b('0x2')](_0x086b('0x3'),{'body':_0x10219b,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index b3091ae..4f66bb4 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 _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 +var _0xeef7=['Agents','online','../client','getMailQueues','Request','GetMailQueue','strategy','User'];(function(_0x3420c5,_0x5eaf8b){var _0x49aae3=function(_0x54d52e){while(--_0x54d52e){_0x3420c5['push'](_0x3420c5['shift']());}};_0x49aae3(++_0x5eaf8b);}(_0xeef7,0x1ca));var _0x7eef=function(_0x17fbc2,_0x1f2de7){_0x17fbc2=_0x17fbc2-0x0;var _0x38b500=_0xeef7[_0x17fbc2];return _0x38b500;};'use strict';var client=require(_0x7eef('0x0'));exports[_0x7eef('0x1')]=function(){return function(){return client[_0x7eef('0x2')](_0x7eef('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x7eef('0x4')],'include':[{'model':_0x7eef('0x5'),'as':_0x7eef('0x6'),'attributes':['id','name',_0x7eef('0x7'),'mailPause']}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 5107354..30a8191 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 _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 +var _0xde2f=['../client','CreateMailQueueReport','update','Request','UpdateMailQueueReport','DESC'];(function(_0x291147,_0x4f833d){var _0x530153=function(_0x3a2797){while(--_0x3a2797){_0x291147['push'](_0x291147['shift']());}};_0x530153(++_0x4f833d);}(_0xde2f,0x132));var _0xfde2=function(_0x1ebe43,_0x27443d){_0x1ebe43=_0x1ebe43-0x0;var _0x3652b0=_0xde2f[_0x1ebe43];return _0x3652b0;};'use strict';var client=require(_0xfde2('0x0'));exports['create']=function(_0x4656f8){return client['Request']('CreateMailQueueReport',{'body':_0x4656f8,'log':_0xfde2('0x1')});};exports[_0xfde2('0x2')]=function(_0x8b2569,_0x6d15b){return client[_0xfde2('0x3')](_0xfde2('0x4'),{'body':_0x6d15b,'options':{'where':{'uniqueid':_0x8b2569},'order':[['id',_0xfde2('0x5')]],'limit':0x1},'log':_0xfde2('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 9a53ed0..b06d856 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 _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 +var _0x37d1=['Request','addTagsToChatInteraction','update','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x1c1d05,_0x255116){var _0x432813=function(_0x384005){while(--_0x384005){_0x1c1d05['push'](_0x1c1d05['shift']());}};_0x432813(++_0x255116);}(_0x37d1,0xf2));var _0x137d=function(_0x4ca3bc,_0x16ff7d){_0x4ca3bc=_0x4ca3bc-0x0;var _0x519648=_0x37d1[_0x4ca3bc];return _0x519648;};'use strict';var client=require('../client');exports[_0x137d('0x0')]=function(_0x67f6c3,_0x7037b5){return client['Request'](_0x137d('0x1'),{'body':_0x7037b5,'options':{'where':{'id':_0x67f6c3}},'log':_0x137d('0x2')});};exports[_0x137d('0x3')]=function(_0x224cdb,_0x1efa02){return client[_0x137d('0x4')]('AddTagsToOpenchannelInteraction',{'body':_0x1efa02,'options':{'where':{'id':_0x224cdb}},'log':_0x137d('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 7d8085f..e51be6a 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 _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 +var _0xb217=['../client','create'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0xb217,0x172));var _0x7b21=function(_0x2ed4f7,_0x461cec){_0x2ed4f7=_0x2ed4f7-0x0;var _0x849b17=_0xb217[_0x2ed4f7];return _0x849b17;};'use strict';var client=require(_0x7b21('0x0'));exports[_0x7b21('0x1')]=function(_0x5c30ea){return client['Request']('CreateOpenchannelMessage',{'body':_0x5c30ea,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 91118f8..086433f 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 _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 +var _0xcee2=['Agents','name','online','getOpenchannelQueues','../client','Request','GetOpenchannelQueue','timeout','strategy','User'];(function(_0x310d10,_0x3fe887){var _0x1fb8af=function(_0x42965b){while(--_0x42965b){_0x310d10['push'](_0x310d10['shift']());}};_0x1fb8af(++_0x3fe887);}(_0xcee2,0x1e4));var _0x2cee=function(_0x5cd9d9,_0x5545e7){_0x5cd9d9=_0x5cd9d9-0x0;var _0x2c6c14=_0xcee2[_0x5cd9d9];return _0x2c6c14;};'use strict';var client=require(_0x2cee('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x2cee('0x1')](_0x2cee('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x2cee('0x3'),_0x2cee('0x4')],'include':[{'model':_0x2cee('0x5'),'as':_0x2cee('0x6'),'attributes':['id',_0x2cee('0x7'),_0x2cee('0x8'),'openchannelPause']}]},'log':_0x2cee('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 7641186..5aea630 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 _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 +var _0x51ab=['update','UpdateOpenchannelQueueReport','DESC','CreateOpenchannelQueueReport'];(function(_0x490e61,_0x7f848e){var _0x169bc6=function(_0x1c70bf){while(--_0x1c70bf){_0x490e61['push'](_0x490e61['shift']());}};_0x169bc6(++_0x7f848e);}(_0x51ab,0x103));var _0xb51a=function(_0x2b4aa8,_0xc42bf5){_0x2b4aa8=_0x2b4aa8-0x0;var _0x43b854=_0x51ab[_0x2b4aa8];return _0x43b854;};'use strict';var client=require('../client');exports['create']=function(_0x6ca902){return client['Request']('CreateOpenchannelQueueReport',{'body':_0x6ca902,'log':_0xb51a('0x0')});};exports[_0xb51a('0x1')]=function(_0x4b6a7c,_0x490cc5){return client['Request'](_0xb51a('0x2'),{'body':_0x490cc5,'options':{'where':{'uniqueid':_0x4b6a7c},'order':[['id',_0xb51a('0x3')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 23136af..c84bed9 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 _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 +var _0x8a8b=['Request','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x48bb77,_0x8d9a85){var _0x288bbe=function(_0x8a10db){while(--_0x8a10db){_0x48bb77['push'](_0x48bb77['shift']());}};_0x288bbe(++_0x8d9a85);}(_0x8a8b,0xae));var _0xb8a8=function(_0x4e16ee,_0x47b5b3){_0x4e16ee=_0x4e16ee-0x0;var _0x48cce5=_0x8a8b[_0x4e16ee];return _0x48cce5;};'use strict';var client=require(_0xb8a8('0x0'));exports['update']=function(_0x54e14e,_0x30a142){return client[_0xb8a8('0x1')]('UpdateSmsInteraction',{'body':_0x30a142,'options':{'where':{'id':_0x54e14e}},'log':_0xb8a8('0x2')});};exports['addTags']=function(_0xca9854,_0x4fe301){return client[_0xb8a8('0x1')](_0xb8a8('0x3'),{'body':_0x4fe301,'options':{'where':{'id':_0xca9854}},'log':_0xb8a8('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 206c5a4..2f1f0c8 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 _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 +var _0x1e90=['create','Request','createSmsMessage'];(function(_0x510c60,_0x50247e){var _0x49c4aa=function(_0x3149c7){while(--_0x3149c7){_0x510c60['push'](_0x510c60['shift']());}};_0x49c4aa(++_0x50247e);}(_0x1e90,0x1e9));var _0x01e9=function(_0x540ec3,_0x49044d){_0x540ec3=_0x540ec3-0x0;var _0x38910d=_0x1e90[_0x540ec3];return _0x38910d;};'use strict';var client=require('../client');exports[_0x01e9('0x0')]=function(_0x5eae80){return client[_0x01e9('0x1')]('CreateSmsMessage',{'body':_0x5eae80,'log':_0x01e9('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index d318c90..6951fca 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 _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 +var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x12ce46,_0x53e1a5){var _0xe2feb0=function(_0x5e5bd3){while(--_0x5e5bd3){_0x12ce46['push'](_0x12ce46['shift']());}};_0xe2feb0(++_0x53e1a5);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index bcffe91..47bdd7c 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 _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 +var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x2538f1,_0x575840){var _0x85122e=function(_0x48b38e){while(--_0x48b38e){_0x2538f1['push'](_0x2538f1['shift']());}};_0x85122e(++_0x575840);}(_0x55ca,0x126));var _0xa55c=function(_0x3a441a,_0x43eb56){_0x3a441a=_0x3a441a-0x0;var _0x3128a2=_0x55ca[_0x3a441a];return _0x3128a2;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index c36cdb3..d7e7d15 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(_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 +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x3e44cb,_0x2e4af7){var _0x554dd4=function(_0x593a17){while(--_0x593a17){_0x3e44cb['push'](_0x3e44cb['shift']());}};_0x554dd4(++_0x2e4af7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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 1df446e..8488d5a 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 _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 +var _0xa498=['update','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x41ce34,_0x22932a){var _0x580c63=function(_0x46a806){while(--_0x46a806){_0x41ce34['push'](_0x41ce34['shift']());}};_0x580c63(++_0x22932a);}(_0xa498,0x1d6));var _0x8a49=function(_0x4fe496,_0x1d8673){_0x4fe496=_0x4fe496-0x0;var _0x422b24=_0xa498[_0x4fe496];return _0x422b24;};'use strict';var client=require('../client');exports[_0x8a49('0x0')]=function(_0xafd977,_0x48e111){return client['Request'](_0x8a49('0x1'),{'body':_0x48e111,'options':{'where':{'id':_0xafd977}},'log':_0x8a49('0x2')});};exports[_0x8a49('0x3')]=function(_0x65eb15,_0x2f362e){return client['Request'](_0x8a49('0x4'),{'body':_0x2f362e,'options':{'where':{'id':_0x65eb15}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 0d87280..5ec2972 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 _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 +var _0xddb3=['../client','create','Request','createWhatsappMessage'];(function(_0x51423e,_0x21a8e8){var _0x5addc4=function(_0x1b2662){while(--_0x1b2662){_0x51423e['push'](_0x51423e['shift']());}};_0x5addc4(++_0x21a8e8);}(_0xddb3,0x190));var _0x3ddb=function(_0xad46e8,_0x5de468){_0xad46e8=_0xad46e8-0x0;var _0x5697ed=_0xddb3[_0xad46e8];return _0x5697ed;};'use strict';var client=require(_0x3ddb('0x0'));exports[_0x3ddb('0x1')]=function(_0x50c755){return client[_0x3ddb('0x2')]('CreateWhatsappMessage',{'body':_0x50c755,'log':_0x3ddb('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 88fec55..ce88b7b 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 _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 +var _0x575b=['name','timeout','strategy','whatsappPause','getWhatsappQueues','../client'];(function(_0x15e984,_0x5078bf){var _0x6011a=function(_0x3a16c8){while(--_0x3a16c8){_0x15e984['push'](_0x15e984['shift']());}};_0x6011a(++_0x5078bf);}(_0x575b,0x1af));var _0xb575=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x575b[_0x2c91e9];return _0x13f0ff;};'use strict';var client=require(_0xb575('0x0'));exports['getWhatsappQueues']=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xb575('0x1'),_0xb575('0x2'),_0xb575('0x3')],'include':[{'model':'User','as':'Agents','attributes':['id','name','online',_0xb575('0x4')]}]},'log':_0xb575('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index cabeda5..5bbfc8b 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 _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 +var _0x949b=['Request','DESC','UpdateWhatsappQueueReport','../client','create','CreateWhatsappQueueReport'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x949b,0xcf));var _0xb949=function(_0x3c9399,_0x385d5f){_0x3c9399=_0x3c9399-0x0;var _0x42b2e9=_0x949b[_0x3c9399];return _0x42b2e9;};'use strict';var client=require(_0xb949('0x0'));exports[_0xb949('0x1')]=function(_0x5ead3b){return client['Request'](_0xb949('0x2'),{'body':_0x5ead3b,'log':_0xb949('0x2')});};exports['update']=function(_0x3fd106,_0x4ebf97){return client[_0xb949('0x3')]('UpdateWhatsappQueueReport',{'body':_0x4ebf97,'options':{'where':{'uniqueid':_0x3fd106},'order':[['id',_0xb949('0x4')]],'limit':0x1},'log':_0xb949('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 150a4ce..ae0df65 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 _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 +var _0x2755=['channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','map','message','join','stop','agents','timeout','createQueue'];(function(_0x1f622f,_0x892de9){var _0xa9a796=function(_0x7f8bfc){while(--_0x7f8bfc){_0x1f622f['push'](_0x1f622f['shift']());}};_0xa9a796(++_0x892de9);}(_0x2755,0x80));var _0x5275=function(_0x1a7bec,_0x31bbd7){_0x1a7bec=_0x1a7bec-0x0;var _0x55bf92=_0x2755[_0x1a7bec];return _0x55bf92;};'use strict';var schema=require(_0x5275('0x0'));var _=require(_0x5275('0x1'));var util=require(_0x5275('0x2'));var seqqueue=require(_0x5275('0x3'));var logger=require(_0x5275('0x4'))(_0x5275('0x5'));var strategy=require(_0x5275('0x6'));var queue=schema({'name':{'type':_0x5275('0x7'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x5275('0x8'),'message':_0x5275('0x9')}});function writeLog(_0x5f34d3,_0x233243,_0x574206){return logger['info'](util[_0x5275('0xa')](_0x5275('0xb'),_0x5f34d3,_0x233243['name'],_0x574206));}function handleFindAgent(_0x1e864c){return function(_0x3b984e){return _0x3b984e[_0x5275('0xc')]['toLowerCase']()===_0x1e864c[_0x5275('0xd')]();};}exports[_0x5275('0xe')]=function(_0x3dbab5,_0x3a618f,_0x5e16fd,_0xbf0c21){return function(_0x4e301b){try{var _0x220a8a={'name':_0x3a618f[0x0],'timeout':_0x3a618f[0x1]};var _0x3e2fad=queue[_0x5275('0x0')](_0x220a8a,{'typecast':!![]});if(_0x3e2fad[_0x5275('0xf')]){logger[_0x5275('0x10')]('[%s][AGENT]\x20%s',_0x3dbab5,_[_0x5275('0x11')](_0x3e2fad,_0x5275('0x12'))[_0x5275('0x13')](',\x20'));_0x4e301b[_0x5275('0x14')]();}else{var _0x4f9319=_['find'](_0x5e16fd[_0x5275('0x15')],handleFindAgent(_0x220a8a[_0x5275('0xc')]));if(_0x4f9319){var _0x2efde3=(_0x220a8a[_0x5275('0x16')]||0xa)*0x3e8;var _0x4e3187,_0x37ae23;var _0x14a4c1=seqqueue[_0x5275('0x17')](_0x2efde3);_0x14a4c1['id']=_0x3dbab5;_0x14a4c1['atimeout']=_0x2efde3;_0x14a4c1[_0x5275('0x18')]=_0xbf0c21[_0x5275('0x18')];writeLog(_0x3dbab5,_0x4f9319,util[_0x5275('0xa')](_0x5275('0x19'),_0x2efde3));_0x5e16fd[_0x5275('0x1a')][_0x3dbab5]['on'](_0x5275('0x1b'),function(){logger['info'](_0x5275('0x1c'),_0x3dbab5);clearTimeout(_0x37ae23);_0x37ae23=undefined;_0x14a4c1[_0x5275('0x1d')]();if(_0x5e16fd[_0x5275('0x1a')][_0x3dbab5]){delete _0x5e16fd[_0x5275('0x1a')][_0x3dbab5];}_0x4e301b[_0x5275('0x14')]();});_0x5e16fd['rules'][_0x3dbab5]['on'](_0x5275('0x1e'),function(){if(_0x5e16fd['rules'][_0x3dbab5]){delete _0x5e16fd['rules'][_0x3dbab5];}});_0x37ae23=setTimeout(function(){logger['info'](_0x5275('0x1f'),_0x3dbab5);clearTimeout(_0x37ae23);_0x14a4c1['close']();_0x4e301b[_0x5275('0x20')]();},_0x2efde3);strategy[_0x5275('0x21')](_0x14a4c1,_0x4f9319,_0x5e16fd,_0xbf0c21);}else{logger['error'](_0x5275('0x22'),_0x3dbab5,_0x220a8a[_0x5275('0xc')]);_0x4e301b[_0x5275('0x14')]();}}}catch(_0x3e3d76){console[_0x5275('0x23')](_0x3e3d76);logger[_0x5275('0x10')](_0x5275('0x24'),_0x3dbab5,_0x3e3d76[_0x5275('0x25')]);_0x4e301b[_0x5275('0x14')]();}};}; \ 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 3f1d604..6796899 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 _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 +var _0x1380=['message','postText','next','amazonlex','providerResponse','Message','create','then','Failed','catch','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','interaction','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','getMustacheRender','body','error','[%s][AMAZONLEX]\x20%s','stringify','finally','info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x1380,0x13e));var _0x0138=function(_0x514e58,_0x381db6){_0x514e58=_0x514e58-0x0;var _0x5a539a=_0x1380[_0x514e58];return _0x5a539a;};'use strict';var _=require(_0x0138('0x0'));var moment=require(_0x0138('0x1'));var AWS=require('aws-sdk');var utils=require(_0x0138('0x2'));var logger=require(_0x0138('0x3'))('routing');var rpc={'chatMessage':require(_0x0138('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x0138('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x0138('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x0138('0x7')]=function(_0x3fe196,_0x4c4d86){return function(_0x1c53cf){try{if(!_['isNil'](this[_0x0138('0x8')]['UserId'])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x3fe196,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1c53cf['next']();}var _0x5808b9={'ContactId':this[_0x0138('0x9')]['id'],'sentAt':moment()[_0x0138('0xa')](_0x0138('0xb')),'direction':_0x0138('0xc')};if(this['channel']===_0x0138('0xd')||this[_0x0138('0xe')]===_0x0138('0xf')){_0x5808b9[_0x0138('0x10')]=this[_0x0138('0x8')][_0x0138('0x10')];}var _0x233e1e=this[_0x0138('0xe')];if(_0x233e1e===_0x0138('0x11')){_0x5808b9[_0x0138('0x12')]=this[_0x0138('0x13')]['id'];}else{_0x5808b9[_[_0x0138('0x14')](_0x233e1e)+_0x0138('0x15')]=this[_0x0138('0x13')]['id'];}_0x5808b9[_[_0x0138('0x14')](_0x233e1e)+'InteractionId']=this['interaction']['id'];if(this[_0x0138('0x8')]['created']){var _0x5eb2e3=_0x4c4d86[0x4];if(!_['isEmpty'](_0x5eb2e3)){_0x5808b9['body']=utils[_0x0138('0x16')](_0x5eb2e3,this);return rpc[_0x233e1e+'Message']['create'](_0x5808b9)['then'](function(_0x33ebc3){logger['info']('[%s][AMAZONLEX]\x20%s',_0x3fe196,_0x5808b9[_0x0138('0x17')]);})['catch'](function(_0x318257){logger[_0x0138('0x18')](_0x0138('0x19'),_0x3fe196,JSON[_0x0138('0x1a')](_0x318257));})[_0x0138('0x1b')](function(){logger[_0x0138('0x1c')](_0x0138('0x1d'),_0x3fe196);_0x1c53cf[_0x0138('0x1e')]();});}else{logger['info'](_0x0138('0x1f'),_0x3fe196);_0x1c53cf[_0x0138('0x1e')]();}}else{var _0x3d545f=this;var _0x4a38a5=new AWS[(_0x0138('0x20'))]({'accessKeyId':_0x4c4d86[0x0],'secretAccessKey':_0x4c4d86[0x1],'region':_0x4c4d86[0x2]});var _0x584e7a={'botAlias':_0x0138('0x21'),'botName':_0x4c4d86[0x3],'inputText':this[_0x0138('0x22')]['body'],'userId':this[_0x0138('0xe')]+':'+this[_0x0138('0x8')]['id']['toString']()};_0x4a38a5[_0x0138('0x23')](_0x584e7a,function(_0x59e535,_0x494adb){if(_0x59e535){logger[_0x0138('0x18')]('[%s][AMAZONLEX]\x20%s',_0x3fe196,_0x59e535[_0x0138('0x22')]);_0x1c53cf[_0x0138('0x24')]();}else if(_0x494adb&&_0x494adb[_0x0138('0x22')]){_0x3d545f[_0x0138('0x17')][_0x0138('0x25')]=_0x494adb;_0x5808b9[_0x0138('0x17')]=_0x494adb[_0x0138('0x22')];_0x5808b9['providerName']=_0x0138('0x25');_0x5808b9[_0x0138('0x26')]=JSON[_0x0138('0x1a')](_0x494adb);return rpc[_0x233e1e+_0x0138('0x27')][_0x0138('0x28')](_0x5808b9)[_0x0138('0x29')](function(_0x16c233){logger[_0x0138('0x1c')](_0x0138('0x19'),_0x3fe196,_0x5808b9['body']);if(_0x494adb['dialogState']==_0x0138('0x2a')){_0x1c53cf[_0x0138('0x24')]();}else{_0x1c53cf[_0x0138('0x1e')]();}})[_0x0138('0x2b')](function(_0x5df518){logger[_0x0138('0x18')](_0x0138('0x19'),_0x3fe196,JSON[_0x0138('0x1a')](_0x5df518));_0x1c53cf[_0x0138('0x24')]();});}else{_0x1c53cf[_0x0138('0x24')]();}});}}catch(_0x1954d4){logger[_0x0138('0x18')](_0x0138('0x19'),_0x3fe196,JSON[_0x0138('0x1a')](_0x1954d4));_0x1c53cf[_0x0138('0x1e')]();}};}; \ 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 dcf6421..9f31be9 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 _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 +var _0xa643=['from','message','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','inReplyTo','messageId','html','','replace','','headers','auto_reply','sendMailMessage','smtpOptions','then','Message','create','catch','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','update','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','info','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','mail','body','getMustacheRender'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa643,0xa9));var _0x3a64=function(_0x593ba6,_0x2b4aac){_0x593ba6=_0x593ba6-0x0;var _0x150292=_0xa643[_0x593ba6];return _0x150292;};'use strict';var _=require('lodash');var moment=require(_0x3a64('0x0'));var utils=require(_0x3a64('0x1'));var logger=require(_0x3a64('0x2'))('routing');var rpc={'chatMessage':require(_0x3a64('0x3')),'openchannelMessage':require(_0x3a64('0x4')),'mailMessage':require(_0x3a64('0x5')),'smsMessage':require(_0x3a64('0x6')),'faxMessage':require(_0x3a64('0x7')),'whatsappMessage':require(_0x3a64('0x8')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x3a64('0x9')),'mailInteraction':require(_0x3a64('0xa')),'smsInteraction':require(_0x3a64('0xb')),'faxInteraction':require(_0x3a64('0xc')),'whatsappInteraction':require(_0x3a64('0xd'))};var mailRpc=require(_0x3a64('0xe'));exports[_0x3a64('0xf')]=function(_0x30af25,_0x23f452,_0x3605fd,_0x25a1c1){return function(_0x41c22a){try{var _0x4f0ffc=this[_0x3a64('0x10')];if(_0x4f0ffc==='mail'&&_0x25a1c1['body']['isAutoreply']){logger['info'](_0x3a64('0x11'),_0x30af25,_0x3a64('0x12'));return _0x41c22a[_0x3a64('0x13')]();}if(_0x23f452[0x0]==='1'&&(_['isNil'](this[_0x3a64('0x14')]['created'])||!this[_0x3a64('0x14')]['created'])){logger[_0x3a64('0x15')]('[%s][AUTOREPLY]\x20%s',_0x30af25,_0x3a64('0x16'));return _0x41c22a[_0x3a64('0x13')]();}if(_0x23f452[0x0]==='2'&&this[_0x3a64('0x14')][_0x3a64('0x17')]){logger[_0x3a64('0x15')](_0x3a64('0x18'),_0x30af25,'One\x20Time\x20already\x20sent');return _0x41c22a['next']();}var _0x353e9d={'ContactId':this[_0x3a64('0x19')]['id'],'sentAt':moment()[_0x3a64('0x1a')](_0x3a64('0x1b')),'direction':_0x3a64('0x1c')};if(this['channel']===_0x3a64('0x1d')){_0x353e9d[_0x3a64('0x1e')]=utils['getMustacheRender'](_0x23f452[0x2],this);}else{_0x353e9d[_0x3a64('0x1e')]=utils[_0x3a64('0x1f')](_0x23f452[0x1],this);}if(this['message']){_0x353e9d['to']=this['message'][_0x3a64('0x20')]||'';if(this[_0x3a64('0x10')]==='mail'&&_0x23f452[0x1]==='1'){_0x353e9d['cc']=this[_0x3a64('0x21')]['cc']||'';}_0x353e9d[_0x3a64('0x20')]=this[_0x3a64('0x21')]['to']||'';_0x353e9d[_0x3a64('0x22')]=this[_0x3a64('0x21')][_0x3a64('0x22')]||'';_0x353e9d[_0x3a64('0x23')]=!![];if(this[_0x3a64('0x21')][_0x3a64('0x24')]){_0x353e9d[_0x3a64('0x24')]='';_0x353e9d[_0x3a64('0x24')]+=_[_0x3a64('0x25')](this['message'][_0x3a64('0x24')],'Re:')?'':_0x3a64('0x26');_0x353e9d['subject']+=this[_0x3a64('0x21')][_0x3a64('0x24')];}}if(this[_0x3a64('0x10')]===_0x3a64('0x27')){_0x353e9d[_0x3a64('0x28')]=this[_0x3a64('0x29')]['id'];}else{_0x353e9d[_[_0x3a64('0x2a')](this['channel'])+_0x3a64('0x2b')]=this[_0x3a64('0x29')]['id'];}_0x353e9d[_['upperFirst'](this[_0x3a64('0x10')])+_0x3a64('0x2c')]=this[_0x3a64('0x14')]['id'];var _0x2a3a2=this[_0x3a64('0x14')];if(rpc[this[_0x3a64('0x10')]+'Message']){if(this[_0x3a64('0x10')]==='mail'){_0x353e9d[_0x3a64('0x2d')]=this[_0x3a64('0x21')][_0x3a64('0x2e')];_0x353e9d[_0x3a64('0x2f')]=_0x3a64('0x30')+_[_0x3a64('0x31')](_0x353e9d[_0x3a64('0x1e')],_0x3a64('0x32'),']+(>|$)/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 +var _0x14a6=['consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','condition','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','number'];(function(_0x503ea4,_0x144197){var _0x24f36f=function(_0x3cf297){while(--_0x3cf297){_0x503ea4['push'](_0x503ea4['shift']());}};_0x24f36f(++_0x144197);}(_0x14a6,0x124));var _0x614a=function(_0x308408,_0x37d440){_0x308408=_0x308408-0x0;var _0x9dc073=_0x14a6[_0x308408];return _0x9dc073;};'use strict';var schema=require(_0x614a('0x0'));var _=require(_0x614a('0x1'));var htmlToText=require(_0x614a('0x2'));var utils=require(_0x614a('0x3'));var logger=require(_0x614a('0x4'))(_0x614a('0x5'));var gotoif=schema({'condition':{'type':_0x614a('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x614a('0x7'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x614a('0x8')]=function(_0x2f4b3c,_0x3fa5c5){return function(_0x14233a){try{var _0x5a065b={'condition':htmlToText[_0x614a('0x9')](utils[_0x614a('0xa')](_0x3fa5c5[0x0],this),{'wordwrap':![]})[_0x614a('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3fa5c5[0x1],'priorityFalse':_0x3fa5c5[0x2]};var _0x26edd1=gotoif[_0x614a('0x0')](_0x5a065b,{'typecast':!![]});if(_0x26edd1[_0x614a('0xc')]){logger[_0x614a('0xd')](_0x614a('0xe'),_0x2f4b3c,_[_0x614a('0xf')](_0x26edd1,_0x614a('0x10'))[_0x614a('0x11')](',\x20'));_0x14233a['stop']();}else{try{var _0x4eeb62=eval('('+_0x5a065b[_0x614a('0x12')]+')');var _0x1eb021=_0x4eeb62?_0x5a065b[_0x614a('0x13')]:_0x5a065b['priorityFalse'];logger[_0x614a('0x14')](_0x614a('0x15'),_0x2f4b3c,_0x5a065b[_0x614a('0x12')],_0x4eeb62,_0x1eb021||_0x614a('0x16'));if(_0x1eb021){var _0x430eb3=_[_0x614a('0x17')](_0x14233a[_0x614a('0x18')](),{'p':_0x1eb021});if(_0x430eb3>=0x0){logger[_0x614a('0x14')](_0x614a('0x19'),_0x2f4b3c,_0x1eb021||_0x614a('0x16'),_0x430eb3);_0x14233a[_0x614a('0x16')](_0x430eb3);}else{logger[_0x614a('0x14')](_0x614a('0x1a'),_0x2f4b3c,_0x1eb021||_0x614a('0x16'));_0x14233a[_0x614a('0x1b')]();}}else{_0x14233a[_0x614a('0x16')]();}}catch(_0x12e8fd){logger[_0x614a('0xd')](_0x614a('0x1c'),_0x2f4b3c,_0x12e8fd[_0x614a('0x10')]);_0x14233a[_0x614a('0x1b')]();}}}catch(_0x82b28b){logger['error']('[%s][GOTOIF]\x20%s',_0x2f4b3c,JSON[_0x614a('0x1d')](_0x82b28b));_0x14233a[_0x614a('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 acf963b..d3d7148 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 _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 +var _0x7d81=['message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','[%s][GOTOP]\x20%s','map'];(function(_0x138c15,_0x357fff){var _0x50a854=function(_0x38f423){while(--_0x38f423){_0x138c15['push'](_0x138c15['shift']());}};_0x50a854(++_0x357fff);}(_0x7d81,0x77));var _0x17d8=function(_0x59cf14,_0x3ba23e){_0x59cf14=_0x59cf14-0x0;var _0x2e62cb=_0x7d81[_0x59cf14];return _0x2e62cb;};'use strict';var schema=require(_0x17d8('0x0'));var _=require(_0x17d8('0x1'));var logger=require('../../../../config/logger')(_0x17d8('0x2'));var gotop=schema({'priority':{'type':_0x17d8('0x3'),'required':!![],'message':_0x17d8('0x4')}});exports['consequence']=function(_0xf9a026,_0x2520d8){return function(_0x102c86){try{var _0x4735b2={'priority':_0x2520d8[0x0]};var _0x213593=gotop[_0x17d8('0x0')](_0x4735b2,{'typecast':!![]});if(_0x213593['length']){logger['error'](_0x17d8('0x5'),_0xf9a026,_[_0x17d8('0x6')](_0x213593,_0x17d8('0x7'))[_0x17d8('0x8')](',\x20'));_0x102c86[_0x17d8('0x9')]();}else{logger['info'](_0x17d8('0xa'),_0xf9a026,_0x4735b2[_0x17d8('0xb')]);if(_0x4735b2[_0x17d8('0xb')]){var _0x4afee8=_[_0x17d8('0xc')](_0x102c86[_0x17d8('0xd')](),{'p':_0x4735b2[_0x17d8('0xb')]});if(_0x4afee8>=0x0){logger[_0x17d8('0xe')](_0x17d8('0xf'),_0xf9a026,_0x4735b2[_0x17d8('0xb')]||_0x17d8('0x10'),_0x4afee8);_0x102c86[_0x17d8('0x10')](_0x4afee8);}else{logger[_0x17d8('0xe')](_0x17d8('0x11'),_0xf9a026,_0x4735b2[_0x17d8('0xb')]||_0x17d8('0x10'));_0x102c86['stop']();}}else{_0x102c86['next']();}}}catch(_0x31b000){logger['error'](_0x17d8('0x5'),_0xf9a026,JSON['stringify'](_0x31b000));_0x102c86['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 419bb83..9977542 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 _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 +var _0x8262=['info','[%s][MESSAGE]\x20%s','body','catch','stringify','stop','error','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','interaction','Message','then'];(function(_0x46383b,_0x5b398c){var _0x5b1a50=function(_0x268e47){while(--_0x268e47){_0x46383b['push'](_0x46383b['shift']());}};_0x5b1a50(++_0x5b398c);}(_0x8262,0x9d));var _0x2826=function(_0x2befdd,_0x318672){_0x2befdd=_0x2befdd-0x0;var _0xcfa797=_0x8262[_0x2befdd];return _0xcfa797;};'use strict';var _=require(_0x2826('0x0'));var utils=require(_0x2826('0x1'));var logger=require(_0x2826('0x2'))(_0x2826('0x3'));var rpc={'chatMessage':require(_0x2826('0x4')),'openchannelMessage':require(_0x2826('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x2826('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x4567c5,_0x22d692){return function(_0x2ba3ea){try{var _0x429187={'body':utils[_0x2826('0x7')](_0x22d692[0x0],this),'ContactId':this[_0x2826('0x8')]['id']};if(this[_0x2826('0x9')]===_0x2826('0xa')){_0x429187[_0x2826('0xb')]=this['account']['id'];}else{_0x429187[_[_0x2826('0xc')](this[_0x2826('0x9')])+_0x2826('0xd')]=this['account']['id'];}_0x429187[_[_0x2826('0xc')](this[_0x2826('0x9')])+_0x2826('0xe')]=this[_0x2826('0xf')]['id'];if(rpc[this[_0x2826('0x9')]+_0x2826('0x10')]){return rpc[this[_0x2826('0x9')]+'Message']['create'](_0x429187)[_0x2826('0x11')](function(_0x9c30c5){logger[_0x2826('0x12')](_0x2826('0x13'),_0x4567c5,_0x429187[_0x2826('0x14')]);_0x2ba3ea['next']();})[_0x2826('0x15')](function(_0x479ddb){logger['error'](_0x2826('0x13'),_0x4567c5,JSON[_0x2826('0x16')](_0x479ddb));_0x2ba3ea[_0x2826('0x17')]();});}}catch(_0x33e850){logger[_0x2826('0x18')]('[%s][MESSAGE]\x20%s',_0x4567c5,JSON[_0x2826('0x16')](_0x33e850));_0x2ba3ea[_0x2826('0x17')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index e77027f..77fd8df 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 _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 +var _0x1f2b=['../../../../config/logger','routing','[%s][NOOP]\x20%s','next','error','stringify','./utils'];(function(_0x248e3f,_0x5cbaa5){var _0x1feab9=function(_0x1a7ccf){while(--_0x1a7ccf){_0x248e3f['push'](_0x248e3f['shift']());}};_0x1feab9(++_0x5cbaa5);}(_0x1f2b,0x76));var _0xb1f2=function(_0x32e26e,_0x5b9732){_0x32e26e=_0x32e26e-0x0;var _0x139dc3=_0x1f2b[_0x32e26e];return _0x139dc3;};'use strict';var utils=require(_0xb1f2('0x0'));var logger=require(_0xb1f2('0x1'))(_0xb1f2('0x2'));exports['consequence']=function(_0x56bb40,_0xaa39f3){return function(_0x5afe7e){try{logger['info'](_0xb1f2('0x3'),_0x56bb40,utils['getMustacheRender'](_0xaa39f3[0x0],this));_0x5afe7e[_0xb1f2('0x4')]();}catch(_0x421a5e){logger[_0xb1f2('0x5')](_0xb1f2('0x3'),_0x56bb40,JSON[_0xb1f2('0x6')](_0x421a5e));_0x5afe7e['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index b124766..a8e8690 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 _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 +var _0xda11=['../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','joinAt','emit','clone','push','capitalize','InteractionId','%sQueuesWaitingInteractions','pick','%s:queue:%s','format','save','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','interaction','MessageId','message','chat','[%s][START:QUEUE][NAME:%s]','name','QueueReport','error','create\x20queue\x20report','waiting','accepted','info','update','catch','update\x20queue\x20report','toLowerCase','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','timeout','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xda11,0x18b));var _0x1da1=function(_0x35e837,_0x444a5b){_0x35e837=_0x35e837-0x0;var _0x408efa=_0xda11[_0x35e837];return _0x408efa;};'use strict';var schema=require(_0x1da1('0x0'));var _=require(_0x1da1('0x1'));var util=require(_0x1da1('0x2'));var seqqueue=require(_0x1da1('0x3'));var moment=require(_0x1da1('0x4'));var Redis=require('ioredis');var config=require(_0x1da1('0x5'));var logger=require(_0x1da1('0x6'))('routing');var strategy=require('./strategy');config[_0x1da1('0x7')]=_[_0x1da1('0x8')](config[_0x1da1('0x7')],{'host':_0x1da1('0x9'),'port':0x18eb});var io=require(_0x1da1('0xa'))(new Redis(config['redis']));var attributes=['id',_0x1da1('0xb'),_0x1da1('0xc'),_0x1da1('0xd'),'from',_0x1da1('0xe')];function emit(_0xbde431,_0x50cd75,_0x653026){io['to'](_0xbde431)[_0x1da1('0xf')](_0x50cd75,_0x653026);}function emitChannelQueueInteraction(_0x5bea92,_0x26ead4,_0x30654e,_0x526cb3,_0x2ebeec,_0x894ed0,_0x10fa84,_0x3a93f9){var _0x2567e3=_[_0x1da1('0x10')](_0x30654e);_0x2567e3[_0x1da1('0xb')]=_0x3a93f9;_0x2567e3[_0x1da1('0xd')]=_0x26ead4;_0x2567e3['account']=_0x526cb3;_0x2567e3['id']=_0x2ebeec;if(_0x894ed0){attributes[_0x1da1('0x11')](_[_0x1da1('0x12')](_0x5bea92)+_0x1da1('0x13'));_0x10fa84[util['format'](_0x1da1('0x14'),_0x5bea92)][_0x2ebeec]=_[_0x1da1('0x15')](_0x2567e3,attributes);}else{delete _0x10fa84[util['format']('%sQueuesWaitingInteractions',_0x5bea92)][_0x2ebeec];}emit(util['format'](_0x1da1('0x16'),_0x5bea92,_0x26ead4),util[_0x1da1('0x17')]('%s_queue_waiting_interaction:%s',_0x5bea92,_0x894ed0?_0x1da1('0x18'):_0x1da1('0x19')),_[_0x1da1('0x15')](_0x2567e3,attributes));}var rpc={'openchannelQueueReport':require(_0x1da1('0x1a')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x1da1('0x1b')),'smsQueueReport':require(_0x1da1('0x1c')),'faxQueueReport':require(_0x1da1('0x1d')),'whatsappQueueReport':require(_0x1da1('0x1e'))};var queue=schema({'name':{'type':_0x1da1('0x1f'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x1da1('0x20')}});function startRouting(_0x12e4e5,_0x3daa4f,_0x110e8a,_0x3c978c){if(_0x12e4e5&&_0x3daa4f&&_0x110e8a){_0x3daa4f['waiting']+=0x1;var _0x401207={'uniqueid':_0x12e4e5,'from':_0x110e8a['body']?_0x110e8a[_0x1da1('0x21')]['from']:'','joinAt':moment()[_0x1da1('0x17')](_0x1da1('0x22')),'ContactId':_0x110e8a[_0x1da1('0x23')]?_0x110e8a[_0x1da1('0x23')]['id']:null,'ListId':_0x110e8a[_0x1da1('0x24')]?_0x110e8a[_0x1da1('0x24')]['id']:null};_0x401207[_[_0x1da1('0x25')](_0x110e8a['channel'])+_0x1da1('0x26')]=_0x3daa4f['id']||null;_0x401207[_[_0x1da1('0x25')](_0x110e8a[_0x1da1('0x27')])+'InteractionId']=_0x110e8a['interaction']?_0x110e8a[_0x1da1('0x28')]['id']:null;_0x401207[_[_0x1da1('0x25')](_0x110e8a[_0x1da1('0x27')])+_0x1da1('0x29')]=_0x110e8a[_0x1da1('0x2a')]?_0x110e8a['message']['id']:null;_0x401207[_['upperFirst'](_0x110e8a['channel'])+(_0x110e8a['channel']!==_0x1da1('0x2b')?'AccountId':'WebsiteId')]=_0x110e8a[_0x1da1('0xc')]?_0x110e8a[_0x1da1('0xc')]['id']:null;logger['info'](util['format'](_0x1da1('0x2c'),_0x12e4e5,_0x3daa4f[_0x1da1('0x2d')]));emitChannelQueueInteraction(_0x110e8a[_0x1da1('0x27')],_0x3daa4f[_0x1da1('0x2d')],_0x401207,_0x110e8a[_0x1da1('0xc')][_0x1da1('0x2d')],_0x110e8a['message']['id'],!![],_0x3c978c,_0x3daa4f['id']);if(rpc[_0x110e8a[_0x1da1('0x27')]+_0x1da1('0x2e')]){return rpc[_0x110e8a[_0x1da1('0x27')]+_0x1da1('0x2e')]['create'](_0x401207)['catch'](function(_0x1bff0a){logger[_0x1da1('0x2f')](_0x1da1('0x30'));});}}}function stopRouting(_0x68cf82,_0x365573,_0x4caa62,_0x4072af){if(_0x68cf82&&_0x365573){_0x365573[_0x1da1('0x31')]-=0x1;var _0x4a82b1={'leaveAt':moment()[_0x1da1('0x17')](_0x1da1('0x22')),'acceptAt':moment()['format'](_0x1da1('0x22')),'reason':_0x1da1('0x32')};logger[_0x1da1('0x33')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x68cf82,_0x365573[_0x1da1('0x2d')]));emitChannelQueueInteraction(_0x4caa62[_0x1da1('0x27')],_0x365573[_0x1da1('0x2d')],_0x4caa62[_0x1da1('0x21')],_0x4caa62[_0x1da1('0xc')][_0x1da1('0x2d')],_0x4caa62['message']['id'],![],_0x4072af,_0x365573['id']);if(rpc[_0x4caa62['channel']+_0x1da1('0x2e')]){return rpc[_0x4caa62[_0x1da1('0x27')]+_0x1da1('0x2e')][_0x1da1('0x34')](_0x68cf82,_0x4a82b1)[_0x1da1('0x35')](function(_0x2fb112){logger[_0x1da1('0x2f')](_0x1da1('0x36'));});}}}function endRouting(_0x32fff0,_0x36d00d,_0x5c0e38,_0x5cee73){if(_0x32fff0&&_0x36d00d){_0x36d00d[_0x1da1('0x31')]-=0x1;var _0x4f506e={'leaveAt':moment()[_0x1da1('0x17')](_0x1da1('0x22')),'exitAt':moment()[_0x1da1('0x17')](_0x1da1('0x22')),'reason':'timeout'};logger[_0x1da1('0x33')](util[_0x1da1('0x17')]('[%s][END:QUEUE][NAME:%s]',_0x32fff0,_0x36d00d['name']));emitChannelQueueInteraction(_0x5c0e38['channel'],_0x36d00d[_0x1da1('0x2d')],_0x5c0e38[_0x1da1('0x21')],_0x5c0e38[_0x1da1('0xc')][_0x1da1('0x2d')],_0x5c0e38[_0x1da1('0x2a')]['id'],![],_0x5cee73);if(rpc[_0x5c0e38[_0x1da1('0x27')]+_0x1da1('0x2e')]){return rpc[_0x5c0e38[_0x1da1('0x27')]+_0x1da1('0x2e')][_0x1da1('0x34')](_0x32fff0,_0x4f506e)[_0x1da1('0x35')](function(_0x43aa11){logger[_0x1da1('0x2f')](_0x1da1('0x36'));});}}}function handleFindQueue(_0x11f7c9){return function(_0x9a0424){return _0x9a0424[_0x1da1('0x2d')][_0x1da1('0x37')]()===_0x11f7c9[_0x1da1('0x37')]();};}exports['consequence']=function(_0x32b406,_0x130ea0,_0x2a421f,_0x4c4296){return function(_0x425727){try{var _0x9e082f={'name':_0x130ea0[0x0],'timeout':_0x130ea0[0x1]};var _0x476b73=queue[_0x1da1('0x0')](_0x9e082f,{'typecast':!![]});if(_0x476b73[_0x1da1('0x38')]){logger[_0x1da1('0x2f')](_0x1da1('0x39'),_0x32b406,_[_0x1da1('0x3a')](_0x476b73,_0x1da1('0x2a'))[_0x1da1('0x3b')](',\x20'));_0x425727[_0x1da1('0x3c')]();}else{var _0x3b53bf=_[_0x1da1('0x3d')](_0x2a421f[_0x4c4296['channel']+_0x1da1('0x3e')],handleFindQueue(_0x9e082f[_0x1da1('0x2d')]));if(_0x3b53bf){startRouting(_0x32b406,_0x3b53bf,_0x4c4296,_0x2a421f);var _0x48b367=(_0x3b53bf[_0x1da1('0x3f')]||0xa)*0x3e8;var _0xf2b2b=(_0x9e082f[_0x1da1('0x3f')]||0x14)*0x3e8;var _0x2ec09e;if(_0x48b367>_0xf2b2b){_0xf2b2b=_0x48b367;}var _0x19157a=seqqueue[_0x1da1('0x40')](_0x48b367);_0x19157a['id']=_0x32b406;_0x19157a[_0x1da1('0x41')]=_0x48b367;_0x19157a[_0x1da1('0x42')]=_0xf2b2b;_0x19157a['channel']=_0x4c4296['channel'];_0x2a421f[_0x1da1('0x43')][_0x32b406]['on'](_0x1da1('0x44'),function(){logger[_0x1da1('0x33')](_0x1da1('0x45'),_0x32b406);stopRouting(_0x32b406,_0x3b53bf,_0x4c4296,_0x2a421f);clearTimeout(_0x2ec09e);_0x2ec09e=undefined;_0x19157a[_0x1da1('0x46')](!![]);if(_0x2a421f[_0x1da1('0x43')][_0x32b406]){delete _0x2a421f[_0x1da1('0x43')][_0x32b406];}_0x425727[_0x1da1('0x3c')]();});_0x2a421f[_0x1da1('0x43')][_0x32b406]['on'](_0x1da1('0x47'),function(){if(_0x2a421f['rules'][_0x32b406]){delete _0x2a421f[_0x1da1('0x43')][_0x32b406];}});_0x2ec09e=setTimeout(function(){logger[_0x1da1('0x33')](_0x1da1('0x48'),_0x32b406);endRouting(_0x32b406,_0x3b53bf,_0x4c4296,_0x2a421f);clearTimeout(_0x2ec09e);_0x19157a[_0x1da1('0x46')](!![]);_0x425727[_0x1da1('0x49')]();},_0xf2b2b);switch(_0x3b53bf[_0x1da1('0x4a')]){case _0x1da1('0x4b'):strategy[_0x1da1('0x4b')](_0x19157a,_0x3b53bf,_0x2a421f,_0x4c4296);break;default:strategy[_0x1da1('0x4c')](_0x19157a,_0x3b53bf,_0x2a421f,_0x4c4296);}}else{logger['error'](_0x1da1('0x4d'),_0x32b406,_0x9e082f[_0x1da1('0x2d')]);_0x425727[_0x1da1('0x3c')]();}}}catch(_0x5e4f6e){console[_0x1da1('0x4e')](_0x5e4f6e);logger['error'](_0x1da1('0x39'),_0x32b406,_0x5e4f6e[_0x1da1('0x4f')]);_0x425727[_0x1da1('0x3c')]();}};}; \ 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 654eb00..281309e 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 _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 +var _0x6737=['realtime','handleTimeout','timeout','bind','drained','prototype','push','handleRun','handleDrained','debug','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','saveWaitingNotification','showNotification','writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','removeWaitingNotification','channel','STOP','TIMEOUT','uuid','./util','routing','notificationId','squeue'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x6737,0xe2));var _0x7673=function(_0x5e8157,_0x3b4ab8){_0x5e8157=_0x5e8157-0x0;var _0x3ec40c=_0x6737[_0x5e8157];return _0x3ec40c;};'use strict';var _=require('lodash');var uuid=require(_0x7673('0x0'));var util=require(_0x7673('0x1'));var logger=require('../../../../../config/logger')(_0x7673('0x2'));var Agent=function(_0x2a9cd0,_0x43ee27,_0x12efff,_0x54002e){this[_0x7673('0x3')]=uuid['v4']();this[_0x7673('0x4')]=_0x2a9cd0;this['agent']=_0x43ee27;this[_0x7673('0x5')]=_0x12efff;this[_0x7673('0x2')]=_0x54002e;this['squeue']['push'](this['handleRun']['bind'](this),this[_0x7673('0x6')]['bind'](this));this[_0x7673('0x4')]['on'](_0x7673('0x7'),this['handleTimeout'][_0x7673('0x8')](this));this[_0x7673('0x4')]['on'](_0x7673('0x9'),this['handleDrained']['bind'](this));};Agent[_0x7673('0xa')]['push']=function(){this[_0x7673('0x4')][_0x7673('0xb')](this[_0x7673('0xc')][_0x7673('0x8')](this),this[_0x7673('0x6')][_0x7673('0x8')](this));};Agent[_0x7673('0xa')][_0x7673('0xd')]=function(){this[_0x7673('0x6')](!![]);};Agent[_0x7673('0xa')]['handleRun']=function(){logger[_0x7673('0xe')](_0x7673('0xf'),this[_0x7673('0x4')]['id'],this[_0x7673('0x10')]['id']);if(_[_0x7673('0x11')](this[_0x7673('0x5')][_0x7673('0x12')][this['agent']['id']])){logger['debug'](_0x7673('0x13'),this[_0x7673('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x7673('0xb')][_0x7673('0x8')](this),0x3e8);}else{if(this['routing'][_0x7673('0x14')]||util[_0x7673('0x15')](this[_0x7673('0x4')]['id'],this['realtime']['agents'][this[_0x7673('0x10')]['id']],this[_0x7673('0x4')]['channel'],![])){this[_0x7673('0x5')][_0x7673('0x12')][this[_0x7673('0x10')]['id']][_0x7673('0x16')]=!![];this[_0x7673('0x5')][_0x7673('0x12')][this['agent']['id']]['busyQueue']=undefined;util[_0x7673('0x17')](this[_0x7673('0x5')],this[_0x7673('0x2')],this[_0x7673('0x10')],this[_0x7673('0x4')]['channel']);util[_0x7673('0x18')](this[_0x7673('0x3')],this[_0x7673('0x4')]['id'],this[_0x7673('0x5')][_0x7673('0x12')][this[_0x7673('0x10')]['id']],null,this['routing']);util[_0x7673('0x19')](this[_0x7673('0x4')]['id'],this[_0x7673('0x5')][_0x7673('0x12')][this['agent']['id']],'RINGING'+(this[_0x7673('0x2')][_0x7673('0x14')]?_0x7673('0x1a'):''));}else{logger[_0x7673('0xe')](_0x7673('0x1b'),this[_0x7673('0x4')]['id'],this[_0x7673('0x10')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0x7673('0xa')][_0x7673('0x6')]=function(_0x1dd436){if(_[_0x7673('0x11')](this[_0x7673('0x5')][_0x7673('0x12')][this[_0x7673('0x10')]['id']])){return logger['debug']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x7673('0x4')]['id'],this[_0x7673('0x10')]['id']);}else{logger[_0x7673('0xe')](_0x7673('0x1c'),this['squeue']['id'],this[_0x7673('0x10')]['id']);util['hideNotification'](this[_0x7673('0x3')],this[_0x7673('0x4')]['id'],this[_0x7673('0x5')][_0x7673('0x12')][this[_0x7673('0x10')]['id']],null,this[_0x7673('0x2')]);this[_0x7673('0x5')][_0x7673('0x12')][this[_0x7673('0x10')]['id']][_0x7673('0x16')]=![];this[_0x7673('0x5')][_0x7673('0x12')][this[_0x7673('0x10')]['id']]['busyQueue']=undefined;util[_0x7673('0x1d')](this[_0x7673('0x5')],this[_0x7673('0x2')],this[_0x7673('0x10')],this[_0x7673('0x4')][_0x7673('0x1e')]);util[_0x7673('0x19')](this['squeue']['id'],this['realtime'][_0x7673('0x12')][this[_0x7673('0x10')]['id']],_0x1dd436?_0x7673('0x1f'):_0x7673('0x20'));}if(!_0x1dd436){setTimeout(this[_0x7673('0xb')][_0x7673('0x8')](this),0x3e8);}};function agent(_0x159afd,_0x47c9a3,_0x2845f6,_0x13c591){return new Agent(_0x159afd,_0x47c9a3,_0x2845f6,_0x13c591);}module['exports']=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 1888515..84efa1f 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 _0x4ea3=['[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','RINGING','busyQueue','channel','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','writeLog','removeWaitingNotification','exports','lodash','./util','routing','notificationId','squeue','queue','push','handleRun','handleTimeout','bind','timeout','drained','prototype','handleDrained','isNil','Agents','length','realtime','agents','debug'];(function(_0x19a72c,_0x2229cb){var _0x3c6199=function(_0x4293e9){while(--_0x4293e9){_0x19a72c['push'](_0x19a72c['shift']());}};_0x3c6199(++_0x2229cb);}(_0x4ea3,0x122));var _0x34ea=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x4ea3[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x34ea('0x0'));var uuid=require('uuid');var util=require(_0x34ea('0x1'));var logger=require('../../../../../config/logger')(_0x34ea('0x2'));var Beepall=function(_0x3cfa06,_0x131d4e,_0x2a8bcf,_0x554cce){this[_0x34ea('0x3')]=uuid['v4']();this[_0x34ea('0x4')]=_0x3cfa06;this[_0x34ea('0x5')]=_0x131d4e;this['realtime']=_0x2a8bcf;this['routing']=_0x554cce;this[_0x34ea('0x4')][_0x34ea('0x6')](this[_0x34ea('0x7')]['bind'](this),this[_0x34ea('0x8')][_0x34ea('0x9')](this));this['squeue']['on'](_0x34ea('0xa'),this[_0x34ea('0x8')]['bind'](this));this['squeue']['on'](_0x34ea('0xb'),this['handleDrained'][_0x34ea('0x9')](this));};Beepall[_0x34ea('0xc')][_0x34ea('0x6')]=function(){this[_0x34ea('0x4')][_0x34ea('0x6')](this[_0x34ea('0x7')]['bind'](this),this['handleTimeout']['bind'](this));};Beepall[_0x34ea('0xc')][_0x34ea('0xd')]=function(){this[_0x34ea('0x8')](!![]);};Beepall[_0x34ea('0xc')][_0x34ea('0x7')]=function(){var _0x749433=!![];if(!_[_0x34ea('0xe')](this[_0x34ea('0x5')])&&!_[_0x34ea('0xe')](this['queue'][_0x34ea('0xf')])&&this[_0x34ea('0x5')]['Agents']['length']>0x0){for(var _0x1dd111=0x0,_0x3fd65d;_0x1dd1110x0){for(var _0x36f98d=0x0,_0x2d662f;_0x36f98d0x0&&_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 +var _0x2f3e=['PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','checkWaitingNotifications','interaction','UserId','some','channel','capitalize','InteractionId','agents','saveWaitingNotification','WaitingInteractions','removeWaitingNotification','writeLog','lodash','util','../../../../../config/environment','../../../../../config/logger','routing','defaults','redis','localhost','socket.io-emitter','user:%s','name','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','error','format','[%s][QUEUE]\x20%s','message','emit','save','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause'];(function(_0x6e1416,_0x9152fd){var _0x5d6c40=function(_0x242225){while(--_0x242225){_0x6e1416['push'](_0x6e1416['shift']());}};_0x5d6c40(++_0x9152fd);}(_0x2f3e,0xb1));var _0xe2f3=function(_0x574617,_0x42eccc){_0x574617=_0x574617-0x0;var _0x29de90=_0x2f3e[_0x574617];return _0x29de90;};'use strict';var _=require(_0xe2f3('0x0'));var util=require(_0xe2f3('0x1'));var utils=require('../utils');var Redis=require('ioredis');var config=require(_0xe2f3('0x2'));var logger=require(_0xe2f3('0x3'))(_0xe2f3('0x4'));config['redis']=_[_0xe2f3('0x5')](config[_0xe2f3('0x6')],{'host':_0xe2f3('0x7'),'port':0x18eb});var io=require(_0xe2f3('0x8'))(new Redis(config[_0xe2f3('0x6')]));function sendNotification(_0x4e578a,_0x20928d,_0x21fe76,_0x6f0719,_0xf8bfbb,_0x371139){io['to'](util['format'](_0xe2f3('0x9'),_0x6f0719[_0xe2f3('0xa')]))['emit'](_0xe2f3('0xb'),_0x6f0719);var _0x34a005=_0x371139||{};var _0x532be8=_0x21fe76[_0xe2f3('0xc')]('.');var _0x2a497e={'uniqueid':_0x20928d,'channel':_0x532be8[0x0],'id':_0x532be8[0x1],'title':_0x532be8[0x0]+_0xe2f3('0xd'),'interactionId':_0x532be8[0x2],'queue':_0xf8bfbb?_0xf8bfbb['name']:null,'sound':_0x34a005[_0xe2f3('0xe')][_0xe2f3('0xf')],'shake':_0x34a005[_0xe2f3('0xe')][_0xe2f3('0x10')]};try{if(!_0x34a005[_0xe2f3('0x11')]){_0x34a005['body']={};}if(_0xf8bfbb){_0x34a005[_0xe2f3('0x11')]['queue']=_0xf8bfbb;}else if(_0x34a005[_0xe2f3('0x11')][_0xe2f3('0x12')]){delete _0x34a005[_0xe2f3('0x11')]['queue'];}_0x2a497e[_0xe2f3('0x13')]=utils[_0xe2f3('0x14')](_0x34a005[_0xe2f3('0xe')]['notificationTemplate'],_0x34a005);}catch(_0x5c8f47){_0x2a497e['msg']='I\x20can\x27t\x20render\x20your\x20template';logger[_0xe2f3('0x15')](util[_0xe2f3('0x16')](_0xe2f3('0x17'),_0x20928d,_0x5c8f47[_0xe2f3('0x18')]));}io['to'](util[_0xe2f3('0x16')](_0xe2f3('0x9'),_0x6f0719[_0xe2f3('0xa')]))[_0xe2f3('0x19')](util[_0xe2f3('0x16')]('notification:%s',_0x4e578a?_0xe2f3('0x1a'):'remove'),_0x2a497e);}function writeLog(_0x46d062,_0x15ace9,_0x5bf5ef){return logger[_0xe2f3('0x1b')](util[_0xe2f3('0x16')](_0xe2f3('0x1c'),_0x46d062,_0x15ace9[_0xe2f3('0xa')],_0x5bf5ef));}exports[_0xe2f3('0x1d')]=function(_0x520b21,_0x3201a4,_0x3a15b4,_0x582f28){if(_0x3201a4[_0xe2f3('0x1e')]){writeLog(_0x520b21,_0x3201a4,_0xe2f3('0x1f'));return![];}if(!_0x3201a4[_0xe2f3('0x20')]){writeLog(_0x520b21,_0x3201a4,_0xe2f3('0x21'));return![];}if(_0x3201a4[_0x3a15b4+_0xe2f3('0x22')]){writeLog(_0x520b21,_0x3201a4,_0xe2f3('0x23'));return![];}if(_0x582f28&&_0x3201a4[_0xe2f3('0x24')](_0x3a15b4+_0xe2f3('0x25'))&&_0x3201a4['hasOwnProperty'](_0x3a15b4+_0xe2f3('0x26'))){if(_0x3201a4[_0x3a15b4+_0xe2f3('0x25')]>0x0&&_0x3201a4[_0x3a15b4+_0xe2f3('0x26')]>=_0x3201a4[_0x3a15b4+_0xe2f3('0x25')]){writeLog(_0x520b21,_0x3201a4,_0x3a15b4[_0xe2f3('0x27')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0xe2f3('0x28')]=function(_0x2cd854,_0x109303,_0x583627,_0x536c89,_0x4cf878){return sendNotification(!![],_0x2cd854,_0x109303,_0x583627,_0x536c89,_0x4cf878);};exports['hideNotification']=function(_0x56cdc6,_0x2f9838,_0x48f08f,_0x5058ce,_0x1e2d11){return sendNotification(![],_0x56cdc6,_0x2f9838,_0x48f08f,_0x5058ce,_0x1e2d11);};exports[_0xe2f3('0x29')]=function(_0xc49dfd,_0x32249d,_0x35808f){var _0xa5435e=_0x32249d[_0xe2f3('0x2a')][_0xe2f3('0x2b')];if(!_0xa5435e&&_0x35808f){_0xa5435e=_0x35808f['id'];}var _0x5174bf=_[_0xe2f3('0x2c')](_0xc49dfd[_0x32249d[_0xe2f3('0x2d')]+'QueuesWaitingInteractions'],function(_0x13d3ad){var _0x3c1541=_[_0xe2f3('0x2e')](_0x32249d['channel'])+_0xe2f3('0x2f');return _0x13d3ad[_0x3c1541]===_0x32249d[_0xe2f3('0x2a')]['id'];});if(!_0x5174bf&&_0xa5435e){_0x5174bf=_[_0xe2f3('0x2c')](_0xc49dfd[_0xe2f3('0x30')][_0xa5435e][_0x32249d['channel']+'WaitingInteractions'],function(_0x41ba10){return _0x41ba10['id']===_0x32249d[_0xe2f3('0x2a')]['id'];});}return _0x5174bf;};exports[_0xe2f3('0x31')]=function(_0x13643a,_0x48cb42,_0x1dbd5d,_0xbedcd9){_0x13643a[_0xe2f3('0x30')][_0x1dbd5d['id']][_0xbedcd9+_0xe2f3('0x32')][_0x48cb42['message']['id']]={'id':_0x48cb42[_0xe2f3('0x2a')]['id']};};exports[_0xe2f3('0x33')]=function(_0xb33ec5,_0x379ab3,_0x2a727f,_0x4189d3){delete _0xb33ec5[_0xe2f3('0x30')][_0x2a727f['id']][_0x4189d3+'WaitingInteractions'][_0x379ab3[_0xe2f3('0x18')]['id']];};exports[_0xe2f3('0x34')]=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 667f95e..4148ab7 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 _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 +var _0x028d=['consequence','validate','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','shelljs','lodash','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x2531dc,_0x32f449){var _0x38bdf2=function(_0x1d2977){while(--_0x1d2977){_0x2531dc['push'](_0x2531dc['shift']());}};_0x38bdf2(++_0x32f449);}(_0x028d,0xff));var _0xd028=function(_0x14991d,_0x1e10e6){_0x14991d=_0x14991d-0x0;var _0x3b2047=_0x028d[_0x14991d];return _0x3b2047;};'use strict';var schema=require('validate');var sh=require(_0xd028('0x0'));var _=require(_0xd028('0x1'));var utils=require('./utils');var logger=require(_0xd028('0x2'))(_0xd028('0x3'));var system=schema({'command':{'type':_0xd028('0x4'),'required':!![],'message':_0xd028('0x5')}});exports[_0xd028('0x6')]=function(_0x67d150,_0x5094d8){return function(_0x153af8){try{var _0x4592fd={'command':_0x5094d8[0x0]};var _0x20588f=system[_0xd028('0x7')](_0x4592fd,{'typecast':!![]});if(_0x20588f[_0xd028('0x8')]){logger[_0xd028('0x9')](_0xd028('0xa'),_0x67d150,_[_0xd028('0xb')](_0x20588f,_0xd028('0xc'))[_0xd028('0xd')](',\x20'));logger[_0xd028('0xe')](_0xd028('0xf'),_0x67d150);_0x153af8[_0xd028('0x10')]();}else{var _0x383982=this;var _0x4ec82c=utils[_0xd028('0x11')](_0x5094d8[0x0],this);logger[_0xd028('0xe')](_0xd028('0x12'),_0x67d150,_0x4ec82c);sh[_0xd028('0x13')](_[_0xd028('0x14')](_0x4ec82c),function(_0x3eb4d0,_0x4d6018){logger[_0xd028('0xe')](_0xd028('0x15'),_0x67d150,_0x3eb4d0);if(_0x3eb4d0==0x0){var _0x4817a4=_0x4d6018[_0xd028('0x16')](/(\r\n|\n|\r)/gm,'');if(_[_0xd028('0x17')](_0x5094d8[0x1])||_[_0xd028('0x18')](_0x5094d8[0x1])){logger[_0xd028('0xe')](_0xd028('0x19'),_0x67d150);_0x383982[_0xd028('0x1a')][_0x5094d8[0x1]]=_0x4817a4;}else{logger[_0xd028('0xe')](_0xd028('0x1b'),_0x67d150,_0x5094d8[0x1],_0x4817a4);_0x383982[_0xd028('0x1a')][_0x5094d8[0x1]]=_0x4817a4;}}_0x153af8[_0xd028('0x10')]();});}}catch(_0x12450d){logger[_0xd028('0x9')]('[%s][SYSTEM]\x20%s',_0x67d150,_[_0xd028('0x1c')](_0x12450d)?JSON['stringify'](_0x12450d):_0x12450d);logger[_0xd028('0xe')](_0xd028('0xf'),_0x67d150);_0x153af8[_0xd028('0x10')]();}};}; \ 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 aa7d6af..565a634 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 _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 +var _0xfadf=['finally','stringify','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s'];(function(_0x6fc5ba,_0x4a75c6){var _0x26e04c=function(_0x5e7173){while(--_0x5e7173){_0x6fc5ba['push'](_0x6fc5ba['shift']());}};_0x26e04c(++_0x4a75c6);}(_0xfadf,0x198));var _0xffad=function(_0x58110e,_0x3a67bf){_0x58110e=_0x58110e-0x0;var _0x14495d=_0xfadf[_0x58110e];return _0x14495d;};'use strict';var schema=require('validate');var _=require(_0xffad('0x0'));var rpc={'chatInteraction':require(_0xffad('0x1')),'openchannelInteraction':require(_0xffad('0x2')),'smsInteraction':require(_0xffad('0x3')),'mailInteraction':require(_0xffad('0x4')),'faxInteraction':require(_0xffad('0x5')),'whatsappInteraction':require(_0xffad('0x6'))};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':_0xffad('0x7'),'required':!![],'message':_0xffad('0x8')}});exports[_0xffad('0x9')]=function(_0x542f9c,_0x53cd56,_0x896e88,_0x10e7a1){return function(_0x62e6de){try{var _0x20258a={'tag':_0x53cd56[0x0]};var _0x144cd5=tag[_0xffad('0xa')](_0x20258a,{'typecast':!![]});if(_0x144cd5[_0xffad('0xb')]){logger[_0xffad('0xc')]('[%s][TAG]\x20%s',_0x542f9c,_[_0xffad('0xd')](_0x144cd5,_0xffad('0xe'))[_0xffad('0xf')](',\x20'));logger[_0xffad('0x10')](_0xffad('0x11'),_0x542f9c);_0x62e6de[_0xffad('0x12')]();}else{var _0x21a5ca={'ids':[_0x53cd56[0x0]]};if(rpc[_0x10e7a1['channel']+_0xffad('0x13')]){rpc[_0x10e7a1[_0xffad('0x14')]+'Interaction'][_0xffad('0x15')](_0x10e7a1[_0xffad('0x16')]['id'],_0x21a5ca)[_0xffad('0x17')](function(_0x3246e6){logger[_0xffad('0x10')](_0xffad('0x18'),_0x542f9c,_0x53cd56[0x1],_0x10e7a1[_0xffad('0x14')],_0x10e7a1['interaction']['id']);})[_0xffad('0x19')](function(_0x4c188c){logger[_0xffad('0xc')](_0xffad('0x1a'),_0x542f9c,JSON['stringify'](_0x4c188c));logger[_0xffad('0x10')](_0xffad('0x11'),_0x542f9c);})[_0xffad('0x1b')](function(){_0x62e6de['next']();});}}}catch(_0x4c896e){logger[_0xffad('0xc')](_0xffad('0x1a'),_0x542f9c,_['isObject'](_0x4c896e)?JSON[_0xffad('0x1c')](_0x4c896e):_0x4c896e);logger['info'](_0xffad('0x11'),_0x542f9c);_0x62e6de[_0xffad('0x12')]();}};}; \ 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 b10c089..071a46f 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 _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 +var _0xc633=['isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','lodash','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','title','jsonrpc','2.0','method','login','params','stringify','utf8','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','info','stop','catch','error','[%s][TVOX]\x20%s'];(function(_0x165d61,_0x20c2fb){var _0x51bdd5=function(_0x48982e){while(--_0x48982e){_0x165d61['push'](_0x165d61['shift']());}};_0x51bdd5(++_0x20c2fb);}(_0xc633,0x138));var _0x3c63=function(_0x285c2f,_0x2b8c92){_0x285c2f=_0x285c2f-0x0;var _0x3e174f=_0xc633[_0x285c2f];return _0x3e174f;};'use strict';var rp=require(_0x3c63('0x0'));var logger=require(_0x3c63('0x1'))('routing');var _=require(_0x3c63('0x2'));var arr=[];exports['consequence']=function(_0x2ad5e9,_0x1aa72c){return function(_0x579e65){var _0x1a2e8c=_0x1aa72c[0xa];var _0x31d563=_0x1aa72c[0xb];var _0xab1a0a=_0x1aa72c[0xc];var _0x4eeec7=_0x1aa72c[0xd];var _0x1c8d15=_0x1aa72c[0xe];var _0x1bc56f=_0x1aa72c[0xf][_0x3c63('0x3')](/\n/g,_0x3c63('0x4'));var _0x5a5027=_0x1aa72c[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x3c63('0x5')](_0x31d563)){arr[_0x3c63('0x6')](_0x31d563);var _0x448aea=_0x1aa72c[0x3];var _0x4fda94=_0x1aa72c[0x4];var _0x14b3d0=_0x1aa72c[0x1];var _0x120fce=_0x1aa72c[0x0];var _0x86e3d5={};_0x86e3d5[_0x3c63('0x7')]=_0x1aa72c[0x8]+_0x3c63('0x8')+_0xab1a0a+'|'+_0x1a2e8c+'|'+_0x4eeec7+'|'+_0x31d563+'|'+_0x1c8d15;_0x86e3d5['urlOnRing']=_0x1aa72c[0x7]+_0x3c63('0x8')+_0xab1a0a+'|'+_0x1a2e8c+'|'+_0x4eeec7+'|'+_0x31d563+'|'+_0x1c8d15+'|'+_0x1bc56f+'|'+_0x5a5027;_0x86e3d5[_0x3c63('0x9')]=_0x1aa72c[0x9];var _0x4cdbe5={};_0x4cdbe5[_0x3c63('0xa')]=_0x3c63('0xb');_0x4cdbe5[_0x3c63('0xc')]=_0x3c63('0xd');var _0x36b607=[];_0x36b607['push'](_0x1aa72c[0x2]);_0x36b607['push'](_0x1aa72c[0x5]);_0x36b607[_0x3c63('0x6')](_0x1aa72c[0x6]);_0x4cdbe5[_0x3c63('0xe')]=_0x36b607;_0x4cdbe5['id']=0x1;var _0x518b05=JSON[_0x3c63('0xf')](_0x4cdbe5);var _0x1bdee1={'encoding':_0x3c63('0x10'),'method':'POST','timeout':0x2710,'url':_0x448aea,'headers':{'Content-Type':'application/json-rpc'},'body':_0x518b05};return rp(_0x1bdee1)[_0x3c63('0x11')](function(_0x525817){const _0x149d6d=JSON[_0x3c63('0x12')](_0x525817);if(!_0x149d6d[_0x3c63('0x13')][_0x3c63('0x14')]){throw new Error(_0x3c63('0x15'));}var _0x2dadfa=_0x31d563;var _0x53e226=_0x3c63('0x16')+_0x14b3d0+'&serviceId='+_0x120fce+_0x3c63('0x17')+_0x2dadfa+'&data='+JSON['stringify'](_0x86e3d5);var _0x4cdc85=_0x4fda94+'?'+_0x53e226;return rp(_0x4cdc85);})['then'](function(_0x472538){logger[_0x3c63('0x18')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x2ad5e9,_0x472538);_0x579e65[_0x3c63('0x19')]();})[_0x3c63('0x1a')](function(_0x4fa377){logger[_0x3c63('0x1b')](_0x3c63('0x1c'),_0x2ad5e9,_[_0x3c63('0x1d')](_0x4fa377)?JSON[_0x3c63('0xf')](_0x4fa377):_0x4fa377);_0x579e65[_0x3c63('0x19')]();});}else{logger[_0x3c63('0x18')](_0x3c63('0x1e'),_0x2ad5e9);_0x579e65['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 0ad6076..19a9e73 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_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 +var _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x38c3c9,_0x54426f){var _0x1d5e65=function(_0x1e50f6){while(--_0x1e50f6){_0x38c3c9['push'](_0x38c3c9['shift']());}};_0x1d5e65(++_0x54426f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index e4b0722..d48c155 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 _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 +var _0x253b=['format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','applications','isArray','length','existsSync','app','.js','toLowerCase','autoreply','mail','push','slice','join','dialogflow','split','amazonlex','tag','TagId','appdata','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','execute','Applications\x20executed','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','error','agent','agents','busy','busyQueue','end','QueueReport','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','find','chatQueues','paused','waiting','mailQueues','name','openchannelQueues','available','smsQueues','loggedIn','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','stringify','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine'];(function(_0xbaeba7,_0x578dfa){var _0x4b42e7=function(_0x23bd26){while(--_0x23bd26){_0xbaeba7['push'](_0xbaeba7['shift']());}};_0x4b42e7(++_0x578dfa);}(_0x253b,0x199));var _0xb253=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x253b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb253('0x0'));var util=require(_0xb253('0x1'));var path=require(_0xb253('0x2'));var fs=require('fs');var jayson=require(_0xb253('0x3'));var BPromise=require(_0xb253('0x4'));var utils=require('./applications/utils');var sUtils=require(_0xb253('0x5'));var logger=require(_0xb253('0x6'))(_0xb253('0x7'));var rpc={'openchannelQueueReport':require(_0xb253('0x8')),'mailQueueReport':require(_0xb253('0x9')),'chatQueueReport':require(_0xb253('0xa')),'smsQueueReport':require(_0xb253('0xb')),'faxQueueReport':require(_0xb253('0xc')),'whatsappQueueReport':require(_0xb253('0xd'))};var RuleEngine=require(_0xb253('0xe'));function getId(_0x109687,_0x3831b5,_0x512c63){return util[_0xb253('0xf')](_0xb253('0x10'),_0x109687,_0x3831b5||0x0,_0x512c63||0x0);}function getIntervals(_0x3add9a,_0x5df0a5){var _0x171d68=[];if(!_[_0xb253('0x11')](_0x5df0a5[_0xb253('0x12')])&&!_[_0xb253('0x11')](_0x3add9a[_0x5df0a5['IntervalId']])&&!_['isNil'](_0x3add9a[_0x5df0a5[_0xb253('0x12')]]['Intervals'])){_0x171d68=_[_0xb253('0x13')](_0x3add9a[_0x5df0a5[_0xb253('0x12')]][_0xb253('0x14')],_0xb253('0x15'));}else if(!_['isNil'](_0x5df0a5[_0xb253('0x15')])){_0x171d68=[_0x5df0a5[_0xb253('0x15')]];}return _0x171d68;}exports[_0xb253('0x16')]=function(_0xe4b96b){_0xe4b96b[_0xb253('0x17')]={};return new BPromise(function(_0x37ed21,_0x353b8e){var _0x4bb04f={'Start':function(_0x3c67ea){var _0x28d336=this;return new Promise(function(_0x30e2ec,_0x140169){if(_0x3c67ea){try{var _0x580ac9=[];var _0x1df1de=getId(_0x3c67ea[_0xb253('0x18')],_0x3c67ea[_0xb253('0x19')]?_0x3c67ea[_0xb253('0x19')]['id']:0x0,_0x3c67ea[_0xb253('0x1a')]?_0x3c67ea[_0xb253('0x1a')]['id']:0x0);var _0x53d29f=sUtils[_0xb253('0x1b')](_0xe4b96b,_0x3c67ea);if(!_0x53d29f&&_0x3c67ea[_0xb253('0x1c')]&&_[_0xb253('0x1d')](_0x3c67ea[_0xb253('0x1c')])&&_0x3c67ea[_0xb253('0x1c')][_0xb253('0x1e')]){for(var _0x35976e=0x0;_0x35976e<_0x3c67ea['applications']['length'];_0x35976e+=0x1){var _0x981a3=_0x3c67ea[_0xb253('0x1c')][_0x35976e];if(fs[_0xb253('0x1f')](path['join'](__dirname,_0xb253('0x1c'),_0x981a3[_0xb253('0x20')]+_0xb253('0x21')))){var _0x19c3de=[];switch(_0x981a3['app'][_0xb253('0x22')]()){case _0xb253('0x23'):var _0x31992e=_0x981a3['appdata']['split'](',');if(_0x3c67ea[_0xb253('0x18')]===_0xb253('0x24')){_0x19c3de[_0xb253('0x25')](_0x31992e[0x0]);_0x19c3de[_0xb253('0x25')](_0x31992e[0x1]);_0x19c3de[_0xb253('0x25')](_0x31992e[_0xb253('0x26')](0x2,_0x31992e[_0xb253('0x1e')])['join'](','));}else{_0x19c3de[_0xb253('0x25')](_0x31992e[0x0]);_0x19c3de[_0xb253('0x25')](_0x31992e['slice'](0x1,_0x31992e[_0xb253('0x1e')])[_0xb253('0x27')](','));}break;case _0xb253('0x28'):var _0x2be76c=_0x981a3['appdata'][_0xb253('0x29')](',');_0x19c3de['push'](_0x2be76c[0x0]);_0x19c3de[_0xb253('0x25')](_0x2be76c[0x1]);_0x19c3de['push'](_0x2be76c[_0xb253('0x26')](0x2,_0x2be76c['length'])[_0xb253('0x27')](','));break;case'dialogflowv2':var _0xda366=_0x981a3['appdata']['split'](',');_0x19c3de[_0xb253('0x25')](_0xda366[0x0]);_0x19c3de['push'](_0xda366[0x1]);_0x19c3de[_0xb253('0x25')](_0xda366[0x2]);_0x19c3de[_0xb253('0x25')](_0xda366[0x3]);_0x19c3de[_0xb253('0x25')](_0xda366[_0xb253('0x26')](0x4,_0xda366[_0xb253('0x1e')])[_0xb253('0x27')](','));break;case _0xb253('0x2a'):var _0x183656=_0x981a3['appdata']['split'](',');_0x19c3de['push'](_0x183656[0x0]);_0x19c3de[_0xb253('0x25')](_0x183656[0x1]);_0x19c3de[_0xb253('0x25')](_0x183656[0x2]);_0x19c3de[_0xb253('0x25')](_0x183656[0x3]);_0x19c3de[_0xb253('0x25')](_0x183656[_0xb253('0x26')](0x4,_0x183656[_0xb253('0x1e')])[_0xb253('0x27')](','));break;case _0xb253('0x19'):_0x19c3de['push'](_0x981a3['appdata']);break;case _0xb253('0x2b'):_0x19c3de[_0xb253('0x25')](_0x981a3[_0xb253('0x2c')]);_0x19c3de[_0xb253('0x25')](_0x981a3[_0xb253('0x2d')]);break;case'tvox':var _0x418094=utils[_0xb253('0x2e')](_0x3c67ea[_0xb253('0x2f')][_0xb253('0x30')],_0x3c67ea);var _0x5403f4=_0x981a3['appdata']['split'](',');_0x19c3de['push'](_0x5403f4[0x0]);_0x19c3de[_0xb253('0x25')](_0x5403f4[0x1]);_0x19c3de[_0xb253('0x25')](_0x5403f4[0x2]);_0x19c3de[_0xb253('0x25')](_0x5403f4[0x3]);_0x19c3de[_0xb253('0x25')](_0x5403f4[0x4]);_0x19c3de[_0xb253('0x25')](_0x5403f4[0x5]);_0x19c3de[_0xb253('0x25')](_0x5403f4[0x6]);_0x19c3de[_0xb253('0x25')](_0x5403f4[0x7]);_0x19c3de[_0xb253('0x25')](_0x5403f4[0x8]);_0x19c3de[_0xb253('0x25')](_0x5403f4[0x9]);_0x19c3de[_0xb253('0x25')](_0x5403f4[0xa]);_0x19c3de[_0xb253('0x25')](_0x3c67ea[_0xb253('0x1a')]['id']);_0x19c3de[_0xb253('0x25')](_0x3c67ea['message']['id']);_0x19c3de[_0xb253('0x25')](_0x981a3[_0xb253('0x31')]);_0x19c3de['push'](_0x3c67ea[_0xb253('0x1a')][_0xb253('0x32')]);_0x19c3de['push'](_0x3c67ea[_0xb253('0x33')][_0xb253('0x33')]);_0x19c3de[_0xb253('0x25')](_0x418094);break;default:_0x19c3de=_[_0xb253('0x11')](_0x981a3[_0xb253('0x2d')])?[]:_0x981a3[_0xb253('0x2d')]['split'](',');}var _0x1a2dc9={'id':util[_0xb253('0xf')](_0xb253('0x34'),_0x1df1de,_0x981a3['id'],_0x981a3[_0xb253('0x20')]),'condition':require(_0xb253('0x35'))['condition'](_0x1df1de,getIntervals(_0xe4b96b[_0xb253('0x36')],_0x981a3),_0xe4b96b),'consequence':require(_0xb253('0x37')+_0x981a3[_0xb253('0x20')])[_0xb253('0x38')](_0x1df1de,_0x19c3de,_0xe4b96b,_0x3c67ea),'p':_0x981a3[_0xb253('0x39')]||0x0};logger[_0xb253('0x3a')](_0xb253('0x3b'),_0x1a2dc9['id'],_0xb253('0x3c'),getIntervals(_0xe4b96b[_0xb253('0x36')],_0x981a3)[_0xb253('0x27')](_0xb253('0x3d')));_0x580ac9['push'](_0x1a2dc9);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0xb253('0x27')](__dirname,_0xb253('0x1c'),_0x981a3[_0xb253('0x20')]+'.js'));}}_0xe4b96b[_0xb253('0x17')][_0x1df1de]=new RuleEngine(_0x580ac9);_0xe4b96b[_0xb253('0x17')][_0x1df1de][_0xb253('0x3e')](_0x3c67ea,function(_0x4e0aec){logger[_0xb253('0x3a')](_0xb253('0x3f'),JSON['stringify'](_0x4e0aec[_0xb253('0x40')]));if(_0xe4b96b[_0xb253('0x17')][_0x1df1de]){_0xe4b96b['rules'][_0x1df1de][_0xb253('0x41')](_0xb253('0x42'));}});return _0x30e2ec({'code':0xc8,'message':_0x3c67ea});}else{if(_0x53d29f){logger[_0xb253('0x3a')](util['format'](_0xb253('0x43'),_0x1df1de));}else{logger[_0xb253('0x3a')](_0xb253('0x44'));}return _0x30e2ec({'code':0xc8,'message':_0x3c67ea});}}catch(_0x3498b2){logger['error'](_0x3498b2[_0xb253('0x45')]);return _0x140169(_0x28d336[_0xb253('0x46')](0x1f4,_0x3498b2));}}return _0x140169('routing\x20is\x20empty');});},'AcceptMessage':function(_0x520b11){var _0x7fbc95=this;return new Promise(function(_0x3afb3e,_0x56fafd){if(_0x520b11['agent']&&_0x520b11['agent']['id']){if(_0xe4b96b['agents'][_0x520b11[_0xb253('0x47')]['id']]){_0xe4b96b[_0xb253('0x48')][_0x520b11[_0xb253('0x47')]['id']][_0xb253('0x49')]=![];_0xe4b96b[_0xb253('0x48')][_0x520b11[_0xb253('0x47')]['id']][_0xb253('0x4a')]=undefined;}}if(_0x520b11[_0xb253('0x19')]&&_0x520b11[_0xb253('0x19')]['id']){try{var _0x3fd0ad=getId(_0x520b11[_0xb253('0x18')],_0x520b11[_0xb253('0x19')]?_0x520b11[_0xb253('0x19')]['id']:0x0,_0x520b11[_0xb253('0x1a')]?_0x520b11['interaction']['id']:0x0);if(_0xe4b96b[_0xb253('0x17')][_0x3fd0ad]){_0xe4b96b[_0xb253('0x17')][_0x3fd0ad][_0xb253('0x41')](_0xb253('0x4b'));if(rpc[_0x520b11[_0xb253('0x18')]+'QueueReport']){rpc[_0x520b11[_0xb253('0x18')]+_0xb253('0x4c')]['update'](_0x3fd0ad,{'UserId':_0x520b11[_0xb253('0x19')][_0xb253('0x4d')]})['catch'](function(){logger['error'](_0xb253('0x4e'));});}}return _0x3afb3e({'code':0xc8,'message':_0x520b11});}catch(_0x2cba39){logger[_0xb253('0x46')](_0x2cba39[_0xb253('0x45')]);return _0x56fafd(_0x7fbc95['error'](0x1f4,_0x2cba39));}}logger[_0xb253('0x46')](_0xb253('0x4f'));return _0x56fafd(_0x7fbc95[_0xb253('0x46')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x33783a){var _0xeabbac=this;return new Promise(function(_0x1a15ae,_0x1f66c3){if(_0x33783a['agent']&&_0x33783a['agent']['id']){try{if(_0xe4b96b['agents'][_0x33783a[_0xb253('0x47')]['id']]){_0xe4b96b[_0xb253('0x48')][_0x33783a['agent']['id']][_0xb253('0x49')]=![];_0xe4b96b[_0xb253('0x48')][_0x33783a['agent']['id']][_0xb253('0x4a')]=undefined;}return _0x1a15ae({'code':0xc8,'message':_0x33783a});}catch(_0x53762f){logger[_0xb253('0x46')](_0x53762f[_0xb253('0x45')]);return _0x1f66c3(_0xeabbac[_0xb253('0x46')](0x1f4,_0x53762f));}}logger[_0xb253('0x46')](_0xb253('0x4f'));return _0x1f66c3(_0xeabbac['error'](0x1f4,_0xb253('0x4f')));});},'AbandonInteraction':function(_0x366611){var _0x497d0a=this;return new Promise(function(_0x512a68,_0x267bb8){if(_0x366611[_0xb253('0x18')]&&_0x366611[_0xb253('0x1a')]&&_0x366611[_0xb253('0x1a')]['id']){try{var _0x1a4227=getId(_0x366611[_0xb253('0x18')],_0x366611[_0xb253('0x19')]?_0x366611[_0xb253('0x19')]['id']:0x0,_0x366611[_0xb253('0x1a')]?_0x366611[_0xb253('0x1a')]['id']:0x0);if(_0xe4b96b[_0xb253('0x17')][_0x1a4227]){_0xe4b96b[_0xb253('0x17')][_0x1a4227][_0xb253('0x41')](_0xb253('0x4b'));}return _0x512a68({'code':0xc8,'message':_0x366611});}catch(_0x3e5104){logger[_0xb253('0x46')](_0x3e5104[_0xb253('0x45')]);return _0x267bb8(_0x497d0a[_0xb253('0x46')](0x1f4,_0x3e5104));}}logger[_0xb253('0x46')](_0xb253('0x4f'));return _0x267bb8(_0x497d0a[_0xb253('0x46')](0x1f4,_0xb253('0x4f')));});},'AgentCapacity':function(_0x1b709c){var _0x2bf1a5=this;return new Promise(function(_0x20e9ba,_0x49e870){if(_0xe4b96b[_0xb253('0x48')][_0xb253('0x50')](_0x1b709c['id'])){for(var _0x17ca0c in _0x1b709c['capacity']){if(_0x1b709c[_0xb253('0x51')][_0xb253('0x50')](_0x17ca0c)){if(_0xe4b96b['agents'][_0x1b709c['id']][_0xb253('0x50')](_0x17ca0c+'CurrentCapacity')){_0xe4b96b[_0xb253('0x48')][_0x1b709c['id']][_0x17ca0c+_0xb253('0x52')]=parseInt(_0x1b709c[_0xb253('0x51')][_0x17ca0c],0xa);}}}_0xe4b96b[_0xb253('0x48')][_0x1b709c['id']][_0xb253('0x53')]();return _0x20e9ba({'code':0xc8,'message':_0xe4b96b[_0xb253('0x48')][_0x1b709c['id']]});}else{return _0x49e870(_0x2bf1a5[_0xb253('0x46')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x1588e4){return new Promise(function(_0xf465b9){var _0x42eee2=_[_0xb253('0x54')](_0xe4b96b[_0xb253('0x48')]);if(_0x1588e4&&_0x1588e4['id']){var _0x3f59f8=_[_0xb253('0x55')](_0x42eee2,function(_0x2697c7){return _0x2697c7['id']===_0x1588e4['id'];});_0xf465b9(_0x3f59f8);}else{_0xf465b9({'count':_0x42eee2[_0xb253('0x1e')],'rows':_0x42eee2});}});},'ChatQueues':function(){return new Promise(function(_0x4fe049){var _0x443380=[];for(var _0x29694a in _0xe4b96b[_0xb253('0x56')]){if(_0xe4b96b[_0xb253('0x56')][_0xb253('0x50')](_0x29694a)){var _0xd57260=_0xe4b96b[_0xb253('0x56')][_0x29694a];var _0x549e4c={'id':_0xd57260['id'],'available':_0xd57260['available'],'loggedIn':_0xd57260['loggedIn'],'name':_0xd57260['name'],'paused':_0xd57260[_0xb253('0x57')],'waiting':_0xd57260[_0xb253('0x58')]};_0x443380['push'](_0x549e4c);}}_0x4fe049({'count':_0x443380[_0xb253('0x1e')],'rows':_0x443380});});},'MailQueues':function(){return new Promise(function(_0x4f9210){var _0x240264=[];for(var _0x21ae98 in _0xe4b96b[_0xb253('0x59')]){if(_0xe4b96b[_0xb253('0x59')]['hasOwnProperty'](_0x21ae98)){var _0x562a78=_0xe4b96b[_0xb253('0x59')][_0x21ae98];var _0x557124={'id':_0x562a78['id'],'available':_0x562a78['available'],'loggedIn':_0x562a78['loggedIn'],'name':_0x562a78[_0xb253('0x5a')],'paused':_0x562a78[_0xb253('0x57')],'waiting':_0x562a78[_0xb253('0x58')]};_0x240264[_0xb253('0x25')](_0x557124);}}_0x4f9210({'count':_0x240264[_0xb253('0x1e')],'rows':_0x240264});});},'OpenchannelQueues':function(){return new Promise(function(_0x871c5a){var _0x5900d3=[];for(var _0x5b76ca in _0xe4b96b[_0xb253('0x5b')]){if(_0xe4b96b[_0xb253('0x5b')][_0xb253('0x50')](_0x5b76ca)){var _0x579c88=_0xe4b96b['openchannelQueues'][_0x5b76ca];var _0x2b1601={'id':_0x579c88['id'],'available':_0x579c88[_0xb253('0x5c')],'loggedIn':_0x579c88['loggedIn'],'name':_0x579c88[_0xb253('0x5a')],'paused':_0x579c88[_0xb253('0x57')],'waiting':_0x579c88['waiting']};_0x5900d3[_0xb253('0x25')](_0x2b1601);}}_0x871c5a({'count':_0x5900d3[_0xb253('0x1e')],'rows':_0x5900d3});});},'SmsQueues':function(){return new Promise(function(_0x415e5c){var _0x59d6cb=[];for(var _0x29462d in _0xe4b96b['smsQueues']){if(_0xe4b96b[_0xb253('0x5d')][_0xb253('0x50')](_0x29462d)){var _0x17a46b=_0xe4b96b['smsQueues'][_0x29462d];var _0x41468c={'id':_0x17a46b['id'],'available':_0x17a46b[_0xb253('0x5c')],'loggedIn':_0x17a46b[_0xb253('0x5e')],'name':_0x17a46b[_0xb253('0x5a')],'paused':_0x17a46b[_0xb253('0x57')],'waiting':_0x17a46b[_0xb253('0x58')]};_0x59d6cb['push'](_0x41468c);}}_0x415e5c({'count':_0x59d6cb[_0xb253('0x1e')],'rows':_0x59d6cb});});},'FaxQueues':function(){return new Promise(function(_0x283a30){var _0x17ccf8=[];for(var _0x403976 in _0xe4b96b[_0xb253('0x5f')]){if(_0xe4b96b[_0xb253('0x5f')][_0xb253('0x50')](_0x403976)){var _0x4a7fdb=_0xe4b96b[_0xb253('0x5f')][_0x403976];var _0x2e0eda={'id':_0x4a7fdb['id'],'available':_0x4a7fdb['available'],'loggedIn':_0x4a7fdb['loggedIn'],'name':_0x4a7fdb[_0xb253('0x5a')],'paused':_0x4a7fdb[_0xb253('0x57')],'waiting':_0x4a7fdb[_0xb253('0x58')]};_0x17ccf8['push'](_0x2e0eda);}}_0x283a30({'count':_0x17ccf8[_0xb253('0x1e')],'rows':_0x17ccf8});});},'WhatsappQueues':function(){return new Promise(function(_0x2cf170){var _0x195523=[];for(var _0x90e4dc in _0xe4b96b[_0xb253('0x60')]){if(_0xe4b96b[_0xb253('0x60')]['hasOwnProperty'](_0x90e4dc)){var _0x3b3a0b=_0xe4b96b[_0xb253('0x60')][_0x90e4dc];var _0x32559e={'id':_0x3b3a0b['id'],'available':_0x3b3a0b['available'],'loggedIn':_0x3b3a0b['loggedIn'],'name':_0x3b3a0b[_0xb253('0x5a')],'paused':_0x3b3a0b[_0xb253('0x57')],'waiting':_0x3b3a0b[_0xb253('0x58')]};_0x195523[_0xb253('0x25')](_0x32559e);}}_0x2cf170({'count':_0x195523[_0xb253('0x1e')],'rows':_0x195523});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x11e251){var _0x168fef=_[_0xb253('0x54')](_0xe4b96b[_0xb253('0x61')]);_0x11e251({'count':_0x168fef[_0xb253('0x1e')],'rows':_0x168fef});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x1fe1d1){var _0x1bb7d3=_['values'](_0xe4b96b[_0xb253('0x62')]);_0x1fe1d1({'count':_0x1bb7d3[_0xb253('0x1e')],'rows':_0x1bb7d3});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x5a25fc){var _0xd1ea79=_['values'](_0xe4b96b[_0xb253('0x63')]);_0x5a25fc({'count':_0xd1ea79[_0xb253('0x1e')],'rows':_0xd1ea79});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x4e7705){var _0x175cbf=_[_0xb253('0x54')](_0xe4b96b[_0xb253('0x64')]);_0x4e7705({'count':_0x175cbf['length'],'rows':_0x175cbf});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x267eaa){var _0x4a0fdd=_['values'](_0xe4b96b['faxQueuesWaitingInteractions']);_0x267eaa({'count':_0x4a0fdd[_0xb253('0x1e')],'rows':_0x4a0fdd});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0xe5f59c){var _0x4beaa2=_['values'](_0xe4b96b[_0xb253('0x65')]);_0xe5f59c({'count':_0x4beaa2[_0xb253('0x1e')],'rows':_0x4beaa2});});}};var _0x156c32=jayson['server'](_0x4bb04f)[_0xb253('0x66')]();_0x156c32['on'](_0xb253('0x46'),function(_0x29d03e){logger['error'](JSON[_0xb253('0x67')](_0x29d03e));return _0x353b8e(_0x29d03e);});_0x156c32[_0xb253('0x16')](0x232c,_0xb253('0x68'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x37ed21(_0xb253('0x69')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 4605618..d4ce2d4 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 _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 +var _0xca23=['then','error','message','catch','condition','rules','info','stop','push','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','bluebird','jayson/promise','../../../config/logger','http','request'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xca23,0xbb));var _0x3ca2=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xca23[_0x20589d];return _0x422de9;};'use strict';var util=require('util');var BPromise=require(_0x3ca2('0x0'));var jayson=require(_0x3ca2('0x1'));var _=require('lodash');var logger=require(_0x3ca2('0x2'))('routing');var client=jayson['client'][_0x3ca2('0x3')]({'port':0x232a});function request(_0x3107c9,_0x25ff18){return new BPromise(function(_0x55d8e4,_0x32fdf1){return client[_0x3ca2('0x4')](_0x3107c9,_0x25ff18)[_0x3ca2('0x5')](function(_0x3cb905){if(_0x3cb905[_0x3ca2('0x6')]){return _0x32fdf1(_0x3cb905[_0x3ca2('0x6')][_0x3ca2('0x7')]);}else{return _0x55d8e4(_0x3cb905['result']);}})[_0x3ca2('0x8')](function(_0x293378){return _0x32fdf1(_0x293378);});});}exports[_0x3ca2('0x9')]=function(_0x411bcd,_0x42641f,_0x323fcb){return function(_0x412c2e){if(_0x323fcb[_0x3ca2('0xa')]&&!_0x323fcb[_0x3ca2('0xa')][_0x411bcd]){logger[_0x3ca2('0xb')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x411bcd);return _0x412c2e[_0x3ca2('0xc')]();}var _0x4f9c80=[];for(var _0x41c993=0x0;_0x41c993<_0x42641f['length'];_0x41c993+=0x1){_0x4f9c80[_0x3ca2('0xd')](request('Command',{'command':util[_0x3ca2('0xe')](_0x3ca2('0xf'),_0x42641f[_0x41c993])})[_0x3ca2('0x5')](function(_0x43890c){return _0x43890c&&_0x43890c['message']&&_0x43890c['message'][_0x3ca2('0x10')](_0x3ca2('0x11'))>=0x0?!![]:![];})[_0x3ca2('0x8')](function(_0x3d6b75){logger['error'](_0x3ca2('0x12'),_0x411bcd,_0x42641f[_0x41c993]);}));}BPromise['all'](_0x4f9c80)[_0x3ca2('0x5')](function(_0x4018d7){var _0x4a9cd7=_[_0x3ca2('0x13')](_0x4018d7);logger[_0x3ca2('0xb')](_0x3ca2('0x14'),_0x411bcd,_0x42641f[_0x3ca2('0x15')](_0x3ca2('0x16')),_0x4a9cd7);_0x412c2e['when'](_0x4a9cd7);})[_0x3ca2('0x8')](function(_0x1926c3){console[_0x3ca2('0x17')](_0x1926c3);logger[_0x3ca2('0x6')](_0x3ca2('0x14'),_0x411bcd,_0x42641f[_0x3ca2('0x15')](_0x3ca2('0x16')),_0x1926c3['stack']);_0x412c2e[_0x3ca2('0xc')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index ddbe629..c75e9cf 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 _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 +var _0xbaf0=['includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','talktime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agent','[%s][agents][hangup]','util','./utils','info','format','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','agentcalledAt','now','connectedlinename','error','agentringnoanswer','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','push','forIn'];(function(_0x34342a,_0x3e16f5){var _0x427cdf=function(_0x6aafbd){while(--_0x6aafbd){_0x34342a['push'](_0x34342a['shift']());}};_0x427cdf(++_0x3e16f5);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var utils=require(_0x0baf('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1e212d,_0x263f79){utils[_0x0baf('0x2')](util[_0x0baf('0x3')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1e212d[_0x0baf('0x4')],_0x1e212d[_0x0baf('0x5')],_0x1e212d[_0x0baf('0x6')],_0x1e212d[_0x0baf('0x7')],_0x1e212d[_0x0baf('0x8')],_0x1e212d[_0x0baf('0x9')],_0x1e212d[_0x0baf('0xa')],_0x1e212d[_0x0baf('0xb')]));if(_0x1e212d[_0x0baf('0x6')]){utils['getVoiceQueueByName'](_0x1e212d[_0x0baf('0x6')])['then'](function(_0x4605c3){if(_0x4605c3){_0x1e212d[_0x0baf('0xc')]=_0x4605c3[_0x0baf('0xc')];_0x1e212d[_0x0baf('0xd')]=_0x1e212d[_0x0baf('0xe')]?_0x4605c3[_0x0baf('0xf')]:![];_0x1e212d[_0x0baf('0x10')]=_0x1e212d[_0x0baf('0xd')]?_0x4605c3[_0x0baf('0x11')]:0x0;}utils[_0x0baf('0x12')](_0x0baf('0x13'),_0x1e212d);});}else{utils['request']('CreateVoiceAgentReport',_0x1e212d);}if(_0x263f79){delete transfers[_0x1e212d[_0x0baf('0x4')]];}else{delete agents[_0x1e212d[_0x0baf('0x14')]];}}exports[_0x0baf('0x15')]=function(_0x13df17){try{utils['debug'](util[_0x0baf('0x3')]('[%s][agents][agentcalled]',_0x13df17[_0x0baf('0x4')]),_0x13df17);agents[_0x13df17[_0x0baf('0x14')]]=_0x13df17;agents[_0x13df17[_0x0baf('0x14')]][_0x0baf('0x16')]=utils[_0x0baf('0x17')]();agents[_0x13df17[_0x0baf('0x14')]]['lastevent']='called';agents[_0x13df17[_0x0baf('0x14')]][_0x0baf('0xa')]=null;agents[_0x13df17[_0x0baf('0x14')]][_0x0baf('0x18')]=null;utils[_0x0baf('0x2')](util[_0x0baf('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x13df17[_0x0baf('0x4')],agents[_0x13df17[_0x0baf('0x14')]][_0x0baf('0x7')],_0x13df17[_0x0baf('0x14')]));}catch(_0x47070d){utils[_0x0baf('0x19')](util['format']('[%s][agents][agentcalled]',_0x13df17[_0x0baf('0x4')]),_0x47070d);}};exports[_0x0baf('0x1a')]=function(_0x32e839){try{if(!_[_0x0baf('0x1b')](agents[_0x32e839[_0x0baf('0x14')]])){utils[_0x0baf('0x1c')](util[_0x0baf('0x3')](_0x0baf('0x1d'),_0x32e839[_0x0baf('0x4')]),_0x32e839);utils[_0x0baf('0x2')](util['format'](_0x0baf('0x1e'),_0x32e839['uniqueid'],agents[_0x32e839[_0x0baf('0x14')]]['membername'],_0x32e839['destuniqueid']));agents[_0x32e839[_0x0baf('0x14')]]['agentringnoanswer']=!![];agents[_0x32e839['destuniqueid']][_0x0baf('0x1f')]=utils[_0x0baf('0x17')]();agents[_0x32e839[_0x0baf('0x14')]][_0x0baf('0xb')]=_0x0baf('0x20');agents[_0x32e839['destuniqueid']][_0x0baf('0x21')]=_0x0baf('0x20');agents[_0x32e839[_0x0baf('0x14')]][_0x0baf('0x22')]=_0x32e839[_0x0baf('0x23')]?parseInt(_0x32e839[_0x0baf('0x23')])/0x3e8:0x0;agents[_0x32e839[_0x0baf('0x14')]]['talktime']=0x0;unanswered[_0x0baf('0x24')](_0x32e839[_0x0baf('0x14')]);}}catch(_0xcaf13d){utils[_0x0baf('0x19')](util['format'](_0x0baf('0x1d'),_0x32e839[_0x0baf('0x4')]),_0xcaf13d);}};exports['queuecallerabandon']=function(_0x44ec31){try{_[_0x0baf('0x25')](agents,function(_0x478ce8,_0xb4dbb1){if(_0x478ce8[_0x0baf('0x4')]==_0x44ec31[_0x0baf('0x4')]&&!_[_0x0baf('0x26')](unanswered,_0x478ce8['destuniqueid'])){utils[_0x0baf('0x1c')](util[_0x0baf('0x3')](_0x0baf('0x27'),_0x44ec31[_0x0baf('0x4')]),_0x44ec31);utils[_0x0baf('0x2')](util[_0x0baf('0x3')](_0x0baf('0x28'),_0x44ec31[_0x0baf('0x4')],_0x478ce8[_0x0baf('0x7')],_0x478ce8[_0x0baf('0x14')]));_0x478ce8[_0x0baf('0x1a')]=!![];_0x478ce8[_0x0baf('0x1f')]=utils[_0x0baf('0x17')]();_0x478ce8[_0x0baf('0xb')]='abandoned';_0x478ce8[_0x0baf('0x21')]='abandoned';_0x478ce8[_0x0baf('0x22')]=_0x44ec31[_0x0baf('0x22')];_0x478ce8[_0x0baf('0x29')]=0x0;writeDB(_0x478ce8);}});}catch(_0x3d65f2){utils['error'](util[_0x0baf('0x3')](_0x0baf('0x27'),_0x44ec31['uniqueid']),_0x3d65f2);}};exports[_0x0baf('0x2a')]=function(_0x2447c2){try{if(agents[_0x2447c2[_0x0baf('0x14')]]){utils[_0x0baf('0x1c')](util[_0x0baf('0x3')](_0x0baf('0x2b'),_0x2447c2[_0x0baf('0x4')]),_0x2447c2);utils[_0x0baf('0x2')](util['format'](_0x0baf('0x2c'),_0x2447c2[_0x0baf('0x4')],agents[_0x2447c2['destuniqueid']][_0x0baf('0x7')],_0x2447c2['destuniqueid']));agents[_0x2447c2['destuniqueid']][_0x0baf('0x2d')]=utils[_0x0baf('0x17')]();agents[_0x2447c2['destuniqueid']]['connectedlinenum']=_0x2447c2[_0x0baf('0xa')];agents[_0x2447c2[_0x0baf('0x14')]][_0x0baf('0x18')]=_0x2447c2[_0x0baf('0x18')];agents[_0x2447c2[_0x0baf('0x14')]][_0x0baf('0x22')]=_0x2447c2[_0x0baf('0x23')];agents[_0x2447c2[_0x0baf('0x14')]][_0x0baf('0xb')]=_0x0baf('0x2e');_[_0x0baf('0x25')](agents,function(_0x148540,_0x354cb1){if(_0x148540[_0x0baf('0x14')]!=_0x2447c2['destuniqueid']&&_0x148540[_0x0baf('0x4')]==_0x2447c2[_0x0baf('0x4')]){_0x148540['talktime']=0x0;_0x148540[_0x0baf('0x22')]=_0x2447c2[_0x0baf('0x23')];_0x148540[_0x0baf('0x1a')]=!![];_0x148540[_0x0baf('0x1f')]=utils[_0x0baf('0x17')]();_0x148540[_0x0baf('0xb')]='answered_elsewhere';_0x148540[_0x0baf('0x21')]=_0x0baf('0x2f');_0x148540['answeredelsewheredestinationuniqueid']=_0x2447c2[_0x0baf('0x14')];_0x148540[_0x0baf('0x30')]=_0x2447c2[_0x0baf('0x7')];writeDB(_0x148540);}});}}catch(_0x57903e){utils['error'](util[_0x0baf('0x3')](_0x0baf('0x2b'),_0x2447c2[_0x0baf('0x4')]),_0x57903e);}};exports[_0x0baf('0xe')]=function(_0x2b6d54){try{if(!_[_0x0baf('0x1b')](agents[_0x2b6d54[_0x0baf('0x14')]])){utils[_0x0baf('0x1c')](util[_0x0baf('0x3')](_0x0baf('0x31'),_0x2b6d54['uniqueid']),_0x2b6d54);utils[_0x0baf('0x2')](util[_0x0baf('0x3')](_0x0baf('0x32'),_0x2b6d54[_0x0baf('0x4')],agents[_0x2b6d54[_0x0baf('0x14')]]['membername'],_0x2b6d54[_0x0baf('0x14')]));agents[_0x2b6d54[_0x0baf('0x14')]][_0x0baf('0xe')]=!![];agents[_0x2b6d54[_0x0baf('0x14')]][_0x0baf('0x33')]=utils['now']();agents[_0x2b6d54[_0x0baf('0x14')]][_0x0baf('0x29')]=utils[_0x0baf('0x34')](agents[_0x2b6d54[_0x0baf('0x14')]][_0x0baf('0x33')],agents[_0x2b6d54[_0x0baf('0x14')]][_0x0baf('0x2d')]);agents[_0x2b6d54['destuniqueid']][_0x0baf('0x21')]=_0x2b6d54[_0x0baf('0x21')];agents[_0x2b6d54[_0x0baf('0x14')]]['lastevent']=_0x0baf('0x35');writeDB(agents[_0x2b6d54[_0x0baf('0x14')]]);}}catch(_0x10fa62){utils[_0x0baf('0x19')](util[_0x0baf('0x3')](_0x0baf('0x31'),_0x2b6d54[_0x0baf('0x4')]),_0x10fa62);}};exports['blindtransfer']=function(_0x22c451){try{if(!_[_0x0baf('0x1b')](agents[_0x22c451[_0x0baf('0x36')]])){utils[_0x0baf('0x1c')](util[_0x0baf('0x3')](_0x0baf('0x37'),_0x22c451[_0x0baf('0x4')]),_0x22c451);utils[_0x0baf('0x2')](util[_0x0baf('0x3')](_0x0baf('0x38'),_0x22c451[_0x0baf('0x4')],agents[_0x22c451['transfereruniqueid']]['membername'],agents[_0x22c451[_0x0baf('0x36')]][_0x0baf('0x4')]));agents[_0x22c451[_0x0baf('0x36')]][_0x0baf('0x39')]=!![];agents[_0x22c451[_0x0baf('0x36')]][_0x0baf('0x3a')]=_0x0baf('0x3b');agents[_0x22c451['transfereruniqueid']][_0x0baf('0x3c')]=_0x22c451[_0x0baf('0x3d')];agents[_0x22c451[_0x0baf('0x36')]][_0x0baf('0x3e')]=agents[_0x22c451[_0x0baf('0x36')]][_0x0baf('0x4')];}}catch(_0x5e1849){utils[_0x0baf('0x19')](util['format'](_0x0baf('0x37'),_0x22c451['uniqueid']),_0x5e1849);}};exports[_0x0baf('0x3f')]=function(_0x5eaeb2){try{utils[_0x0baf('0x1c')](util['format'](_0x0baf('0x40'),_0x5eaeb2[_0x0baf('0x41')]),_0x5eaeb2);if(_0x5eaeb2[_0x0baf('0x41')]==_0x5eaeb2[_0x0baf('0x42')]){if(!_[_0x0baf('0x1b')](agents[_0x5eaeb2['secondtransfereruniqueid']])){utils[_0x0baf('0x2')](util[_0x0baf('0x3')](_0x0baf('0x43'),_0x5eaeb2[_0x0baf('0x41')],agents[_0x5eaeb2[_0x0baf('0x44')]][_0x0baf('0x7')]));agents[_0x5eaeb2['secondtransfereruniqueid']][_0x0baf('0x39')]=!![];agents[_0x5eaeb2[_0x0baf('0x44')]][_0x0baf('0x3a')]=_0x0baf('0x45');agents[_0x5eaeb2[_0x0baf('0x44')]][_0x0baf('0x3c')]=_0x5eaeb2[_0x0baf('0x46')];agents[_0x5eaeb2['secondtransfereruniqueid']]['transferuniqueid']=_0x5eaeb2[_0x0baf('0x41')];}if(_0x5eaeb2[_0x0baf('0x47')]&&agents[_0x5eaeb2[_0x0baf('0x47')]]){agents[_0x5eaeb2[_0x0baf('0x47')]][_0x0baf('0x48')]=0x1;transfers[_0x5eaeb2[_0x0baf('0x47')]]=_[_0x0baf('0x49')](agents[_0x5eaeb2[_0x0baf('0x47')]]);transfers[_0x5eaeb2[_0x0baf('0x47')]]['calleridnum']=agents[_0x5eaeb2[_0x0baf('0x44')]][_0x0baf('0x9')];transfers[_0x5eaeb2[_0x0baf('0x47')]][_0x0baf('0x4a')]=agents[_0x5eaeb2[_0x0baf('0x44')]][_0x0baf('0x4a')];transfers[_0x5eaeb2[_0x0baf('0x47')]]['agentcalledAt']=utils[_0x0baf('0x17')]();transfers[_0x5eaeb2[_0x0baf('0x47')]][_0x0baf('0x2d')]=utils[_0x0baf('0x17')]();transfers[_0x5eaeb2[_0x0baf('0x47')]][_0x0baf('0x22')]=0x0;transfers[_0x5eaeb2[_0x0baf('0x47')]][_0x0baf('0x48')]=0x2;}}else if(_0x5eaeb2['secondtransfereruniqueid']==_0x5eaeb2[_0x0baf('0x4b')]){if(!_['isNil'](agents[_0x5eaeb2[_0x0baf('0x41')]])){utils['info'](util['format'](_0x0baf('0x43'),_0x5eaeb2['origtransfereruniqueid'],agents[_0x5eaeb2[_0x0baf('0x41')]][_0x0baf('0x7')]));agents[_0x5eaeb2['origtransfereruniqueid']][_0x0baf('0x39')]=!![];agents[_0x5eaeb2[_0x0baf('0x41')]][_0x0baf('0x3a')]='ATTENDED';agents[_0x5eaeb2['origtransfereruniqueid']][_0x0baf('0x3c')]=_0x5eaeb2[_0x0baf('0x4c')];agents[_0x5eaeb2[_0x0baf('0x41')]][_0x0baf('0x3e')]=_0x5eaeb2[_0x0baf('0x44')];}if(_0x5eaeb2['transfertargetuniqueid']&&agents[_0x5eaeb2[_0x0baf('0x4d')]]){agents[_0x5eaeb2['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x5eaeb2['transfertargetuniqueid']]=_[_0x0baf('0x49')](agents[_0x5eaeb2['transfertargetuniqueid']]);transfers[_0x5eaeb2['transfertargetuniqueid']][_0x0baf('0x9')]=agents[_0x5eaeb2[_0x0baf('0x41')]][_0x0baf('0x9')];transfers[_0x5eaeb2[_0x0baf('0x4d')]][_0x0baf('0x4a')]=agents[_0x5eaeb2[_0x0baf('0x41')]]['calleridname'];transfers[_0x5eaeb2[_0x0baf('0x4d')]][_0x0baf('0x16')]=utils[_0x0baf('0x17')]();transfers[_0x5eaeb2[_0x0baf('0x4d')]][_0x0baf('0x2d')]=utils[_0x0baf('0x17')]();transfers[_0x5eaeb2['transfertargetuniqueid']][_0x0baf('0x22')]=0x0;transfers[_0x5eaeb2[_0x0baf('0x4d')]][_0x0baf('0x48')]=0x2;}}}catch(_0x5d4053){utils[_0x0baf('0x19')](util[_0x0baf('0x3')](_0x0baf('0x40'),_0x5eaeb2[_0x0baf('0x41')]),_0x5d4053);}};exports[_0x0baf('0x4e')]=function(_0x27a959){try{utils[_0x0baf('0x1c')](util['format']('[%s][agents][hangup]',_0x27a959['uniqueid']),_0x27a959);if(agents[_0x27a959[_0x0baf('0x4')]]&&agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x21')]===_0x0baf('0x20')){if(_0x27a959[_0x0baf('0x4f')]==='21'){agents[_0x27a959[_0x0baf('0x4')]]['reason']='rejected';agents[_0x27a959[_0x0baf('0x4')]]['lastevent']=_0x0baf('0x50');}utils[_0x0baf('0x2')](util['format'](_0x0baf('0x51'),_0x27a959[_0x0baf('0x4')],agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x7')],agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x21')],agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0xb')]));writeDB(agents[_0x27a959[_0x0baf('0x4')]]);var _0x5ea0f3=unanswered['indexOf'](_0x27a959['uniqueid']);if(_0x5ea0f3>-0x1){unanswered['splice'](_0x5ea0f3,0x1);}}if(transfers[_0x27a959['uniqueid']]){transfers[_0x27a959[_0x0baf('0x4')]][_0x0baf('0xe')]=!![];transfers[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x33')]=utils['now']();transfers[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x29')]=utils['diffTime'](transfers[_0x27a959['uniqueid']][_0x0baf('0x33')],transfers[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x2d')]);transfers[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x21')]=_0x0baf('0x52');transfers[_0x27a959[_0x0baf('0x4')]][_0x0baf('0xb')]='complete';utils[_0x0baf('0x2')](util[_0x0baf('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x27a959[_0x0baf('0x4')],transfers[_0x27a959[_0x0baf('0x4')]]['membername'],transfers[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x21')],transfers[_0x27a959[_0x0baf('0x4')]][_0x0baf('0xb')]));writeDB(transfers[_0x27a959[_0x0baf('0x4')]],!![]);}if(agents[_0x27a959['uniqueid']]&&agents[_0x27a959['uniqueid']][_0x0baf('0x2d')]){agents[_0x27a959[_0x0baf('0x4')]]['agentcomplete']=!![];agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x33')]=utils[_0x0baf('0x17')]();agents[_0x27a959['uniqueid']][_0x0baf('0x29')]=utils[_0x0baf('0x34')](agents[_0x27a959[_0x0baf('0x4')]]['agentcompleteAt'],agents[_0x27a959[_0x0baf('0x4')]]['agentconnectAt']);agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x21')]=agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x39')]?_0x0baf('0x39'):'agent';agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0xb')]='complete';utils[_0x0baf('0x2')](util[_0x0baf('0x3')](_0x0baf('0x51'),_0x27a959[_0x0baf('0x4')],agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x7')],agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0x21')],agents[_0x27a959[_0x0baf('0x4')]][_0x0baf('0xb')]));writeDB(agents[_0x27a959[_0x0baf('0x4')]]);}}catch(_0x2c2f09){utils['error'](util['format'](_0x0baf('0x53'),_0x27a959[_0x0baf('0x4')]),_0x2c2f09);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 96c38dd..f533ef2 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 _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 +var _0x46a0=['toLowerCase','cdr','substring','lastIndexOf','includes','noop','set','gotoif','lastdata','lodash','./utils','NO\x20ANSWER','FAILED','ANSWERED','uniqueid','blinds','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','calleridnum','lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','request','recording','newchannel','debug','format','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','starttime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]','localtwolinkedid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','transfertargetchannel','origtransfererchannel','userfield','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','now','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x46a0,0xe3));var _0x046a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x46a0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x046a('0x0'));var util=require('util');var utils=require(_0x046a('0x1'));var transfers=require('./transfers.controller');var dispositions=[_0x046a('0x2'),_0x046a('0x3'),_0x046a('0x3'),'NO\x20ANSWER',_0x046a('0x2'),_0x046a('0x2'),_0x046a('0x4'),'BUSY','FAILED',_0x046a('0x3'),_0x046a('0x3')];var channels={};function writeDB(_0x6e3311){var _0x1fd243;if(transfers['blinds'][_0x6e3311[_0x046a('0x5')]]){_0x1fd243=_0x6e3311[_0x046a('0x5')];_0x6e3311[_0x046a('0x5')]=transfers[_0x046a('0x6')][_0x6e3311[_0x046a('0x5')]]['transfereeuniqueid'];}utils['info'](util['format'](_0x046a('0x7'),_0x6e3311[_0x046a('0x5')],_0x6e3311[_0x046a('0x8')],_0x6e3311[_0x046a('0x9')],_0x6e3311[_0x046a('0xa')],_0x6e3311['interface'],_0x6e3311[_0x046a('0xb')],_0x6e3311['connectedlinenum'],_0x6e3311[_0x046a('0xc')]));if(_0x6e3311[_0x046a('0xd')]){utils[_0x046a('0xe')](_0x6e3311['accountcode'])[_0x046a('0xf')](function(_0x35221f){if(_0x35221f){_0x6e3311[_0x046a('0x10')]=_0x35221f['id'];}utils['request'](_0x046a('0x11'),_0x6e3311);});}else{utils[_0x046a('0x12')](_0x046a('0x11'),_0x6e3311);}if(channels[_0x6e3311[_0x046a('0x5')]]){delete channels[_0x6e3311[_0x046a('0x5')]];}else if(_0x1fd243&&channels[_0x1fd243]){if(!transfers[_0x046a('0x6')][_0x1fd243][_0x046a('0x13')])delete transfers['blinds'][_0x1fd243];delete channels[_0x1fd243];}}exports[_0x046a('0x14')]=function(_0x308658){try{utils[_0x046a('0x15')](util[_0x046a('0x16')](_0x046a('0x17'),_0x308658[_0x046a('0x5')]),_0x308658);if(_0x308658['uniqueid']==_0x308658[_0x046a('0x18')]&&_0x308658[_0x046a('0x8')]!=_0x046a('0x19')){utils[_0x046a('0x1a')](util[_0x046a('0x16')](_0x046a('0x1b'),_0x308658[_0x046a('0x5')],_0x308658[_0x046a('0x1c')],_0x308658['exten']));channels[_0x308658['uniqueid']]={'uniqueid':_0x308658[_0x046a('0x5')],'accountcode':_0x308658['accountcode'],'source':_0x308658[_0x046a('0xb')],'destination':_0x308658[_0x046a('0x1d')],'destinationcontext':_0x308658[_0x046a('0x1c')],'channel':_0x308658[_0x046a('0x8')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x046a('0x2'),'amaflags':'DOCUMENTATION'};}}catch(_0x33200b){utils[_0x046a('0x1e')](util[_0x046a('0x16')](_0x046a('0x17'),_0x308658['uniqueid']),_0x33200b);}};exports[_0x046a('0x1f')]=function(_0x3181d6){try{utils['debug'](util[_0x046a('0x16')](_0x046a('0x20'),_0x3181d6[_0x046a('0x5')]),_0x3181d6);if(!_[_0x046a('0x21')](channels[_0x3181d6[_0x046a('0x5')]])&&_0x3181d6[_0x046a('0x22')]==0x6){utils[_0x046a('0x1a')](util['format'](_0x046a('0x23'),_0x3181d6['uniqueid'],_0x3181d6[_0x046a('0x1c')],_0x3181d6[_0x046a('0x8')]));if(_[_0x046a('0x21')](channels[_0x3181d6[_0x046a('0x5')]][_0x046a('0x24')])){channels[_0x3181d6[_0x046a('0x5')]][_0x046a('0x24')]=utils['now']();}}else if(!_['isNil'](channels[_0x3181d6['linkedid']])&&_0x3181d6[_0x046a('0x22')]==0x6&&_0x3181d6[_0x046a('0x1c')]!=_0x046a('0x25')){utils[_0x046a('0x1a')](util[_0x046a('0x16')](_0x046a('0x26'),_0x3181d6[_0x046a('0x5')],_0x3181d6[_0x046a('0x18')],_0x3181d6[_0x046a('0x1c')],_0x3181d6[_0x046a('0x8')]));channels[_0x3181d6['linkedid']]['accountcode']=_0x3181d6[_0x046a('0xd')];channels[_0x3181d6[_0x046a('0x18')]][_0x046a('0x27')]=_0x3181d6[_0x046a('0x8')];if(_['isNil'](channels[_0x3181d6[_0x046a('0x18')]]['answertime'])){channels[_0x3181d6[_0x046a('0x18')]][_0x046a('0x28')]=utils['now']();}channels[_0x3181d6[_0x046a('0x18')]][_0x046a('0x29')]=dispositions[_[_0x046a('0x2a')](_0x3181d6[_0x046a('0x22')])]||_0x046a('0x4');}}catch(_0x992393){utils[_0x046a('0x1e')](util['format'](_0x046a('0x20'),_0x3181d6[_0x046a('0x5')]),_0x992393);}};exports[_0x046a('0x2b')]=function(_0x410055){try{if(!_[_0x046a('0x21')](channels[_0x410055['uniqueid']])){utils[_0x046a('0x15')](util['format'](_0x046a('0x2c'),_0x410055[_0x046a('0x5')]),_0x410055);if(_[_0x046a('0x21')](channels[_0x410055[_0x046a('0x5')]][_0x046a('0x2d')])){channels[_0x410055[_0x046a('0x5')]][_0x046a('0x2d')]=_0x410055[_0x046a('0x2e')]+'\x20<'+_0x410055['calleridnum']+'>';}utils['info'](util['format'](_0x046a('0x2f'),_0x410055[_0x046a('0x5')],channels[_0x410055[_0x046a('0x5')]]['callerid'],_0x410055[_0x046a('0x30')]));channels[_0x410055[_0x046a('0x5')]]['endtime']=utils['now']();channels[_0x410055[_0x046a('0x5')]][_0x046a('0x31')]=utils[_0x046a('0x32')](channels[_0x410055[_0x046a('0x5')]]['endtime'],channels[_0x410055[_0x046a('0x5')]][_0x046a('0x33')]);channels[_0x410055[_0x046a('0x5')]][_0x046a('0x34')]=channels[_0x410055[_0x046a('0x5')]][_0x046a('0x28')]?utils[_0x046a('0x32')](channels[_0x410055[_0x046a('0x5')]]['endtime'],channels[_0x410055[_0x046a('0x5')]][_0x046a('0x28')]):0x0;writeDB(channels[_0x410055['uniqueid']]);}}catch(_0x55cf87){utils[_0x046a('0x1e')](util[_0x046a('0x16')](_0x046a('0x2c'),_0x410055[_0x046a('0x5')]),_0x55cf87);}};exports[_0x046a('0x35')]=function(_0x78d294){try{if(!_[_0x046a('0x21')](channels[_0x78d294['localtwolinkedid']])){utils[_0x046a('0x15')](util['format'](_0x046a('0x36'),_0x78d294['origtransfereruniqueid']),_0x78d294);if(channels[_0x78d294[_0x046a('0x37')]][_0x046a('0x8')]==_0x78d294['transfereechannel']){utils['info'](util[_0x046a('0x16')](_0x046a('0x38'),_0x78d294[_0x046a('0x39')],_0x78d294['localtwolinkedid'],_0x78d294[_0x046a('0x3a')]));channels[_0x78d294[_0x046a('0x37')]][_0x046a('0x27')]=_0x78d294[_0x046a('0x3a')];channels[_0x78d294[_0x046a('0x37')]]['userfield']='_attended';}else if(channels[_0x78d294[_0x046a('0x37')]][_0x046a('0x8')]=_0x78d294[_0x046a('0x3b')]){utils[_0x046a('0x1a')](util['format'](_0x046a('0x38'),_0x78d294[_0x046a('0x39')],_0x78d294[_0x046a('0x37')],_0x78d294['origtransfererchannel']));channels[_0x78d294[_0x046a('0x37')]][_0x046a('0x27')]=_0x78d294[_0x046a('0x3c')];channels[_0x78d294[_0x046a('0x37')]][_0x046a('0x3d')]=_0x046a('0x3e');}}}catch(_0x1b9ff3){utils[_0x046a('0x1e')](util[_0x046a('0x16')](_0x046a('0x36'),_0x78d294[_0x046a('0x39')]),_0x1b9ff3);}};exports[_0x046a('0x3f')]=function(_0x24b458){try{if(!_[_0x046a('0x21')](channels[_0x24b458[_0x046a('0x5')]])){utils[_0x046a('0x15')](util[_0x046a('0x16')](_0x046a('0x40'),_0x24b458[_0x046a('0x5')]),_0x24b458);channels[_0x24b458[_0x046a('0x5')]][_0x046a('0x41')]=utils[_0x046a('0x42')]();utils['info'](util[_0x046a('0x16')](_0x046a('0x43'),_0x24b458['uniqueid'],channels[_0x24b458[_0x046a('0x5')]]['musiconholdstartAt']));}}catch(_0xb2add8){utils['error'](util[_0x046a('0x16')](_0x046a('0x40'),_0x24b458[_0x046a('0x5')]),_0xb2add8);}};exports[_0x046a('0x44')]=function(_0x23da87){try{if(!_['isNil'](channels[_0x23da87[_0x046a('0x5')]])){utils['debug'](util['format'](_0x046a('0x45'),_0x23da87[_0x046a('0x5')]),_0x23da87);if(!_[_0x046a('0x21')](channels[_0x23da87[_0x046a('0x5')]][_0x046a('0x41')])){channels[_0x23da87[_0x046a('0x5')]]['mohtime']+=utils[_0x046a('0x32')](utils[_0x046a('0x42')](),channels[_0x23da87['uniqueid']][_0x046a('0x41')]);utils['info'](util[_0x046a('0x16')](_0x046a('0x46'),_0x23da87[_0x046a('0x5')],channels[_0x23da87[_0x046a('0x5')]][_0x046a('0x47')]));delete channels[_0x23da87[_0x046a('0x5')]]['musiconholdstartAt'];}}}catch(_0x23a7ff){utils[_0x046a('0x1e')](util[_0x046a('0x16')](_0x046a('0x45'),_0x23da87['uniqueid']),_0x23a7ff);}};exports['varset']=function(_0x172a50){try{if(!_[_0x046a('0x21')](channels[_0x172a50[_0x046a('0x5')]])){utils['debug'](util[_0x046a('0x16')](_0x046a('0x48'),_0x172a50[_0x046a('0x5')]),_0x172a50);if(!_[_0x046a('0x21')](_0x172a50[_0x046a('0x49')][_0x046a('0x4a')])){utils['info'](util['format'](_0x046a('0x4b'),_0x172a50[_0x046a('0x5')],_0x172a50[_0x046a('0x4c')]));channels[_0x172a50[_0x046a('0x5')]]['source']=_0x172a50[_0x046a('0x4c')];}if(!_[_0x046a('0x21')](_0x172a50['variable'][_0x046a('0x4d')])){utils[_0x046a('0x1a')](util['format'](_0x046a('0x4e'),_0x172a50[_0x046a('0x5')],_0x172a50['value']));channels[_0x172a50['uniqueid']][_0x046a('0x4f')]=_0x172a50[_0x046a('0x4c')];channels[_0x172a50['uniqueid']][_0x046a('0x2d')]='\x22'+_0x172a50['value']+_0x046a('0x50')+_0x172a50[_0x046a('0x4c')]+'>';}if(!_['isNil'](_0x172a50[_0x046a('0x49')][_0x046a('0x51')])||!_[_0x046a('0x21')](_0x172a50['variable'][_0x046a('0x52')])){utils[_0x046a('0x1a')](util[_0x046a('0x16')](_0x046a('0x53'),_0x172a50[_0x046a('0x5')],!_[_0x046a('0x21')](_0x172a50[_0x046a('0x49')][_0x046a('0x51')])?_0x046a('0x51'):_0x046a('0x52'),_0x172a50[_0x046a('0x4c')]));channels[_0x172a50[_0x046a('0x5')]][_0x046a('0x2d')]=_0x172a50['value'];}if(!_['isNil'](_0x172a50[_0x046a('0x49')][_0x046a('0x54')])||!_['isNil'](_0x172a50[_0x046a('0x49')][_0x046a('0x55')])){utils['info'](util[_0x046a('0x16')](_0x046a('0x53'),_0x172a50[_0x046a('0x5')],!_[_0x046a('0x21')](_0x172a50['variable'][_0x046a('0x54')])?_0x046a('0x54'):'xmcs-queue',_0x172a50['value']));channels[_0x172a50[_0x046a('0x5')]][_0x046a('0x56')]='Queue';channels[_0x172a50[_0x046a('0x5')]]['lastdata']=_0x172a50[_0x046a('0x4c')];channels[_0x172a50[_0x046a('0x5')]][_0x046a('0x9')]=!![];}if(!_[_0x046a('0x21')](_0x172a50[_0x046a('0x49')][_0x046a('0x57')])){utils['info'](util[_0x046a('0x16')](_0x046a('0x58'),_0x172a50[_0x046a('0x5')],_0x172a50[_0x046a('0x4c')]));channels[_0x172a50[_0x046a('0x5')]][_0x046a('0x59')]=_0x172a50[_0x046a('0x4c')];}if(!_[_0x046a('0x21')](_0x172a50[_0x046a('0x49')][_0x046a('0x5a')])){utils[_0x046a('0x1a')](util[_0x046a('0x16')](_0x046a('0x5b'),_0x172a50[_0x046a('0x5')],_0x172a50[_0x046a('0x4c')]));channels[_0x172a50[_0x046a('0x5')]]['type']=_0x172a50[_0x046a('0x4c')];}if(!_[_0x046a('0x21')](_0x172a50[_0x046a('0x49')]['outboundrouteid'])){utils['info'](util['format'](_0x046a('0x5c'),_0x172a50[_0x046a('0x5')],_0x172a50['value']));channels[_0x172a50[_0x046a('0x5')]][_0x046a('0x5d')]=_0x172a50['value'];}if(!_[_0x046a('0x21')](_0x172a50['variable'][_0x046a('0x5e')])){utils[_0x046a('0x1a')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x172a50['uniqueid'],_0x172a50[_0x046a('0x4c')]));channels[_0x172a50[_0x046a('0x5')]][_0x046a('0x5e')]=_0x172a50['value'];}}}catch(_0x111672){utils['error'](util[_0x046a('0x16')](_0x046a('0x48'),_0x172a50[_0x046a('0x5')]),_0x111672);}};exports['newexten']=function(_0x309b96){try{if(!_[_0x046a('0x21')](channels[_0x309b96[_0x046a('0x5')]])){utils[_0x046a('0x15')](util[_0x046a('0x16')](_0x046a('0x5f'),_0x309b96[_0x046a('0x5')]),_0x309b96);utils['info'](util[_0x046a('0x16')](_0x046a('0x60'),_0x309b96[_0x046a('0x5')],_0x309b96[_0x046a('0x61')],_0x309b96[_0x046a('0x62')]));if(_0x309b96['application']['toLowerCase']()=='set'&&_[_0x046a('0x63')](_0x309b96[_0x046a('0x62')][_0x046a('0x64')](),_0x046a('0x65'))){var _0x3e857f=_0x309b96['appdata']['split']('=');var _0x190da4=_0x3e857f[0x0][_0x046a('0x66')](_0x3e857f[0x0][_0x046a('0x67')]('(')+0x1,_0x3e857f[0x0][_0x046a('0x67')](')'));var _0x3f5c26=_0x3e857f[0x1];channels[_0x309b96[_0x046a('0x5')]][_0x190da4]=_0x3f5c26;}if(!_[_0x046a('0x68')]([_0x046a('0x2b'),_0x046a('0x69'),'execif',_0x046a('0x6a'),_0x046a('0x6b')],_0x309b96[_0x046a('0x61')]['toLowerCase']())){channels[_0x309b96[_0x046a('0x5')]][_0x046a('0x56')]=_0x309b96[_0x046a('0x61')];channels[_0x309b96['uniqueid']][_0x046a('0x6c')]=_0x309b96[_0x046a('0x62')];}}}catch(_0x180160){utils[_0x046a('0x1e')](util[_0x046a('0x16')](_0x046a('0x5f'),_0x309b96['uniqueid']),_0x180160);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index ce165b4..e5d6f83 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 _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 +var _0x1b3d=['shutdown','[core]\x20shutdown','fullybooted','error','[core]\x20error','close','managerevent','./utils','info','[core]\x20connected'];(function(_0x2962d5,_0x38deda){var _0x273406=function(_0x3e0775){while(--_0x3e0775){_0x2962d5['push'](_0x2962d5['shift']());}};_0x273406(++_0x38deda);}(_0x1b3d,0xc5));var _0xd1b3=function(_0x5231f9,_0x14bbe9){_0x5231f9=_0x5231f9-0x0;var _0x3eae55=_0x1b3d[_0x5231f9];return _0x3eae55;};'use strict';var utils=require(_0xd1b3('0x0'));exports['connect']=function(){utils[_0xd1b3('0x1')](_0xd1b3('0x2'));};exports[_0xd1b3('0x3')]=function(){utils[_0xd1b3('0x1')](_0xd1b3('0x4'));};exports[_0xd1b3('0x5')]=function(){utils[_0xd1b3('0x1')]('[core]\x20fullybooted');};exports[_0xd1b3('0x6')]=function(_0x1d3a99){utils[_0xd1b3('0x6')](_0xd1b3('0x7'),_0x1d3a99);};exports[_0xd1b3('0x8')]=function(){utils[_0xd1b3('0x1')]('[core]\x20close');};exports[_0xd1b3('0x9')]=function(_0x78f290){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index f193375..4a45a30 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 _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 +var _0xf2de=['set','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','cause-txt','complete','duration','endtime','holdtime','diffTime','util','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','dialstatus','request','newexten','debug','format','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata'];(function(_0x1de64d,_0x458b9e){var _0x548350=function(_0x4daf40){while(--_0x4daf40){_0x1de64d['push'](_0x1de64d['shift']());}};_0x548350(++_0x458b9e);}(_0xf2de,0x1db));var _0xef2d=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xf2de[_0x618414];return _0x21c19a;};'use strict';var _=require('lodash');var util=require(_0xef2d('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x34d8d4){utils['info'](util['format'](_0xef2d('0x1'),_0x34d8d4[_0xef2d('0x2')],_0x34d8d4[_0xef2d('0x3')],_0x34d8d4[_0xef2d('0x4')],_0x34d8d4['calleridnum'],_0x34d8d4['connectedlinenum'],_0x34d8d4[_0xef2d('0x5')]));utils[_0xef2d('0x6')]('CreateVoiceDialReport',_0x34d8d4);delete dials[_0x34d8d4[_0xef2d('0x2')]];}exports[_0xef2d('0x7')]=function(_0x35ea09){try{utils[_0xef2d('0x8')](util[_0xef2d('0x9')](_0xef2d('0xa'),_0x35ea09[_0xef2d('0x2')]),_0x35ea09);utils[_0xef2d('0xb')](util['format'](_0xef2d('0xc'),_0x35ea09[_0xef2d('0x2')],_0x35ea09[_0xef2d('0xd')],_0x35ea09[_0xef2d('0xe')]));if(_0x35ea09[_0xef2d('0xd')]['toLowerCase']()==_0xef2d('0xf')&&_['startsWith'](_0x35ea09['appdata']['toLowerCase'](),_0xef2d('0x10'))){var _0x31d175=_0x35ea09['appdata'][_0xef2d('0x11')]('=');dials[_0x35ea09[_0xef2d('0x2')]]={'routeId':_0x31d175[0x1]};}}catch(_0x5f0b92){utils[_0xef2d('0x12')](util[_0xef2d('0x9')](_0xef2d('0xa'),_0x35ea09[_0xef2d('0x2')]),_0x5f0b92);}};exports[_0xef2d('0x13')]=function(_0x41a5b8){try{utils[_0xef2d('0x8')](util[_0xef2d('0x9')](_0xef2d('0x14'),_0x41a5b8['uniqueid']),_0x41a5b8);if(!_[_0xef2d('0x15')](_0x41a5b8[_0xef2d('0x16')]['outboundrouteid'])){utils[_0xef2d('0xb')](util[_0xef2d('0x9')](_0xef2d('0x17'),_0x41a5b8[_0xef2d('0x2')],_0x41a5b8[_0xef2d('0x18')]));dials[_0x41a5b8[_0xef2d('0x2')]]={'routeId':_0x41a5b8[_0xef2d('0x18')]};}}catch(_0x340a91){utils[_0xef2d('0x12')](util[_0xef2d('0x9')]('[%s][dials][varset]',_0x41a5b8[_0xef2d('0x2')]),_0x340a91);}};exports[_0xef2d('0x19')]=function(_0x263956){try{if(!_['isNil'](dials[_0x263956['uniqueid']])){utils[_0xef2d('0x8')](util[_0xef2d('0x9')]('[%s][dials][dialbegin]',_0x263956[_0xef2d('0x2')]),_0x263956);dials[_0x263956[_0xef2d('0x2')]]=_[_0xef2d('0x1a')](dials[_0x263956[_0xef2d('0x2')]],_0x263956);dials[_0x263956['uniqueid']][_0xef2d('0x1b')]=utils[_0xef2d('0x1c')]();dials[_0x263956[_0xef2d('0x2')]][_0xef2d('0x1d')]=_0xef2d('0x1e');utils[_0xef2d('0xb')](util['format'](_0xef2d('0x1f'),_0x263956['uniqueid'],dials[_0x263956[_0xef2d('0x2')]][_0xef2d('0x1b')]));}}catch(_0x59be1d){utils[_0xef2d('0x12')](util[_0xef2d('0x9')](_0xef2d('0x20'),_0x263956[_0xef2d('0x2')]),_0x59be1d);}};exports[_0xef2d('0x21')]=function(_0x532042){try{if(!_[_0xef2d('0x15')](dials[_0x532042[_0xef2d('0x2')]])){utils['debug'](util[_0xef2d('0x9')]('[%s][dials][dialend]',_0x532042[_0xef2d('0x2')]),_0x532042);dials[_0x532042['uniqueid']][_0xef2d('0x5')]=_0x532042[_0xef2d('0x5')];if(_0x532042['dialstatus']==_0xef2d('0x22')){dials[_0x532042[_0xef2d('0x2')]]=_[_0xef2d('0x1a')](dials[_0x532042['uniqueid']],_0x532042);dials[_0x532042[_0xef2d('0x2')]][_0xef2d('0x23')]=utils[_0xef2d('0x1c')]();dials[_0x532042['uniqueid']]['lastevent']=_0xef2d('0x24');utils[_0xef2d('0xb')](util[_0xef2d('0x9')](_0xef2d('0x25'),_0x532042['uniqueid'],_0x532042[_0xef2d('0x5')],dials[_0x532042[_0xef2d('0x2')]][_0xef2d('0x23')]));}else{utils['info'](util[_0xef2d('0x9')](_0xef2d('0x26'),_0x532042[_0xef2d('0x2')],_0x532042['dialstatus']));}}}catch(_0x312ee8){utils[_0xef2d('0x12')](util[_0xef2d('0x9')]('[%s][dials][dialend]',_0x532042['uniqueid']),_0x312ee8);}};exports['hangup']=function(_0x42c493){try{if(!_[_0xef2d('0x15')](dials[_0x42c493[_0xef2d('0x2')]])){utils['debug'](util['format'](_0xef2d('0x27'),_0x42c493[_0xef2d('0x2')]),_0x42c493);utils[_0xef2d('0xb')](util[_0xef2d('0x9')](_0xef2d('0x28'),_0x42c493[_0xef2d('0x2')],_0x42c493[_0xef2d('0x29')],_0x42c493[_0xef2d('0x2a')],_0x42c493[_0xef2d('0x2b')]));dials[_0x42c493[_0xef2d('0x2')]]=_['assign'](dials[_0x42c493['uniqueid']],{'endtime':utils[_0xef2d('0x1c')](),'lastevent':_0xef2d('0x2c')});dials[_0x42c493['uniqueid']][_0xef2d('0x2d')]=utils['diffTime'](dials[_0x42c493['uniqueid']][_0xef2d('0x2e')],dials[_0x42c493[_0xef2d('0x2')]]['starttime']);dials[_0x42c493[_0xef2d('0x2')]][_0xef2d('0x2f')]=utils[_0xef2d('0x30')](dials[_0x42c493[_0xef2d('0x2')]][_0xef2d('0x23')]||dials[_0x42c493['uniqueid']][_0xef2d('0x2e')],dials[_0x42c493[_0xef2d('0x2')]]['starttime']);dials[_0x42c493[_0xef2d('0x2')]]['billableseconds']=dials[_0x42c493['uniqueid']][_0xef2d('0x23')]?utils[_0xef2d('0x30')](dials[_0x42c493[_0xef2d('0x2')]][_0xef2d('0x2e')],dials[_0x42c493['uniqueid']][_0xef2d('0x23')]):0x0;writeDB(dials[_0x42c493['uniqueid']]);}}catch(_0x1fb8f1){utils['error'](util[_0xef2d('0x9')]('[%s][dials][hangup]',_0x42c493['uniqueid']),_0x1fb8f1);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 54daa94..a062164 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 _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 +var _0x1992=['agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','util','xdr','disabled','env','production','local','asterisk','username','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','uniqueid','agentconnect','[%s][index][agentconnect]'];(function(_0x1280cc,_0x29172f){var _0x409fca=function(_0x44e19b){while(--_0x44e19b){_0x1280cc['push'](_0x1280cc['shift']());}};_0x409fca(++_0x29172f);}(_0x1992,0x1ca));var _0x2199=function(_0x17f579,_0x35ec3c){_0x17f579=_0x17f579-0x0;var _0x8c949b=_0x1992[_0x17f579];return _0x8c949b;};var AsteriskManager=require('asterisk-manager');var config=require(_0x2199('0x0'));var utils=require(_0x2199('0x1'));var util=require(_0x2199('0x2'));var isXDREnabled=config[_0x2199('0x3')]&&config[_0x2199('0x3')][_0x2199('0x4')]?!config['xdr'][_0x2199('0x4')]:!![];var isProduction=config[_0x2199('0x5')]===_0x2199('0x6')||![];var isLocalAsterisk=config[_0x2199('0x3')]&&config[_0x2199('0x3')][_0x2199('0x7')]===!![]||![];var ami=new AsteriskManager(config['asterisk']['port'],config[_0x2199('0x8')]['ip'],config[_0x2199('0x8')][_0x2199('0x9')],config[_0x2199('0x8')]['password'],!![]);ami[_0x2199('0xa')]();if(!isXDREnabled){utils[_0x2199('0xb')](_0x2199('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0x2199('0xd'));}else{var agents=require(_0x2199('0xe'));var calls=require(_0x2199('0xf'));var queues=require(_0x2199('0x10'));var recordings=require('./recordings.controller');var members=require(_0x2199('0x11'));var dials=require(_0x2199('0x12'));var transfers=require(_0x2199('0x13'));var core=require(_0x2199('0x14'));ami['on'](_0x2199('0x15'),core[_0x2199('0x15')]);ami['on'](_0x2199('0x16'),core['shutdown']);ami['on'](_0x2199('0x17'),core[_0x2199('0x17')]);ami['on'](_0x2199('0x18'),core[_0x2199('0x18')]);ami['on']('close',core[_0x2199('0x19')]);ami['on'](_0x2199('0x1a'),core[_0x2199('0x1a')]);ami['on'](_0x2199('0x1b'),function(_0x41233c){try{utils[_0x2199('0x1c')](util[_0x2199('0x1d')](_0x2199('0x1e'),_0x41233c['device']),_0x41233c);members[_0x2199('0x1b')](_0x41233c);}catch(_0x2ccfcd){utils['error'](util[_0x2199('0x1d')](_0x2199('0x1e'),_0x41233c[_0x2199('0x1f')]),_0x2ccfcd);}});ami['on'](_0x2199('0x20'),function(_0x396032){try{utils[_0x2199('0x1c')](util[_0x2199('0x1d')](_0x2199('0x21'),_0x396032['uniqueid']),_0x396032);agents[_0x2199('0x20')](_0x396032);}catch(_0x18a6a7){utils[_0x2199('0x18')](util[_0x2199('0x1d')](_0x2199('0x21'),_0x396032['uniqueid']),_0x18a6a7);}});ami['on'](_0x2199('0x22'),function(_0x510282){try{utils['debug'](util['format'](_0x2199('0x23'),_0x510282['uniqueid']),_0x510282);agents[_0x2199('0x22')](_0x510282);}catch(_0x4d7b4e){utils[_0x2199('0x18')](util[_0x2199('0x1d')](_0x2199('0x23'),_0x510282[_0x2199('0x24')]),_0x4d7b4e);}});ami['on'](_0x2199('0x25'),function(_0x5b62a1){try{utils['debug'](util[_0x2199('0x1d')](_0x2199('0x26'),_0x5b62a1['uniqueid']),_0x5b62a1);agents['agentconnect'](_0x5b62a1);queues[_0x2199('0x25')](_0x5b62a1);}catch(_0x40cd11){utils[_0x2199('0x18')](util[_0x2199('0x1d')](_0x2199('0x26'),_0x5b62a1['uniqueid']),_0x40cd11);}});ami['on'](_0x2199('0x27'),function(_0x1e7ac9){try{utils[_0x2199('0x1c')](util[_0x2199('0x1d')](_0x2199('0x28'),_0x1e7ac9[_0x2199('0x24')]),_0x1e7ac9);agents[_0x2199('0x27')](_0x1e7ac9);queues[_0x2199('0x27')](_0x1e7ac9);members['agentcomplete'](_0x1e7ac9);}catch(_0x5268c1){utils['error'](util[_0x2199('0x1d')]('[%s][index][agentcomplete]',_0x1e7ac9[_0x2199('0x24')]),_0x5268c1);}});ami['on'](_0x2199('0x29'),function(_0x539cba){try{utils[_0x2199('0x1c')](util[_0x2199('0x1d')](_0x2199('0x2a'),_0x539cba[_0x2199('0x24')]),_0x539cba);agents['queuecallerabandon'](_0x539cba);queues[_0x2199('0x29')](_0x539cba);}catch(_0x15a9ce){utils['error'](util[_0x2199('0x1d')]('[%s][index][queuecallerabandon]',_0x539cba[_0x2199('0x24')]),_0x15a9ce);}});ami['on'](_0x2199('0x2b'),function(_0x3ca3ec){try{utils[_0x2199('0x1c')](util[_0x2199('0x1d')](_0x2199('0x2c'),_0x3ca3ec[_0x2199('0x24')]),_0x3ca3ec);queues[_0x2199('0x2b')](_0x3ca3ec);recordings[_0x2199('0x2b')](_0x3ca3ec);}catch(_0x25367c){utils[_0x2199('0x18')](util[_0x2199('0x1d')](_0x2199('0x2c'),_0x3ca3ec['uniqueid']),_0x25367c);}});ami['on'](_0x2199('0x2d'),function(_0x33c05e){try{utils[_0x2199('0x1c')](util[_0x2199('0x1d')]('[%s][index][queuecallerleave]',_0x33c05e['uniqueid']),_0x33c05e);queues[_0x2199('0x2d')](_0x33c05e);}catch(_0xdb6813){utils[_0x2199('0x18')](util[_0x2199('0x1d')](_0x2199('0x2e'),_0x33c05e['uniqueid']),_0xdb6813);}});ami['on'](_0x2199('0x2f'),function(_0x3620fa){try{utils[_0x2199('0x1c')](util[_0x2199('0x1d')]('[%s][index][musiconholdstart]',_0x3620fa[_0x2199('0x24')]),_0x3620fa);queues[_0x2199('0x2f')](_0x3620fa);calls['musiconholdstart'](_0x3620fa);}catch(_0x4febad){utils[_0x2199('0x18')](util[_0x2199('0x1d')](_0x2199('0x30'),_0x3620fa['uniqueid']),_0x4febad);}});ami['on']('musiconholdstop',function(_0x553866){try{utils[_0x2199('0x1c')](util[_0x2199('0x1d')](_0x2199('0x31'),_0x553866[_0x2199('0x24')]),_0x553866);queues[_0x2199('0x32')](_0x553866);calls[_0x2199('0x32')](_0x553866);}catch(_0x21a8a3){utils['error'](util[_0x2199('0x1d')](_0x2199('0x31'),_0x553866['uniqueid']),_0x21a8a3);}});ami['on'](_0x2199('0x33'),function(_0x509cff){try{utils[_0x2199('0x1c')](util[_0x2199('0x1d')](_0x2199('0x34'),_0x509cff[_0x2199('0x24')]),_0x509cff);calls[_0x2199('0x33')](_0x509cff);recordings[_0x2199('0x33')](_0x509cff);}catch(_0x32a53e){utils[_0x2199('0x18')](util[_0x2199('0x1d')](_0x2199('0x34'),_0x509cff[_0x2199('0x24')]),_0x32a53e);}});ami['on'](_0x2199('0x35'),function(_0x3aecbe){try{utils[_0x2199('0x1c')](util[_0x2199('0x1d')](_0x2199('0x36'),_0x3aecbe[_0x2199('0x24')]),_0x3aecbe);calls[_0x2199('0x35')](_0x3aecbe);recordings[_0x2199('0x35')](_0x3aecbe);dials[_0x2199('0x35')](_0x3aecbe);agents['hangup'](_0x3aecbe);queues[_0x2199('0x35')](_0x3aecbe);}catch(_0x1bfbb3){utils['error'](util[_0x2199('0x1d')](_0x2199('0x36'),_0x3aecbe[_0x2199('0x24')]),_0x1bfbb3);}});ami['on']('cdr',function(_0x51e6cf){try{utils[_0x2199('0x1c')](util[_0x2199('0x1d')](_0x2199('0x37'),_0x51e6cf[_0x2199('0x24')]),_0x51e6cf);members[_0x2199('0x38')](_0x51e6cf);}catch(_0x149d77){utils[_0x2199('0x18')](util[_0x2199('0x1d')](_0x2199('0x37'),_0x51e6cf[_0x2199('0x24')]),_0x149d77);}});ami['on'](_0x2199('0x39'),function(_0x30f52c){try{utils[_0x2199('0x1c')](util[_0x2199('0x1d')]('[%s][index][blindtransfer]',_0x30f52c[_0x2199('0x24')]),_0x30f52c);queues[_0x2199('0x39')](_0x30f52c);agents['blindtransfer'](_0x30f52c);transfers[_0x2199('0x39')](_0x30f52c);recordings['blindtransfer'](_0x30f52c);}catch(_0x4a0378){utils[_0x2199('0x18')](util[_0x2199('0x1d')]('[%s][index][blindtransfer]',_0x30f52c['uniqueid']),_0x4a0378);}});ami['on'](_0x2199('0x3a'),function(_0x106c28){try{utils[_0x2199('0x1c')](util['format'](_0x2199('0x3b'),_0x106c28[_0x2199('0x3c')]),_0x106c28);queues['attendedtransfer'](_0x106c28);transfers[_0x2199('0x3a')](_0x106c28);agents[_0x2199('0x3a')](_0x106c28);calls[_0x2199('0x3a')](_0x106c28);}catch(_0x80c039){utils[_0x2199('0x18')](util[_0x2199('0x1d')]('[%s][index][attendedtransfer]',_0x106c28[_0x2199('0x3c')]),_0x80c039);}});ami['on'](_0x2199('0x3d'),function(_0x2e599b){try{utils[_0x2199('0x1c')](util[_0x2199('0x1d')](_0x2199('0x3e'),_0x2e599b[_0x2199('0x24')]),_0x2e599b);queues['varset'](_0x2e599b);recordings[_0x2199('0x3d')](_0x2e599b);calls['varset'](_0x2e599b);dials[_0x2199('0x3d')](_0x2e599b);}catch(_0x16b030){utils[_0x2199('0x18')](util[_0x2199('0x1d')](_0x2199('0x3e'),_0x2e599b[_0x2199('0x24')]),_0x16b030);}});ami['on'](_0x2199('0x3f'),function(_0x5f60ac){try{utils[_0x2199('0x1c')](util[_0x2199('0x1d')](_0x2199('0x40'),_0x5f60ac[_0x2199('0x24')]),_0x5f60ac);calls[_0x2199('0x3f')](_0x5f60ac);recordings[_0x2199('0x3f')](_0x5f60ac);dials['newexten'](_0x5f60ac);}catch(_0x333a12){utils['error'](util['format'](_0x2199('0x40'),_0x5f60ac[_0x2199('0x24')]),_0x333a12);}});ami['on']('newchannel',function(_0x5bfcc7){try{utils[_0x2199('0x1c')](util[_0x2199('0x1d')](_0x2199('0x41'),_0x5bfcc7[_0x2199('0x24')]),_0x5bfcc7);calls[_0x2199('0x42')](_0x5bfcc7);recordings[_0x2199('0x42')](_0x5bfcc7);}catch(_0x3ee4c4){utils[_0x2199('0x18')](util[_0x2199('0x1d')](_0x2199('0x41'),_0x5bfcc7[_0x2199('0x24')]),_0x3ee4c4);}});ami['on'](_0x2199('0x43'),function(_0x45c398){try{utils[_0x2199('0x1c')](util['format']('[%s][index][dialbegin]',_0x45c398[_0x2199('0x24')]),_0x45c398);dials[_0x2199('0x43')](_0x45c398);}catch(_0x9885e5){utils[_0x2199('0x18')](util[_0x2199('0x1d')](_0x2199('0x44'),_0x45c398[_0x2199('0x24')]),_0x9885e5);}});ami['on'](_0x2199('0x45'),function(_0x446a71){try{utils[_0x2199('0x1c')](util[_0x2199('0x1d')](_0x2199('0x46'),_0x446a71[_0x2199('0x24')]),_0x446a71);dials[_0x2199('0x45')](_0x446a71);}catch(_0x5111c5){utils[_0x2199('0x18')](util[_0x2199('0x1d')](_0x2199('0x46'),_0x446a71[_0x2199('0x24')]),_0x5111c5);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index a60f254..5ce179b 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 _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 +var _0x97da=['interface','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','[%s][members][agentcomplete]','info','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','[%s][members][cdr]','channel','assign','data1','data2','source','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','destination','lodash','./utils','Local/_attended@transfer','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','membername','type'];(function(_0x4d1643,_0x28a790){var _0x43eec4=function(_0xea9983){while(--_0xea9983){_0x4d1643['push'](_0x4d1643['shift']());}};_0x43eec4(++_0x28a790);}(_0x97da,0x164));var _0xa97d=function(_0x51cd61,_0x5ac573){_0x51cd61=_0x51cd61-0x0;var _0x474e89=_0x97da[_0x51cd61];return _0x474e89;};'use strict';var _=require(_0xa97d('0x0'));var util=require('util');var utils=require(_0xa97d('0x1'));var members={};var exclude=[_0xa97d('0x2'),'Queue:'];function writeDB(_0x275c14){utils['info'](util[_0xa97d('0x3')](_0xa97d('0x4'),_0x275c14[_0xa97d('0x5')],_0x275c14['interface'],_0x275c14['channel'],_0x275c14['data2'],_0x275c14[_0xa97d('0x6')],_0x275c14[_0xa97d('0x7')]));if(_0x275c14[_0xa97d('0x8')]){utils[_0xa97d('0x9')](_0x275c14[_0xa97d('0x8')])[_0xa97d('0xa')](function(_0x1d0ab0){if(_0x1d0ab0){_0x275c14['membername']=_0x1d0ab0[_0xa97d('0xb')];_0x275c14[_0xa97d('0xc')]=_0x1d0ab0['internal'];utils[_0xa97d('0xd')](_0xa97d('0xe'),_0x275c14);}else{utils[_0xa97d('0xf')](_0x275c14[_0xa97d('0x8')][_0xa97d('0x10')]('/')[0x1])['then'](function(_0x1002ba){if(_0x1002ba){_0x275c14[_0xa97d('0x6')]=_0x1002ba[_0xa97d('0xb')];_0x275c14[_0xa97d('0xc')]=_0x1002ba['internal'];utils[_0xa97d('0xd')](_0xa97d('0xe'),_0x275c14);}});}})['catch'](function(_0x4d10d1){utils[_0xa97d('0x11')](util['format'](_0xa97d('0x12'),_0x275c14[_0xa97d('0x5')]),_0x4d10d1);});}delete members[_0x275c14[_0xa97d('0x8')]];}function startsWith(_0xd23310,_0x2c94f6){return _[_0xa97d('0x13')](_0xd23310,function(_0xbe54ea){return _[_0xa97d('0x14')](_0x2c94f6,_0xbe54ea);});}exports[_0xa97d('0x15')]=function(_0x4f73f3){try{utils[_0xa97d('0x16')](util[_0xa97d('0x3')](_0xa97d('0x17'),members[_0x4f73f3[_0xa97d('0x18')]]?members[_0x4f73f3[_0xa97d('0x18')]][_0xa97d('0x5')]:_0x4f73f3[_0xa97d('0x18')]),_0x4f73f3);utils['info'](util[_0xa97d('0x3')](_0xa97d('0x19'),members[_0x4f73f3[_0xa97d('0x18')]]?members[_0x4f73f3[_0xa97d('0x18')]]['uniqueid']:_0x4f73f3[_0xa97d('0x18')],_0x4f73f3[_0xa97d('0x1a')],_0x4f73f3[_0xa97d('0x18')]));switch(_0x4f73f3[_0xa97d('0x1a')]){case _0xa97d('0x1b'):case _0xa97d('0x1c'):if(!startsWith(exclude,_0x4f73f3[_0xa97d('0x18')])){members[_0x4f73f3[_0xa97d('0x18')]]={'channel':_0xa97d('0x1d'),'interface':_0x4f73f3[_0xa97d('0x18')],'type':_0xa97d('0x1e'),'enterAt':utils[_0xa97d('0x1f')](),'role':_0xa97d('0x20')};}break;case _0xa97d('0x21'):if(!_[_0xa97d('0x22')](members[_0x4f73f3[_0xa97d('0x18')]])){members[_0x4f73f3[_0xa97d('0x18')]][_0xa97d('0x23')]=utils[_0xa97d('0x1f')]();members[_0x4f73f3['device']][_0xa97d('0x24')]=utils['diffTime'](members[_0x4f73f3[_0xa97d('0x18')]][_0xa97d('0x23')],members[_0x4f73f3[_0xa97d('0x18')]]['enterAt']);if(members[_0x4f73f3['device']][_0xa97d('0x5')]){writeDB(members[_0x4f73f3[_0xa97d('0x18')]]);}}break;default:break;}}catch(_0x583ba5){utils[_0xa97d('0x11')](util['format'](_0xa97d('0x17'),members[_0x4f73f3[_0xa97d('0x18')]]?members[_0x4f73f3[_0xa97d('0x18')]]['uniqueid']:_0x4f73f3[_0xa97d('0x18')]),_0x583ba5);}};exports['agentcomplete']=function(_0xac5f0e){try{if(!_[_0xa97d('0x22')](members[_0xac5f0e[_0xa97d('0x8')]])){utils[_0xa97d('0x16')](util['format'](_0xa97d('0x25'),_0xac5f0e['uniqueid']),_0xac5f0e);utils[_0xa97d('0x26')](util['format'](_0xa97d('0x27'),_0xac5f0e[_0xa97d('0x5')],_0xac5f0e[_0xa97d('0x8')],_0xac5f0e[_0xa97d('0x28')]));members[_0xac5f0e[_0xa97d('0x8')]]=_['assign'](members[_0xac5f0e[_0xa97d('0x8')]],{'data4':_0xac5f0e['queue'],'uniqueid':_0xac5f0e[_0xa97d('0x5')]});}}catch(_0x5c44be){utils[_0xa97d('0x11')](util[_0xa97d('0x3')]('[%s][members][agentcomplete]',_0xac5f0e[_0xa97d('0x5')]),_0x5c44be);}};exports[_0xa97d('0x29')]=function(_0x3917df){try{utils[_0xa97d('0x16')](util['format'](_0xa97d('0x2a'),_0x3917df['uniqueid']),_0x3917df);if(_0x3917df[_0xa97d('0x2b')]){var _0x278e2d=_0x3917df[_0xa97d('0x2b')]['split']('-')[0x0];if(!_[_0xa97d('0x22')](members[_0x278e2d])){members[_0x278e2d]=_[_0xa97d('0x2c')](members[_0x278e2d],{'data1':members[_0x278e2d][_0xa97d('0x2d')]||_0x3917df[_0xa97d('0x7')],'data2':members[_0x278e2d][_0xa97d('0x2e')]||_0x3917df[_0xa97d('0x2f')],'data3':members[_0x278e2d]['data3']||_0x3917df['destination'],'uniqueid':members[_0x278e2d][_0xa97d('0x5')]||_0x3917df['uniqueid']});utils['info'](util[_0xa97d('0x3')](_0xa97d('0x30'),_0x3917df[_0xa97d('0x5')],members[_0x278e2d][_0xa97d('0x2d')],members[_0x278e2d][_0xa97d('0x2e')],members[_0x278e2d][_0xa97d('0x31')]));if(members[_0x278e2d]['exitAt']){writeDB(members[_0x278e2d]);}}}if(_0x3917df[_0xa97d('0x32')]){var _0x53ad72=_0x3917df['destinationchannel'][_0xa97d('0x10')]('-')[0x0];if(!_['isNil'](members[_0x53ad72])){members[_0x53ad72]=_[_0xa97d('0x2c')](members[_0x53ad72],{'data1':members[_0x53ad72]['data1']||_0x3917df['type'],'data2':members[_0x53ad72][_0xa97d('0x2e')]||_0x3917df[_0xa97d('0x2f')],'data3':members[_0x53ad72]['data3']||_0x3917df[_0xa97d('0x33')],'uniqueid':members[_0x53ad72][_0xa97d('0x5')]||_0x3917df['uniqueid']});utils[_0xa97d('0x26')](util['format'](_0xa97d('0x30'),_0x3917df[_0xa97d('0x5')],members[_0x53ad72][_0xa97d('0x2d')],members[_0x53ad72]['data2'],members[_0x53ad72][_0xa97d('0x31')]));if(members[_0x53ad72]['exitAt']){writeDB(members[_0x53ad72]);}}}}catch(_0x2d3f71){utils[_0xa97d('0x11')](util[_0xa97d('0x3')]('[%s][members][cdr]',_0x3917df[_0xa97d('0x5')]),_0x2d3f71);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 118c464..7b41b82 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 _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 +var _0xa63a=['now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','[%s][queues][varset]','queuestatus','toUpperCase','CONTINUE','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','accountcode','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','reason','blindtransfer','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','transfertype','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','queuecallerenterreason','calleridname','[%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','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','queuecallerexitreason','queue','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xa63a,0x12a));var _0xaa63=function(_0x4fe19c,_0x45d0fe){_0x4fe19c=_0x4fe19c-0x0;var _0x952ac7=_0xa63a[_0x4fe19c];return _0x952ac7;};'use strict';var _=require(_0xaa63('0x0'));var util=require(_0xaa63('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x37209e){utils[_0xaa63('0x2')](util['format'](_0xaa63('0x3'),_0x37209e[_0xaa63('0x4')],_0x37209e[_0xaa63('0x5')],_0x37209e['queue'],_0x37209e[_0xaa63('0x6')],_0x37209e[_0xaa63('0x7')],_0x37209e['accountcode'],_0x37209e[_0xaa63('0x8')]));if(_0x37209e[_0xaa63('0x9')]){utils['getVoiceQueueByName'](_0x37209e[_0xaa63('0x9')])[_0xaa63('0xa')](function(_0xd9ec4e){if(_0xd9ec4e){_0x37209e[_0xaa63('0xb')]=_0xd9ec4e['type'];}utils['request']('CreateVoiceQueueReport',_0x37209e);});}else{utils[_0xaa63('0xc')](_0xaa63('0xd'),_0x37209e);}if(_0x37209e[_0xaa63('0xe')]){delete queues[_0x37209e[_0xaa63('0xe')]];}else{delete queues[_0x37209e['uniqueid']];}}exports['queuecallerjoin']=function(_0x25e14b){try{utils[_0xaa63('0xf')](util['format'](_0xaa63('0x10'),_0x25e14b[_0xaa63('0x4')]),_0x25e14b);utils[_0xaa63('0x2')](util[_0xaa63('0x11')](_0xaa63('0x12'),_0x25e14b[_0xaa63('0x4')],_0x25e14b[_0xaa63('0x9')],_0x25e14b['position']));queues[_0x25e14b[_0xaa63('0x4')]]=_['assign'](_0x25e14b,{'originalposition':_0x25e14b[_0xaa63('0x13')],'queuecallerjoinAt':utils[_0xaa63('0x14')](),'mohtime':0x0});}catch(_0x4d7f94){utils[_0xaa63('0x15')](util[_0xaa63('0x11')](_0xaa63('0x10'),_0x25e14b['uniqueid']),_0x4d7f94);}};exports[_0xaa63('0x16')]=function(_0x407654){try{if(!_[_0xaa63('0x17')](queues[_0x407654['uniqueid']])){utils[_0xaa63('0xf')](util['format'](_0xaa63('0x18'),_0x407654[_0xaa63('0x4')]),_0x407654);if(queues[_0x407654[_0xaa63('0x4')]][_0xaa63('0x19')]){if(!queues[_0x407654['uniqueid']][_0xaa63('0x1a')]&&!queues[_0x407654[_0xaa63('0x4')]][_0xaa63('0x1b')]){queues[_0x407654[_0xaa63('0x4')]][_0xaa63('0x1c')]=!![];queues[_0x407654[_0xaa63('0x4')]][_0xaa63('0x1d')]=utils[_0xaa63('0x14')]();queues[_0x407654[_0xaa63('0x4')]][_0xaa63('0x8')]='COMPLETEDBYAGENT';}utils[_0xaa63('0x2')](util[_0xaa63('0x11')](_0xaa63('0x1e'),_0x407654[_0xaa63('0x4')],queues[_0x407654[_0xaa63('0x4')]][_0xaa63('0x1f')],queues[_0x407654['uniqueid']][_0xaa63('0x8')]));writeDB(queues[_0x407654[_0xaa63('0x4')]]);}else if(queues[_0x407654[_0xaa63('0x4')]][_0xaa63('0xe')]){utils[_0xaa63('0x2')](util['format'](_0xaa63('0x20'),_0x407654[_0xaa63('0x4')],queues[_0x407654['uniqueid']][_0xaa63('0x1f')],queues[_0x407654['uniqueid']][_0xaa63('0xe')]));queues[queues[_0x407654['uniqueid']][_0xaa63('0xe')]]=queues[_0x407654['uniqueid']];queues[queues[_0x407654[_0xaa63('0x4')]][_0xaa63('0xe')]]['queuecallerenterreason']=0x2;delete queues[_0x407654[_0xaa63('0x4')]];}}}catch(_0x404682){utils[_0xaa63('0x15')](util[_0xaa63('0x11')]('[%s][queues][hangup]',_0x407654[_0xaa63('0x4')]),_0x404682);}};exports[_0xaa63('0x21')]=function(_0x3f33ed){try{utils[_0xaa63('0xf')](util[_0xaa63('0x11')](_0xaa63('0x22'),_0x3f33ed[_0xaa63('0x4')]),_0x3f33ed);if(!_[_0xaa63('0x17')](_0x3f33ed['variable'][_0xaa63('0x23')])&&_0x3f33ed['value'][_0xaa63('0x24')]()!==_0xaa63('0x25')){if(!_[_0xaa63('0x17')](queues[_0x3f33ed[_0xaa63('0x4')]])){queues[_0x3f33ed[_0xaa63('0x4')]]['queuecallerabandon']=![];queues[_0x3f33ed[_0xaa63('0x4')]]['queuecallerabandonAt']=null;queues[_0x3f33ed[_0xaa63('0x4')]]['queuecallerexit']=!![];queues[_0x3f33ed['uniqueid']][_0xaa63('0x26')]=utils[_0xaa63('0x14')]();queues[_0x3f33ed[_0xaa63('0x4')]][_0xaa63('0x8')]=_0x3f33ed[_0xaa63('0x27')]['toUpperCase']();utils[_0xaa63('0x2')](util['format'](_0xaa63('0x28'),_0x3f33ed[_0xaa63('0x4')],queues[_0x3f33ed[_0xaa63('0x4')]]['name'],_0x3f33ed[_0xaa63('0x27')],queues[_0x3f33ed['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x3f33ed['uniqueid']]);}}else if(!_[_0xaa63('0x17')](_0x3f33ed[_0xaa63('0x29')]['queueposition'])){if(!_[_0xaa63('0x17')](queues[_0x3f33ed['uniqueid']])&&!queues[_0x3f33ed['uniqueid']]['queuecallerabandon']){queues[_0x3f33ed[_0xaa63('0x4')]][_0xaa63('0x1a')]=![];queues[_0x3f33ed['uniqueid']][_0xaa63('0x2a')]=null;queues[_0x3f33ed['uniqueid']][_0xaa63('0x1b')]=!![];queues[_0x3f33ed['uniqueid']][_0xaa63('0x26')]=utils[_0xaa63('0x14')]();queues[_0x3f33ed['uniqueid']][_0xaa63('0x8')]=_0xaa63('0x2b');utils[_0xaa63('0x2')](util[_0xaa63('0x11')](_0xaa63('0x2c'),_0x3f33ed[_0xaa63('0x4')],queues[_0x3f33ed[_0xaa63('0x4')]]['name'],_0x3f33ed[_0xaa63('0x27')],queues[_0x3f33ed[_0xaa63('0x4')]]['queuecallerexitreason']));}}}catch(_0x3f565e){utils['error'](util['format'](_0xaa63('0x22'),_0x3f33ed[_0xaa63('0x4')]),_0x3f565e);}};exports['queuecallerabandon']=function(_0x2f1907){try{if(!_[_0xaa63('0x17')](queues[_0x2f1907[_0xaa63('0x4')]])){utils['debug'](util[_0xaa63('0x11')](_0xaa63('0x2d'),_0x2f1907[_0xaa63('0x4')]),_0x2f1907);queues[_0x2f1907[_0xaa63('0x4')]][_0xaa63('0x1b')]=![];queues[_0x2f1907['uniqueid']][_0xaa63('0x26')]=null;queues[_0x2f1907[_0xaa63('0x4')]]['queuecallerabandon']=!![];queues[_0x2f1907[_0xaa63('0x4')]][_0xaa63('0x2a')]=utils[_0xaa63('0x14')]();queues[_0x2f1907['uniqueid']][_0xaa63('0x8')]=_0xaa63('0x2e');utils[_0xaa63('0x2')](util['format'](_0xaa63('0x2f'),_0x2f1907['uniqueid'],queues[_0x2f1907[_0xaa63('0x4')]][_0xaa63('0x1f')],queues[_0x2f1907['uniqueid']]['queuecallerexitreason']));}}catch(_0x1eb86f){utils[_0xaa63('0x15')](util[_0xaa63('0x11')]('[%s][queues][queuecallerabandon]',_0x2f1907['uniqueid']),_0x1eb86f);}};exports['queuecallerleave']=function(_0x23984f){try{if(!_[_0xaa63('0x17')](queues[_0x23984f[_0xaa63('0x4')]])){utils[_0xaa63('0xf')](util[_0xaa63('0x11')](_0xaa63('0x30'),_0x23984f[_0xaa63('0x4')]),_0x23984f);utils[_0xaa63('0x2')](util[_0xaa63('0x11')](_0xaa63('0x31'),_0x23984f[_0xaa63('0x4')],queues[_0x23984f[_0xaa63('0x4')]][_0xaa63('0x1f')],_0x23984f[_0xaa63('0x32')],_0x23984f[_0xaa63('0x33')]));queues[_0x23984f['uniqueid']][_0xaa63('0x34')]=!![];queues[_0x23984f[_0xaa63('0x4')]][_0xaa63('0x19')]=utils[_0xaa63('0x14')]();queues[_0x23984f[_0xaa63('0x4')]][_0xaa63('0x35')]=utils[_0xaa63('0x36')](queues[_0x23984f[_0xaa63('0x4')]]['queuecallerleaveAt'],queues[_0x23984f[_0xaa63('0x4')]][_0xaa63('0x37')]);queues[_0x23984f['uniqueid']][_0xaa63('0x13')]=_0x23984f[_0xaa63('0x13')];queues[_0x23984f[_0xaa63('0x4')]][_0xaa63('0x38')]=_0x23984f['count'];queues[_0x23984f['uniqueid']][_0xaa63('0x32')]=_0x23984f[_0xaa63('0x32')];queues[_0x23984f[_0xaa63('0x4')]][_0xaa63('0x33')]=_0x23984f[_0xaa63('0x33')];}}catch(_0x372dde){utils['error'](util[_0xaa63('0x11')](_0xaa63('0x30'),_0x23984f[_0xaa63('0x4')]),_0x372dde);}};exports[_0xaa63('0x39')]=function(_0x101c04){try{if(!_[_0xaa63('0x17')](queues[_0x101c04[_0xaa63('0x4')]])){utils['debug'](util['format']('[%s][queues][agentconnect]',_0x101c04[_0xaa63('0x4')]),_0x101c04);utils['info'](util[_0xaa63('0x11')](_0xaa63('0x3a'),_0x101c04[_0xaa63('0x4')],queues[_0x101c04[_0xaa63('0x4')]][_0xaa63('0x1f')],_0x101c04[_0xaa63('0x3b')],_0x101c04[_0xaa63('0x3c')]));queues[_0x101c04[_0xaa63('0x4')]][_0xaa63('0x1a')]=![];queues[_0x101c04[_0xaa63('0x4')]][_0xaa63('0x1a')]=![];queues[_0x101c04[_0xaa63('0x4')]][_0xaa63('0x2a')]=null;queues[_0x101c04[_0xaa63('0x4')]]['queuecallerexit']=![];queues[_0x101c04['uniqueid']][_0xaa63('0x8')]=null;queues[_0x101c04[_0xaa63('0x4')]][_0xaa63('0x26')]=null;queues[_0x101c04[_0xaa63('0x4')]][_0xaa63('0x3d')]=!![];queues[_0x101c04[_0xaa63('0x4')]][_0xaa63('0x3e')]=_0x101c04[_0xaa63('0x3c')];queues[_0x101c04['uniqueid']][_0xaa63('0x6')]=_0x101c04[_0xaa63('0x3b')];}}catch(_0x3c454d){utils[_0xaa63('0x15')](util['format'](_0xaa63('0x3f'),_0x101c04[_0xaa63('0x4')]),_0x3c454d);}};exports[_0xaa63('0x40')]=function(_0x3e6a2d){try{if(!_[_0xaa63('0x17')](queues[_0x3e6a2d[_0xaa63('0x4')]])){if(queues[_0x3e6a2d[_0xaa63('0x4')]][_0xaa63('0x19')]){utils[_0xaa63('0xf')](util[_0xaa63('0x11')](_0xaa63('0x41'),_0x3e6a2d[_0xaa63('0x4')]),_0x3e6a2d);queues[_0x3e6a2d[_0xaa63('0x4')]][_0xaa63('0x1a')]=![];queues[_0x3e6a2d[_0xaa63('0x4')]][_0xaa63('0x1a')]=![];queues[_0x3e6a2d[_0xaa63('0x4')]][_0xaa63('0x2a')]=null;queues[_0x3e6a2d['uniqueid']][_0xaa63('0x1b')]=![];queues[_0x3e6a2d[_0xaa63('0x4')]][_0xaa63('0x26')]=null;queues[_0x3e6a2d[_0xaa63('0x4')]][_0xaa63('0x3d')]=!![];queues[_0x3e6a2d[_0xaa63('0x4')]][_0xaa63('0x6')]=_0x3e6a2d[_0xaa63('0x3b')];queues[_0x3e6a2d[_0xaa63('0x4')]][_0xaa63('0x1c')]=!![];queues[_0x3e6a2d[_0xaa63('0x4')]][_0xaa63('0x1d')]=utils[_0xaa63('0x14')]();if(_0x3e6a2d['reason']==_0xaa63('0x42')){if(!queues[_0x3e6a2d[_0xaa63('0x4')]][_0xaa63('0x42')]){queues[_0x3e6a2d[_0xaa63('0x4')]][_0xaa63('0x8')]=_0xaa63('0x43');}}else{queues[_0x3e6a2d['uniqueid']]['queuecallerexitreason']='COMPLETEDBY'+_0x3e6a2d[_0xaa63('0x44')][_0xaa63('0x24')]();}utils['info'](util[_0xaa63('0x11')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x3e6a2d[_0xaa63('0x4')],queues[_0x3e6a2d[_0xaa63('0x4')]]['name'],_0x3e6a2d[_0xaa63('0x3b')],queues[_0x3e6a2d['uniqueid']][_0xaa63('0x8')]));writeDB(queues[_0x3e6a2d[_0xaa63('0x4')]]);}}}catch(_0x1696dd){utils[_0xaa63('0x15')](util[_0xaa63('0x11')](_0xaa63('0x41'),_0x3e6a2d['uniqueid']),_0x1696dd);}};exports[_0xaa63('0x45')]=function(_0x1e19e6){try{if(!_[_0xaa63('0x17')](queues[_0x1e19e6['transfereeuniqueid']])){utils['debug'](util[_0xaa63('0x11')]('[%s][queues][blindtransfer]',_0x1e19e6[_0xaa63('0x4')]),_0x1e19e6);queues[_0x1e19e6[_0xaa63('0x46')]][_0xaa63('0x42')]=!![];queues[_0x1e19e6[_0xaa63('0x46')]]['transfertype']=_0xaa63('0x47');queues[_0x1e19e6[_0xaa63('0x46')]][_0xaa63('0x48')]=_0x1e19e6[_0xaa63('0x49')];queues[_0x1e19e6['transfereeuniqueid']][_0xaa63('0x4a')]=_0x1e19e6[_0xaa63('0x46')];queues[_0x1e19e6[_0xaa63('0x46')]][_0xaa63('0x8')]=_0xaa63('0x4b');utils[_0xaa63('0x2')](util['format'](_0xaa63('0x4c'),_0x1e19e6[_0xaa63('0x4')],queues[_0x1e19e6[_0xaa63('0x46')]][_0xaa63('0x1f')],_0x1e19e6[_0xaa63('0x46')],_0x1e19e6['extension']));}}catch(_0x5c5ee2){utils[_0xaa63('0x15')](util[_0xaa63('0x11')](_0xaa63('0x4d'),_0x1e19e6['uniqueid']),_0x5c5ee2);}};exports['attendedtransfer']=function(_0x2de417){try{utils[_0xaa63('0xf')](util[_0xaa63('0x11')](_0xaa63('0x4e'),_0x2de417[_0xaa63('0x4f')]),_0x2de417);if(_0x2de417[_0xaa63('0x4f')]==_0x2de417[_0xaa63('0x50')]){if(!_[_0xaa63('0x17')](queues[_0x2de417[_0xaa63('0x51')]])){utils['info'](util[_0xaa63('0x11')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x2de417[_0xaa63('0x4f')],queues[_0x2de417[_0xaa63('0x51')]]['name'],_0x2de417[_0xaa63('0x52')]));queues[_0x2de417[_0xaa63('0x51')]][_0xaa63('0x42')]=!![];queues[_0x2de417[_0xaa63('0x51')]][_0xaa63('0x53')]=_0xaa63('0x54');queues[_0x2de417[_0xaa63('0x51')]][_0xaa63('0x48')]=_0x2de417[_0xaa63('0x52')];queues[_0x2de417['secondtransfererlinkedid']][_0xaa63('0x4a')]=_0x2de417[_0xaa63('0x4f')];queues[_0x2de417[_0xaa63('0x51')]][_0xaa63('0x8')]=_0xaa63('0x55');}if(!_[_0xaa63('0x17')](queues[_0x2de417[_0xaa63('0x50')]])){if(_0x2de417['transfereelinkedid']&&queues[_0x2de417['transfereelinkedid']]){queues[_0x2de417[_0xaa63('0x56')]]['queuecallerenterreason']=0x1;queues[_0x2de417[_0xaa63('0x46')]]=_[_0xaa63('0x57')](queues[_0x2de417[_0xaa63('0x56')]]);queues[_0x2de417[_0xaa63('0x46')]]['transfereduniqueid']=_0x2de417[_0xaa63('0x58')];queues[_0x2de417[_0xaa63('0x46')]][_0xaa63('0x59')]=0x2;queues[_0x2de417[_0xaa63('0x46')]][_0xaa63('0x7')]=queues[_0x2de417[_0xaa63('0x51')]][_0xaa63('0x7')];queues[_0x2de417[_0xaa63('0x46')]]['calleridname']=queues[_0x2de417['secondtransfererlinkedid']][_0xaa63('0x5a')];queues[_0x2de417[_0xaa63('0x46')]][_0xaa63('0x37')]=utils[_0xaa63('0x14')]();queues[_0x2de417[_0xaa63('0x46')]][_0xaa63('0x19')]=utils[_0xaa63('0x14')]();queues[_0x2de417['transfereeuniqueid']][_0xaa63('0x35')]=0x0;queues[_0x2de417[_0xaa63('0x46')]]['mohtime']=0x0;utils['info'](util[_0xaa63('0x11')](_0xaa63('0x5b'),_0x2de417[_0xaa63('0x4f')],queues[_0x2de417[_0xaa63('0x46')]][_0xaa63('0x1f')],queues[_0x2de417[_0xaa63('0x46')]][_0xaa63('0x7')],queues[_0x2de417[_0xaa63('0x46')]][_0xaa63('0x5a')]));}else{utils['info'](util['format'](_0xaa63('0x5c'),_0x2de417['origtransfereruniqueid'],queues[_0x2de417[_0xaa63('0x50')]][_0xaa63('0x1f')],_0x2de417[_0xaa63('0x51')]));queues[_0x2de417[_0xaa63('0x50')]][_0xaa63('0xe')]=_0x2de417[_0xaa63('0x51')];}}}else if(_0x2de417[_0xaa63('0x5d')]==_0x2de417[_0xaa63('0x51')]){if(!_[_0xaa63('0x17')](queues[_0x2de417[_0xaa63('0x50')]])){utils[_0xaa63('0x2')](util[_0xaa63('0x11')](_0xaa63('0x5e'),_0x2de417[_0xaa63('0x4f')],queues[_0x2de417[_0xaa63('0x50')]][_0xaa63('0x1f')],_0x2de417[_0xaa63('0x5d')],_0x2de417[_0xaa63('0x5f')]));queues[_0x2de417['origtransfererlinkedid']]['transfer']=!![];queues[_0x2de417[_0xaa63('0x50')]][_0xaa63('0x53')]='ATTENDED';queues[_0x2de417[_0xaa63('0x50')]][_0xaa63('0x48')]=_0x2de417[_0xaa63('0x5f')];queues[_0x2de417['origtransfererlinkedid']][_0xaa63('0x4a')]=_0x2de417[_0xaa63('0x5d')];queues[_0x2de417[_0xaa63('0x50')]][_0xaa63('0x8')]=_0xaa63('0x55');}if(!_['isNil'](queues[_0x2de417[_0xaa63('0x51')]])){if(_0x2de417[_0xaa63('0x60')]&&queues[_0x2de417['transfertargetlinkedid']]){queues[_0x2de417[_0xaa63('0x60')]]['queuecallerenterreason']=0x1;queues[_0x2de417[_0xaa63('0x58')]]=_[_0xaa63('0x57')](queues[_0x2de417['transfertargetlinkedid']]);queues[_0x2de417[_0xaa63('0x58')]]['transfereduniqueid']=_0x2de417[_0xaa63('0x58')];queues[_0x2de417[_0xaa63('0x58')]][_0xaa63('0x59')]=0x2;queues[_0x2de417['transfertargetuniqueid']][_0xaa63('0x7')]=queues[_0x2de417[_0xaa63('0x50')]]['calleridnum'];queues[_0x2de417[_0xaa63('0x58')]][_0xaa63('0x5a')]=queues[_0x2de417[_0xaa63('0x50')]][_0xaa63('0x5a')];queues[_0x2de417[_0xaa63('0x58')]][_0xaa63('0x37')]=utils['now']();queues[_0x2de417[_0xaa63('0x58')]][_0xaa63('0x19')]=utils[_0xaa63('0x14')]();queues[_0x2de417['transfertargetuniqueid']][_0xaa63('0x35')]=0x0;queues[_0x2de417[_0xaa63('0x58')]][_0xaa63('0x61')]=0x0;utils[_0xaa63('0x2')](util[_0xaa63('0x11')](_0xaa63('0x62'),_0x2de417['origtransfereruniqueid'],queues[_0x2de417[_0xaa63('0x58')]][_0xaa63('0x1f')],queues[_0x2de417[_0xaa63('0x58')]]['transfereduniqueid'],queues[_0x2de417[_0xaa63('0x58')]]['calleridnum'],queues[_0x2de417[_0xaa63('0x58')]][_0xaa63('0x5a')]));}else{utils[_0xaa63('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x2de417[_0xaa63('0x4f')],queues[_0x2de417[_0xaa63('0x51')]][_0xaa63('0x1f')],_0x2de417[_0xaa63('0x50')]));queues[_0x2de417['secondtransfererlinkedid']][_0xaa63('0xe')]=_0x2de417[_0xaa63('0x50')];}}}}catch(_0x5086b7){utils[_0xaa63('0x15')](util[_0xaa63('0x11')](_0xaa63('0x4e'),_0x2de417[_0xaa63('0x4f')]),_0x5086b7);}};exports[_0xaa63('0x63')]=function(_0x50c3f0){try{if(!_['isNil'](queues[_0x50c3f0['uniqueid']])){utils[_0xaa63('0xf')](util[_0xaa63('0x11')]('[%s][queues][musiconholdstart]',_0x50c3f0[_0xaa63('0x4')]),_0x50c3f0);queues[_0x50c3f0[_0xaa63('0x4')]][_0xaa63('0x64')]=utils[_0xaa63('0x14')]();utils[_0xaa63('0x2')](util[_0xaa63('0x11')](_0xaa63('0x65'),_0x50c3f0[_0xaa63('0x4')],queues[_0x50c3f0[_0xaa63('0x4')]]['name'],queues[_0x50c3f0[_0xaa63('0x4')]][_0xaa63('0x64')]));}}catch(_0x121650){utils['error'](util[_0xaa63('0x11')](_0xaa63('0x66'),_0x50c3f0[_0xaa63('0x4')]),_0x121650);}};exports[_0xaa63('0x67')]=function(_0x33a921){try{if(!_['isNil'](queues[_0x33a921[_0xaa63('0x4')]])){if(!_[_0xaa63('0x17')](queues[_0x33a921[_0xaa63('0x4')]][_0xaa63('0x64')])){utils[_0xaa63('0xf')](util[_0xaa63('0x11')](_0xaa63('0x68'),_0x33a921[_0xaa63('0x4')]),_0x33a921);queues[_0x33a921['uniqueid']][_0xaa63('0x61')]+=utils['diffTime'](utils[_0xaa63('0x14')](),queues[_0x33a921['uniqueid']][_0xaa63('0x64')]);utils[_0xaa63('0x2')](util['format'](_0xaa63('0x69'),_0x33a921[_0xaa63('0x4')],queues[_0x33a921['uniqueid']][_0xaa63('0x1f')],queues[_0x33a921[_0xaa63('0x4')]]['mohtime']));delete queues[_0x33a921['uniqueid']][_0xaa63('0x64')];}}}catch(_0x3a9a12){utils[_0xaa63('0x15')](util['format']('[%s][queues][musiconholdstop]',_0x33a921[_0xaa63('0x4')]),_0x3a9a12);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index c555ca5..a4a41a7 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 _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 +var _0xf972=['then','name','UserId','request','CreateVoiceRecording','blinds','newchannel','debug','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','monitors','push','hangup','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','newexten','application','appdata','toLowerCase','set','startsWith','cdr','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','recording','util','./utils','./transfers.controller','info','[%s][recordings][writeDB]','uniqueid','transfereeuniqueid','accountcode'];(function(_0x44c24b,_0x1bed36){var _0x574d2e=function(_0x4082cc){while(--_0x4082cc){_0x44c24b['push'](_0x44c24b['shift']());}};_0x574d2e(++_0x1bed36);}(_0xf972,0xd0));var _0x2f97=function(_0x520f9b,_0x66cba9){_0x520f9b=_0x520f9b-0x0;var _0x321d5a=_0xf972[_0x520f9b];return _0x321d5a;};'use strict';var _=require('lodash');var util=require(_0x2f97('0x0'));var utils=require(_0x2f97('0x1'));var transfers=require(_0x2f97('0x2'));var recordings={};function writeDB(_0xa521dd){var _0x18e633;utils[_0x2f97('0x3')](util['format'](_0x2f97('0x4'),_0xa521dd[_0x2f97('0x5')]));if(transfers['blinds'][_0xa521dd[_0x2f97('0x5')]]){_0x18e633=_0xa521dd[_0x2f97('0x5')];_0xa521dd[_0x2f97('0x5')]=transfers['blinds'][_0xa521dd[_0x2f97('0x5')]][_0x2f97('0x6')];}if(_0xa521dd['accountcode']){utils['getUserByInternal'](_0xa521dd[_0x2f97('0x7')])[_0x2f97('0x8')](function(_0x2cb50d){if(_0x2cb50d){_0xa521dd['membername']=_0x2cb50d[_0x2f97('0x9')];_0xa521dd[_0x2f97('0xa')]=_0x2cb50d['id'];}utils[_0x2f97('0xb')](_0x2f97('0xc'),_0xa521dd);});}else{utils[_0x2f97('0xb')]('CreateVoiceRecording',_0xa521dd);}if(_0x18e633)delete transfers[_0x2f97('0xd')][_0x18e633];}exports[_0x2f97('0xe')]=function(_0x273a3f){try{utils[_0x2f97('0xf')](util[_0x2f97('0x10')](_0x2f97('0x11'),_0x273a3f[_0x2f97('0x5')]),_0x273a3f);if(_0x273a3f['uniqueid']==_0x273a3f[_0x2f97('0x12')]){utils[_0x2f97('0x3')](util['format'](_0x2f97('0x13'),_0x273a3f[_0x2f97('0x5')],_0x273a3f[_0x2f97('0x14')],_0x273a3f[_0x2f97('0x15')]));recordings[_0x273a3f[_0x2f97('0x5')]]={'uniqueid':_0x273a3f[_0x2f97('0x5')],'accountcode':_0x273a3f['accountcode'],'exten':_0x273a3f[_0x2f97('0x15')],'context':_0x273a3f['context'],'channel':_0x273a3f[_0x2f97('0x16')],'monitors':[]};}}catch(_0x57f7df){utils[_0x2f97('0x17')](util[_0x2f97('0x10')](_0x2f97('0x11'),_0x273a3f[_0x2f97('0x5')]),_0x57f7df);}};exports[_0x2f97('0x18')]=function(_0x539072){try{utils[_0x2f97('0xf')](util[_0x2f97('0x10')]('[%s][recordings][newstate]',_0x539072[_0x2f97('0x5')]),_0x539072);if(!_['isNil'](recordings[_0x539072['uniqueid']])&&_0x539072['channelstate']==0x6){utils[_0x2f97('0x3')](util[_0x2f97('0x10')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x539072['uniqueid'],_0x539072[_0x2f97('0x14')],_0x539072[_0x2f97('0x16')]));}else if(!_[_0x2f97('0x19')](recordings[_0x539072['linkedid']])&&_0x539072[_0x2f97('0x1a')]==0x6&&_0x539072['context']!=_0x2f97('0x1b')){utils['info'](util[_0x2f97('0x10')](_0x2f97('0x1c'),_0x539072[_0x2f97('0x5')],_0x539072[_0x2f97('0x12')],_0x539072['context'],_0x539072[_0x2f97('0x16')]));recordings[_0x539072[_0x2f97('0x12')]]['accountcode']=_0x539072[_0x2f97('0x7')];}}catch(_0x52b155){utils[_0x2f97('0x17')](util['format'](_0x2f97('0x1d'),_0x539072[_0x2f97('0x5')]),_0x52b155);}};exports[_0x2f97('0x1e')]=function(_0x443d83){try{if(!_['isNil'](_0x443d83[_0x2f97('0x1f')])&&!_[_0x2f97('0x19')](_0x443d83[_0x2f97('0x1f')]['mixmonitor_filename'])){utils['debug'](util[_0x2f97('0x10')](_0x2f97('0x20'),_0x443d83[_0x2f97('0x5')]),_0x443d83);utils[_0x2f97('0x3')](util['format'](_0x2f97('0x21'),_0x443d83[_0x2f97('0x5')],_0x443d83[_0x2f97('0x1f')],_0x443d83[_0x2f97('0x22')]));if(_[_0x2f97('0x23')](_0x443d83[_0x2f97('0x22')],_0x2f97('0x24'))){_0x443d83[_0x2f97('0x22')]=_0x443d83[_0x2f97('0x22')][_0x2f97('0x25')](_0x2f97('0x24'),_0x2f97('0x26'));}if(recordings[_0x443d83['linkedid']]){var _0x1703dd=_['find'](recordings[_0x443d83[_0x2f97('0x12')]][_0x2f97('0x27')],{'value':_0x443d83[_0x2f97('0x22')]});if(_[_0x2f97('0x19')](_0x1703dd)){recordings[_0x443d83[_0x2f97('0x12')]][_0x2f97('0x27')][_0x2f97('0x28')]({'value':_0x443d83[_0x2f97('0x22')]});}}}}catch(_0x172e7b){utils[_0x2f97('0x17')](util[_0x2f97('0x10')](_0x2f97('0x20'),_0x443d83[_0x2f97('0x5')]),_0x172e7b);}};exports[_0x2f97('0x29')]=function(_0x164a6a){try{if(!_[_0x2f97('0x19')](recordings[_0x164a6a[_0x2f97('0x5')]])){utils[_0x2f97('0xf')](util[_0x2f97('0x10')]('[%s][recordings][hangup]',_0x164a6a['uniqueid']),_0x164a6a);utils[_0x2f97('0x3')](util[_0x2f97('0x10')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x164a6a[_0x2f97('0x5')],_0x164a6a[_0x2f97('0x2a')],_0x164a6a[_0x2f97('0x2b')],_0x164a6a[_0x2f97('0x2c')]));recordings[_0x164a6a[_0x2f97('0x5')]][_0x2f97('0x2a')]=_0x164a6a['calleridnum'];recordings[_0x164a6a[_0x2f97('0x5')]][_0x2f97('0x2b')]=_0x164a6a[_0x2f97('0x2b')];recordings[_0x164a6a['uniqueid']][_0x2f97('0x2d')]=_0x164a6a[_0x2f97('0x2d')];recordings[_0x164a6a[_0x2f97('0x5')]][_0x2f97('0x2e')]=_0x164a6a['connectedlinename'];if(recordings[_0x164a6a[_0x2f97('0x5')]][_0x2f97('0x2f')]==_0x2f97('0x30')&&recordings[_0x164a6a[_0x2f97('0x5')]][_0x2f97('0x7')]){recordings[_0x164a6a[_0x2f97('0x5')]]['connectedlinenum']=recordings[_0x164a6a[_0x2f97('0x5')]][_0x2f97('0x7')];recordings[_0x164a6a[_0x2f97('0x5')]][_0x2f97('0x2e')]='';}recordings[_0x164a6a['uniqueid']][_0x2f97('0x27')]['forEach'](function(_0x2936bc){var _0x94578b=_['clone'](recordings[_0x164a6a[_0x2f97('0x5')]]);_0x94578b[_0x2f97('0x22')]=_0x2936bc[_0x2f97('0x22')];writeDB(_0x94578b);});delete recordings[_0x164a6a[_0x2f97('0x5')]];}}catch(_0x1cbb43){utils[_0x2f97('0x17')](util[_0x2f97('0x10')]('[%s][recordings][hangup]',_0x164a6a[_0x2f97('0x5')]),_0x1cbb43);}};exports[_0x2f97('0x31')]=function(_0x39de83){try{if(!_[_0x2f97('0x19')](recordings[_0x39de83[_0x2f97('0x5')]])){utils[_0x2f97('0xf')](util[_0x2f97('0x10')]('[%s][recordings][newexten]',_0x39de83[_0x2f97('0x5')]),_0x39de83);utils['info'](util[_0x2f97('0x10')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x39de83[_0x2f97('0x5')],_0x39de83[_0x2f97('0x32')],_0x39de83[_0x2f97('0x33')]));if(_0x39de83[_0x2f97('0x32')][_0x2f97('0x34')]()==_0x2f97('0x35')&&_[_0x2f97('0x36')](_0x39de83[_0x2f97('0x33')][_0x2f97('0x34')](),_0x2f97('0x37'))){var _0x36acd8=_0x39de83[_0x2f97('0x33')]['split']('=');var _0x36a816=_0x36acd8[0x0][_0x2f97('0x38')](_0x36acd8[0x0][_0x2f97('0x39')]('(')+0x1,_0x36acd8[0x0][_0x2f97('0x39')](')'));var _0x35d99c=_0x36acd8[0x1];recordings[_0x39de83['uniqueid']][_0x36a816]=_0x35d99c;}}}catch(_0x8647a3){utils[_0x2f97('0x17')](util['format'](_0x2f97('0x3a'),_0x39de83[_0x2f97('0x5')]),_0x8647a3);}};exports[_0x2f97('0x3b')]=function(_0x35f32a){try{if(!_[_0x2f97('0x19')](recordings[_0x35f32a[_0x2f97('0x5')]])){utils[_0x2f97('0xf')](util['format']('[%s][recordings][queuecallerjoin]',_0x35f32a[_0x2f97('0x5')]),_0x35f32a);utils['info'](util[_0x2f97('0x10')](_0x2f97('0x3c'),_0x35f32a[_0x2f97('0x5')],_0x35f32a['queue']));recordings[_0x35f32a[_0x2f97('0x5')]]['queue']=_0x35f32a[_0x2f97('0x3d')];}}catch(_0x381296){utils[_0x2f97('0x17')](util['format'](_0x2f97('0x3e'),_0x35f32a[_0x2f97('0x5')]),_0x381296);}};exports[_0x2f97('0x3f')]=function(_0x1d6535){try{utils[_0x2f97('0xf')](util[_0x2f97('0x10')](_0x2f97('0x40'),_0x1d6535[_0x2f97('0x5')]),_0x1d6535);utils[_0x2f97('0x3')](util[_0x2f97('0x10')](_0x2f97('0x41'),_0x1d6535[_0x2f97('0x5')],_0x1d6535[_0x2f97('0x42')],_0x1d6535[_0x2f97('0x43')],_0x1d6535[_0x2f97('0x44')],_0x1d6535[_0x2f97('0x45')]));if(recordings[_0x1d6535[_0x2f97('0x46')]]&&transfers[_0x2f97('0xd')][_0x1d6535[_0x2f97('0x46')]]){transfers[_0x2f97('0xd')][_0x1d6535[_0x2f97('0x46')]][_0x2f97('0x47')]=!![];}}catch(_0xd4e001){utils['error'](util[_0x2f97('0x10')]('[%s][recordings][blindtransfer]',_0x1d6535[_0x2f97('0x5')]),_0xd4e001);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 0fdb6e1..ca6951b 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 _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 +var _0xc85f=['transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','error','lodash','./utils','info','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','debug','format','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname'];(function(_0x3d60e4,_0x2a4db3){var _0x5c927d=function(_0x500232){while(--_0x500232){_0x3d60e4['push'](_0x3d60e4['shift']());}};_0x5c927d(++_0x2a4db3);}(_0xc85f,0x16a));var _0xfc85=function(_0xa26a73,_0x321c67){_0xa26a73=_0xa26a73-0x0;var _0x49fd7b=_0xc85f[_0xa26a73];return _0x49fd7b;};'use strict';var _=require(_0xfc85('0x0'));var util=require('util');var utils=require(_0xfc85('0x1'));function writeDB(_0x87a4b4){utils[_0xfc85('0x2')](util['format'](_0xfc85('0x3'),_0x87a4b4[_0xfc85('0x4')]==='attended'?_0x87a4b4[_0xfc85('0x5')]:_0x87a4b4[_0xfc85('0x6')],_0x87a4b4['type']));utils[_0xfc85('0x7')](_0xfc85('0x8'),_0x87a4b4);}exports[_0xfc85('0x9')]={};exports['blindtransfer']=function(_0x49767a){try{utils[_0xfc85('0xa')](util[_0xfc85('0xb')]('[%s][transfers][blindtransfer]',_0x49767a[_0xfc85('0x6')]),_0x49767a);utils[_0xfc85('0x2')](util[_0xfc85('0xb')](_0xfc85('0xc'),_0x49767a[_0xfc85('0x6')],_0x49767a[_0xfc85('0xd')],_0x49767a[_0xfc85('0xe')],_0x49767a['transfereecalleridnum'],_0x49767a[_0xfc85('0xf')]));_0x49767a['type']='blind';exports[_0xfc85('0x9')][_0x49767a[_0xfc85('0x10')]]=_0x49767a;writeDB(_0x49767a);}catch(_0x373a50){utils['error'](util[_0xfc85('0xb')]('[%s][transfers][blindtransfer]',_0x49767a['uniqueid']),_0x373a50);}};exports[_0xfc85('0x11')]=function(_0x507234){try{utils[_0xfc85('0xa')](util['format'](_0xfc85('0x12'),_0x507234[_0xfc85('0x5')]),_0x507234);utils['info'](util[_0xfc85('0xb')](_0xfc85('0x13'),_0x507234[_0xfc85('0x5')],_0x507234[_0xfc85('0x14')],_0x507234[_0xfc85('0x15')],_0x507234[_0xfc85('0x16')],_0x507234[_0xfc85('0x17')]));_0x507234=_['assign'](_0x507234,{'transfererchannel':_0x507234['origtransfererchannel'],'transferercalleridnum':_0x507234[_0xfc85('0x14')],'transferercalleridname':_0x507234[_0xfc85('0x15')],'transfererconnectedlinenum':_0x507234['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x507234[_0xfc85('0x18')],'transfereraccountcode':_0x507234[_0xfc85('0x19')],'transferercontext':_0x507234[_0xfc85('0x1a')],'transfererexten':_0x507234[_0xfc85('0x1b')],'transfererlinkedid':_0x507234[_0xfc85('0x1c')],'context':_0x507234[_0xfc85('0x1d')],'extension':_0x507234[_0xfc85('0x1e')],'type':_0xfc85('0x1f')});if(_[_0xfc85('0x20')](_0x507234[_0xfc85('0x21')])){_0x507234=_[_0xfc85('0x22')](_0x507234,{'transfereechannel':_0x507234[_0xfc85('0x23')],'transfereecalleridnum':_0x507234[_0xfc85('0x16')],'transfereecalleridname':_0x507234[_0xfc85('0x17')],'transfereeconnectedlinenum':_0x507234[_0xfc85('0x24')],'transfereeconnectedlinename':_0x507234[_0xfc85('0x25')],'transfereeaccountcode':_0x507234[_0xfc85('0x26')],'transfereecontext':_0x507234['transfertargetcontext'],'transfereeexten':_0x507234[_0xfc85('0x27')],'transfereelinkedid':_0x507234[_0xfc85('0x28')]});}writeDB(_0x507234);}catch(_0x22a6e8){utils[_0xfc85('0x29')](util[_0xfc85('0xb')](_0xfc85('0x12'),_0x507234['origtransfereruniqueid']),_0x22a6e8);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 42a341b..855ff74 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 _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 +var _0x94ba=['moment','util','client','../../config/logger','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','name','interface','result','length','getUserByInternal','[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]','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise'];(function(_0x3800cb,_0x25bbc6){var _0x326528=function(_0x5b82c4){while(--_0x5b82c4){_0x3800cb['push'](_0x3800cb['shift']());}};_0x326528(++_0x25bbc6);}(_0x94ba,0xbe));var _0xa94b=function(_0x410c9f,_0x1c464a){_0x410c9f=_0x410c9f-0x0;var _0xfc4322=_0x94ba[_0x410c9f];return _0xfc4322;};'use strict';var BPromise=require(_0xa94b('0x0'));var jayson=require(_0xa94b('0x1'));var moment=require(_0xa94b('0x2'));var util=require(_0xa94b('0x3'));var client=jayson[_0xa94b('0x4')]['http']({'port':0x2329});var logger=require(_0xa94b('0x5'))('xdr');exports[_0xa94b('0x6')]=function(_0xd72e72,_0x4c63b5){logger['info'](_0xd72e72,_0x4c63b5?util[_0xa94b('0x7')](_0x4c63b5,{'showHidden':![],'depth':null}):'');};exports[_0xa94b('0x8')]=function(_0x363129,_0x262c09){logger['debug'](_0x363129,_0x262c09?util[_0xa94b('0x7')](_0x262c09,{'showHidden':![],'depth':null}):'');};exports[_0xa94b('0x9')]=function(_0x4b3f86,_0x4d9b9a){logger[_0xa94b('0x9')](_0x4b3f86,_0x4d9b9a?util[_0xa94b('0x7')](_0x4d9b9a,{'showHidden':![],'depth':null}):'');};exports[_0xa94b('0xa')]=function(_0x5233ee,_0x30bdd2){return client[_0xa94b('0xa')](_0x5233ee,{'body':_0x30bdd2})[_0xa94b('0xb')](function(_0x34e4bf){logger[_0xa94b('0x8')](_0xa94b('0xc'),_0x5233ee,_0x34e4bf?util['inspect'](_0x34e4bf,{'showHidden':![],'depth':null}):'');})[_0xa94b('0xd')](function(_0x107c24){logger[_0xa94b('0x9')](_0xa94b('0xc'),_0x5233ee,_0x107c24?util[_0xa94b('0x7')](_0x107c24,{'showHidden':![],'depth':null}):'');});};function getUser(_0xfc303c){return client[_0xa94b('0xa')](_0xa94b('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0xa94b('0xf'),_0xa94b('0x10')],'where':_0xfc303c,'limit':0x1}})['then'](function(_0xea3a9f){logger['debug']('[utils][getUser]\x20where:%s',JSON['stringify'](_0xfc303c),_0xea3a9f?util[_0xa94b('0x7')](_0xea3a9f,{'showHidden':![],'depth':null}):'');return _0xea3a9f[_0xa94b('0x11')][_0xa94b('0x12')]?_0xea3a9f[_0xa94b('0x11')][0x0]:null;});}exports[_0xa94b('0x13')]=function(_0x38e446){return new BPromise(function(_0x37a08d,_0x1b0e14){if(_0x38e446){return getUser({'internal':_0x38e446})[_0xa94b('0xb')](function(_0x32406e){logger[_0xa94b('0x6')](_0xa94b('0x14'),_0x38e446,_0x32406e?_0xa94b('0x15'):_0xa94b('0x16'));return _0x37a08d(_0x32406e);})[_0xa94b('0xd')](function(_0x103e03){logger[_0xa94b('0x9')](_0xa94b('0x17'),_0x103e03?util[_0xa94b('0x7')](_0x103e03,{'showHidden':![],'depth':null}):'');return _0x37a08d(null);});}return _0x37a08d(null);});};exports[_0xa94b('0x18')]=function(_0x394ac9){return new BPromise(function(_0x55baa8,_0x460818){if(_0x394ac9){return getUser({'interface':_0x394ac9})[_0xa94b('0xb')](function(_0x2740b4){logger[_0xa94b('0x6')](_0xa94b('0x19'),_0x394ac9,_0x2740b4?_0xa94b('0x15'):_0xa94b('0x16'));return _0x55baa8(_0x2740b4);})['catch'](function(_0x426ded){logger[_0xa94b('0x9')](_0xa94b('0x1a'),_0x426ded?util[_0xa94b('0x7')](_0x426ded,{'showHidden':![],'depth':null}):'');return _0x55baa8(null);});}return _0x55baa8(null);});};exports[_0xa94b('0x1b')]=function(_0x1d2869){return new BPromise(function(_0x6aa3e1,_0x3750dd){if(_0x1d2869){return getUser({'name':_0x1d2869})[_0xa94b('0xb')](function(_0x4bd212){logger['info'](_0xa94b('0x1c'),_0x1d2869,_0x4bd212?_0xa94b('0x15'):_0xa94b('0x16'));return _0x6aa3e1(_0x4bd212);})[_0xa94b('0xd')](function(_0x242a7e){logger[_0xa94b('0x9')](_0xa94b('0x1d'),_0x242a7e?util['inspect'](_0x242a7e,{'showHidden':![],'depth':null}):'');return _0x6aa3e1(null);});}return _0x6aa3e1(null);});};exports['getVoiceQueueByName']=function(_0x1508e3){return new BPromise(function(_0x5e3579,_0x2ade99){if(_0x1508e3){return client[_0xa94b('0xa')](_0xa94b('0x1e'),{'options':{'raw':!![],'attributes':['id',_0xa94b('0xf'),_0xa94b('0x1f'),'acw',_0xa94b('0x20')],'where':{'name':_0x1508e3},'limit':0x1}})[_0xa94b('0xb')](function(_0x5783cf){logger[_0xa94b('0x8')](_0xa94b('0x21'),_0x1508e3,_0x5783cf?util[_0xa94b('0x7')](_0x5783cf,{'showHidden':![],'depth':null}):'');logger[_0xa94b('0x6')](_0xa94b('0x22'),_0x1508e3,_0x5783cf?_0xa94b('0x15'):_0xa94b('0x16'));return _0x5e3579(_0x5783cf[_0xa94b('0x11')][_0xa94b('0x12')]?_0x5783cf[_0xa94b('0x11')][0x0]:null);})[_0xa94b('0xd')](function(_0x1d6df6){logger[_0xa94b('0x9')]('[utils][getVoiceQueueByName]',_0x1d6df6?util[_0xa94b('0x7')](_0x1d6df6,{'showHidden':![],'depth':null}):'');return _0x5e3579(null);});}return _0x5e3579(null);});};exports[_0xa94b('0x23')]=function(_0x32a6b4,_0x2f5ed1){return moment(_0x32a6b4)[_0xa94b('0x24')](_0x2f5ed1,_0xa94b('0x25'))[_0xa94b('0x26')](_0xa94b('0x27'));};exports[_0xa94b('0x28')]=function(_0x32ad3b,_0x274d0a){return moment(_0x32ad3b)[_0xa94b('0x29')](_0x274d0a,_0xa94b('0x25'))[_0xa94b('0x26')](_0xa94b('0x27'));};exports[_0xa94b('0x2a')]=function(_0x473727,_0x4d380f){return moment(_0x473727)[_0xa94b('0x2b')](moment(_0x4d380f),_0xa94b('0x25'));};exports[_0xa94b('0x2c')]=function(_0x299ab,_0x557214){return parseInt(_0x299ab,0xa)+parseInt(_0x557214,0xa);};exports[_0xa94b('0x2d')]=function(){return moment()[_0xa94b('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa94b('0x2e')]=function(_0x3f7451,_0x5bac41){if(_0x5bac41){return moment(_0x3f7451)[_0xa94b('0x2e')](_0x5bac41);}return!![];};exports[_0xa94b('0x2f')]=function(_0x2be830,_0x3fc5a7){if(_0x3fc5a7){return moment(_0x2be830)[_0xa94b('0x2f')](_0x3fc5a7);}else if(_0x2be830){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 e0e01d7..388727b 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 _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 +var _0xf626=['/var','xcally','role','name','ensureDir','client','catch','log','user','then','no-user','data','timestamp','api','auth','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','x-forwarded-for','connection','remoteAddress','statusCode','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','headers','url','agent_name','test','setupLoggers','fs-extra','path','util','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','join'];(function(_0x23cfc8,_0x2f8716){var _0x137f73=function(_0xcab6fe){while(--_0xcab6fe){_0x23cfc8['push'](_0x23cfc8['shift']());}};_0x137f73(++_0x2f8716);}(_0xf626,0x82));var _0x6f62=function(_0xe9ae4d,_0x8e268e){_0xe9ae4d=_0xe9ae4d-0x0;var _0x3a11da=_0xf626[_0xe9ae4d];return _0x3a11da;};var fs=require(_0x6f62('0x0'));var _=require('lodash');var ewinston=require('express-winston');var path=require(_0x6f62('0x1'));var util=require(_0x6f62('0x2'));var fileLogger=require(_0x6f62('0x3'))['fileLogger'];var safeTemplate=require(_0x6f62('0x4'))[_0x6f62('0x5')];var maskSensitiveData=require(_0x6f62('0x6'))['maskSensitiveData'];function ClientSideLogger(){function _0x528c33(_0x10cd77){var _0x32f93e=path[_0x6f62('0x7')](_0x6f62('0x8'),'log',_0x6f62('0x9'));var _0x3c322c=path['join']('client',_0x10cd77[_0x6f62('0xa')]+'-'+_0x10cd77[_0x6f62('0xb')]);return fs[_0x6f62('0xc')](path[_0x6f62('0x7')](_0x32f93e,_0x3c322c))['then'](function(){var _0x515dbd=fileLogger(_0x6f62('0xd'),path[_0x6f62('0x7')](_0x32f93e,_0x3c322c));return _0x515dbd;})[_0x6f62('0xe')](function(_0x329b9d){throw _0x329b9d;});}this[_0x6f62('0xf')]=function(_0x438eee,_0x3d29ec,_0x43629f,_0xf5f133){return _0x528c33(_0x438eee[_0x6f62('0x10')])[_0x6f62('0x11')](function(_0x3fb2ee){var _0x3c7744=_0x3fb2ee[_0x3d29ec];return _0x3c7744;})[_0x6f62('0x11')](function(_0x1d28aa){var _0x1c1de6=_0x438eee['user']?_0x438eee[_0x6f62('0x10')]['id']:_0x6f62('0x12');var _0x556602=_0xf5f133[_0x6f62('0x13')];var _0x1f3b6d=_0xf5f133[_0x6f62('0x14')];var _0x1455c8=new Date(Number(_0x1f3b6d));return _0x1d28aa(_0x1c1de6,_0x1455c8,_0x43629f,_0x556602);})[_0x6f62('0xe')](function(_0x549dae){fileLogger(_0x6f62('0xd'))['error'](_0x549dae);});};}function setupLoggers(_0x4b6727){return new Promise(function(_0x5c04b3){var _0x2b7af6=new ClientSideLogger();var _0x28cba3=fileLogger(_0x6f62('0x15'));var _0x4b8234=fileLogger(_0x6f62('0x16'));_0x4b6727['set'](_0x6f62('0x17'),_0x2b7af6);_0x4b6727[_0x6f62('0x18')](ewinston[_0x6f62('0x19')]({'winstonInstance':_0x28cba3,'meta':![],'statusLevels':!![],'msg':function(_0x60fa6,_0x2f4b2c){var _0x24e036=_0x6f62('0x1a');if(!_[_0x6f62('0x1b')](_0x60fa6[_0x6f62('0x1c')])){_0x24e036+=_0x6f62('0x1d');var _0x4e067f=_0x60fa6['body'];maskSensitiveData(_0x4e067f);}return safeTemplate(util[_0x6f62('0x1e')](_0x24e036,_0x60fa6['method'],_0x60fa6['headers'][_0x6f62('0x1f')]?_0x60fa6['headers'][_0x6f62('0x1f')]:_0x60fa6[_0x6f62('0x20')][_0x6f62('0x21')]||_0x60fa6['ip'],_0x60fa6['url'],_0x2f4b2c[_0x6f62('0x22')],_0x2f4b2c[_0x6f62('0x23')],_0x60fa6[_0x6f62('0x10')]?_0x60fa6[_0x6f62('0x10')]['id']:null,_0x60fa6[_0x6f62('0x10')]?_0x60fa6[_0x6f62('0x10')][_0x6f62('0xb')]:null,_0x60fa6['user']?_0x60fa6[_0x6f62('0x10')][_0x6f62('0xa')]:null,_0x4e067f?util[_0x6f62('0x24')](_0x4e067f,![],null):''));}}));_0x4b6727[_0x6f62('0x18')](ewinston[_0x6f62('0x19')]({'winstonInstance':_0x4b8234,'meta':![],'statusLevels':!![],'msg':function(_0x2955d5,_0xc00499){var _0xb85ace=_0x6f62('0x25');if(_0x2955d5[_0x6f62('0x1c')]&&_0x2955d5[_0x6f62('0x1c')][_0x6f62('0x26')]&&_0x2955d5[_0x6f62('0x1c')]['agent_id']){_0xb85ace=_0x6f62('0x27');}return util[_0x6f62('0x1e')](_0xb85ace,_0x2955d5[_0x6f62('0x28')],_0x2955d5[_0x6f62('0x29')]['x-forwarded-for']?_0x2955d5[_0x6f62('0x29')][_0x6f62('0x1f')]:_0x2955d5[_0x6f62('0x20')][_0x6f62('0x21')]||_0x2955d5['ip'],_0x2955d5[_0x6f62('0x2a')],_0xc00499[_0x6f62('0x22')],_0xc00499[_0x6f62('0x23')],_0x2955d5[_0x6f62('0x10')]?_0x2955d5['user']['id']:null,_0x2955d5[_0x6f62('0x10')]?_0x2955d5[_0x6f62('0x10')][_0x6f62('0xb')]:null,_0x2955d5[_0x6f62('0x10')]?_0x2955d5['user']['role']:null,_0x2955d5[_0x6f62('0x1c')]&&_0x2955d5['body'][_0x6f62('0x26')]?_0x2955d5[_0x6f62('0x1c')][_0x6f62('0x26')]:'other',_0x2955d5[_0x6f62('0x1c')]&&_0x2955d5['body']['agent_id']?_0x2955d5[_0x6f62('0x1c')]['agent_id']:'',_0x2955d5[_0x6f62('0x1c')]&&_0x2955d5[_0x6f62('0x1c')]['agent_name']?_0x2955d5[_0x6f62('0x1c')][_0x6f62('0x2b')]:'');},'ignoreRoute':function(_0x34214b){var _0x4b7860=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4b7860[_0x6f62('0x2c')](_0x34214b[_0x6f62('0x2a')]);}}));return _0x5c04b3();});}exports[_0x6f62('0x2d')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 21471fd..00ecf1b 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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 +var _0x54f5=['minutes','startOf','day','endOf','isBetween','timeCompare','format','includes','date','daysInMonth','max','min','MMM','guess','isMoment','length','iftime','lodash','moment-timezone','map','source','join','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','circularMonthInterval','clone','hours'];(function(_0x4147fc,_0x535c6d){var _0x5295fc=function(_0x131a74){while(--_0x131a74){_0x4147fc['push'](_0x4147fc['shift']());}};_0x5295fc(++_0x535c6d);}(_0x54f5,0x1e5));var _0x554f=function(_0x1ba43c,_0x5bd2e8){_0x1ba43c=_0x1ba43c-0x0;var _0x2f60eb=_0x54f5[_0x1ba43c];return _0x2f60eb;};var _=require(_0x554f('0x0'));var moment=require(_0x554f('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][_0x554f('0x2')](function(_0x3b133e){return _0x3b133e[_0x554f('0x3')];})[_0x554f('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0xa5d48b){if(!_0xa5d48b[_0x554f('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x47ef0f){var _0x54bd64=_0x47ef0f[_0x554f('0x6')](':')['map'](function(_0x1a8d16){return parseInt(_0x1a8d16,0xa);});var _0x6e9dfb=_0x54bd64[0x0];var _0x33d43b=_0x54bd64[0x1];if(_0x6e9dfb<0x0||_0x6e9dfb>0x17||_0x33d43b<0x0||_0x33d43b>0x3b){throw new Error(EINVALID_DATE);}return[_0x6e9dfb,_0x33d43b];}function circularDoWInterval(_0x53015e,_0x5c4057){if(_0x53015e===_0x5c4057){return[_0x53015e];}else{var _0x35e211=moment[_0x554f('0x7')]();moment[_0x554f('0x7')]('en');var _0x40fc15=moment[_0x554f('0x8')]()[_0x554f('0x2')](function(_0x1e6bd8){return _0x1e6bd8[_0x554f('0x9')]();});moment[_0x554f('0x7')](_0x35e211);var _0x7d6eb4=_0x40fc15['indexOf'](_0x53015e);var _0x6afb81=_0x40fc15[_0x554f('0xa')](_0x5c4057);if(_0x6afb81>_0x7d6eb4){return _0x40fc15['slice'](_0x7d6eb4,_0x6afb81+0x1);}else{var _0x54cbce=_0x40fc15['slice'](0x0,_0x6afb81+0x1);var _0x3b45ba=_0x40fc15[_0x554f('0xb')](_0x7d6eb4);return _0x3b45ba[_0x554f('0xc')](_0x54cbce);}}}module[_0x554f('0xd')][_0x554f('0xe')]=circularDoWInterval;function circularMonthInterval(_0x1a5e1d,_0x1e3c42){if(_0x1a5e1d===_0x1e3c42){return[_0x1a5e1d];}else{var _0x4603c0=moment['locale']();moment[_0x554f('0x7')]('en');var _0x230136=moment[_0x554f('0xf')]()['map'](function(_0x2dc3e2){return _0x2dc3e2[_0x554f('0x9')]();});moment[_0x554f('0x7')](_0x4603c0);var _0x398524=_0x230136['indexOf'](_0x1a5e1d);var _0x22064b=_0x230136['indexOf'](_0x1e3c42);if(_0x22064b>_0x398524){return _0x230136[_0x554f('0xb')](_0x398524,_0x22064b+0x1);}else{var _0x3150bf=_0x230136[_0x554f('0xb')](0x0,_0x22064b+0x1);var _0x2804c9=_0x230136[_0x554f('0xb')](_0x398524);return _0x2804c9[_0x554f('0xc')](_0x3150bf);}}}module['exports'][_0x554f('0x10')]=circularMonthInterval;function parseDom(_0x2742f8){var _0x20ba7e=parseInt(_0x2742f8,0xa);if(_0x20ba7e<0x1||_0x20ba7e>0x1f){throw new Error(EINVALID_DATE);}return _0x20ba7e;}function timeCompare(_0x5f4604,_0x32c9e9,_0x48f499){var _0x2e0a86=_0x5f4604[_0x554f('0x11')]();var _0x2f5fee=extractTime(_0x32c9e9);var _0x4d7360=_0x2f5fee[0x0];var _0x588be6=_0x2f5fee[0x1];var _0x43c6db=_0x5f4604[_0x554f('0x11')]()[_0x554f('0x12')](_0x4d7360)[_0x554f('0x13')](_0x588be6);throwIfDateNotValid(_0x43c6db);var _0x1603b2=extractTime(_0x48f499);var _0x510bcf=_0x1603b2[0x0];var _0x483823=_0x1603b2[0x1];var _0x28780d=_0x5f4604[_0x554f('0x11')]()['hours'](_0x510bcf)['minutes'](_0x483823);throwIfDateNotValid(_0x28780d);if(_0x28780d['isBefore'](_0x43c6db)){var _0x53b023=_0x2e0a86['clone']()[_0x554f('0x14')](_0x554f('0x15'));var _0x21ba93=_0x2e0a86[_0x554f('0x11')]()[_0x554f('0x16')]('day');return _0x2e0a86[_0x554f('0x17')](_0x43c6db,_0x21ba93,undefined,'[]')||_0x2e0a86['isBetween'](_0x53b023,_0x28780d,undefined,'[]');}else{return _0x2e0a86[_0x554f('0x17')](_0x43c6db,_0x28780d,undefined,'[]');}}module['exports'][_0x554f('0x18')]=timeCompare;function dowCompare(_0x2a6cbd,_0x51280e,_0x13655d){var _0x1b8a00=_0x2a6cbd['locale']('en')[_0x554f('0x19')]('ddd')[_0x554f('0x9')]();return circularDoWInterval(_0x51280e,_0x13655d)[_0x554f('0x1a')](_0x1b8a00);}module['exports']['dowCompare']=dowCompare;function domCompare(_0x106383,_0x73d24,_0x519d18){var _0x236462=_0x106383[_0x554f('0x1b')]();if(_0x73d24===_0x519d18){return _0x236462===_0x73d24;}else{var _0x924ba=_0x106383[_0x554f('0x1c')]();var _0x109fa=_0x73d24<_0x519d18;let _0x507b61=![];var _0x3c1b8d=0x0;var _0x3e48ce=0x0;if(_0x109fa){_0x3c1b8d=Math[_0x554f('0x1d')](0x1,_0x73d24);_0x3e48ce=Math[_0x554f('0x1e')](_0x519d18,_0x924ba);_0x507b61=_0x236462>=_0x3c1b8d&&_0x236462<=_0x3e48ce;}else{_0x3c1b8d=Math['min'](_0x73d24,_0x924ba);_0x3e48ce=Math[_0x554f('0x1d')](0x1,_0x519d18);_0x507b61=_0x236462>=_0x3c1b8d||_0x236462<=_0x3e48ce;}return _0x507b61;}}module['exports']['domCompare']=domCompare;function monthCompare(_0x35996d,_0xcf9c8b,_0x146bba){var _0xd4ddf7=_0x35996d['locale']('en')[_0x554f('0x19')](_0x554f('0x1f'))[_0x554f('0x9')]();return circularMonthInterval(_0xcf9c8b,_0x146bba)[_0x554f('0x1a')](_0xd4ddf7);}module['exports']['monthCompare']=monthCompare;function iftime(_0x5f07d5,_0x4c5921=moment['tz'][_0x554f('0x20')](),_0x59cf26=moment()){if(!validateRx['test'](_0x5f07d5)){throw new Error(EINVALID_STRING);}else{var _0xbdab05=(moment[_0x554f('0x21')](_0x59cf26)?_0x59cf26['clone']():moment(_0x59cf26))['tz'](_0x4c5921)[_0x554f('0x7')]('en');throwIfDateNotValid(_0xbdab05);var _0x26187a=_0x5f07d5[_0x554f('0x6')](',');var _0x4c8058=_0x26187a[0x0];var _0x4abf2d=_0x26187a[0x1];var _0x3bf0aa=_0x26187a[0x2];var _0x1debf6=_0x26187a[0x3];let _0x3b9496=!![];if(_0x4c8058!=='*'){var _0x34ce9f=_0x4c8058[_0x554f('0x6')]('-');var _0x40daee=_['padStart'](_0x34ce9f[0x0],0x5,'0');var _0x513280=_0x34ce9f['length']===0x2?_['padStart'](_0x34ce9f[0x1],0x5,'0'):_0x40daee;_0x3b9496=timeCompare(_0xbdab05,_0x40daee,_0x513280);}let _0x2ca6a3=!![];if(_0x4abf2d!=='*'){var _0x5b1f4c=_0x4abf2d['split']('-');var _0xf23d7f=_0x5b1f4c[0x0];var _0x54dec0=_0x5b1f4c[_0x554f('0x22')]===0x2?_0x5b1f4c[0x1]:_0xf23d7f;_0x2ca6a3=dowCompare(_0xbdab05,_0xf23d7f,_0x54dec0);}let _0x2ad01a=!![];if(_0x3bf0aa!=='*'){var _0x24ef90=_0x3bf0aa['split']('-');var _0x123b0d=parseDom(_0x24ef90[0x0]);var _0x473dad=_0x24ef90[_0x554f('0x22')]===0x2?parseDom(_0x24ef90[0x1]):_0x123b0d;_0x2ad01a=domCompare(_0xbdab05,_0x123b0d,_0x473dad);}let _0x3b8ba4=!![];if(_0x1debf6!=='*'){var _0x4cb4ad=_0x1debf6[_0x554f('0x6')]('-');var _0x35ec11=_0x4cb4ad[0x0];var _0x286018=_0x4cb4ad[_0x554f('0x22')]===0x2?_0x4cb4ad[0x1]:_0x4cb4ad[0x0];_0x3b8ba4=monthCompare(_0xbdab05,_0x35ec11,_0x286018);}return _0x3b9496&&_0x2ca6a3&&_0x2ad01a&&_0x3b8ba4;}}module[_0x554f('0xd')][_0x554f('0x23')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index e6ce46e..48b900b 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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 +var _0xaded=['%s-%s.log','message','replace','{{{','}}}','format','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','Logger','transports','Console','File','error','warn','fileLogger','path','util','winston','../config/environment','debugLevel','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20cyan','addColors','join'];(function(_0x52defa,_0x492e7f){var _0x4f95d6=function(_0x482de6){while(--_0x482de6){_0x52defa['push'](_0x52defa['shift']());}};_0x4f95d6(++_0x492e7f);}(_0xaded,0x195));var _0xdade=function(_0x5cedf6,_0x4d9400){_0x5cedf6=_0x5cedf6-0x0;var _0x8ccd35=_0xaded[_0x5cedf6];return _0x8ccd35;};'use strict';var path=require(_0xdade('0x0'));var util=require(_0xdade('0x1'));var moment=require('moment');var winston=require(_0xdade('0x2'));var config=require(_0xdade('0x3'));var debugLevel=config[_0xdade('0x4')]?config['debugLevel']['toLowerCase']():_0xdade('0x5');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':_0xdade('0x6'),'error':_0xdade('0x7'),'warn':_0xdade('0x8'),'info':_0xdade('0x9'),'print':_0xdade('0xa'),'success':_0xdade('0xb'),'http':'gray','verbose':'bold\x20magenta','debug':'bold\x20blue','silly':_0xdade('0xc')};winston[_0xdade('0xd')](XC_LOG_COLORS);function getLogFileName(_0x36624f,_0x1e1b81,_0x493576){var _0x43e2a5=_0x36624f||'/var/log/xcally';return path[_0xdade('0xe')](_0x43e2a5,util['format'](_0xdade('0xf'),_0x1e1b81,_0x493576));}function formatter(_0x510889,_0x32557d){_0x32557d[_0xdade('0x10')]=_0x32557d[_0xdade('0x10')][_0xdade('0x11')](/@@{/g,_0xdade('0x12'))[_0xdade('0x11')](/}@@/g,_0xdade('0x13'))[_0xdade('0x11')](/@{/g,'{{')[_0xdade('0x11')](/}@/g,'}}');return util[_0xdade('0x14')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xdade('0x14')](_0xdade('0x15')),_0x32557d['level'][_0xdade('0x16')](),_0x510889,_0x32557d[_0xdade('0x10')]);}function fileFormat(_0x2d9c52,_0x5ece58){_0x5ece58[_0xdade('0x10')]=_0x5ece58['message']['replace'](/@@{/g,_0xdade('0x12'))['replace'](/}@@/g,_0xdade('0x13'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x3aecf1=_0x5ece58[_0xdade('0x17')]&&Object['keys'](_0x5ece58['meta'])[_0xdade('0x18')]?'\x0a\x09'+JSON[_0xdade('0x19')](_0x5ece58[_0xdade('0x17')]):'';return util[_0xdade('0x14')](_0xdade('0x1a'),moment()['format'](_0xdade('0x15')),_0x5ece58[_0xdade('0x1b')][_0xdade('0x16')](),_0x2d9c52,_0x5ece58['message'],_0x3aecf1);}function consoleLogger(){var _0x2083bc=new winston[(_0xdade('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xdade('0x1d'))][(_0xdade('0x1e'))]({'level':'warn','json':![],'formatter':function(_0x46dceb){return formatter('',_0x46dceb);}})]});return _0x2083bc;}function fileLogger(_0x3496f7,_0x17c66c){var _0x1d935b=new winston[(_0xdade('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xdade('0x1d'))][(_0xdade('0x1f'))]({'name':util[_0xdade('0x14')]('%s-%s',_0x3496f7,_0xdade('0x20')),'filename':getLogFileName(_0x17c66c,_0x3496f7,_0xdade('0x20')),'level':_0xdade('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x333b9c){return fileFormat(_0x3496f7,_0x333b9c);}}),new winston['transports'][(_0xdade('0x1f'))]({'name':util[_0xdade('0x14')]('%s-%s',_0x3496f7,debugLevel),'filename':getLogFileName(_0x17c66c,_0x3496f7,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xcd87ab){return fileFormat(_0x3496f7,_0xcd87ab);}}),new winston[(_0xdade('0x1d'))][(_0xdade('0x1e'))]({'level':_0xdade('0x21'),'json':![],'formatter':function(_0x108af6){return fileFormat(_0x3496f7,_0x108af6);}})]});return _0x1d935b;}exports['consoleLogger']=consoleLogger;exports[_0xdade('0x22')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 9864a44..30d12f9 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 _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 +var _0x14a0=['membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','localstationid','dsn','secret','registry','isArray','length','isPlainObject','isString','replace','@@{','}@@','includes','exports','maskSensitiveData','username','password','newPassword','apiKey','firstName','lastName','street','fax','email','clientId','code','accessKey','tenantId','accessToken'];(function(_0x18697f,_0x1229a2){var _0x2cd42d=function(_0xf18867){while(--_0xf18867){_0x18697f['push'](_0x18697f['shift']());}};_0x2cd42d(++_0x1229a2);}(_0x14a0,0x8e));var _0x014a=function(_0x4e4b8d,_0x1d9168){_0x4e4b8d=_0x4e4b8d-0x0;var _0x366450=_0x14a0[_0x4e4b8d];return _0x366450;};var _=require('lodash');var sensitiveFields=[_0x014a('0x0'),_0x014a('0x1'),_0x014a('0x2'),_0x014a('0x3'),_0x014a('0x4'),_0x014a('0x5'),_0x014a('0x6'),'phone','mobile',_0x014a('0x7'),_0x014a('0x8'),_0x014a('0x9'),'clientSecret','securityToken',_0x014a('0xa'),_0x014a('0xb'),_0x014a('0xc'),'token','channelSecret',_0x014a('0xd'),'accessTokenSecret','authToken','consumerKey','consumerSecret',_0x014a('0xe'),'calleridname',_0x014a('0xf'),_0x014a('0x10'),'vidaooApiKey',_0x014a('0x11'),_0x014a('0x12'),_0x014a('0x13'),_0x014a('0x14'),_0x014a('0x15'),_0x014a('0x16'),_0x014a('0x17'),_0x014a('0x18'),_0x014a('0x19'),_0x014a('0x1a'),_0x014a('0x1b'),_0x014a('0x1c'),'oldPassword'];function maskSensitiveData(_0x130d13){const _0x3cf92f=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x130d13)){for(const _0x3a836f in _0x130d13){if(_[_0x014a('0x1d')](_0x130d13[_0x3a836f])){for(let _0x59a4ea=0x0;_0x59a4ea<_0x130d13[_0x3a836f][_0x014a('0x1e')];_0x59a4ea++){maskSensitiveData(_0x130d13[_0x3a836f][_0x59a4ea]);}}else if(_[_0x014a('0x1f')](_0x130d13[_0x3a836f])){maskSensitiveData(_0x130d13[_0x3a836f]);}else if(_[_0x014a('0x20')](_0x130d13[_0x3a836f])){_0x130d13[_0x3a836f]=_0x130d13[_0x3a836f][_0x014a('0x21')](/{{{/g,_0x014a('0x22'))[_0x014a('0x21')](/}}}/g,_0x014a('0x23'))[_0x014a('0x21')](/{{/g,'@{')[_0x014a('0x21')](/}}/g,'}@');if(_[_0x014a('0x24')](sensitiveFields,_0x3a836f)){_0x130d13[_0x3a836f]=_0x130d13[_0x3a836f][_0x014a('0x21')](_0x3cf92f,'*');}}}}}module[_0x014a('0x25')][_0x014a('0x26')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index c4c1655..1661762 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 _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 +var _0xe605=['isArray','map','isPlainObject','keys','reduce','exports','lodash','\x20}\x20}','string','replace'];(function(_0x578fdc,_0x184671){var _0x3366d2=function(_0x2335d4){while(--_0x2335d4){_0x578fdc['push'](_0x578fdc['shift']());}};_0x3366d2(++_0x184671);}(_0xe605,0x92));var _0x5e60=function(_0x3fc5d9,_0x46857a){_0x3fc5d9=_0x3fc5d9-0x0;var _0x20f23d=_0xe605[_0x3fc5d9];return _0x20f23d;};var _=require(_0x5e60('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x455628){return _0x455628==='{{'?'{\x20{\x20':_0x5e60('0x1');}function safeTemplate(_0x455efd){var _0x342132=_0x455efd;if(typeof _0x455efd===_0x5e60('0x2')){_0x342132=_0x455efd[_0x5e60('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x5e60('0x4')](_0x455efd)){_0x342132=_0x455efd[_0x5e60('0x5')](function(_0x30d8fb){return safeTemplate(_0x30d8fb);});}else if(_[_0x5e60('0x6')](_0x455efd)){_0x342132=Object[_0x5e60('0x7')](_0x455efd)[_0x5e60('0x8')](function(_0x168a14,_0x4e3501){_0x168a14[_0x4e3501]=safeTemplate(_0x455efd[_0x4e3501]);return _0x168a14;},{});}return _0x342132;}module[_0x5e60('0x9')]['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 af1753b..7e6b21a 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 _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 +var _0x4336=['server/app.json','apps','name','motion2','env','NODE_PATH','string','pathExists','then','readJSON','updated','Updating\x20app.json','writeJSON','exports','fs-extra','../config/environment','root','resolve'];(function(_0x5ede1a,_0x51e4d0){var _0x9b0761=function(_0x3cf50b){while(--_0x3cf50b){_0x5ede1a['push'](_0x5ede1a['shift']());}};_0x9b0761(++_0x51e4d0);}(_0x4336,0x140));var _0x6433=function(_0x1d98db,_0x571a42){_0x1d98db=_0x1d98db-0x0;var _0x223203=_0x4336[_0x1d98db];return _0x223203;};var fs=require(_0x6433('0x0'));var path=require('path');var config=require(_0x6433('0x1'));var root=config[_0x6433('0x2')];var APP_JSON_PATH=path[_0x6433('0x3')](root,_0x6433('0x4'));var NODEPATH=path[_0x6433('0x3')](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x1044bb){let _0x4e9857=![];if(Array['isArray'](_0x1044bb[_0x6433('0x5')])){var _0xd5fd8a=_0x1044bb[_0x6433('0x5')]['findIndex'](function(_0xa8bc07){return _0xa8bc07[_0x6433('0x6')]===_0x6433('0x7');});if(_0xd5fd8a>-0x1){var _0x509238=_0x1044bb[_0x6433('0x5')][_0xd5fd8a];if(typeof _0x509238[_0x6433('0x8')][_0x6433('0x9')]!==_0x6433('0xa')){_0x509238[_0x6433('0x8')]['NODE_PATH']=NODEPATH;_0x4e9857=!![];}}return{'appConfig':_0x1044bb,'updated':_0x4e9857};}}function updateAppConfig(_0x27b3ef){return fs[_0x6433('0xb')](APP_JSON_PATH)[_0x6433('0xc')](function(_0x42e295){if(_0x42e295){return fs[_0x6433('0xd')](APP_JSON_PATH)['then'](function(_0x3ecd7b){var _0xefcca3=setLegacyLibsNodeEnvPath(_0x3ecd7b);if(_0xefcca3[_0x6433('0xe')]){_0x27b3ef['info'](_0x6433('0xf'));return fs[_0x6433('0x10')](APP_JSON_PATH,_0x3ecd7b,{'spaces':0x2});}else{return Promise[_0x6433('0x3')]();}});}else{return Promise[_0x6433('0x3')]();}});}module[_0x6433('0x11')]=updateAppConfig; \ No newline at end of file